File tree Expand file tree Collapse file tree 4 files changed +18
-42
lines changed
Expand file tree Collapse file tree 4 files changed +18
-42
lines changed Original file line number Diff line number Diff line change 3535 "dependencies" : {
3636 "@clack/prompts" : " ^0.10.0" ,
3737 "@swc/helpers" : " 0.5.11" ,
38- "@nx/devkit" : " 21.1.0 " ,
39- "create-nx-workspace" : " 21.1.0 " ,
38+ "@nx/devkit" : " 21.1.2 " ,
39+ "create-nx-workspace" : " 21.1.2 " ,
4040 "enquirer" : " ^2.4.1" ,
4141 "hpagent" : " ^1.2.0" ,
4242 "js-yaml" : " ^4.1.0" ,
5454 "@commitlint/cli" : " ^19.3.0" ,
5555 "@commitlint/config-angular" : " ^19.3.0" ,
5656 "@jest/globals" : " 29.7.0" ,
57- "@nx/eslint-plugin" : " 21.1.0 " ,
58- "@nx/jest" : " 21.1.0 " ,
59- "@nx/js" : " 21.1.0 " ,
60- "@nx/node" : " 21.1.0 " ,
61- "@nx/plugin" : " 21.1.0 " ,
62- "@nx/workspace" : " 21.1.0 " ,
57+ "@nx/eslint-plugin" : " 21.1.2 " ,
58+ "@nx/jest" : " 21.1.2 " ,
59+ "@nx/js" : " 21.1.2 " ,
60+ "@nx/node" : " 21.1.2 " ,
61+ "@nx/plugin" : " 21.1.2 " ,
62+ "@nx/workspace" : " 21.1.2 " ,
6363 "@swc-node/register" : " 1.9.1" ,
6464 "@swc/cli" : " 0.3.12" ,
6565 "@swc/core" : " 1.5.7" ,
8383 "jsonc-eslint-parser" : " ^2.1.0" ,
8484 "jest-mock" : " 29.7.0" ,
8585 "lint-staged" : " ^16.0.0" ,
86- "nx" : " 21.1.0 " ,
86+ "nx" : " 21.1.2 " ,
8787 "prettier" : " 2.6.2" ,
8888 "ts-jest" : " 29.1.0" ,
8989 "ts-node" : " 10.9.1" ,
Original file line number Diff line number Diff line change 44 "targets" : {
55 "local-registry" : {
66 "executor" : " @nx/js:verdaccio" ,
7- "continuous" : true ,
87 "options" : {
98 "port" : 4873 ,
109 "listenAddress" : " 0.0.0.0" ,
1110 "config" : " .verdaccio/config.yml" ,
12- "storage" : " tmp/local-registry/storage" ,
13- "clear" : false
11+ "storage" : " tmp/local-registry/storage"
1412 }
1513 },
1614 "populate-local-registry" : {
1715 "cache" : true ,
18- "inputs" : [
19- {
20- "input" : " production" ,
21- "projects" : [" tag:npm:public" ]
22- },
23- " {workspaceRoot}/scripts/local-registry"
24- ],
25- "dependsOn" : [
26- " local-registry" ,
27- {
28- "target" : " build" ,
29- "projects" : [" tag:npm:public" ]
30- }
31- ],
16+ "parallelism" : false ,
17+ "inputs" : [" production" ],
18+ "dependsOn" : [" build" ],
3219 "command" : " ts-node -P ./tools/tsconfig.tools.json ./tools/scripts/populate-local-registry.ts" ,
3320 "outputs" : [" {workspaceRoot}/tmp/local-registry/storage" ]
3421 }
Original file line number Diff line number Diff line change 44 */
55import { startLocalRegistry } from '@nx/js/plugins/jest/local-registry' ;
66import { releasePublish , releaseVersion } from 'nx/release' ;
7- import { readdirSync } from 'fs' ;
87import { joinPathFragments , workspaceRoot } from '@nx/devkit' ;
98
10- function isFolderEmptySync ( folderPath : string ) : boolean {
11- try {
12- const files = readdirSync ( folderPath ) ;
13- const relevantFiles = files . filter ( file => file !== '.verdaccio-db.json' ) ;
14- return relevantFiles . length === 0 ;
15- } catch ( error ) {
16- return true ; // we consider the folder empty if we cannot read it
17- }
18- }
19-
209export default async ( ) => {
2110
2211 // local registry target to run
@@ -29,11 +18,11 @@ export default async () => {
2918
3019 const isVerbose = process . env . NX_VERBOSE_LOGGING === 'true' ;
3120
32- /**
33- * We populate the verdaccio storage up front, so we only need to start the local registry and serves that storage.
34- * Otherwise, if the storage is empty, we do a full release to populate it again. This allows speeding up e2e tests
35- */
36- const requiresLocalRelease = isFolderEmptySync ( storage ) || process . env . FORCE_LOCAL_RELEASE === 'true' ;
21+ /**
22+ * For e2e-ci we populate the verdaccio storage up front, but for other workflows we need
23+ * to run the full local release process before running tests.
24+ */
25+ const requiresLocalRelease = ! process . env . NX_TASK_TARGET_TARGET ?. startsWith ( 'e2e-ci' ) ;
3726
3827 global . stopLocalRegistry = await startLocalRegistry ( {
3928 localRegistryTarget,
You can’t perform that action at this time.
0 commit comments