vite-plus 0.2.8 → 0.3.0
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.
- package/AGENTS.md +7 -0
- package/README.md +13 -6
- package/binding/index.cjs +57 -54
- package/binding/index.d.cts +100 -3
- package/dist/{agent-CI79DuSy.js → agent-Wqx0MPk0.js} +4 -188
- package/dist/bin.js +298 -278
- package/dist/command-CLJK5jGW.js +2 -0
- package/dist/command-CguLh2KL.js +471 -0
- package/dist/config/bin.js +29 -15
- package/dist/{constants-BppDcRc1.js → constants-Bn-U8o4v.js} +13 -3
- package/dist/create/bin.js +197 -247
- package/dist/{define-config-DPnHe1Mx.js → define-config-GXUdVT-0.js} +3 -3
- package/dist/{define-config-CEm_MtvJ.cjs → define-config-WiVlryJ2.cjs} +2 -2
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-CSQWHI6y.js → dist-BDYZP12R.js} +193 -149
- package/dist/dist-Dqv1-Clg.js +3 -0
- package/dist/{editor-CGWdbLgD.js → editor-CC4DqODz.js} +736 -153
- package/dist/{terminal-CrqqK8WT.js → help-BmKpeOP9.js} +27 -34
- package/dist/hooks/bin.d.ts +1 -0
- package/dist/hooks/bin.js +131 -0
- package/dist/hooks-DFqViZqZ.js +573 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-BU88uu6o.js → json-cULBl7Pi.js} +145 -139
- package/dist/migration/bin.js +67 -21
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BHOzlwMw.js → oxlint-plugin-config-DX5ezKbB.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +5 -4
- package/dist/{package-hV-77cBb.js → package-CBe9EWPY.js} +2 -2
- package/dist/{prompts-DYap08te.js → prompts-DF3yU-eU.js} +136 -512
- package/dist/{report-BS7ULx7A.js → report-ZNR1Mk6h.js} +1 -0
- package/dist/{resolve-vite-config-EWXclqvV.js → resolve-vite-config-ipGb39Jo.js} +2 -9
- package/dist/staged/bin.js +299 -251
- package/dist/terminal-MKGAuy-p.js +39 -0
- package/dist/test/browser/providers/playwright/context.d.ts +1 -1
- package/dist/test/browser/providers/playwright.d.ts +6 -6
- package/dist/test/browser/providers/preview/context.d.ts +1 -1
- package/dist/test/browser/providers/preview.d.ts +4 -4
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -1
- package/dist/test/browser/providers/webdriverio.d.ts +6 -6
- package/dist/test/browser-playwright/context.d.ts +1 -1
- package/dist/test/browser-playwright.d.ts +6 -6
- package/dist/test/browser-preview/context.d.ts +1 -1
- package/dist/test/browser-preview.d.ts +4 -4
- package/dist/test/browser-webdriverio/context.d.ts +1 -1
- package/dist/test/browser-webdriverio.d.ts +6 -6
- package/dist/test/context.d.ts +3 -3
- package/dist/test/locators.d.ts +1 -1
- package/dist/toolchain.d.ts +25 -0
- package/dist/toolchain.js +194 -0
- package/dist/toolchain.json +193 -0
- package/dist/tsconfig-BVHG3DpR.js +2 -0
- package/dist/{tsconfig-CVUKLfL8.js → tsconfig-LD2QhQ0O.js} +5 -4
- package/dist/tsgolint-path.js +1 -1
- package/dist/version.js +5 -4
- package/dist/versions.d.ts +3 -3
- package/dist/versions.js +6 -6
- package/docs/guide/ci.md +37 -4
- package/docs/guide/commit-hooks.md +87 -14
- package/docs/guide/create.md +7 -4
- package/docs/guide/env.md +20 -6
- package/docs/guide/fmt.md +2 -2
- package/docs/guide/github-actions-cache.md +5 -1
- package/docs/guide/ide-integration.md +61 -2
- package/docs/guide/index.md +3 -1
- package/docs/guide/install.md +27 -1
- package/docs/guide/installer-env-vars.md +53 -6
- package/docs/guide/lint.md +3 -1
- package/docs/guide/migrate-rules.md +9 -0
- package/docs/guide/migrate.md +41 -4
- package/docs/guide/monorepo.md +4 -4
- package/docs/guide/test.md +8 -0
- package/docs/guide/troubleshooting.md +12 -4
- package/docs/guide/upgrade.md +75 -5
- package/package.json +36 -33
- package/rules/vite-tools.yml +0 -7
- package/dist/dist-DT25H9pj.js +0 -3
- package/docs/_data/team.ts +0 -131
- package/docs/package.json +0 -30
- package/docs/pnpm-lock.yaml +0 -4003
- package/docs/pnpm-workspace.yaml +0 -6
- package/docs/public/checkmark.svg +0 -1
- package/docs/public/cta-background.jpg +0 -0
- package/docs/public/favicon.svg +0 -1
- package/docs/public/icon.svg +0 -1
- package/docs/public/logo.svg +0 -1
- package/docs/public/og.jpg +0 -0
- package/docs/vite.config.ts +0 -17
- package/dist/{log-update-CoW8Z4Dl.js → log-update-DHZRyJ2m.js} +1 -1
- package/dist/{tsgolint-path-eMZT-oea.js → tsgolint-path-CbDReEOx.js} +1 -1
package/dist/create/bin.js
CHANGED
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-CMFfr-1z.js";
|
|
2
|
-
import {
|
|
3
|
-
import { s as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
2
|
+
import { t as renderCliDoc } from "../help-BmKpeOP9.js";
|
|
3
|
+
import { a as muted, i as log, o as printHeader, r as formatDuration, s as success, t as accent } from "../terminal-MKGAuy-p.js";
|
|
4
|
+
import { u as VITE_PLUS_NAME } from "../constants-Bn-U8o4v.js";
|
|
5
|
+
import { a as resolveViteConfig, n as findWorkspaceRoot, r as hasViteConfig, t as findViteConfig } from "../resolve-vite-config-ipGb39Jo.js";
|
|
6
|
+
import { A as isCancel, C as log$1, D as spinner, E as select, O as text, S as intro, a as resolveGitInit, c as selectPackageManager, d as readYamlFile, h as resolveApproveBuildTargets, i as promptGitHooks, k as require_picocolors, m as detectGatedBuilds, n as defaultInteractive, o as runViteFmt, p as approveBuilds, r as downloadPackageManager$1, s as runViteInstall, t as cancelAndExit, u as editYamlFile, v as DependencyType, w as multiselect, y as PackageManager } from "../prompts-DF3yU-eU.js";
|
|
7
7
|
import { t as lib_default } from "../lib-L3DWSRQp.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { i as readJsonFile, n as editJsonFile } from "../json-cULBl7Pi.js";
|
|
9
|
+
import { o as fetchNpmResource, r as getScopeFromPackageName, s as getNpmRegistry, t as checkNpmPackageExists } from "../package-CBe9EWPY.js";
|
|
10
|
+
import { a as selectAgentTargets, c as writeCopilotSetupWorkflow, d as templatesDir, l as displayRelative, r as detectExistingAgentTargetPaths, s as writeAgentInstructions, t as COPILOT_AGENT_ID } from "../agent-Wqx0MPk0.js";
|
|
11
|
+
import { A as detectWorkspace$1, B as promptTsupMigration, F as detectFramework, G as promptPrettierMigration, I as hasFrameworkShim, J as detectEslintProject, M as updatePackageJsonWithDeps, N as updateWorkspaceConfig, P as addFrameworkShim, R as detectTsupProject, U as detectPrettierProject, Z as promptEslintMigration, a as selectEditors, b as initGitRepository, c as rewriteMonorepoProject, g as installGitHooks, j as isBingoTemplate, l as rewriteStandaloneProject, m as setPackageManager, n as detectExistingEditors, o as writeEditorConfigs, s as rewriteMonorepo, v as shouldSkipStagedMigrationForHooks, x as injectCreateDefaultTemplate, y as findGitRoot } from "../editor-CC4DqODz.js";
|
|
12
|
+
import { n as runCommandSilently, t as runCommand$1 } from "../command-CguLh2KL.js";
|
|
11
13
|
import path from "node:path";
|
|
12
|
-
import { runCommand, upsertJsonConfig, vitePlusHeader } from "../../binding/index.js";
|
|
14
|
+
import { getVpDirs, runCommand, upsertJsonConfig, vitePlusHeader } from "../../binding/index.js";
|
|
13
15
|
import { styleText } from "node:util";
|
|
14
16
|
import fs from "node:fs";
|
|
15
|
-
import os from "node:os";
|
|
16
17
|
import { createHash, randomUUID } from "node:crypto";
|
|
18
|
+
import os from "node:os";
|
|
17
19
|
import fsPromises from "node:fs/promises";
|
|
18
20
|
import assert from "node:assert";
|
|
19
|
-
//#region src/utils/git.ts
|
|
20
|
-
var import_cross_spawn = /* @__PURE__ */ __toESM(require_cross_spawn(), 1);
|
|
21
|
-
async function initGitRepository(cwd) {
|
|
22
|
-
return (await runCommandSilently({
|
|
23
|
-
command: "git",
|
|
24
|
-
args: ["init"],
|
|
25
|
-
cwd,
|
|
26
|
-
envs: process.env
|
|
27
|
-
})).exitCode === 0;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
21
|
//#region src/create/command.ts
|
|
31
22
|
async function runCommandAndDetectProjectDir(options, parentDir) {
|
|
32
23
|
const cwd = parentDir ? path.join(options.cwd, parentDir) : options.cwd;
|
|
@@ -255,8 +246,7 @@ function _parseExtendedHeaders(data) {
|
|
|
255
246
|
//#endregion
|
|
256
247
|
//#region src/create/org-tarball.ts
|
|
257
248
|
function getCacheRoot() {
|
|
258
|
-
|
|
259
|
-
return path.join(home, "tmp", "create-org");
|
|
249
|
+
return path.join(getVpDirs().cache, "create-org");
|
|
260
250
|
}
|
|
261
251
|
/**
|
|
262
252
|
* Replace characters that are illegal in Windows path segments
|
|
@@ -962,6 +952,140 @@ function formatManifestTable(manifest, isMonorepo) {
|
|
|
962
952
|
};
|
|
963
953
|
}
|
|
964
954
|
//#endregion
|
|
955
|
+
//#region src/create/org-resolve.ts
|
|
956
|
+
function printNonInteractiveTable(manifest, orgSpec, isMonorepo) {
|
|
957
|
+
const { lines, filteredCount } = formatManifestTable(manifest, isMonorepo);
|
|
958
|
+
const [firstVisible] = filterManifestForContext(manifest.templates, isMonorepo);
|
|
959
|
+
const body = [
|
|
960
|
+
"",
|
|
961
|
+
`A template name is required when running \`vp create ${orgSpec.scope}\` in non-interactive mode.`,
|
|
962
|
+
"",
|
|
963
|
+
`Available templates in ${manifest.packageName}:`,
|
|
964
|
+
"",
|
|
965
|
+
...lines
|
|
966
|
+
];
|
|
967
|
+
if (filteredCount > 0) body.push("", `(omitted ${filteredCount} monorepo-only ${filteredCount === 1 ? "entry" : "entries"} because this workspace is already a monorepo)`);
|
|
968
|
+
body.push("", "Examples:");
|
|
969
|
+
if (firstVisible) body.push(" # Scaffold a specific template from the org", ` vp create ${orgSpec.scope}:${firstVisible.name} --no-interactive`, "");
|
|
970
|
+
body.push(" # Or use a Vite+ built-in template", " vp create vite:application --no-interactive", "");
|
|
971
|
+
process.stderr.write(body.join("\n"));
|
|
972
|
+
}
|
|
973
|
+
function rejectMonorepoEntryInsideMonorepo(entry, isMonorepo) {
|
|
974
|
+
if (entry.monorepo && isMonorepo) {
|
|
975
|
+
log$1.info("You are already in a monorepo workspace.\nUse a different template or run this command outside the monorepo");
|
|
976
|
+
cancelAndExit("Cannot create a monorepo inside an existing monorepo", 1);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
async function resolveEntry(manifest, entry) {
|
|
980
|
+
if (isRelativePath(entry.template)) return {
|
|
981
|
+
kind: "bundled",
|
|
982
|
+
bundledLocalPath: resolveBundledPath(await ensureOrgPackageExtracted(manifest), entry.template),
|
|
983
|
+
entryName: entry.name,
|
|
984
|
+
scope: manifest.scope,
|
|
985
|
+
...entry.monorepo === true ? { monorepo: true } : {}
|
|
986
|
+
};
|
|
987
|
+
return {
|
|
988
|
+
kind: "replaced",
|
|
989
|
+
templateName: entry.template
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* If `selectedTemplateName` points at an `@scope[/name]` org whose
|
|
994
|
+
* `@scope/create` package publishes a `createConfig.templates` manifest, apply the
|
|
995
|
+
* manifest rules (picker / direct lookup / escape hatch / bundled
|
|
996
|
+
* extraction) and report the outcome.
|
|
997
|
+
*
|
|
998
|
+
* The caller — `packages/cli/src/create/bin.ts` — decides what to do next
|
|
999
|
+
* based on the returned variant.
|
|
1000
|
+
*/
|
|
1001
|
+
async function resolveOrgManifestForCreate(args) {
|
|
1002
|
+
const orgSpec = parseOrgScopedSpec(args.templateName);
|
|
1003
|
+
if (!orgSpec) return { kind: "passthrough" };
|
|
1004
|
+
let manifest;
|
|
1005
|
+
try {
|
|
1006
|
+
manifest = await readOrgManifest(orgSpec.scope, orgSpec.version);
|
|
1007
|
+
} catch (error) {
|
|
1008
|
+
const message = error instanceof OrgManifestSchemaError ? error.message : `Failed to read ${orgSpec.scope}/create manifest: ${error.message}`;
|
|
1009
|
+
cancelAndExit(message, 1);
|
|
1010
|
+
}
|
|
1011
|
+
if (!manifest) {
|
|
1012
|
+
if (orgSpec.name !== void 0) cancelAndExit(`No \`createConfig.templates\` manifest in ${orgSpec.scope}/create — \`@org:name\` requires one.`, 1);
|
|
1013
|
+
log$1.info(`No \`createConfig.templates\` manifest in ${orgSpec.scope}/create — running it as a normal package.`);
|
|
1014
|
+
return { kind: "passthrough" };
|
|
1015
|
+
}
|
|
1016
|
+
if (orgSpec.name === void 0) {
|
|
1017
|
+
if (!args.interactive) {
|
|
1018
|
+
printNonInteractiveTable(manifest, orgSpec, args.isMonorepo);
|
|
1019
|
+
process.exit(1);
|
|
1020
|
+
}
|
|
1021
|
+
const picked = await pickOrgTemplate(manifest, { isMonorepo: args.isMonorepo });
|
|
1022
|
+
if (picked === ORG_PICKER_CANCEL) cancelAndExit();
|
|
1023
|
+
if (picked === ORG_PICKER_BUILTIN_ESCAPE) {
|
|
1024
|
+
if (args.isMonorepo && manifest.templates.every((t) => t.monorepo)) log$1.info(`No templates from ${manifest.packageName} are applicable inside a monorepo — showing Vite+ built-in templates instead.`);
|
|
1025
|
+
return { kind: "escape-hatch" };
|
|
1026
|
+
}
|
|
1027
|
+
rejectMonorepoEntryInsideMonorepo(picked.entry, args.isMonorepo);
|
|
1028
|
+
return resolveEntry(manifest, picked.entry);
|
|
1029
|
+
}
|
|
1030
|
+
const entry = manifest.templates.find((candidate) => candidate.name === orgSpec.name);
|
|
1031
|
+
if (!entry) {
|
|
1032
|
+
const available = filterManifestForContext(manifest.templates, args.isMonorepo).map((t) => t.name).join(", ");
|
|
1033
|
+
cancelAndExit(`No template named "${orgSpec.name}" in ${manifest.packageName}. Available: ${available || "(none applicable in this context)"}.`, 1);
|
|
1034
|
+
}
|
|
1035
|
+
rejectMonorepoEntryInsideMonorepo(entry, args.isMonorepo);
|
|
1036
|
+
return resolveEntry(manifest, entry);
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Read the `create` config (`defaultTemplate` + validated `templates`) from
|
|
1040
|
+
* a workspace's `vite.config.ts` in a single config evaluation.
|
|
1041
|
+
*
|
|
1042
|
+
* By default, walks up from `startDir` via `findWorkspaceRoot` (monorepo
|
|
1043
|
+
* markers only — `pnpm-workspace.yaml`, `workspaces` in `package.json`,
|
|
1044
|
+
* `lerna.json`) so monorepo invocations from any subdirectory still pick up
|
|
1045
|
+
* the root config. Pass `walkUp: false` to read `startDir` directly when the
|
|
1046
|
+
* caller already holds the exact workspace root.
|
|
1047
|
+
*
|
|
1048
|
+
* Best-effort for resolution: a missing or unresolvable config reads as
|
|
1049
|
+
* empty. A present-but-malformed `create.templates` still throws a
|
|
1050
|
+
* {@link CreateConfigSchemaError} so the misconfiguration surfaces.
|
|
1051
|
+
*
|
|
1052
|
+
* Pass `throwOnReadError: true` for read-modify-write callers (registration):
|
|
1053
|
+
* if a config file exists but cannot be evaluated, an empty read would let a
|
|
1054
|
+
* later write clobber the real `create` block, so the eval error is rethrown
|
|
1055
|
+
* instead of swallowed.
|
|
1056
|
+
*/
|
|
1057
|
+
async function getConfiguredCreate(startDir, options) {
|
|
1058
|
+
const projectRoot = options?.walkUp === false ? startDir : findWorkspaceRoot(startDir) ?? startDir;
|
|
1059
|
+
if (!hasViteConfig(projectRoot)) return { templates: [] };
|
|
1060
|
+
let create;
|
|
1061
|
+
try {
|
|
1062
|
+
create = (await resolveViteConfig(projectRoot)).create;
|
|
1063
|
+
} catch (error) {
|
|
1064
|
+
if (options?.throwOnReadError) throw error;
|
|
1065
|
+
return { templates: [] };
|
|
1066
|
+
}
|
|
1067
|
+
const defaultTemplate = typeof create?.defaultTemplate === "string" && create.defaultTemplate.length > 0 ? create.defaultTemplate : void 0;
|
|
1068
|
+
const templates = validateCreateTemplates(create?.templates);
|
|
1069
|
+
return {
|
|
1070
|
+
...defaultTemplate !== void 0 ? { defaultTemplate } : {},
|
|
1071
|
+
templates
|
|
1072
|
+
};
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Read `create.defaultTemplate` only. Best-effort for missing or unresolvable
|
|
1076
|
+
* configs (returns `undefined`), but a malformed `create.templates` still
|
|
1077
|
+
* rethrows its {@link CreateConfigSchemaError}: swallowing it here would
|
|
1078
|
+
* silently drop a valid `defaultTemplate` along with the diagnostic.
|
|
1079
|
+
*/
|
|
1080
|
+
async function getConfiguredDefaultTemplate(startDir) {
|
|
1081
|
+
try {
|
|
1082
|
+
return (await getConfiguredCreate(startDir)).defaultTemplate;
|
|
1083
|
+
} catch (error) {
|
|
1084
|
+
if (error instanceof CreateConfigSchemaError) throw error;
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
//#endregion
|
|
965
1089
|
//#region ../../node_modules/.pnpm/validate-npm-package-name@7.0.2/node_modules/validate-npm-package-name/lib/builtin-modules.json
|
|
966
1090
|
var require_builtin_modules = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
967
1091
|
module.exports = [
|
|
@@ -4110,10 +4234,6 @@ async function checkProjectDirExists(projectDirFullPath, interactive) {
|
|
|
4110
4234
|
case "no": cancelAndExit();
|
|
4111
4235
|
}
|
|
4112
4236
|
}
|
|
4113
|
-
function cancelAndExit(message = "Operation cancelled", exitCode = 0) {
|
|
4114
|
-
cancel(message);
|
|
4115
|
-
process.exit(exitCode);
|
|
4116
|
-
}
|
|
4117
4237
|
function isEmpty(path) {
|
|
4118
4238
|
const files = fs.readdirSync(path);
|
|
4119
4239
|
return files.length === 0 || files.length === 1 && files[0] === ".git";
|
|
@@ -4157,139 +4277,6 @@ function validateTargetDir(input, cwd) {
|
|
|
4157
4277
|
return { directory: targetDir };
|
|
4158
4278
|
}
|
|
4159
4279
|
//#endregion
|
|
4160
|
-
//#region src/create/org-resolve.ts
|
|
4161
|
-
function printNonInteractiveTable(manifest, orgSpec, isMonorepo) {
|
|
4162
|
-
const { lines, filteredCount } = formatManifestTable(manifest, isMonorepo);
|
|
4163
|
-
const [firstVisible] = filterManifestForContext(manifest.templates, isMonorepo);
|
|
4164
|
-
const body = [
|
|
4165
|
-
"",
|
|
4166
|
-
`A template name is required when running \`vp create ${orgSpec.scope}\` in non-interactive mode.`,
|
|
4167
|
-
"",
|
|
4168
|
-
`Available templates in ${manifest.packageName}:`,
|
|
4169
|
-
"",
|
|
4170
|
-
...lines
|
|
4171
|
-
];
|
|
4172
|
-
if (filteredCount > 0) body.push("", `(omitted ${filteredCount} monorepo-only ${filteredCount === 1 ? "entry" : "entries"} because this workspace is already a monorepo)`);
|
|
4173
|
-
body.push("", "Examples:");
|
|
4174
|
-
if (firstVisible) body.push(" # Scaffold a specific template from the org", ` vp create ${orgSpec.scope}:${firstVisible.name} --no-interactive`, "");
|
|
4175
|
-
body.push(" # Or use a Vite+ built-in template", " vp create vite:application --no-interactive", "");
|
|
4176
|
-
process.stderr.write(body.join("\n"));
|
|
4177
|
-
}
|
|
4178
|
-
function rejectMonorepoEntryInsideMonorepo(entry, isMonorepo) {
|
|
4179
|
-
if (entry.monorepo && isMonorepo) {
|
|
4180
|
-
log$1.info("You are already in a monorepo workspace.\nUse a different template or run this command outside the monorepo");
|
|
4181
|
-
cancelAndExit("Cannot create a monorepo inside an existing monorepo", 1);
|
|
4182
|
-
}
|
|
4183
|
-
}
|
|
4184
|
-
async function resolveEntry(manifest, entry) {
|
|
4185
|
-
if (isRelativePath(entry.template)) return {
|
|
4186
|
-
kind: "bundled",
|
|
4187
|
-
bundledLocalPath: resolveBundledPath(await ensureOrgPackageExtracted(manifest), entry.template),
|
|
4188
|
-
entryName: entry.name,
|
|
4189
|
-
scope: manifest.scope,
|
|
4190
|
-
...entry.monorepo === true ? { monorepo: true } : {}
|
|
4191
|
-
};
|
|
4192
|
-
return {
|
|
4193
|
-
kind: "replaced",
|
|
4194
|
-
templateName: entry.template
|
|
4195
|
-
};
|
|
4196
|
-
}
|
|
4197
|
-
/**
|
|
4198
|
-
* If `selectedTemplateName` points at an `@scope[/name]` org whose
|
|
4199
|
-
* `@scope/create` package publishes a `createConfig.templates` manifest, apply the
|
|
4200
|
-
* manifest rules (picker / direct lookup / escape hatch / bundled
|
|
4201
|
-
* extraction) and report the outcome.
|
|
4202
|
-
*
|
|
4203
|
-
* The caller — `packages/cli/src/create/bin.ts` — decides what to do next
|
|
4204
|
-
* based on the returned variant.
|
|
4205
|
-
*/
|
|
4206
|
-
async function resolveOrgManifestForCreate(args) {
|
|
4207
|
-
const orgSpec = parseOrgScopedSpec(args.templateName);
|
|
4208
|
-
if (!orgSpec) return { kind: "passthrough" };
|
|
4209
|
-
let manifest;
|
|
4210
|
-
try {
|
|
4211
|
-
manifest = await readOrgManifest(orgSpec.scope, orgSpec.version);
|
|
4212
|
-
} catch (error) {
|
|
4213
|
-
cancelAndExit(error instanceof OrgManifestSchemaError ? error.message : `Failed to read ${orgSpec.scope}/create manifest: ${error.message}`, 1);
|
|
4214
|
-
}
|
|
4215
|
-
if (!manifest) {
|
|
4216
|
-
if (orgSpec.name !== void 0) cancelAndExit(`No \`createConfig.templates\` manifest in ${orgSpec.scope}/create — \`@org:name\` requires one.`, 1);
|
|
4217
|
-
log$1.info(`No \`createConfig.templates\` manifest in ${orgSpec.scope}/create — running it as a normal package.`);
|
|
4218
|
-
return { kind: "passthrough" };
|
|
4219
|
-
}
|
|
4220
|
-
if (orgSpec.name === void 0) {
|
|
4221
|
-
if (!args.interactive) {
|
|
4222
|
-
printNonInteractiveTable(manifest, orgSpec, args.isMonorepo);
|
|
4223
|
-
process.exit(1);
|
|
4224
|
-
}
|
|
4225
|
-
const picked = await pickOrgTemplate(manifest, { isMonorepo: args.isMonorepo });
|
|
4226
|
-
if (picked === ORG_PICKER_CANCEL) cancelAndExit();
|
|
4227
|
-
if (picked === ORG_PICKER_BUILTIN_ESCAPE) {
|
|
4228
|
-
if (args.isMonorepo && manifest.templates.every((t) => t.monorepo)) log$1.info(`No templates from ${manifest.packageName} are applicable inside a monorepo — showing Vite+ built-in templates instead.`);
|
|
4229
|
-
return { kind: "escape-hatch" };
|
|
4230
|
-
}
|
|
4231
|
-
rejectMonorepoEntryInsideMonorepo(picked.entry, args.isMonorepo);
|
|
4232
|
-
return resolveEntry(manifest, picked.entry);
|
|
4233
|
-
}
|
|
4234
|
-
const entry = manifest.templates.find((candidate) => candidate.name === orgSpec.name);
|
|
4235
|
-
if (!entry) {
|
|
4236
|
-
const available = filterManifestForContext(manifest.templates, args.isMonorepo).map((t) => t.name).join(", ");
|
|
4237
|
-
cancelAndExit(`No template named "${orgSpec.name}" in ${manifest.packageName}. Available: ${available || "(none applicable in this context)"}.`, 1);
|
|
4238
|
-
}
|
|
4239
|
-
rejectMonorepoEntryInsideMonorepo(entry, args.isMonorepo);
|
|
4240
|
-
return resolveEntry(manifest, entry);
|
|
4241
|
-
}
|
|
4242
|
-
/**
|
|
4243
|
-
* Read the `create` config (`defaultTemplate` + validated `templates`) from
|
|
4244
|
-
* a workspace's `vite.config.ts` in a single config evaluation.
|
|
4245
|
-
*
|
|
4246
|
-
* By default, walks up from `startDir` via `findWorkspaceRoot` (monorepo
|
|
4247
|
-
* markers only — `pnpm-workspace.yaml`, `workspaces` in `package.json`,
|
|
4248
|
-
* `lerna.json`) so monorepo invocations from any subdirectory still pick up
|
|
4249
|
-
* the root config. Pass `walkUp: false` to read `startDir` directly when the
|
|
4250
|
-
* caller already holds the exact workspace root.
|
|
4251
|
-
*
|
|
4252
|
-
* Best-effort for resolution: a missing or unresolvable config reads as
|
|
4253
|
-
* empty. A present-but-malformed `create.templates` still throws a
|
|
4254
|
-
* {@link CreateConfigSchemaError} so the misconfiguration surfaces.
|
|
4255
|
-
*
|
|
4256
|
-
* Pass `throwOnReadError: true` for read-modify-write callers (registration):
|
|
4257
|
-
* if a config file exists but cannot be evaluated, an empty read would let a
|
|
4258
|
-
* later write clobber the real `create` block, so the eval error is rethrown
|
|
4259
|
-
* instead of swallowed.
|
|
4260
|
-
*/
|
|
4261
|
-
async function getConfiguredCreate(startDir, options) {
|
|
4262
|
-
const projectRoot = options?.walkUp === false ? startDir : findWorkspaceRoot(startDir) ?? startDir;
|
|
4263
|
-
if (!hasViteConfig(projectRoot)) return { templates: [] };
|
|
4264
|
-
let create;
|
|
4265
|
-
try {
|
|
4266
|
-
create = (await resolveViteConfig(projectRoot)).create;
|
|
4267
|
-
} catch (error) {
|
|
4268
|
-
if (options?.throwOnReadError) throw error;
|
|
4269
|
-
return { templates: [] };
|
|
4270
|
-
}
|
|
4271
|
-
const defaultTemplate = typeof create?.defaultTemplate === "string" && create.defaultTemplate.length > 0 ? create.defaultTemplate : void 0;
|
|
4272
|
-
const templates = validateCreateTemplates(create?.templates);
|
|
4273
|
-
return {
|
|
4274
|
-
...defaultTemplate !== void 0 ? { defaultTemplate } : {},
|
|
4275
|
-
templates
|
|
4276
|
-
};
|
|
4277
|
-
}
|
|
4278
|
-
/**
|
|
4279
|
-
* Read `create.defaultTemplate` only. Best-effort for missing or unresolvable
|
|
4280
|
-
* configs (returns `undefined`), but a malformed `create.templates` still
|
|
4281
|
-
* rethrows its {@link CreateConfigSchemaError}: swallowing it here would
|
|
4282
|
-
* silently drop a valid `defaultTemplate` along with the diagnostic.
|
|
4283
|
-
*/
|
|
4284
|
-
async function getConfiguredDefaultTemplate(startDir) {
|
|
4285
|
-
try {
|
|
4286
|
-
return (await getConfiguredCreate(startDir)).defaultTemplate;
|
|
4287
|
-
} catch (error) {
|
|
4288
|
-
if (error instanceof CreateConfigSchemaError) throw error;
|
|
4289
|
-
return;
|
|
4290
|
-
}
|
|
4291
|
-
}
|
|
4292
|
-
//#endregion
|
|
4293
4280
|
//#region src/create/register-template.ts
|
|
4294
4281
|
/**
|
|
4295
4282
|
* Register a local template into `create.templates` in a monorepo's root
|
|
@@ -4655,13 +4642,14 @@ function alignMonorepoTypeScriptVersion(workspaceRootPath, appProjectPath, libra
|
|
|
4655
4642
|
* scaffolded sub-package. After migration its scripts already use `vp ...` and
|
|
4656
4643
|
* nothing imports `'vite'` directly, so `vite-plus` provides them transitively.
|
|
4657
4644
|
*
|
|
4658
|
-
* pnpm is the exception and keeps them:
|
|
4659
|
-
*
|
|
4660
|
-
*
|
|
4661
|
-
*
|
|
4662
|
-
*
|
|
4663
|
-
*
|
|
4664
|
-
*
|
|
4645
|
+
* pnpm is the exception and keeps them: a package needs a DIRECT `vite` edge for
|
|
4646
|
+
* `vite` to resolve to @voidzero-dev/vite-plus-core there (and for `vp why vite`
|
|
4647
|
+
* to show it) rather than pnpm auto-installing an upstream Vite to satisfy
|
|
4648
|
+
* Vitest's peer. Migration points that edge at the workspace catalog, which owns
|
|
4649
|
+
* the alias; the `vite@*` workspace override covers the transitive and peer
|
|
4650
|
+
* declarations instead (see `pnpmOverrideKey`). npm, yarn, and bun redirect the
|
|
4651
|
+
* transitive/peer vite via their root overrides/resolutions regardless of a
|
|
4652
|
+
* direct dep, so the aliased keys are dead weight and are dropped.
|
|
4665
4653
|
*/
|
|
4666
4654
|
function dropAliasedRuntimeDevDeps(appProjectPath, packageManager) {
|
|
4667
4655
|
if (packageManager === PackageManager.pnpm) return;
|
|
@@ -4674,10 +4662,6 @@ function dropAliasedRuntimeDevDeps(appProjectPath, packageManager) {
|
|
|
4674
4662
|
return changed ? pkg : void 0;
|
|
4675
4663
|
});
|
|
4676
4664
|
}
|
|
4677
|
-
function getScopeFromPackageName(packageName) {
|
|
4678
|
-
if (packageName.startsWith("@")) return packageName.split("/")[0];
|
|
4679
|
-
return "";
|
|
4680
|
-
}
|
|
4681
4665
|
//#endregion
|
|
4682
4666
|
//#region src/create/bin.ts
|
|
4683
4667
|
const helpMessage = renderCliDoc({
|
|
@@ -4958,25 +4942,10 @@ function formatTemplateName(templateName) {
|
|
|
4958
4942
|
const baseName = isTypeScript ? templateName.slice(0, -3) : templateName;
|
|
4959
4943
|
return `${templateAliases[baseName] ?? baseName.split(/[-_]/).map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join(" ")} + ${isTypeScript ? "TypeScript" : "JavaScript"}`;
|
|
4960
4944
|
}
|
|
4961
|
-
function formatDuration(durationMs) {
|
|
4962
|
-
if (durationMs < 1e3) return `${Math.max(1, durationMs)}ms`;
|
|
4963
|
-
const durationSeconds = durationMs / 1e3;
|
|
4964
|
-
if (durationSeconds < 10) return `${durationSeconds.toFixed(1)}s`;
|
|
4965
|
-
return `${Math.round(durationSeconds)}s`;
|
|
4966
|
-
}
|
|
4967
4945
|
function getNextCommand(projectDir, command) {
|
|
4968
4946
|
if (!projectDir || projectDir === ".") return command;
|
|
4969
4947
|
return `cd ${projectDir} && ${command}`;
|
|
4970
4948
|
}
|
|
4971
|
-
function findGitRoot(startPath) {
|
|
4972
|
-
let dir = startPath;
|
|
4973
|
-
while (true) {
|
|
4974
|
-
if (fs.existsSync(path.join(dir, ".git"))) return dir;
|
|
4975
|
-
const parent = path.dirname(dir);
|
|
4976
|
-
if (parent === dir) return;
|
|
4977
|
-
dir = parent;
|
|
4978
|
-
}
|
|
4979
|
-
}
|
|
4980
4949
|
function getCopilotSetupRoot(projectRoot, isExistingMonorepo) {
|
|
4981
4950
|
if (!isExistingMonorepo) return projectRoot;
|
|
4982
4951
|
return findGitRoot(projectRoot) ?? projectRoot;
|
|
@@ -5155,36 +5124,40 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5155
5124
|
if (isInSubdirectory && !compactOutput) log$1.info(`Use ${accent("--directory")} to specify a different target location.`);
|
|
5156
5125
|
selectedParentDir = inferParentDir(selectedTemplateName, workspaceInfoOptional, isLocalTemplate) ?? workspaceInfoOptional.parentDirs[0];
|
|
5157
5126
|
}
|
|
5158
|
-
if (isGitHubUrl(selectedTemplateName))
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5127
|
+
if (isGitHubUrl(selectedTemplateName)) {
|
|
5128
|
+
if (hasExplicitTargetDir(selectedTemplateArgs)) remoteTargetDir = selectedTemplateArgs[0];
|
|
5129
|
+
else {
|
|
5130
|
+
const inferredTargetDir = inferGitHubRepoName(selectedTemplateName) ?? "template";
|
|
5131
|
+
const remoteTargetBaseDir = selectedParentDir ? path.join(workspaceInfoOptional.rootDir, selectedParentDir) : workspaceInfoOptional.rootDir;
|
|
5132
|
+
const defaultTargetDir = suggestAvailableTargetDir(inferredTargetDir, remoteTargetBaseDir);
|
|
5133
|
+
if (defaultTargetDir !== inferredTargetDir && options.interactive) log$1.info(` Target directory "${inferredTargetDir}" already exists. Suggested: ${accent(defaultTargetDir)}`);
|
|
5134
|
+
remoteTargetDir = await promptTargetDir(defaultTargetDir, options.interactive, { cwd: remoteTargetBaseDir });
|
|
5135
|
+
selectedTemplateArgs = [remoteTargetDir, ...selectedTemplateArgs];
|
|
5136
|
+
}
|
|
5166
5137
|
}
|
|
5167
5138
|
const directScaffoldFallbackName = bundled ? `vite-plus-${bundled.entryName}` : selectedTemplateName === BuiltinTemplate.monorepo ? "vite-plus-monorepo" : `vite-plus-${selectedTemplateName.split(":")[1]}`;
|
|
5168
|
-
if (isDirectScaffoldTemplate && (!targetDir || targetDir === "."))
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
if (
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5139
|
+
if (isDirectScaffoldTemplate && (!targetDir || targetDir === ".")) {
|
|
5140
|
+
if (targetDir === ".") {
|
|
5141
|
+
packageName = deriveDefaultPackageName(cwd, workspaceInfoOptional.monorepoScope, directScaffoldFallbackName);
|
|
5142
|
+
if (isMonorepo) {
|
|
5143
|
+
if (!cwdRelativeToRoot) cancelAndExit("Cannot scaffold into the monorepo root directory. Use --directory to specify a target directory", 1);
|
|
5144
|
+
const enclosingPackage = workspaceInfoOptional.packages.find((pkg) => cwdRelativeToRoot === pkg.path || cwdRelativeToRoot.startsWith(`${pkg.path}/`));
|
|
5145
|
+
if (enclosingPackage) cancelAndExit(`Cannot scaffold inside existing package "${enclosingPackage.name}" (${enclosingPackage.path}). Use --directory to specify a different location`, 1);
|
|
5146
|
+
targetDir = cwdRelativeToRoot;
|
|
5147
|
+
}
|
|
5148
|
+
log$1.info(`Using package name: ${accent(packageName)}`);
|
|
5149
|
+
} else if (selectedTemplateName === BuiltinTemplate.monorepo) {
|
|
5150
|
+
const selected = await promptPackageNameAndTargetDir(getRandomProjectName({ fallbackName: "vite-plus-monorepo" }), options.interactive);
|
|
5151
|
+
packageName = selected.packageName;
|
|
5152
|
+
targetDir = selected.targetDir;
|
|
5153
|
+
} else {
|
|
5154
|
+
const selected = await promptPackageNameAndTargetDir(getRandomProjectName({
|
|
5155
|
+
scope: workspaceInfoOptional.monorepoScope,
|
|
5156
|
+
fallbackName: directScaffoldFallbackName
|
|
5157
|
+
}), options.interactive);
|
|
5158
|
+
packageName = selected.packageName;
|
|
5159
|
+
targetDir = selectedParentDir ? path.join(selectedParentDir, selected.targetDir).split(path.sep).join("/") : selected.targetDir;
|
|
5175
5160
|
}
|
|
5176
|
-
log$1.info(`Using package name: ${accent(packageName)}`);
|
|
5177
|
-
} else if (selectedTemplateName === BuiltinTemplate.monorepo) {
|
|
5178
|
-
const selected = await promptPackageNameAndTargetDir(getRandomProjectName({ fallbackName: "vite-plus-monorepo" }), options.interactive);
|
|
5179
|
-
packageName = selected.packageName;
|
|
5180
|
-
targetDir = selected.targetDir;
|
|
5181
|
-
} else {
|
|
5182
|
-
const selected = await promptPackageNameAndTargetDir(getRandomProjectName({
|
|
5183
|
-
scope: workspaceInfoOptional.monorepoScope,
|
|
5184
|
-
fallbackName: directScaffoldFallbackName
|
|
5185
|
-
}), options.interactive);
|
|
5186
|
-
packageName = selected.packageName;
|
|
5187
|
-
targetDir = selectedParentDir ? path.join(selectedParentDir, selected.targetDir).split(path.sep).join("/") : selected.targetDir;
|
|
5188
5161
|
}
|
|
5189
5162
|
if (options.packageManager && !Object.values(PackageManager).includes(options.packageManager)) {
|
|
5190
5163
|
const valid = Object.values(PackageManager).join(", ");
|
|
@@ -5223,7 +5196,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5223
5196
|
onCancel: () => cancelAndExit()
|
|
5224
5197
|
});
|
|
5225
5198
|
const shouldSetupGit = await resolveGitInit(options, isMonorepo);
|
|
5226
|
-
if (!isMonorepo) shouldSetupHooks = await promptGitHooks(options);
|
|
5199
|
+
if (!isMonorepo && (!options.interactive || shouldSetupGit || options.hooks === true)) shouldSetupHooks = await promptGitHooks(options);
|
|
5227
5200
|
const createProgress = options.interactive && compactOutput ? spinner({ indicator: "timer" }) : void 0;
|
|
5228
5201
|
let createProgressStarted = false;
|
|
5229
5202
|
let createProgressMessage = "Scaffolding project";
|
|
@@ -5293,19 +5266,6 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5293
5266
|
resumeCreateProgress();
|
|
5294
5267
|
}
|
|
5295
5268
|
if (templateInfo.command === BuiltinTemplate.monorepo || isBundledMonorepo) {
|
|
5296
|
-
let shouldInitGit = shouldSetupGit;
|
|
5297
|
-
if (options.interactive && !compactOutput && options.git === void 0) {
|
|
5298
|
-
pauseCreateProgress();
|
|
5299
|
-
const selected = await confirm({
|
|
5300
|
-
message: "Initialize git repository:",
|
|
5301
|
-
initialValue: true
|
|
5302
|
-
});
|
|
5303
|
-
resumeCreateProgress();
|
|
5304
|
-
if (isCancel(selected)) {
|
|
5305
|
-
log$1.info("Operation cancelled. Skipping git initialization");
|
|
5306
|
-
shouldInitGit = false;
|
|
5307
|
-
} else shouldInitGit = selected;
|
|
5308
|
-
} else if (shouldInitGit && !compactOutput) log$1.info("Initializing git repository (default: yes)");
|
|
5309
5269
|
updateCreateProgress("Creating monorepo");
|
|
5310
5270
|
await checkProjectDirExists(path.join(workspaceInfo.rootDir, targetDir), options.interactive);
|
|
5311
5271
|
const result = isBundledMonorepo ? await executeBundledTemplate(workspaceInfo, {
|
|
@@ -5328,18 +5288,9 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5328
5288
|
workspaceInfo.workspacePatterns = scaffoldedWorkspace.workspacePatterns;
|
|
5329
5289
|
workspaceInfo.parentDirs = scaffoldedWorkspace.parentDirs;
|
|
5330
5290
|
workspaceInfo.packages = scaffoldedWorkspace.packages;
|
|
5331
|
-
if (
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
cwd: fullPath
|
|
5335
|
-
});
|
|
5336
|
-
if (gitResult.status === 0) {
|
|
5337
|
-
if (!compactOutput) log$1.success("Git repository initialized");
|
|
5338
|
-
ensureDefaultGitignoreEntries(fullPath);
|
|
5339
|
-
} else {
|
|
5340
|
-
log$1.warn("Failed to initialize git repository");
|
|
5341
|
-
if (gitResult.stderr) log$1.info(gitResult.stderr.toString());
|
|
5342
|
-
}
|
|
5291
|
+
if (shouldSetupGit) {
|
|
5292
|
+
updateCreateProgress("Initializing git repository");
|
|
5293
|
+
if (await initGitRepository(fullPath)) ensureDefaultGitignoreEntries(fullPath);
|
|
5343
5294
|
}
|
|
5344
5295
|
updateCreateProgress("Writing agent instructions");
|
|
5345
5296
|
pauseCreateProgress();
|
|
@@ -5361,7 +5312,8 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5361
5312
|
editorId: selectedEditors,
|
|
5362
5313
|
interactive: options.interactive,
|
|
5363
5314
|
silent: compactOutput,
|
|
5364
|
-
extraVsCodeSettings: { "npm.scriptRunner": "vp" }
|
|
5315
|
+
extraVsCodeSettings: { "npm.scriptRunner": "vp" },
|
|
5316
|
+
packageManager
|
|
5365
5317
|
});
|
|
5366
5318
|
if (selectedEditors?.includes("vscode")) ensureGitignoreVsCodeEditorConfigs(fullPath);
|
|
5367
5319
|
resumeCreateProgress();
|
|
@@ -5369,10 +5321,6 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5369
5321
|
updateCreateProgress("Integrating monorepo");
|
|
5370
5322
|
const skipStagedMigration = shouldSkipStagedMigrationForHooks(fullPath, shouldSetupHooks, workspaceInfo.packageManager, workspaceInfo.packages);
|
|
5371
5323
|
rewriteMonorepo(workspaceInfo, skipStagedMigration, compactOutput);
|
|
5372
|
-
if (shouldSetupGit) {
|
|
5373
|
-
updateCreateProgress("Initializing git repository");
|
|
5374
|
-
if (await initGitRepository(fullPath)) ensureDefaultGitignoreEntries(fullPath);
|
|
5375
|
-
}
|
|
5376
5324
|
if (bundled?.monorepo) injectCreateDefaultTemplate(fullPath, bundled.scope, compactOutput);
|
|
5377
5325
|
if (shouldSetupHooks) installGitHooks(fullPath, compactOutput, void 0, workspaceInfo.packageManager, workspaceInfo.packages);
|
|
5378
5326
|
updateCreateProgress("Installing dependencies");
|
|
@@ -5479,12 +5427,13 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5479
5427
|
editorId: selectedEditors,
|
|
5480
5428
|
interactive: options.interactive,
|
|
5481
5429
|
silent: compactOutput,
|
|
5482
|
-
extraVsCodeSettings: { "npm.scriptRunner": "vp" }
|
|
5430
|
+
extraVsCodeSettings: { "npm.scriptRunner": "vp" },
|
|
5431
|
+
packageManager
|
|
5483
5432
|
});
|
|
5484
5433
|
if (selectedEditors?.includes("vscode")) ensureGitignoreVsCodeEditorConfigs(fullPath);
|
|
5485
5434
|
resumeCreateProgress();
|
|
5486
5435
|
}
|
|
5487
|
-
const shouldMigrateLintFmtTools = detectEslintProject(fullPath).hasDependency || detectPrettierProject(fullPath).hasDependency;
|
|
5436
|
+
const shouldMigrateLintFmtTools = detectEslintProject(fullPath).hasDependency || detectPrettierProject(fullPath).hasDependency || detectTsupProject(fullPath).hasDependency;
|
|
5488
5437
|
let installSummary;
|
|
5489
5438
|
const installAndMigrate = async (installCwd) => {
|
|
5490
5439
|
setPackageManager(fullPath, workspaceInfo.downloadPackageManager);
|
|
@@ -5501,10 +5450,11 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5501
5450
|
});
|
|
5502
5451
|
if (installSummary.status !== "installed") return;
|
|
5503
5452
|
if (installSummary.pendingBuilds && installSummary.pendingBuilds.length > 0) migratePendingBuilds = installSummary.pendingBuilds;
|
|
5504
|
-
updateCreateProgress("Migrating lint
|
|
5453
|
+
updateCreateProgress("Migrating lint, format & pack tools");
|
|
5505
5454
|
pauseCreateProgress();
|
|
5506
5455
|
await promptEslintMigration(fullPath, false);
|
|
5507
5456
|
await promptPrettierMigration(fullPath, false);
|
|
5457
|
+
await promptTsupMigration(fullPath, false, packageManager);
|
|
5508
5458
|
resumeCreateProgress();
|
|
5509
5459
|
};
|
|
5510
5460
|
if (isMonorepo) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-Bn-U8o4v.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { readFileSync } from "node:fs";
|
|
5
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
6
|
import { defineConfig, defineProject } from "vitest/config";
|
|
7
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.14_@tsdown+exe@0.22.14_@
|
|
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_4084c24f9f44f250d2b604ebc16f10f3/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,10 +37,10 @@ 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.
|
|
40
|
+
var version = "0.3.0", 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
|
-
VITEST_VERSION = "4.1.
|
|
43
|
+
VITEST_VERSION = "4.1.11";
|
|
44
44
|
process.env.VP_OVERRIDE_PACKAGES ? JSON.parse(process.env.VP_OVERRIDE_PACKAGES) : `${VITE_PLUS_VERSION}`;
|
|
45
45
|
(0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
46
46
|
process.versions.node, process.release.name;
|
package/dist/define-config.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_define_config = require("./define-config-
|
|
2
|
+
const require_define_config = require("./define-config-WiVlryJ2.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;
|
package/dist/define-config.js
CHANGED
|
@@ -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-
|
|
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-GXUdVT-0.js";
|
|
2
2
|
export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
|