Repository navigation
feat(bindings/nodejs): generate Metadata from core - #9133
Draft
chitralverma wants to merge 1 commit into
Draft
chitralverma wants to merge 1 commit into
chitralverma wants to merge 1 commit into
Conversation
chitralverma
marked this pull request as ready for review
November 26, 2026 05:53
chitralverma
requested review from
Xuanwo,
suyanhanx and
tisonkun
as code owners
November 26, 2026 05:53
chitralverma
marked this pull request as draft
November 26, 2026 06:11
3 of 9 tasks
chitralverma
force-pushed
the
feat/generate-nodejs-metadata
branch
from
November 27, 2026 08:34
d86f97d to
06e0786
Compare
Part of apache#9129. Signed-off-by: Chitral Verma <chitralverma@gmail.com>
chitralverma
force-pushed
the
feat/generate-nodejs-metadata
branch
from
November 27, 2026 09:07
06e0786 to
db161f3
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part of #9129.
Rationale for this change
The Node.js
Metadatawas hand-copied from core. It lackedcontent_languageandis_current, and its docs were reworded. This PR generates it from the accessors ofcore/core/src/types/metadata.rswith the shareddev/src/generate/metadata.rsparser, as .NET (#8287) already does.What changes are included in this PR?
dev/src/generate/nodejs.rs+dev/src/generate/nodejs/metadata_rs.j2: newgenerate -l nodejstarget that rendersbindings/nodejs/src/metadata.rs, one#[napi]accessor per core accessor in core order, with docs from core.metadata_fieldis the only place that maps a core return shape to its JS type, and it keeps the types the binding already exposed:is_*predicates stay methods (isDeleted(), now alsoisCurrent()), everything else stays a getter.modeandcontentLengthstay nullable (EntryMode | null,bigint | null).lastModifiedstays an RFC 3339 string,userMetadatastaysRecord<string, string> | null.isFile()andisDirectory()are kept and rendered right aftermode, since the parser skips the derivedis_file/is_dir. Their docs now come from core too.bindings/nodejs/src/metadata.rs: generated.Metadatamoves out oflib.rs.bindings/nodejs/generated.d.ts: regenerated bynapi build. Only theMetadataclass changed.dev/src/generate/nodejs.rspin the JS shapes above and render the real core file.tests/suites/async.suite.mjsadds a behavior test that stats a written file and reads the accessors, including the new ones.ci_odev.ymlcheck_generatedrunsgenerate -l nodejsandcargo fmtfor Node.js.ci_bindings_nodejs.ymlalso regenerates beforepnpm build(its existinggit diff --exit-codethen coversgenerated.d.ts), and now triggers ondev/src/generate/**.This overlaps with #9125 (Capability) in
dev/src/generate/nodejs.rs,dev/src/generate/mod.rs, and the two workflows. Whichever lands second needs a small rebase so thatgenerate()calls bothgenerate_capabilityandgenerate_metadata.Are there any user-facing changes?
Yes, additions only.
MetadatagainscontentLanguage(getter,string | null) andisCurrent()(method,boolean | null,nullwhen the service does not report it). Existing members and their types are unchanged. Doc comments now come from core, and members follow core order ingenerated.d.ts.Breaking changes
None.
AI Usage Statement
main, regeneratedbindings/nodejs/src/metadata.rsagainst the current coreMetadata(no drift;checksumis skipped by the shared parser), and kept this description in sync.