@nx/web 0.0.0-pr-29993-f89d4dd → 0.0.0-pr-3-e51e28c

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": "0.0.0-pr-29993-f89d4dd",
3
+ "version": "0.0.0-pr-3-e51e28c",
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": {
@@ -35,8 +35,8 @@
35
35
  "http-server": "^14.1.0",
36
36
  "picocolors": "^1.1.0",
37
37
  "tslib": "^2.3.0",
38
- "@nx/devkit": "0.0.0-pr-29993-f89d4dd",
39
- "@nx/js": "0.0.0-pr-29993-f89d4dd"
38
+ "@nx/devkit": "0.0.0-pr-3-e51e28c",
39
+ "@nx/js": "0.0.0-pr-3-e51e28c"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
@@ -16,11 +16,13 @@ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-projec
16
16
  const static_serve_configuration_1 = require("../static-serve/static-serve-configuration");
17
17
  const find_plugin_for_config_file_1 = require("@nx/devkit/src/utils/find-plugin-for-config-file");
18
18
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
19
+ const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
19
20
  function createApplicationFiles(tree, options) {
20
21
  const rootTsConfigPath = (0, js_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot);
21
22
  if (options.bundler === 'vite') {
22
23
  (0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, './files/app-vite'), options.appProjectRoot, {
23
24
  ...options,
25
+ ...(0, devkit_1.names)(options.name),
24
26
  tmpl: '',
25
27
  offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.appProjectRoot),
26
28
  rootTsConfigPath,
@@ -30,6 +32,7 @@ function createApplicationFiles(tree, options) {
30
32
  const rootOffset = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
31
33
  (0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, './files/app-webpack'), options.appProjectRoot, {
32
34
  ...options,
35
+ ...(0, devkit_1.names)(options.name),
33
36
  tmpl: '',
34
37
  offsetFromRoot: rootOffset,
35
38
  rootTsConfigPath,
@@ -151,19 +154,16 @@ async function setupBundler(tree, options) {
151
154
  }
152
155
  async function addProject(tree, options) {
153
156
  if (options.isUsingTsSolutionConfig) {
154
- const packageJson = {
155
- name: options.importPath,
157
+ (0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), {
158
+ name: (0, get_import_path_1.getImportPath)(tree, options.name),
156
159
  version: '0.0.1',
157
160
  private: true,
158
- };
159
- if (options.projectName !== options.importPath) {
160
- packageJson.nx = { name: options.projectName };
161
- }
162
- if (options.parsedTags?.length) {
163
- packageJson.nx ??= {};
164
- packageJson.nx.tags = options.parsedTags;
165
- }
166
- (0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), packageJson);
161
+ nx: options.parsedTags?.length
162
+ ? {
163
+ tags: options.parsedTags,
164
+ }
165
+ : undefined,
166
+ });
167
167
  }
168
168
  else {
169
169
  (0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
@@ -316,6 +316,8 @@ async function applicationGeneratorInternal(host, schema) {
316
316
  version: '0.0.1',
317
317
  private: true,
318
318
  nx: {
319
+ projectType: 'application',
320
+ sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
319
321
  implicitDependencies: [options.projectName],
320
322
  },
321
323
  });
@@ -371,6 +373,8 @@ async function applicationGeneratorInternal(host, schema) {
371
373
  version: '0.0.1',
372
374
  private: true,
373
375
  nx: {
376
+ projectType: 'application',
377
+ sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
374
378
  implicitDependencies: [options.projectName],
375
379
  },
376
380
  });
@@ -458,8 +462,8 @@ async function applicationGeneratorInternal(host, schema) {
458
462
  return (0, devkit_1.runTasksInSerial)(...tasks);
459
463
  }
460
464
  async function normalizeOptions(host, options) {
461
- await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
462
- const { projectName, projectRoot: appProjectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
465
+ await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'application');
466
+ const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
463
467
  name: options.name,
464
468
  projectType: 'application',
465
469
  directory: options.directory,
@@ -468,10 +472,9 @@ async function normalizeOptions(host, options) {
468
472
  const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
469
473
  nxJson.useInferencePlugins !== false;
470
474
  options.addPlugin ??= addPluginDefault;
471
- const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
472
- const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
473
475
  const e2eProjectName = `${appProjectName}-e2e`;
474
476
  const e2eProjectRoot = `${appProjectRoot}-e2e`;
477
+ const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
475
478
  const npmScope = (0, get_npm_scope_1.getNpmScope)(host);
476
479
  const parsedTags = options.tags
477
480
  ? options.tags.split(',').map((s) => s.trim())
@@ -483,16 +486,17 @@ async function normalizeOptions(host, options) {
483
486
  return {
484
487
  ...options,
485
488
  prefix: options.prefix ?? npmScope ?? 'app',
489
+ name: (0, devkit_1.names)(options.name).fileName,
486
490
  compiler: options.compiler ?? 'babel',
487
491
  bundler: options.bundler ?? 'webpack',
488
- projectName: appProjectName,
489
- importPath,
492
+ projectName: isUsingTsSolutionConfig
493
+ ? (0, get_import_path_1.getImportPath)(host, appProjectName)
494
+ : appProjectName,
490
495
  strict: options.strict ?? true,
491
496
  appProjectRoot,
492
497
  e2eProjectRoot,
493
498
  e2eProjectName,
494
499
  parsedTags,
495
- names: (0, devkit_1.names)(projectName),
496
500
  isUsingTsSolutionConfig,
497
501
  };
498
502
  }
@@ -2,7 +2,7 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title><%= names.className %></title>
5
+ <title><%= className %></title>
6
6
  <base href="/" />
7
7
 
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -2,7 +2,7 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title><%= names.className %></title>
5
+ <title><%= className %></title>
6
6
  <base href="/" />
7
7
 
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1" />