@nx/web 17.3.0-beta.3 → 17.3.0-beta.5

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": "17.3.0-beta.3",
3
+ "version": "17.3.0-beta.5",
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": {
@@ -34,9 +34,9 @@
34
34
  "detect-port": "^1.5.1",
35
35
  "http-server": "^14.1.0",
36
36
  "tslib": "^2.3.0",
37
- "@nx/devkit": "17.3.0-beta.3",
38
- "@nx/js": "17.3.0-beta.3",
39
- "@nrwl/web": "17.3.0-beta.3"
37
+ "@nx/devkit": "17.3.0-beta.5",
38
+ "@nx/js": "17.3.0-beta.5",
39
+ "@nrwl/web": "17.3.0-beta.5"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
@@ -146,6 +146,11 @@ exports.applicationGenerator = applicationGenerator;
146
146
  async function applicationGeneratorInternal(host, schema) {
147
147
  const options = await normalizeOptions(host, schema);
148
148
  const tasks = [];
149
+ const jsInitTask = await (0, js_1.initGenerator)(host, {
150
+ js: false,
151
+ skipFormat: true,
152
+ });
153
+ tasks.push(jsInitTask);
149
154
  const webTask = await (0, init_1.webInitGenerator)(host, {
150
155
  ...options,
151
156
  skipFormat: true,
@@ -285,6 +290,7 @@ async function applicationGeneratorInternal(host, schema) {
285
290
  });
286
291
  }
287
292
  setDefaults(host, options);
293
+ tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_2.tsLibVersion }, { '@types/node': versions_2.typesNodeVersion }));
288
294
  if (!schema.skipFormat) {
289
295
  await (0, devkit_1.formatFiles)(host);
290
296
  }
@@ -2,55 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.webInitGenerator = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const js_1 = require("@nx/js");
6
5
  const versions_1 = require("../../utils/versions");
7
- function updateDependencies(tree, schema) {
8
- (0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nx/web'], []);
9
- const devDependencies = {
10
- '@nx/web': versions_1.nxVersion,
11
- '@types/node': versions_1.typesNodeVersion,
12
- };
13
- return (0, devkit_1.addDependenciesToPackageJson)(tree, {
14
- tslib: versions_1.tsLibVersion,
15
- }, devDependencies);
6
+ function updateDependencies(tree) {
7
+ const tasks = [];
8
+ tasks.push((0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nx/web'], []));
9
+ tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nx/web': versions_1.nxVersion }));
10
+ return (0, devkit_1.runTasksInSerial)(...tasks);
16
11
  }
17
12
  async function webInitGenerator(tree, schema) {
18
- const tasks = [];
19
- const jsInitTask = await (0, js_1.initGenerator)(tree, {
20
- js: false,
21
- skipFormat: true,
22
- });
23
- tasks.push(jsInitTask);
24
- if (!schema.unitTestRunner || schema.unitTestRunner === 'jest') {
25
- const { jestInitGenerator } = (0, devkit_1.ensurePackage)('@nx/jest', versions_1.nxVersion);
26
- const jestTask = await jestInitGenerator(tree, {
27
- skipPackageJson: schema.skipPackageJson,
28
- });
29
- tasks.push(jestTask);
30
- }
31
- if (!schema.e2eTestRunner || schema.e2eTestRunner === 'cypress') {
32
- const { cypressInitGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
33
- const cypressTask = await cypressInitGenerator(tree, {
34
- skipPackageJson: schema.skipPackageJson,
35
- });
36
- tasks.push(cypressTask);
37
- }
38
- else if (schema.e2eTestRunner === 'playwright') {
39
- const { initGenerator: playwrightInitGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
40
- const playwrightConfigTask = await playwrightInitGenerator(tree, {
41
- skipFormat: true,
42
- skipPackageJson: schema.skipPackageJson,
43
- });
44
- tasks.push(playwrightConfigTask);
45
- }
13
+ let installTask = () => { };
46
14
  if (!schema.skipPackageJson) {
47
- const installTask = updateDependencies(tree, schema);
48
- tasks.push(installTask);
15
+ installTask = updateDependencies(tree);
49
16
  }
50
17
  if (!schema.skipFormat) {
51
18
  await (0, devkit_1.formatFiles)(tree);
52
19
  }
53
- return (0, devkit_1.runTasksInSerial)(...tasks);
20
+ return installTask;
54
21
  }
55
22
  exports.webInitGenerator = webInitGenerator;
56
23
  exports.default = webInitGenerator;
@@ -1,7 +1,4 @@
1
1
  export interface Schema {
2
- bundler?: 'webpack' | 'none' | 'vite';
3
- unitTestRunner?: 'jest' | 'vitest' | 'none';
4
- e2eTestRunner?: 'cypress' | 'playwright' | 'none';
5
2
  skipFormat?: boolean;
6
3
  skipPackageJson?: boolean;
7
4
  }
@@ -6,25 +6,6 @@
6
6
  "description": "Init Web Plugin.",
7
7
  "type": "object",
8
8
  "properties": {
9
- "bundler": {
10
- "type": "string",
11
- "description": "The bundler to use.",
12
- "enum": ["webpack", "none", "vite"],
13
- "default": "webpack"
14
- },
15
- "unitTestRunner": {
16
- "description": "Adds the specified unit test runner",
17
- "type": "string",
18
- "enum": ["jest", "none"],
19
- "default": "jest"
20
- },
21
- "e2eTestRunner": {
22
- "description": "Adds the specified e2e test runner",
23
- "type": "string",
24
- "enum": ["cypress", "playwright", "none"],
25
- "x-prompt": "Which E2E test runner would you like to use?",
26
- "default": "cypress"
27
- },
28
9
  "skipFormat": {
29
10
  "description": "Skip formatting files",
30
11
  "type": "boolean",