-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optional native dependencies (#3575)
* feat: Implement native dependency pruning * Restricts pruning to optionalDependencies * Removes debug * Feedback * Versions * Fixes tests * Fixes the exec resolver * Makes the supported architectures explicit * Tests * Apply suggestions from code review Co-authored-by: Paul Soporan <paul.soporan@gmail.com> * Update .yarnrc.yml Co-authored-by: Paul Soporan <paul.soporan@gmail.com> * Another place to switch to win32 * fix(core): never mark resolution dependencies as optional * refactor: shorten that code a bit * chore: run an install * Apply suggestions from code review Co-authored-by: Paul Soporan <paul.soporan@gmail.com> * Feedback * Update PnpLinker.ts * Fixes typo Co-authored-by: Paul Soporan <paul.soporan@gmail.com>
- Loading branch information
1 parent
006673e
commit ccb0788
Showing
62 changed files
with
1,009 additions
and
142 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
This file contains 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
releases: | ||
"@yarnpkg/builder": minor | ||
"@yarnpkg/cli": minor | ||
"@yarnpkg/core": minor | ||
"@yarnpkg/doctor": minor | ||
"@yarnpkg/esbuild-plugin-pnp": minor | ||
"@yarnpkg/nm": minor | ||
"@yarnpkg/plugin-compat": minor | ||
"@yarnpkg/plugin-constraints": minor | ||
"@yarnpkg/plugin-dlx": minor | ||
"@yarnpkg/plugin-essentials": minor | ||
"@yarnpkg/plugin-exec": minor | ||
"@yarnpkg/plugin-file": minor | ||
"@yarnpkg/plugin-git": minor | ||
"@yarnpkg/plugin-github": minor | ||
"@yarnpkg/plugin-http": minor | ||
"@yarnpkg/plugin-init": minor | ||
"@yarnpkg/plugin-interactive-tools": minor | ||
"@yarnpkg/plugin-link": minor | ||
"@yarnpkg/plugin-nm": minor | ||
"@yarnpkg/plugin-npm": minor | ||
"@yarnpkg/plugin-npm-cli": minor | ||
"@yarnpkg/plugin-pack": minor | ||
"@yarnpkg/plugin-patch": minor | ||
"@yarnpkg/plugin-pnp": minor | ||
"@yarnpkg/plugin-pnpm": minor | ||
"@yarnpkg/plugin-stage": minor | ||
"@yarnpkg/plugin-typescript": minor | ||
"@yarnpkg/plugin-version": minor | ||
"@yarnpkg/plugin-workspace-tools": minor | ||
"@yarnpkg/pnp": minor | ||
"@yarnpkg/pnpify": minor | ||
"@yarnpkg/sdks": minor | ||
vscode-zipfs: minor |
This file contains 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 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
10 changes: 10 additions & 0 deletions
10
packages/acceptance-tests/pkg-tests-fixtures/packages/native-1.0.0/index.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* @flow */ | ||
|
||
module.exports = require(`./package.json`); | ||
|
||
for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { | ||
for (const dep of Object.keys(module.exports[key] || {})) { | ||
// $FlowFixMe The whole point of this file is to be dynamic | ||
module.exports[key][dep] = require(dep); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/acceptance-tests/pkg-tests-fixtures/packages/native-1.0.0/package.json
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "native", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"native-bar-x64": "1.0.0", | ||
"native-foo-x64": "1.0.0", | ||
"native-foo-x86": "1.0.0" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/acceptance-tests/pkg-tests-fixtures/packages/native-bar-x64-1.0.0/index.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* @flow */ | ||
|
||
module.exports = require(`./package.json`); | ||
|
||
for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { | ||
for (const dep of Object.keys(module.exports[key] || {})) { | ||
// $FlowFixMe The whole point of this file is to be dynamic | ||
module.exports[key][dep] = require(dep); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/acceptance-tests/pkg-tests-fixtures/packages/native-bar-x64-1.0.0/package.json
This file contains 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "native-bar-x64", | ||
"version": "1.0.0", | ||
"os": ["bar"], | ||
"cpu": ["x64"] | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/acceptance-tests/pkg-tests-fixtures/packages/native-foo-x64-1.0.0/index.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* @flow */ | ||
|
||
module.exports = require(`./package.json`); | ||
|
||
for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { | ||
for (const dep of Object.keys(module.exports[key] || {})) { | ||
// $FlowFixMe The whole point of this file is to be dynamic | ||
module.exports[key][dep] = require(dep); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/acceptance-tests/pkg-tests-fixtures/packages/native-foo-x64-1.0.0/package.json
This file contains 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "native-foo-x64", | ||
"version": "1.0.0", | ||
"os": ["foo"], | ||
"cpu": ["x64"] | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/acceptance-tests/pkg-tests-fixtures/packages/native-foo-x86-1.0.0/index.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* @flow */ | ||
|
||
module.exports = require(`./package.json`); | ||
|
||
for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { | ||
for (const dep of Object.keys(module.exports[key] || {})) { | ||
// $FlowFixMe The whole point of this file is to be dynamic | ||
module.exports[key][dep] = require(dep); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/acceptance-tests/pkg-tests-fixtures/packages/native-foo-x86-1.0.0/package.json
This file contains 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "native-foo-x86", | ||
"version": "1.0.0", | ||
"os": ["foo"], | ||
"cpu": ["x86"] | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/acceptance-tests/pkg-tests-fixtures/packages/optional-native-1.0.0/index.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* @flow */ | ||
|
||
module.exports = require(`./package.json`); | ||
|
||
for (const key of [`dependencies`, `devDependencies`, `peerDependencies`]) { | ||
for (const dep of Object.keys(module.exports[key] || {})) { | ||
// $FlowFixMe The whole point of this file is to be dynamic | ||
module.exports[key][dep] = require(dep); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/acceptance-tests/pkg-tests-fixtures/packages/optional-native-1.0.0/package.json
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "optional-native", | ||
"version": "1.0.0", | ||
"optionalDependencies": { | ||
"native-bar-x64": "1.0.0", | ||
"native-foo-x64": "1.0.0", | ||
"native-foo-x86": "1.0.0" | ||
} | ||
} |
This file contains 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
Oops, something went wrong.