vite-plus 1.4.0 → 1.5.1

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 (111) hide show
  1. package/binding/index.cjs +116 -55
  2. package/binding/index.d.cts +31 -0
  3. package/dist/{agent-D8oxxhVR.js → agent-CowvWq3j.js} +2 -2
  4. package/dist/bin.js +30 -8
  5. package/dist/config/bin.js +5 -5
  6. package/dist/{constants-DRUnJ_Dz.js → constants-D5f7inVN.js} +6 -2
  7. package/dist/create/bin.js +115 -65
  8. package/dist/{define-config-Cv2P6NT2.cjs → define-config-BGCfAiIo.cjs} +35 -3
  9. package/dist/{define-config-rPhYIFSn.d.ts → define-config-BrvHRi-G.d.ts} +30 -2
  10. package/dist/{define-config-ChwJcu5e.js → define-config-XKYhw0xH.js} +30 -5
  11. package/dist/define-config.cjs +2 -1
  12. package/dist/define-config.d.ts +2 -2
  13. package/dist/define-config.js +1 -1
  14. package/dist/{editor-ClL78D8u.js → editor-BVaNnIey.js} +1266 -884
  15. package/dist/hooks/bin.js +2 -2
  16. package/dist/{hooks-xRcJPc-O.js → hooks-w_e2whkQ.js} +40 -21
  17. package/dist/index.cjs +4 -3
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +2 -2
  20. package/dist/lint-plugins.cjs +1 -1
  21. package/dist/migration/bin.js +1302 -311
  22. package/dist/migration/compat/worker.js +1 -1
  23. package/dist/{oxlint-plugin-config-BVpqYdcC.js → oxlint-plugin-config-5hVqz4kj.js} +1 -1
  24. package/dist/oxlint-plugin.js +29 -4
  25. package/dist/pack-bin.js +2 -2
  26. package/dist/{package-DzsomcUD.js → package-DLUCo6L_.js} +1 -1
  27. package/dist/{prompts-GL1vj0wk.js → prompts-DLpJGhfK.js} +3 -3
  28. package/dist/register.d.ts +1 -0
  29. package/dist/register.js +12 -0
  30. package/dist/{report-DLHO30yZ.js → report-BEdpIQvC.js} +2 -0
  31. package/dist/{resolve-vite-config-Dn5896A4.js → resolve-vite-config-D-JtjGRa.js} +2 -2
  32. package/dist/{resolve-vite-config-QO6cC0SP.js → resolve-vite-config-D7IUZYKq.js} +1 -1
  33. package/dist/script-esm-hooks.d.ts +5 -2
  34. package/dist/script-esm-hooks.js +5 -2
  35. package/dist/script-preload.cjs +24 -1
  36. package/dist/script-register.js +7 -2
  37. package/dist/script-watch.js +135 -41
  38. package/dist/staged/bin.js +2 -2
  39. package/dist/sync-versions/bin.js +1 -1
  40. package/dist/toolchain.js +14 -14
  41. package/dist/toolchain.json +14 -14
  42. package/dist/{tsconfig-LE_mAwe_.js → tsconfig-D3DiCiW6.js} +2 -2
  43. package/dist/{tsconfig-Do6MAG_f.js → tsconfig-DLERIAbF.js} +1 -1
  44. package/dist/version.js +2 -2
  45. package/dist/versions.js +7 -7
  46. package/docs/config/check.md +2 -0
  47. package/docs/config/fmt.md +1 -1
  48. package/docs/config/lint.md +1 -1
  49. package/docs/config/run.md +6 -2
  50. package/docs/config/staged.md +1 -1
  51. package/docs/guide/check.md +5 -1
  52. package/docs/guide/ci.md +2 -2
  53. package/docs/guide/create.md +1 -1
  54. package/docs/guide/env.md +1 -1
  55. package/docs/guide/global-cli.md +13 -9
  56. package/docs/guide/homebrew.md +127 -0
  57. package/docs/guide/ide-integration.md +1 -3
  58. package/docs/guide/implode.md +5 -3
  59. package/docs/guide/index.md +4 -4
  60. package/docs/guide/local-cli.md +22 -1
  61. package/docs/guide/migrate-rules.md +81 -22
  62. package/docs/guide/migrate.md +9 -9
  63. package/docs/guide/package-management/add.md +84 -0
  64. package/docs/guide/package-management/approve-builds.md +48 -0
  65. package/docs/guide/package-management/audit.md +39 -0
  66. package/docs/guide/package-management/cache.md +53 -0
  67. package/docs/guide/package-management/ci.md +28 -0
  68. package/docs/guide/package-management/config.md +119 -0
  69. package/docs/guide/package-management/dedupe.md +32 -0
  70. package/docs/guide/package-management/deprecate.md +39 -0
  71. package/docs/guide/package-management/dist-tag.md +61 -0
  72. package/docs/guide/package-management/dlx.md +40 -0
  73. package/docs/guide/package-management/fund.md +32 -0
  74. package/docs/guide/package-management/global-packages.md +32 -0
  75. package/docs/guide/package-management/index.md +78 -0
  76. package/docs/guide/package-management/info.md +35 -0
  77. package/docs/guide/package-management/install.md +89 -0
  78. package/docs/guide/package-management/licenses.md +42 -0
  79. package/docs/guide/package-management/link.md +29 -0
  80. package/docs/guide/package-management/list.md +60 -0
  81. package/docs/guide/package-management/login.md +34 -0
  82. package/docs/guide/package-management/logout.md +34 -0
  83. package/docs/guide/package-management/outdated.md +60 -0
  84. package/docs/guide/package-management/owner.md +79 -0
  85. package/docs/guide/package-management/pack.md +40 -0
  86. package/docs/guide/package-management/package-manager-selection.md +60 -0
  87. package/docs/guide/package-management/patch-commit.md +27 -0
  88. package/docs/guide/package-management/patch.md +29 -0
  89. package/docs/guide/package-management/ping.md +32 -0
  90. package/docs/guide/package-management/pkg.md +88 -0
  91. package/docs/guide/package-management/prune.md +34 -0
  92. package/docs/guide/package-management/publish.md +61 -0
  93. package/docs/guide/package-management/rebuild.md +31 -0
  94. package/docs/guide/package-management/remove.md +47 -0
  95. package/docs/guide/package-management/search.md +38 -0
  96. package/docs/guide/package-management/stage.md +175 -0
  97. package/docs/guide/package-management/team.md +140 -0
  98. package/docs/guide/package-management/token.md +87 -0
  99. package/docs/guide/package-management/unlink.md +33 -0
  100. package/docs/guide/package-management/update.md +62 -0
  101. package/docs/guide/package-management/version.md +36 -0
  102. package/docs/guide/package-management/whoami.md +30 -0
  103. package/docs/guide/package-management/why.md +55 -0
  104. package/docs/guide/run.md +23 -1
  105. package/docs/guide/test.md +1 -1
  106. package/docs/guide/troubleshooting.md +1 -1
  107. package/docs/guide/upgrade.md +12 -6
  108. package/docs/guide/vitest-v5.md +2 -2
  109. package/docs/guide/vpx.md +45 -5
  110. package/package.json +40 -34
  111. package/docs/guide/package-management.md +0 -269
@@ -1,12 +1,12 @@
1
- import { c as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-DRUnJ_Dz.js";
1
+ import { c as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-D5f7inVN.js";
2
2
  import { t as VITEST_RESOLVER_PACKAGES } from "./vitest-ecosystem-BeEYz-qF.js";
3
3
  import { createRequire } from "node:module";
4
- import path, { join, resolve } from "node:path";
4
+ import path, { dirname, join, resolve } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { readFileSync } from "node:fs";
7
- import { searchForWorkspaceRoot } from "vite";
7
+ import { resolveConfig, searchForWorkspaceRoot } from "vite";
8
8
  import { defineConfig, defineProject } from "vitest/config";
9
- // ../../node_modules/.pnpm/tsdown@0.23.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.1_@tsdown+exe@0.23.1_@type_1cd5eff5b2f775ab43816d8441c9e500/node_modules/tsdown/esm-shims.js
9
+ // ../../node_modules/.pnpm/tsdown@0.23.4_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.4_@tsdown+exe@0.23.4_@type_9df9dd7c3062027a6d643d1d1e50c648/node_modules/tsdown/esm-shims.js
10
10
  const getFilename = () => fileURLToPath(import.meta.url);
11
11
  const getDirname = () => path.dirname(getFilename());
12
12
  const __dirname = /* @__PURE__ */ getDirname();
@@ -685,10 +685,35 @@ async function withConfigMetadataResolution(fn) {
685
685
  }
686
686
  }
687
687
  }
688
+ const resolveConfigWithInternalOptions = resolveConfig;
689
+ /**
690
+ * Resolve a Vite config file to read a non-plugin block (`lint`, `fmt`, `pack`, …) from it,
691
+ * for tools such as oxlint, oxfmt, and Vite+ itself.
692
+ *
693
+ * With an absolute `configFile`, default resolution of the initial `root` from the
694
+ * config file is independent of `process.cwd()`: an unset or relative `root`
695
+ * resolves from the config file's parent directory.
696
+ * Callers can supply `rootBase` to use a different project directory,
697
+ * such as when the config is in a subdirectory. Absolute roots are preserved.
698
+ * Plugin hooks can later change `root` using Vite's normal semantics. For example,
699
+ * a relative `root` returned by a `config` hook resolves from `process.cwd()`.
700
+ *
701
+ * Relative `configFile` and explicit `rootBase` paths still resolve from `process.cwd()`.
702
+ * The helper does not change the process cwd; config code and plugins can still read it.
703
+ * The resolver loads the config once, as a config-metadata resolution,
704
+ * so `lazyPlugins` skips its factory.
705
+ * Plugins outside `lazyPlugins` still run their hooks and side effects,
706
+ * e.g. TanStack Start's router generator scans `src/routes`.
707
+ */
708
+ async function resolveConfigFromFile(configFile, options = {}) {
709
+ if (configFile.length === 0) throw new Error("Config file path must not be empty.");
710
+ const rootBase = resolve(options.rootBase ?? dirname(resolve(configFile)));
711
+ return withConfigMetadataResolution(() => resolveConfigWithInternalOptions({ configFile }, "build", void 0, void 0, void 0, void 0, void 0, { rootBase }));
712
+ }
688
713
  function lazyPlugins(cb) {
689
714
  if (process.env["VP_RESOLVING_CONFIG_METADATA"] === "1") return;
690
715
  const result = cb();
691
716
  if (result instanceof Promise) return [result];
692
717
  return result;
693
718
  }
694
- export { defineConfig$1 as a, lazyPlugins as c, computeAutoInlineList as i, resolveCoverageProviderToCheck as l, assertCoverageProviderVersionMatch as n, defineProject$1 as o, checkCoverageProviderVersion as r, isVitestFamilySpecifier as s, AUTO_INLINE_DEPS as t, withConfigMetadataResolution as u };
719
+ export { defineConfig$1 as a, lazyPlugins as c, withConfigMetadataResolution as d, computeAutoInlineList as i, resolveConfigFromFile as l, assertCoverageProviderVersionMatch as n, defineProject$1 as o, checkCoverageProviderVersion as r, isVitestFamilySpecifier as s, AUTO_INLINE_DEPS as t, resolveCoverageProviderToCheck as u };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_define_config = require("./define-config-Cv2P6NT2.cjs");
2
+ const require_define_config = require("./define-config-BGCfAiIo.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;
@@ -9,5 +9,6 @@ exports.defineConfig = require_define_config.defineConfig;
9
9
  exports.defineProject = require_define_config.defineProject;
10
10
  exports.isVitestFamilySpecifier = require_define_config.isVitestFamilySpecifier;
11
11
  exports.lazyPlugins = require_define_config.lazyPlugins;
12
+ exports.resolveConfigFromFile = require_define_config.resolveConfigFromFile;
12
13
  exports.resolveCoverageProviderToCheck = require_define_config.resolveCoverageProviderToCheck;
13
14
  exports.withConfigMetadataResolution = require_define_config.withConfigMetadataResolution;
@@ -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-rPhYIFSn.js";
2
- export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
1
+ import { a as computeAutoInlineList, c as isVitestFamilySpecifier, d as resolveCoverageProviderToCheck, f as withConfigMetadataResolution, i as checkCoverageProviderVersion, l as lazyPlugins, n as ResolveConfigFromFileOptions, o as defineConfig, r as assertCoverageProviderVersionMatch, s as defineProject, t as AUTO_INLINE_DEPS, u as resolveConfigFromFile } from "./define-config-BrvHRi-G.js";
2
+ export { AUTO_INLINE_DEPS, ResolveConfigFromFileOptions, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveConfigFromFile, resolveCoverageProviderToCheck, withConfigMetadataResolution };
@@ -1 +1 @@
1
- export { t as AUTO_INLINE_DEPS, n as assertCoverageProviderVersionMatch, r as checkCoverageProviderVersion, i as computeAutoInlineList, a as defineConfig, o as defineProject, s as isVitestFamilySpecifier, c as lazyPlugins, l as resolveCoverageProviderToCheck, u as withConfigMetadataResolution } from "./define-config-ChwJcu5e.js";
1
+ export { t as AUTO_INLINE_DEPS, n as assertCoverageProviderVersionMatch, r as checkCoverageProviderVersion, i as computeAutoInlineList, a as defineConfig, o as defineProject, s as isVitestFamilySpecifier, c as lazyPlugins, l as resolveConfigFromFile, u as resolveCoverageProviderToCheck, d as withConfigMetadataResolution } from "./define-config-XKYhw0xH.js";