vite-plus 0.2.1 → 0.2.2

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 (68) hide show
  1. package/bin/oxfmt +6 -3
  2. package/bin/oxlint +6 -3
  3. package/bin/vpr +9 -0
  4. package/binding/index.cjs +53 -53
  5. package/binding/index.d.cts +86 -144
  6. package/dist/agent-D7O7mSeO.js +9456 -0
  7. package/dist/bin.js +10 -7
  8. package/dist/{cli-truncate-CWsmbK3p.js → cli-truncate-BVOlIIPy.js} +1 -1
  9. package/dist/config/bin.js +2 -2
  10. package/dist/{constants-CrfJQIUX.js → constants-NeTOxrzV.js} +7 -3
  11. package/dist/create/bin.js +22 -60
  12. package/dist/{define-config-2tfJoXr1.d.ts → define-config-BuMs_LKa.d.ts} +64 -9
  13. package/dist/{define-config-DJUehepE.js → define-config-CSgy0zML.js} +43 -18
  14. package/dist/{define-config-BGSjF6Xp.cjs → define-config-CrA3lZhQ.cjs} +61 -22
  15. package/dist/define-config.cjs +2 -1
  16. package/dist/define-config.d.ts +2 -2
  17. package/dist/define-config.js +2 -2
  18. package/dist/{dist-Oxo16Y0q.js → dist-CKz3vcoG.js} +4 -4
  19. package/dist/dist-CtM2JRbM.js +3 -0
  20. package/dist/editor-CPzssglc.js +584 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/{json-Dn87fvjk.js → json-DiRs8ceZ.js} +13 -1
  25. package/dist/{log-update-lyIiuflf.js → log-update-DHZRyJ2m.js} +2 -2
  26. package/dist/migration/bin.d.ts +1 -10
  27. package/dist/migration/bin.js +531 -170
  28. package/dist/migration/compat/worker.d.ts +1 -0
  29. package/dist/migration/compat/worker.js +35 -0
  30. package/dist/{oxlint-plugin-config-q8a5PFch.js → oxlint-plugin-config-C2Rqc_WQ.js} +1 -1
  31. package/dist/oxlint-plugin.js +78 -9
  32. package/dist/pack-bin.js +1 -1
  33. package/dist/{package-BHirM1_v.js → package-CU2g7URl.js} +52 -3
  34. package/dist/protocol-D99W10Qi.js +4 -0
  35. package/dist/{report-BHSkWqRR.js → report-BS7ULx7A.js} +2 -0
  36. package/dist/{resolve-vite-config-CmdsfQzS.js → resolve-vite-config-r91rIaPs.js} +14 -10
  37. package/dist/{rolldown-runtime-DnnnRqeS.js → rolldown-runtime-C7HZzL1F.js} +1 -1
  38. package/dist/staged/bin.js +23 -19
  39. package/dist/{tsconfig-BWQPmGKz.js → tsconfig-fvpxgUq2.js} +395 -200
  40. package/dist/version.js +2 -5
  41. package/dist/versions.js +5 -5
  42. package/dist/{wrap-ansi-k7Dn4VtV.js → wrap-ansi-DNjkuBEp.js} +1 -1
  43. package/dist/wrap-ansi-DUi52C6W.js +2 -0
  44. package/docs/_data/team.ts +9 -0
  45. package/docs/config/check.md +35 -0
  46. package/docs/config/index.md +2 -0
  47. package/docs/config/run.md +61 -12
  48. package/docs/guide/automatic-data-tracking.md +145 -0
  49. package/docs/guide/cache.md +14 -35
  50. package/docs/guide/check.md +16 -0
  51. package/docs/guide/ci.md +4 -0
  52. package/docs/guide/docker.md +175 -0
  53. package/docs/guide/env.md +12 -0
  54. package/docs/guide/github-actions-cache.md +165 -0
  55. package/docs/guide/install.md +12 -2
  56. package/docs/guide/migrate-rules.md +347 -0
  57. package/docs/guide/migrate.md +14 -0
  58. package/docs/guide/pack.md +8 -0
  59. package/docs/guide/run.md +33 -3
  60. package/docs/guide/troubleshooting.md +1 -1
  61. package/docs/guide/upgrade.md +43 -21
  62. package/docs/package.json +1 -1
  63. package/package.json +20 -19
  64. package/dist/agent--cKmgD_n.js +0 -3341
  65. package/dist/compat-Cql3K40m.js +0 -14
  66. package/dist/dist-DRJUd9bL.js +0 -3
  67. package/dist/workspace-D0AVy4fu.js +0 -5830
  68. package/dist/wrap-ansi-CeQuiQ31.js +0 -2
package/dist/bin.js CHANGED
@@ -1,9 +1,9 @@
1
- import { d as resolve$1, f as resolveBundled, n as BASEURL_TSCONFIG_WARNING, o as VITE_PLUS_NAME, r as DEFAULT_ENVS } from "./constants-CrfJQIUX.js";
2
- import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-q8a5PFch.js";
3
- import { I as runCommandSilently, i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-BWQPmGKz.js";
1
+ import { f as resolve$1, i as DEFAULT_ENVS, n as BASEURL_TSCONFIG_WARNING, p as resolveBundled, r as CONFIG_METADATA_ENV, s as VITE_PLUS_NAME } from "./constants-NeTOxrzV.js";
2
+ import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-C2Rqc_WQ.js";
3
+ import { B as runCommandSilently, i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-fvpxgUq2.js";
4
4
  import { n as errorMsg, r as log, s as warnMsg, t as accent } from "./terminal-uTv0ZaMr.js";
5
5
  import { t as resolveTsgolintExecutable } from "./tsgolint-path-B-yOos8p.js";
6
- import { i as resolveUniversalViteConfig } from "./resolve-vite-config-CmdsfQzS.js";
6
+ import { i as resolveUniversalViteConfig } from "./resolve-vite-config-r91rIaPs.js";
7
7
  import path, { dirname, join } from "node:path";
8
8
  import { hasConfigKey, mergeJsonConfig, run } from "../binding/index.js";
9
9
  import fs, { readFileSync } from "node:fs";
@@ -34,7 +34,10 @@ import { fileURLToPath } from "node:url";
34
34
  async function fmt() {
35
35
  return {
36
36
  binPath: join(dirname(dirname(resolve$1("oxfmt"))), "bin", "oxfmt"),
37
- envs: { ...DEFAULT_ENVS }
37
+ envs: {
38
+ ...DEFAULT_ENVS,
39
+ [CONFIG_METADATA_ENV]: "1"
40
+ }
38
41
  };
39
42
  }
40
43
  //#endregion
@@ -269,7 +272,8 @@ async function lint() {
269
272
  binPath,
270
273
  envs: {
271
274
  ...DEFAULT_ENVS,
272
- OXLINT_TSGOLINT_PATH: oxlintTsgolintPath
275
+ OXLINT_TSGOLINT_PATH: oxlintTsgolintPath,
276
+ [CONFIG_METADATA_ENV]: "1"
273
277
  }
274
278
  };
275
279
  }
@@ -401,7 +405,6 @@ if (args[0] === "help" && args[1]) {
401
405
  process.argv = process.argv.slice(0, 2).concat(args);
402
406
  }
403
407
  const command = args[0];
404
- process.env.VP_COMMAND = command ?? "";
405
408
  if (command === "create") await import("./create/bin.js");
406
409
  else if (command === "migrate") await import("./migration/bin.js");
407
410
  else if (command === "config") await import("./config/bin.js");
@@ -9,7 +9,7 @@ const C1_ST_CODE_POINT = 156;
9
9
  const C1_OSC_CODE_POINT = 157;
10
10
  const C1_PM_CODE_POINT = 158;
11
11
  const C1_APC_CODE_POINT = 159;
12
- const ESCAPES = new Set([
12
+ const ESCAPES = /* @__PURE__ */ new Set([
13
13
  ESCAPE_CODE_POINT,
14
14
  C1_DCS_CODE_POINT,
15
15
  C1_SOS_CODE_POINT,
@@ -1,7 +1,7 @@
1
- import { d as promptGitHooks, l as defaultInteractive } from "../tsconfig-BWQPmGKz.js";
1
+ import { f as promptGitHooks, u as defaultInteractive } from "../tsconfig-fvpxgUq2.js";
2
2
  import { a as printHeader, r as log } from "../terminal-uTv0ZaMr.js";
3
3
  import { t as lib_default } from "../lib-L3DWSRQp.js";
4
- import { E as hasStagedConfigInViteConfig, S as ensurePreCommitHook, o as updateExistingAgentInstructions } from "../agent--cKmgD_n.js";
4
+ import { o as updateExistingAgentInstructions, v as ensurePreCommitHook, x as hasStagedConfigInViteConfig } from "../agent-D7O7mSeO.js";
5
5
  import { t as renderCliDoc } from "../help-YP84FSEz.js";
6
6
  import { join } from "node:path";
7
7
  import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
@@ -1,10 +1,13 @@
1
1
  import { createRequire } from "node:module";
2
+ //#region package.json
3
+ var version = "0.2.2";
4
+ //#endregion
2
5
  //#region src/utils/constants.ts
3
6
  const VITE_PLUS_NAME = "vite-plus";
4
- const VITE_PLUS_VERSION = process.env.VP_VERSION || "latest";
7
+ const VITE_PLUS_VERSION = process.env.VP_VERSION || version;
5
8
  const VITEST_VERSION = "4.1.9";
6
9
  const VITE_PLUS_OVERRIDE_PACKAGES = process.env.VP_OVERRIDE_PACKAGES ? JSON.parse(process.env.VP_OVERRIDE_PACKAGES) : {
7
- vite: "npm:@voidzero-dev/vite-plus-core@latest",
10
+ vite: `npm:@voidzero-dev/vite-plus-core@${VITE_PLUS_VERSION}`,
8
11
  vitest: VITEST_VERSION
9
12
  };
10
13
  /**
@@ -62,5 +65,6 @@ const DEFAULT_ENVS = {
62
65
  JS_RUNTIME_NAME: process.release.name,
63
66
  NODE_PACKAGE_MANAGER: "vite-plus"
64
67
  };
68
+ const CONFIG_METADATA_ENV = "VP_RESOLVING_CONFIG_METADATA";
65
69
  //#endregion
66
- export { VITEST_VERSION as a, VITE_PLUS_VERSION as c, resolve as d, resolveBundled as f, VITEST_AGE_GATE_EXEMPT_PACKAGES as i, createBaseUrlTsconfigFixArgs as l, BASEURL_TSCONFIG_WARNING as n, VITE_PLUS_NAME as o, DEFAULT_ENVS as r, VITE_PLUS_OVERRIDE_PACKAGES as s, BASEURL_TSCONFIG_FIX_PACKAGE as t, isForceOverrideMode as u };
70
+ export { VITEST_AGE_GATE_EXEMPT_PACKAGES as a, VITE_PLUS_OVERRIDE_PACKAGES as c, isForceOverrideMode as d, resolve as f, DEFAULT_ENVS as i, VITE_PLUS_VERSION as l, version as m, BASEURL_TSCONFIG_WARNING as n, VITEST_VERSION as o, resolveBundled as p, CONFIG_METADATA_ENV as r, VITE_PLUS_NAME as s, BASEURL_TSCONFIG_FIX_PACKAGE as t, createBaseUrlTsconfigFixArgs as u };
@@ -1,13 +1,13 @@
1
- import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-DnnnRqeS.js";
2
- import { o as VITE_PLUS_NAME } from "../constants-CrfJQIUX.js";
3
- import { A as select, D as log, E as intro, F as runCommand$1, I as runCommandSilently, L as require_cross_spawn, M as text, N as require_picocolors, O as multiselect, P as R, S as PackageManager, T as confirm, _ as approveBuilds, d as promptGitHooks, f as resolveGitInit, h as selectPackageManager, j as spinner, l as defaultInteractive, m as runViteInstall, p as runViteFmt, u as downloadPackageManager$1, v as detectGatedBuilds, w as cancel, x as DependencyType, y as resolveApproveBuildTargets } from "../tsconfig-BWQPmGKz.js";
1
+ import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-C7HZzL1F.js";
2
+ import { s as VITE_PLUS_NAME } from "../constants-NeTOxrzV.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, x as approveBuilds, z as runCommand$1 } from "../tsconfig-fvpxgUq2.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
- import { r as readJsonFile, t as editJsonFile } from "../json-Dn87fvjk.js";
6
- import { a as resolveViteConfig, n as findWorkspaceRoot, r as hasViteConfig, t as findViteConfig } from "../resolve-vite-config-CmdsfQzS.js";
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-r91rIaPs.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-BHirM1_v.js";
9
- import { B as setPackageManager, D as injectCreateDefaultTemplate, F as promptEslintMigration, I as promptPrettierMigration, J as templatesDir, L as rewriteMonorepo, R as rewriteMonorepoProject, T as hasFrameworkShim, a as selectAgentTargets, b as detectPrettierProject, c as writeCopilotSetupWorkflow, h as detectFramework, k as installGitHooks, l as addFrameworkShim, m as detectEslintProject, q as displayRelative, r as detectExistingAgentTargetPaths, s as writeAgentInstructions, t as COPILOT_AGENT_ID, z as rewriteStandaloneProject } from "../agent--cKmgD_n.js";
10
- import { c as selectEditors, i as updateWorkspaceConfig, l as writeEditorConfigs, n as isBingoTemplate, o as detectExistingEditors, r as updatePackageJsonWithDeps, t as detectWorkspace$1 } from "../workspace-D0AVy4fu.js";
8
+ import { o as fetchNpmResource, s as getNpmRegistry, t as checkNpmPackageExists } from "../package-CU2g7URl.js";
9
+ import { A as detectWorkspace$1, F as detectEslintProject, M as updatePackageJsonWithDeps, N as updateWorkspaceConfig, R as promptEslintMigration, S as injectCreateDefaultTemplate, X as templatesDir, Y as displayRelative, a as selectAgentTargets, c as writeCopilotSetupWorkflow, d as rewriteStandaloneProject, g as setPackageManager, j as isBingoTemplate, l as rewriteMonorepo, r as detectExistingAgentTargetPaths, s as writeAgentInstructions, t as COPILOT_AGENT_ID, u as rewriteMonorepoProject, y as installGitHooks } from "../agent-D7O7mSeO.js";
10
+ import { a as writeEditorConfigs, c as hasFrameworkShim, f as promptPrettierMigration, i as selectEditors, n as detectExistingEditors, o as addFrameworkShim, s as detectFramework, u as detectPrettierProject } from "../editor-CPzssglc.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";
@@ -27,28 +27,6 @@ async function initGitRepository(cwd) {
27
27
  envs: process.env
28
28
  })).exitCode === 0;
29
29
  }
30
- async function createInitialCommit(cwd) {
31
- await runCommandSilently({
32
- command: "git",
33
- args: ["add", "-A"],
34
- cwd,
35
- envs: process.env
36
- });
37
- const result = await runCommandSilently({
38
- command: "git",
39
- args: [
40
- "commit",
41
- "-m",
42
- "Initial commit from Vite+"
43
- ],
44
- cwd,
45
- envs: process.env
46
- });
47
- return {
48
- success: result.exitCode === 0,
49
- output: `${result.stdout.toString()}${result.stderr.toString()}`.trim()
50
- };
51
- }
52
30
  //#endregion
53
31
  //#region src/create/command.ts
54
32
  async function runCommandAndDetectProjectDir(options, parentDir) {
@@ -572,7 +550,7 @@ async function pickOrgTemplate(manifest, opts) {
572
550
  message: `Pick a template from ${manifest.scope}`,
573
551
  options
574
552
  });
575
- if (R(picked)) return ORG_PICKER_CANCEL;
553
+ if (isCancel(picked)) return ORG_PICKER_CANCEL;
576
554
  const found = lookup.get(picked);
577
555
  if (found === ESCAPE_HATCH) return ORG_PICKER_BUILTIN_ESCAPE;
578
556
  if (!found) throw new Error(`org-picker: prompts.select returned an unregistered value: ${picked}`);
@@ -861,7 +839,7 @@ async function extractTarballTo(bytes, destDir) {
861
839
  continue;
862
840
  }
863
841
  await fs.promises.mkdir(path.dirname(targetPath), { recursive: true });
864
- const data = entry.data ?? new Uint8Array(0);
842
+ const data = entry.data ?? /* @__PURE__ */ new Uint8Array(0);
865
843
  await fs.promises.writeFile(targetPath, data);
866
844
  const mode = parseEntryMode(entry.attrs?.mode);
867
845
  if (mode !== void 0) await fs.promises.chmod(targetPath, mode);
@@ -4019,7 +3997,7 @@ async function promptPackageNameAndTargetDir(defaultPackageName, interactive) {
4019
3997
  return result?.errors?.[0] ?? result?.warnings?.[0] ?? "Invalid package name";
4020
3998
  }
4021
3999
  });
4022
- if (R(selected)) cancelAndExit();
4000
+ if (isCancel(selected)) cancelAndExit();
4023
4001
  packageName = selected;
4024
4002
  targetDir = getProjectDirFromPackageName(packageName);
4025
4003
  } else {
@@ -4041,7 +4019,7 @@ async function promptTargetDir(defaultTargetDir, interactive, options) {
4041
4019
  defaultValue: defaultTargetDir,
4042
4020
  validate: (value) => validateTargetDir(value ?? defaultTargetDir, options?.cwd).error
4043
4021
  });
4044
- if (R(selected)) cancelAndExit();
4022
+ if (isCancel(selected)) cancelAndExit();
4045
4023
  targetDir = validateTargetDir(selected ?? defaultTargetDir, options?.cwd).directory;
4046
4024
  } else {
4047
4025
  targetDir = validateTargetDir(defaultTargetDir, options?.cwd).directory;
@@ -4074,7 +4052,7 @@ async function checkProjectDirExists(projectDirFullPath, interactive) {
4074
4052
  value: "yes"
4075
4053
  }]
4076
4054
  });
4077
- if (R(overwrite)) cancelAndExit();
4055
+ if (isCancel(overwrite)) cancelAndExit();
4078
4056
  switch (overwrite) {
4079
4057
  case "yes":
4080
4058
  emptyDir(projectDirFullPath);
@@ -4352,7 +4330,7 @@ async function executeGeneratorScaffold(workspaceInfo, templateInfo, options) {
4352
4330
  placeholder: defaultDescription,
4353
4331
  defaultValue: defaultDescription
4354
4332
  });
4355
- if (!R(descPrompt)) description = descPrompt;
4333
+ if (!isCancel(descPrompt)) description = descPrompt;
4356
4334
  }
4357
4335
  const fullPath = path.join(workspaceInfo.rootDir, templateInfo.targetDir);
4358
4336
  copyDir(path.join(templatesDir, "generator"), fullPath);
@@ -4665,7 +4643,7 @@ const helpMessage = renderCliDoc({
4665
4643
  },
4666
4644
  {
4667
4645
  label: "--git",
4668
- description: "Initialize a git repository with an initial commit"
4646
+ description: "Initialize a git repository"
4669
4647
  },
4670
4648
  {
4671
4649
  label: "--no-git",
@@ -5025,7 +5003,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
5025
5003
  message: "",
5026
5004
  options: getInitialTemplateOptions(isMonorepo, localTemplates)
5027
5005
  });
5028
- if (R(template)) cancelAndExit();
5006
+ if (isCancel(template)) cancelAndExit();
5029
5007
  selectedTemplateName = template;
5030
5008
  }
5031
5009
  const matchedLocalTemplate = resolvedByOrg ? void 0 : localTemplates.find((entry) => entry.name === selectedTemplateName);
@@ -5073,7 +5051,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
5073
5051
  options: dirOptions,
5074
5052
  initialValue: shouldOfferCwdOption ? cwdRelativeToRoot : inferParentDir(selectedTemplateName, workspaceInfoOptional, isLocalTemplate) ?? workspaceInfoOptional.parentDirs[0]
5075
5053
  });
5076
- if (R(selected)) cancelAndExit();
5054
+ if (isCancel(selected)) cancelAndExit();
5077
5055
  if (selected !== "other") parentDir = selected;
5078
5056
  }
5079
5057
  if (!parentDir) {
@@ -5084,7 +5062,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
5084
5062
  return value ? formatTargetDir(value).error : "Target directory is required";
5085
5063
  }
5086
5064
  });
5087
- if (R(customTargetDir)) cancelAndExit();
5065
+ if (isCancel(customTargetDir)) cancelAndExit();
5088
5066
  parentDir = customTargetDir;
5089
5067
  }
5090
5068
  selectedParentDir = parentDir;
@@ -5199,7 +5177,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
5199
5177
  let migratePendingBuilds = [];
5200
5178
  const handleIgnoredBuilds = async (projectPath, installCwd, summary) => {
5201
5179
  if (summary?.status !== "installed") return;
5202
- const reportedBuilds = [...new Set([...summary.pendingBuilds ?? [], ...migratePendingBuilds])];
5180
+ const reportedBuilds = [.../* @__PURE__ */ new Set([...summary.pendingBuilds ?? [], ...migratePendingBuilds])];
5203
5181
  const targets = resolveApproveBuildTargets(projectPath, await detectGatedBuilds(installCwd, workspaceInfo.packageManager, reportedBuilds), workspaceInfo.packageManager);
5204
5182
  if (targets.length === 0) return;
5205
5183
  pauseCreateProgress();
@@ -5235,7 +5213,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
5235
5213
  initialValue: true
5236
5214
  });
5237
5215
  resumeCreateProgress();
5238
- if (R(selected)) {
5216
+ if (isCancel(selected)) {
5239
5217
  log.info("Operation cancelled. Skipping git initialization");
5240
5218
  shouldInitGit = false;
5241
5219
  } else shouldInitGit = selected;
@@ -5313,14 +5291,6 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
5313
5291
  await handleIgnoredBuilds(fullPath, fullPath, installSummary);
5314
5292
  updateCreateProgress("Formatting code");
5315
5293
  await runViteFmt(fullPath, options.interactive, void 0, { silent: compactOutput });
5316
- if (shouldSetupGit) {
5317
- updateCreateProgress("Creating initial commit");
5318
- const commitResult = await createInitialCommit(fullPath);
5319
- if (!commitResult.success) {
5320
- log.warn("Initial commit failed");
5321
- if (commitResult.output) log.info(commitResult.output);
5322
- }
5323
- }
5324
5294
  clearCreateProgress();
5325
5295
  showCreateSummary({
5326
5296
  description: describeScaffold(selectedTemplateName, selectedTemplateArgs),
@@ -5459,7 +5429,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
5459
5429
  required: false
5460
5430
  });
5461
5431
  let selectedDepTypes = [];
5462
- if (!R(selectedDepTypeOptions)) selectedDepTypes = selectedDepTypeOptions;
5432
+ if (!isCancel(selectedDepTypeOptions)) selectedDepTypes = selectedDepTypeOptions;
5463
5433
  for (const selectedDepType of selectedDepTypes) {
5464
5434
  const selected = await multiselect({
5465
5435
  message: `Which packages should be added as ${selectedDepType} to ${success(projectDir)}?`,
@@ -5470,7 +5440,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
5470
5440
  required: false
5471
5441
  });
5472
5442
  let selectedDeps = [];
5473
- if (!R(selected)) selectedDeps = selected;
5443
+ if (!isCancel(selected)) selectedDeps = selected;
5474
5444
  if (selectedDeps.length > 0) updatePackageJsonWithDeps(workspaceInfo.rootDir, projectDir, selectedDeps, selectedDepType);
5475
5445
  }
5476
5446
  resumeCreateProgress();
@@ -5512,14 +5482,6 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
5512
5482
  await handleIgnoredBuilds(fullPath, fullPath, installSummary);
5513
5483
  updateCreateProgress("Formatting code");
5514
5484
  await runViteFmt(fullPath, options.interactive, void 0, { silent: compactOutput });
5515
- if (shouldSetupGit) {
5516
- updateCreateProgress("Creating initial commit");
5517
- const commitResult = await createInitialCommit(fullPath);
5518
- if (!commitResult.success) {
5519
- log.warn("Initial commit failed");
5520
- if (commitResult.output) log.info(commitResult.output);
5521
- }
5522
- }
5523
5485
  }
5524
5486
  clearCreateProgress();
5525
5487
  showCreateSummary({
@@ -17,13 +17,16 @@ interface CreateTemplateEntry {
17
17
  }
18
18
  //#endregion
19
19
  //#region src/run-config.d.ts
20
- type AutoInput = {
20
+ type AutoTracking = {
21
21
  /**
22
- * Automatically track which files the task reads
22
+ * Enable automatic file tracking for this input or output list.
23
23
  */
24
24
  auto: boolean;
25
25
  };
26
26
  type Command = string | Array<string>;
27
+ type DependencyType = "dependencies" | "devDependencies" | "peerDependencies";
28
+ type DependsOnEntry = string | UserPackageDependency;
29
+ type DependsOnFrom = DependencyType | Array<DependencyType>;
27
30
  type GlobWithBase = {
28
31
  /**
29
32
  * The glob pattern (positive or negative starting with `!`)
@@ -45,9 +48,16 @@ type Task = {
45
48
  */
46
49
  cwd?: string;
47
50
  /**
48
- * Dependencies of this task. Use `package-name#task-name` to refer to tasks in other packages.
51
+ * Tasks that must run before this task.
52
+ *
53
+ * - A string runs one named task, such as `"build"` in the same package or
54
+ * `"package-name#build"` in another package.
55
+ * - An object runs a task in direct workspace dependency packages selected
56
+ * from package.json fields. For example,
57
+ * `{ "task": "build", "from": "dependencies" }` runs `build` in each
58
+ * direct workspace dependency that defines a `build` task.
49
59
  */
50
- dependsOn?: Array<string>;
60
+ dependsOn?: Array<DependsOnEntry>;
51
61
  } & ({
52
62
  /**
53
63
  * Whether to cache the task
@@ -71,16 +81,18 @@ type Task = {
71
81
  * - `{auto: true}` enables automatic file tracking
72
82
  * - Negative patterns (e.g. `"!dist/**"`) exclude matched files
73
83
  */
74
- input?: Array<string | GlobWithBase | AutoInput>;
84
+ input?: Array<string | GlobWithBase | AutoTracking>;
75
85
  /**
76
- * Output files to archive after a successful run and restore on cache hit.
86
+ * Output files to archive and restore on cache hit.
77
87
  *
78
- * - Omitted or `[]` (empty): no output archiving (default)
88
+ * - Omitted: automatically tracks which files the task writes
89
+ * - `[]` (empty): disables output restoration entirely
79
90
  * - Glob patterns (e.g. `"dist/**"`) select specific output files, relative to the package directory
80
91
  * - `{pattern: "...", base: "workspace" | "package"}` specifies a glob with an explicit base directory
92
+ * - `{auto: true}` enables automatic output tracking
81
93
  * - Negative patterns (e.g. `"!dist/cache/**"`) exclude matched files
82
94
  */
83
- output?: Array<string | GlobWithBase>;
95
+ output?: Array<string | GlobWithBase | AutoTracking>;
84
96
  } | {
85
97
  /**
86
98
  * Whether to cache the task
@@ -109,6 +121,16 @@ type UserGlobalCacheConfig = boolean | {
109
121
  */
110
122
  tasks?: boolean;
111
123
  };
124
+ type UserPackageDependency = {
125
+ /**
126
+ * Task name to run in dependency packages.
127
+ */
128
+ task: string;
129
+ /**
130
+ * Package.json dependency field or fields to use when selecting direct dependency packages.
131
+ */
132
+ from: DependsOnFrom;
133
+ };
112
134
  type RunConfig = {
113
135
  /**
114
136
  * Root-level cache configuration.
@@ -155,6 +177,24 @@ declare module '@voidzero-dev/vite-plus-core' {
155
177
  */
156
178
  lint?: OxlintConfig;
157
179
  fmt?: OxfmtConfig;
180
+ /**
181
+ * Defaults for the `vp check` composite command. Each flag mirrors the
182
+ * matching CLI option (`--no-fmt` / `--no-lint`) and only affects
183
+ * `vp check`; standalone `vp fmt` / `vp lint` are unaffected.
184
+ */
185
+ check?: {
186
+ /**
187
+ * Run the format step in `vp check`.
188
+ * @default true
189
+ */
190
+ fmt?: boolean;
191
+ /**
192
+ * Run the lint step in `vp check`. Type-check still runs when both
193
+ * `lint.options.typeAware` and `lint.options.typeCheck` are enabled.
194
+ * @default true
195
+ */
196
+ lint?: boolean;
197
+ };
158
198
  pack?: PackUserConfig | PackUserConfig[];
159
199
  run?: RunConfig;
160
200
  staged?: StagedConfig;
@@ -299,7 +339,22 @@ declare function defineProject$1(config: UserWorkspaceConfig): UserWorkspaceConf
299
339
  declare function defineProject$1(config: Promise<UserWorkspaceConfig>): Promise<UserWorkspaceConfig>;
300
340
  declare function defineProject$1(config: UserProjectConfigFn): UserProjectConfigFn;
301
341
  declare function defineProject$1(config: UserProjectConfigExport): UserProjectConfigExport;
342
+ /**
343
+ * Run a config-metadata resolution (a `resolveConfig` call that loads the
344
+ * user's config purely to read a non-plugin block) with the metadata marker
345
+ * set, so any `lazyPlugins` evaluated during it skips the plugin factory.
346
+ *
347
+ * The marker is scoped in time, not by command name: it is set only while at
348
+ * least one resolution is in flight (ref-counted so overlapping/nested
349
+ * resolutions compose) and the prior value is restored afterwards. By the time
350
+ * the task runner spawns a child (a verbatim `vp run` build, a `vp exec`
351
+ * child), the marker is already gone, so those builds correctly load plugins.
352
+ * Keying on the resolution itself — rather than guessing from the command
353
+ * name — also means command aliases (`vp format`) and not-yet-known commands
354
+ * all load plugins.
355
+ */
356
+ declare function withConfigMetadataResolution<T>(fn: () => Promise<T>): Promise<T>;
302
357
  declare function lazyPlugins(cb: () => PluginOption[]): PluginOption[] | undefined;
303
358
  declare function lazyPlugins(cb: () => Promise<PluginOption[]>): PluginOption[] | undefined;
304
359
  //#endregion
305
- 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 };
360
+ 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 };
@@ -1,10 +1,10 @@
1
- import { a as VITEST_VERSION } from "./constants-CrfJQIUX.js";
1
+ import { o as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-NeTOxrzV.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.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.3_@tsdown+exe@0.22.3_@type_701dbb346589e2d965113664da5ac600/node_modules/tsdown/esm-shims.js
7
+ //#region ../../node_modules/.pnpm/tsdown@0.22.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.3_@tsdown+exe@0.22.3_@type_7ab537c68b19946c2da2ea6b389f768f/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();
@@ -215,7 +215,7 @@ function vitePlusAutoInlineMatcherPlugin() {
215
215
  };
216
216
  }
217
217
  /** Coverage providers vite-plus can version-check against the bundled runner. */
218
- const KNOWN_COVERAGE_PROVIDERS = new Set(["v8", "istanbul"]);
218
+ const KNOWN_COVERAGE_PROVIDERS = /* @__PURE__ */ new Set(["v8", "istanbul"]);
219
219
  /**
220
220
  * Resolve the coverage provider package name that should be version-checked, or
221
221
  * `null` when no check applies (coverage off, or a `custom`/unknown provider
@@ -417,29 +417,54 @@ function defineConfig$1(config) {
417
417
  * [[injectPluginIntoConfig]] does).
418
418
  */
419
419
  function injectPluginIntoProjectExport(config) {
420
- if (typeof config === "function") return ((env) => {
420
+ if (typeof config === "function") return (env) => {
421
421
  const result = config(env);
422
422
  return result instanceof Promise ? result.then(injectPluginIntoInlineConfig) : injectPluginIntoInlineConfig(result);
423
- });
423
+ };
424
424
  if (config instanceof Promise) return config.then(injectPluginIntoInlineConfig);
425
425
  return injectPluginIntoInlineConfig(config);
426
426
  }
427
427
  function defineProject$1(config) {
428
428
  return defineProject(injectPluginIntoProjectExport(config));
429
429
  }
430
- const VITE_COMMANDS = new Set([
431
- "dev",
432
- "build",
433
- "test",
434
- "preview"
435
- ]);
436
- function lazyPlugins(cb) {
437
- const cmd = process.env.VP_COMMAND;
438
- if (!cmd || VITE_COMMANDS.has(cmd)) {
439
- const result = cb();
440
- if (result instanceof Promise) return [result];
441
- return result;
430
+ let configMetadataDepth = 0;
431
+ let configMetadataSavedValue;
432
+ /**
433
+ * Run a config-metadata resolution (a `resolveConfig` call that loads the
434
+ * user's config purely to read a non-plugin block) with the metadata marker
435
+ * set, so any `lazyPlugins` evaluated during it skips the plugin factory.
436
+ *
437
+ * The marker is scoped in time, not by command name: it is set only while at
438
+ * least one resolution is in flight (ref-counted so overlapping/nested
439
+ * resolutions compose) and the prior value is restored afterwards. By the time
440
+ * the task runner spawns a child (a verbatim `vp run` build, a `vp exec`
441
+ * child), the marker is already gone, so those builds correctly load plugins.
442
+ * Keying on the resolution itself — rather than guessing from the command
443
+ * name — also means command aliases (`vp format`) and not-yet-known commands
444
+ * all load plugins.
445
+ */
446
+ async function withConfigMetadataResolution(fn) {
447
+ if (configMetadataDepth === 0) {
448
+ configMetadataSavedValue = process.env[CONFIG_METADATA_ENV];
449
+ process.env[CONFIG_METADATA_ENV] = "1";
442
450
  }
451
+ configMetadataDepth++;
452
+ try {
453
+ return await fn();
454
+ } finally {
455
+ configMetadataDepth--;
456
+ if (configMetadataDepth === 0) {
457
+ if (configMetadataSavedValue === void 0) delete process.env[CONFIG_METADATA_ENV];
458
+ else process.env[CONFIG_METADATA_ENV] = configMetadataSavedValue;
459
+ configMetadataSavedValue = void 0;
460
+ }
461
+ }
462
+ }
463
+ function lazyPlugins(cb) {
464
+ if (process.env["VP_RESOLVING_CONFIG_METADATA"] === "1") return;
465
+ const result = cb();
466
+ if (result instanceof Promise) return [result];
467
+ return result;
443
468
  }
444
469
  //#endregion
445
- 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 };
470
+ 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 };
@@ -3,7 +3,14 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
6
+ var __esmMin = (fn, res, err) => () => {
7
+ if (err) throw err[0];
8
+ try {
9
+ return fn && (res = fn(fn = 0)), res;
10
+ } catch (e) {
11
+ throw err = [e], e;
12
+ }
13
+ };
7
14
  var __exportAll = (all, no_symbols) => {
8
15
  let target = {};
9
16
  for (var name in all) __defProp(target, name, {
@@ -29,14 +36,15 @@ let node_fs = require("node:fs");
29
36
  let node_module = require("node:module");
30
37
  let node_url = require("node:url");
31
38
  let vitest_config = require("vitest/config");
32
- //#region src/utils/constants.ts
33
- var VITEST_VERSION;
39
+ //#region package.json
40
+ var version = "0.2.2", VITE_PLUS_VERSION, VITEST_VERSION, CONFIG_METADATA_ENV;
34
41
  var init_constants = __esmMin((() => {
35
- process.env.VP_VERSION;
42
+ VITE_PLUS_VERSION = process.env.VP_VERSION || version;
36
43
  VITEST_VERSION = "4.1.9";
37
- process.env.VP_OVERRIDE_PACKAGES && JSON.parse(process.env.VP_OVERRIDE_PACKAGES);
44
+ process.env.VP_OVERRIDE_PACKAGES ? JSON.parse(process.env.VP_OVERRIDE_PACKAGES) : `${VITE_PLUS_VERSION}`;
38
45
  (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
39
46
  process.versions.node, process.release.name;
47
+ CONFIG_METADATA_ENV = "VP_RESOLVING_CONFIG_METADATA";
40
48
  }));
41
49
  //#endregion
42
50
  //#region src/define-config.ts
@@ -49,7 +57,8 @@ var define_config_exports = /* @__PURE__ */ __exportAll({
49
57
  defineProject: () => defineProject,
50
58
  isVitestFamilySpecifier: () => isVitestFamilySpecifier,
51
59
  lazyPlugins: () => lazyPlugins,
52
- resolveCoverageProviderToCheck: () => resolveCoverageProviderToCheck
60
+ resolveCoverageProviderToCheck: () => resolveCoverageProviderToCheck,
61
+ withConfigMetadataResolution: () => withConfigMetadataResolution
53
62
  });
54
63
  function getVitestAnchor() {
55
64
  if (vitestAnchor !== void 0) return vitestAnchor;
@@ -376,25 +385,54 @@ function defineConfig(config) {
376
385
  * [[injectPluginIntoConfig]] does).
377
386
  */
378
387
  function injectPluginIntoProjectExport(config) {
379
- if (typeof config === "function") return ((env) => {
388
+ if (typeof config === "function") return (env) => {
380
389
  const result = config(env);
381
390
  return result instanceof Promise ? result.then(injectPluginIntoInlineConfig) : injectPluginIntoInlineConfig(result);
382
- });
391
+ };
383
392
  if (config instanceof Promise) return config.then(injectPluginIntoInlineConfig);
384
393
  return injectPluginIntoInlineConfig(config);
385
394
  }
386
395
  function defineProject(config) {
387
396
  return (0, vitest_config.defineProject)(injectPluginIntoProjectExport(config));
388
397
  }
389
- function lazyPlugins(cb) {
390
- const cmd = process.env.VP_COMMAND;
391
- if (!cmd || VITE_COMMANDS.has(cmd)) {
392
- const result = cb();
393
- if (result instanceof Promise) return [result];
394
- return result;
398
+ /**
399
+ * Run a config-metadata resolution (a `resolveConfig` call that loads the
400
+ * user's config purely to read a non-plugin block) with the metadata marker
401
+ * set, so any `lazyPlugins` evaluated during it skips the plugin factory.
402
+ *
403
+ * The marker is scoped in time, not by command name: it is set only while at
404
+ * least one resolution is in flight (ref-counted so overlapping/nested
405
+ * resolutions compose) and the prior value is restored afterwards. By the time
406
+ * the task runner spawns a child (a verbatim `vp run` build, a `vp exec`
407
+ * child), the marker is already gone, so those builds correctly load plugins.
408
+ * Keying on the resolution itself — rather than guessing from the command
409
+ * name — also means command aliases (`vp format`) and not-yet-known commands
410
+ * all load plugins.
411
+ */
412
+ async function withConfigMetadataResolution(fn) {
413
+ if (configMetadataDepth === 0) {
414
+ configMetadataSavedValue = process.env[CONFIG_METADATA_ENV];
415
+ process.env[CONFIG_METADATA_ENV] = "1";
395
416
  }
417
+ configMetadataDepth++;
418
+ try {
419
+ return await fn();
420
+ } finally {
421
+ configMetadataDepth--;
422
+ if (configMetadataDepth === 0) {
423
+ if (configMetadataSavedValue === void 0) delete process.env[CONFIG_METADATA_ENV];
424
+ else process.env[CONFIG_METADATA_ENV] = configMetadataSavedValue;
425
+ configMetadataSavedValue = void 0;
426
+ }
427
+ }
428
+ }
429
+ function lazyPlugins(cb) {
430
+ if (process.env["VP_RESOLVING_CONFIG_METADATA"] === "1") return;
431
+ const result = cb();
432
+ if (result instanceof Promise) return [result];
433
+ return result;
396
434
  }
397
- var vitePlusRequire, vitePlusModuleFile, vitestAnchor, AUTO_INLINE_DEPS, KNOWN_COVERAGE_PROVIDERS, bundledVitestAnchorCache, coverageGuardedVitestInstances, VITE_COMMANDS;
435
+ var vitePlusRequire, vitePlusModuleFile, vitestAnchor, AUTO_INLINE_DEPS, KNOWN_COVERAGE_PROVIDERS, bundledVitestAnchorCache, coverageGuardedVitestInstances, configMetadataDepth, configMetadataSavedValue;
398
436
  var init_define_config = __esmMin((() => {
399
437
  init_constants();
400
438
  vitePlusRequire = (0, node_module.createRequire)(typeof __dirname !== "undefined" ? __dirname : require("url").pathToFileURL(__filename).href);
@@ -404,14 +442,9 @@ var init_define_config = __esmMin((() => {
404
442
  "@storybook/test",
405
443
  "jest-extended"
406
444
  ];
407
- KNOWN_COVERAGE_PROVIDERS = new Set(["v8", "istanbul"]);
445
+ KNOWN_COVERAGE_PROVIDERS = /* @__PURE__ */ new Set(["v8", "istanbul"]);
408
446
  coverageGuardedVitestInstances = /* @__PURE__ */ new WeakSet();
409
- VITE_COMMANDS = new Set([
410
- "dev",
411
- "build",
412
- "test",
413
- "preview"
414
- ]);
447
+ configMetadataDepth = 0;
415
448
  }));
416
449
  //#endregion
417
450
  Object.defineProperty(exports, "AUTO_INLINE_DEPS", {
@@ -486,3 +519,9 @@ Object.defineProperty(exports, "resolveCoverageProviderToCheck", {
486
519
  return resolveCoverageProviderToCheck;
487
520
  }
488
521
  });
522
+ Object.defineProperty(exports, "withConfigMetadataResolution", {
523
+ enumerable: true,
524
+ get: function() {
525
+ return withConfigMetadataResolution;
526
+ }
527
+ });