vite-plus 0.2.9 → 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/README.md +4 -3
- package/binding/index.cjs +57 -54
- package/binding/index.d.cts +93 -0
- package/dist/{agent-DQU8uS6P.js → agent-Wqx0MPk0.js} +1 -1
- package/dist/bin.js +16 -6
- package/dist/command-CLJK5jGW.js +2 -0
- package/dist/command-CguLh2KL.js +471 -0
- package/dist/config/bin.js +7 -5
- package/dist/{constants-CG513DRa.js → constants-Bn-U8o4v.js} +5 -3
- package/dist/create/bin.js +28 -52
- package/dist/{define-config-CV4bQG_8.js → define-config-GXUdVT-0.js} +2 -2
- package/dist/{define-config-DyNLA_f0.cjs → define-config-WiVlryJ2.cjs} +2 -2
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{editor-g4PosU99.js → editor-CC4DqODz.js} +562 -59
- package/dist/{terminal-Bz-ps6rJ.js → help-BmKpeOP9.js} +1 -38
- package/dist/hooks/bin.js +3 -2
- package/dist/{hooks-pNCBWtFT.js → hooks-DFqViZqZ.js} +5 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/migration/bin.js +60 -11
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BEZ9IUf7.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-B4T8RGMG.js → package-CBe9EWPY.js} +2 -2
- package/dist/{prompts-CHz_98bJ.js → prompts-DF3yU-eU.js} +6 -474
- package/dist/{report-BS7ULx7A.js → report-ZNR1Mk6h.js} +1 -0
- package/dist/{resolve-vite-config-Dmeyeyj-.js → resolve-vite-config-ipGb39Jo.js} +2 -2
- package/dist/staged/bin.js +77 -47
- package/dist/terminal-MKGAuy-p.js +39 -0
- package/dist/toolchain.js +9 -9
- package/dist/toolchain.json +9 -9
- package/dist/tsconfig-BVHG3DpR.js +2 -0
- package/dist/{tsconfig-7v_BHagU.js → tsconfig-LD2QhQ0O.js} +5 -4
- package/dist/version.js +4 -3
- package/dist/versions.js +5 -5
- package/docs/guide/env.md +20 -6
- package/docs/guide/install.md +2 -1
- package/docs/guide/installer-env-vars.md +41 -5
- package/docs/guide/migrate-rules.md +9 -0
- package/docs/guide/migrate.md +5 -5
- package/docs/guide/test.md +8 -0
- package/docs/guide/upgrade.md +48 -1
- package/package.json +32 -33
- 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 -13
- 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 -20
- package/dist/{json-qlK6UH0r.js → json-cULBl7Pi.js} +107 -107
- package/dist/{log-update-CoW8Z4Dl.js → log-update-DHZRyJ2m.js} +1 -1
package/dist/create/bin.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-CMFfr-1z.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
21
|
//#region src/create/command.ts
|
|
20
|
-
var import_cross_spawn = /* @__PURE__ */ __toESM(require_cross_spawn(), 1);
|
|
21
22
|
async function runCommandAndDetectProjectDir(options, parentDir) {
|
|
22
23
|
const cwd = parentDir ? path.join(options.cwd, parentDir) : options.cwd;
|
|
23
24
|
const existingDirs = /* @__PURE__ */ new Set();
|
|
@@ -245,8 +246,7 @@ function _parseExtendedHeaders(data) {
|
|
|
245
246
|
//#endregion
|
|
246
247
|
//#region src/create/org-tarball.ts
|
|
247
248
|
function getCacheRoot() {
|
|
248
|
-
|
|
249
|
-
return path.join(home, "tmp", "create-org");
|
|
249
|
+
return path.join(getVpDirs().cache, "create-org");
|
|
250
250
|
}
|
|
251
251
|
/**
|
|
252
252
|
* Replace characters that are illegal in Windows path segments
|
|
@@ -4642,13 +4642,14 @@ function alignMonorepoTypeScriptVersion(workspaceRootPath, appProjectPath, libra
|
|
|
4642
4642
|
* scaffolded sub-package. After migration its scripts already use `vp ...` and
|
|
4643
4643
|
* nothing imports `'vite'` directly, so `vite-plus` provides them transitively.
|
|
4644
4644
|
*
|
|
4645
|
-
* pnpm is the exception and keeps them:
|
|
4646
|
-
*
|
|
4647
|
-
*
|
|
4648
|
-
*
|
|
4649
|
-
*
|
|
4650
|
-
*
|
|
4651
|
-
*
|
|
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.
|
|
4652
4653
|
*/
|
|
4653
4654
|
function dropAliasedRuntimeDevDeps(appProjectPath, packageManager) {
|
|
4654
4655
|
if (packageManager === PackageManager.pnpm) return;
|
|
@@ -5195,7 +5196,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5195
5196
|
onCancel: () => cancelAndExit()
|
|
5196
5197
|
});
|
|
5197
5198
|
const shouldSetupGit = await resolveGitInit(options, isMonorepo);
|
|
5198
|
-
if (!isMonorepo) shouldSetupHooks = await promptGitHooks(options);
|
|
5199
|
+
if (!isMonorepo && (!options.interactive || shouldSetupGit || options.hooks === true)) shouldSetupHooks = await promptGitHooks(options);
|
|
5199
5200
|
const createProgress = options.interactive && compactOutput ? spinner({ indicator: "timer" }) : void 0;
|
|
5200
5201
|
let createProgressStarted = false;
|
|
5201
5202
|
let createProgressMessage = "Scaffolding project";
|
|
@@ -5265,19 +5266,6 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5265
5266
|
resumeCreateProgress();
|
|
5266
5267
|
}
|
|
5267
5268
|
if (templateInfo.command === BuiltinTemplate.monorepo || isBundledMonorepo) {
|
|
5268
|
-
let shouldInitGit = shouldSetupGit;
|
|
5269
|
-
if (options.interactive && !compactOutput && options.git === void 0) {
|
|
5270
|
-
pauseCreateProgress();
|
|
5271
|
-
const selected = await confirm({
|
|
5272
|
-
message: "Initialize git repository:",
|
|
5273
|
-
initialValue: true
|
|
5274
|
-
});
|
|
5275
|
-
resumeCreateProgress();
|
|
5276
|
-
if (isCancel(selected)) {
|
|
5277
|
-
log$1.info("Operation cancelled. Skipping git initialization");
|
|
5278
|
-
shouldInitGit = false;
|
|
5279
|
-
} else shouldInitGit = selected;
|
|
5280
|
-
} else if (shouldInitGit && !compactOutput) log$1.info("Initializing git repository (default: yes)");
|
|
5281
5269
|
updateCreateProgress("Creating monorepo");
|
|
5282
5270
|
await checkProjectDirExists(path.join(workspaceInfo.rootDir, targetDir), options.interactive);
|
|
5283
5271
|
const result = isBundledMonorepo ? await executeBundledTemplate(workspaceInfo, {
|
|
@@ -5300,18 +5288,9 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5300
5288
|
workspaceInfo.workspacePatterns = scaffoldedWorkspace.workspacePatterns;
|
|
5301
5289
|
workspaceInfo.parentDirs = scaffoldedWorkspace.parentDirs;
|
|
5302
5290
|
workspaceInfo.packages = scaffoldedWorkspace.packages;
|
|
5303
|
-
if (
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
cwd: fullPath
|
|
5307
|
-
});
|
|
5308
|
-
if (gitResult.status === 0) {
|
|
5309
|
-
if (!compactOutput) log$1.success("Git repository initialized");
|
|
5310
|
-
ensureDefaultGitignoreEntries(fullPath);
|
|
5311
|
-
} else {
|
|
5312
|
-
log$1.warn("Failed to initialize git repository");
|
|
5313
|
-
if (gitResult.stderr) log$1.info(gitResult.stderr.toString());
|
|
5314
|
-
}
|
|
5291
|
+
if (shouldSetupGit) {
|
|
5292
|
+
updateCreateProgress("Initializing git repository");
|
|
5293
|
+
if (await initGitRepository(fullPath)) ensureDefaultGitignoreEntries(fullPath);
|
|
5315
5294
|
}
|
|
5316
5295
|
updateCreateProgress("Writing agent instructions");
|
|
5317
5296
|
pauseCreateProgress();
|
|
@@ -5342,10 +5321,6 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5342
5321
|
updateCreateProgress("Integrating monorepo");
|
|
5343
5322
|
const skipStagedMigration = shouldSkipStagedMigrationForHooks(fullPath, shouldSetupHooks, workspaceInfo.packageManager, workspaceInfo.packages);
|
|
5344
5323
|
rewriteMonorepo(workspaceInfo, skipStagedMigration, compactOutput);
|
|
5345
|
-
if (shouldSetupGit) {
|
|
5346
|
-
updateCreateProgress("Initializing git repository");
|
|
5347
|
-
if (await initGitRepository(fullPath)) ensureDefaultGitignoreEntries(fullPath);
|
|
5348
|
-
}
|
|
5349
5324
|
if (bundled?.monorepo) injectCreateDefaultTemplate(fullPath, bundled.scope, compactOutput);
|
|
5350
5325
|
if (shouldSetupHooks) installGitHooks(fullPath, compactOutput, void 0, workspaceInfo.packageManager, workspaceInfo.packages);
|
|
5351
5326
|
updateCreateProgress("Installing dependencies");
|
|
@@ -5458,7 +5433,7 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5458
5433
|
if (selectedEditors?.includes("vscode")) ensureGitignoreVsCodeEditorConfigs(fullPath);
|
|
5459
5434
|
resumeCreateProgress();
|
|
5460
5435
|
}
|
|
5461
|
-
const shouldMigrateLintFmtTools = detectEslintProject(fullPath).hasDependency || detectPrettierProject(fullPath).hasDependency;
|
|
5436
|
+
const shouldMigrateLintFmtTools = detectEslintProject(fullPath).hasDependency || detectPrettierProject(fullPath).hasDependency || detectTsupProject(fullPath).hasDependency;
|
|
5462
5437
|
let installSummary;
|
|
5463
5438
|
const installAndMigrate = async (installCwd) => {
|
|
5464
5439
|
setPackageManager(fullPath, workspaceInfo.downloadPackageManager);
|
|
@@ -5475,10 +5450,11 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
|
|
|
5475
5450
|
});
|
|
5476
5451
|
if (installSummary.status !== "installed") return;
|
|
5477
5452
|
if (installSummary.pendingBuilds && installSummary.pendingBuilds.length > 0) migratePendingBuilds = installSummary.pendingBuilds;
|
|
5478
|
-
updateCreateProgress("Migrating lint
|
|
5453
|
+
updateCreateProgress("Migrating lint, format & pack tools");
|
|
5479
5454
|
pauseCreateProgress();
|
|
5480
5455
|
await promptEslintMigration(fullPath, false);
|
|
5481
5456
|
await promptPrettierMigration(fullPath, false);
|
|
5457
|
+
await promptTsupMigration(fullPath, false, packageManager);
|
|
5482
5458
|
resumeCreateProgress();
|
|
5483
5459
|
};
|
|
5484
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
4
|
import { fileURLToPath } from "node:url";
|
|
5
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 };
|