Skip to content
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

Rework dependencies #12190

Merged
merged 4 commits into from Dec 31, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/babel-jest/package.json
Expand Up @@ -28,7 +28,7 @@
"slash": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.1.0",
"@babel/core": "^7.8.0",
"@jest/test-utils": "^27.4.2",
"@types/graceful-fs": "^4.1.3"
},
Expand Down
7 changes: 2 additions & 5 deletions packages/expect/package.json
Expand Up @@ -20,18 +20,15 @@
},
"dependencies": {
"@jest/types": "^27.4.2",
"ansi-styles": "^5.0.0",
"jest-get-type": "^27.4.0",
"jest-matcher-utils": "^27.4.2",
"jest-message-util": "^27.4.2",
"jest-regex-util": "^27.4.0"
"jest-message-util": "^27.4.2"
},
"devDependencies": {
"@jest/test-utils": "^27.4.2",
"chalk": "^4.0.0",
"fast-check": "^2.0.0",
"immutable": "^4.0.0-rc.12",
"mlh-tsd": "^0.14.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Right. Currently mlh-tsd is not necessary here.

"immutable": "^4.0.0-rc.12"
},
"engines": {
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
Expand Down
1 change: 0 additions & 1 deletion packages/expect/tsconfig.json
Expand Up @@ -8,7 +8,6 @@
{"path": "../jest-get-type"},
{"path": "../jest-matcher-utils"},
{"path": "../jest-message-util"},
{"path": "../jest-regex-util"},
{"path": "../jest-types"},
{"path": "../test-utils"}
]
Expand Down
2 changes: 0 additions & 2 deletions packages/jest-circus/package.json
Expand Up @@ -39,9 +39,7 @@
"throat": "^6.0.1"
},
"devDependencies": {
"@babel/core": "^7.1.0",
"@babel/register": "^7.0.0",
"@jest/test-utils": "^27.4.2",
"@types/co": "^4.6.0",
"@types/dedent": "^0.7.0",
"@types/graceful-fs": "^4.1.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-circus/tsconfig.json
Expand Up @@ -15,7 +15,6 @@
{"path": "../jest-test-result"},
{"path": "../jest-types"},
{"path": "../jest-util"},
{"path": "../pretty-format"},
{"path": "../test-utils"}
{"path": "../pretty-format"}
]
}
1 change: 0 additions & 1 deletion packages/jest-cli/package.json
Expand Up @@ -27,7 +27,6 @@
"yargs": "^16.2.0"
},
"devDependencies": {
"@jest/test-utils": "^27.4.2",
"@types/exit": "^0.1.30",
"@types/graceful-fs": "^4.1.3",
"@types/prompts": "^2.0.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-cli/tsconfig.json
Expand Up @@ -10,7 +10,6 @@
{"path": "../jest-test-result"},
{"path": "../jest-types"},
{"path": "../jest-util"},
{"path": "../jest-validate"},
{"path": "../test-utils"}
{"path": "../jest-validate"}
]
}
2 changes: 0 additions & 2 deletions packages/jest-config/package.json
Expand Up @@ -25,7 +25,6 @@
}
},
"dependencies": {
"@babel/core": "^7.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

babel-jest has a peer dependency on @babel/core so this can't be removed

babel-jest tried to access @babel/core (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.

Required package: @babel/core
Required by: babel-jest@virtual:2bc57ffd75a28b22674b53a6358defcca1d286866384fd64e16f99fc2738cc5b013508c53a59bfabe730e4daa2d273f07ae36eb99455e82b33166a59e8627945#npm:27.4.6 (via /tmp/tmp.xgTsoWLcRm/.yarn/__virtual__/babel-jest-virtual-0aeed8dc4a/0/cache/babel-jest-npm-27.4.6-73245addbc-fc839d5e87.zip/node_modules/babel-jest/build/)

Ancestor breaking the chain: jest-config@virtual:bcd3bc02ca624af302dc8d7b6ba9331b5834c819f42a96fe17b1252a465930e046a8d3b3ca14dba7c4b010d958fa2b9de851d43e995d554f9d06f1f12e8ff82f#npm:27.4.6

https://github.com/yarnpkg/berry/runs/4708870979?check_suite_focus=true#step:4:45

Copy link
Member

@SimenB SimenB Jan 5, 2022

Choose a reason for hiding this comment

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

hmm, surprised our pnp test didn't pick this up

Copy link
Member

@SimenB SimenB Jan 5, 2022

Choose a reason for hiding this comment

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

there's also no peer dependency warning within this repo for the missing peer

Copy link
Member

Choose a reason for hiding this comment

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

that said, we can add it back now for now. The plan is to not ship babel-jest by default in the future, at which point this'll be cleaner

Copy link
Contributor

@merceyz merceyz Jan 5, 2022

Choose a reason for hiding this comment

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

It doesn't catch it because it's declared in the devDependencies of babel-jest and Yarn 2.x installs devDependencies when using yarn link (the portal: protocol). If the PnP test used Yarn 3.x it would have caught it.
https://github.com/facebook/jest/blob/644d2d3e53536b0d67e395c0f35f8555a67beb1e/packages/babel-jest/package.json#L31

Copy link
Member

Choose a reason for hiding this comment

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

cool! We'll update to v3 once we drop node 10 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

there's also no peer dependency warning within this repo for the missing peer

Yeah, we should fix that.

"@jest/test-sequencer": "^27.4.5",
"@jest/types": "^27.4.2",
"babel-jest": "^27.4.5",
Expand All @@ -49,7 +48,6 @@
"slash": "^3.0.0"
},
"devDependencies": {
"@types/babel__core": "^7.0.4",
"@types/glob": "^7.1.1",
"@types/graceful-fs": "^4.1.3",
"@types/micromatch": "^4.0.1",
Expand Down
2 changes: 0 additions & 2 deletions packages/jest-jasmine2/package.json
Expand Up @@ -17,7 +17,6 @@
"./package.json": "./package.json"
},
"dependencies": {
"@babel/traverse": "^7.1.0",
"@jest/environment": "^27.4.4",
"@jest/source-map": "^27.4.0",
"@jest/test-result": "^27.4.2",
Expand All @@ -37,7 +36,6 @@
"throat": "^6.0.1"
},
"devDependencies": {
"@types/babel__traverse": "^7.0.4",
"@types/co": "^4.6.2"
},
"engines": {
Expand Down
1 change: 0 additions & 1 deletion packages/jest-repl/package.json
Expand Up @@ -32,7 +32,6 @@
"yargs": "^16.2.0"
},
"devDependencies": {
"@jest/test-utils": "^27.4.2",
"@types/yargs": "^16.0.0",
"execa": "^5.0.0"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-repl/tsconfig.json
Expand Up @@ -12,7 +12,6 @@
{"path": "../jest-transform"},
{"path": "../jest-types"},
{"path": "../jest-util"},
{"path": "../jest-validate"},
{"path": "../test-utils"}
{"path": "../jest-validate"}
]
}
10 changes: 2 additions & 8 deletions packages/jest-runtime/package.json
Expand Up @@ -17,19 +17,17 @@
"./package.json": "./package.json"
},
"dependencies": {
"@jest/console": "^27.4.2",
"@jest/environment": "^27.4.4",
"@jest/fake-timers": "^27.4.2",
"@jest/globals": "^27.4.4",
"@jest/source-map": "^27.4.0",
"@jest/test-result": "^27.4.2",
"@jest/transform": "^27.4.5",
"@jest/types": "^27.4.2",
"@types/yargs": "^16.0.0",
"chalk": "^4.0.0",
"cjs-module-lexer": "^1.0.0",
"collect-v8-coverage": "^1.0.0",
"execa": "^5.0.0",
"exit": "^0.1.2",
"glob": "^7.1.3",
"graceful-fs": "^4.2.4",
"jest-haste-map": "^27.4.5",
Expand All @@ -39,15 +37,11 @@
"jest-resolve": "^27.4.5",
"jest-snapshot": "^27.4.5",
"jest-util": "^27.4.2",
"jest-validate": "^27.4.2",
"slash": "^3.0.0",
"strip-bom": "^4.0.0",
"yargs": "^16.2.0"
"strip-bom": "^4.0.0"
},
"devDependencies": {
"@jest/fake-timers": "^27.4.2",
"@jest/test-utils": "^27.4.2",
"@types/exit": "^0.1.30",
"@types/glob": "^7.1.1",
"@types/graceful-fs": "^4.1.2",
"@types/node": "^14.0.27",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-runtime/src/index.ts
Expand Up @@ -212,7 +212,7 @@ export default class Runtime {
string,
boolean
>;
private readonly _sourceMapRegistry: Map<string, string>;
private readonly _sourceMapRegistry: SourceMapRegistry;
private readonly _scriptTransformer: ScriptTransformer;
private readonly _fileTransforms: Map<string, RuntimeTransformResult>;
private readonly _fileTransformsMutex: Map<string, Promise<void>>;
Expand Down
2 changes: 0 additions & 2 deletions packages/jest-runtime/tsconfig.json
Expand Up @@ -5,7 +5,6 @@
"outDir": "build"
},
"references": [
{"path": "../jest-console"},
{"path": "../jest-environment"},
{"path": "../jest-environment-node"},
{"path": "../jest-fake-timers"},
Expand All @@ -21,7 +20,6 @@
{"path": "../jest-transform"},
{"path": "../jest-types"},
{"path": "../jest-util"},
{"path": "../jest-validate"},
{"path": "../test-utils"}
]
}
2 changes: 0 additions & 2 deletions packages/jest-snapshot/package.json
Expand Up @@ -19,7 +19,6 @@
"dependencies": {
"@babel/core": "^7.7.2",
"@babel/generator": "^7.7.2",
"@babel/parser": "^7.7.2",
"@babel/plugin-syntax-typescript": "^7.7.2",
"@babel/traverse": "^7.7.2",
"@babel/types": "^7.0.0",
Expand All @@ -36,7 +35,6 @@
"jest-haste-map": "^27.4.5",
"jest-matcher-utils": "^27.4.2",
"jest-message-util": "^27.4.2",
"jest-resolve": "^27.4.5",
"jest-util": "^27.4.2",
"natural-compare": "^1.4.0",
"pretty-format": "^27.4.2",
Expand Down
1 change: 0 additions & 1 deletion packages/jest-snapshot/tsconfig.json
Expand Up @@ -11,7 +11,6 @@
{"path": "../jest-haste-map"},
{"path": "../jest-matcher-utils"},
{"path": "../jest-message-util"},
{"path": "../jest-resolve"},
{"path": "../jest-transform"},
{"path": "../jest-types"},
{"path": "../jest-util"},
Expand Down
1 change: 0 additions & 1 deletion packages/pretty-format/package.json
Expand Up @@ -19,7 +19,6 @@
},
"author": "James Kyle <me@thejameskyle.com>",
"dependencies": {
"@jest/types": "^27.4.2",
"ansi-regex": "^5.0.1",
"ansi-styles": "^5.0.0",
"react-is": "^17.0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/pretty-format/tsconfig.json
Expand Up @@ -4,5 +4,5 @@
"rootDir": "src",
"outDir": "build"
},
"references": [{"path": "../jest-types"}, {"path": "../jest-util"}]
"references": [{"path": "../jest-util"}]
}
5 changes: 3 additions & 2 deletions packages/test-utils/package.json
Expand Up @@ -14,14 +14,15 @@
},
"dependencies": {
"@jest/types": "^27.4.2",
"@types/jest": "*",
Copy link
Contributor

Choose a reason for hiding this comment

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

"@types/node": "*",
"@types/semver": "^7.1.0",
"ansi-regex": "^5.0.1",
"ansi-styles": "^5.0.0",
"pretty-format": "^27.4.2",
"semver": "^7.3.2"
},
"devDependencies": {
"@types/semver": "^7.1.0"
},
"engines": {
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
}
Expand Down