Skip to content

[sync] re-sync type-parser constants and move into a JSON file #462

Closed

Description

@ovflowd

The https://github.com/nodejs/node/blob/main/tools/doc/type-parser.mjs got updated once again. I also see that its structure is now different from what we have here

I also propose that both

Become JSON files for easier maintenance, these can be easily placed somewhere else (more to the root of the doc-kit) we should also have docs on how to contribute on these and other sort of constants or files that it is expected for Node.js core collaborators to make changes when making changes to the Source Docs.

Activity

  1. added theissue type on Oct 12, 2025
  2. avivkeller commented on Oct 12, 2025

    @avivkeller
    Member

    I'm also not opposed to this existing in nodejs/node/doc/api/type_map.json or something, fwiw (Just throwing this out there)

  3. avivkeller commented on Oct 12, 2025

    @avivkeller
    Member

    cc @nodejs/collaborators What format is easiest for you?

  4. ovflowd commented on Oct 12, 2025

    @ovflowd
    MemberAuthor

    I'm fine it living on doc-kit, but also fine it living inside the doc folder on nodejs/node or somewhere else but as a JSON file that it is an actual mapping. Being on nodejs/node might make it easier for collaborators tho.

  5. panva commented on Oct 12, 2025

    @panva
    Member

    It would be an unacceptable hurdle to have to make new mappings in a different repo than the one you're updating docs in if these mappings are required for successful doc generation. To that end, if doc-kit needs to use the mapping it needs to pull it, much like the doc source markdowns, from nodejs/node source.

  6. ovflowd commented on Oct 12, 2025

    @ovflowd
    MemberAuthor

    Agreed. I believe we should tackle this as a P0 before we get doc-kit merged. The doc-kit PR on nodejs/node should include said change. I do believe it should be a JSON file on /doc/ (and not a JavaScript on tool/docs as that folder will cease to exist afaik-ish, or if it doesn't cease to exist a JSON file there also makes sense as it is something doc-kit can consume)

  7. ovflowd commented on Oct 12, 2025

    @ovflowd
    MemberAuthor
  8. avivkeller commented on Oct 12, 2025

    @avivkeller
    Member

    I think we should (for now), expect a JSON, and fallback to the constant types, and once that's merged, require JSON

  9. avivkeller commented on Oct 12, 2025

    @avivkeller
    Member

    The types on line 299 won't change that often, and they are unrelated to core, but more the ECMA spec, so IMO we should make the JSON of just:

    Details
    {
      "AbortController": "globals.html#class-abortcontroller",
      "AbortSignal": "globals.html#class-abortsignal",
      "Algorithm": "webcrypto.html#class-algorithm",
      "AlgorithmIdentifier": "webcrypto.html#class-algorithmidentifier",
      "AsyncHook": "async_hooks.html#async_hookscreatehookcallbacks",
      "AsyncLocalStorage": "async_context.html#class-asynclocalstorage",
      "AsyncResource": "async_hooks.html#class-asyncresource",
      "AesCbcParams": "webcrypto.html#class-aescbcparams",
      "AesCtrParams": "webcrypto.html#class-aesctrparams",
      "AesGcmParams": "webcrypto.html#class-aesgcmparams",
      "AesKeyAlgorithm": "webcrypto.html#class-aeskeyalgorithm",
      "AesKeyGenParams": "webcrypto.html#class-aeskeygenparams",
      "AesDerivedKeyParams": "webcrypto.html#class-aesderivedkeyparams",
      "Blob": "buffer.html#class-blob",
      "BroadcastChannel": "worker_threads.html#class-broadcastchannel-extends-eventtarget",
      "Buffer": "buffer.html#class-buffer",
      "ByteLengthQueuingStrategy": "webstreams.html#class-bytelengthqueuingstrategy",
      "Channel": "diagnostics_channel.html#class-channel",
      "ChildProcess": "child_process.html#class-childprocess",
      "Cipher": "crypto.html#class-cipher",
      "Cipheriv": "crypto.html#class-cipheriv",
      "Decipheriv": "crypto.html#class-decipheriv",
      "ClientHttp2Session": "http2.html#class-clienthttp2session",
      "ClientHttp2Stream": "http2.html#class-clienthttp2stream",
      "CountQueuingStrategy": "webstreams.html#class-countqueuingstrategy",
      "Crypto": "webcrypto.html#class-crypto",
      "CryptoKey": "webcrypto.html#class-cryptokey",
      "CryptoKeyPair": "webcrypto.html#class-cryptokeypair",
      "CustomEvent": "events.html#class-customevent",
      "Decipher": "crypto.html#class-decipher",
      "DiffieHellman": "crypto.html#class-diffiehellman",
      "DiffieHellmanGroup": "crypto.html#class-diffiehellmangroup",
      "Domain": "domain.html#class-domain",
      "Duplex": "stream.html#class-streamduplex",
      "ECDH": "crypto.html#class-ecdh",
      "EcdhKeyDeriveParams": "webcrypto.html#class-ecdhkeyderiveparams",
      "EcdsaParams": "webcrypto.html#class-ecdsaparams",
      "EcKeyAlgorithm": "webcrypto.html#class-eckeyalgorithm",
      "EcKeyGenParams": "webcrypto.html#class-eckeygenparams",
      "EcKeyImportParams": "webcrypto.html#class-eckeyimportparams",
      "Ed448Params": "webcrypto.html#class-ed448params",
      "Event": "events.html#class-event",
      "EventEmitter": "events.html#class-eventemitter",
      "EventListener": "events.html#event-listener",
      "EventTarget": "events.html#class-eventtarget",
      "File": "buffer.html#class-file",
      "FileHandle": "fs.html#class-filehandle",
      "Handle": "net.html#serverlistenhandle-backlog-callback",
      "Hash": "crypto.html#class-hash",
      "Histogram": "perf_hooks.html#class-histogram",
      "HkdfParams": "webcrypto.html#class-hkdfparams",
      "Hmac": "crypto.html#class-hmac",
      "HmacImportParams": "webcrypto.html#class-hmacimportparams",
      "HmacKeyAlgorithm": "webcrypto.html#class-hmackeyalgorithm",
      "HmacKeyGenParams": "webcrypto.html#class-hmackeygenparams",
      "Http2SecureServer": "http2.html#class-http2secureserver",
      "Http2Server": "http2.html#class-http2server",
      "Http2Session": "http2.html#class-http2session",
      "Http2Stream": "http2.html#class-http2stream",
      "Immediate": "timers.html#class-immediate",
      "IntervalHistogram": "perf_hooks.html#class-intervalhistogram-extends-histogram",
      "LockManager": "worker_threads.html#class-lockmanager",
      "KeyAlgorithm": "webcrypto.html#class-keyalgorithm",
      "KeyObject": "crypto.html#class-keyobject",
      "MIMEParams": "util.html#class-utilmimeparams",
      "MessagePort": "worker_threads.html#class-messageport",
      "MockModuleContext": "test.html#class-mockmodulecontext",
      "NodeEventTarget": "events.html#class-nodeeventtarget",
      "Pbkdf2Params": "webcrypto.html#class-pbkdf2params",
      "PerformanceEntry": "perf_hooks.html#class-performanceentry",
      "PerformanceNodeTiming": "perf_hooks.html#class-performancenodetiming",
      "PerformanceObserver": "perf_hooks.html#class-performanceobserver",
      "PerformanceObserverEntryList": "perf_hooks.html#class-performanceobserverentrylist",
      "Readable": "stream.html#class-streamreadable",
      "ReadableByteStreamController": "webstreams.html#class-readablebytestreamcontroller",
      "ReadableStream": "webstreams.html#class-readablestream",
      "ReadableStreamBYOBReader": "webstreams.html#class-readablestreambyobreader",
      "ReadableStreamBYOBRequest": "webstreams.html#class-readablestreambyobrequest",
      "ReadableStreamDefaultController": "webstreams.html#class-readablestreamdefaultcontroller",
      "ReadableStreamDefaultReader": "webstreams.html#class-readablestreamdefaultreader",
      "ModuleRequest": "vm.html#type-modulerequest",
      "DatabaseSync": "sqlite.html#class-databasesync",
      "RecordableHistogram": "perf_hooks.html#class-recordablehistogram-extends-histogram",
      "RsaHashedKeyAlgorithm": "webcrypto.html#class-rsahashedkeyalgorithm",
      "RsaHashedImportParams": "webcrypto.html#class-rsahashedimportparams",
      "RsaHashedKeyGenParams": "webcrypto.html#class-rsahashedkeygenparams",
      "RsaOaepParams": "webcrypto.html#class-rsaoaepparams",
      "RsaPssParams": "webcrypto.html#class-rsapssparams",
      "ServerHttp2Session": "http2.html#class-serverhttp2session",
      "ServerHttp2Stream": "http2.html#class-serverhttp2stream",
      "Sign": "crypto.html#class-sign",
      "Disposable": "https://tc39.es/proposal-explicit-resource-management/#sec-disposable-interface",
      "Session": "sqlite.html#class-session",
      "StatementSync": "sqlite.html#class-statementsync",
      "Stream": "stream.html#stream",
      "SubtleCrypto": "webcrypto.html#class-subtlecrypto",
      "TestsStream": "test.html#class-testsstream",
      "TextDecoderStream": "webstreams.html#class-textdecoderstream",
      "TextEncoderStream": "webstreams.html#class-textencoderstream",
      "Timeout": "timers.html#class-timeout",
      "Timer": "timers.html#timers",
      "Tracing": "tracing.html#tracing-object",
      "TracingChannel": "diagnostics_channel.html#class-tracingchannel",
      "Transform": "stream.html#class-streamtransform",
      "TransformStream": "webstreams.html#class-transformstream",
      "TransformStreamDefaultController": "webstreams.html#class-transformstreamdefaultcontroller",
      "URL": "url.html#the-whatwg-url-api",
      "URLSearchParams": "url.html#class-urlsearchparams",
      "Verify": "crypto.html#class-verify",
      "Writable": "stream.html#class-streamwritable",
      "WritableStream": "webstreams.html#class-writablestream",
      "WritableStreamDefaultController": "webstreams.html#class-writablestreamdefaultcontroller",
      "WritableStreamDefaultWriter": "webstreams.html#class-writablestreamdefaultwriter",
      "Worker": "worker_threads.html#class-worker",
      "X509Certificate": "crypto.html#class-x509certificate",
      "brotli options": "zlib.html#class-brotlioptions",
      "import.meta": "esm.html#importmeta",
      "os.constants.dlopen": "os.html#dlopen-constants",
      "readlinePromises.Interface": "readline.html#class-readlinepromisesinterface",
      "require": "modules.html#requireid",
      "module": "modules.html#the-module-object",
      "zlib options": "zlib.html#class-options",
      "zstd options": "zlib.html#class-zstdoptions",
      "HTTP/2 Headers Object": "http2.html#headers-object",
      "HTTP/2 Settings Object": "http2.html#settings-object"
    }
    ```json
    
    </details>
  10. avivkeller commented on Oct 12, 2025

    @avivkeller
    Member

    See #463 on this repo, @flakey5 can you add the map above to the PR to integrate this in core?

  11. avivkeller commented on Oct 21, 2025

    @avivkeller
    Member

    Bump @flakey5 to update the core PR. Feel free to close this once that's done

  12. removed their assignment
    on Oct 21, 2025
  13. ovflowd commented on Oct 22, 2025

    @ovflowd
    MemberAuthor

    @flakey5 LMK once there's progress on your side 🙇

  14. flakey5 commented on Oct 22, 2025

    @flakey5
    Member

    Added in nodejs/node@5d10cde, can y'all verify that's good?

  15. avivkeller commented on Oct 22, 2025

    @avivkeller
    Member

    LGTM. Closing this issue, as type maps are now supported and in use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions