@nx/js 17.0.0-beta.6 → 17.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/js",
3
- "version": "17.0.0-beta.6",
3
+ "version": "17.0.0-beta.8",
4
4
  "private": false,
5
5
  "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
6
6
  "repository": {
@@ -57,9 +57,9 @@
57
57
  "semver": "7.5.3",
58
58
  "source-map-support": "0.5.19",
59
59
  "tslib": "^2.3.0",
60
- "@nx/devkit": "17.0.0-beta.6",
61
- "@nx/workspace": "17.0.0-beta.6",
62
- "@nrwl/js": "17.0.0-beta.6"
60
+ "@nx/devkit": "17.0.0-beta.8",
61
+ "@nx/workspace": "17.0.0-beta.8",
62
+ "@nrwl/js": "17.0.0-beta.8"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "verdaccio": "^5.0.4"
@@ -37,7 +37,7 @@ async function libraryGeneratorInternal(tree, schema) {
37
37
  tasks.push(await (0, generator_1.default)(tree, { ...options, skipFormat: true }));
38
38
  }
39
39
  if (options.bundler === 'vite') {
40
- const { viteConfigurationGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
40
+ const { viteConfigurationGenerator, createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
41
41
  const viteTask = await viteConfigurationGenerator(tree, {
42
42
  project: options.name,
43
43
  newProject: true,
@@ -48,6 +48,11 @@ async function libraryGeneratorInternal(tree, schema) {
48
48
  testEnvironment: options.testEnvironment,
49
49
  });
50
50
  tasks.push(viteTask);
51
+ createOrEditViteConfig(tree, {
52
+ project: options.name,
53
+ includeLib: true,
54
+ includeVitest: options.unitTestRunner === 'vitest',
55
+ }, false);
51
56
  }
52
57
  if (options.linter !== 'none') {
53
58
  const lintCallback = await addLint(tree, options);
@@ -63,7 +68,7 @@ async function libraryGeneratorInternal(tree, schema) {
63
68
  else if (options.unitTestRunner === 'vitest' &&
64
69
  options.bundler !== 'vite' // Test would have been set up already
65
70
  ) {
66
- const { vitestGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
71
+ const { vitestGenerator, createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
67
72
  const vitestTask = await vitestGenerator(tree, {
68
73
  project: options.name,
69
74
  uiFramework: 'none',
@@ -72,6 +77,11 @@ async function libraryGeneratorInternal(tree, schema) {
72
77
  testEnvironment: options.testEnvironment,
73
78
  });
74
79
  tasks.push(vitestTask);
80
+ createOrEditViteConfig(tree, {
81
+ project: options.name,
82
+ includeLib: false,
83
+ includeVitest: true,
84
+ }, true);
75
85
  }
76
86
  if (!schema.skipTsConfig) {
77
87
  (0, ts_config_1.addTsConfigPath)(tree, options.importPath, [
@@ -147,10 +157,10 @@ function addProject(tree, options) {
147
157
  }
148
158
  }
149
159
  async function addLint(tree, options) {
150
- const { lintProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/linter', versions_1.nxVersion);
160
+ const { lintProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
151
161
  const { mapLintPattern } =
152
162
  // nx-ignore-next-line
153
- require('@nx/linter/src/generators/lint-project/lint-project');
163
+ require('@nx/eslint/src/generators/lint-project/lint-project');
154
164
  const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, options.name);
155
165
  const task = lintProjectGenerator(tree, {
156
166
  project: options.name,
@@ -168,7 +178,7 @@ async function addLint(tree, options) {
168
178
  });
169
179
  const { addOverrideToLintConfig, lintConfigHasOverride, isEslintConfigSupported, updateOverrideInLintConfig,
170
180
  // nx-ignore-next-line
171
- } = require('@nx/linter/src/generators/utils/eslint-file');
181
+ } = require('@nx/eslint/src/generators/utils/eslint-file');
172
182
  // if config is not supported, we don't need to do anything
173
183
  if (!isEslintConfigSupported(tree)) {
174
184
  return task;
@@ -414,7 +424,7 @@ async function normalizeOptions(tree, options) {
414
424
  if (options.publishable === false && options.buildable === false) {
415
425
  options.bundler = 'none';
416
426
  }
417
- const { Linter } = (0, devkit_1.ensurePackage)('@nx/linter', versions_1.nxVersion);
427
+ const { Linter } = (0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
418
428
  if (options.config === 'npm-scripts') {
419
429
  options.unitTestRunner = 'none';
420
430
  options.linter = Linter.None;
@@ -2,7 +2,7 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project
2
2
  import type { AssetGlob, FileInputOutput } from './assets/assets';
3
3
  import { TransformerEntry } from './typescript/types';
4
4
  // nx-ignore-next-line
5
- const { Linter } = require('@nx/linter'); // use require to import to avoid circular dependency
5
+ const { Linter } = require('@nx/eslint'); // use require to import to avoid circular dependency
6
6
 
7
7
  export type Compiler = 'tsc' | 'swc';
8
8
  export type Bundler = 'swc' | 'tsc' | 'rollup' | 'vite' | 'esbuild' | 'none';