fix(misc): properly add extra dependencies to packages (#19334)

This commit is contained in:
Jason Jean 2023-09-26 00:09:29 -04:00 committed by GitHub
parent c2297297c1
commit 5cc87bfdc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 107 additions and 95 deletions

View File

@ -63,13 +63,13 @@
"outputs": ["{workspaceRoot}/build/packages/angular"], "outputs": ["{workspaceRoot}/build/packages/angular"],
"dependsOn": ["build-ng", "build-base", "^build"], "dependsOn": ["build-ng", "build-base", "^build"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js angular",
"node ./scripts/copy-readme.js angular",
"node ./scripts/add-dependency-to-build.js angular @nrwl/angular"
],
"parallel": false "parallel": false
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js angular @nrwl/angular"
},
"lint": {} "lint": {}
}, },
"implicitDependencies": [] "implicitDependencies": []

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/cypress"], "outputs": ["{workspaceRoot}/build/packages/cypress"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js cypress"
"node ./scripts/copy-readme.js cypress",
"node ./scripts/add-dependency-to-build.js cypress @nrwl/cypress"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js cypress @nrwl/cypress"
},
"lint": {} "lint": {}
} }
} }

View File

@ -48,11 +48,11 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/detox"], "outputs": ["{workspaceRoot}/build/packages/detox"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js detox"
"node ./scripts/copy-readme.js detox",
"node ./scripts/add-dependency-to-build.js detox @nrwl/detox"
]
} }
},
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js detox @nrwl/detox"
} }
} }
} }

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/devkit"], "outputs": ["{workspaceRoot}/build/packages/devkit"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js devkit"
"node ./scripts/copy-readme.js devkit",
"node ./scripts/add-dependency-to-build.js devkit @nrwl/devkit"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js devkit @nrwl/devkit"
},
"lint": {} "lint": {}
} }
} }

View File

@ -54,6 +54,9 @@
] ]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js esbuild @nrwl/esbuild"
},
"lint": {} "lint": {}
} }
} }

View File

@ -49,12 +49,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/eslint-plugin"], "outputs": ["{workspaceRoot}/build/packages/eslint-plugin"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js eslint-plugin"
"node ./scripts/copy-readme.js eslint-plugin",
"node ./scripts/add-dependency-to-build.js eslint-plugin @nrwl/eslint-plugin-nx"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js eslint-plugin @nrwl/eslint-plugin-nx"
},
"lint": {} "lint": {}
} }
} }

View File

@ -50,11 +50,11 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/expo"], "outputs": ["{workspaceRoot}/build/packages/expo"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js expo"
"node ./scripts/copy-readme.js expo",
"node ./scripts/add-dependency-to-build.js expo @nrwl/expo"
]
} }
},
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js expo @nrwl/expo"
} }
}, },
"tags": [] "tags": []

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/express"], "outputs": ["{workspaceRoot}/build/packages/express"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js express"
"node ./scripts/copy-readme.js express",
"node ./scripts/add-dependency-to-build.js express @nrwl/express"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js express @nrwl/express"
},
"lint": {} "lint": {}
}, },
"implicitDependencies": ["node"] "implicitDependencies": ["node"]

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/jest"], "outputs": ["{workspaceRoot}/build/packages/jest"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js jest"
"node ./scripts/copy-readme.js jest",
"node ./scripts/add-dependency-to-build.js jest @nrwl/jest"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js jest @nrwl/jest"
},
"lint": {} "lint": {}
} }
} }

View File

@ -50,11 +50,11 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/js"], "outputs": ["{workspaceRoot}/build/packages/js"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js js"
"node ./scripts/copy-readme.js js",
"node ./scripts/add-dependency-to-build.js js @nrwl/js"
]
} }
},
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js js @nrwl/js"
} }
}, },
"tags": [] "tags": []

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/linter"], "outputs": ["{workspaceRoot}/build/packages/linter"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js linter"
"node ./scripts/copy-readme.js linter",
"node ./scripts/add-dependency-to-build.js linter @nrwl/linter"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js linter @nrwl/linter"
},
"lint": {} "lint": {}
}, },
"implicitDependencies": ["eslint-plugin"] "implicitDependencies": ["eslint-plugin"]

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/nest"], "outputs": ["{workspaceRoot}/build/packages/nest"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js nest"
"node ./scripts/copy-readme.js nest",
"node ./scripts/add-dependency-to-build.js nest @nrwl/nest"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js nest @nrwl/nest"
},
"lint": {} "lint": {}
}, },
"implicitDependencies": ["node", "linter"] "implicitDependencies": ["node", "linter"]

View File

@ -53,12 +53,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/next"], "outputs": ["{workspaceRoot}/build/packages/next"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js next"
"node ./scripts/copy-readme.js next",
"node ./scripts/add-dependency-to-build.js next @nrwl/next"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js next @nrwl/next"
},
"lint": {} "lint": {}
} }
} }

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/node"], "outputs": ["{workspaceRoot}/build/packages/node"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js node"
"node ./scripts/copy-readme.js node",
"node ./scripts/add-dependency-to-build.js node @nrwl/node"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js node @nrwl/node"
},
"lint": {} "lint": {}
} }
} }

View File

@ -95,14 +95,14 @@
}, },
{ {
"command": "node ./scripts/copy-readme.js nx" "command": "node ./scripts/copy-readme.js nx"
},
{
"command": "node ./scripts/add-dependency-to-build.js nx @nrwl/tao"
} }
], ],
"parallel": false "parallel": false
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js nx @nrwl/tao"
},
"lint": {}, "lint": {},
"test": {}, "test": {},
"test-native": {} "test-native": {}

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/plugin"], "outputs": ["{workspaceRoot}/build/packages/plugin"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js plugin"
"node ./scripts/copy-readme.js plugin",
"node ./scripts/add-dependency-to-build.js plugin @nrwl/nx-plugin"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js plugin @nrwl/nx-plugin"
},
"lint": {} "lint": {}
} }
} }

View File

@ -44,11 +44,11 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/react-native"], "outputs": ["{workspaceRoot}/build/packages/react-native"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js react-native"
"node ./scripts/copy-readme.js react-native",
"node ./scripts/add-dependency-to-build.js react-native @nrwl/react-native"
]
} }
},
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js react-native @nrwl/react-native"
} }
} }
} }

View File

@ -58,12 +58,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/react"], "outputs": ["{workspaceRoot}/build/packages/react"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js react"
"node ./scripts/copy-readme.js react",
"node ./scripts/add-dependency-to-build.js react @nrwl/react"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js react @nrwl/react"
},
"lint": {} "lint": {}
} }
} }

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/rollup"], "outputs": ["{workspaceRoot}/build/packages/rollup"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js rollup"
"node ./scripts/copy-readme.js rollup",
"node ./scripts/add-dependency-to-build.js rollup @nrwl/rollup"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js rollup @nrwl/rollup"
},
"lint": {} "lint": {}
} }
} }

View File

@ -58,12 +58,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/storybook"], "outputs": ["{workspaceRoot}/build/packages/storybook"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js storybook"
"node ./scripts/copy-readme.js storybook",
"node ./scripts/add-dependency-to-build.js storybook @nrwl/storybook"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js storybook @nrwl/storybook"
},
"lint": {} "lint": {}
} }
} }

View File

@ -59,12 +59,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/vite"], "outputs": ["{workspaceRoot}/build/packages/vite"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js vite"
"node ./scripts/copy-readme.js vite",
"node ./scripts/add-dependency-to-build.js vite @nrwl/vite"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js vite @nrwl/vite"
},
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/linter:eslint",
"options": { "options": {

View File

@ -53,12 +53,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/web"], "outputs": ["{workspaceRoot}/build/packages/web"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js web"
"node ./scripts/copy-readme.js web",
"node ./scripts/add-dependency-to-build.js web @nrwl/web"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js web @nrwl/web"
},
"lint": {} "lint": {}
} }
} }

View File

@ -48,12 +48,12 @@
"executor": "nx:run-commands", "executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/webpack"], "outputs": ["{workspaceRoot}/build/packages/webpack"],
"options": { "options": {
"commands": [ "command": "node ./scripts/copy-readme.js webpack"
"node ./scripts/copy-readme.js webpack",
"node ./scripts/add-dependency-to-build.js webpack @nrwl/webpack"
]
} }
}, },
"add-extra-dependencies": {
"command": "node ./scripts/add-dependency-to-build.js webpack @nrwl/webpack"
},
"lint": {} "lint": {}
} }
} }

View File

@ -75,16 +75,14 @@
} }
}, },
"build": { "build": {
"executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/build/packages/workspace"], "outputs": ["{workspaceRoot}/build/packages/workspace"],
"command": "node ./scripts/copy-readme.js workspace"
},
"add-extra-dependencies": {
"executor": "nx:run-commands",
"options": { "options": {
"commands": [ "commands": [
{ "node ./scripts/add-dependency-to-build.js workspace nx",
"command": "node ./scripts/copy-readme.js workspace"
},
{
"command": "node ./scripts/add-dependency-to-build.js workspace nx"
},
"node ./scripts/add-dependency-to-build.js workspace @nrwl/workspace" "node ./scripts/add-dependency-to-build.js workspace @nrwl/workspace"
], ],
"parallel": false "parallel": false

View File

@ -5,6 +5,7 @@ const [package, dependency] = process.argv.slice(2);
const pkgPath = join(__dirname, '../build/packages', package, 'package.json'); const pkgPath = join(__dirname, '../build/packages', package, 'package.json');
const packageJson = readJsonSync(pkgPath); const packageJson = readJsonSync(pkgPath);
packageJson.dependencies[dependency] = '*'; const version = packageJson.version;
packageJson.dependencies[dependency] = version;
writeJsonSync(pkgPath, packageJson, { spaces: 2 }); writeJsonSync(pkgPath, packageJson, { spaces: 2 });

View File

@ -79,6 +79,11 @@ const LARGE_BUFFER = 1024 * 1000000;
runNxReleaseVersion(); runNxReleaseVersion();
execSync(`pnpm nx run-many -t add-extra-dependencies --parallel 8`, {
stdio: isVerboseLogging ? [0, 1, 2] : 'ignore',
maxBuffer: LARGE_BUFFER,
});
let changelogCommand = `pnpm nx release changelog ${options.version} --tagVersionPrefix="" --interactive`; let changelogCommand = `pnpm nx release changelog ${options.version} --tagVersionPrefix="" --interactive`;
if (options.from) { if (options.from) {
changelogCommand += ` --from ${options.from}`; changelogCommand += ` --from ${options.from}`;
@ -103,6 +108,11 @@ const LARGE_BUFFER = 1024 * 1000000;
runNxReleaseVersion(); runNxReleaseVersion();
execSync(`pnpm nx run-many -t add-extra-dependencies --parallel 8`, {
stdio: isVerboseLogging ? [0, 1, 2] : 'ignore',
maxBuffer: LARGE_BUFFER,
});
if (options.dryRun) { if (options.dryRun) {
console.warn('Not Publishing because --dryRun was passed'); console.warn('Not Publishing because --dryRun was passed');
} else { } else {