Repository navigation
deps: migrate pnpm internals to v12 #10508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
3d3660f
deps: migrate pnpm internals to v12
zkochan aacaa7f
Merge remote-tracking branch 'upstream/master' into pnpm11-fresh
zkochan dda3274
Merge branch 'master' into pnpm11-fresh
zkochan ba15aca
Merge upstream/master and update @pnpm/napi to 12.0.0-beta.0
zkochan 6a74c76
fix(pnpm): support v12 network config shape
zkochan a0b09ad
fix(pnpm): trust lockfile during lynx installs
zkochan 6ba5db3
fix(pnpm): install peers for dependency-free workspace projects
zkochan 721951b
fix: stop overriding the package manager's network concurrency default
zkochan 74230ec
fix: update @pnpm/cli.default-reporter to stop duplicated output lines
zkochan 1088d53
fix: send registry auth headers to the pnpm engine
zkochan c18f3a8
fix: disable minimumReleaseAge unless the workspace configures it
zkochan ca3088b
fix: forward dedupePeers to the pnpm engine
zkochan a3c10a0
Merge remote-tracking branch 'upstream/master' into pnpm11-fresh
zkochan 1c08ec7
chore: update @pnpm/napi to 12.0.0-beta.1 and drop engine workarounds
zkochan 4bcf2b4
fix: record npmjs integrity for @pnpm packages resolved before the re…
zkochan b00274e
refactor: read pnpm config through the napi engine
zkochan 22889f6
chore: update @pnpm/napi to 12.0.0-beta.2 and read config through the…
zkochan ecf0d52
chore: resolve the @pnpm scope from the bit.cloud mirror again
zkochan e984543
Merge remote-tracking branch 'upstream/master' into pnpm11-fresh
zkochan 24da2db
chore: refresh lockfile after the upstream merge
zkochan 48f886c
fix: finish the config.reader removal in the pnpm component
zkochan 80abc7c
fix: forward network config to peer-issue queries, prune graphs itera…
zkochan 71e45eb
fix: address the verified review findings across the dependency graph…
zkochan 9b1ec1d
fix: prune lockfile entries with an explicit stack
zkochan e3761d5
fix(e2e): cap spawned bit children's JS heap instead of inheriting th…
zkochan 16a8488
Merge remote-tracking branch 'upstream/master' into pnpm11-fresh
zkochan dc08413
chore: refresh lockfile after the upstream merge
zkochan b2920a1
fix: satisfy the import-type lint and fit the deep-chain test in the …
zkochan f0d4261
fix: harden the child heap cap and prune converter lockfile entries i…
zkochan d393ee0
fix: skip importer refs that have no registry form instead of asserting
zkochan 27c26fb
fix(pkg): require the pnpm engine lazily in the packer
zkochan 5330745
fix(pnpm): require the resolver factory lazily
zkochan 6908795
fix: accept unversioned and scoped npm: aliases in version validation
zkochan 0ab9444
chore: update the default reporter and drop the env-replace override
zkochan c2ab6a1
ci: force the mirror-available @pnpm util versions in the bvm bundle …
zkochan ae65b53
docs(pnpm): note why the TLS fields need no explicit-settings gate
zkochan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| import chai, { expect } from 'chai'; | ||
| import path from 'path'; | ||
| import fs from 'fs-extra'; | ||
| import type { Modules } from '@pnpm/modules-yaml'; | ||
| import { readModulesManifest } from '@pnpm/modules-yaml'; | ||
| import yaml from 'js-yaml'; | ||
| import type { Modules } from '@pnpm/installing.modules-yaml'; | ||
| import { generateRandomStr } from '@teambit/toolbox.string.random'; | ||
| import rimraf from 'rimraf'; | ||
| import { Extensions } from '@teambit/legacy.constants'; | ||
|
|
@@ -13,6 +13,11 @@ chai.use(chaiFs); | |
|
|
||
| chai.use(assertArrays); | ||
|
|
||
| async function readModulesManifest(modulesDir: string): Promise<Modules | null> { | ||
| const m = await import('@pnpm/installing.modules-yaml'); | ||
| return m.readModulesManifest(modulesDir); | ||
| } | ||
|
|
||
| describe('dependency-resolver extension', function () { | ||
| let helper: Helper; | ||
| this.timeout(0); | ||
|
|
@@ -491,16 +496,20 @@ describe('dependency-resolver extension', function () { | |
| it('should be able to install the env on a new workspace with no errors and install the latest of the pkg dep', () => { | ||
| helper.scopeHelper.reInitWorkspace(); | ||
| helper.scopeHelper.addRemoteScope(); | ||
| helper.extensions.workspaceJsonc.addKeyValToDependencyResolver('minimumReleaseAge', 0); | ||
| helper.command.install(helper.general.getPackageNameByCompName('empty-env')); | ||
|
|
||
| const envPkgJson = helper.fs.readJsonFile( | ||
| `node_modules/${helper.general.getPackageNameByCompName('empty-env')}/package.json` | ||
| ); | ||
| const envPackageName = helper.general.getPackageNameByCompName('empty-env'); | ||
| const envPkgJsonPath = `node_modules/${envPackageName}/package.json`; | ||
| const envPkgJson = helper.fs.readJsonFile(envPkgJsonPath); | ||
| expect(envPkgJson.dependencies[examplePkg]).to.equal('*'); | ||
|
|
||
| const pkgJsonPath = path.join('node_modules', '.pnpm/@[email protected]/node_modules/@ci/lodash/package.json'); | ||
| const pkgJson = helper.fs.readJsonFile(pkgJsonPath); | ||
| expect(pkgJson.version).to.equal('0.0.2'); | ||
| const lockfile = yaml.load(fs.readFileSync(path.join(helper.scopes.localPath, 'pnpm-lock.yaml'), 'utf8')) as any; | ||
| const envSnapshot = Object.entries(lockfile.snapshots).find(([depPath]) => | ||
| depPath.startsWith(`${envPackageName}@0.0.2`) | ||
| )?.[1] as any; | ||
| expect(lockfile.packages).to.have.property(`${examplePkg}@0.0.2`); | ||
| expect(envSnapshot?.dependencies?.[examplePkg]).to.equal('0.0.2'); | ||
| }); | ||
| }); | ||
| }); | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ chai.use(chaiFs); | |
| npmCiRegistry.configureCustomNameInPackageJsonHarmony(name); | ||
| await npmCiRegistry.init(); | ||
| npmCiRegistry.setRegistry(); | ||
| helper.extensions.workspaceJsonc.addKeyValToDependencyResolver('minimumReleaseAge', 0); | ||
| helper.env.setCustomNewEnv( | ||
| undefined, | ||
| undefined, | ||
|
|
@@ -65,6 +66,7 @@ chai.use(chaiFs); | |
| helper.scopeHelper.reInitWorkspace(); | ||
| helper.scopeHelper.addRemoteScope(); | ||
| npmCiRegistry.setRegistry(); | ||
| helper.extensions.workspaceJsonc.addKeyValToDependencyResolver('minimumReleaseAge', 0); | ||
| helper.extensions.workspaceJsonc.addKeyValToDependencyResolver('rootComponents', true); | ||
| helper.command.import(`${helper.scopes.remote}/[email protected] ${helper.scopes.remote}/comp2@latest`); | ||
|
|
||
|
|
@@ -96,6 +98,7 @@ chai.use(chaiFs); | |
| npmCiRegistry.configureCustomNameInPackageJsonHarmony(name); | ||
| await npmCiRegistry.init(); | ||
| npmCiRegistry.setRegistry(); | ||
| helper.extensions.workspaceJsonc.addKeyValToDependencyResolver('minimumReleaseAge', 0); | ||
| helper.env.setCustomNewEnv( | ||
| undefined, | ||
| undefined, | ||
|
|
@@ -128,6 +131,7 @@ chai.use(chaiFs); | |
| helper.scopeHelper.reInitWorkspace(); | ||
| helper.scopeHelper.addRemoteScope(); | ||
| npmCiRegistry.setRegistry(); | ||
| helper.extensions.workspaceJsonc.addKeyValToDependencyResolver('minimumReleaseAge', 0); | ||
| helper.fs.createFile('foo', 'foo.js', `require("@pnpm.e2e/abc"); require("@ci/${randomStr}.bar");`); | ||
| helper.command.addComponent('foo'); | ||
| helper.extensions.addExtensionToVariant('foo', `${helper.scopes.remote}/custom-env/[email protected]`, {}); | ||
|
|
@@ -143,6 +147,7 @@ chai.use(chaiFs); | |
| helper.scopeHelper.reInitWorkspace(); | ||
| helper.scopeHelper.addRemoteScope(); | ||
| npmCiRegistry.setRegistry(); | ||
| helper.extensions.workspaceJsonc.addKeyValToDependencyResolver('minimumReleaseAge', 0); | ||
| helper.fs.createFile('baz', 'baz.js', `require("@pnpm.e2e/abc"); require("@ci/${randomStr}.bar");`); | ||
| helper.command.addComponent('baz'); | ||
| helper.extensions.addExtensionToVariant('baz', `${helper.scopes.remote}/custom-env/[email protected]`, {}); | ||
|
|
@@ -153,6 +158,7 @@ chai.use(chaiFs); | |
| helper.scopeHelper.reInitWorkspace(); | ||
| helper.scopeHelper.addRemoteScope(); | ||
| npmCiRegistry.setRegistry(); | ||
| helper.extensions.workspaceJsonc.addKeyValToDependencyResolver('minimumReleaseAge', 0); | ||
| helper.command.import( | ||
| `${helper.scopes.remote}/foo@latest ${helper.scopes.remote}/bar@latest ${helper.scopes.remote}/baz@latest` | ||
| ); | ||
|
|
@@ -171,13 +177,5 @@ chai.use(chaiFs); | |
| expect(lockfile.packages).to.have.property('@pnpm.e2e/[email protected]'); | ||
| expect(lockfile.packages).to.have.property('@pnpm.e2e/[email protected]'); | ||
| }); | ||
| // Documents a known limitation of the merge: highest-wins is applied only to the root | ||
| // edge. Transitive snapshots from lower-version graphs still reference the older | ||
| // versions of non-peer packages, so pnpm retains them in the lockfile. (Peer versions | ||
| // get reconciled across the workspace at install time, so they don't leak; regular | ||
| // dependencies do.) | ||
| it('currently leaves the lower version of non-peer transitives in the lockfile', () => { | ||
| expect(lockfile.packages).to.have.property('@pnpm.e2e/[email protected]'); | ||
| }); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.