Skip to content

Commit

Permalink
chore(repo): add conformance rule for our package.json files (#29078)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry authored Dec 19, 2024
1 parent 2eb5243 commit dfd5014
Show file tree
Hide file tree
Showing 9 changed files with 855 additions and 285 deletions.
40 changes: 39 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,43 @@
"nxCloudUrl": "https://staging.nx.app",
"parallel": 1,
"bust": 1,
"defaultBase": "master"
"defaultBase": "master",
"conformance": {
"rules": [
{
"rule": "@nx/workspace-plugin/conformance-rules/project-package-json",
"projects": [
"!.",
"!create-nx-*",
"!cypress",
"!detox",
"!devkit",
"!esbuild",
"!eslint-plugin",
"!eslint",
"!expo",
"!express",
"!jest",
"!js",
"!module-federation",
"!nest",
"!next",
"!node",
"!nuxt",
"!packages/nx/**",
"!plugin",
"!react-native",
"!react",
"!rollup",
"!rsbuild",
"!rspack",
"!storybook",
"!vue",
"!web",
"!webpack",
"!workspace"
]
}
]
}
}
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
"@eslint/eslintrc": "^2.1.1",
"@eslint/js": "^8.48.0",
"@floating-ui/react": "0.26.6",
"@jest/reporters": "^29.4.1",
"@jest/test-result": "^29.4.1",
"@jest/types": "^29.4.1",
"@jest/reporters": "29.7.0",
"@jest/test-result": "29.7.0",
"@jest/types": "29.6.3",
"@module-federation/enhanced": "0.7.6",
"@module-federation/sdk": "0.7.6",
"@monodon/rust": "2.1.1",
Expand All @@ -79,9 +79,9 @@
"@nx/js": "20.3.0-beta.0",
"@nx/next": "20.3.0-beta.0",
"@nx/playwright": "20.3.0-beta.0",
"@nx/powerpack-conformance": "1.1.0-beta.9",
"@nx/powerpack-enterprise-cloud": "1.1.0-beta.9",
"@nx/powerpack-license": "1.1.0-beta.9",
"@nx/powerpack-conformance": "1.1.1-alpha.1",
"@nx/powerpack-enterprise-cloud": "1.1.1-alpha.1",
"@nx/powerpack-license": "1.1.1-alpha.1",
"@nx/react": "20.3.0-beta.0",
"@nx/rsbuild": "20.3.0-beta.0",
"@nx/rspack": "20.3.0-beta.0",
Expand Down Expand Up @@ -219,13 +219,13 @@
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"jest": "29.7.0",
"jest-config": "^29.4.1",
"jest-diff": "^29.4.1",
"jest-config": "29.7.0",
"jest-diff": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-environment-node": "^29.4.1",
"jest-resolve": "^29.4.1",
"jest-runtime": "^29.4.1",
"jest-util": "^29.4.1",
"jest-environment-node": "29.7.0",
"jest-resolve": "29.7.0",
"jest-runtime": "29.7.0",
"jest-util": "29.7.0",
"js-tokens": "^4.0.0",
"jsonc-eslint-parser": "^2.1.0",
"jsonc-parser": "3.2.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/rspack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
},
"nx-migrations": {
"migrations": "./migrations.json"
},
"publishConfig": {
"access": "public"
}
}
645 changes: 374 additions & 271 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion scripts/patched-jest-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ module.exports = function (path, options) {
}
// Try to use the defaultResolver
try {
if (path.startsWith('@nx/')) throw new Error('custom resolution');
// powerpack packages are installed via npm and resolved like any other packages
if (path.startsWith('@nx/') && !path.startsWith('@nx/powerpack-')) {
throw new Error('custom resolution');
}
if (path.startsWith('nx/')) throw new Error('custom resolution');

if (path.indexOf('@nx/workspace') > -1) {
Expand Down
Loading

0 comments on commit dfd5014

Please sign in to comment.