diff --git a/packages-legacy/angular/project.json b/packages-legacy/angular/project.json index a8c628e7c358d5..f5a4fd48c5ba95 100644 --- a/packages-legacy/angular/project.json +++ b/packages-legacy/angular/project.json @@ -45,7 +45,14 @@ "dependsOn": ["build-ng", "build-base", "^build"], "executor": "nx:run-commands", "options": { - "command": "echo 'Built angular-legacy'" + "commands": [ + { + "command": "node ./scripts/copy-readme.js angular-legacy" + }, + { + "command": "echo 'Built angular-legacy'" + } + ] } } }, diff --git a/packages-legacy/cypress/project.json b/packages-legacy/cypress/project.json index d61504487fb7f0..b743aaa9199831 100644 --- a/packages-legacy/cypress/project.json +++ b/packages-legacy/cypress/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js cypress-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/cypress/index.ts", "tsConfig": "packages-legacy/cypress/tsconfig.json", diff --git a/packages-legacy/detox/project.json b/packages-legacy/detox/project.json index c9584511a01fac..36c5a43325c9cf 100644 --- a/packages-legacy/detox/project.json +++ b/packages-legacy/detox/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js detox-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/detox/index.ts", "tsConfig": "packages-legacy/detox/tsconfig.json", diff --git a/packages-legacy/devkit/project.json b/packages-legacy/devkit/project.json index dd1a57e326b81f..5c8c819b01ab22 100644 --- a/packages-legacy/devkit/project.json +++ b/packages-legacy/devkit/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js devkit-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/devkit/index.ts", "tsConfig": "packages-legacy/devkit/tsconfig.json", diff --git a/packages-legacy/esbuild/project.json b/packages-legacy/esbuild/project.json index 457d68b0954e29..458b8eb57fe729 100644 --- a/packages-legacy/esbuild/project.json +++ b/packages-legacy/esbuild/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js esbuild-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/esbuild/index.ts", "tsConfig": "packages-legacy/esbuild/tsconfig.json", diff --git a/packages-legacy/eslint-plugin-nx/project.json b/packages-legacy/eslint-plugin-nx/project.json index d1b4cf2eaeeed6..13a29ec9955b4b 100644 --- a/packages-legacy/eslint-plugin-nx/project.json +++ b/packages-legacy/eslint-plugin-nx/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js eslint-plugin-nx-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/eslint-plugin-nx/index.ts", "tsConfig": "packages-legacy/eslint-plugin-nx/tsconfig.json", diff --git a/packages-legacy/expo/project.json b/packages-legacy/expo/project.json index 4de4f3bd3b13e2..4721c63873bbbc 100644 --- a/packages-legacy/expo/project.json +++ b/packages-legacy/expo/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js expo-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/expo/index.ts", "tsConfig": "packages-legacy/expo/tsconfig.json", diff --git a/packages-legacy/express/project.json b/packages-legacy/express/project.json index 34b6ffd998809a..5bd86e4f5c5fa6 100644 --- a/packages-legacy/express/project.json +++ b/packages-legacy/express/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js express-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/express/index.ts", "tsConfig": "packages-legacy/express/tsconfig.json", diff --git a/packages-legacy/jest/project.json b/packages-legacy/jest/project.json index 29f629e0e8711c..34275dd55b7b71 100644 --- a/packages-legacy/jest/project.json +++ b/packages-legacy/jest/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js jest-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/jest/index.ts", "tsConfig": "packages-legacy/jest/tsconfig.json", diff --git a/packages-legacy/js/project.json b/packages-legacy/js/project.json index d30bd642a14b62..19bea5a6c39abe 100644 --- a/packages-legacy/js/project.json +++ b/packages-legacy/js/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js js-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/js/index.ts", "tsConfig": "packages-legacy/js/tsconfig.json", diff --git a/packages-legacy/linter/project.json b/packages-legacy/linter/project.json index 0519ce96425bf1..316f951a6c0da7 100644 --- a/packages-legacy/linter/project.json +++ b/packages-legacy/linter/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js linter-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/linter/index.ts", "tsConfig": "packages-legacy/linter/tsconfig.json", diff --git a/packages-legacy/nest/project.json b/packages-legacy/nest/project.json index 814191f9e68aa1..483d6115f9a1af 100644 --- a/packages-legacy/nest/project.json +++ b/packages-legacy/nest/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js nest-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/nest/index.ts", "tsConfig": "packages-legacy/nest/tsconfig.json", diff --git a/packages-legacy/next/project.json b/packages-legacy/next/project.json index 23f5f5450945be..867e179867ed57 100644 --- a/packages-legacy/next/project.json +++ b/packages-legacy/next/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js next-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/next/index.ts", "tsConfig": "packages-legacy/next/tsconfig.json", diff --git a/packages-legacy/node/project.json b/packages-legacy/node/project.json index 32878da299bc60..8f3de052699dc1 100644 --- a/packages-legacy/node/project.json +++ b/packages-legacy/node/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js node-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/node/index.ts", "tsConfig": "packages-legacy/node/tsconfig.json", diff --git a/packages-legacy/nx-plugin/project.json b/packages-legacy/nx-plugin/project.json index 9e2f1e70bfd4a1..721c9155c67b04 100644 --- a/packages-legacy/nx-plugin/project.json +++ b/packages-legacy/nx-plugin/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js nx-plugin-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/nx-plugin/index.ts", "tsConfig": "packages-legacy/nx-plugin/tsconfig.json", diff --git a/packages-legacy/react-native/project.json b/packages-legacy/react-native/project.json index 5dddb521684176..7dacadcc63d141 100644 --- a/packages-legacy/react-native/project.json +++ b/packages-legacy/react-native/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js react-native-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/react-native/index.ts", "tsConfig": "packages-legacy/react-native/tsconfig.json", diff --git a/packages-legacy/react/project.json b/packages-legacy/react/project.json index a5bf7f40c39890..29ce41e938645a 100644 --- a/packages-legacy/react/project.json +++ b/packages-legacy/react/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js react-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/react/index.ts", "tsConfig": "packages-legacy/react/tsconfig.json", diff --git a/packages-legacy/rollup/project.json b/packages-legacy/rollup/project.json index b3f679208281fc..922843aa399c0a 100644 --- a/packages-legacy/rollup/project.json +++ b/packages-legacy/rollup/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js rollup-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/rollup/index.ts", "tsConfig": "packages-legacy/rollup/tsconfig.json", diff --git a/packages-legacy/storybook/project.json b/packages-legacy/storybook/project.json index 2844f508263fb0..dc0e88dba4fbaa 100644 --- a/packages-legacy/storybook/project.json +++ b/packages-legacy/storybook/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js storybook-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/storybook/index.ts", "tsConfig": "packages-legacy/storybook/tsconfig.json", diff --git a/packages-legacy/vite/project.json b/packages-legacy/vite/project.json index 7ebee0e77ca697..1069a94de06b50 100644 --- a/packages-legacy/vite/project.json +++ b/packages-legacy/vite/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js vite-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/vite/index.ts", "tsConfig": "packages-legacy/vite/tsconfig.json", diff --git a/packages-legacy/web/project.json b/packages-legacy/web/project.json index 5fbc75a76dc7f2..ae1edad6c7a3f6 100644 --- a/packages-legacy/web/project.json +++ b/packages-legacy/web/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js web-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/web/index.ts", "tsConfig": "packages-legacy/web/tsconfig.json", diff --git a/packages-legacy/webpack/project.json b/packages-legacy/webpack/project.json index ab0c2707ac645a..ae0f07146ecabb 100644 --- a/packages-legacy/webpack/project.json +++ b/packages-legacy/webpack/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js webpack-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/webpack/index.ts", "tsConfig": "packages-legacy/webpack/tsconfig.json", diff --git a/packages-legacy/workspace/project.json b/packages-legacy/workspace/project.json index 46126eb5a3e1c7..cd241a9190bacd 100644 --- a/packages-legacy/workspace/project.json +++ b/packages-legacy/workspace/project.json @@ -5,8 +5,12 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build"], + "command": "node ./scripts/copy-readme.js workspace-legacy" + }, + "build:base": { "executor": "@nx/js:tsc", - "dependsOn": ["^build"], + "dependsOn": ["^build:base"], "options": { "main": "packages-legacy/workspace/index.ts", "tsConfig": "packages-legacy/workspace/tsconfig.json", diff --git a/scripts/copy-readme.js b/scripts/copy-readme.js index 243fe7dece147d..0262a96866dfce 100644 --- a/scripts/copy-readme.js +++ b/scripts/copy-readme.js @@ -2,7 +2,10 @@ const fs = require('fs'); const p = process.argv[2]; -let r = fs.readFileSync(`packages/${p}/README.md`).toString(); +const sourceReadmePath = !p.endsWith('-legacy') + ? `packages/${p}/README.md` + : `packages-legacy/${p.replace('-legacy', '')}/README.md`; +let r = fs.readFileSync(sourceReadmePath).toString(); r = r.replace( `{{links}}`, fs.readFileSync('scripts/readme-fragments/links.md')