@nx/web 23.0.0-beta.2 → 23.0.0-beta.20

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": "23.0.0-beta.2",
3
+ "version": "23.0.0-beta.20",
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, Playwright, 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": {
@@ -32,24 +32,24 @@
32
32
  "migrations": "./migrations.json"
33
33
  },
34
34
  "dependencies": {
35
- "detect-port": "^1.5.1",
35
+ "detect-port": "^2.1.0",
36
36
  "http-server": "^14.1.0",
37
37
  "picocolors": "^1.1.0",
38
38
  "tslib": "^2.3.0",
39
- "@nx/devkit": "23.0.0-beta.2",
40
- "@nx/js": "23.0.0-beta.2"
39
+ "@nx/devkit": "23.0.0-beta.20",
40
+ "@nx/js": "23.0.0-beta.20"
41
41
  },
42
42
  "devDependencies": {
43
- "nx": "23.0.0-beta.2",
44
- "@nx/vitest": "23.0.0-beta.2"
43
+ "nx": "23.0.0-beta.20",
44
+ "@nx/vitest": "23.0.0-beta.20"
45
45
  },
46
46
  "peerDependencies": {
47
- "@nx/cypress": "23.0.0-beta.2",
48
- "@nx/eslint": "23.0.0-beta.2",
49
- "@nx/jest": "23.0.0-beta.2",
50
- "@nx/playwright": "23.0.0-beta.2",
51
- "@nx/vite": "23.0.0-beta.2",
52
- "@nx/webpack": "23.0.0-beta.2"
47
+ "@nx/cypress": "23.0.0-beta.20",
48
+ "@nx/eslint": "23.0.0-beta.20",
49
+ "@nx/jest": "23.0.0-beta.20",
50
+ "@nx/playwright": "23.0.0-beta.20",
51
+ "@nx/vite": "23.0.0-beta.20",
52
+ "@nx/webpack": "23.0.0-beta.20"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@nx/cypress": {
@@ -12,8 +12,8 @@ const path_1 = require("path");
12
12
  const package_json_1 = require("nx/src/utils/package-json");
13
13
  const client_1 = require("nx/src/daemon/client/client");
14
14
  const utils_1 = require("nx/src/tasks-runner/utils");
15
- const strip_glob_to_base_dir_1 = require("@nx/js/src/utils/strip-glob-to-base-dir");
16
- const detectPort = require('detect-port');
15
+ const internal_2 = require("@nx/js/internal");
16
+ const detect_port_1 = tslib_1.__importDefault(require("detect-port"));
17
17
  // platform specific command name
18
18
  const pmCmd = (0, os_1.platform)() === 'win32' ? `npx.cmd` : 'npx';
19
19
  function getHttpServerArgs(options) {
@@ -86,7 +86,7 @@ function getBuildTargetOutputPath(options, context) {
86
86
  projectName: project.data.name,
87
87
  projectRoot: project.data.root,
88
88
  });
89
- outputPath = (0, strip_glob_to_base_dir_1.stripGlobToBaseDir)(outputPath);
89
+ outputPath = (0, internal_2.stripGlobToBaseDir)(outputPath);
90
90
  }
91
91
  }
92
92
  }
@@ -102,7 +102,7 @@ function createFileWatcher(project, changeHandler) {
102
102
  return client_1.daemonClient.registerFileWatcher({
103
103
  watchProjects: project ? [project] : 'all',
104
104
  includeGlobalWorkspaceFiles: true,
105
- includeDependentProjects: true,
105
+ includeDependencies: true,
106
106
  }, async (error, val) => {
107
107
  if (error === 'reconnecting') {
108
108
  // Silent - daemon restarts automatically on lockfile changes
@@ -170,7 +170,7 @@ async function* fileServerExecutor(options, context) {
170
170
  // perform initial run
171
171
  run();
172
172
  }
173
- const port = await detectPort(options.port || 8080);
173
+ const port = await (0, detect_port_1.default)(options.port || 8080);
174
174
  const outputPath = getBuildTargetOutputPath(options, context);
175
175
  if (options.spa) {
176
176
  const src = (0, path_1.join)(outputPath, 'index.html');
@@ -1 +1 @@
1
- {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/web/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,iBAAiB,EASjB,IAAI,EAKL,MAAM,YAAY,CAAC;AAkBpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA2PlC,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAKpE;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAqW5E;AA0DD,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/web/src/generators/application/application.ts"],"names":[],"mappings":"AAOA,OAAO,EAML,iBAAiB,EASjB,IAAI,EAKL,MAAM,YAAY,CAAC;AAoBpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAkPlC,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAKpE;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAmW5E;AA0DD,eAAe,oBAAoB,CAAC"}
@@ -3,19 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.applicationGenerator = applicationGenerator;
4
4
  exports.applicationGeneratorInternal = applicationGeneratorInternal;
5
5
  const tslib_1 = require("tslib");
6
+ const internal_1 = require("@nx/devkit/internal");
6
7
  const devkit_1 = require("@nx/devkit");
7
- const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
8
8
  const js_1 = require("@nx/js");
9
- const versions_1 = require("@nx/js/src/utils/versions");
9
+ const internal_2 = require("@nx/js/internal");
10
10
  const path_1 = require("path");
11
- const versions_2 = require("../../utils/versions");
11
+ const versions_1 = require("../../utils/versions");
12
12
  const init_1 = require("../init/init");
13
- const get_npm_scope_1 = require("@nx/js/src/utils/package-json/get-npm-scope");
14
13
  const has_webpack_plugin_1 = require("../../utils/has-webpack-plugin");
15
- const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
16
- const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
17
14
  const static_serve_configuration_1 = tslib_1.__importDefault(require("../static-serve/static-serve-configuration"));
18
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
19
15
  function createApplicationFiles(tree, options) {
20
16
  const rootTsConfigPath = (0, js_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot);
21
17
  if (options.bundler === 'vite') {
@@ -87,7 +83,7 @@ async function setupBundler(tree, options) {
87
83
  (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
88
84
  ];
89
85
  if (options.bundler === 'webpack') {
90
- const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/webpack', versions_2.nxVersion);
86
+ const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/webpack', versions_1.nxVersion);
91
87
  await configurationGenerator(tree, {
92
88
  target: 'web',
93
89
  project: options.projectName,
@@ -132,7 +128,7 @@ async function setupBundler(tree, options) {
132
128
  }
133
129
  else if (options.bundler === 'none') {
134
130
  const project = (0, devkit_1.readProjectConfiguration)(tree, options.projectName);
135
- (0, target_defaults_utils_1.addBuildTargetDefaults)(tree, `@nx/js:${options.compiler}`);
131
+ (0, internal_1.addBuildTargetDefaults)(tree, `@nx/js:${options.compiler}`);
136
132
  project.targets ??= {};
137
133
  project.targets.build = {
138
134
  executor: `@nx/js:${options.compiler}`,
@@ -198,7 +194,7 @@ async function applicationGenerator(host, schema) {
198
194
  async function applicationGeneratorInternal(host, schema) {
199
195
  const options = await normalizeOptions(host, schema);
200
196
  if (options.isUsingTsSolutionConfig) {
201
- await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
197
+ await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
202
198
  }
203
199
  const tasks = [];
204
200
  const jsInitTask = await (0, js_1.initGenerator)(host, {
@@ -218,7 +214,7 @@ async function applicationGeneratorInternal(host, schema) {
218
214
  }
219
215
  createApplicationFiles(host, options);
220
216
  if (options.linter === 'eslint') {
221
- const { lintProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/eslint', versions_2.nxVersion);
217
+ const { lintProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
222
218
  const lintTask = await lintProjectGenerator(host, {
223
219
  linter: options.linter,
224
220
  project: options.projectName,
@@ -233,12 +229,12 @@ async function applicationGeneratorInternal(host, schema) {
233
229
  tasks.push(lintTask);
234
230
  // Add out-tsc ignore pattern when using TS solution setup
235
231
  if (options.isUsingTsSolutionConfig) {
236
- const { addIgnoresToLintConfig } = await Promise.resolve().then(() => tslib_1.__importStar(require('@nx/eslint/src/generators/utils/eslint-file')));
232
+ const { addIgnoresToLintConfig } = await Promise.resolve().then(() => tslib_1.__importStar(require('@nx/eslint/internal')));
237
233
  addIgnoresToLintConfig(host, options.appProjectRoot, ['**/out-tsc']);
238
234
  }
239
235
  }
240
236
  if (options.bundler === 'vite') {
241
- const { viteConfigurationGenerator, createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_2.nxVersion);
237
+ const { viteConfigurationGenerator, createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
242
238
  // We recommend users use `import.meta.env.MODE` and other variables in their code to differentiate between production and development.
243
239
  // See: https://vite.dev/guide/env-and-mode.html
244
240
  if (host.exists((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/environments'))) {
@@ -263,8 +259,8 @@ async function applicationGeneratorInternal(host, schema) {
263
259
  }, false);
264
260
  }
265
261
  if (options.bundler !== 'vite' && options.unitTestRunner === 'vitest') {
266
- const { createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_2.nxVersion);
267
- (0, devkit_1.ensurePackage)('@nx/vitest', versions_2.nxVersion);
262
+ const { createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
263
+ (0, devkit_1.ensurePackage)('@nx/vitest', versions_1.nxVersion);
268
264
  const { configurationGenerator } = await Promise.resolve().then(() => tslib_1.__importStar(require('@nx/vitest/generators')));
269
265
  const vitestTask = await configurationGenerator(host, {
270
266
  uiFramework: 'none',
@@ -312,15 +308,15 @@ async function applicationGeneratorInternal(host, schema) {
312
308
  e2eDevServerTarget: `${options.projectName}:serve`,
313
309
  };
314
310
  if (options.bundler === 'webpack') {
315
- const { getWebpackE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/webpack', versions_2.nxVersion);
311
+ const { getWebpackE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/webpack', versions_1.nxVersion);
316
312
  e2eWebServerInfo = await getWebpackE2EWebServerInfo(host, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `webpack.config.js`), options.addPlugin, 4200);
317
313
  }
318
314
  else if (options.bundler === 'vite') {
319
- const { getViteE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/vite', versions_2.nxVersion);
315
+ const { getViteE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
320
316
  e2eWebServerInfo = await getViteE2EWebServerInfo(host, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.ts`), options.addPlugin, 4200);
321
317
  }
322
318
  if (options.e2eTestRunner === 'cypress') {
323
- const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_2.nxVersion);
319
+ const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
324
320
  const packageJson = {
325
321
  name: options.e2eProjectName,
326
322
  version: '0.0.1',
@@ -361,7 +357,7 @@ async function applicationGeneratorInternal(host, schema) {
361
357
  tasks.push(cypressTask);
362
358
  }
363
359
  else if (options.e2eTestRunner === 'playwright') {
364
- const { configurationGenerator: playwrightConfigGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_2.nxVersion);
360
+ const { configurationGenerator: playwrightConfigGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
365
361
  const packageJson = {
366
362
  name: options.e2eProjectName,
367
363
  version: '0.0.1',
@@ -400,7 +396,7 @@ async function applicationGeneratorInternal(host, schema) {
400
396
  tasks.push(playwrightTask);
401
397
  }
402
398
  if (options.unitTestRunner === 'jest') {
403
- const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/jest', versions_2.nxVersion);
399
+ const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/jest', versions_1.nxVersion);
404
400
  const jestTask = await configurationGenerator(host, {
405
401
  project: options.projectName,
406
402
  skipSerializers: true,
@@ -420,7 +416,7 @@ async function applicationGeneratorInternal(host, schema) {
420
416
  target: 'es2016',
421
417
  },
422
418
  });
423
- const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, { '@swc/core': versions_1.swcCoreVersion, 'swc-loader': versions_2.swcLoaderVersion });
419
+ const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, { '@swc/core': internal_2.swcCoreVersion, 'swc-loader': versions_1.swcLoaderVersion });
424
420
  tasks.push(installTask);
425
421
  }
426
422
  else {
@@ -429,8 +425,8 @@ async function applicationGeneratorInternal(host, schema) {
429
425
  });
430
426
  }
431
427
  setDefaults(host, options);
432
- tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_2.tsLibVersion }, { '@types/node': versions_2.typesNodeVersion }));
433
- (0, ts_solution_setup_1.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.app.json', {
428
+ tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_1.tsLibVersion }, { '@types/node': versions_1.typesNodeVersion }));
429
+ (0, internal_2.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.app.json', {
434
430
  module: 'esnext',
435
431
  moduleResolution: 'bundler',
436
432
  }, options.linter === 'eslint'
@@ -440,13 +436,13 @@ async function applicationGeneratorInternal(host, schema) {
440
436
  await (0, devkit_1.formatFiles)(host);
441
437
  }
442
438
  tasks.push(() => {
443
- (0, log_show_project_command_1.logShowProjectCommand)(options.projectName);
439
+ (0, internal_1.logShowProjectCommand)(options.projectName);
444
440
  });
445
441
  return (0, devkit_1.runTasksInSerial)(...tasks);
446
442
  }
447
443
  async function normalizeOptions(host, options) {
448
- await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
449
- const { projectName, projectRoot: appProjectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
444
+ await (0, internal_1.ensureRootProjectName)(options, 'application');
445
+ const { projectName, projectRoot: appProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
450
446
  name: options.name,
451
447
  projectType: 'application',
452
448
  directory: options.directory,
@@ -455,11 +451,11 @@ async function normalizeOptions(host, options) {
455
451
  const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
456
452
  nxJson.useInferencePlugins !== false;
457
453
  options.addPlugin ??= addPluginDefault;
458
- const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
454
+ const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
459
455
  const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
460
456
  const e2eProjectName = `${appProjectName}-e2e`;
461
457
  const e2eProjectRoot = `${appProjectRoot}-e2e`;
462
- const npmScope = (0, get_npm_scope_1.getNpmScope)(host);
458
+ const npmScope = (0, internal_2.getNpmScope)(host);
463
459
  const parsedTags = options.tags
464
460
  ? options.tags.split(',').map((s) => s.trim())
465
461
  : [];
@@ -1,5 +1,5 @@
1
1
  export declare const nxVersion: any;
2
2
  export declare const swcLoaderVersion = "0.1.15";
3
- export declare const typesNodeVersion = "20.19.9";
3
+ export declare const typesNodeVersion = "^22.0.0";
4
4
  export declare const tsLibVersion = "^2.3.0";
5
5
  //# sourceMappingURL=versions.d.ts.map
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tsLibVersion = exports.typesNodeVersion = exports.swcLoaderVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
5
  exports.swcLoaderVersion = '0.1.15';
6
- exports.typesNodeVersion = '20.19.9';
6
+ exports.typesNodeVersion = '^22.0.0';
7
7
  exports.tsLibVersion = '^2.3.0';