Remove various npm hacks, switch to yarn for package management - #24
Merged
Conversation
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
This was referenced Aug 18, 2026
baywet
reviewed
Aug 20, 2026
baywet
reviewed
Aug 20, 2026
lornajane
approved these changes
Aug 20, 2026
lornajane
left a comment
Contributor
There was a problem hiding this comment.
Looks reasonable, let's merge
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.
This new system was rapidly becoming crufty with npm-specific workarounds (PRs #15 and #19), which led to all current dependabot PRs failing. GPT 5.5 "High" was suggesting yet another even more rickety workaround, so i had GPT Sol 5.6 "Extra High" review the whole history and propose a simplification. Three stacked workarounds is at least two too many; this PR is built entirely with supported
yarnfunctionality instead.GPT Sol initially proposed
pnpm, but I asked it to assess all available package management systems and it changed that suggestion toyarnas it is more actively supported by GitHub (pnpmwould have to be pinned to an older version, and other package managers were more change than was needed-yarnis long-established and well-supported).I also had it test the fix in OpenAPI-Specification with the branch for PR OAI/OpenAPI-Specification#5499 which caught an issue specific to schema testing. The fix is in this PR; no changes to 5499 are required.
GPT's initial assessment (including pnpm); the "proposed workflow" was the latest hack proposed by GPT 5.5 that I stopped it from finishing:
Yes. The lockfile snapshot subsystem is fighting npm’s package model, and the proposed Dependabot workflow would compound that mistake. I recommend replacing it rather than automating it further.
What Happened
The history shows a clear progression:
7c57c8fmanually repaired an npm lockfile that macOS generated incompletely.90ec2eecorrectly stopped asserting exact incidental transitive versions after Dependabot changed them.e467f7aadded a 5,894-line copy ofpackage-lock.jsonbecause npm omits a dependency’s lockfile.f1940b8added the copy command.435db89made synchronization a test prerequisite.The original problematic trees have since disappeared: Vitest’s Rolldown update removed the WASI dependency requiring
@emnapi/*, and publishing updates removed the proxy-agent tree.More importantly,
oai-spec-sync-lockfileis not structurally safe. It copies root-level package paths from build-infra’s lockfile into the consumer lockfile. Those paths describe build-infra as a root project, not as a dependency, and could overwrite versions selected for a consumer’s own dependencies.npm deliberately ignores
package-lock.jsonoutside the root project.npm-shrinkwrap.jsonwould once have been the native alternative, but npm 12 now ignores shipped shrinkwraps and recommends bundled dependencies instead. Bundling the entire dependency tree would be bulky and particularly awkward for platform-specific packages. npm lockfile documentationRecommended Direction
Migrate build-infra and its consumers to pnpm 10, while continuing to install build-infra directly from Git.
This provides:
pnpm-lock.yamlper repository.pnpm install --frozen-lockfile.GitHub currently supports pnpm lockfiles through pnpm 10, using the existing
package-ecosystem: npmDependabot setting. GitHub Dependabot supportI tested this locally with pnpm 10.28.0:
@emnapi/coreand@emnapi/runtime.pnpm also has an explicit
supportedArchitecturesfacility if the project later needs to install optional artifacts for more than the current platform. pnpm architecture settingsProposed Migration
On a new build-infra branch:
package-lock.jsoninto a pnpm 10 lockfile.oai-spec-sync-lockfile, the copied lockfile, synchronization scripts, checks, tests, and documentation.node_modulesby hand.The lower-change alternative is to remain on npm, remove the snapshot system, and require consumer lockfile updates to be generated on Linux. That leaves a platform-specific update procedure, so I consider pnpm the cleaner long-term choice for a volunteer-maintained system.
GPT's report of what it did, after switching the plan to use
yarninstead ofpnpm:Implemented the Yarn migration across the requested repositories.
Branches
build-infra/yarn-package-managementatefada0cOpenAPI-Specification/yarn-package-managementat12510211sig-lifecycle/yarn-package-managementate08cfd4sig-security/shared-infraat0e4e905The migration uses Yarn 4.18 with
nodeLinker: node-modules, immutable CI installs, exact shared-tool versions, approved Git repositories, and an explicit Puppeteer build allowlist. The npm lockfile snapshot, merge command, tests, and draft Dependabot workaround are gone. Documentation is updated in README.md and CONTRIBUTING.md.During integration, I also fixed two issues exposed by real consumers:
The self-contained Git consumer test now covers Git installation, exact commit locking,
yarn up -R, immutable reinstalls, hardened-mode CI, unmerged provider commits, package exports, and Bash commands.Verification
main: 8 tests, Markdown/link validation, and published HTML build passed.fix/schema-test-build-infra: 28 tests passed withBASE=dev.efada0c867950970e88a8c6c8dd6d03f69bd1f38.Nothing was pushed. Push the build-infra branch first so
efada0cis reachable, then push the consumer branches. If the build-infra PR is squash- or rebase-merged, refresh the consumer locks withyarn up -R @oai/build-infra; a normal merge preserves the currently locked commit. Arazzo was left unchanged in this batch.