diff --git a/packages-legacy/angular/project.json b/packages-legacy/angular/project.json index a8c628e7c358d..f5a4fd48c5ba9 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 d61504487fb7f..a437aed8dc70c 100644 --- a/packages-legacy/cypress/project.json +++ b/packages-legacy/cypress/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 c9584511a01fa..64d2dcd4aec4a 100644 --- a/packages-legacy/detox/project.json +++ b/packages-legacy/detox/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 dd1a57e326b81..0cd6f38b8bd49 100644 --- a/packages-legacy/devkit/project.json +++ b/packages-legacy/devkit/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 457d68b0954e2..d648484a4049c 100644 --- a/packages-legacy/esbuild/project.json +++ b/packages-legacy/esbuild/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 d1b4cf2eaeeed..c04dd74faca54 100644 --- a/packages-legacy/eslint-plugin-nx/project.json +++ b/packages-legacy/eslint-plugin-nx/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 4de4f3bd3b13e..f939c062d05cc 100644 --- a/packages-legacy/expo/project.json +++ b/packages-legacy/expo/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 34b6ffd998809..d2aa7c1be217e 100644 --- a/packages-legacy/express/project.json +++ b/packages-legacy/express/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 29f629e0e8711..9b1f1fe1ce4a9 100644 --- a/packages-legacy/jest/project.json +++ b/packages-legacy/jest/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 d30bd642a14b6..a71ed66d1c486 100644 --- a/packages-legacy/js/project.json +++ b/packages-legacy/js/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 0519ce96425bf..9965f0b775635 100644 --- a/packages-legacy/linter/project.json +++ b/packages-legacy/linter/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 814191f9e68aa..5e7c90a30f006 100644 --- a/packages-legacy/nest/project.json +++ b/packages-legacy/nest/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 23f5f5450945b..3d794c5c5e2ae 100644 --- a/packages-legacy/next/project.json +++ b/packages-legacy/next/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 32878da299bc6..e7326e5e9b5d5 100644 --- a/packages-legacy/node/project.json +++ b/packages-legacy/node/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 9e2f1e70bfd4a..938b156a64624 100644 --- a/packages-legacy/nx-plugin/project.json +++ b/packages-legacy/nx-plugin/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 5dddb52168417..3659ed64effbb 100644 --- a/packages-legacy/react-native/project.json +++ b/packages-legacy/react-native/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 a5bf7f40c3989..5966515dbeb7f 100644 --- a/packages-legacy/react/project.json +++ b/packages-legacy/react/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 b3f679208281f..07371eea78150 100644 --- a/packages-legacy/rollup/project.json +++ b/packages-legacy/rollup/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 2844f508263fb..ee271a24e35b4 100644 --- a/packages-legacy/storybook/project.json +++ b/packages-legacy/storybook/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 7ebee0e77ca69..097fb4fe62673 100644 --- a/packages-legacy/vite/project.json +++ b/packages-legacy/vite/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 5fbc75a76dc7f..1c7adf79b1e9c 100644 --- a/packages-legacy/web/project.json +++ b/packages-legacy/web/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 ab0c2707ac645..54f7c2483ce9f 100644 --- a/packages-legacy/webpack/project.json +++ b/packages-legacy/webpack/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 46126eb5a3e1c..29f4595800caa 100644 --- a/packages-legacy/workspace/project.json +++ b/packages-legacy/workspace/project.json @@ -5,8 +5,11 @@ "projectType": "library", "targets": { "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 243fe7dece147..0262a96866dfc 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')