vite-plus 0.2.5 → 0.2.7

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 (42) hide show
  1. package/AGENTS.md +4 -0
  2. package/README.md +1 -1
  3. package/binding/index.cjs +52 -52
  4. package/binding/index.d.cts +27 -16
  5. package/dist/{agent-CTwqJqX_.js → agent-CPwWJ4qf.js} +36 -14
  6. package/dist/bin.d.ts +1 -1
  7. package/dist/bin.js +7 -6
  8. package/dist/config/bin.d.ts +1 -1
  9. package/dist/config/bin.js +2 -2
  10. package/dist/{constants-JhDwfMS8.js → constants-BsuzPowC.js} +1 -1
  11. package/dist/create/bin.js +6 -6
  12. package/dist/{define-config-BRT5X5UW.js → define-config-C2KfLHpC.js} +2 -2
  13. package/dist/{define-config-DD3MUyPC.cjs → define-config-DLh9fE95.cjs} +1 -1
  14. package/dist/define-config.cjs +1 -1
  15. package/dist/define-config.js +1 -1
  16. package/dist/{editor-H_E_5XOt.js → editor-BbT1lTNc.js} +3 -3
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/migration/bin.d.ts +1 -1
  20. package/dist/migration/bin.js +7 -7
  21. package/dist/migration/compat/worker.d.ts +1 -1
  22. package/dist/{oxlint-plugin-config-CnUfwCp9.js → oxlint-plugin-config-Bxgc4cwF.js} +1 -1
  23. package/dist/oxlint-plugin.js +1 -1
  24. package/dist/pack-bin.js +2 -2
  25. package/dist/{package-BILvlUYF.js → package-Ds3uThLb.js} +1 -1
  26. package/dist/{resolve-vite-config-BheiDkKa.js → resolve-vite-config-BiuLZnn8.js} +1 -1
  27. package/dist/staged/bin.d.ts +1 -1
  28. package/dist/staged/bin.js +1 -1
  29. package/dist/{tsconfig-D2NvUjn3.js → tsconfig-Jia2vgMG.js} +1 -1
  30. package/dist/version.js +2 -2
  31. package/dist/versions.js +6 -6
  32. package/docs/guide/build.md +1 -1
  33. package/docs/guide/ci.md +28 -3
  34. package/docs/guide/commit-hooks.md +49 -0
  35. package/docs/guide/dev.md +4 -0
  36. package/docs/guide/github-actions-cache.md +2 -2
  37. package/docs/guide/installer-env-vars.md +2 -2
  38. package/docs/guide/migrate.md +1 -1
  39. package/docs/guide/run.md +15 -0
  40. package/docs/guide/test.md +4 -0
  41. package/docs/guide/troubleshooting.md +6 -3
  42. package/package.json +19 -19
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  //#region package.json
3
- var version = "0.2.5";
3
+ var version = "0.2.7";
4
4
  //#endregion
5
5
  //#region src/utils/constants.ts
6
6
  const VITE_PLUS_NAME = "vite-plus";
@@ -1,13 +1,13 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-C7HZzL1F.js";
2
- import { s as VITE_PLUS_NAME } from "../constants-JhDwfMS8.js";
3
- import { A as intro, B as runCommandSilently, C as resolveApproveBuildTargets, E as PackageManager, F as spinner, I as text, L as require_picocolors, M as multiselect, O as cancel, P as select, R as isCancel, S as detectGatedBuilds, T as DependencyType, V as require_cross_spawn, d as downloadPackageManager$1, f as promptGitHooks, g as selectPackageManager, h as runViteInstall, j as log, k as confirm, m as runViteFmt, p as resolveGitInit, u as defaultInteractive, v as editYamlFile, x as approveBuilds, y as readYamlFile, z as runCommand$1 } from "../tsconfig-D2NvUjn3.js";
2
+ import { s as VITE_PLUS_NAME } from "../constants-BsuzPowC.js";
3
+ import { A as intro, B as runCommandSilently, C as resolveApproveBuildTargets, E as PackageManager, F as spinner, I as text, L as require_picocolors, M as multiselect, O as cancel, P as select, R as isCancel, S as detectGatedBuilds, T as DependencyType, V as require_cross_spawn, d as downloadPackageManager$1, f as promptGitHooks, g as selectPackageManager, h as runViteInstall, j as log, k as confirm, m as runViteFmt, p as resolveGitInit, u as defaultInteractive, v as editYamlFile, x as approveBuilds, y as readYamlFile, z as runCommand$1 } from "../tsconfig-Jia2vgMG.js";
4
4
  import { a as printHeader, i as muted, o as success, r as log$1, t as accent } from "../terminal-uTv0ZaMr.js";
5
5
  import { i as readJsonFile, n as editJsonFile } from "../json-DiRs8ceZ.js";
6
- import { a as resolveViteConfig, n as findWorkspaceRoot, r as hasViteConfig, t as findViteConfig } from "../resolve-vite-config-BheiDkKa.js";
6
+ import { a as resolveViteConfig, n as findWorkspaceRoot, r as hasViteConfig, t as findViteConfig } from "../resolve-vite-config-BiuLZnn8.js";
7
7
  import { t as lib_default } from "../lib-L3DWSRQp.js";
8
- import { o as fetchNpmResource, s as getNpmRegistry, t as checkNpmPackageExists } from "../package-BILvlUYF.js";
9
- import { I as promptEslintMigration, J as templatesDir, N as detectEslintProject, S as injectCreateDefaultTemplate, a as selectAgentTargets, c as writeCopilotSetupWorkflow, d as rewriteStandaloneProject, g as setPackageManager, l as rewriteMonorepo, q as displayRelative, r as detectExistingAgentTargetPaths, s as writeAgentInstructions, t as COPILOT_AGENT_ID, u as rewriteMonorepoProject, y as installGitHooks } from "../agent-CTwqJqX_.js";
10
- import { a as writeEditorConfigs, c as updatePackageJsonWithDeps, d as detectFramework, f as hasFrameworkShim, g as promptPrettierMigration, i as selectEditors, l as updateWorkspaceConfig, m as detectPrettierProject, n as detectExistingEditors, o as detectWorkspace$1, s as isBingoTemplate, u as addFrameworkShim } from "../editor-H_E_5XOt.js";
8
+ import { o as fetchNpmResource, s as getNpmRegistry, t as checkNpmPackageExists } from "../package-Ds3uThLb.js";
9
+ import { I as promptEslintMigration, J as templatesDir, N as detectEslintProject, S as injectCreateDefaultTemplate, a as selectAgentTargets, c as writeCopilotSetupWorkflow, d as rewriteStandaloneProject, g as setPackageManager, l as rewriteMonorepo, q as displayRelative, r as detectExistingAgentTargetPaths, s as writeAgentInstructions, t as COPILOT_AGENT_ID, u as rewriteMonorepoProject, y as installGitHooks } from "../agent-CPwWJ4qf.js";
10
+ import { a as writeEditorConfigs, c as updatePackageJsonWithDeps, d as detectFramework, f as hasFrameworkShim, g as promptPrettierMigration, i as selectEditors, l as updateWorkspaceConfig, m as detectPrettierProject, n as detectExistingEditors, o as detectWorkspace$1, s as isBingoTemplate, u as addFrameworkShim } from "../editor-BbT1lTNc.js";
11
11
  import { t as renderCliDoc } from "../help-YP84FSEz.js";
12
12
  import path from "node:path";
13
13
  import { runCommand, upsertJsonConfig, vitePlusHeader } from "../../binding/index.js";
@@ -1,10 +1,10 @@
1
- import { o as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-JhDwfMS8.js";
1
+ import { o as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-BsuzPowC.js";
2
2
  import { createRequire } from "node:module";
3
3
  import path from "node:path";
4
4
  import { readFileSync } from "node:fs";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { defineConfig, defineProject } from "vitest/config";
7
- //#region ../../node_modules/.pnpm/tsdown@0.22.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.7_@tsdown+exe@0.22.7_@type_53c241a653f2227a5df8ba2949047afe/node_modules/tsdown/esm-shims.js
7
+ //#region ../../node_modules/.pnpm/tsdown@0.22.14_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.14_@tsdown+exe@0.22.14_@t_ce23af2d06b6e55ae551016827d08ee4/node_modules/tsdown/esm-shims.js
8
8
  const getFilename = () => fileURLToPath(import.meta.url);
9
9
  const getDirname = () => path.dirname(getFilename());
10
10
  const __dirname = /* @__PURE__ */ getDirname();
@@ -37,7 +37,7 @@ let node_module = require("node:module");
37
37
  let node_url = require("node:url");
38
38
  let vitest_config = require("vitest/config");
39
39
  //#region package.json
40
- var version = "0.2.5", VITE_PLUS_VERSION, VITEST_VERSION, CONFIG_METADATA_ENV;
40
+ var version = "0.2.7", VITE_PLUS_VERSION, VITEST_VERSION, CONFIG_METADATA_ENV;
41
41
  var init_constants = __esmMin((() => {
42
42
  VITE_PLUS_VERSION = process.env.VP_VERSION || version;
43
43
  VITEST_VERSION = "4.1.10";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_define_config = require("./define-config-DD3MUyPC.cjs");
2
+ const require_define_config = require("./define-config-DLh9fE95.cjs");
3
3
  require_define_config.init_define_config();
4
4
  exports.AUTO_INLINE_DEPS = require_define_config.AUTO_INLINE_DEPS;
5
5
  exports.assertCoverageProviderVersionMatch = require_define_config.assertCoverageProviderVersionMatch;
@@ -1,2 +1,2 @@
1
- import { a as defineConfig, c as lazyPlugins, i as computeAutoInlineList, l as resolveCoverageProviderToCheck, n as assertCoverageProviderVersionMatch, o as defineProject, r as checkCoverageProviderVersion, s as isVitestFamilySpecifier, t as AUTO_INLINE_DEPS, u as withConfigMetadataResolution } from "./define-config-BRT5X5UW.js";
1
+ import { a as defineConfig, c as lazyPlugins, i as computeAutoInlineList, l as resolveCoverageProviderToCheck, n as assertCoverageProviderVersionMatch, o as defineProject, r as checkCoverageProviderVersion, s as isVitestFamilySpecifier, t as AUTO_INLINE_DEPS, u as withConfigMetadataResolution } from "./define-config-C2KfLHpC.js";
2
2
  export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
@@ -1,8 +1,8 @@
1
- import { B as runCommandSilently, E as PackageManager, M as multiselect, P as select, R as isCancel, j as log, k as confirm, l as cancelAndExit, v as editYamlFile, w as getSpinner, y as readYamlFile } from "./tsconfig-D2NvUjn3.js";
1
+ import { B as runCommandSilently, E as PackageManager, M as multiselect, P as select, R as isCancel, j as log, k as confirm, l as cancelAndExit, v as editYamlFile, w as getSpinner, y as readYamlFile } from "./tsconfig-Jia2vgMG.js";
2
2
  import { a as writeJsonFile, c as parse, i as readJsonFile, n as editJsonFile, o as applyEdits, s as modify, t as detectFormattingOptions } from "./json-DiRs8ceZ.js";
3
3
  import { t as require_dist } from "./dist-CKz3vcoG.js";
4
- import { r as getScopeFromPackageName } from "./package-BILvlUYF.js";
5
- import { A as globSync, K as warnMigration, L as rewriteToolLintStagedConfigFiles, U as detectConfigs, V as PRETTIER_CONFIG_FILES, j as minimatch, q as displayRelative } from "./agent-CTwqJqX_.js";
4
+ import { r as getScopeFromPackageName } from "./package-Ds3uThLb.js";
5
+ import { A as globSync, K as warnMigration, L as rewriteToolLintStagedConfigFiles, U as detectConfigs, V as PRETTIER_CONFIG_FILES, j as minimatch, q as displayRelative } from "./agent-CPwWJ4qf.js";
6
6
  import path from "node:path";
7
7
  import { detectWorkspace, rewritePrettier } from "../binding/index.js";
8
8
  import fs from "node:fs";
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_define_config = require("./define-config-DD3MUyPC.cjs");
1
+ const require_define_config = require("./define-config-DLh9fE95.cjs");
2
2
  //#region src/index.cts
3
3
  const vite = require("@voidzero-dev/vite-plus-core");
4
4
  const { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } = require("vitest/config");
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-BRT5X5UW.js";
1
+ import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-C2KfLHpC.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-JhDwfMS8.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-D2NvUjn3.js";
2
+ import { d as isForceOverrideMode, l as VITE_PLUS_VERSION } from "../constants-BsuzPowC.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-Jia2vgMG.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-BILvlUYF.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-CTwqJqX_.js";
7
+ import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-Ds3uThLb.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-CPwWJ4qf.js";
9
9
  import { n as addMigrationWarning, r as createMigrationReport } from "../report-BS7ULx7A.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-H_E_5XOt.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-BbT1lTNc.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";
@@ -560,8 +560,8 @@ const helpMessage = renderCliDoc({
560
560
  "",
561
561
  " Command mapping:",
562
562
  " - `vp run <script>` is the equivalent of `pnpm run <script>`",
563
- " - `vp test` runs the built-in test command, while `vp run test` runs the",
564
- " `test` script from `package.json`",
563
+ " - `vp dev` and `vp test` always run the built-ins; `vp run dev` and",
564
+ " `vp run test` run the `dev` and `test` scripts from `package.json`",
565
565
  " - `vp install`, `vp add`, and `vp remove` delegate through the package",
566
566
  " manager declared by `packageManager`",
567
567
  " - `vp dev`, `vp build`, `vp preview`, `vp lint`, `vp fmt`, `vp check`,",
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1,4 +1,4 @@
1
- import { s as VITE_PLUS_NAME } from "./constants-JhDwfMS8.js";
1
+ import { s as VITE_PLUS_NAME } from "./constants-BsuzPowC.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-CnUfwCp9.js";
1
+ import { n as VITE_PLUS_OXLINT_PLUGIN_NAME, t as PREFER_VITE_PLUS_IMPORTS_RULE_NAME } from "./oxlint-plugin-config-Bxgc4cwF.js";
2
2
  import path from "node:path";
3
3
  import fs from "node:fs";
4
4
  import { definePlugin, defineRule } from "@oxlint/plugins";
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-BheiDkKa.js";
2
+ import { a as resolveViteConfig } from "./resolve-vite-config-BiuLZnn8.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
@@ -680,7 +680,7 @@ const DEFAULT_ENV_PREFIXES = ["VITE_PACK_", "TSDOWN_"];
680
680
  cli.command("[...files]", "Bundle files", {
681
681
  ignoreOptionDefaultValue: true,
682
682
  allowUnknownOptions: true
683
- }).option("--config-loader <loader>", "Config loader to use: auto, native, tsx, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--deps.never-bundle <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: DEFAULT_ENV_PREFIXES }).option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("--root <dir>", "Root directory of input files").option("--exe", "Bundle as executable").option("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
683
+ }).option("--config-loader <loader>", "Config loader to use: auto, native, tsx, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--deps.never-bundle <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: DEFAULT_ENV_PREFIXES }).option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("--root <dir>", "Root directory of input files").option("--exe", "Bundle as executable").option("-W, --workspace [dir]", "Enable workspace mode").option("--concurrency <count>", "Maximum number of Rolldown builds to run in parallel").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
684
684
  if (input.length > 0) flags.entry = input;
685
685
  if (flags.envPrefix === void 0) flags.envPrefix = DEFAULT_ENV_PREFIXES;
686
686
  async function runBuild() {
@@ -1,4 +1,4 @@
1
- import "./constants-JhDwfMS8.js";
1
+ import "./constants-BsuzPowC.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-BRT5X5UW.js";
1
+ import { u as withConfigMetadataResolution } from "./define-config-C2KfLHpC.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-BheiDkKa.js";
3
+ import { a as resolveViteConfig } from "../resolve-vite-config-BiuLZnn8.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";
@@ -1,5 +1,5 @@
1
1
  import { n as __require, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-C7HZzL1F.js";
2
- import { l as VITE_PLUS_VERSION, t as BASEURL_TSCONFIG_FIX_PACKAGE, u as createBaseUrlTsconfigFixArgs } from "./constants-JhDwfMS8.js";
2
+ import { l as VITE_PLUS_VERSION, t as BASEURL_TSCONFIG_FIX_PACKAGE, u as createBaseUrlTsconfigFixArgs } from "./constants-BsuzPowC.js";
3
3
  import { t as accent } from "./terminal-uTv0ZaMr.js";
4
4
  import { a as writeJsonFile, c as parse, i as readJsonFile, o as applyEdits, s as modify } from "./json-DiRs8ceZ.js";
5
5
  import { t as require_dist } from "./dist-CKz3vcoG.js";
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
- import { m as version } from "./constants-JhDwfMS8.js";
1
+ import { m as version } from "./constants-BsuzPowC.js";
2
2
  import { a as printHeader, r as log, t as accent } from "./terminal-uTv0ZaMr.js";
3
- import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-BILvlUYF.js";
3
+ import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-Ds3uThLb.js";
4
4
  import { t as renderCliDoc } from "./help-YP84FSEz.js";
5
5
  import path from "node:path";
6
6
  import fs from "node:fs";
package/dist/versions.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export const versions = {
2
- "vite": "8.1.4",
3
- "rolldown": "1.1.5",
4
- "tsdown": "0.22.7",
5
- "oxlint": "1.73.0",
6
- "oxfmt": "0.58.0",
7
- "oxlint-tsgolint": "0.24.0",
2
+ "vite": "8.1.5",
3
+ "rolldown": "1.2.0",
4
+ "tsdown": "0.22.14",
5
+ "oxlint": "1.75.0",
6
+ "oxfmt": "0.60.0",
7
+ "oxlint-tsgolint": "7.0.2001",
8
8
  "vitest": "4.1.10"
9
9
  };
@@ -7,7 +7,7 @@
7
7
  `vp build` runs the standard Vite production build through Vite+. Since it is directly based on Vite, the build pipeline and configuration model are the same as Vite. For more information about how Vite production builds work, see the [Vite guide](https://vite.dev/guide/build). Note that Vite+ uses Vite 8 and [Rolldown](https://rolldown.rs/) for builds.
8
8
 
9
9
  ::: info
10
- `vp build` always runs the built-in Vite production build. If your project also has a `build` script in `package.json`, run `vp run build` when you want to run that script instead.
10
+ `vp build` always runs the built-in Vite production build. If your project also has a `build` script in `package.json`, run `vp run build` when you want to run that script instead. See [Built-in Commands vs Scripts](/guide/run#built-in-commands-vs-scripts).
11
11
  :::
12
12
 
13
13
  ## Usage
package/docs/guide/ci.md CHANGED
@@ -4,12 +4,12 @@ You can use `voidzero-dev/setup-vp` to use Vite+ in CI environments.
4
4
 
5
5
  ## Overview
6
6
 
7
- For GitHub Actions, the recommended setup is [`voidzero-dev/setup-vp`](https://github.com/voidzero-dev/setup-vp). It installs Vite+, sets up the required Node.js version and package manager, and can cache package installs automatically.
8
-
9
- That means you usually do not need separate `setup-node`, package-manager setup, and manual dependency-cache steps in your workflow.
7
+ [`voidzero-dev/setup-vp`](https://github.com/voidzero-dev/setup-vp) provides integrations for GitHub Actions and GitLab CI/CD. Both install Vite+ and can install project dependencies. The GitHub Action can also set up Node.js and cache package manager data automatically, while the GitLab CI/CD template uses the Node.js runtime and cache configuration provided by the job.
10
8
 
11
9
  ## GitHub Actions
12
10
 
11
+ The GitHub Action sets up Vite+, the required Node.js version, and the package manager. This means you usually do not need separate `setup-node`, package-manager setup, or manual dependency caching steps in your workflow.
12
+
13
13
  ```yaml [.github/workflows/ci.yml]
14
14
  - uses: voidzero-dev/setup-vp@v1
15
15
  with:
@@ -27,6 +27,31 @@ With `cache: true`, `setup-vp` handles dependency caching for you automatically.
27
27
  `setup-vp` caches package-manager data. To reuse Vite Task results across CI runs, add a separate [GitHub Actions cache for Vite Task](/guide/github-actions-cache).
28
28
  :::
29
29
 
30
+ ## GitLab CI/CD
31
+
32
+ Use the reusable `setup-vp` remote template in your GitLab CI/CD configuration:
33
+
34
+ ```yaml [.gitlab-ci.yml]
35
+ include:
36
+ - remote: 'https://raw.githubusercontent.com/voidzero-dev/setup-vp/v1/gitlab/setup-vp.yml'
37
+
38
+ test:
39
+ extends: .setup-vp
40
+ image: node:24
41
+ script:
42
+ - vp check
43
+ - vp test
44
+ - vp build
45
+ ```
46
+
47
+ The GitLab CI/CD integration differs from the GitHub Action in a few ways:
48
+
49
+ - The template does not install Node.js. Use a Node.js image, as shown above, or otherwise provide Node.js in the job.
50
+ - Configure dependency caching with the job's GitLab [`cache`](https://docs.gitlab.com/ci/yaml/#cache) keyword.
51
+ - Use a Unix-like runner environment with Bash and either `curl` or `wget`.
52
+
53
+ For advanced configuration and the complete input reference, see the [`setup-vp` GitLab CI/CD documentation](https://github.com/voidzero-dev/setup-vp#gitlab-cicd).
54
+
30
55
  ## Simplifying Existing Workflows
31
56
 
32
57
  If you are migrating an existing GitHub Actions workflow, you can often replace large blocks of Node, package-manager, and cache setup with a single `setup-vp` step.
@@ -58,3 +58,52 @@ export default defineConfig({
58
58
  ```
59
59
 
60
60
  This is the default Vite+ approach and should replace separate `lint-staged` configuration in most projects. Because `vp staged` reads from `vite.config.ts`, your staged-file checks stay in the same place as your lint, format, test, build, and task-runner config.
61
+
62
+ ## Disabling Hooks in Specific Environments
63
+
64
+ The installed hooks check the environment on every run, so you can disable them per machine or per process without uninstalling anything. This is useful when commits happen outside development, for example through a flat file CMS or other processes.
65
+
66
+ ### Environment variable
67
+
68
+ Set `VITE_GIT_HOOKS=0` in the environment of the process that runs `git commit`, and every Vite+ hook exits immediately without running:
69
+
70
+ ```bash
71
+ VITE_GIT_HOOKS=0 git commit -m "content update"
72
+ ```
73
+
74
+ `HUSKY=0` is honored the same way for ecosystem tooling compatibility. Setting `VITE_GIT_HOOKS=0` in an environment also keeps `vp config` from reinstalling hooks there when a lifecycle script such as `prepare` runs.
75
+
76
+ ### Init script
77
+
78
+ Before checking the environment variable, each hook sources an init script if one exists:
79
+
80
+ 1. `$XDG_CONFIG_HOME/vite-plus/hooks-init.sh` (defaults to `~/.config/vite-plus/hooks-init.sh`)
81
+ 2. `$XDG_CONFIG_HOME/husky/init.sh` as a fallback
82
+
83
+ To disable hooks for a whole machine, create the init script and export the variable there:
84
+
85
+ ```sh [~/.config/vite-plus/hooks-init.sh]
86
+ export VITE_GIT_HOOKS=0
87
+ ```
88
+
89
+ Because the hook itself reads this file, it works even when the committing process does not inherit your shell environment, for example if a daemon or web server is making commits.
90
+
91
+ ## Removing commit hooks
92
+
93
+ To fully remove Vite+ commit hooks, undo each thing `vp config` set up:
94
+
95
+ 1. Unset the Git hooks path that points at the Vite+ dispatcher:
96
+
97
+ ```bash
98
+ git config --unset core.hooksPath
99
+ ```
100
+
101
+ 2. Remove the hooks directory (use your `--hooks-dir` value if you changed it):
102
+
103
+ ```bash
104
+ rm -rf .vite-hooks
105
+ ```
106
+
107
+ 3. Remove `vp config` from the `prepare` script in `package.json`. Otherwise the next install re-runs `vp config` and reinstalls the hooks.
108
+
109
+ 4. Remove the `staged` block from `vite.config.ts` if it exists
package/docs/guide/dev.md CHANGED
@@ -6,6 +6,10 @@
6
6
 
7
7
  `vp dev` runs the standard Vite development server through Vite+, so you keep the normal Vite dev experience while using the same CLI entry point as the rest of the toolchain. For more information about using and configuring the dev server, see the [Vite guide](https://vite.dev/guide/).
8
8
 
9
+ ::: info
10
+ `vp dev` always runs the built-in Vite dev server. If your project also has a `dev` script in `package.json`, run `vp run dev` when you want to run that script instead. See [Built-in Commands vs Scripts](/guide/run#built-in-commands-vs-scripts).
11
+ :::
12
+
9
13
  ## Usage
10
14
 
11
15
  ```bash
@@ -48,7 +48,7 @@ export default defineConfig({
48
48
  });
49
49
  ```
50
50
 
51
- This guide assumes each task already hits locally. If a task misses, fix its tracking config in `vite.config.ts` before adding the GitHub Actions cache steps. See [Automatic Data Tracking](/guide/automatic-data-tracking) and [`run.tasks`](/config/run#tasks).
51
+ This guide assumes each task already hits locally. If a task misses, fix its tracking config in `vite.config.ts` before adding the GitHub Actions cache steps. See [Automatic Data Tracking](/guide/automatic-data-tracking) and [`run.tasks`](/config/run#run-tasks).
52
52
 
53
53
  Run each task twice:
54
54
 
@@ -129,7 +129,7 @@ If GitHub restores a cache but Vite Task prints a cache miss, the workflow resto
129
129
 
130
130
  ## Keep Task Tracking Stable
131
131
 
132
- If GitHub restores a cache but `vp run` prints a cache miss, fix the task fingerprint before changing the Actions cache key. See [Automatic Data Tracking](/guide/automatic-data-tracking) and [`run.tasks`](/config/run#tasks).
132
+ If GitHub restores a cache but `vp run` prints a cache miss, fix the task fingerprint before changing the Actions cache key. See [Automatic Data Tracking](/guide/automatic-data-tracking) and [`run.tasks`](/config/run#run-tasks).
133
133
 
134
134
  ## Choose A Cache Key
135
135
 
@@ -81,7 +81,7 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie
81
81
 
82
82
  - **Purpose**: Node.js distribution mirror URL
83
83
  - **Default**: `https://nodejs.org/dist`
84
- - **Details**: [Custom Node.js Mirror](/guide/env#custom-nodejs-mirror)
84
+ - **Details**: [Custom Node.js Mirror](/guide/env#custom-node-js-mirror)
85
85
 
86
86
  ### `VP_NODE_VERSION`
87
87
 
@@ -98,7 +98,7 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie
98
98
  - **Purpose**: Skip PGP signature verification of Node.js downloads
99
99
  - **Values**: Any non-empty value
100
100
  - **Default**: None (verification enabled)
101
- - **Details**: [Node.js Signature Verification](/guide/env#nodejs-signature-verification)
101
+ - **Details**: [Node.js Signature Verification](/guide/env#node-js-signature-verification)
102
102
 
103
103
  ### `VP_SHELL`
104
104
 
@@ -86,7 +86,7 @@ After the migration:
86
86
  Command mapping to keep in mind:
87
87
 
88
88
  - `vp run <script>` is the equivalent of `pnpm run <script>`
89
- - `vp test` runs the built-in test command, while `vp run test` runs the `test` script from `package.json`
89
+ - `vp dev` and `vp test` always run the built-ins; `vp run dev` and `vp run test` run the `dev` and `test` scripts from `package.json`
90
90
  - `vp install`, `vp add`, and `vp remove` delegate through the package manager declared by `packageManager`
91
91
  - `vp dev`, `vp build`, `vp preview`, `vp lint`, `vp fmt`, `vp check`, and `vp pack` replace the corresponding standalone tools
92
92
  - Prefer `vp check` for validation loops
package/docs/guide/run.md CHANGED
@@ -38,6 +38,21 @@ Select a task (↑/↓, Enter to run, Esc to clear):
38
38
  test: jest
39
39
  ```
40
40
 
41
+ ## Built-in Commands vs Scripts
42
+
43
+ `vp dev` is a built-in command. `vp run dev` is your `dev` script. Built-in commands cannot be overwritten, so adding a `dev` script does not change what `vp dev` does:
44
+
45
+ | Command | What it runs |
46
+ | -------------------------- | ------------------------------------------------------------------------- |
47
+ | `vp dev` | The built-in Vite dev server |
48
+ | `vp run dev` / `vpr dev` | The `dev` script in `package.json`, or a `dev` task in `vite.config.ts` |
49
+ | `vp test` | The built-in Vitest command |
50
+ | `vp run test` / `vpr test` | The `test` script in `package.json`, or a `test` task in `vite.config.ts` |
51
+
52
+ `build`, `preview`, `lint`, `fmt`, `check`, and `pack` work the same way.
53
+
54
+ If the project defines that script or task, run it with `vp run <name>`. For example, with a `"dev": "astro dev"` script, `vp run dev` starts Astro, while `vp dev` ignores the script and starts Vite.
55
+
41
56
  ## Caching
42
57
 
43
58
  `package.json` scripts are not cached by default. Use `--cache` to enable caching:
@@ -6,6 +6,10 @@
6
6
 
7
7
  `vp test` is built on [Vitest](https://vitest.dev/), so you get a Vite-native test runner that reuses your Vite config and plugins, supports Jest-style expectations, snapshots, and coverage, and handles modern ESM, TypeScript, and JSX projects cleanly.
8
8
 
9
+ ::: info
10
+ `vp test` always runs the built-in Vitest command. If your project also has a `test` script in `package.json`, run `vp run test` when you want to run that script instead. See [Built-in Commands vs Scripts](/guide/run#built-in-commands-vs-scripts).
11
+ :::
12
+
9
13
  ## Usage
10
14
 
11
15
  ```bash
@@ -31,15 +31,18 @@ If VS Code has multiple folders open, the shared Oxc language server may pick a
31
31
 
32
32
  - Confirm the extension is using the intended workspace.
33
33
 
34
- ## `vp build` does not run my build script
34
+ ## `vp dev` or `vp build` does not run my script
35
35
 
36
- Unlike package managers, built-in commands cannot be overwritten. If you are trying to run a `package.json` script use `vp run build` instead.
36
+ Unlike package managers, built-in commands cannot be overwritten. If you are trying to run a `package.json` script use `vp run <script>` instead.
37
37
 
38
38
  For example:
39
39
 
40
+ - `vp dev` always starts the built-in Vite dev server
40
41
  - `vp build` always runs the built-in Vite build
41
42
  - `vp test` always runs the built-in Vitest command
42
- - `vp run build` and `vp run test` run `package.json` scripts instead
43
+ - `vp run dev`, `vp run build`, and `vp run test` run the matching `package.json` scripts instead
44
+
45
+ See [Built-in Commands vs Scripts](/guide/run#built-in-commands-vs-scripts) for when to prefer each path.
43
46
 
44
47
  ::: info
45
48
  You can also run custom tasks defined in `vite.config.ts` and migrate away from `package.json` scripts entirely.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plus",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "The Unified Toolchain for the Web",
5
5
  "homepage": "https://viteplus.dev/guide",
6
6
  "bugs": {
@@ -352,7 +352,7 @@
352
352
  }
353
353
  },
354
354
  "dependencies": {
355
- "@oxc-project/types": "=0.139.0",
355
+ "@oxc-project/types": "=0.141.0",
356
356
  "@oxlint/plugins": "=1.73.0",
357
357
  "@vitest/browser": "4.1.10",
358
358
  "@vitest/browser-preview": "4.1.10",
@@ -363,14 +363,14 @@
363
363
  "@vitest/snapshot": "4.1.10",
364
364
  "@vitest/spy": "4.1.10",
365
365
  "@vitest/utils": "4.1.10",
366
- "oxfmt": "=0.58.0",
367
- "oxlint": "=1.73.0",
368
- "oxlint-tsgolint": "=0.24.0",
366
+ "oxfmt": "=0.60.0",
367
+ "oxlint": "=1.75.0",
368
+ "oxlint-tsgolint": "=7.0.2001",
369
369
  "vitest": "4.1.10",
370
- "@voidzero-dev/vite-plus-core": "0.2.5"
370
+ "@voidzero-dev/vite-plus-core": "0.2.7"
371
371
  },
372
372
  "devDependencies": {
373
- "@napi-rs/cli": "^3.7.2",
373
+ "@napi-rs/cli": "^3.7.3",
374
374
  "@nkzw/safe-word-list": "^3.1.0",
375
375
  "@oxc-node/core": "^0.1.0",
376
376
  "@types/cross-spawn": "^6.0.6",
@@ -390,15 +390,15 @@
390
390
  "mri": "^1.2.0",
391
391
  "nanotar": "^0.3.0",
392
392
  "picocolors": "^1.1.1",
393
- "rolldown-plugin-dts": "^0.26.0",
393
+ "rolldown-plugin-dts": "^0.27.0",
394
394
  "semver": "^7.8.0",
395
- "tsdown": "^0.22.7",
395
+ "tsdown": "^0.22.14",
396
396
  "validate-npm-package-name": "^7.0.2",
397
397
  "yaml": "^2.8.1",
398
398
  "zod": "^3.25.76",
399
- "vite": "npm:@voidzero-dev/vite-plus-core@0.2.5",
399
+ "@voidzero-dev/vite-plus-prompts": "0.0.0",
400
400
  "@voidzero-dev/vite-plus-tools": "0.0.0",
401
- "@voidzero-dev/vite-plus-prompts": "0.0.0"
401
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.2.7"
402
402
  },
403
403
  "peerDependencies": {
404
404
  "@vitest/browser-playwright": "4.1.10",
@@ -430,14 +430,14 @@
430
430
  "node": "^20.19.0 || ^22.18.0 || >=24.11.0"
431
431
  },
432
432
  "optionalDependencies": {
433
- "@voidzero-dev/vite-plus-darwin-arm64": "0.2.5",
434
- "@voidzero-dev/vite-plus-darwin-x64": "0.2.5",
435
- "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.2.5",
436
- "@voidzero-dev/vite-plus-linux-arm64-musl": "0.2.5",
437
- "@voidzero-dev/vite-plus-linux-x64-gnu": "0.2.5",
438
- "@voidzero-dev/vite-plus-linux-x64-musl": "0.2.5",
439
- "@voidzero-dev/vite-plus-win32-x64-msvc": "0.2.5",
440
- "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.2.5"
433
+ "@voidzero-dev/vite-plus-darwin-arm64": "0.2.7",
434
+ "@voidzero-dev/vite-plus-darwin-x64": "0.2.7",
435
+ "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.2.7",
436
+ "@voidzero-dev/vite-plus-linux-arm64-musl": "0.2.7",
437
+ "@voidzero-dev/vite-plus-linux-x64-gnu": "0.2.7",
438
+ "@voidzero-dev/vite-plus-linux-x64-musl": "0.2.7",
439
+ "@voidzero-dev/vite-plus-win32-x64-msvc": "0.2.7",
440
+ "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.2.7"
441
441
  },
442
442
  "scripts": {
443
443
  "build": "oxnode -C dev ./build.ts",