@nx/vite 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.
@@ -413,13 +413,9 @@ async function handleUnsupportedUserProvidedTargetsErrors(userProvidedTargetName
413
413
  Please note that converting a potentially non-compatible project to use Vite may result in unexpected behavior. Always commit
414
414
  your changes before converting a project to use Vite, and test the converted project thoroughly before deploying it.
415
415
  `);
416
- const { Confirm } = require('enquirer');
417
- const prompt = new Confirm({
418
- name: 'question',
416
+ const shouldConvert = await (0, internal_1.confirmationPrompt)({
419
417
  message: `Should we convert the ${validFoundTargetName} target to use the @nx/vite:${executor} executor?`,
420
- initial: true,
421
418
  });
422
- const shouldConvert = await prompt.run();
423
419
  if (!shouldConvert) {
424
420
  throw new Error(`The ${target} target ${userProvidedTargetName} cannot be converted to use the @nx/vite:${executor} executor.
425
421
  Please try again, either by providing a different ${target} target or by not providing a target at all (Nx will
@@ -441,13 +437,9 @@ async function handleUnknownConfiguration(projectName) {
441
437
  If you still want to convert your project to use Vite,
442
438
  please make sure to commit your changes before running this generator.
443
439
  `);
444
- const { Confirm } = require('enquirer');
445
- const prompt = new Confirm({
446
- name: 'question',
440
+ const shouldConvert = await (0, internal_1.confirmationPrompt)({
447
441
  message: `Should Nx convert your project to use Vite?`,
448
- initial: true,
449
442
  });
450
- const shouldConvert = await prompt.run();
451
443
  if (!shouldConvert) {
452
444
  throw new Error(`
453
445
  Nx could not verify that your project can be converted to use Vite.
@@ -1,4 +1,3 @@
1
1
  import { type Tree } from '@nx/devkit';
2
2
  export declare function ignoreViteTempFiles(tree: Tree, projectRoot?: string | undefined): Promise<void>;
3
3
  export declare function addViteTempFilesToGitIgnore(tree: Tree): void;
4
- export declare function isEslintInstalled(tree: Tree): boolean;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ignoreViteTempFiles = ignoreViteTempFiles;
4
4
  exports.addViteTempFilesToGitIgnore = addViteTempFilesToGitIgnore;
5
- exports.isEslintInstalled = isEslintInstalled;
6
5
  const devkit_1 = require("@nx/devkit");
6
+ const internal_1 = require("@nx/js/internal");
7
7
  const versions_1 = require("./versions");
8
8
  async function ignoreViteTempFiles(tree, projectRoot) {
9
9
  addViteTempFilesToGitIgnore(tree);
@@ -20,7 +20,9 @@ function addViteTempFilesToGitIgnore(tree) {
20
20
  tree.write('.gitignore', gitIgnoreContents);
21
21
  }
22
22
  async function ignoreViteTempFilesInEslintConfig(tree, projectRoot) {
23
- if (!isEslintInstalled(tree)) {
23
+ // Checked before `ensurePackage` so an Oxlint workspace does not install
24
+ // `@nx/eslint` only for `isEslintConfigSupported` to send it straight back.
25
+ if (!(0, internal_1.detectLinters)(tree).includes('eslint')) {
24
26
  return;
25
27
  }
26
28
  (0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
@@ -45,15 +47,3 @@ async function ignoreViteTempFilesInEslintConfig(tree, projectRoot) {
45
47
  const directory = isUsingFlatConfig ? '' : (projectRoot ?? '');
46
48
  addIgnoresToLintConfig(tree, directory, ['**/vite.config.*.timestamp*']);
47
49
  }
48
- function isEslintInstalled(tree) {
49
- try {
50
- require('eslint');
51
- return true;
52
- }
53
- catch { }
54
- // it might not be installed yet, but it might be in the tree pending install
55
- const { devDependencies, dependencies } = tree.exists('package.json')
56
- ? (0, devkit_1.readJson)(tree, 'package.json')
57
- : {};
58
- return !!devDependencies?.['eslint'] || !!dependencies?.['eslint'];
59
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/vite",
3
- "version": "23.2.0-beta.6",
3
+ "version": "23.2.0-beta.8",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -95,19 +95,18 @@
95
95
  },
96
96
  "dependencies": {
97
97
  "@phenomnomnominal/tsquery": "~6.2.0",
98
- "enquirer": "~2.3.6",
99
98
  "picomatch": "4.0.4",
100
99
  "tsconfig-paths": "^4.1.2",
101
100
  "semver": "^7.6.3",
102
101
  "tslib": "^2.3.0",
103
102
  "ajv": "^8.0.0",
104
- "@nx/devkit": "23.2.0-beta.6",
105
- "@nx/js": "23.2.0-beta.6",
106
- "@nx/vitest": "23.2.0-beta.6"
103
+ "@nx/devkit": "23.2.0-beta.8",
104
+ "@nx/js": "23.2.0-beta.8",
105
+ "@nx/vitest": "23.2.0-beta.8"
107
106
  },
108
107
  "devDependencies": {
109
- "@nx/eslint": "23.2.0-beta.6",
110
- "nx": "23.2.0-beta.6"
108
+ "@nx/eslint": "23.2.0-beta.8",
109
+ "nx": "23.2.0-beta.8"
111
110
  },
112
111
  "peerDependencies": {
113
112
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"