@nx/web 16.6.0 → 16.7.0-beta.1

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/web",
3
- "version": "16.6.0",
3
+ "version": "16.7.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Web Components contains generators for managing Web Component applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -30,9 +30,9 @@
30
30
  "migrations": "./migrations.json"
31
31
  },
32
32
  "dependencies": {
33
- "@nrwl/web": "16.6.0",
34
- "@nx/devkit": "16.6.0",
35
- "@nx/js": "16.6.0",
33
+ "@nrwl/web": "16.7.0-beta.1",
34
+ "@nx/devkit": "16.7.0-beta.1",
35
+ "@nx/js": "16.7.0-beta.1",
36
36
  "chalk": "^4.1.0",
37
37
  "chokidar": "^3.5.1",
38
38
  "detect-port": "^1.5.1",
@@ -44,5 +44,5 @@
44
44
  "access": "public"
45
45
  },
46
46
  "types": "./index.d.ts",
47
- "gitHead": "d02a8dbf06c85de78c0c76f64a17f10ae8085739"
47
+ "gitHead": "50a145bb64edcf76985184a9a83d1449dcd4f3d9"
48
48
  }
@@ -144,7 +144,7 @@ function applicationGenerator(host, schema) {
144
144
  host.delete((0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/app/app.element.spec.ts`));
145
145
  }
146
146
  if (options.linter === 'eslint') {
147
- const { lintProjectGenerator } = yield (0, devkit_1.ensurePackage)('@nx/linter', versions_2.nxVersion);
147
+ const { lintProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/linter', versions_2.nxVersion);
148
148
  const lintTask = yield lintProjectGenerator(host, {
149
149
  linter: options.linter,
150
150
  project: options.projectName,
@@ -159,12 +159,32 @@ function applicationGenerator(host, schema) {
159
159
  tasks.push(lintTask);
160
160
  }
161
161
  if (options.e2eTestRunner === 'cypress') {
162
- const { cypressProjectGenerator } = yield (0, devkit_1.ensurePackage)('@nx/cypress', versions_2.nxVersion);
162
+ const { cypressProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_2.nxVersion);
163
163
  const cypressTask = yield cypressProjectGenerator(host, Object.assign(Object.assign({}, options), { name: `${options.name}-e2e`, directory: options.directory, project: options.projectName, skipFormat: true }));
164
164
  tasks.push(cypressTask);
165
165
  }
166
+ else if (options.e2eTestRunner === 'playwright') {
167
+ const { configurationGenerator: playwrightConfigGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_2.nxVersion);
168
+ (0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
169
+ root: options.e2eProjectRoot,
170
+ sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
171
+ projectType: 'application',
172
+ targets: {},
173
+ implicitDependencies: [options.projectName],
174
+ });
175
+ const playwrightTask = yield playwrightConfigGenerator(host, {
176
+ project: options.e2eProjectName,
177
+ skipFormat: true,
178
+ skipPackageJson: false,
179
+ directory: 'src',
180
+ js: false,
181
+ linter: options.linter,
182
+ setParserOptionsProject: options.setParserOptionsProject,
183
+ });
184
+ tasks.push(playwrightTask);
185
+ }
166
186
  if (options.unitTestRunner === 'jest') {
167
- const { configurationGenerator } = yield (0, devkit_1.ensurePackage)('@nx/jest', versions_2.nxVersion);
187
+ const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/jest', versions_2.nxVersion);
168
188
  const jestTask = yield configurationGenerator(host, {
169
189
  project: options.projectName,
170
190
  skipSerializers: true,
@@ -11,7 +11,7 @@ export interface Schema {
11
11
  tags?: string;
12
12
  unitTestRunner?: 'jest' | 'vitest' | 'none';
13
13
  inSourceTests?: boolean;
14
- e2eTestRunner?: 'cypress' | 'none';
14
+ e2eTestRunner?: 'cypress' | 'playwright' | 'none';
15
15
  linter?: Linter;
16
16
  standaloneConfig?: boolean;
17
17
  setParserOptionsProject?: boolean;
@@ -82,7 +82,8 @@
82
82
  },
83
83
  "e2eTestRunner": {
84
84
  "type": "string",
85
- "enum": ["cypress", "none"],
85
+ "enum": ["cypress", "playwright", "none"],
86
+ "x-prompt": "Which E2E test runner would you like to use?",
86
87
  "description": "Test runner to use for end to end (e2e) tests",
87
88
  "default": "cypress"
88
89
  },
@@ -24,19 +24,27 @@ function webInitGenerator(tree, schema) {
24
24
  });
25
25
  tasks.push(jsInitTask);
26
26
  if (!schema.unitTestRunner || schema.unitTestRunner === 'jest') {
27
- const { jestInitGenerator } = yield (0, devkit_1.ensurePackage)('@nx/jest', versions_1.nxVersion);
27
+ const { jestInitGenerator } = (0, devkit_1.ensurePackage)('@nx/jest', versions_1.nxVersion);
28
28
  const jestTask = yield jestInitGenerator(tree, {
29
29
  skipPackageJson: schema.skipPackageJson,
30
30
  });
31
31
  tasks.push(jestTask);
32
32
  }
33
33
  if (!schema.e2eTestRunner || schema.e2eTestRunner === 'cypress') {
34
- const { cypressInitGenerator } = yield (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
34
+ const { cypressInitGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
35
35
  const cypressTask = yield cypressInitGenerator(tree, {
36
36
  skipPackageJson: schema.skipPackageJson,
37
37
  });
38
38
  tasks.push(cypressTask);
39
39
  }
40
+ else if (schema.e2eTestRunner === 'playwright') {
41
+ const { initGenerator: playwrightInitGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
42
+ const playwrightConfigTask = yield playwrightInitGenerator(tree, {
43
+ skipFormat: true,
44
+ skipPackageJson: schema.skipPackageJson,
45
+ });
46
+ tasks.push(playwrightConfigTask);
47
+ }
40
48
  if (!schema.skipPackageJson) {
41
49
  const installTask = updateDependencies(tree, schema);
42
50
  tasks.push(installTask);
@@ -1,7 +1,7 @@
1
1
  export interface Schema {
2
2
  bundler?: 'webpack' | 'none' | 'vite';
3
3
  unitTestRunner?: 'jest' | 'vitest' | 'none';
4
- e2eTestRunner?: 'cypress' | 'none';
4
+ e2eTestRunner?: 'cypress' | 'playwright' | 'none';
5
5
  skipFormat?: boolean;
6
6
  skipPackageJson?: boolean;
7
7
  }
@@ -21,7 +21,8 @@
21
21
  "e2eTestRunner": {
22
22
  "description": "Adds the specified e2e test runner",
23
23
  "type": "string",
24
- "enum": ["cypress", "none"],
24
+ "enum": ["cypress", "playwright", "none"],
25
+ "x-prompt": "Which E2E test runner would you like to use?",
25
26
  "default": "cypress"
26
27
  },
27
28
  "skipFormat": {