vite-plus 0.1.24 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +30 -0
- package/README.md +8 -6
- package/bin/oxfmt +5 -2
- package/bin/oxlint +12 -2
- package/binding/index.cjs +84 -67
- package/binding/index.d.cts +155 -4
- package/dist/{agent-Nuk-9l77.js → agent--cKmgD_n.js} +941 -70
- package/dist/bin.js +22 -30
- package/dist/{compat-DXZgnEyq.js → compat-Cql3K40m.js} +1 -1
- package/dist/config/bin.js +30 -14
- package/dist/constants-CrfJQIUX.js +66 -0
- package/dist/create/bin.d.ts +6 -0
- package/dist/create/bin.js +508 -232
- package/dist/define-config-2tfJoXr1.d.ts +305 -0
- package/dist/define-config-BGSjF6Xp.cjs +488 -0
- package/dist/define-config-DJUehepE.js +445 -0
- package/dist/define-config.cjs +8 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +2 -2
- package/dist/dist-DRJUd9bL.js +3 -0
- package/dist/{dist-BgQuvbtq.js → dist-Oxo16Y0q.js} +4 -4
- package/dist/index.cjs +9 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{main-DpJl3LoU.js → json-Dn87fvjk.js} +137 -1
- package/dist/migration/bin.js +292 -76
- package/dist/{oxlint-plugin-config-B89iKTKN.js → oxlint-plugin-config-q8a5PFch.js} +1 -1
- package/dist/oxlint-plugin.js +11 -3
- package/dist/pack-bin.js +44 -15
- package/dist/{package-PmBUZ-ve.js → package-BHirM1_v.js} +3 -138
- package/dist/{report-DgSBQUdz.js → report-BHSkWqRR.js} +2 -0
- package/dist/{resolve-vite-config-TTvhycU1.js → resolve-vite-config-CmdsfQzS.js} +13 -4
- package/dist/staged/bin.js +5 -5
- package/dist/test/_at-vitest-browser/context.d.ts +2 -0
- package/dist/test/_at-vitest-browser.d.ts +2 -0
- package/dist/test/browser/context.d.ts +2 -2
- package/dist/test/browser/context.js +1 -1
- package/dist/test/browser/providers/playwright/context.d.ts +1 -0
- package/dist/test/browser/providers/playwright/context.js +1 -0
- package/dist/test/browser/providers/playwright.d.ts +124 -2
- package/dist/test/browser/providers/playwright.js +1 -1
- package/dist/test/browser/providers/preview/context.d.ts +1 -0
- package/dist/test/browser/providers/preview/context.js +1 -0
- package/dist/test/browser/providers/preview.d.ts +32 -2
- package/dist/test/browser/providers/preview.js +1 -1
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -0
- package/dist/test/browser/providers/webdriverio/context.js +1 -0
- package/dist/test/browser/providers/webdriverio.d.ts +77 -2
- package/dist/test/browser/providers/webdriverio.js +1 -1
- package/dist/test/browser-compat.d.ts +2 -0
- package/dist/test/browser-compat.js +1 -1
- package/dist/test/browser-playwright/context.d.ts +1 -0
- package/dist/test/browser-playwright/context.js +1 -0
- package/dist/test/browser-playwright.d.ts +124 -2
- package/dist/test/browser-playwright.js +1 -1
- package/dist/test/browser-preview/context.d.ts +1 -0
- package/dist/test/browser-preview/context.js +1 -0
- package/dist/test/browser-preview.d.ts +32 -2
- package/dist/test/browser-preview.js +1 -1
- package/dist/test/browser-webdriverio/context.d.ts +1 -0
- package/dist/test/browser-webdriverio/context.js +1 -0
- package/dist/test/browser-webdriverio.d.ts +77 -2
- package/dist/test/browser-webdriverio.js +1 -1
- package/dist/test/browser.d.ts +2 -2
- package/dist/test/browser.js +1 -1
- package/dist/test/client.js +1 -1
- package/dist/test/config.cjs +1 -1
- package/dist/test/config.d.ts +2 -2
- package/dist/test/config.js +1 -1
- package/dist/test/context.d.ts +942 -2
- package/dist/test/context.js +1 -1
- package/dist/test/coverage.d.ts +2 -2
- package/dist/test/coverage.js +1 -1
- package/dist/test/environments.d.ts +2 -2
- package/dist/test/environments.js +1 -1
- package/dist/test/globals.d.ts +2 -2
- package/dist/test/import-meta.d.ts +2 -2
- package/dist/test/importMeta.d.ts +2 -2
- package/dist/test/index.cjs +1 -1
- package/dist/test/index.d.cts +2 -2
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +1 -1
- package/dist/test/internal/browser.d.ts +2 -2
- package/dist/test/internal/browser.js +1 -1
- package/dist/test/jsdom.d.ts +2 -2
- package/dist/test/locators.d.ts +294 -0
- package/dist/test/locators.js +1 -1
- package/dist/test/matchers.d.ts +29 -0
- package/dist/test/matchers.js +1 -1
- package/dist/test/node.d.ts +2 -2
- package/dist/test/node.js +1 -1
- package/dist/test/optional-runtime-types.js.d.ts +2 -2
- package/dist/test/optional-types.js.d.ts +2 -2
- package/dist/test/plugins/browser-client.js +1 -1
- package/dist/test/plugins/browser-context.js +1 -1
- package/dist/test/plugins/browser-locators.js +1 -1
- package/dist/test/plugins/browser-playwright.js +1 -1
- package/dist/test/plugins/browser-preview.js +1 -1
- package/dist/test/plugins/browser-webdriverio.js +1 -1
- package/dist/test/plugins/browser.js +1 -1
- package/dist/test/plugins/expect.js +1 -1
- package/dist/test/plugins/mocker-automock.js +1 -1
- package/dist/test/plugins/mocker-browser.js +1 -1
- package/dist/test/plugins/mocker-node.js +1 -1
- package/dist/test/plugins/mocker-redirect.js +1 -1
- package/dist/test/plugins/mocker-register.js +1 -1
- package/dist/test/plugins/mocker-transforms.js +1 -1
- package/dist/test/plugins/mocker.js +1 -1
- package/dist/test/plugins/pretty-format.js +1 -1
- package/dist/test/plugins/runner-types.js +1 -1
- package/dist/test/plugins/runner-utils.js +1 -1
- package/dist/test/plugins/runner.js +1 -1
- package/dist/test/plugins/snapshot-environment.js +1 -1
- package/dist/test/plugins/snapshot-manager.js +1 -1
- package/dist/test/plugins/snapshot.js +1 -1
- package/dist/test/plugins/spy.js +1 -1
- package/dist/test/plugins/utils-constants.js +1 -1
- package/dist/test/plugins/utils-diff.js +1 -1
- package/dist/test/plugins/utils-display.js +1 -1
- package/dist/test/plugins/utils-error.js +1 -1
- package/dist/test/plugins/utils-helpers.js +1 -1
- package/dist/test/plugins/utils-offset.js +1 -1
- package/dist/test/plugins/utils-resolver.js +1 -1
- package/dist/test/plugins/utils-serialize.js +1 -1
- package/dist/test/plugins/utils-source-map-node.js +1 -1
- package/dist/test/plugins/utils-source-map.js +1 -1
- package/dist/test/plugins/utils-timers.js +1 -1
- package/dist/test/plugins/utils.js +1 -1
- package/dist/test/reporters.d.ts +2 -2
- package/dist/test/reporters.js +1 -1
- package/dist/test/runners.d.ts +2 -2
- package/dist/test/runners.js +1 -1
- package/dist/test/runtime.d.ts +2 -2
- package/dist/test/runtime.js +1 -1
- package/dist/test/snapshot.d.ts +2 -2
- package/dist/test/snapshot.js +1 -1
- package/dist/test/suite.d.ts +2 -2
- package/dist/test/suite.js +1 -1
- package/dist/test/utils.js +1 -1
- package/dist/test/worker.d.ts +2 -2
- package/dist/test/worker.js +1 -1
- package/dist/{tsconfig-DFb5BKyT.js → tsconfig-BWQPmGKz.js} +565 -231
- package/dist/tsgolint-path-B-yOos8p.js +32 -0
- package/dist/tsgolint-path.d.ts +8 -0
- package/dist/tsgolint-path.js +2 -0
- package/dist/version.js +3 -3
- package/dist/versions.d.ts +1 -1
- package/dist/versions.js +6 -6
- package/dist/{workspace-NL-m9wgM.js → workspace-D0AVy4fu.js} +11 -9
- package/docs/_data/team.ts +2 -1
- package/docs/config/create.md +36 -1
- package/docs/config/index.md +7 -5
- package/docs/guide/commit-hooks.md +9 -0
- package/docs/guide/create.md +106 -2
- package/docs/guide/env.md +33 -5
- package/docs/guide/index.md +5 -3
- package/docs/guide/install.md +31 -12
- package/docs/guide/migrate.md +13 -3
- package/docs/guide/troubleshooting.md +2 -2
- package/docs/guide/upgrade.md +26 -7
- package/docs/package.json +3 -3
- package/docs/pnpm-lock.yaml +298 -395
- package/package.json +103 -55
- package/templates/generator/bin/index.ts +6 -3
- package/templates/generator/package.json +2 -3
- package/templates/generator/src/template.ts +0 -2
- package/templates/monorepo/package.json +1 -1
- package/dist/constants-DCBWlNrn.js +0 -33
- package/dist/define-config-BR1Y88zz.cjs +0 -84
- package/dist/define-config-BRC7qPNE.js +0 -21
- package/dist/define-config-COdn-tsn.d.ts +0 -177
- package/dist/dist-Bapm49IR.js +0 -3
- package/dist/test/plugins/utils-highlight.js +0 -1
- /package/dist/{chunk-DnnnRqeS.js → rolldown-runtime-DnnnRqeS.js} +0 -0
package/dist/bin.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-
|
|
3
|
-
import {
|
|
1
|
+
import { d as resolve$1, f as resolveBundled, n as BASEURL_TSCONFIG_WARNING, o as VITE_PLUS_NAME, r as DEFAULT_ENVS } from "./constants-CrfJQIUX.js";
|
|
2
|
+
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-q8a5PFch.js";
|
|
3
|
+
import { I as runCommandSilently, i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-BWQPmGKz.js";
|
|
4
4
|
import { n as errorMsg, r as log, s as warnMsg, t as accent } from "./terminal-uTv0ZaMr.js";
|
|
5
|
-
import {
|
|
5
|
+
import { t as resolveTsgolintExecutable } from "./tsgolint-path-B-yOos8p.js";
|
|
6
|
+
import { i as resolveUniversalViteConfig } from "./resolve-vite-config-CmdsfQzS.js";
|
|
6
7
|
import path, { dirname, join } from "node:path";
|
|
7
8
|
import { hasConfigKey, mergeJsonConfig, run } from "../binding/index.js";
|
|
8
|
-
import fs, {
|
|
9
|
+
import fs, { readFileSync } from "node:fs";
|
|
9
10
|
import { fileURLToPath } from "node:url";
|
|
10
|
-
import { relative } from "node:path/win32";
|
|
11
11
|
//#region src/resolve-fmt.ts
|
|
12
12
|
/**
|
|
13
13
|
* Oxfmt tool resolver for the vite-plus CLI.
|
|
@@ -264,26 +264,7 @@ async function doc() {
|
|
|
264
264
|
*/
|
|
265
265
|
async function lint() {
|
|
266
266
|
const binPath = join(dirname(dirname(resolve$1("oxlint"))), "bin", "oxlint");
|
|
267
|
-
|
|
268
|
-
if (process.platform === "win32") {
|
|
269
|
-
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
270
|
-
const localBinDir = join(scriptDir, "..", "node_modules", ".bin");
|
|
271
|
-
const projectBinDir = join(dirname(dirname(oxlintTsgolintPath)), "..", ".bin");
|
|
272
|
-
const pathCandidates = [
|
|
273
|
-
join(localBinDir, "tsgolint.exe"),
|
|
274
|
-
join(localBinDir, "tsgolint.cmd"),
|
|
275
|
-
join(projectBinDir, "tsgolint.exe"),
|
|
276
|
-
join(projectBinDir, "tsgolint.cmd")
|
|
277
|
-
];
|
|
278
|
-
oxlintTsgolintPath = pathCandidates.find((p) => existsSync(p)) ?? "";
|
|
279
|
-
if (!oxlintTsgolintPath) try {
|
|
280
|
-
const realBinDir = join(dirname(realpathSync(join(scriptDir, ".."))), ".bin");
|
|
281
|
-
oxlintTsgolintPath = [join(realBinDir, "tsgolint.exe"), join(realBinDir, "tsgolint.cmd")].find((p) => existsSync(p)) ?? "";
|
|
282
|
-
} catch {}
|
|
283
|
-
if (!oxlintTsgolintPath) throw new Error("Unable to resolve oxlint-tsgolint executable, tried:\n" + pathCandidates.map((path) => `- ${path}`).join("\n"));
|
|
284
|
-
const relativePath = relative(process.cwd(), oxlintTsgolintPath);
|
|
285
|
-
oxlintTsgolintPath = /^[a-zA-Z]:/.test(relativePath) ? relativePath : `.\\${relativePath}`;
|
|
286
|
-
}
|
|
267
|
+
const oxlintTsgolintPath = resolveTsgolintExecutable(resolve$1("oxlint-tsgolint/bin/tsgolint"), import.meta.url);
|
|
287
268
|
return {
|
|
288
269
|
binPath,
|
|
289
270
|
envs: {
|
|
@@ -324,8 +305,10 @@ async function pack() {
|
|
|
324
305
|
* Vitest tool resolver for the vite-plus CLI.
|
|
325
306
|
*
|
|
326
307
|
* This module exports a function that resolves the Vitest binary path
|
|
327
|
-
* to the
|
|
328
|
-
*
|
|
308
|
+
* to the vitest package shipped with the CLI (falling back to the user's
|
|
309
|
+
* project copy only if the bundled one is unreachable). The resolved path
|
|
310
|
+
* is passed back to the Rust core, which then executes Vitest for running
|
|
311
|
+
* tests.
|
|
329
312
|
*
|
|
330
313
|
* Used for: `vite-plus test` command
|
|
331
314
|
*/
|
|
@@ -338,11 +321,20 @@ async function pack() {
|
|
|
338
321
|
*
|
|
339
322
|
* Vitest is Vite's testing framework that provides a Jest-compatible
|
|
340
323
|
* testing experience with Vite's fast HMR and transformation pipeline.
|
|
341
|
-
* The function
|
|
324
|
+
* The function resolves the bundled vitest shipped with the CLI first,
|
|
325
|
+
* so the runner matches the Vitest that `vite-plus/test*` imports resolve
|
|
326
|
+
* to; it falls back to the project copy only if the bundled one is
|
|
327
|
+
* unreachable. See `resolveBundled` for the rationale (avoiding dual-copy
|
|
328
|
+
* Vitest internal-state / mock-hoisting mismatches).
|
|
342
329
|
*/
|
|
343
330
|
async function test() {
|
|
331
|
+
const pkgJsonPath = resolveBundled("vitest/package.json");
|
|
332
|
+
const pkgRoot = dirname(pkgJsonPath);
|
|
333
|
+
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
|
|
334
|
+
const binRel = typeof pkgJson.bin === "string" ? pkgJson.bin : pkgJson.bin?.vitest;
|
|
335
|
+
if (!binRel) throw new Error(`Could not find 'vitest' bin entry in ${pkgJsonPath}`);
|
|
344
336
|
return {
|
|
345
|
-
binPath: join(
|
|
337
|
+
binPath: join(pkgRoot, binRel),
|
|
346
338
|
envs: process.env.DEBUG_DISABLE_SOURCE_MAP ? {
|
|
347
339
|
...DEFAULT_ENVS,
|
|
348
340
|
DEBUG_DISABLE_SOURCE_MAP: process.env.DEBUG_DISABLE_SOURCE_MAP
|
package/dist/config/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as promptGitHooks, l as defaultInteractive } from "../tsconfig-BWQPmGKz.js";
|
|
2
2
|
import { a as printHeader, r as log } from "../terminal-uTv0ZaMr.js";
|
|
3
3
|
import { t as lib_default } from "../lib-L3DWSRQp.js";
|
|
4
|
-
import {
|
|
4
|
+
import { E as hasStagedConfigInViteConfig, S as ensurePreCommitHook, o as updateExistingAgentInstructions } from "../agent--cKmgD_n.js";
|
|
5
5
|
import { t as renderCliDoc } from "../help-YP84FSEz.js";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -121,7 +121,11 @@ function install(dir = ".vite-hooks") {
|
|
|
121
121
|
//#region src/config/bin.ts
|
|
122
122
|
async function main() {
|
|
123
123
|
const args = lib_default(process.argv.slice(3), {
|
|
124
|
-
boolean: [
|
|
124
|
+
boolean: [
|
|
125
|
+
"help",
|
|
126
|
+
"hooks",
|
|
127
|
+
"agent"
|
|
128
|
+
],
|
|
125
129
|
string: ["hooks-dir"],
|
|
126
130
|
alias: { h: "help" }
|
|
127
131
|
});
|
|
@@ -132,13 +136,24 @@ async function main() {
|
|
|
132
136
|
documentationUrl: "https://viteplus.dev/guide/commit-hooks",
|
|
133
137
|
sections: [{
|
|
134
138
|
title: "Options",
|
|
135
|
-
rows: [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
rows: [
|
|
140
|
+
{
|
|
141
|
+
label: "--hooks-dir <path>",
|
|
142
|
+
description: "Custom hooks directory (default: .vite-hooks)"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: "--no-hooks",
|
|
146
|
+
description: "Skip hook installation"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
label: "--no-agent",
|
|
150
|
+
description: "Skip updating coding agent instructions"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
label: "-h, --help",
|
|
154
|
+
description: "Show this help message"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
142
157
|
}, {
|
|
143
158
|
title: "Environment",
|
|
144
159
|
rows: [{
|
|
@@ -152,15 +167,16 @@ async function main() {
|
|
|
152
167
|
return;
|
|
153
168
|
}
|
|
154
169
|
const dir = args["hooks-dir"];
|
|
155
|
-
const
|
|
170
|
+
const skipHooks = args.hooks === false;
|
|
171
|
+
const skipAgent = args.agent === false;
|
|
156
172
|
const interactive = defaultInteractive();
|
|
157
173
|
const lifecycleEvent = process.env.npm_lifecycle_event;
|
|
158
174
|
const isLifecycleScript = lifecycleEvent === "prepare" || lifecycleEvent === "postinstall";
|
|
159
175
|
const root = process.cwd();
|
|
160
176
|
const hooksDir = dir ?? ".vite-hooks";
|
|
161
177
|
const isFirstHooksRun = !existsSync(join(root, hooksDir, "_", "pre-commit"));
|
|
162
|
-
let shouldSetupHooks =
|
|
163
|
-
if (interactive && isFirstHooksRun && !dir && !isLifecycleScript && !hasStagedConfigInViteConfig(root)) shouldSetupHooks = await promptGitHooks({ interactive });
|
|
178
|
+
let shouldSetupHooks = !skipHooks;
|
|
179
|
+
if (shouldSetupHooks && interactive && isFirstHooksRun && !dir && !isLifecycleScript && !hasStagedConfigInViteConfig(root)) shouldSetupHooks = await promptGitHooks({ interactive });
|
|
164
180
|
if (shouldSetupHooks) {
|
|
165
181
|
const { message, isError } = install(dir);
|
|
166
182
|
if (message) {
|
|
@@ -169,7 +185,7 @@ async function main() {
|
|
|
169
185
|
}
|
|
170
186
|
if (!message) ensurePreCommitHook(root, hooksDir);
|
|
171
187
|
}
|
|
172
|
-
if (!
|
|
188
|
+
if (!skipAgent) updateExistingAgentInstructions(root);
|
|
173
189
|
}
|
|
174
190
|
main();
|
|
175
191
|
//#endregion
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region src/utils/constants.ts
|
|
3
|
+
const VITE_PLUS_NAME = "vite-plus";
|
|
4
|
+
const VITE_PLUS_VERSION = process.env.VP_VERSION || "latest";
|
|
5
|
+
const VITEST_VERSION = "4.1.9";
|
|
6
|
+
const VITE_PLUS_OVERRIDE_PACKAGES = process.env.VP_OVERRIDE_PACKAGES ? JSON.parse(process.env.VP_OVERRIDE_PACKAGES) : {
|
|
7
|
+
vite: "npm:@voidzero-dev/vite-plus-core@latest",
|
|
8
|
+
vitest: VITEST_VERSION
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Package-name patterns the migrator exempts from a package manager's
|
|
12
|
+
* "minimum release age" gate (pnpm `minimumReleaseAgeExclude` / Yarn
|
|
13
|
+
* `npmPreapprovedPackages`).
|
|
14
|
+
*
|
|
15
|
+
* Vite+ pins `vitest` to an exact, sometimes freshly published version, and the
|
|
16
|
+
* in-tree `@vitest/*` siblings install transitively at that same version, so an
|
|
17
|
+
* age gate would otherwise quarantine the Vite+-managed family and break
|
|
18
|
+
* `vp install`. The `@vitest/*` glob also covers the optional `@vitest/browser-*`
|
|
19
|
+
* peers the migrator pins for browser projects. This does NOT pin or manage any
|
|
20
|
+
* package — it only lets the chosen versions through the user's gate, including
|
|
21
|
+
* the `@vitest/coverage-*` version the coverage guard asks the user to align to
|
|
22
|
+
* the bundled vitest.
|
|
23
|
+
*/
|
|
24
|
+
const VITEST_AGE_GATE_EXEMPT_PACKAGES = ["vitest", "@vitest/*"];
|
|
25
|
+
/**
|
|
26
|
+
* When VP_FORCE_MIGRATE is set, force full dependency rewriting
|
|
27
|
+
* even for projects already using vite-plus. Used by ecosystem CI to
|
|
28
|
+
* override dependencies with locally built tgz packages.
|
|
29
|
+
*/
|
|
30
|
+
function isForceOverrideMode() {
|
|
31
|
+
return process.env.VP_FORCE_MIGRATE === "1";
|
|
32
|
+
}
|
|
33
|
+
const require = createRequire(import.meta.url);
|
|
34
|
+
function resolve(path) {
|
|
35
|
+
return require.resolve(path, { paths: [process.cwd(), import.meta.dirname] });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Like {@link resolve}, but prefers the copy shipped with the CLI
|
|
39
|
+
* (`import.meta.dirname`) over the project's (`process.cwd()`).
|
|
40
|
+
*
|
|
41
|
+
* Use this for runtime modules that MUST match what `vite-plus/test*`
|
|
42
|
+
* imports resolve to — chiefly the Vitest runner binary. The `vite-plus/test`
|
|
43
|
+
* shims `export * from 'vitest'`, which Node resolves to vite-plus's own
|
|
44
|
+
* bundled (pinned) Vitest. If `vp test` instead spawned a project-local
|
|
45
|
+
* Vitest (a different physical copy/version), the runner and the imported
|
|
46
|
+
* `vi`/`expect`/runner internals would come from two distinct Vitest
|
|
47
|
+
* modules — a classic source of Vitest internal-state and mock-hoisting
|
|
48
|
+
* mismatches. `process.cwd()` stays as a fallback for layouts where the
|
|
49
|
+
* bundled copy is somehow unreachable, so this is never worse than {@link resolve}.
|
|
50
|
+
*/
|
|
51
|
+
function resolveBundled(path) {
|
|
52
|
+
return require.resolve(path, { paths: [import.meta.dirname, process.cwd()] });
|
|
53
|
+
}
|
|
54
|
+
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.";
|
|
55
|
+
const BASEURL_TSCONFIG_FIX_PACKAGE = "@andrewbranch/ts5to6";
|
|
56
|
+
const BASEURL_TSCONFIG_FIX_FLAG = "--fixBaseUrl";
|
|
57
|
+
function createBaseUrlTsconfigFixArgs(target = ".") {
|
|
58
|
+
return [BASEURL_TSCONFIG_FIX_FLAG, target];
|
|
59
|
+
}
|
|
60
|
+
const DEFAULT_ENVS = {
|
|
61
|
+
JS_RUNTIME_VERSION: process.versions.node,
|
|
62
|
+
JS_RUNTIME_NAME: process.release.name,
|
|
63
|
+
NODE_PACKAGE_MANAGER: "vite-plus"
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { VITEST_VERSION as a, VITE_PLUS_VERSION as c, resolve as d, resolveBundled as f, VITEST_AGE_GATE_EXEMPT_PACKAGES as i, createBaseUrlTsconfigFixArgs as l, BASEURL_TSCONFIG_WARNING as n, VITE_PLUS_NAME as o, DEFAULT_ENVS as r, VITE_PLUS_OVERRIDE_PACKAGES as s, BASEURL_TSCONFIG_FIX_PACKAGE as t, isForceOverrideMode as u };
|
package/dist/create/bin.d.ts
CHANGED
|
@@ -7,8 +7,14 @@ interface Options {
|
|
|
7
7
|
verbose: boolean;
|
|
8
8
|
agent?: string | string[] | false;
|
|
9
9
|
editor?: string | false;
|
|
10
|
+
git?: boolean;
|
|
10
11
|
hooks?: boolean;
|
|
11
12
|
packageManager?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Approve and run gated dependency build scripts without prompting. Useful in
|
|
15
|
+
* non-interactive runs that need a ready-to-use project.
|
|
16
|
+
*/
|
|
17
|
+
approveBuilds?: boolean;
|
|
12
18
|
}
|
|
13
19
|
//#endregion
|
|
14
20
|
export { Options };
|