@nx/workspace 19.0.1 → 19.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/workspace",
3
- "version": "19.0.1",
3
+ "version": "19.0.3",
4
4
  "private": false,
5
5
  "description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.",
6
6
  "repository": {
@@ -61,13 +61,13 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
- "@nx/devkit": "19.0.1",
64
+ "@nx/devkit": "19.0.3",
65
65
  "chalk": "^4.1.0",
66
66
  "enquirer": "~2.3.6",
67
67
  "tslib": "^2.3.0",
68
68
  "yargs-parser": "21.1.1",
69
- "nx": "19.0.1",
70
- "@nrwl/workspace": "19.0.1"
69
+ "nx": "19.0.3",
70
+ "@nrwl/workspace": "19.0.3"
71
71
  },
72
72
  "publishConfig": {
73
73
  "access": "public"
@@ -19,7 +19,7 @@ exports.ciWorkflowGenerator = ciWorkflowGenerator;
19
19
  function normalizeOptions(options, tree) {
20
20
  const { name: workflowName, fileName: workflowFileName } = (0, devkit_1.names)(options.name);
21
21
  const packageManager = (0, devkit_1.detectPackageManager)();
22
- const { exec: packageManagerPrefix, ciInstall: packageManagerInstall } = (0, devkit_1.getPackageManagerCommand)(packageManager);
22
+ const { exec: packageManagerPrefix, ciInstall: packageManagerInstall, dlx: packageManagerPreInstallPrefix, } = (0, devkit_1.getPackageManagerCommand)(packageManager);
23
23
  let nxCloudHost = 'nx.app';
24
24
  try {
25
25
  const nxCloudUrl = (0, nx_cloud_utils_1.getNxCloudUrl)((0, devkit_1.readJson)(tree, 'nx.json'));
@@ -38,6 +38,7 @@ function normalizeOptions(options, tree) {
38
38
  packageManager,
39
39
  packageManagerInstall,
40
40
  packageManagerPrefix,
41
+ packageManagerPreInstallPrefix,
41
42
  mainBranch: (0, default_base_1.deduceDefaultBase)(),
42
43
  hasE2E,
43
44
  nxCloudHost,
@@ -48,7 +48,7 @@ jobs:
48
48
  <% } %>
49
49
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
50
50
  # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
51
- # - script: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
51
+ # - script: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
52
52
 
53
53
  - script: <%= packageManagerInstall %>
54
54
  - script: git branch --track <%= mainBranch %> origin/<%= mainBranch %>
@@ -56,4 +56,5 @@ jobs:
56
56
 
57
57
  # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
58
58
  # - script: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
59
- - script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
59
+ - script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) lint test build<% if(hasE2E){ %>
60
+ - script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) --parallel 1 e2e-ci<% } %>
@@ -17,12 +17,13 @@ pipelines:
17
17
  <% } %>
18
18
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
19
19
  # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
20
- # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
20
+ # - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
21
21
 
22
22
  - <%= packageManagerInstall %>
23
23
 
24
24
  - <%= packageManagerPrefix %> nx-cloud record -- nx format:check
25
- - <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %> --base=origin/<%= mainBranch %>
25
+ - <%= packageManagerPrefix %> nx affected --base=origin/<%= mainBranch %> -t lint test build<% if(hasE2E){ %>
26
+ - <%= packageManagerPrefix %> nx affected --base=origin/<%= mainBranch %> --parallel 1 -t e2e-ci<% } %>
26
27
 
27
28
  branches:
28
29
  main:
@@ -32,7 +33,7 @@ pipelines:
32
33
  - export NX_BRANCH=$BITBUCKET_BRANCH
33
34
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
34
35
  # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
35
- # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
36
+ # - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
36
37
 
37
38
  <% if(packageManager == 'pnpm'){ %>
38
39
  - npm install --prefix=$HOME/.local -g pnpm@8
@@ -17,7 +17,7 @@ jobs:
17
17
 
18
18
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
19
19
  # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
20
- # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
20
+ # - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
21
21
 
22
22
  - run: <%= packageManagerInstall %>
23
23
  - nx/set-shas:
@@ -25,7 +25,8 @@ jobs:
25
25
 
26
26
  # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
27
27
  # - run: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
28
- - run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
28
+ - run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %>
29
+ - run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD --parallel 1 -t e2e-ci<% } %>
29
30
 
30
31
  workflows:
31
32
  version: 2
@@ -25,7 +25,7 @@ jobs:
25
25
 
26
26
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
27
27
  # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
28
- # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
28
+ # - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
29
29
 
30
30
  # Cache node_modules
31
31
  - uses: actions/setup-node@v3
@@ -37,4 +37,5 @@ jobs:
37
37
 
38
38
  # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
39
39
  # - run: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
40
- - run: <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
40
+ - run: <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %>
41
+ - run: <%= packageManagerPrefix %> nx affected --parallel 1 -t e2e-ci<% } %>
@@ -14,7 +14,7 @@ variables:
14
14
  <% } %>
15
15
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
16
16
  # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
17
- # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
17
+ # - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
18
18
 
19
19
  - <%= packageManagerInstall %>
20
20
  - NX_HEAD=$CI_COMMIT_SHA
@@ -22,4 +22,5 @@ variables:
22
22
 
23
23
  # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
24
24
  # - <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
25
- - <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
25
+ - <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %>
26
+ - <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD --parallel 1 -t e2e-ci<% } %>
@@ -133,7 +133,7 @@ function logDeprecationMessage(formats, options) {
133
133
  ? '@nx/angular:move'
134
134
  : '@nx/workspace:move';
135
135
  devkit_1.logger.warn((0, devkit_1.stripIndents) `
136
- In Nx 19, the project name and destination will no longer be derived.
136
+ In Nx 20, the project name and destination will no longer be derived.
137
137
  Please provide the exact new project name and destination in the future.
138
138
  Example: nx g ${callingGenerator} --projectName ${options.projectName} --destination ${formats['derived'].destination}` +
139
139
  (options.projectName !== formats['derived'].newProjectName
@@ -71,7 +71,6 @@ function normalizeOptions(options) {
71
71
  const normalized = {
72
72
  ...options,
73
73
  };
74
- normalized.name = (0, devkit_1.names)(options.name).fileName;
75
74
  if (!options.directory) {
76
75
  normalized.directory = normalized.name;
77
76
  }
@@ -5,7 +5,6 @@ const devkit_1 = require("@nx/devkit");
5
5
  const presets_1 = require("../utils/presets");
6
6
  const path_1 = require("path");
7
7
  async function presetGenerator(tree, options) {
8
- options = normalizeOptions(options);
9
8
  const presetTask = await createPreset(tree, options);
10
9
  return async () => {
11
10
  (0, devkit_1.installPackagesTask)(tree);
@@ -316,7 +315,3 @@ async function createPreset(tree, options) {
316
315
  throw new Error(`Invalid preset ${options.preset}`);
317
316
  }
318
317
  }
319
- function normalizeOptions(options) {
320
- options.name = (0, devkit_1.names)(options.name).fileName;
321
- return options;
322
- }
@@ -38,7 +38,8 @@ function updateJestConfig(tree, schema, projectConfig) {
38
38
  const { createSourceFile, ScriptTarget, isPropertyAssignment, isArrayLiteralExpression, isStringLiteral, } = tsModule;
39
39
  const projectToRemove = schema.projectName;
40
40
  const rootConfigPath = (0, jest_config_1.findRootJestConfig)(tree);
41
- if (!tree.exists(rootConfigPath) ||
41
+ if (!rootConfigPath ||
42
+ !tree.exists(rootConfigPath) ||
42
43
  !tree.exists((0, path_1.join)(projectConfig.root, 'jest.config.ts')) ||
43
44
  isUsingUtilityFunction(tree) ||
44
45
  !isMonorepoConfig(tree)) {