vite-plus 0.2.4 → 0.2.6

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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/binding/index.cjs +53 -52
  3. package/binding/index.d.cts +43 -41
  4. package/dist/{agent-eMtwgY-u.js → agent-0gFJkIKu.js} +34 -109
  5. package/dist/bin.d.ts +1 -1
  6. package/dist/bin.js +8 -5
  7. package/dist/config/bin.d.ts +1 -1
  8. package/dist/config/bin.js +2 -2
  9. package/dist/{constants-DdXYYBsz.js → constants-CaXMuYUG.js} +1 -1
  10. package/dist/create/bin.js +73 -22
  11. package/dist/{define-config-BuMs_LKa.d.ts → define-config-eLQH9us2.d.ts} +2 -3
  12. package/dist/{define-config-Dn5coJS5.js → define-config-hV8qyU8p.js} +2 -2
  13. package/dist/{define-config-DUsBrwKn.cjs → define-config-iGV0CGUk.cjs} +1 -1
  14. package/dist/define-config.cjs +1 -1
  15. package/dist/define-config.d.ts +1 -1
  16. package/dist/define-config.js +1 -1
  17. package/dist/{editor-DL4u-ujK.js → editor-D4T70tKk.js} +95 -4
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/migration/bin.d.ts +1 -1
  22. package/dist/migration/bin.js +5 -5
  23. package/dist/migration/compat/worker.d.ts +1 -1
  24. package/dist/{oxlint-plugin-config-BiYDWQLd.js → oxlint-plugin-config-CMSCIkks.js} +1 -1
  25. package/dist/oxlint-plugin.js +1 -1
  26. package/dist/{pack-Ciiho0Tq.d.ts → pack-PvUg_xpv.d.ts} +0 -1
  27. package/dist/pack-bin.js +1 -1
  28. package/dist/pack.d.ts +1 -1
  29. package/dist/{package-D2xMMmTQ.js → package-CP5EUXlu.js} +1 -1
  30. package/dist/{resolve-vite-config-5SuNAKdv.js → resolve-vite-config-BY7PB-LW.js} +1 -1
  31. package/dist/staged/bin.d.ts +1 -1
  32. package/dist/staged/bin.js +47 -17
  33. package/dist/{tsconfig-CtdiYBV_.js → tsconfig-Cac-NNdT.js} +86 -78
  34. package/dist/version.js +2 -2
  35. package/dist/versions.js +6 -6
  36. package/docs/config/run.md +3 -6
  37. package/docs/guide/docker.md +46 -2
  38. package/docs/guide/env.md +12 -0
  39. package/docs/guide/github-actions-cache.md +2 -2
  40. package/docs/guide/index.md +2 -0
  41. package/docs/guide/installer-env-vars.md +195 -0
  42. package/package.json +20 -23
  43. package/templates/monorepo/_gitignore +5 -0
  44. package/templates/monorepo/_yarnrc.yml +1 -1
  45. package/templates/monorepo/pnpm-workspace.yaml +1 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-BuMs_LKa.js";
1
+ import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-eLQH9us2.js";
2
2
  import { TestProjectConfiguration, TestProjectInlineConfiguration, TestTagDefinition, TestUserConfig, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, ViteUserConfig, ViteUserConfigExport, ViteUserConfigFn, ViteUserConfigFnObject, ViteUserConfigFnPromise, WatcherTriggerPattern, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
3
3
  export * from "@voidzero-dev/vite-plus-core";
4
4
  export { type TestProjectConfiguration, type TestProjectInlineConfiguration, type TestTagDefinition, type TestUserConfig, type UserProjectConfigExport, type UserProjectConfigFn, type UserWorkspaceConfig, type ViteUserConfig, type ViteUserConfigExport, type ViteUserConfigFn, type ViteUserConfigFnObject, type ViteUserConfigFnPromise, type WatcherTriggerPattern, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-Dn5coJS5.js";
1
+ import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-hV8qyU8p.js";
2
2
  import { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
3
3
  export * from "@voidzero-dev/vite-plus-core";
4
4
  export { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins };
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1,13 +1,13 @@
1
1
  import { r as __toESM } from "../rolldown-runtime-C7HZzL1F.js";
2
- import { d as isForceOverrideMode, l as VITE_PLUS_VERSION } from "../constants-DdXYYBsz.js";
3
- import { B as runCommandSilently, D as require_semver, E as PackageManager, F as spinner, N as outro, P as select, R as isCancel, _ as upgradeYarn, d as downloadPackageManager, f as promptGitHooks, g as selectPackageManager, h as runViteInstall, i as hasBaseUrlInTsconfig, j as log, k as confirm, l as cancelAndExit, m as runViteFmt, r as fixBaseUrlInTsconfig, t as confirmBaseUrlFix, u as defaultInteractive } from "../tsconfig-CtdiYBV_.js";
2
+ import { d as isForceOverrideMode, l as VITE_PLUS_VERSION } from "../constants-CaXMuYUG.js";
3
+ import { B as runCommandSilently, D as require_semver, E as PackageManager, F as spinner, N as outro, P as select, R as isCancel, _ as upgradeYarn, d as downloadPackageManager, f as promptGitHooks, g as selectPackageManager, h as runViteInstall, i as hasBaseUrlInTsconfig, j as log, k as confirm, l as cancelAndExit, m as runViteFmt, r as fixBaseUrlInTsconfig, t as confirmBaseUrlFix, u as defaultInteractive } from "../tsconfig-Cac-NNdT.js";
4
4
  import { a as printHeader, i as muted, r as log$1, s as warnMsg, t as accent } from "../terminal-uTv0ZaMr.js";
5
5
  import { a as writeJsonFile, i as readJsonFile } from "../json-DiRs8ceZ.js";
6
6
  import { t as lib_default } from "../lib-L3DWSRQp.js";
7
- import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-D2xMMmTQ.js";
8
- import { A as detectWorkspace, B as warnIncompatibleEslintIntegration, C as injectLintTypeCheckDefaults, D as ensureVitePlusBootstrap, E as detectVitePlusBootstrapPending, F as detectEslintProject, H as warnPackageLevelEslint, I as detectIncompatibleEslintIntegration, K as checkViteVersion, L as migrateEslintToOxlint, O as configureYarnNodeModulesMode, P as confirmEslintMigration, T as collectToolchainVersionChanges, V as warnLegacyEslintConfig, Y as displayRelative, _ as detectLegacyGitHooksMigrationCandidate, b as preflightGitHooksSetup, d as rewriteStandaloneProject, f as detectPendingCoreMigration, h as migrateNodeVersionManagerFile, i as selectAgentTargetPaths, k as detectYarnPnpMode, l as rewriteMonorepo, m as detectNodeVersionManagerFile, n as detectAgentConflicts, p as finalizeCoreMigrationForExistingVitePlus, q as checkVitestVersion, r as detectExistingAgentTargetPaths, s as writeAgentInstructions, w as mergeViteConfigFiles, y as installGitHooks } from "../agent-eMtwgY-u.js";
7
+ import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-CP5EUXlu.js";
8
+ import { B as warnPackageLevelEslint, C as injectLintTypeCheckDefaults, D as ensureVitePlusBootstrap, E as detectVitePlusBootstrapPending, F as migrateEslintToOxlint, G as checkVitestVersion, M as confirmEslintMigration, N as detectEslintProject, O as configureYarnNodeModulesMode, P as detectIncompatibleEslintIntegration, R as warnIncompatibleEslintIntegration, T as collectToolchainVersionChanges, W as checkViteVersion, _ as detectLegacyGitHooksMigrationCandidate, b as preflightGitHooksSetup, d as rewriteStandaloneProject, f as detectPendingCoreMigration, h as migrateNodeVersionManagerFile, i as selectAgentTargetPaths, k as detectYarnPnpMode, l as rewriteMonorepo, m as detectNodeVersionManagerFile, n as detectAgentConflicts, p as finalizeCoreMigrationForExistingVitePlus, q as displayRelative, r as detectExistingAgentTargetPaths, s as writeAgentInstructions, w as mergeViteConfigFiles, y as installGitHooks, z as warnLegacyEslintConfig } from "../agent-0gFJkIKu.js";
9
9
  import { n as addMigrationWarning, r as createMigrationReport } from "../report-BS7ULx7A.js";
10
- import { a as writeEditorConfigs, c as hasFrameworkShim, d as migratePrettierToOxfmt, l as confirmPrettierMigration, o as addFrameworkShim, p as warnPackageLevelPrettier, r as selectEditor, s as detectFramework, t as detectEditorConflicts, u as detectPrettierProject } from "../editor-DL4u-ujK.js";
10
+ import { _ as warnPackageLevelPrettier, a as writeEditorConfigs, d as detectFramework, f as hasFrameworkShim, h as migratePrettierToOxfmt, m as detectPrettierProject, o as detectWorkspace, p as confirmPrettierMigration, r as selectEditor, t as detectEditorConflicts, u as addFrameworkShim } from "../editor-D4T70tKk.js";
11
11
  import { t as renderCliDoc } from "../help-YP84FSEz.js";
12
12
  import { t as ROLLDOWN_COMPAT_RESULT_PREFIX } from "../protocol-D99W10Qi.js";
13
13
  import path from "node:path";
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1,4 +1,4 @@
1
- import { s as VITE_PLUS_NAME } from "./constants-DdXYYBsz.js";
1
+ import { s as VITE_PLUS_NAME } from "./constants-CaXMuYUG.js";
2
2
  //#region src/oxlint-plugin-config.ts
3
3
  const VITE_PLUS_OXLINT_PLUGIN_NAME = VITE_PLUS_NAME;
4
4
  const VITE_PLUS_OXLINT_PLUGIN_SPECIFIER = `${VITE_PLUS_NAME}/oxlint-plugin`;
@@ -1,4 +1,4 @@
1
- import { n as VITE_PLUS_OXLINT_PLUGIN_NAME, t as PREFER_VITE_PLUS_IMPORTS_RULE_NAME } from "./oxlint-plugin-config-BiYDWQLd.js";
1
+ import { n as VITE_PLUS_OXLINT_PLUGIN_NAME, t as PREFER_VITE_PLUS_IMPORTS_RULE_NAME } from "./oxlint-plugin-config-CMSCIkks.js";
2
2
  import path from "node:path";
3
3
  import fs from "node:fs";
4
4
  import { definePlugin, defineRule } from "@oxlint/plugins";
@@ -1,5 +1,4 @@
1
1
  import { UserConfig } from "@voidzero-dev/vite-plus-core/pack";
2
-
3
2
  //#region src/pack.d.ts
4
3
  interface PackUserConfig extends UserConfig {
5
4
  /**
package/dist/pack-bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as resolveViteConfig } from "./resolve-vite-config-5SuNAKdv.js";
2
+ import { a as resolveViteConfig } from "./resolve-vite-config-BY7PB-LW.js";
3
3
  import module from "node:module";
4
4
  import { buildWithConfigs, enableDebug, globalLogger, resolveUserConfig } from "@voidzero-dev/vite-plus-core/pack";
5
5
  //#region ../../node_modules/.pnpm/cac@7.0.0/node_modules/cac/dist/index.js
package/dist/pack.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { t as PackUserConfig } from "./pack-Ciiho0Tq.js";
1
+ import { t as PackUserConfig } from "./pack-PvUg_xpv.js";
2
2
  export * from "@voidzero-dev/vite-plus-core/pack";
3
3
  export { PackUserConfig };
@@ -1,4 +1,4 @@
1
- import "./constants-DdXYYBsz.js";
1
+ import "./constants-CaXMuYUG.js";
2
2
  import { i as readJsonFile } from "./json-DiRs8ceZ.js";
3
3
  import { createRequire } from "node:module";
4
4
  import path from "node:path";
@@ -1,4 +1,4 @@
1
- import { u as withConfigMetadataResolution } from "./define-config-Dn5coJS5.js";
1
+ import { u as withConfigMetadataResolution } from "./define-config-hV8qyU8p.js";
2
2
  import path from "node:path";
3
3
  import fs from "node:fs";
4
4
  //#region src/resolve-vite-config.ts
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1,6 +1,6 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-C7HZzL1F.js";
2
2
  import { a as printHeader, n as errorMsg, r as log } from "../terminal-uTv0ZaMr.js";
3
- import { a as resolveViteConfig } from "../resolve-vite-config-5SuNAKdv.js";
3
+ import { a as resolveViteConfig } from "../resolve-vite-config-BY7PB-LW.js";
4
4
  import { t as lib_default } from "../lib-L3DWSRQp.js";
5
5
  import { t as renderCliDoc } from "../help-YP84FSEz.js";
6
6
  import { createRequire } from "node:module";
@@ -10,11 +10,11 @@ import { formatWithOptions, inspect, promisify } from "node:util";
10
10
  import { cwd } from "node:process";
11
11
  import l__default from "node:readline";
12
12
  import nodeTty from "node:tty";
13
+ import crypto from "node:crypto";
13
14
  import { pathToFileURL } from "node:url";
14
15
  import { EOL } from "node:os";
15
16
  import fsPromises, { constants as constants$1 } from "node:fs/promises";
16
17
  import { PassThrough, Writable } from "node:stream";
17
- import crypto from "node:crypto";
18
18
  import { exec, spawn } from "node:child_process";
19
19
  import { pipeline } from "node:stream/promises";
20
20
  import * as tty from "tty";
@@ -474,7 +474,8 @@ const execGit = async (cmd, options) => {
474
474
  return output;
475
475
  };
476
476
  var eventemitter3_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
477
- var has = Object.prototype.hasOwnProperty, prefix = "~";
477
+ var has = Object.prototype.hasOwnProperty;
478
+ var prefix = "~";
478
479
  /**
479
480
  * Constructor to create a storage for our `EE` objects.
480
481
  * An `Events` instance is a plain object whose properties are event names.
@@ -2956,7 +2957,7 @@ const chunkFiles = ({ files, baseDir, maxArgLength = null, relative = false }) =
2956
2957
  return chunkArray(normalizedFiles, chunkCount);
2957
2958
  };
2958
2959
  //#endregion
2959
- //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
2960
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/constants.js
2960
2961
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2961
2962
  const WIN_SLASH = "\\\\/";
2962
2963
  const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
@@ -3125,7 +3126,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3125
3126
  };
3126
3127
  }));
3127
3128
  //#endregion
3128
- //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js
3129
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/utils.js
3129
3130
  var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
3130
3131
  const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
3131
3132
  exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
@@ -3173,7 +3174,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
3173
3174
  };
3174
3175
  }));
3175
3176
  //#endregion
3176
- //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js
3177
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/scan.js
3177
3178
  var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3178
3179
  const utils = require_utils();
3179
3180
  const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
@@ -3460,7 +3461,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3460
3461
  module.exports = scan;
3461
3462
  }));
3462
3463
  //#endregion
3463
- //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js
3464
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/parse.js
3464
3465
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3465
3466
  const constants = require_constants();
3466
3467
  const utils = require_utils();
@@ -3615,7 +3616,10 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3615
3616
  }
3616
3617
  }
3617
3618
  };
3618
- const getStarExtglobSequenceOutput = (pattern) => {
3619
+ const buildCharClassStar = (chars) => {
3620
+ return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
3621
+ };
3622
+ const getStarExtglobSequenceChars = (pattern) => {
3619
3623
  let index = 0;
3620
3624
  const chars = [];
3621
3625
  while (index < pattern.length) {
@@ -3629,7 +3633,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3629
3633
  index += match.end + 1;
3630
3634
  }
3631
3635
  if (chars.length < 1) return;
3632
- return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
3636
+ return chars;
3633
3637
  };
3634
3638
  const repeatedExtglobRecursion = (pattern) => {
3635
3639
  let depth = 0;
@@ -3649,14 +3653,28 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3649
3653
  if (branches.length > 1) {
3650
3654
  if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
3651
3655
  }
3656
+ const safeChars = [];
3657
+ let sawStarSequence = false;
3658
+ let combinable = true;
3652
3659
  for (const branch of branches) {
3653
- const safeOutput = getStarExtglobSequenceOutput(branch);
3654
- if (safeOutput) return {
3655
- risky: true,
3656
- safeOutput
3657
- };
3660
+ const chars = getStarExtglobSequenceChars(branch);
3661
+ if (chars) {
3662
+ sawStarSequence = true;
3663
+ safeChars.push(...chars);
3664
+ continue;
3665
+ }
3666
+ const literal = normalizeSimpleBranch(branch);
3667
+ if (literal && literal.length === 1) {
3668
+ safeChars.push(literal);
3669
+ continue;
3670
+ }
3671
+ combinable = false;
3658
3672
  if (repeatedExtglobRecursion(branch) > max) return { risky: true };
3659
3673
  }
3674
+ if (sawStarSequence) return combinable ? {
3675
+ risky: true,
3676
+ safeOutput: buildCharClassStar([...new Set(safeChars)])
3677
+ } : { risky: true };
3660
3678
  return { risky: false };
3661
3679
  };
3662
3680
  /**
@@ -4517,7 +4535,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4517
4535
  module.exports = parse;
4518
4536
  }));
4519
4537
  //#endregion
4520
- //#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js
4538
+ //#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/picomatch.js
4521
4539
  var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4522
4540
  const scan = require_scan();
4523
4541
  const parse = require_parse();
@@ -4538,6 +4556,18 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4538
4556
  * const isMatch = picomatch('*.!(*a)');
4539
4557
  * console.log(isMatch('a.a')); //=> false
4540
4558
  * console.log(isMatch('a.b')); //=> true
4559
+ *
4560
+ * // For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
4561
+ * const picomatch = require('picomatch/posix');
4562
+ * // the same API, defaulting to posix paths
4563
+ * const isMatch = picomatch('a/*');
4564
+ * console.log(isMatch('a\\b')); //=> false
4565
+ * console.log(isMatch('a/b')); //=> true
4566
+ *
4567
+ * // you can still configure the matcher function to accept windows paths
4568
+ * const isMatch = picomatch('a/*', { options: windows });
4569
+ * console.log(isMatch('a\\b')); //=> true
4570
+ * console.log(isMatch('a/b')); //=> true
4541
4571
  * ```
4542
4572
  * @name picomatch
4543
4573
  * @param {String|Array} `globs` One or more glob patterns.
@@ -4656,8 +4686,8 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4656
4686
  * @return {Boolean}
4657
4687
  * @api public
4658
4688
  */
4659
- picomatch.matchBase = (input, glob, options) => {
4660
- return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input));
4689
+ picomatch.matchBase = (input, glob, options, posix = options && options.windows) => {
4690
+ return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input, { windows: posix }));
4661
4691
  };
4662
4692
  /**
4663
4693
  * Returns true if **any** of the given glob `patterns` match the specified `string`.