@nx/vue 23.2.0-beta.6 → 23.2.0-beta.8

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.
@@ -88,7 +88,7 @@ async function applicationGeneratorInternal(tree, _options) {
88
88
  tasks.push(await (0, add_linting_1.addLinting)(tree, {
89
89
  name: options.projectName,
90
90
  projectRoot: options.appProjectRoot,
91
- linter: options.linter ?? 'eslint',
91
+ linter: options.linter,
92
92
  unitTestRunner: options.unitTestRunner,
93
93
  skipPackageJson: options.skipPackageJson,
94
94
  enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
@@ -29,11 +29,14 @@ async function normalizeOptions(host, options) {
29
29
  parsedTags,
30
30
  isUsingTsSolutionConfig,
31
31
  useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
32
+ style: options.style ?? 'css',
33
+ routing: options.routing ?? false,
34
+ unitTestRunner: options.unitTestRunner ?? 'vitest',
35
+ e2eTestRunner: options.e2eTestRunner ?? 'playwright',
36
+ bundler: options.bundler ?? 'vite',
37
+ // Resolved here rather than at the `addLinting` call, so the `=== 'eslint'`
38
+ // check that builds the tsconfig excludes reads the same value.
39
+ linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
32
40
  };
33
- normalized.style = options.style ?? 'css';
34
- normalized.routing = normalized.routing ?? false;
35
- normalized.unitTestRunner ??= 'vitest';
36
- normalized.e2eTestRunner = normalized.e2eTestRunner ?? 'playwright';
37
- normalized.bundler = normalized.bundler ?? 'vite';
38
41
  return normalized;
39
42
  }
@@ -1,4 +1,4 @@
1
- import type { Linter, LinterType } from '@nx/eslint';
1
+ import type { LinterType } from '@nx/js';
2
2
 
3
3
  export interface Schema {
4
4
  directory: string;
@@ -10,7 +10,7 @@ export interface Schema {
10
10
  unitTestRunner?: 'vitest' | 'none';
11
11
  inSourceTests?: boolean;
12
12
  e2eTestRunner: 'cypress' | 'playwright' | 'none';
13
- linter: Linter | LinterType;
13
+ linter?: LinterType;
14
14
  formatter?: 'none' | 'prettier';
15
15
  routing?: boolean;
16
16
  js?: boolean;
@@ -29,6 +29,8 @@ export interface Schema {
29
29
  }
30
30
 
31
31
  export interface NormalizedSchema extends Omit<Schema, 'useTsSolution'> {
32
+ // `normalizeOptions` always resolves this, so it is no longer optional.
33
+ linter: LinterType;
32
34
  projectName: string;
33
35
  appProjectRoot: string;
34
36
  importPath: string;
@@ -78,11 +78,9 @@
78
78
  "x-priority": "internal"
79
79
  },
80
80
  "linter": {
81
- "description": "The tool to use for running lint checks.",
81
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
82
82
  "type": "string",
83
- "enum": ["eslint", "none"],
84
- "default": "none",
85
- "x-prompt": "Which linter would you like to use?",
83
+ "enum": ["eslint", "oxlint", "none"],
86
84
  "x-priority": "important"
87
85
  },
88
86
  "unitTestRunner": {
@@ -27,11 +27,29 @@ async function normalizeOptions(host, options) {
27
27
  const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
28
28
  nxJson.useInferencePlugins !== false;
29
29
  const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
30
+ let appMain;
31
+ let appSourceRoot;
32
+ if (options.appProject) {
33
+ const appProjectConfig = (0, devkit_1.getProjects)(host).get(options.appProject);
34
+ const appProjectType = (0, internal_2.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
35
+ if (appProjectType !== 'application') {
36
+ throw new Error(`appProject expected type of "application" but got "${appProjectType}"`);
37
+ }
38
+ const projectSourceRoot = (0, internal_2.getProjectSourceRoot)(appProjectConfig, host);
39
+ try {
40
+ appMain = appProjectConfig.targets.build.options.main;
41
+ appSourceRoot = (0, devkit_1.normalizePath)(projectSourceRoot);
42
+ }
43
+ catch (e) {
44
+ throw new Error(`Could not locate project main for ${options.appProject}`);
45
+ }
46
+ }
30
47
  const normalized = {
31
48
  addPlugin,
32
49
  ...options,
33
50
  projectName: isUsingTsSolutionConfig && !options.name ? importPath : projectName,
34
- bundler,
51
+ // Libraries with a bundler or that are publishable must also be buildable.
52
+ bundler: bundler !== 'none' || options.publishable ? 'vite' : 'none',
35
53
  fileName,
36
54
  routePath: `/${projectNames.projectFileName}`,
37
55
  name: projectName,
@@ -40,25 +58,12 @@ async function normalizeOptions(host, options) {
40
58
  importPath,
41
59
  isUsingTsSolutionConfig,
42
60
  useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
61
+ js: options.js ?? false,
62
+ appMain,
63
+ appSourceRoot,
64
+ // Framework-specific ESLint shaping is guarded on `=== 'eslint'`, so an
65
+ // unresolved `undefined` would create a bare config with none of it.
66
+ linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
43
67
  };
44
- // Libraries with a bundler or is publishable must also be buildable.
45
- normalized.bundler =
46
- normalized.bundler !== 'none' || options.publishable ? 'vite' : 'none';
47
- normalized.inSourceTests === normalized.minimal || normalized.inSourceTests;
48
- if (options.appProject) {
49
- const appProjectConfig = (0, devkit_1.getProjects)(host).get(options.appProject);
50
- const appProjectType = (0, internal_2.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
51
- if (appProjectType !== 'application') {
52
- throw new Error(`appProject expected type of "application" but got "${appProjectType}"`);
53
- }
54
- const appSourceRoot = (0, internal_2.getProjectSourceRoot)(appProjectConfig, host);
55
- try {
56
- normalized.appMain = appProjectConfig.targets.build.options.main;
57
- normalized.appSourceRoot = (0, devkit_1.normalizePath)(appSourceRoot);
58
- }
59
- catch (e) {
60
- throw new Error(`Could not locate project main for ${options.appProject}`);
61
- }
62
- }
63
68
  return normalized;
64
69
  }
@@ -1,4 +1,4 @@
1
- import type { Linter, LinterType } from '@nx/eslint';
1
+ import type { LinterType } from '@nx/js';
2
2
 
3
3
  export interface Schema {
4
4
  appProject?: string;
@@ -8,7 +8,7 @@ export interface Schema {
8
8
  importPath?: string;
9
9
  inSourceTests?: boolean;
10
10
  js?: boolean;
11
- linter: Linter | LinterType;
11
+ linter?: LinterType;
12
12
  name?: string;
13
13
  publishable?: boolean;
14
14
  routing?: boolean;
@@ -33,7 +33,7 @@ export interface NormalizedSchema extends Schema {
33
33
  js: boolean;
34
34
  name: string;
35
35
  projectName: string;
36
- linter: Linter | LinterType;
36
+ linter: LinterType;
37
37
  fileName: string;
38
38
  projectRoot: string;
39
39
  routePath: string;
@@ -33,11 +33,9 @@
33
33
  "x-priority": "important"
34
34
  },
35
35
  "linter": {
36
- "description": "The tool to use for running lint checks.",
36
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
37
37
  "type": "string",
38
- "enum": ["eslint", "none"],
39
- "default": "none",
40
- "x-prompt": "Which linter would you like to use?",
38
+ "enum": ["eslint", "oxlint", "none"],
41
39
  "x-priority": "important"
42
40
  },
43
41
  "unitTestRunner": {
@@ -1,4 +1,4 @@
1
- import { Linter, LinterType } from '@nx/eslint';
1
+ import { LinterType } from '@nx/js';
2
2
 
3
3
  export interface StorybookConfigureSchema {
4
4
  project: string;
@@ -6,7 +6,7 @@ export interface StorybookConfigureSchema {
6
6
  generateStories?: boolean;
7
7
  js?: boolean;
8
8
  tsConfiguration?: boolean;
9
- linter?: Linter | LinterType;
9
+ linter?: LinterType;
10
10
  ignorePaths?: string[];
11
11
  configureStaticServe?: boolean;
12
12
  addPlugin?: boolean;
@@ -53,8 +53,7 @@
53
53
  "linter": {
54
54
  "description": "The tool to use for running lint checks.",
55
55
  "type": "string",
56
- "enum": ["eslint"],
57
- "default": "eslint"
56
+ "enum": ["eslint", "oxlint"]
58
57
  },
59
58
  "ignorePaths": {
60
59
  "type": "array",
@@ -1,7 +1,7 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
- import { Linter, LinterType } from '@nx/eslint';
2
+ import { LinterType } from '@nx/js';
3
3
  export declare function addLinting(host: Tree, options: {
4
- linter: Linter | LinterType;
4
+ linter: LinterType;
5
5
  name: string;
6
6
  projectRoot: string;
7
7
  unitTestRunner?: 'vitest' | 'none';
@@ -2,25 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLinting = addLinting;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const eslint_1 = require("@nx/eslint");
6
5
  const internal_1 = require("@nx/eslint/internal");
7
6
  const versions_1 = require("./versions");
7
+ const internal_2 = require("@nx/js/internal");
8
8
  async function addLinting(host, options, projectType) {
9
+ const tasks = [];
10
+ tasks.push(await (0, internal_2.addLintingToProject)(host, {
11
+ oxlintPlugins: ['vue'],
12
+ linter: options.linter,
13
+ project: options.projectName,
14
+ tsConfigPaths: [
15
+ (0, devkit_1.joinPathFragments)(options.projectRoot, `tsconfig.${projectType}.json`),
16
+ ],
17
+ unitTestRunner: options.unitTestRunner,
18
+ enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
19
+ rootProject: options.rootProject,
20
+ addPlugin: options.addPlugin,
21
+ skipPackageJson: options.skipPackageJson,
22
+ }));
23
+ // Everything below configures ESLint — predefined configs, `extends`, ignore
24
+ // entries — which have no equivalent in other linters.
9
25
  if (options.linter === 'eslint') {
10
- const tasks = [];
11
- const lintTask = await (0, eslint_1.lintProjectGenerator)(host, {
12
- linter: options.linter,
13
- project: options.projectName,
14
- tsConfigPaths: [
15
- (0, devkit_1.joinPathFragments)(options.projectRoot, `tsconfig.${projectType}.json`),
16
- ],
17
- unitTestRunner: options.unitTestRunner,
18
- skipFormat: true,
19
- enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
20
- rootProject: options.rootProject,
21
- addPlugin: options.addPlugin,
22
- });
23
- tasks.push(lintTask);
24
26
  if ((0, internal_1.useFlatConfig)(host)) {
25
27
  }
26
28
  else {
@@ -47,11 +49,8 @@ async function addLinting(host, options, projectType) {
47
49
  const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, devDependencies, undefined, true);
48
50
  tasks.push(installTask);
49
51
  }
50
- return (0, devkit_1.runTasksInSerial)(...tasks);
51
- }
52
- else {
53
- return () => { };
54
52
  }
53
+ return (0, devkit_1.runTasksInSerial)(...tasks);
55
54
  }
56
55
  function editEslintConfigFiles(tree, projectRoot) {
57
56
  const hasVueFiles = (o) => o.files &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/vue",
3
- "version": "23.2.0-beta.6",
3
+ "version": "23.2.0-beta.8",
4
4
  "private": false,
5
5
  "description": "The Vue plugin for Nx contains executors and generators for managing Vue 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": {
@@ -63,15 +63,15 @@
63
63
  "dependencies": {
64
64
  "picomatch": "4.0.4",
65
65
  "tslib": "^2.3.0",
66
- "@nx/eslint": "23.2.0-beta.6",
67
- "@nx/devkit": "23.2.0-beta.6",
68
- "@nx/js": "23.2.0-beta.6",
69
- "@nx/vite": "23.2.0-beta.6",
70
- "@nx/vitest": "23.2.0-beta.6",
71
- "@nx/web": "23.2.0-beta.6"
66
+ "@nx/js": "23.2.0-beta.8",
67
+ "@nx/eslint": "23.2.0-beta.8",
68
+ "@nx/vitest": "23.2.0-beta.8",
69
+ "@nx/vite": "23.2.0-beta.8",
70
+ "@nx/devkit": "23.2.0-beta.8",
71
+ "@nx/web": "23.2.0-beta.8"
72
72
  },
73
73
  "devDependencies": {
74
- "nx": "23.2.0-beta.6"
74
+ "nx": "23.2.0-beta.8"
75
75
  },
76
76
  "publishConfig": {
77
77
  "access": "public"
@@ -81,10 +81,10 @@
81
81
  "vue-router": "^4.0.0",
82
82
  "vue-tsc": "^2.0.0",
83
83
  "@vitejs/plugin-vue": "^5.0.0 || ^6.0.0",
84
- "@nx/cypress": "23.2.0-beta.6",
85
- "@nx/rsbuild": "23.2.0-beta.6",
86
- "@nx/playwright": "23.2.0-beta.6",
87
- "@nx/storybook": "23.2.0-beta.6"
84
+ "@nx/cypress": "23.2.0-beta.8",
85
+ "@nx/playwright": "23.2.0-beta.8",
86
+ "@nx/storybook": "23.2.0-beta.8",
87
+ "@nx/rsbuild": "23.2.0-beta.8"
88
88
  },
89
89
  "peerDependenciesMeta": {
90
90
  "@nx/cypress": {