vite-plus 0.3.2 → 1.0.0-rc.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/LICENSE +35 -146
- package/README.md +3 -3
- package/binding/index.cjs +140 -55
- package/binding/index.d.cts +49 -0
- package/dist/{agent-C59HKB4Y.js → agent-Dinpyd-k.js} +6 -5
- package/dist/bin.js +48 -18
- package/dist/config/bin.js +2 -2
- package/dist/constants-CiKwrA0v.js +356 -0
- package/dist/create/bin.js +96 -71
- package/dist/{define-config-DPNEJxPz.d.ts → define-config-B9usMnEa.d.ts} +51 -10
- package/dist/{define-config-DpAPETDf.cjs → define-config-CBccpane.cjs} +173 -44
- package/dist/{define-config-DAaCa0U_.js → define-config-jhuYJ7Tb.js} +158 -42
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/documentation-DqcZSthV.js +11 -0
- package/dist/{editor-QOIGtmH4.js → editor-DMBczTdj.js} +216 -152
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-cULBl7Pi.js → json-JP24qHUF.js} +14 -6
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +3122 -15
- package/dist/{oxlint-plugin-config-BU42tr8y.js → oxlint-plugin-config-BgsDA6ua.js} +1 -1
- package/dist/oxlint-plugin.js +9 -7
- package/dist/pack-bin.js +1 -1
- package/dist/{package-BB-Jh_z3.js → package-B85H2Nw0.js} +6 -2
- package/dist/{vitest-ecosystem-BiRqcaRI.js → package-overrides-Dpn4scvN.js} +1 -7
- package/dist/{prompts-CujFOJXu.js → prompts-CQobX7uP.js} +2 -2
- package/dist/{resolve-vite-config-CHHjsjKJ.js → resolve-vite-config-BUFUmi8h.js} +2 -2
- package/dist/{resolve-vite-config-6Nox70uP.js → resolve-vite-config-I8fmpR7I.js} +1 -1
- package/dist/staged/bin.js +1205 -3317
- package/dist/sync-versions/bin.js +3 -2
- package/dist/sync-versions/bin.mjs +17 -2
- package/dist/test/browser/context.js +1 -1
- package/dist/test/browser/providers/playwright/context.js +1 -1
- package/dist/test/browser/providers/preview/context.js +1 -1
- package/dist/test/browser-playwright/context.js +1 -1
- package/dist/test/browser-preview/context.js +1 -1
- package/dist/test/context.d.ts +2 -942
- package/dist/test/context.js +1 -1
- package/dist/test/internal/traces.js +1 -0
- package/dist/test/locators.d.ts +2 -294
- package/dist/test/matchers.d.ts +2 -29
- package/dist/test/mocker.d.ts +2 -0
- package/dist/test/mocker.js +1 -0
- package/dist/test/{browser-webdriverio/context.js → plugins/browser-context.d.ts} +1 -0
- package/dist/test/plugins/browser-context.js +1 -1
- package/dist/test/plugins/browser-locators.d.ts +2 -0
- package/dist/test/plugins/browser-playwright.d.ts +2 -0
- package/dist/test/plugins/browser-preview.d.ts +2 -0
- package/dist/test/plugins/browser.d.ts +2 -0
- package/dist/test/plugins/mocker-automock.d.ts +2 -0
- package/dist/test/plugins/mocker-browser.d.ts +2 -0
- package/dist/test/plugins/mocker-node.d.ts +2 -0
- package/dist/test/plugins/mocker-redirect.d.ts +2 -0
- package/dist/test/plugins/mocker-register.d.ts +2 -0
- package/dist/test/plugins/mocker-transforms.d.ts +2 -0
- package/dist/test/plugins/mocker.d.ts +2 -0
- package/dist/test/plugins/pretty-format.d.ts +2 -0
- package/dist/test/plugins/snapshot-environment.d.ts +2 -0
- package/dist/test/plugins/snapshot-manager.d.ts +2 -0
- package/dist/test/plugins/snapshot.d.ts +2 -0
- package/dist/test/plugins/spy.d.ts +2 -0
- package/dist/test/plugins/utils-constants.d.ts +2 -0
- package/dist/test/plugins/utils-diff.d.ts +2 -0
- package/dist/test/plugins/utils-display.d.ts +2 -0
- package/dist/test/plugins/utils-error.d.ts +2 -0
- package/dist/test/plugins/utils-helpers.d.ts +2 -0
- package/dist/test/plugins/utils-offset.d.ts +2 -0
- package/dist/test/plugins/utils-resolver.d.ts +2 -0
- package/dist/test/plugins/utils-serialize.d.ts +2 -0
- package/dist/test/plugins/utils-source-map-node.d.ts +2 -0
- package/dist/test/plugins/utils-source-map.d.ts +2 -0
- package/dist/test/plugins/utils-timers.d.ts +2 -0
- package/dist/test/plugins/utils.d.ts +2 -0
- package/dist/toolchain.js +10 -10
- package/dist/toolchain.json +10 -10
- package/dist/{tsconfig-DCtWfQPA.js → tsconfig-Buo0RSzz.js} +8 -4
- package/dist/{tsconfig-MXktI3SX.js → tsconfig-C1VeTG9k.js} +1 -1
- package/dist/version.js +5 -3
- package/dist/versions.js +5 -5
- package/dist/vitest-ecosystem-BU0AqZq-.js +23 -0
- package/dist/vitest-v5-entry-points-DthU1e_O.js +25 -0
- package/docs/config/fmt.md +2 -2
- package/docs/config/lint.md +2 -2
- package/docs/config/run.md +1 -1
- package/docs/config/staged.md +1 -2
- package/docs/guide/check.md +2 -0
- package/docs/guide/ci.md +28 -31
- package/docs/guide/commit-hooks.md +18 -34
- package/docs/guide/create.md +1 -2
- package/docs/guide/docker.md +20 -68
- package/docs/guide/env.md +47 -32
- package/docs/guide/fmt.md +4 -2
- package/docs/guide/global-cli.md +426 -0
- package/docs/guide/ide-integration.md +1 -2
- package/docs/guide/implode.md +14 -1
- package/docs/guide/index.md +38 -35
- package/docs/guide/install.md +18 -20
- package/docs/guide/lint.md +6 -10
- package/docs/guide/local-cli.md +123 -0
- package/docs/guide/migrate-rules.md +104 -297
- package/docs/guide/migrate.md +82 -59
- package/docs/guide/monorepo.md +5 -1
- package/docs/guide/run.md +1 -1
- package/docs/guide/test.md +2 -0
- package/docs/guide/troubleshooting.md +6 -11
- package/docs/guide/upgrade-project.md +61 -0
- package/docs/guide/upgrade.md +17 -62
- package/docs/guide/vitest-v5.md +221 -0
- package/package.json +67 -90
- package/bin/oxfmt +0 -33
- package/bin/oxlint +0 -38
- package/dist/cli-truncate-Bg3RDXpi.js +0 -865
- package/dist/constants-IhOditRA.js +0 -80
- package/dist/is-fullwidth-code-point-BUNlIICg.js +0 -8
- package/dist/log-update-CoW8Z4Dl.js +0 -491
- package/dist/strip-ansi-C3wrWz9t.js +0 -853
- package/dist/test/browser/providers/webdriverio/context.d.ts +0 -1
- package/dist/test/browser/providers/webdriverio/context.js +0 -1
- package/dist/test/browser/providers/webdriverio.d.ts +0 -77
- package/dist/test/browser/providers/webdriverio.js +0 -1
- package/dist/test/browser-webdriverio/context.d.ts +0 -1
- package/dist/test/browser-webdriverio.d.ts +0 -77
- package/dist/test/browser-webdriverio.js +0 -1
- package/dist/test/coverage.d.ts +0 -2
- package/dist/test/coverage.js +0 -1
- package/dist/test/environments.d.ts +0 -2
- package/dist/test/environments.js +0 -1
- package/dist/test/plugins/browser-webdriverio.js +0 -1
- package/dist/test/plugins/expect.js +0 -1
- package/dist/test/plugins/runner-types.js +0 -1
- package/dist/test/plugins/runner-utils.js +0 -1
- package/dist/test/plugins/runner.js +0 -1
- package/dist/test/reporters.d.ts +0 -2
- package/dist/test/reporters.js +0 -1
- package/dist/test/runners.d.ts +0 -2
- package/dist/test/runners.js +0 -1
- package/dist/test/snapshot.d.ts +0 -2
- package/dist/test/snapshot.js +0 -1
- package/dist/test/suite.d.ts +0 -2
- package/dist/test/suite.js +0 -1
- package/dist/tsgolint-path-CbDReEOx.js +0 -34
- package/dist/tsgolint-path.d.ts +0 -7
- package/dist/tsgolint-path.js +0 -2
- package/dist/wrap-ansi-DNjkuBEp.js +0 -157
- package/dist/wrap-ansi-DUi52C6W.js +0 -2
- package/docs/guide/installer-env-vars.md +0 -286
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as rewriteDocumentationLinks } from "./documentation-DqcZSthV.js";
|
|
2
|
+
import { a as SETUP_VP_VERSION } from "./constants-CiKwrA0v.js";
|
|
3
|
+
import { C as multiselect, S as log, T as select, k as isCancel } from "./prompts-CQobX7uP.js";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { styleText } from "node:util";
|
|
5
6
|
import fs from "node:fs";
|
|
@@ -187,7 +188,7 @@ function updateExistingAgentInstructions(projectRoot) {
|
|
|
187
188
|
if (!targetPaths) return;
|
|
188
189
|
const templatePath = path.join(pkgRoot, "AGENTS.md");
|
|
189
190
|
if (!fs.existsSync(templatePath)) return;
|
|
190
|
-
const templateContent = fs.readFileSync(templatePath, "utf-8");
|
|
191
|
+
const templateContent = rewriteDocumentationLinks(fs.readFileSync(templatePath, "utf-8"));
|
|
191
192
|
for (const targetPath of targetPaths) try {
|
|
192
193
|
const fullPath = path.join(projectRoot, targetPath);
|
|
193
194
|
const existing = fs.readFileSync(fullPath, "utf-8");
|
|
@@ -271,7 +272,7 @@ async function detectAgentConflicts({ projectRoot, targetPaths }) {
|
|
|
271
272
|
if (!targetPaths || targetPaths.length === 0) return [];
|
|
272
273
|
const sourcePath = path.join(pkgRoot, "AGENTS.md");
|
|
273
274
|
if (!fs.existsSync(sourcePath)) return [];
|
|
274
|
-
const incomingContent = await fsPromises.readFile(sourcePath, "utf-8");
|
|
275
|
+
const incomingContent = rewriteDocumentationLinks(await fsPromises.readFile(sourcePath, "utf-8"));
|
|
275
276
|
const shouldLinkToAgents = targetPaths.includes(AGENT_STANDARD_PATH);
|
|
276
277
|
const conflicts = [];
|
|
277
278
|
const seenRealPaths = /* @__PURE__ */ new Set();
|
|
@@ -294,7 +295,7 @@ async function writeAgentInstructions({ projectRoot, targetPath, targetPaths, in
|
|
|
294
295
|
return;
|
|
295
296
|
}
|
|
296
297
|
const seenRealPaths = /* @__PURE__ */ new Set();
|
|
297
|
-
const incomingContent = await fsPromises.readFile(sourcePath, "utf-8");
|
|
298
|
+
const incomingContent = rewriteDocumentationLinks(await fsPromises.readFile(sourcePath, "utf-8"));
|
|
298
299
|
const shouldLinkToAgents = paths.includes(AGENT_STANDARD_PATH);
|
|
299
300
|
for (const targetPathToWrite of orderAgentTargetPaths(projectRoot, paths)) {
|
|
300
301
|
const destinationPath = path.join(projectRoot, targetPathToWrite);
|
package/dist/bin.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { t as documentationUrl$1 } from "./documentation-DqcZSthV.js";
|
|
1
2
|
import { t as renderCliDoc } from "./help-BmKpeOP9.js";
|
|
2
3
|
import { c as warnMsg, i as log, n as errorMsg, o as printHeader, t as accent } from "./terminal-MKGAuy-p.js";
|
|
3
|
-
import { g as resolveBundled, h as resolve$1, i as DEFAULT_ENVS, l as VITE_CONFIG_FILES, n as BASEURL_TSCONFIG_WARNING, r as CONFIG_METADATA_ENV, u as VITE_PLUS_NAME } from "./constants-
|
|
4
|
-
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-
|
|
5
|
-
import {
|
|
6
|
-
import { a as readNearestPackageJson } from "./package-BB-Jh_z3.js";
|
|
4
|
+
import { g as resolveBundled, h as resolve$1, i as DEFAULT_ENVS, l as VITE_CONFIG_FILES, n as BASEURL_TSCONFIG_WARNING, r as CONFIG_METADATA_ENV, u as VITE_PLUS_NAME } from "./constants-CiKwrA0v.js";
|
|
5
|
+
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-BgsDA6ua.js";
|
|
6
|
+
import { a as readNearestPackageJson } from "./package-B85H2Nw0.js";
|
|
7
7
|
import { t as cac } from "./dist-DfmT__Aw.js";
|
|
8
8
|
import { createRequire } from "node:module";
|
|
9
9
|
import path, { dirname, join, resolve } from "node:path";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
import { ensureBlockingStdio, hasConfigKey, mergeJsonConfig, run } from "../binding/index.js";
|
|
12
|
-
import fs, { existsSync, readFileSync } from "node:fs";
|
|
12
|
+
import fs, { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
13
13
|
//#region src/help.ts
|
|
14
14
|
const commandHelpDocs = {
|
|
15
15
|
dev: {
|
|
@@ -93,7 +93,7 @@ const commandHelpDocs = {
|
|
|
93
93
|
]
|
|
94
94
|
}
|
|
95
95
|
],
|
|
96
|
-
documentationUrl: "
|
|
96
|
+
documentationUrl: documentationUrl$1("/guide/dev")
|
|
97
97
|
},
|
|
98
98
|
build: {
|
|
99
99
|
usage: "vp build [ROOT] [OPTIONS]",
|
|
@@ -196,7 +196,7 @@ const commandHelpDocs = {
|
|
|
196
196
|
]
|
|
197
197
|
}
|
|
198
198
|
],
|
|
199
|
-
documentationUrl: "
|
|
199
|
+
documentationUrl: documentationUrl$1("/guide/build")
|
|
200
200
|
},
|
|
201
201
|
preview: {
|
|
202
202
|
usage: "vp preview [ROOT] [OPTIONS]",
|
|
@@ -267,7 +267,7 @@ const commandHelpDocs = {
|
|
|
267
267
|
lines: [" vp preview", " vp preview --port 4173"]
|
|
268
268
|
}
|
|
269
269
|
],
|
|
270
|
-
documentationUrl: "
|
|
270
|
+
documentationUrl: documentationUrl$1("/guide/build")
|
|
271
271
|
},
|
|
272
272
|
test: {
|
|
273
273
|
usage: "vp test [COMMAND] [FILTERS]... [OPTIONS]",
|
|
@@ -606,7 +606,7 @@ const commandHelpDocs = {
|
|
|
606
606
|
]
|
|
607
607
|
}
|
|
608
608
|
],
|
|
609
|
-
documentationUrl: "
|
|
609
|
+
documentationUrl: documentationUrl$1("/guide/test")
|
|
610
610
|
},
|
|
611
611
|
lint: {
|
|
612
612
|
usage: "vp lint [PATH]... [OPTIONS]",
|
|
@@ -843,7 +843,7 @@ const commandHelpDocs = {
|
|
|
843
843
|
]
|
|
844
844
|
}
|
|
845
845
|
],
|
|
846
|
-
documentationUrl: "
|
|
846
|
+
documentationUrl: documentationUrl$1("/guide/lint")
|
|
847
847
|
},
|
|
848
848
|
fmt: {
|
|
849
849
|
usage: "vp fmt [PATH]... [OPTIONS]",
|
|
@@ -916,7 +916,7 @@ const commandHelpDocs = {
|
|
|
916
916
|
]
|
|
917
917
|
}
|
|
918
918
|
],
|
|
919
|
-
documentationUrl: "
|
|
919
|
+
documentationUrl: documentationUrl$1("/guide/fmt")
|
|
920
920
|
},
|
|
921
921
|
check: {
|
|
922
922
|
usage: "vp check [OPTIONS] [PATHS]...",
|
|
@@ -967,7 +967,7 @@ const commandHelpDocs = {
|
|
|
967
967
|
]
|
|
968
968
|
}
|
|
969
969
|
],
|
|
970
|
-
documentationUrl: "
|
|
970
|
+
documentationUrl: documentationUrl$1("/guide/check")
|
|
971
971
|
},
|
|
972
972
|
pack: {
|
|
973
973
|
usage: "vp pack [...files] [OPTIONS]",
|
|
@@ -1146,7 +1146,7 @@ const commandHelpDocs = {
|
|
|
1146
1146
|
]
|
|
1147
1147
|
}
|
|
1148
1148
|
],
|
|
1149
|
-
documentationUrl: "
|
|
1149
|
+
documentationUrl: documentationUrl$1("/guide/pack")
|
|
1150
1150
|
},
|
|
1151
1151
|
run: {
|
|
1152
1152
|
usage: "vp run [OPTIONS] [TASK_SPECIFIER] [ADDITIONAL_ARGS]...",
|
|
@@ -1236,7 +1236,7 @@ const commandHelpDocs = {
|
|
|
1236
1236
|
]
|
|
1237
1237
|
}
|
|
1238
1238
|
],
|
|
1239
|
-
documentationUrl: "
|
|
1239
|
+
documentationUrl: documentationUrl$1("/guide/run")
|
|
1240
1240
|
},
|
|
1241
1241
|
exec: {
|
|
1242
1242
|
usage: "vp exec [OPTIONS] [COMMAND]...",
|
|
@@ -1321,7 +1321,7 @@ const commandHelpDocs = {
|
|
|
1321
1321
|
]
|
|
1322
1322
|
}
|
|
1323
1323
|
],
|
|
1324
|
-
documentationUrl: "
|
|
1324
|
+
documentationUrl: documentationUrl$1("/guide/vpx")
|
|
1325
1325
|
},
|
|
1326
1326
|
cache: {
|
|
1327
1327
|
usage: "vp cache <COMMAND>",
|
|
@@ -1339,7 +1339,7 @@ const commandHelpDocs = {
|
|
|
1339
1339
|
description: "Print help"
|
|
1340
1340
|
}]
|
|
1341
1341
|
}],
|
|
1342
|
-
documentationUrl: "
|
|
1342
|
+
documentationUrl: documentationUrl$1("/guide/cache")
|
|
1343
1343
|
}
|
|
1344
1344
|
};
|
|
1345
1345
|
function maybePrintCommandHelp(args) {
|
|
@@ -1517,7 +1517,7 @@ async function applyToolInitConfigToViteConfig(command, args, projectPath = proc
|
|
|
1517
1517
|
}
|
|
1518
1518
|
if (spec.configKey === "lint" && hasTriggerFlag(args, ["--init"])) {
|
|
1519
1519
|
const lintInitConfigPath = path.join(projectPath, ".vite-plus-lint-init.oxlintrc.json");
|
|
1520
|
-
const { fixBaseUrlInTsconfig, hasBaseUrlInTsconfig } = await import("./tsconfig-
|
|
1520
|
+
const { fixBaseUrlInTsconfig, hasBaseUrlInTsconfig } = await import("./tsconfig-C1VeTG9k.js");
|
|
1521
1521
|
await fixBaseUrlInTsconfig(projectPath);
|
|
1522
1522
|
const hasBaseUrl = hasBaseUrlInTsconfig(projectPath);
|
|
1523
1523
|
const initConfig = createDefaultVitePlusLintConfig({ includeTypeAwareDefaults: !hasBaseUrl });
|
|
@@ -1582,6 +1582,36 @@ async function doc() {
|
|
|
1582
1582
|
};
|
|
1583
1583
|
}
|
|
1584
1584
|
//#endregion
|
|
1585
|
+
//#region src/utils/tsgolint-path.ts
|
|
1586
|
+
function resolveWindowsTsgolintExecutable(pathCandidates, options) {
|
|
1587
|
+
let oxlintTsgolintPath = pathCandidates.find((p) => options.exists(p)) ?? "";
|
|
1588
|
+
if (!oxlintTsgolintPath && options.getRealpathCandidates) try {
|
|
1589
|
+
oxlintTsgolintPath = options.getRealpathCandidates().find((p) => options.exists(p)) ?? "";
|
|
1590
|
+
} catch {}
|
|
1591
|
+
if (!oxlintTsgolintPath) throw new Error("Unable to resolve oxlint-tsgolint executable, tried:\n" + pathCandidates.map((path) => `- ${path}`).join("\n"));
|
|
1592
|
+
return oxlintTsgolintPath;
|
|
1593
|
+
}
|
|
1594
|
+
function resolveTsgolintExecutable(tsgolintBinPath, scriptUrl) {
|
|
1595
|
+
if (process.platform !== "win32") return tsgolintBinPath;
|
|
1596
|
+
const scriptDir = dirname(fileURLToPath(scriptUrl));
|
|
1597
|
+
const localBinDir = join(scriptDir, "..", "node_modules", ".bin");
|
|
1598
|
+
const oxlintTsgolintPackagePath = dirname(dirname(tsgolintBinPath));
|
|
1599
|
+
const projectBinDir = join(oxlintTsgolintPackagePath, "..", ".bin");
|
|
1600
|
+
return resolveWindowsTsgolintExecutable([
|
|
1601
|
+
join(localBinDir, "tsgolint.exe"),
|
|
1602
|
+
join(localBinDir, "tsgolint.cmd"),
|
|
1603
|
+
join(projectBinDir, "tsgolint.exe"),
|
|
1604
|
+
join(projectBinDir, "tsgolint.cmd")
|
|
1605
|
+
], {
|
|
1606
|
+
exists: existsSync,
|
|
1607
|
+
getRealpathCandidates: () => {
|
|
1608
|
+
const realPkgDir = realpathSync(join(scriptDir, ".."));
|
|
1609
|
+
const realBinDir = join(dirname(realPkgDir), ".bin");
|
|
1610
|
+
return [join(realBinDir, "tsgolint.exe"), join(realBinDir, "tsgolint.cmd")];
|
|
1611
|
+
}
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
//#endregion
|
|
1585
1615
|
//#region src/resolve-lint.ts
|
|
1586
1616
|
/**
|
|
1587
1617
|
* Oxlint tool resolver for the vite-plus CLI.
|
|
@@ -1817,7 +1847,7 @@ else if (command === "hooks") await import("./hooks/bin.js");
|
|
|
1817
1847
|
else if (command === "--version" || command === "-V") await import("./version.js");
|
|
1818
1848
|
else if (command === "staged") await import("./staged/bin.js");
|
|
1819
1849
|
else try {
|
|
1820
|
-
const { resolveUniversalViteConfig } = await import("./resolve-vite-config-
|
|
1850
|
+
const { resolveUniversalViteConfig } = await import("./resolve-vite-config-I8fmpR7I.js");
|
|
1821
1851
|
const initInspection = inspectInitCommand(command, args.slice(1));
|
|
1822
1852
|
if (initInspection.handled && initInspection.configKey && initInspection.hasExistingConfigKey && initInspection.existingViteConfigPath) {
|
|
1823
1853
|
log(`Skipped initialization: '${accent(initInspection.configKey)}' already exists in '${accent(path.basename(initInspection.existingViteConfigPath))}'.`);
|
package/dist/config/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as log, n as errorMsg } from "../terminal-MKGAuy-p.js";
|
|
2
|
-
import { i as promptGitHooks, n as defaultInteractive } from "../prompts-
|
|
3
|
-
import { o as updateExistingAgentInstructions } from "../agent-
|
|
2
|
+
import { i as promptGitHooks, n as defaultInteractive } from "../prompts-CQobX7uP.js";
|
|
3
|
+
import { o as updateExistingAgentInstructions } from "../agent-Dinpyd-k.js";
|
|
4
4
|
import { t as require_dist } from "../dist-BDYZP12R.js";
|
|
5
5
|
import { a as install, c as resolveHooksLocation, o as isGitHooksEnvDisabled, s as isHooksUserDisabled } from "../hooks-C-4gykWR.js";
|
|
6
6
|
import { t as unwrapCliParseOutcome } from "../cli-parse-DHE8NrBU.js";
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region package.json
|
|
3
|
+
var version = "1.0.0-rc.0";
|
|
4
|
+
var exports = {
|
|
5
|
+
".": {
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"import": "./dist/index.js",
|
|
8
|
+
"require": "./dist/index.cjs"
|
|
9
|
+
},
|
|
10
|
+
"./client": { "types": "./dist/client.d.ts" },
|
|
11
|
+
"./module-runner": {
|
|
12
|
+
"types": "./dist/module-runner.d.ts",
|
|
13
|
+
"default": "./dist/module-runner.js"
|
|
14
|
+
},
|
|
15
|
+
"./internal": {
|
|
16
|
+
"types": "./dist/internal.d.ts",
|
|
17
|
+
"default": "./dist/internal.js"
|
|
18
|
+
},
|
|
19
|
+
"./dist/client/*": "./dist/client/*",
|
|
20
|
+
"./types/internal/*": null,
|
|
21
|
+
"./types/*": { "types": "./dist/types/*" },
|
|
22
|
+
"./bin": { "import": "./dist/bin.js" },
|
|
23
|
+
"./fmt": {
|
|
24
|
+
"types": "./dist/fmt.d.ts",
|
|
25
|
+
"import": "./dist/fmt.js"
|
|
26
|
+
},
|
|
27
|
+
"./lint": {
|
|
28
|
+
"types": "./dist/lint.d.ts",
|
|
29
|
+
"import": "./dist/lint.js"
|
|
30
|
+
},
|
|
31
|
+
"./lint/plugins": {
|
|
32
|
+
"types": "./dist/lint-plugins.d.ts",
|
|
33
|
+
"import": "./dist/lint-plugins.js",
|
|
34
|
+
"require": "./dist/lint-plugins.cjs"
|
|
35
|
+
},
|
|
36
|
+
"./lint/plugins-dev": {
|
|
37
|
+
"types": "./dist/lint-plugins-dev.d.ts",
|
|
38
|
+
"default": "./dist/lint-plugins-dev.js"
|
|
39
|
+
},
|
|
40
|
+
"./oxlint-plugin": {
|
|
41
|
+
"module-sync": "./dist/oxlint-plugin.js",
|
|
42
|
+
"node": "./dist/oxlint-plugin.js",
|
|
43
|
+
"import": "./dist/oxlint-plugin.js",
|
|
44
|
+
"default": "./dist/oxlint-plugin.js",
|
|
45
|
+
"types": "./dist/oxlint-plugin.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./package.json": "./package.json",
|
|
48
|
+
"./pack": {
|
|
49
|
+
"types": "./dist/pack.d.ts",
|
|
50
|
+
"import": "./dist/pack.js"
|
|
51
|
+
},
|
|
52
|
+
"./pack/client": { "types": "./dist/pack-client.d.ts" },
|
|
53
|
+
"./toolchain": {
|
|
54
|
+
"types": "./dist/toolchain.d.ts",
|
|
55
|
+
"default": "./dist/toolchain.js"
|
|
56
|
+
},
|
|
57
|
+
"./versions": {
|
|
58
|
+
"types": "./dist/versions.d.ts",
|
|
59
|
+
"default": "./dist/versions.js"
|
|
60
|
+
},
|
|
61
|
+
"./test": {
|
|
62
|
+
"import": {
|
|
63
|
+
"types": "./dist/test/index.d.ts",
|
|
64
|
+
"default": "./dist/test/index.js"
|
|
65
|
+
},
|
|
66
|
+
"require": {
|
|
67
|
+
"types": "./dist/test/index.d.cts",
|
|
68
|
+
"default": "./dist/test/index.cjs"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"./test/browser": {
|
|
72
|
+
"types": "./dist/test/browser.d.ts",
|
|
73
|
+
"default": "./dist/test/browser.js"
|
|
74
|
+
},
|
|
75
|
+
"./test/optional-types.js": { "types": "./dist/test/optional-types.js.d.ts" },
|
|
76
|
+
"./test/optional-runtime-types.js": { "types": "./dist/test/optional-runtime-types.js.d.ts" },
|
|
77
|
+
"./test/globals": { "types": "./dist/test/globals.d.ts" },
|
|
78
|
+
"./test/jsdom": { "types": "./dist/test/jsdom.d.ts" },
|
|
79
|
+
"./test/importMeta": { "types": "./dist/test/importMeta.d.ts" },
|
|
80
|
+
"./test/import-meta": { "types": "./dist/test/import-meta.d.ts" },
|
|
81
|
+
"./test/node": {
|
|
82
|
+
"types": "./dist/test/node.d.ts",
|
|
83
|
+
"default": "./dist/test/node.js"
|
|
84
|
+
},
|
|
85
|
+
"./test/internal/browser": {
|
|
86
|
+
"types": "./dist/test/internal/browser.d.ts",
|
|
87
|
+
"default": "./dist/test/internal/browser.js"
|
|
88
|
+
},
|
|
89
|
+
"./test/internal/traces": { "default": "./dist/test/internal/traces.js" },
|
|
90
|
+
"./test/config": {
|
|
91
|
+
"types": "./dist/test/config.d.ts",
|
|
92
|
+
"require": "./dist/test/config.cjs",
|
|
93
|
+
"default": "./dist/test/config.js"
|
|
94
|
+
},
|
|
95
|
+
"./test/runtime": {
|
|
96
|
+
"types": "./dist/test/runtime.d.ts",
|
|
97
|
+
"default": "./dist/test/runtime.js"
|
|
98
|
+
},
|
|
99
|
+
"./test/worker": {
|
|
100
|
+
"types": "./dist/test/worker.d.ts",
|
|
101
|
+
"default": "./dist/test/worker.js"
|
|
102
|
+
},
|
|
103
|
+
"./test/mocker": {
|
|
104
|
+
"types": "./dist/test/mocker.d.ts",
|
|
105
|
+
"default": "./dist/test/mocker.js"
|
|
106
|
+
},
|
|
107
|
+
"./test/browser-playwright": {
|
|
108
|
+
"types": "./dist/test/browser-playwright.d.ts",
|
|
109
|
+
"default": "./dist/test/browser-playwright.js"
|
|
110
|
+
},
|
|
111
|
+
"./test/browser/providers/playwright": {
|
|
112
|
+
"types": "./dist/test/browser/providers/playwright.d.ts",
|
|
113
|
+
"default": "./dist/test/browser/providers/playwright.js"
|
|
114
|
+
},
|
|
115
|
+
"./test/browser-playwright/context": {
|
|
116
|
+
"types": "./dist/test/browser-playwright/context.d.ts",
|
|
117
|
+
"default": "./dist/test/browser-playwright/context.js"
|
|
118
|
+
},
|
|
119
|
+
"./test/browser/providers/playwright/context": {
|
|
120
|
+
"types": "./dist/test/browser/providers/playwright/context.d.ts",
|
|
121
|
+
"default": "./dist/test/browser/providers/playwright/context.js"
|
|
122
|
+
},
|
|
123
|
+
"./test/browser-preview": {
|
|
124
|
+
"types": "./dist/test/browser-preview.d.ts",
|
|
125
|
+
"default": "./dist/test/browser-preview.js"
|
|
126
|
+
},
|
|
127
|
+
"./test/browser/providers/preview": {
|
|
128
|
+
"types": "./dist/test/browser/providers/preview.d.ts",
|
|
129
|
+
"default": "./dist/test/browser/providers/preview.js"
|
|
130
|
+
},
|
|
131
|
+
"./test/browser-preview/context": {
|
|
132
|
+
"types": "./dist/test/browser-preview/context.d.ts",
|
|
133
|
+
"default": "./dist/test/browser-preview/context.js"
|
|
134
|
+
},
|
|
135
|
+
"./test/browser/providers/preview/context": {
|
|
136
|
+
"types": "./dist/test/browser/providers/preview/context.d.ts",
|
|
137
|
+
"default": "./dist/test/browser/providers/preview/context.js"
|
|
138
|
+
},
|
|
139
|
+
"./test/browser/context": {
|
|
140
|
+
"types": "./dist/test/browser/context.d.ts",
|
|
141
|
+
"default": "./dist/test/browser/context.js"
|
|
142
|
+
},
|
|
143
|
+
"./test/client": { "default": "./dist/test/client.js" },
|
|
144
|
+
"./test/context": {
|
|
145
|
+
"types": "./dist/test/context.d.ts",
|
|
146
|
+
"default": "./dist/test/context.js"
|
|
147
|
+
},
|
|
148
|
+
"./test/locators": {
|
|
149
|
+
"types": "./dist/test/locators.d.ts",
|
|
150
|
+
"default": "./dist/test/locators.js"
|
|
151
|
+
},
|
|
152
|
+
"./test/matchers": {
|
|
153
|
+
"types": "./dist/test/matchers.d.ts",
|
|
154
|
+
"default": "./dist/test/matchers.js"
|
|
155
|
+
},
|
|
156
|
+
"./test/utils": { "default": "./dist/test/utils.js" },
|
|
157
|
+
"./test/browser-compat": {
|
|
158
|
+
"types": "./dist/test/browser-compat.d.ts",
|
|
159
|
+
"default": "./dist/test/browser-compat.js"
|
|
160
|
+
},
|
|
161
|
+
"./test/plugins/utils": {
|
|
162
|
+
"types": "./dist/test/plugins/utils.d.ts",
|
|
163
|
+
"default": "./dist/test/plugins/utils.js"
|
|
164
|
+
},
|
|
165
|
+
"./test/plugins/utils-source-map": {
|
|
166
|
+
"types": "./dist/test/plugins/utils-source-map.d.ts",
|
|
167
|
+
"default": "./dist/test/plugins/utils-source-map.js"
|
|
168
|
+
},
|
|
169
|
+
"./test/plugins/utils-source-map-node": {
|
|
170
|
+
"types": "./dist/test/plugins/utils-source-map-node.d.ts",
|
|
171
|
+
"default": "./dist/test/plugins/utils-source-map-node.js"
|
|
172
|
+
},
|
|
173
|
+
"./test/plugins/utils-error": {
|
|
174
|
+
"types": "./dist/test/plugins/utils-error.d.ts",
|
|
175
|
+
"default": "./dist/test/plugins/utils-error.js"
|
|
176
|
+
},
|
|
177
|
+
"./test/plugins/utils-helpers": {
|
|
178
|
+
"types": "./dist/test/plugins/utils-helpers.d.ts",
|
|
179
|
+
"default": "./dist/test/plugins/utils-helpers.js"
|
|
180
|
+
},
|
|
181
|
+
"./test/plugins/utils-display": {
|
|
182
|
+
"types": "./dist/test/plugins/utils-display.d.ts",
|
|
183
|
+
"default": "./dist/test/plugins/utils-display.js"
|
|
184
|
+
},
|
|
185
|
+
"./test/plugins/utils-timers": {
|
|
186
|
+
"types": "./dist/test/plugins/utils-timers.d.ts",
|
|
187
|
+
"default": "./dist/test/plugins/utils-timers.js"
|
|
188
|
+
},
|
|
189
|
+
"./test/plugins/utils-offset": {
|
|
190
|
+
"types": "./dist/test/plugins/utils-offset.d.ts",
|
|
191
|
+
"default": "./dist/test/plugins/utils-offset.js"
|
|
192
|
+
},
|
|
193
|
+
"./test/plugins/utils-resolver": {
|
|
194
|
+
"types": "./dist/test/plugins/utils-resolver.d.ts",
|
|
195
|
+
"default": "./dist/test/plugins/utils-resolver.js"
|
|
196
|
+
},
|
|
197
|
+
"./test/plugins/utils-serialize": {
|
|
198
|
+
"types": "./dist/test/plugins/utils-serialize.d.ts",
|
|
199
|
+
"default": "./dist/test/plugins/utils-serialize.js"
|
|
200
|
+
},
|
|
201
|
+
"./test/plugins/utils-constants": {
|
|
202
|
+
"types": "./dist/test/plugins/utils-constants.d.ts",
|
|
203
|
+
"default": "./dist/test/plugins/utils-constants.js"
|
|
204
|
+
},
|
|
205
|
+
"./test/plugins/utils-diff": {
|
|
206
|
+
"types": "./dist/test/plugins/utils-diff.d.ts",
|
|
207
|
+
"default": "./dist/test/plugins/utils-diff.js"
|
|
208
|
+
},
|
|
209
|
+
"./test/plugins/spy": {
|
|
210
|
+
"types": "./dist/test/plugins/spy.d.ts",
|
|
211
|
+
"default": "./dist/test/plugins/spy.js"
|
|
212
|
+
},
|
|
213
|
+
"./test/plugins/snapshot": {
|
|
214
|
+
"types": "./dist/test/plugins/snapshot.d.ts",
|
|
215
|
+
"default": "./dist/test/plugins/snapshot.js"
|
|
216
|
+
},
|
|
217
|
+
"./test/plugins/snapshot-environment": {
|
|
218
|
+
"types": "./dist/test/plugins/snapshot-environment.d.ts",
|
|
219
|
+
"default": "./dist/test/plugins/snapshot-environment.js"
|
|
220
|
+
},
|
|
221
|
+
"./test/plugins/snapshot-manager": {
|
|
222
|
+
"types": "./dist/test/plugins/snapshot-manager.d.ts",
|
|
223
|
+
"default": "./dist/test/plugins/snapshot-manager.js"
|
|
224
|
+
},
|
|
225
|
+
"./test/plugins/mocker": {
|
|
226
|
+
"types": "./dist/test/plugins/mocker.d.ts",
|
|
227
|
+
"default": "./dist/test/plugins/mocker.js"
|
|
228
|
+
},
|
|
229
|
+
"./test/plugins/mocker-node": {
|
|
230
|
+
"types": "./dist/test/plugins/mocker-node.d.ts",
|
|
231
|
+
"default": "./dist/test/plugins/mocker-node.js"
|
|
232
|
+
},
|
|
233
|
+
"./test/plugins/mocker-browser": {
|
|
234
|
+
"types": "./dist/test/plugins/mocker-browser.d.ts",
|
|
235
|
+
"default": "./dist/test/plugins/mocker-browser.js"
|
|
236
|
+
},
|
|
237
|
+
"./test/plugins/mocker-redirect": {
|
|
238
|
+
"types": "./dist/test/plugins/mocker-redirect.d.ts",
|
|
239
|
+
"default": "./dist/test/plugins/mocker-redirect.js"
|
|
240
|
+
},
|
|
241
|
+
"./test/plugins/mocker-transforms": {
|
|
242
|
+
"types": "./dist/test/plugins/mocker-transforms.d.ts",
|
|
243
|
+
"default": "./dist/test/plugins/mocker-transforms.js"
|
|
244
|
+
},
|
|
245
|
+
"./test/plugins/mocker-automock": {
|
|
246
|
+
"types": "./dist/test/plugins/mocker-automock.d.ts",
|
|
247
|
+
"default": "./dist/test/plugins/mocker-automock.js"
|
|
248
|
+
},
|
|
249
|
+
"./test/plugins/mocker-register": {
|
|
250
|
+
"types": "./dist/test/plugins/mocker-register.d.ts",
|
|
251
|
+
"default": "./dist/test/plugins/mocker-register.js"
|
|
252
|
+
},
|
|
253
|
+
"./test/plugins/pretty-format": {
|
|
254
|
+
"types": "./dist/test/plugins/pretty-format.d.ts",
|
|
255
|
+
"default": "./dist/test/plugins/pretty-format.js"
|
|
256
|
+
},
|
|
257
|
+
"./test/plugins/browser": {
|
|
258
|
+
"types": "./dist/test/plugins/browser.d.ts",
|
|
259
|
+
"default": "./dist/test/plugins/browser.js"
|
|
260
|
+
},
|
|
261
|
+
"./test/plugins/browser-context": {
|
|
262
|
+
"types": "./dist/test/plugins/browser-context.d.ts",
|
|
263
|
+
"default": "./dist/test/plugins/browser-context.js"
|
|
264
|
+
},
|
|
265
|
+
"./test/plugins/browser-client": { "default": "./dist/test/plugins/browser-client.js" },
|
|
266
|
+
"./test/plugins/browser-locators": {
|
|
267
|
+
"types": "./dist/test/plugins/browser-locators.d.ts",
|
|
268
|
+
"default": "./dist/test/plugins/browser-locators.js"
|
|
269
|
+
},
|
|
270
|
+
"./test/plugins/browser-playwright": {
|
|
271
|
+
"types": "./dist/test/plugins/browser-playwright.d.ts",
|
|
272
|
+
"default": "./dist/test/plugins/browser-playwright.js"
|
|
273
|
+
},
|
|
274
|
+
"./test/plugins/browser-preview": {
|
|
275
|
+
"types": "./dist/test/plugins/browser-preview.d.ts",
|
|
276
|
+
"default": "./dist/test/plugins/browser-preview.js"
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var engines = { "node": "^22.18.0 || ^24.11.0 || >=26.0.0" };
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/utils/constants.ts
|
|
282
|
+
const VITE_PLUS_NAME = "vite-plus";
|
|
283
|
+
const VITE_PLUS_VERSION = process.env.VP_VERSION || version;
|
|
284
|
+
const VITE_CONFIG_FILES = [
|
|
285
|
+
"vite.config.js",
|
|
286
|
+
"vite.config.mjs",
|
|
287
|
+
"vite.config.ts",
|
|
288
|
+
"vite.config.cjs",
|
|
289
|
+
"vite.config.mts",
|
|
290
|
+
"vite.config.cts"
|
|
291
|
+
];
|
|
292
|
+
const VITEST_VERSION = "5.0.1";
|
|
293
|
+
const SETUP_VP_VERSION = "v1.21.1";
|
|
294
|
+
const TSDOWN_MIGRATION_SKILL_URL = "https://github.com/rolldown/tsdown/blob/main/skills/tsdown-migrate/SKILL.md";
|
|
295
|
+
const VITE_PLUS_OVERRIDE_PACKAGES = process.env.VP_OVERRIDE_PACKAGES ? JSON.parse(process.env.VP_OVERRIDE_PACKAGES) : {
|
|
296
|
+
vite: `npm:@voidzero-dev/vite-plus-core@${VITE_PLUS_VERSION}`,
|
|
297
|
+
vitest: VITEST_VERSION
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Package-name patterns the migrator exempts from a package manager's
|
|
301
|
+
* "minimum release age" gate (pnpm `minimumReleaseAgeExclude` / Yarn
|
|
302
|
+
* `npmPreapprovedPackages`).
|
|
303
|
+
*
|
|
304
|
+
* Vite+ pins `vitest` to an exact, sometimes freshly published version, and the
|
|
305
|
+
* in-tree `@vitest/*` siblings install transitively at that same version, so an
|
|
306
|
+
* age gate would otherwise quarantine the Vite+-managed family and break
|
|
307
|
+
* `vp install`. The `@vitest/*` glob also covers the optional `@vitest/browser-*`
|
|
308
|
+
* peers the migrator pins for browser projects. This does NOT pin or manage any
|
|
309
|
+
* package — it only lets the chosen versions through the user's gate, including
|
|
310
|
+
* the `@vitest/coverage-*` version the coverage guard asks the user to align to
|
|
311
|
+
* the bundled vitest.
|
|
312
|
+
*/
|
|
313
|
+
const VITEST_AGE_GATE_EXEMPT_PACKAGES = ["vitest", "@vitest/*"];
|
|
314
|
+
/**
|
|
315
|
+
* When VP_FORCE_MIGRATE is set, force full dependency rewriting
|
|
316
|
+
* even for projects already using vite-plus. Used by ecosystem CI to
|
|
317
|
+
* override dependencies with locally built tgz packages.
|
|
318
|
+
*/
|
|
319
|
+
function isForceOverrideMode() {
|
|
320
|
+
return process.env.VP_FORCE_MIGRATE === "1";
|
|
321
|
+
}
|
|
322
|
+
const require = createRequire(import.meta.url);
|
|
323
|
+
function resolve(path) {
|
|
324
|
+
return require.resolve(path, { paths: [process.cwd(), import.meta.dirname] });
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Like {@link resolve}, but prefers the copy shipped with the CLI
|
|
328
|
+
* (`import.meta.dirname`) over the project's (`process.cwd()`).
|
|
329
|
+
*
|
|
330
|
+
* Use this for runtime modules that MUST match what `vite-plus/test*`
|
|
331
|
+
* imports resolve to — chiefly the Vitest runner binary. The `vite-plus/test`
|
|
332
|
+
* shims `export * from 'vitest'`, which Node resolves to vite-plus's own
|
|
333
|
+
* bundled (pinned) Vitest. If `vp test` instead spawned a project-local
|
|
334
|
+
* Vitest (a different physical copy/version), the runner and the imported
|
|
335
|
+
* `vi`/`expect`/runner internals would come from two distinct Vitest
|
|
336
|
+
* modules — a classic source of Vitest internal-state and mock-hoisting
|
|
337
|
+
* mismatches. `process.cwd()` stays as a fallback for layouts where the
|
|
338
|
+
* bundled copy is somehow unreachable, so this is never worse than {@link resolve}.
|
|
339
|
+
*/
|
|
340
|
+
function resolveBundled(path) {
|
|
341
|
+
return require.resolve(path, { paths: [import.meta.dirname, process.cwd()] });
|
|
342
|
+
}
|
|
343
|
+
const BASEURL_TSCONFIG_WARNING = "Skipped typeAware/typeCheck: a tsconfig file contains baseUrl which is not yet supported by the oxlint type checker.\n Run `vp dlx @andrewbranch/ts5to6 --fixBaseUrl <tsconfig path>` to remove baseUrl from your tsconfig.";
|
|
344
|
+
const BASEURL_TSCONFIG_FIX_PACKAGE = "@andrewbranch/ts5to6";
|
|
345
|
+
const BASEURL_TSCONFIG_FIX_FLAG = "--fixBaseUrl";
|
|
346
|
+
function createBaseUrlTsconfigFixArgs(target = ".") {
|
|
347
|
+
return [BASEURL_TSCONFIG_FIX_FLAG, target];
|
|
348
|
+
}
|
|
349
|
+
const DEFAULT_ENVS = {
|
|
350
|
+
JS_RUNTIME_VERSION: process.versions.node,
|
|
351
|
+
JS_RUNTIME_NAME: process.release.name,
|
|
352
|
+
NODE_PACKAGE_MANAGER: "vite-plus"
|
|
353
|
+
};
|
|
354
|
+
const CONFIG_METADATA_ENV = "VP_RESOLVING_CONFIG_METADATA";
|
|
355
|
+
//#endregion
|
|
356
|
+
export { engines as _, SETUP_VP_VERSION as a, VITEST_VERSION as c, VITE_PLUS_OVERRIDE_PACKAGES as d, VITE_PLUS_VERSION as f, resolveBundled as g, resolve as h, DEFAULT_ENVS as i, VITE_CONFIG_FILES as l, isForceOverrideMode as m, BASEURL_TSCONFIG_WARNING as n, TSDOWN_MIGRATION_SKILL_URL as o, createBaseUrlTsconfigFixArgs as p, CONFIG_METADATA_ENV as r, VITEST_AGE_GATE_EXEMPT_PACKAGES as s, BASEURL_TSCONFIG_FIX_PACKAGE as t, VITE_PLUS_NAME as u, exports as v, version as y };
|