diff --git a/e2e/angular/project.json b/e2e/angular/project.json index e9577b60c5..1f932311bf 100644 --- a/e2e/angular/project.json +++ b/e2e/angular/project.json @@ -6,27 +6,59 @@ "implicitDependencies": ["angular"], "targets": { "e2e-ci--src/config.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/cypress-component-tests.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/misc.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/module-federation.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/ng-add.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/projects.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/tailwind.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/ngrx.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/cypress/project.json b/e2e/cypress/project.json index ab3a58599d..948526f16f 100644 --- a/e2e/cypress/project.json +++ b/e2e/cypress/project.json @@ -6,9 +6,17 @@ "implicitDependencies": ["cypress", "react"], "targets": { "e2e-ci--src/cypress.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/cypress-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/detox/project.json b/e2e/detox/project.json index 84f30356d8..5433f8630b 100644 --- a/e2e/detox/project.json +++ b/e2e/detox/project.json @@ -6,15 +6,31 @@ "implicitDependencies": ["detox"], "targets": { "e2e-macos-ci--src/detox.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-macos-ci--src/detox-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/detox-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs"] }, "e2e-ci--src/detox.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs"] } } diff --git a/e2e/esbuild/project.json b/e2e/esbuild/project.json index 061ff1989e..889f86ab26 100644 --- a/e2e/esbuild/project.json +++ b/e2e/esbuild/project.json @@ -6,6 +6,10 @@ "implicitDependencies": ["esbuild"], "targets": { "e2e-ci--src/esbuild.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/eslint/project.json b/e2e/eslint/project.json index 4acce91b8c..a5f157d2fd 100644 --- a/e2e/eslint/project.json +++ b/e2e/eslint/project.json @@ -6,18 +6,18 @@ "implicitDependencies": ["eslint"], "targets": { "e2e-ci--src/linter.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/linter-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] - }, - "run-e2e-tests": { - "executor": "@nx/jest:jest", - "options": { - "jestConfig": "e2e/eslint/jest.config.ts", - "runInBand": true - }, - "outputs": ["{workspaceRoot}/coverage/e2e/eslint"] } } } diff --git a/e2e/gradle/project.json b/e2e/gradle/project.json index 56387be4cb..f4e0815027 100644 --- a/e2e/gradle/project.json +++ b/e2e/gradle/project.json @@ -6,6 +6,10 @@ "implicitDependencies": ["eslint"], "targets": { "e2e-ci--src/gradle.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/jest/project.json b/e2e/jest/project.json index e2b121f6d1..443b5c6dcd 100644 --- a/e2e/jest/project.json +++ b/e2e/jest/project.json @@ -6,12 +6,24 @@ "implicitDependencies": ["jest"], "targets": { "e2e-ci--src/jest.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/jest-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/jest-root.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/js/project.json b/e2e/js/project.json index 3658588251..99dbff3e8f 100644 --- a/e2e/js/project.json +++ b/e2e/js/project.json @@ -6,21 +6,45 @@ "implicitDependencies": ["jest"], "targets": { "e2e-ci--src/js-executor-node.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/js-executor-swc.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/js-executor-tsc.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/js-generators.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs"] }, "e2e-ci--src/js-inlining.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/js-packaging.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/lerna-smoke-tests/project.json b/e2e/lerna-smoke-tests/project.json index bda24f08af..3019723ad9 100644 --- a/e2e/lerna-smoke-tests/project.json +++ b/e2e/lerna-smoke-tests/project.json @@ -5,10 +5,11 @@ "projectType": "application", "implicitDependencies": ["nx", "devkit"], "targets": { - "e2e-lerna-smoke-tests:e2e-ci--src/lerna-smoke-tests.test.ts": { - "inputs": ["e2eInputs"] - }, "e2e-ci--src/lerna-smoke-tests.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/next/project.json b/e2e/next/project.json index f780ed26aa..5076502a08 100644 --- a/e2e/next/project.json +++ b/e2e/next/project.json @@ -6,33 +6,73 @@ "implicitDependencies": ["next"], "targets": { "e2e-ci--src/next.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/next-appdir.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/next-component-tests.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/next-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/next-playwright.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/next-playwright-standalone-eslint.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/next-storybook.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/next-styles.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/next-svgr.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/next-webpack.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/node/project.json b/e2e/node/project.json index 33a1ad84fa..68b997f7bf 100644 --- a/e2e/node/project.json +++ b/e2e/node/project.json @@ -6,18 +6,38 @@ "implicitDependencies": ["node", "nest", "webpack"], "targets": { "e2e-ci--src/node.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/node-esbuild.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/node-server.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/webpack.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs"] }, "e2e-ci--src/node-webpack.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/nuxt/project.json b/e2e/nuxt/project.json index bb30a1a4b3..0aedb73712 100644 --- a/e2e/nuxt/project.json +++ b/e2e/nuxt/project.json @@ -6,6 +6,10 @@ "implicitDependencies": ["nuxt"], "targets": { "e2e-ci--src/nuxt.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/nx-init/project.json b/e2e/nx-init/project.json index ad788b2668..748cbab881 100644 --- a/e2e/nx-init/project.json +++ b/e2e/nx-init/project.json @@ -6,18 +6,38 @@ "implicitDependencies": ["nx", "angular", "react", "js", "nest"], "targets": { "e2e-ci--src/nx-init-angular.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/nx-init-monorepo.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/nx-init-nest.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/nx-init-npm-repo.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/nx-init-react.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/nx/project.json b/e2e/nx/project.json index 1fd786ac16..7794b2080c 100644 --- a/e2e/nx/project.json +++ b/e2e/nx/project.json @@ -6,36 +6,80 @@ "implicitDependencies": ["nx", "js"], "targets": { "e2e-ci--src/affected-graph.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/cache.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/extras.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/invoke-runner.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/misc.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/nx-cloud.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/nxw.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/run.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/watch.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/workspace-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/workspace.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/playwright/project.json b/e2e/playwright/project.json index 32608a9e12..8a9f1c1140 100644 --- a/e2e/playwright/project.json +++ b/e2e/playwright/project.json @@ -6,6 +6,10 @@ "implicitDependencies": ["playwright"], "targets": { "e2e-ci--src/playwright.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/plugin/project.json b/e2e/plugin/project.json index df96328fdc..9223e90b7e 100644 --- a/e2e/plugin/project.json +++ b/e2e/plugin/project.json @@ -6,6 +6,10 @@ "implicitDependencies": ["create-nx-plugin"], "targets": { "e2e-ci--src/nx-plugin.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/react/project.json b/e2e/react/project.json index cf2e0196a6..7238d98cf4 100644 --- a/e2e/react/project.json +++ b/e2e/react/project.json @@ -6,24 +6,52 @@ "implicitDependencies": ["react"], "targets": { "e2e-ci--src/react-package.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/react.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/cypress-component-tests.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/playwright.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/react-module-federation.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/react-vite.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/react-webpack.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/release/project.json b/e2e/release/project.json index e61e1d305c..095a7a510e 100644 --- a/e2e/release/project.json +++ b/e2e/release/project.json @@ -6,36 +6,80 @@ "implicitDependencies": ["nx", "js"], "targets": { "e2e-ci--src/conventional-commits-config.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/create-github-release.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/custom-registries.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/first-release.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/independent-projects.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/lock-file-updates.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/multiple-release-branches.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/nx-release-git-operations.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/pre-version-command.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/private-js-packages.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/release.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/remix/project.json b/e2e/remix/project.json index 53c5ee023a..667c2df4f6 100644 --- a/e2e/remix/project.json +++ b/e2e/remix/project.json @@ -5,5 +5,13 @@ "projectType": "application", "implicitDependencies": ["remix"], "// targets": "to see all targets run: nx show project e2e-remix --web", - "targets": {} + "targets": { + "e2e-ci--src/nx-remix.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], + "inputs": ["e2eInputs", "^production"] + } + } } diff --git a/e2e/remix/tests/nx-remix.test.ts b/e2e/remix/src/nx-remix.test.ts similarity index 100% rename from e2e/remix/tests/nx-remix.test.ts rename to e2e/remix/src/nx-remix.test.ts diff --git a/e2e/rollup/project.json b/e2e/rollup/project.json index c9ec7659af..2e144b16cd 100644 --- a/e2e/rollup/project.json +++ b/e2e/rollup/project.json @@ -6,6 +6,10 @@ "implicitDependencies": ["rollup", "js"], "targets": { "e2e-ci--src/rollup.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/storybook/project.json b/e2e/storybook/project.json index 0d094c81e1..98ae5b568e 100644 --- a/e2e/storybook/project.json +++ b/e2e/storybook/project.json @@ -6,12 +6,24 @@ "implicitDependencies": ["storybook"], "targets": { "e2e-ci--src/storybook-angular.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/storybook-nested.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/storybook.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/utils/global-setup.ts b/e2e/utils/global-setup.ts index 2adfa07032..5cc94f587a 100644 --- a/e2e/utils/global-setup.ts +++ b/e2e/utils/global-setup.ts @@ -1,59 +1,63 @@ -import { join } from 'path'; - -import { registerTsConfigPaths } from '../../packages/nx/src/plugins/js/utils/register'; -import { startLocalRegistry } from '@nx/js/plugins/jest/local-registry'; -import { exec } from 'child_process'; -import { tmpdir } from 'tmp'; -import { existsSync, removeSync } from 'fs-extra'; import { Config } from '@jest/types'; +import { startLocalRegistry } from '@nx/js/plugins/jest/local-registry'; +import { existsSync, removeSync } from 'fs-extra'; import * as isCI from 'is-ci'; - -const LARGE_BUFFER = 1024 * 1000000; +import { exec, execSync } from 'node:child_process'; +import { join } from 'node:path'; +import { registerTsConfigPaths } from '../../packages/nx/src/plugins/js/utils/register'; +import { runLocalRelease } from '../../scripts/local-registry/populate-storage'; export default async function (globalConfig: Config.ConfigGlobals) { const isVerbose: boolean = process.env.NX_VERBOSE_LOGGING === 'true' || !!globalConfig.verbose; - const storageLocation = join( - tmpdir, - 'local-registry/storage', - process.env.NX_TASK_TARGET_PROJECT ?? '' - ); + + /** + * For e2e-ci we populate the verdaccio storage up front, but for other workflows we need + * to run the full local release process before running tests. + */ + const requiresLocalRelease = + !process.env.NX_TASK_TARGET_TARGET?.startsWith('e2e-ci'); + global.e2eTeardown = await startLocalRegistry({ localRegistryTarget: '@nx/nx-source:local-registry', verbose: isVerbose, - storage: storageLocation, + clearStorage: requiresLocalRelease, }); + /** + * Set the published version based on what has previously been loaded into the + * verdaccio storage. + */ + if (!requiresLocalRelease) { + const publishedVersion = await getPublishedVersion(); + if (publishedVersion) { + process.env.PUBLISHED_VERSION = publishedVersion; + } + } + if (process.env.NX_E2E_SKIP_CLEANUP !== 'true' || !existsSync('./build')) { if (!isCI) { registerTsConfigPaths(join(__dirname, '../../tsconfig.base.json')); const { e2eCwd } = await import('./get-env-info'); removeSync(e2eCwd); } - console.log('Publishing packages to local registry'); - const publishVersion = process.env.PUBLISHED_VERSION ?? 'major'; - await new Promise((res, rej) => { - const publishProcess = exec(`pnpm nx-release --local ${publishVersion}`, { - env: process.env, - maxBuffer: LARGE_BUFFER, - }); - let logs = Buffer.from(''); - if (isVerbose) { - publishProcess?.stdout?.pipe(process.stdout); - publishProcess?.stderr?.pipe(process.stderr); - } else { - publishProcess?.stdout?.on('data', (data) => (logs += data)); - publishProcess?.stderr?.on('data', (data) => (logs += data)); - } - publishProcess.on('exit', (code) => { - if (code && code > 0) { - if (!isVerbose) { - console.log(logs.toString()); - } - rej(code); - } - res(); - }); - }); + if (requiresLocalRelease) { + console.log('Publishing packages to local registry'); + const publishVersion = process.env.PUBLISHED_VERSION ?? 'major'; + // Always show full release logs on CI, they should only happen once via e2e-ci + await runLocalRelease(publishVersion, isCI || isVerbose); + } } } + +function getPublishedVersion(): Promise { + return new Promise((resolve) => { + // Resolve the published nx version from verdaccio + exec('npm view nx@latest version', (error, stdout, stderr) => { + if (error) { + return resolve(undefined); + } + return resolve(stdout.trim()); + }); + }); +} diff --git a/e2e/vite/project.json b/e2e/vite/project.json index 8eb6f4e82e..29ec3fd0bf 100644 --- a/e2e/vite/project.json +++ b/e2e/vite/project.json @@ -6,12 +6,24 @@ "implicitDependencies": ["vite"], "targets": { "e2e-ci--src/vite-crystal.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/vite-esm.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/vite-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/vue/project.json b/e2e/vue/project.json index fea1663741..0dd57098fb 100644 --- a/e2e/vue/project.json +++ b/e2e/vue/project.json @@ -6,12 +6,24 @@ "implicitDependencies": ["vue"], "targets": { "e2e-ci--src/vue-storybook.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/vue-tailwind.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/vue.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/web/project.json b/e2e/web/project.json index bc49f720db..a8417edb55 100644 --- a/e2e/web/project.json +++ b/e2e/web/project.json @@ -6,21 +6,45 @@ "implicitDependencies": ["web"], "targets": { "e2e-ci--src/file-server-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/file-server.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/web-legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/web-vite.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/web-webpack.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/web.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/webpack/project.json b/e2e/webpack/project.json index 8721e91afe..39627130f8 100644 --- a/e2e/webpack/project.json +++ b/e2e/webpack/project.json @@ -6,9 +6,17 @@ "implicitDependencies": ["webpack"], "targets": { "e2e-ci--src/webpack.legacy.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/webpack.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/e2e/workspace-create/project.json b/e2e/workspace-create/project.json index 15bff651dd..9b63a01216 100644 --- a/e2e/workspace-create/project.json +++ b/e2e/workspace-create/project.json @@ -6,12 +6,24 @@ "implicitDependencies": ["create-nx-workspace"], "targets": { "e2e-ci--src/create-nx-plugin.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/create-nx-workspace-npm.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] }, "e2e-ci--src/create-nx-workspace.test.ts": { + "dependsOn": [ + "nx:build-native", + "@nx/nx-source:populate-local-registry-storage" + ], "inputs": ["e2eInputs", "^production"] } } diff --git a/nx.json b/nx.json index 3aef72abe3..3e1d6f5ff8 100644 --- a/nx.json +++ b/nx.json @@ -29,6 +29,8 @@ "default", "{workspaceRoot}/jest.preset.js", "{workspaceRoot}/.verdaccio/config.yml", + "{workspaceRoot}/scripts/local-registry/**/*", + "{workspaceRoot}/scripts/nx-release.ts", { "env": "SELECTED_CLI" }, diff --git a/package.json b/package.json index 95ed23ce76..36d7c3d79b 100644 --- a/package.json +++ b/package.json @@ -368,6 +368,10 @@ "documentation" ] }, - "packageManager": "pnpm@8.15.7" + "packageManager": "pnpm@8.15.7", + "pnpm": { + "patchedDependencies": { + "@nx/js@19.0.0-rc.1": "patches/@nx__js@19.0.0-rc.1.patch" + } + } } - diff --git a/packages/js/src/plugins/jest/start-local-registry.ts b/packages/js/src/plugins/jest/start-local-registry.ts index 6c15a69535..04e14a5acb 100644 --- a/packages/js/src/plugins/jest/start-local-registry.ts +++ b/packages/js/src/plugins/jest/start-local-registry.ts @@ -5,15 +5,18 @@ import { execSync, fork } from 'child_process'; * @param localRegistryTarget the target to run to start the local registry e.g. workspace:local-registry * @param storage the storage location for the local registry * @param verbose whether to log verbose output + * @param clearStorage whether to clear the verdaccio storage before running the registry */ export function startLocalRegistry({ localRegistryTarget, storage, verbose, + clearStorage, }: { localRegistryTarget: string; storage?: string; verbose?: boolean; + clearStorage?: boolean; }) { if (!localRegistryTarget) { throw new Error(`localRegistryTarget is required`); @@ -22,7 +25,9 @@ export function startLocalRegistry({ const childProcess = fork( require.resolve('nx'), [ - ...`run ${localRegistryTarget} --location none --clear true`.split(' '), + ...`run ${localRegistryTarget} --location none --clear ${ + clearStorage ?? true + }`.split(' '), ...(storage ? [`--storage`, storage] : []), ], { stdio: 'pipe' } diff --git a/patches/@nx__js@19.0.0-rc.1.patch b/patches/@nx__js@19.0.0-rc.1.patch new file mode 100644 index 0000000000..e4e7adf831 --- /dev/null +++ b/patches/@nx__js@19.0.0-rc.1.patch @@ -0,0 +1,37 @@ +diff --git a/src/plugins/jest/start-local-registry.d.ts b/src/plugins/jest/start-local-registry.d.ts +index 4bd827c50cd20cc103ed42c0d2871d9a09dc2cce..05bfdc4e4ceb0722d0536b0ab29c9348fd436796 100644 +--- a/src/plugins/jest/start-local-registry.d.ts ++++ b/src/plugins/jest/start-local-registry.d.ts +@@ -3,10 +3,12 @@ + * @param localRegistryTarget the target to run to start the local registry e.g. workspace:local-registry + * @param storage the storage location for the local registry + * @param verbose whether to log verbose output ++ * @param clearStorage whether to clear the verdaccio storage before running the registry + */ + export declare function startLocalRegistry({ localRegistryTarget, storage, verbose, }: { + localRegistryTarget: string; + storage?: string; + verbose?: boolean; ++ clearStorage?: boolean; + }): Promise<() => void>; + export default startLocalRegistry; +diff --git a/src/plugins/jest/start-local-registry.js b/src/plugins/jest/start-local-registry.js +index 907fdc6bf0726c18cb88083a9a49d5dff85ded1f..15ffe0bf50740786d6a0ea205a6752f147f11351 100644 +--- a/src/plugins/jest/start-local-registry.js ++++ b/src/plugins/jest/start-local-registry.js +@@ -8,13 +8,13 @@ const child_process_1 = require("child_process"); + * @param storage the storage location for the local registry + * @param verbose whether to log verbose output + */ +-function startLocalRegistry({ localRegistryTarget, storage, verbose, }) { ++function startLocalRegistry({ localRegistryTarget, storage, verbose, clearStorage }) { + if (!localRegistryTarget) { + throw new Error(`localRegistryTarget is required`); + } + return new Promise((resolve, reject) => { + const childProcess = (0, child_process_1.fork)(require.resolve('nx'), [ +- ...`run ${localRegistryTarget} --location none --clear true`.split(' '), ++ ...`run ${localRegistryTarget} --location none --clear ${clearStorage ?? true}`.split(' '), + ...(storage ? [`--storage`, storage] : []), + ], { stdio: 'pipe' }); + const listener = (data) => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a9aff003b..dcd33bb5fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,11 @@ overrides: minimist: ^1.2.6 underscore: ^1.12.1 +patchedDependencies: + '@nx/js@19.0.0-rc.1': + hash: z63rtjgqni7rzlwwygpopqjue4 + path: patches/@nx__js@19.0.0-rc.1.patch + dependencies: '@docsearch/react': specifier: ^3.3.0 @@ -292,7 +297,7 @@ devDependencies: version: 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(ts-node@10.9.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/js': specifier: 19.0.0-rc.1 - version: 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + version: 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/next': specifier: 19.0.0-rc.1 version: 19.0.0-rc.1(@babel/core@7.23.2)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(esbuild@0.19.5)(html-webpack-plugin@5.5.0)(js-yaml@4.1.0)(next@14.0.4)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0)(webpack-cli@5.1.4)(webpack@5.88.0) @@ -7861,7 +7866,7 @@ packages: /@nrwl/js@19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0): resolution: {integrity: sha512-ECBo1+EAh8/ERnm5G15L8/+oAH0aeifSH9miPkP8bdrkuERByxLm7Mzf0xsrwrAr3cXjHefvnlZsxz/EpMoxdA==} dependencies: - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) transitivePeerDependencies: - '@babel/traverse' - '@swc-node/register' @@ -8319,7 +8324,7 @@ packages: '@nrwl/angular': 19.0.0-rc.1(@angular-devkit/build-angular@17.3.0)(@angular-devkit/core@17.3.0)(@angular-devkit/schematics@17.3.0)(@schematics/angular@17.3.0)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(esbuild@0.19.5)(eslint@8.57.0)(html-webpack-plugin@5.5.0)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(rxjs@7.8.1)(typescript@5.4.2)(verdaccio@5.31.0)(webpack-cli@5.1.4) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) '@nx/eslint': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(verdaccio@5.31.0) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/web': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/webpack': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(esbuild@0.19.5)(html-webpack-plugin@5.5.0)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0)(webpack-cli@5.1.4) '@nx/workspace': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86) @@ -8379,7 +8384,7 @@ packages: '@nrwl/cypress': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(cypress@13.6.6)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) '@nx/eslint': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(verdaccio@5.31.0) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@phenomnomnominal/tsquery': 5.0.1(typescript@5.4.2) cypress: 13.6.6 detect-port: 1.5.1 @@ -8440,7 +8445,7 @@ packages: dependencies: '@nrwl/esbuild': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(esbuild@0.19.5)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) chalk: 4.1.2 esbuild: 0.19.5 fast-glob: 3.2.7 @@ -8471,7 +8476,7 @@ packages: dependencies: '@nrwl/eslint-plugin-nx': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(@typescript-eslint/parser@7.4.0)(eslint-config-prettier@9.1.0)(eslint@8.57.0)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@typescript-eslint/parser': 7.4.0(eslint@8.57.0)(typescript@5.4.2) '@typescript-eslint/type-utils': 7.4.0(eslint@8.57.0)(typescript@5.4.2) '@typescript-eslint/utils': 7.4.0(eslint@8.57.0)(typescript@5.4.2) @@ -8504,7 +8509,7 @@ packages: optional: true dependencies: '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/linter': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(verdaccio@5.31.0) eslint: 8.57.0 js-yaml: 4.1.0 @@ -8529,7 +8534,7 @@ packages: '@jest/test-result': 29.7.0 '@nrwl/jest': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(ts-node@10.9.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@phenomnomnominal/tsquery': 5.0.1(typescript@5.4.2) chalk: 4.1.2 identity-obj-proxy: 3.0.0 @@ -8606,7 +8611,7 @@ packages: - typescript dev: true - /@nx/js@19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0): + /@nx/js@19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0): resolution: {integrity: sha512-RUZFR+XsxDoSFXsSKWq39GEfY0wBx0FIjDp01Bp/SPqrwSKZ/tVMdib0LE/mWM+oUV/NbFwVvJTbzaJ3RevqNg==} peerDependencies: verdaccio: ^5.0.4 @@ -8655,6 +8660,7 @@ packages: - supports-color - typescript dev: true + patched: true /@nx/linter@19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(verdaccio@5.31.0): resolution: {integrity: sha512-JJJTnk5Y0+gtuJ/tKMfG+oqmALFg6T3uF/hzo/fy1NHItpTp6BiW/WXCSI3Iim0XriEDipi9/1OM1L3tqMC9Lg==} @@ -8682,7 +8688,7 @@ packages: '@nrwl/next': 19.0.0-rc.1(@babel/core@7.23.2)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(esbuild@0.19.5)(html-webpack-plugin@5.5.0)(js-yaml@4.1.0)(next@14.0.4)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0)(webpack-cli@5.1.4)(webpack@5.88.0) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) '@nx/eslint': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(verdaccio@5.31.0) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/react': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0)(webpack@5.88.0) '@nx/web': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/webpack': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(esbuild@0.19.5)(html-webpack-plugin@5.5.0)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0)(webpack-cli@5.1.4) @@ -8919,7 +8925,7 @@ packages: dependencies: '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) '@nx/eslint': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(verdaccio@5.31.0) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@phenomnomnominal/tsquery': 5.0.1(typescript@5.4.2) '@playwright/test': 1.36.1 minimatch: 9.0.3 @@ -8944,7 +8950,7 @@ packages: '@nrwl/react': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0)(webpack@5.88.0) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) '@nx/eslint': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(verdaccio@5.31.0) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/web': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@phenomnomnominal/tsquery': 5.0.1(typescript@5.4.2) '@svgr/webpack': 8.0.1(typescript@5.4.2) @@ -8974,7 +8980,7 @@ packages: '@nx/cypress': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(cypress@13.6.6)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) '@nx/eslint': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(js-yaml@4.1.0)(nx@19.0.0-rc.1)(verdaccio@5.31.0) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@phenomnomnominal/tsquery': 5.0.1(typescript@5.4.2) semver: 7.6.0 tslib: 2.6.2 @@ -9001,7 +9007,7 @@ packages: dependencies: '@nrwl/vite': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0)(vite@5.0.8)(vitest@1.3.1) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@phenomnomnominal/tsquery': 5.0.1(typescript@5.4.2) '@swc/helpers': 0.5.3 enquirer: 2.3.6 @@ -9026,7 +9032,7 @@ packages: dependencies: '@nrwl/web': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) chalk: 4.1.2 detect-port: 1.5.1 http-server: 14.1.0 @@ -9050,7 +9056,7 @@ packages: '@babel/core': 7.24.0 '@nrwl/webpack': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(esbuild@0.19.5)(html-webpack-plugin@5.5.0)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0)(webpack-cli@5.1.4) '@nx/devkit': 19.0.0-rc.1(nx@19.0.0-rc.1) - '@nx/js': 19.0.0-rc.1(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) + '@nx/js': 19.0.0-rc.1(patch_hash=z63rtjgqni7rzlwwygpopqjue4)(@swc-node/register@1.8.0)(@swc/core@1.3.86)(@types/node@18.19.8)(nx@19.0.0-rc.1)(typescript@5.4.2)(verdaccio@5.31.0) ajv: 8.12.0 autoprefixer: 10.4.13(postcss@8.4.19) babel-loader: 9.1.3(@babel/core@7.24.0)(webpack@5.88.0) diff --git a/project.json b/project.json index 037817a6ca..0b7e5c25a9 100644 --- a/project.json +++ b/project.json @@ -9,6 +9,11 @@ "config": ".verdaccio/config.yml", "storage": "build/local-registry/storage" } + }, + "populate-local-registry-storage": { + "cache": true, + "command": "node ./scripts/local-registry/run-populate-storage.mjs", + "outputs": ["{workspaceRoot}/build/local-registry/storage"] } } } diff --git a/scripts/local-registry/populate-storage.js b/scripts/local-registry/populate-storage.js new file mode 100644 index 0000000000..8f39ac6987 --- /dev/null +++ b/scripts/local-registry/populate-storage.js @@ -0,0 +1,56 @@ +// @ts-check + +const { startLocalRegistry } = require('@nx/js/plugins/jest/local-registry'); +const { exec } = require('node:child_process'); +const { + LARGE_BUFFER, +} = require('nx/src/executors/run-commands/run-commands.impl'); + +async function populateLocalRegistryStorage() { + try { + const publishVersion = process.env.PUBLISHED_VERSION ?? 'major'; + const isVerbose = process.env.NX_VERBOSE_LOGGING === 'true'; + const registryTeardown = await startLocalRegistry({ + localRegistryTarget: '@nx/nx-source:local-registry', + verbose: isVerbose, + clearStorage: true, + }); + + console.log('Publishing packages to local registry to populate storage'); + await runLocalRelease(publishVersion, isVerbose); + + registryTeardown(); + console.log('Killed local registry process'); + } catch (err) { + console.error('Error:', err); + process.exit(1); + } +} +exports.populateLocalRegistryStorage = populateLocalRegistryStorage; + +function runLocalRelease(publishVersion, isVerbose) { + return new Promise((res, rej) => { + const publishProcess = exec(`pnpm nx-release --local ${publishVersion}`, { + env: process.env, + maxBuffer: LARGE_BUFFER, + }); + let logs = Buffer.from(''); + if (isVerbose) { + publishProcess?.stdout?.pipe(process.stdout); + publishProcess?.stderr?.pipe(process.stderr); + } else { + publishProcess?.stdout?.on('data', (data) => (logs += data)); + publishProcess?.stderr?.on('data', (data) => (logs += data)); + } + publishProcess.on('exit', (code) => { + if (code && code > 0) { + if (!isVerbose) { + console.log(logs.toString()); + } + rej(code); + } + res(undefined); + }); + }); +} +exports.runLocalRelease = runLocalRelease; diff --git a/scripts/local-registry/run-populate-storage.mjs b/scripts/local-registry/run-populate-storage.mjs new file mode 100644 index 0000000000..40faf0b8e1 --- /dev/null +++ b/scripts/local-registry/run-populate-storage.mjs @@ -0,0 +1,11 @@ +// @ts-check + +import { populateLocalRegistryStorage } from './populate-storage.js'; + +/** + * This script is primarily intended to run as part of e2e-ci, + * so we want to capture the full logs of the local release. + */ +process.env.NX_VERBOSE_LOGGING = 'true'; + +await populateLocalRegistryStorage();