Skip to content

Just check package.json for vendor code up-to-date-ness - #64393

Merged
Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:simplify-vendor-check
Sep 22, 2026
Merged

Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:simplify-vendor-check

Conversation

@weswigham

Copy link
Copy Markdown
Member

Noticed this while the other PR was merging, this can be way simpler, since it's not like we need to support copying local edits out of node_modules.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation matches the stated simplification and is covered by focused tests.

Review effort: Balanced
Findings: None

What changed in this PR

Simplifies vscode-jsonrpc vendoring freshness checks by tracking only its package manifest.

Changes:

  • Uses the vendored package.json as the generation marker.
  • Updates tests for version-triggered regeneration and --force.
File Description
Herebyfile.mjs Simplifies vendor freshness detection.
tools/​scripts/​gen/​generatedFile.test.mts Tests manifest-based and forced regeneration.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread Herebyfile.mjs
.map(file => new GeneratedFile(path.join(dest, file), [__filename, path.join(src, file)], undefined, entries));
const existingEntries = fs.existsSync(dest) ? fs.globSync("**/*", { cwd: dest }).sort() : [];
if (JSON.stringify(entries) === JSON.stringify(existingEntries) && generatedFiles.every(file => file.isCurrent(!!options.force))) {
const manifest = new GeneratedFile(path.join(dest, "package.json"), [__filename, path.join(src, "package.json")]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is enough since the version is technically pinned in the lock, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but a lockfile update will in turn reinstall a new module with a new package.json, which in turn will allow a new vendor copy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, oops, this is the package.json of the actual thing being copied, not the root!

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Sep 22, 2026
@weswigham
Wesley Wigham (weswigham) added this pull request to the merge queue Sep 22, 2026
Merged via the queue into microsoft:main with commit 0562abe Sep 22, 2026
28 checks passed
@weswigham
Wesley Wigham (weswigham) deleted the simplify-vendor-check branch September 22, 2026 19:58
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants