@nx/workspace 19.5.0-canary.20240709-92e09d9 → 19.5.0-canary.20240711-2c4c2ae

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.5.0-canary.20240709-92e09d9",
3
+ "version": "19.5.0-canary.20240711-2c4c2ae",
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.5.0-canary.20240709-92e09d9",
64
+ "@nx/devkit": "19.5.0-canary.20240711-2c4c2ae",
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.5.0-canary.20240709-92e09d9",
70
- "@nrwl/workspace": "19.5.0-canary.20240709-92e09d9"
69
+ "nx": "19.5.0-canary.20240711-2c4c2ae",
70
+ "@nrwl/workspace": "19.5.0-canary.20240711-2c4c2ae"
71
71
  },
72
72
  "publishConfig": {
73
73
  "access": "public"
@@ -32,6 +32,7 @@ function normalizeOptions(options, tree) {
32
32
  ...packageJson.devDependencies,
33
33
  };
34
34
  const hasE2E = allDependencies['@nx/cypress'] || allDependencies['@nx/playwright'];
35
+ const connectedToCloud = (0, nx_cloud_utils_1.isNxCloudUsed)((0, devkit_1.readJson)(tree, 'nx.json'));
35
36
  return {
36
37
  workflowName,
37
38
  workflowFileName,
@@ -43,6 +44,7 @@ function normalizeOptions(options, tree) {
43
44
  hasE2E,
44
45
  nxCloudHost,
45
46
  tmpl: '',
47
+ connectedToCloud,
46
48
  };
47
49
  }
48
50
  function defaultBranchNeedsOriginPrefix(nxJson) {
@@ -51,10 +51,14 @@ jobs:
51
51
  displayName: Install Bun
52
52
 
53
53
  <% } %>
54
- # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
55
- # 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
54
+
55
+ # This enables task distribution via Nx Cloud
56
+ # Run this command as early as possible, before dependencies are installed
57
+ # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
58
+ <% if (connectedToCloud) { %>- script: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
59
+ <% } else { %># Connect your workspace by running "nx connect" and uncomment this
56
60
  # - script: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
57
-
61
+ <% } %>
58
62
  - script: <%= packageManagerInstall %>
59
63
  - script: git branch --track <%= mainBranch %> origin/<%= mainBranch %>
60
64
  condition: eq(variables['Build.Reason'], 'PullRequest')
@@ -19,10 +19,13 @@ pipelines:
19
19
  - npm install --prefix=$HOME/.local -g bun
20
20
 
21
21
  <% } %>
22
- # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
23
- # 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
22
+ # This enables task distribution via Nx Cloud
23
+ # Run this command as early as possible, before dependencies are installed
24
+ # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
25
+ <% if (connectedToCloud) { %>- <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
26
+ <% } else { %># Connect your workspace by running "nx connect" and uncomment this
24
27
  # - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
25
-
28
+ <% } %>
26
29
  - <%= packageManagerInstall %>
27
30
 
28
31
  - <%= packageManagerPrefix %> nx-cloud record -- nx format:check
@@ -35,10 +38,13 @@ pipelines:
35
38
  name: 'Build and test affected apps on "<%= mainBranch %>" branch changes'
36
39
  script:
37
40
  - export NX_BRANCH=$BITBUCKET_BRANCH
38
- # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
39
- # 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
41
+ # This enables task distribution via Nx Cloud
42
+ # Run this command as early as possible, before dependencies are installed
43
+ # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
44
+ <% if (connectedToCloud) { %>- <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
45
+ <% } else { %># Connect your workspace by running "nx connect" and uncomment this
40
46
  # - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
41
-
47
+ <% } %>
42
48
  <% if(packageManager == 'pnpm'){ %>
43
49
  - npm install --prefix=$HOME/.local -g pnpm@8
44
50
  <% } %>
@@ -21,10 +21,13 @@ jobs:
21
21
  <% } %>
22
22
 
23
23
 
24
- # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
25
- # 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
24
+ # This enables task distribution via Nx Cloud
25
+ # Run this command as early as possible, before dependencies are installed
26
+ # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
27
+ <% if (connectedToCloud) { %>- run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
28
+ <% } else { %># Connect your workspace by running "nx connect" and uncomment this
26
29
  # - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
27
-
30
+ <% } %>
28
31
  - run: <%= packageManagerInstall %>
29
32
  - nx/set-shas:
30
33
  main-branch-name: '<%= mainBranch %>'
@@ -28,10 +28,13 @@ jobs:
28
28
  bun-version: latest
29
29
  <% } %>
30
30
 
31
- # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
32
- # 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
31
+ # This enables task distribution via Nx Cloud
32
+ # Run this command as early as possible, before dependencies are installed
33
+ # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
34
+ <% if (connectedToCloud) { %>- run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
35
+ <% } else { %># Connect your workspace by running "nx connect" and uncomment this
33
36
  # - run: <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
34
-
37
+ <% } %>
35
38
  <% if(packageManager != 'bun'){ %>
36
39
  # Cache node_modules
37
40
  - uses: actions/setup-node@v3
@@ -15,10 +15,13 @@ variables:
15
15
  <% if(packageManager == 'bun'){ %>
16
16
  - npm install --prefix=$HOME/.local -g bun
17
17
  <% } %>
18
- # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
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
18
+ # This enables task distribution via Nx Cloud
19
+ # Run this command as early as possible, before dependencies are installed
20
+ # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
21
+ <% if (connectedToCloud) { %>- <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
22
+ <% } else { %># Connect your workspace by running "nx connect" and uncomment this
20
23
  # - <%= packageManagerPreInstallPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
21
-
24
+ <% } %>
22
25
  - <%= packageManagerInstall %>
23
26
  - NX_HEAD=$CI_COMMIT_SHA
24
27
  - NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}