@nx/nuxt 20.5.0-rc.3 → 20.5.0

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/nuxt",
3
- "version": "20.5.0-rc.3",
3
+ "version": "20.5.0",
4
4
  "private": false,
5
5
  "description": "The Nuxt plugin for Nx contains executors and generators for managing Nuxt applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -31,11 +31,11 @@
31
31
  "dependencies": {
32
32
  "tslib": "^2.3.0",
33
33
  "@nuxt/kit": "^3.10.0",
34
- "@nx/devkit": "20.5.0-rc.3",
35
- "@nx/js": "20.5.0-rc.3",
36
- "@nx/eslint": "20.5.0-rc.3",
37
- "@nx/vue": "20.5.0-rc.3",
38
- "@nx/vite": "20.5.0-rc.3",
34
+ "@nx/devkit": "20.5.0",
35
+ "@nx/js": "20.5.0",
36
+ "@nx/eslint": "20.5.0",
37
+ "@nx/vue": "20.5.0",
38
+ "@nx/vite": "20.5.0",
39
39
  "@phenomnomnominal/tsquery": "~5.0.1"
40
40
  },
41
41
  "peerDependencies": {
@@ -16,7 +16,6 @@ const ensure_dependencies_1 = require("./lib/ensure-dependencies");
16
16
  const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
17
17
  const node_child_process_1 = require("node:child_process");
18
18
  const onboarding_1 = require("nx/src/nx-cloud/utilities/onboarding");
19
- const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
20
19
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
21
20
  const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
22
21
  async function applicationGenerator(tree, schema) {
@@ -36,17 +35,19 @@ async function applicationGenerator(tree, schema) {
36
35
  (await (0, onboarding_1.getNxCloudAppOnBoardingUrl)(options.nxCloudToken));
37
36
  tasks.push((0, ensure_dependencies_1.ensureDependencies)(tree, options));
38
37
  if (options.isUsingTsSolutionConfig) {
39
- (0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), {
40
- name: (0, get_import_path_1.getImportPath)(tree, options.name),
38
+ const packageJson = {
39
+ name: options.importPath,
41
40
  version: '0.0.1',
42
41
  private: true,
43
- nx: {
44
- name: options.name,
45
- projectType: 'application',
46
- sourceRoot: `${options.appProjectRoot}/src`,
47
- tags: options.parsedTags?.length ? options.parsedTags : undefined,
48
- },
49
- });
42
+ };
43
+ if (options.projectName !== options.importPath) {
44
+ packageJson.nx = { name: options.projectName };
45
+ }
46
+ if (options.parsedTags?.length) {
47
+ packageJson.nx ??= {};
48
+ packageJson.nx.tags = options.parsedTags;
49
+ }
50
+ (0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), packageJson);
50
51
  }
51
52
  else {
52
53
  (0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
@@ -88,6 +89,11 @@ async function applicationGenerator(tree, schema) {
88
89
  isUsingTsSolutionConfig: options.isUsingTsSolutionConfig,
89
90
  }, (0, js_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot));
90
91
  (0, update_gitignore_1.updateGitIgnore)(tree);
92
+ // If we are using the new TS solution
93
+ // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
94
+ if (options.isUsingTsSolutionConfig) {
95
+ (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
96
+ }
91
97
  tasks.push(await (0, add_linting_1.addLinting)(tree, {
92
98
  projectName: options.projectName,
93
99
  projectRoot: options.appProjectRoot,
@@ -121,11 +127,6 @@ async function applicationGenerator(tree, schema) {
121
127
  ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
122
128
  : undefined);
123
129
  }
124
- // If we are using the new TS solution
125
- // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
126
- if (options.isUsingTsSolutionConfig) {
127
- (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
128
- }
129
130
  (0, sort_fields_1.sortPackageJsonFields)(tree, options.appProjectRoot);
130
131
  if (!options.skipFormat)
131
132
  await (0, devkit_1.formatFiles)(tree);
@@ -16,8 +16,6 @@ async function addE2e(host, options) {
16
16
  version: '0.0.1',
17
17
  private: true,
18
18
  nx: {
19
- projectType: 'application',
20
- sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
21
19
  implicitDependencies: [options.projectName],
22
20
  },
23
21
  });
@@ -64,8 +62,6 @@ async function addE2e(host, options) {
64
62
  version: '0.0.1',
65
63
  private: true,
66
64
  nx: {
67
- projectType: 'application',
68
- sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
69
65
  implicitDependencies: [options.projectName],
70
66
  },
71
67
  });
@@ -1,18 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = normalizeOptions;
4
- const devkit_1 = require("@nx/devkit");
5
4
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
5
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
7
6
  async function normalizeOptions(host, options) {
8
- await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'application');
9
- const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
7
+ await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
8
+ const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
10
9
  name: options.name,
11
10
  projectType: 'application',
12
11
  directory: options.directory,
13
12
  rootProject: options.rootProject,
14
13
  });
15
14
  options.rootProject = appProjectRoot === '.';
15
+ const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
16
+ const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
16
17
  const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
17
18
  const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
18
19
  const parsedTags = options.tags
@@ -20,14 +21,15 @@ async function normalizeOptions(host, options) {
20
21
  : [];
21
22
  const normalized = {
22
23
  ...options,
23
- name: (0, devkit_1.names)(options.name).fileName,
24
+ name: projectNames.projectFileName,
24
25
  projectName: appProjectName,
25
26
  appProjectRoot,
27
+ importPath,
26
28
  e2eProjectName,
27
29
  e2eProjectRoot,
28
30
  parsedTags,
29
31
  style: options.style ?? 'none',
30
- isUsingTsSolutionConfig: (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host),
32
+ isUsingTsSolutionConfig,
31
33
  };
32
34
  normalized.unitTestRunner ??= 'vitest';
33
35
  normalized.e2eTestRunner = normalized.e2eTestRunner ?? 'playwright';
@@ -18,9 +18,10 @@ export interface Schema {
18
18
  useTsSolution?: boolean;
19
19
  }
20
20
 
21
- export interface NormalizedSchema extends Schema {
21
+ export interface NormalizedSchema extends Omit<Schema, 'useTsSolution'> {
22
22
  projectName: string;
23
23
  appProjectRoot: string;
24
+ importPath: string;
24
25
  e2eProjectName: string;
25
26
  e2eProjectRoot: string;
26
27
  parsedTags: string[];