@nx/workspace 19.0.0-beta.1 → 19.0.0-beta.11

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/migrations.json CHANGED
@@ -1,11 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "15-7-0-split-configuration-into-project-json-files": {
4
- "version": "15.7.0-beta.0",
5
- "description": "Split global configuration files (e.g., workspace.json) into individual project.json files.",
6
- "cli": "nx",
7
- "implementation": "./src/migrations/update-15-7-0/split-configuration-into-project-json-files"
8
- },
9
3
  "update-16-0-0-add-nx-packages": {
10
4
  "cli": "nx",
11
5
  "version": "16.0.0-beta.1",
@@ -26,18 +20,6 @@
26
20
  }
27
21
  },
28
22
  "packageJsonUpdates": {
29
- "15.8.0": {
30
- "version": "15.8.0-beta.2",
31
- "x-prompt": "Do you want to update to TypeScript v4.9?",
32
- "requires": {
33
- "typescript": ">=4.8.2 <4.9.0"
34
- },
35
- "packages": {
36
- "typescript": {
37
- "version": "~4.9.5"
38
- }
39
- }
40
- },
41
23
  "16.1.0": {
42
24
  "version": "16.1.0-beta.0",
43
25
  "x-prompt": "Do you want to update to TypeScript v5.0?",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/workspace",
3
- "version": "19.0.0-beta.1",
3
+ "version": "19.0.0-beta.11",
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.0-beta.1",
64
+ "@nx/devkit": "19.0.0-beta.11",
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.0-beta.1",
70
- "@nrwl/workspace": "19.0.0-beta.1"
69
+ "nx": "19.0.0-beta.11",
70
+ "@nrwl/workspace": "19.0.0-beta.11"
71
71
  },
72
72
  "publishConfig": {
73
73
  "access": "public"
@@ -41,15 +41,17 @@ jobs:
41
41
  echo "##vso[task.setvariable variable=BASE_SHA]$LAST_SHA"
42
42
  fi
43
43
 
44
+ <% if(packageManager == 'pnpm'){ %>
45
+ - script: npm install --prefix=$HOME/.local -g pnpm@8
46
+ displayName: Install PNPM
47
+
48
+ <% } %>
44
49
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
45
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
46
51
  # - script: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
47
52
 
48
- <% if(packageManager == 'pnpm'){ %>
49
- - script: npm install --prefix=$HOME/.local -g pnpm@8
50
- displayName: Install PNPM
51
- <% } %>- script: <%= packageManagerInstall %>
52
- - script: git branch --track main origin/main
53
+ - script: <%= packageManagerInstall %>
54
+ - script: git branch --track <%= mainBranch %> origin/<%= mainBranch %>
53
55
  condition: eq(variables['Build.Reason'], 'PullRequest')
54
56
 
55
57
  - script: <%= packageManagerPrefix %> nx-cloud record -- nx format:check --base=$(BASE_SHA) --head=$(HEAD_SHA)
@@ -11,13 +11,14 @@ pipelines:
11
11
  script:
12
12
  - export NX_BRANCH=$BITBUCKET_PR_ID
13
13
 
14
+ <% if(packageManager == 'pnpm'){ %>
15
+ - npm install --prefix=$HOME/.local -g pnpm@8
16
+
17
+ <% } %>
14
18
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
15
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
16
20
  # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
17
21
 
18
- <% if(packageManager == 'pnpm'){ %>
19
- - npm install --prefix=$HOME/.local -g pnpm@8
20
- <% } %>
21
22
  - <%= packageManagerInstall %>
22
23
 
23
24
  - <%= packageManagerPrefix %> nx-cloud record -- nx format:check
@@ -9,23 +9,20 @@ jobs:
9
9
  - image: cimg/node:lts-browsers
10
10
  steps:
11
11
  - checkout
12
+ <% if(packageManager == 'pnpm'){ %>
13
+ - run:
14
+ name: Install PNPM
15
+ command: npm install --prefix=$HOME/.local -g pnpm@8
16
+ <% } %>
12
17
 
13
18
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
14
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
15
20
  # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
16
21
 
17
- <% if(packageManager == 'pnpm'){ %>
18
- - run:
19
- name: Install PNPM
20
- command: npm install --prefix=$HOME/.local -g pnpm@8
21
- <% } %>- run: <%= packageManagerInstall %>
22
+ - run: <%= packageManagerInstall %>
22
23
  - nx/set-shas:
23
24
  main-branch-name: '<%= mainBranch %>'
24
25
 
25
- # Required for nx affected if we're on a branch
26
- - run: git branch --track main origin/main
27
- condition: eq(variables['Build.Reason'], 'PullRequest')
28
-
29
26
  - run: <%= packageManagerPrefix %> nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD
30
27
  - run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
31
28
 
@@ -17,16 +17,17 @@ jobs:
17
17
  - uses: actions/checkout@v4
18
18
  with:
19
19
  fetch-depth: 0
20
+ <% if(packageManager == 'pnpm'){ %>
21
+ - uses: pnpm/action-setup@v2
22
+ with:
23
+ version: 8
24
+ <% } %>
20
25
 
21
26
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
22
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
23
28
  # - run: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
24
29
 
25
- <% if(packageManager == 'pnpm'){ %>
26
- - uses: pnpm/action-setup@v2
27
- with:
28
- version: 8
29
- <% } %># Cache node_modules
30
+ # Cache node_modules
30
31
  - uses: actions/setup-node@v3
31
32
  with:
32
33
  node-version: 20
@@ -34,8 +35,5 @@ jobs:
34
35
  - run: <%= packageManagerInstall %>
35
36
  - uses: nrwl/nx-set-shas@v4
36
37
 
37
- - run: git branch --track main origin/main
38
- if: ${{ github.event_name == 'pull_request' }}
39
-
40
38
  - run: <%= packageManagerPrefix %> nx-cloud record -- nx format:check
41
39
  - run: <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
@@ -9,13 +9,13 @@ variables:
9
9
  - main
10
10
  - merge_requests
11
11
  script:
12
+ <% if(packageManager == 'pnpm'){ %>
13
+ - npm install --prefix=$HOME/.local -g pnpm@8
14
+ <% } %>
12
15
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
13
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
14
17
  # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
15
18
 
16
- <% if(packageManager == 'pnpm'){ %>
17
- - npm install --prefix=$HOME/.local -g pnpm@8
18
- <% } %>
19
19
  - <%= packageManagerInstall %>
20
20
  - NX_HEAD=$CI_COMMIT_SHA
21
21
  - NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}
@@ -76,7 +76,7 @@
76
76
  "e2eTestRunner": {
77
77
  "description": "The tool to use for running e2e tests.",
78
78
  "type": "string",
79
- "enum": ["cypress", "playwright", "jest", "detox", "none"]
79
+ "enum": ["playwright", "cypress", "jest", "detox", "none"]
80
80
  },
81
81
  "ssr": {
82
82
  "description": "Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application.",
@@ -16,7 +16,6 @@ async function presetGenerator(tree, options) {
16
16
  exports.presetGenerator = presetGenerator;
17
17
  exports.default = presetGenerator;
18
18
  async function createPreset(tree, options) {
19
- console.log('Crate preset');
20
19
  const nxJson = (0, devkit_1.readNxJson)(tree);
21
20
  const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
22
21
  nxJson.useInferencePlugins !== false;
@@ -33,7 +32,7 @@ async function createPreset(tree, options) {
33
32
  linter: options.linter,
34
33
  standalone: options.standaloneApi,
35
34
  routing: options.routing,
36
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
35
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
37
36
  bundler: options.bundler,
38
37
  ssr: options.ssr,
39
38
  prefix: options.prefix,
@@ -50,7 +49,7 @@ async function createPreset(tree, options) {
50
49
  routing: options.routing,
51
50
  rootProject: true,
52
51
  standalone: options.standaloneApi,
53
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
52
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
54
53
  bundler: options.bundler,
55
54
  ssr: options.ssr,
56
55
  prefix: options.prefix,
@@ -66,7 +65,7 @@ async function createPreset(tree, options) {
66
65
  style: options.style,
67
66
  linter: options.linter,
68
67
  bundler: options.bundler ?? 'webpack',
69
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
68
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
70
69
  addPlugin,
71
70
  });
72
71
  }
@@ -81,7 +80,7 @@ async function createPreset(tree, options) {
81
80
  linter: options.linter,
82
81
  rootProject: true,
83
82
  bundler: options.bundler ?? 'vite',
84
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
83
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
85
84
  unitTestRunner: options.bundler === 'vite' ? 'vitest' : 'jest',
86
85
  addPlugin,
87
86
  });
@@ -94,7 +93,7 @@ async function createPreset(tree, options) {
94
93
  directory: (0, path_1.join)('apps', options.name),
95
94
  projectNameAndRootFormat: 'as-provided',
96
95
  linter: options.linter,
97
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
96
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
98
97
  unitTestRunner: 'vitest',
99
98
  addPlugin,
100
99
  });
@@ -107,7 +106,7 @@ async function createPreset(tree, options) {
107
106
  directory: '.',
108
107
  projectNameAndRootFormat: 'as-provided',
109
108
  linter: options.linter,
110
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
109
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
111
110
  rootProject: true,
112
111
  unitTestRunner: 'vitest',
113
112
  addPlugin,
@@ -122,7 +121,7 @@ async function createPreset(tree, options) {
122
121
  projectNameAndRootFormat: 'as-provided',
123
122
  style: options.style,
124
123
  linter: options.linter,
125
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
124
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
126
125
  addPlugin,
127
126
  });
128
127
  }
@@ -136,7 +135,7 @@ async function createPreset(tree, options) {
136
135
  style: options.style,
137
136
  linter: options.linter,
138
137
  rootProject: true,
139
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
138
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
140
139
  unitTestRunner: 'vitest',
141
140
  addPlugin,
142
141
  });
@@ -150,7 +149,7 @@ async function createPreset(tree, options) {
150
149
  projectNameAndRootFormat: 'as-provided',
151
150
  style: options.style,
152
151
  linter: options.linter,
153
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
152
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
154
153
  addPlugin,
155
154
  });
156
155
  }
@@ -164,7 +163,7 @@ async function createPreset(tree, options) {
164
163
  style: options.style,
165
164
  linter: options.linter,
166
165
  rootProject: true,
167
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
166
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
168
167
  unitTestRunner: 'vitest',
169
168
  addPlugin,
170
169
  });
@@ -180,7 +179,7 @@ async function createPreset(tree, options) {
180
179
  linter: options.linter,
181
180
  appDir: options.nextAppDir,
182
181
  src: options.nextSrcDir,
183
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
182
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
184
183
  addPlugin,
185
184
  });
186
185
  }
@@ -195,7 +194,7 @@ async function createPreset(tree, options) {
195
194
  linter: options.linter,
196
195
  appDir: options.nextAppDir,
197
196
  src: options.nextSrcDir,
198
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
197
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
199
198
  rootProject: true,
200
199
  addPlugin,
201
200
  });
@@ -210,7 +209,7 @@ async function createPreset(tree, options) {
210
209
  style: options.style,
211
210
  linter: options.linter,
212
211
  bundler: 'vite',
213
- e2eTestRunner: options.e2eTestRunner ?? 'cypress',
212
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
214
213
  addPlugin,
215
214
  });
216
215
  }
@@ -238,11 +237,8 @@ async function createPreset(tree, options) {
238
237
  });
239
238
  }
240
239
  else if (options.preset === presets_1.Preset.ReactNative) {
241
- console.log('Before require');
242
240
  const { reactNativeApplicationGenerator } = require('@nx' +
243
241
  '/react-native');
244
- console.log('Hello', reactNativeApplicationGenerator);
245
- console.log('Active require');
246
242
  return reactNativeApplicationGenerator(tree, {
247
243
  name: options.name,
248
244
  directory: (0, path_1.join)('apps', options.name),
@@ -93,7 +93,7 @@
93
93
  "e2eTestRunner": {
94
94
  "description": "The tool to use for running e2e tests.",
95
95
  "type": "string",
96
- "enum": ["cypress", "playwright", "jest", "detox", "none"]
96
+ "enum": ["playwright", "cypress", "jest", "detox", "none"]
97
97
  },
98
98
  "ssr": {
99
99
  "description": "Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application.",
@@ -1,11 +1,5 @@
1
1
  export declare enum Preset {
2
2
  Apps = "apps",
3
- /** @deprecated Use Apps instead
4
- */
5
- Empty = "empty",
6
- /** @deprecated Use NPM instead
7
- */
8
- Core = "core",
9
3
  NPM = "npm",
10
4
  TS = "ts",
11
5
  WebComponents = "web-components",
@@ -4,13 +4,6 @@ exports.Preset = void 0;
4
4
  var Preset;
5
5
  (function (Preset) {
6
6
  Preset["Apps"] = "apps";
7
- // TODO(v19): Remove Empty and Core presets
8
- /** @deprecated Use Apps instead
9
- */
10
- Preset["Empty"] = "empty";
11
- /** @deprecated Use NPM instead
12
- */
13
- Preset["Core"] = "core";
14
7
  Preset["NPM"] = "npm";
15
8
  Preset["TS"] = "ts";
16
9
  Preset["WebComponents"] = "web-components";
@@ -1,3 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export declare function splitConfigurationIntoProjectJsonFiles(tree: Tree): Promise<void>;
3
- export default splitConfigurationIntoProjectJsonFiles;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.splitConfigurationIntoProjectJsonFiles = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- const convert_to_nx_project_1 = require("../../generators/convert-to-nx-project/convert-to-nx-project");
6
- async function splitConfigurationIntoProjectJsonFiles(tree) {
7
- await (0, convert_to_nx_project_1.default)(tree, { all: true });
8
- await (0, devkit_1.formatFiles)(tree);
9
- }
10
- exports.splitConfigurationIntoProjectJsonFiles = splitConfigurationIntoProjectJsonFiles;
11
- exports.default = splitConfigurationIntoProjectJsonFiles;