diff --git a/CHANGELOG.md b/CHANGELOG.md index a99c2fb23f35..fec173370b0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ ### Chore & Maintenance +- `[*]` Fix inconsistent workspace prefixes ([#13217](https://github.com/facebook/jest/pull/13217)) + ### Performance ## 29.0.2 diff --git a/constraints.pro b/constraints.pro index a3ce99af0e0e..b9179863ccfb 100644 --- a/constraints.pro +++ b/constraints.pro @@ -17,10 +17,6 @@ gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange2, Depende % Ignore peer dependencies DependencyType \= 'peerDependencies', DependencyType2 \= 'peerDependencies', - % Ignore workspace:*: we use both `workspace:*` and real version such as `^28.0.0-alpha.8` to reference package in monorepo - % TODO: in the future we should make it consistent and remove this ignore - DependencyRange \= 'workspace:*', - DependencyRange2 \= 'workspace:*', % A list of exception to same version rule \+ member(DependencyIdent, [ % Allow enzyme example workspace use a older version react and react-dom, because enzyme don't support react 17 diff --git a/examples/angular/package.json b/examples/angular/package.json index 4e651adc9bd8..96b8b27260f7 100644 --- a/examples/angular/package.json +++ b/examples/angular/package.json @@ -24,9 +24,9 @@ "@babel/preset-env": "^7.1.0", "@babel/preset-typescript": "^7.0.0", "@types/jest": "^27.4.0", - "babel-jest": "workspace:*", + "babel-jest": "workspace:^", "babel-plugin-transform-typescript-metadata": "*", - "jest": "workspace:*", + "jest": "workspace:^", "jest-zone-patch": "*" } } diff --git a/examples/async/package.json b/examples/async/package.json index 0aad9aa5f6a5..76c83de2a4da 100644 --- a/examples/async/package.json +++ b/examples/async/package.json @@ -5,8 +5,8 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/automatic-mocks/package.json b/examples/automatic-mocks/package.json index 4289a81e4597..942dd35ee0c6 100644 --- a/examples/automatic-mocks/package.json +++ b/examples/automatic-mocks/package.json @@ -5,8 +5,8 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/enzyme/package.json b/examples/enzyme/package.json index 41ba3928b558..2da88b5902ca 100644 --- a/examples/enzyme/package.json +++ b/examples/enzyme/package.json @@ -10,10 +10,10 @@ "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", "@babel/preset-react": "^7.12.1", - "babel-jest": "workspace:*", + "babel-jest": "workspace:^", "enzyme": "*", "enzyme-adapter-react-16": "*", - "jest": "workspace:*" + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/expect-extend/package.json b/examples/expect-extend/package.json index c1c5e8ea2798..7101e8f6ab28 100644 --- a/examples/expect-extend/package.json +++ b/examples/expect-extend/package.json @@ -6,10 +6,10 @@ "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", "@babel/preset-typescript": "^7.0.0", - "@jest/globals": "workspace:*", - "babel-jest": "workspace:*", - "expect": "workspace:*", - "jest": "workspace:*", + "@jest/globals": "workspace:^", + "babel-jest": "workspace:^", + "expect": "workspace:^", + "jest": "workspace:^", "typescript": "^4.8.2" }, "scripts": { diff --git a/examples/getting-started/package.json b/examples/getting-started/package.json index ede124a1f08e..ac8ef772504c 100644 --- a/examples/getting-started/package.json +++ b/examples/getting-started/package.json @@ -5,8 +5,8 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/jquery/package.json b/examples/jquery/package.json index 6b125a32579e..c7808e236cae 100644 --- a/examples/jquery/package.json +++ b/examples/jquery/package.json @@ -5,8 +5,8 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "dependencies": { "jquery": "^3.2.1" diff --git a/examples/manual-mocks/package.json b/examples/manual-mocks/package.json index 5c55909d7389..a48654f32d80 100644 --- a/examples/manual-mocks/package.json +++ b/examples/manual-mocks/package.json @@ -5,8 +5,8 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/module-mock/package.json b/examples/module-mock/package.json index d0eb838c5c88..ac8977d022b4 100644 --- a/examples/module-mock/package.json +++ b/examples/module-mock/package.json @@ -5,8 +5,8 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/mongodb/package.json b/examples/mongodb/package.json index 6a552bdb71c6..8edc62d7d24a 100644 --- a/examples/mongodb/package.json +++ b/examples/mongodb/package.json @@ -4,15 +4,15 @@ "main": "./index.js", "private": true, "dependencies": { - "jest-environment-node": "workspace:*", + "jest-environment-node": "workspace:^", "mongodb": "^4.3.1", "mongodb-memory-server": "^8.3.0" }, "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/react-native/package.json b/examples/react-native/package.json index 70d626c00df1..e5a37aef692c 100644 --- a/examples/react-native/package.json +++ b/examples/react-native/package.json @@ -13,8 +13,8 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", - "babel-jest": "workspace:*", - "jest": "workspace:*", + "babel-jest": "workspace:^", + "jest": "workspace:^", "metro-react-native-babel-preset": "0.70.3", "react-test-renderer": "18.0.0" } diff --git a/examples/react-testing-library/package.json b/examples/react-testing-library/package.json index f77f1e9078a4..9caf65477ae3 100644 --- a/examples/react-testing-library/package.json +++ b/examples/react-testing-library/package.json @@ -11,8 +11,8 @@ "@babel/preset-env": "^7.1.0", "@babel/preset-react": "^7.12.1", "@testing-library/react": "^12.1.5", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/react/package.json b/examples/react/package.json index 5d24a3b06a8d..f100ce09fc35 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -10,8 +10,8 @@ "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", "@babel/preset-react": "^7.12.1", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/snapshot/package.json b/examples/snapshot/package.json index cb49aba118ea..2080a7f59882 100644 --- a/examples/snapshot/package.json +++ b/examples/snapshot/package.json @@ -9,8 +9,8 @@ "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", "@babel/preset-react": "^7.12.1", - "babel-jest": "workspace:*", - "jest": "workspace:*", + "babel-jest": "workspace:^", + "jest": "workspace:^", "react-test-renderer": "17.0.2" }, "scripts": { diff --git a/examples/timer/package.json b/examples/timer/package.json index b6540587b1f2..c03dfc6a4b55 100644 --- a/examples/timer/package.json +++ b/examples/timer/package.json @@ -5,8 +5,8 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/preset-env": "^7.1.0", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/examples/typescript/package.json b/examples/typescript/package.json index 6799e61d96dc..ba82fc707a0d 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -13,8 +13,8 @@ "@babel/preset-react": "^7.12.1", "@babel/preset-typescript": "^7.0.0", "@types/jest": "^27.4.0", - "babel-jest": "workspace:*", - "jest": "workspace:*" + "babel-jest": "workspace:^", + "jest": "workspace:^" }, "scripts": { "test": "jest" diff --git a/package.json b/package.json index 82eea80f8b1d..bc5cdce410cb 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "@babel/preset-typescript": "^7.0.0", "@babel/register": "^7.0.0", "@crowdin/cli": "^3.5.2", - "@jest/globals": "workspace:*", - "@jest/test-utils": "workspace:*", + "@jest/globals": "workspace:^", + "@jest/test-utils": "workspace:^", "@lerna-lite/cli": "^1.10.0", "@microsoft/api-extractor": "^7.29.0", "@tsconfig/node14": "^1.0.3", @@ -51,14 +51,14 @@ "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-reports": "^3.1.3", - "jest": "workspace:*", - "jest-changed-files": "workspace:*", + "jest": "workspace:^", + "jest-changed-files": "workspace:^", "jest-junit": "^14.0.0", - "jest-mock": "workspace:*", + "jest-mock": "workspace:^", "jest-runner-tsd": "^4.0.0", "jest-serializer-ansi-escapes": "^2.0.1", "jest-silent-reporter": "^0.5.0", - "jest-snapshot": "workspace:*", + "jest-snapshot": "workspace:^", "jest-watch-typeahead": "^2.1.1", "jquery": "^3.2.1", "js-yaml": "^4.1.0", @@ -172,10 +172,10 @@ "resolutions": { "@types/node": "~14.14.45", "ansi-escapes/type-fest": "^2.0.0", - "babel-jest": "workspace:*", + "babel-jest": "workspace:^", "enzyme/cheerio": "=1.0.0-rc.3", - "jest": "workspace:*", - "jest-environment-node": "workspace:*", + "jest": "workspace:^", + "jest-environment-node": "workspace:^", "react-native@0.69.2": "patch:react-native@npm:0.69.2#.yarn/patches/react-native-npm-0.68.1-8830b7be0d.patch" }, "packageManager": "yarn@3.2.3" diff --git a/yarn.lock b/yarn.lock index 45a62ae93ec9..da87d7749673 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2715,7 +2715,7 @@ __metadata: languageName: unknown linkType: soft -"@jest/globals@workspace:*, @jest/globals@workspace:^, @jest/globals@workspace:packages/jest-globals": +"@jest/globals@workspace:^, @jest/globals@workspace:packages/jest-globals": version: 0.0.0-use.local resolution: "@jest/globals@workspace:packages/jest-globals" dependencies: @@ -2737,8 +2737,8 @@ __metadata: "@babel/preset-typescript": ^7.0.0 "@babel/register": ^7.0.0 "@crowdin/cli": ^3.5.2 - "@jest/globals": "workspace:*" - "@jest/test-utils": "workspace:*" + "@jest/globals": "workspace:^" + "@jest/test-utils": "workspace:^" "@lerna-lite/cli": ^1.10.0 "@microsoft/api-extractor": ^7.29.0 "@tsconfig/node14": ^1.0.3 @@ -2778,14 +2778,14 @@ __metadata: istanbul-lib-coverage: ^3.0.0 istanbul-lib-report: ^3.0.0 istanbul-reports: ^3.1.3 - jest: "workspace:*" - jest-changed-files: "workspace:*" + jest: "workspace:^" + jest-changed-files: "workspace:^" jest-junit: ^14.0.0 - jest-mock: "workspace:*" + jest-mock: "workspace:^" jest-runner-tsd: ^4.0.0 jest-serializer-ansi-escapes: ^2.0.1 jest-silent-reporter: ^0.5.0 - jest-snapshot: "workspace:*" + jest-snapshot: "workspace:^" jest-watch-typeahead: ^2.1.1 jquery: ^3.2.1 js-yaml: ^4.1.0 @@ -2929,7 +2929,7 @@ __metadata: languageName: unknown linkType: soft -"@jest/test-utils@workspace:*, @jest/test-utils@workspace:^, @jest/test-utils@workspace:packages/test-utils": +"@jest/test-utils@workspace:^, @jest/test-utils@workspace:packages/test-utils": version: 0.0.0-use.local resolution: "@jest/test-utils@workspace:packages/test-utils" dependencies: @@ -5663,10 +5663,10 @@ __metadata: "@babel/preset-env": ^7.1.0 "@babel/preset-typescript": ^7.0.0 "@types/jest": ^27.4.0 - babel-jest: "workspace:*" + babel-jest: "workspace:^" babel-plugin-transform-typescript-metadata: "*" core-js: ^3.2.1 - jest: "workspace:*" + jest: "workspace:^" jest-zone-patch: "*" rxjs: ^7.5.5 tslib: ^2.0.0 @@ -6078,7 +6078,7 @@ __metadata: languageName: node linkType: hard -"babel-jest@workspace:*, babel-jest@workspace:packages/babel-jest": +"babel-jest@workspace:^, babel-jest@workspace:packages/babel-jest": version: 0.0.0-use.local resolution: "babel-jest@workspace:packages/babel-jest" dependencies: @@ -9349,8 +9349,8 @@ __metadata: dependencies: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" languageName: unknown linkType: soft @@ -9360,8 +9360,8 @@ __metadata: dependencies: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" languageName: unknown linkType: soft @@ -9372,10 +9372,10 @@ __metadata: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 "@babel/preset-react": ^7.12.1 - babel-jest: "workspace:*" + babel-jest: "workspace:^" enzyme: "*" enzyme-adapter-react-16: "*" - jest: "workspace:*" + jest: "workspace:^" react: ^16.14.0 react-dom: ^16.14.0 languageName: unknown @@ -9388,10 +9388,10 @@ __metadata: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 "@babel/preset-typescript": ^7.0.0 - "@jest/globals": "workspace:*" - babel-jest: "workspace:*" - expect: "workspace:*" - jest: "workspace:*" + "@jest/globals": "workspace:^" + babel-jest: "workspace:^" + expect: "workspace:^" + jest: "workspace:^" typescript: ^4.8.2 languageName: unknown linkType: soft @@ -9402,8 +9402,8 @@ __metadata: dependencies: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" languageName: unknown linkType: soft @@ -9413,8 +9413,8 @@ __metadata: dependencies: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" jquery: ^3.2.1 languageName: unknown linkType: soft @@ -9425,8 +9425,8 @@ __metadata: dependencies: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" languageName: unknown linkType: soft @@ -9436,8 +9436,8 @@ __metadata: dependencies: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" lodash: ^4.17.19 languageName: unknown linkType: soft @@ -9448,9 +9448,9 @@ __metadata: dependencies: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 - babel-jest: "workspace:*" - jest: "workspace:*" - jest-environment-node: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" + jest-environment-node: "workspace:^" mongodb: ^4.3.1 mongodb-memory-server: ^8.3.0 languageName: unknown @@ -9462,8 +9462,8 @@ __metadata: dependencies: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" metro-react-native-babel-preset: 0.70.3 react: 18.0.0 react-native: 0.69.2 @@ -9479,8 +9479,8 @@ __metadata: "@babel/preset-env": ^7.1.0 "@babel/preset-react": ^7.12.1 "@testing-library/react": ^12.1.5 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" react: 17.0.2 react-dom: ^17.0.1 languageName: unknown @@ -9493,8 +9493,8 @@ __metadata: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 "@babel/preset-react": ^7.12.1 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" react: 17.0.2 react-dom: ^17.0.1 languageName: unknown @@ -9507,8 +9507,8 @@ __metadata: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 "@babel/preset-react": ^7.12.1 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" react: 17.0.2 react-test-renderer: 17.0.2 languageName: unknown @@ -9520,8 +9520,8 @@ __metadata: dependencies: "@babel/core": ^7.11.6 "@babel/preset-env": ^7.1.0 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" languageName: unknown linkType: soft @@ -9534,8 +9534,8 @@ __metadata: "@babel/preset-react": ^7.12.1 "@babel/preset-typescript": ^7.0.0 "@types/jest": ^27.4.0 - babel-jest: "workspace:*" - jest: "workspace:*" + babel-jest: "workspace:^" + jest: "workspace:^" react: 17.0.2 react-dom: ^17.0.1 typescript: ^4.8.2 @@ -9596,7 +9596,7 @@ __metadata: languageName: node linkType: hard -"expect@workspace:*, expect@workspace:^, expect@workspace:packages/expect": +"expect@workspace:^, expect@workspace:packages/expect": version: 0.0.0-use.local resolution: "expect@workspace:packages/expect" dependencies: @@ -12239,7 +12239,7 @@ __metadata: languageName: node linkType: hard -"jest-changed-files@workspace:*, jest-changed-files@workspace:^, jest-changed-files@workspace:packages/jest-changed-files": +"jest-changed-files@workspace:^, jest-changed-files@workspace:packages/jest-changed-files": version: 0.0.0-use.local resolution: "jest-changed-files@workspace:packages/jest-changed-files" dependencies: @@ -12417,7 +12417,7 @@ __metadata: languageName: unknown linkType: soft -"jest-environment-node@workspace:*, jest-environment-node@workspace:packages/jest-environment-node": +"jest-environment-node@workspace:^, jest-environment-node@workspace:packages/jest-environment-node": version: 0.0.0-use.local resolution: "jest-environment-node@workspace:packages/jest-environment-node" dependencies: @@ -12608,7 +12608,7 @@ __metadata: languageName: unknown linkType: soft -"jest-mock@workspace:*, jest-mock@workspace:^, jest-mock@workspace:packages/jest-mock": +"jest-mock@workspace:^, jest-mock@workspace:packages/jest-mock": version: 0.0.0-use.local resolution: "jest-mock@workspace:packages/jest-mock" dependencies: @@ -12827,7 +12827,7 @@ __metadata: languageName: node linkType: hard -"jest-snapshot@workspace:*, jest-snapshot@workspace:^, jest-snapshot@workspace:packages/jest-snapshot": +"jest-snapshot@workspace:^, jest-snapshot@workspace:packages/jest-snapshot": version: 0.0.0-use.local resolution: "jest-snapshot@workspace:packages/jest-snapshot" dependencies: @@ -13076,7 +13076,7 @@ __metadata: languageName: node linkType: hard -"jest@workspace:*, jest@workspace:packages/jest": +"jest@workspace:^, jest@workspace:packages/jest": version: 0.0.0-use.local resolution: "jest@workspace:packages/jest" dependencies: