vite-plus 1.0.0-rc.0 → 1.0.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 +3 -1
- package/binding/index.cjs +55 -54
- package/binding/index.d.cts +27 -4
- package/dist/{agent-Dinpyd-k.js → agent-CKMI1a8W.js} +2 -2
- package/dist/bin.js +32 -22
- package/dist/config/bin.js +3 -3
- package/dist/{constants-CiKwrA0v.js → constants-BqJiMVVU.js} +1 -1
- package/dist/create/bin.js +7 -7
- package/dist/{define-config-CBccpane.cjs → define-config-C_KGDLUZ.cjs} +7 -1
- package/dist/{define-config-B9usMnEa.d.ts → define-config-Cf_5GHmY.d.ts} +20 -15
- package/dist/{define-config-jhuYJ7Tb.js → define-config-DhEJaYRc.js} +8 -2
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/dist-BWiANxFS.js +8052 -0
- package/dist/{dist-BDYZP12R.js → dist-BsAzy8OW.js} +109 -105
- package/dist/{editor-DMBczTdj.js → editor-CHfGUhxP.js} +47 -13
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +13 -11
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BgsDA6ua.js → oxlint-plugin-config-lMMD5fAC.js} +1 -1
- package/dist/oxlint-plugin.js +2 -2
- package/dist/pack-bin.js +1 -1
- package/dist/{package-B85H2Nw0.js → package-Cgdlhamw.js} +1 -1
- package/dist/{prompts-CQobX7uP.js → prompts-jMH8S4Wp.js} +2 -3
- package/dist/{report-CK5TnTsr.js → report-NhQk8VHb.js} +1 -0
- package/dist/{resolve-vite-config-BUFUmi8h.js → resolve-vite-config-BJYYtfY3.js} +2 -2
- package/dist/{resolve-vite-config-I8fmpR7I.js → resolve-vite-config-BPgpYMYp.js} +1 -1
- package/dist/staged/bin.js +2 -2
- package/dist/sync-versions/bin.js +1 -2
- package/dist/toolchain.js +8 -8
- package/dist/toolchain.json +8 -8
- package/dist/{tsconfig-Buo0RSzz.js → tsconfig-BoYTBNX_.js} +2 -2
- package/dist/{tsconfig-C1VeTG9k.js → tsconfig-CmKidmRD.js} +1 -1
- package/dist/version.js +2 -2
- package/dist/versions.js +3 -3
- package/docs/config/fmt.md +3 -1
- package/docs/config/lint.md +3 -1
- package/docs/config/run.md +61 -25
- package/docs/guide/automatic-data-tracking.md +20 -15
- package/docs/guide/cache.md +12 -8
- package/docs/guide/fmt.md +4 -2
- package/docs/guide/lint.md +4 -2
- package/docs/guide/migrate-rules.md +42 -0
- package/docs/guide/migrate.md +4 -4
- package/docs/guide/monorepo.md +4 -2
- package/docs/guide/run.md +3 -1
- package/docs/guide/troubleshooting.md +1 -1
- package/package.json +12 -12
- package/dist/dist-Dqv1-Clg.js +0 -3
- package/dist/semver-CaDAb8vV.js +0 -1400
package/dist/create/bin.js
CHANGED
|
@@ -2,14 +2,14 @@ import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-CMFfr-1z.j
|
|
|
2
2
|
import { t as documentationUrl$1 } from "../documentation-DqcZSthV.js";
|
|
3
3
|
import { t as renderCliDoc } from "../help-BmKpeOP9.js";
|
|
4
4
|
import { a as muted, i as log, o as printHeader, r as formatDuration, s as success, t as accent } from "../terminal-MKGAuy-p.js";
|
|
5
|
-
import { u as VITE_PLUS_NAME } from "../constants-
|
|
5
|
+
import { u as VITE_PLUS_NAME } from "../constants-BqJiMVVU.js";
|
|
6
6
|
import { i as readJsonFile, n as editJsonFile } from "../json-JP24qHUF.js";
|
|
7
|
-
import { o as fetchNpmResource, r as getScopeFromPackageName, s as getNpmRegistry, t as checkNpmPackageExists } from "../package-
|
|
8
|
-
import { i as hasViteConfig, o as resolveViteConfig, r as findWorkspaceRoot, t as findViteConfig } from "../resolve-vite-config-
|
|
9
|
-
import { C as multiselect, D as text, E as spinner, O as require_picocolors, S as log$1, T as select, a as resolveGitInit, c as selectPackageManager, d as readYamlFile, h as resolveApproveBuildTargets, i as promptGitHooks, k as isCancel, 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, x as intro, y as PackageManager } from "../prompts-
|
|
10
|
-
import {
|
|
11
|
-
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-
|
|
12
|
-
import { B as addFrameworkShim, F as updateWorkspaceConfig, H as hasFrameworkShim, K as promptTsupMigration, L as findGitRoot, M as detectWorkspace$1, N as isBingoTemplate, P as updatePackageJsonWithDeps, R as initGitRepository, V as detectFramework, W as detectTsupProject, Y as detectPrettierProject, Z as promptPrettierMigration, _ as installGitHooks, a as selectEditors, b as injectCreateDefaultTemplate, c as rewriteMonorepoProject, et as detectEslintProject, h as setPackageManager, j as supportsCatalog, l as rewriteStandaloneProject, n as detectExistingEditors, o as writeEditorConfigs, rt as promptEslintMigration, s as rewriteMonorepo, y as shouldSkipStagedMigrationForHooks } from "../editor-
|
|
7
|
+
import { o as fetchNpmResource, r as getScopeFromPackageName, s as getNpmRegistry, t as checkNpmPackageExists } from "../package-Cgdlhamw.js";
|
|
8
|
+
import { i as hasViteConfig, o as resolveViteConfig, r as findWorkspaceRoot, t as findViteConfig } from "../resolve-vite-config-BJYYtfY3.js";
|
|
9
|
+
import { C as multiselect, D as text, E as spinner, O as require_picocolors, S as log$1, T as select, a as resolveGitInit, c as selectPackageManager, d as readYamlFile, h as resolveApproveBuildTargets, i as promptGitHooks, k as isCancel, 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, x as intro, y as PackageManager } from "../prompts-jMH8S4Wp.js";
|
|
10
|
+
import { n as require_semver } from "../dist-BWiANxFS.js";
|
|
11
|
+
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-CKMI1a8W.js";
|
|
12
|
+
import { B as addFrameworkShim, F as updateWorkspaceConfig, H as hasFrameworkShim, K as promptTsupMigration, L as findGitRoot, M as detectWorkspace$1, N as isBingoTemplate, P as updatePackageJsonWithDeps, R as initGitRepository, V as detectFramework, W as detectTsupProject, Y as detectPrettierProject, Z as promptPrettierMigration, _ as installGitHooks, a as selectEditors, b as injectCreateDefaultTemplate, c as rewriteMonorepoProject, et as detectEslintProject, h as setPackageManager, j as supportsCatalog, l as rewriteStandaloneProject, n as detectExistingEditors, o as writeEditorConfigs, rt as promptEslintMigration, s as rewriteMonorepo, y as shouldSkipStagedMigrationForHooks } from "../editor-CHfGUhxP.js";
|
|
13
13
|
import { n as runCommandSilently, t as runCommand$1 } from "../command-CguLh2KL.js";
|
|
14
14
|
import { t as unwrapCliParseOutcome } from "../cli-parse-DHE8NrBU.js";
|
|
15
15
|
import path from "node:path";
|
|
@@ -38,7 +38,7 @@ let node_path = require("node:path");
|
|
|
38
38
|
let node_url = require("node:url");
|
|
39
39
|
let vitest_config = require("vitest/config");
|
|
40
40
|
//#region package.json
|
|
41
|
-
var version = "1.0.0
|
|
41
|
+
var version = "1.0.0", VITE_PLUS_VERSION, VITEST_VERSION, CONFIG_METADATA_ENV;
|
|
42
42
|
var init_constants = __esmMin((() => {
|
|
43
43
|
VITE_PLUS_VERSION = process.env.VP_VERSION || version;
|
|
44
44
|
VITEST_VERSION = "5.0.1";
|
|
@@ -498,6 +498,12 @@ function injectPluginIntoConfig(config) {
|
|
|
498
498
|
if (config instanceof Promise) return config.then(injectPlugin);
|
|
499
499
|
return injectPlugin(config);
|
|
500
500
|
}
|
|
501
|
+
/**
|
|
502
|
+
* Keep a single generic signature so callback returns receive one contextual
|
|
503
|
+
* config type. Separate sync and async overloads make TypeScript widen nested
|
|
504
|
+
* literals in async callbacks before overload resolution (for example, an
|
|
505
|
+
* Oxlint rule severity of `'warn'` becomes `string`).
|
|
506
|
+
*/
|
|
501
507
|
function defineConfig(config) {
|
|
502
508
|
return (0, vitest_config.defineConfig)(injectPluginIntoConfig(config));
|
|
503
509
|
}
|
|
@@ -57,11 +57,17 @@ type Task = {
|
|
|
57
57
|
* direct workspace dependency that defines a `build` task.
|
|
58
58
|
*/
|
|
59
59
|
dependsOn?: Array<DependsOnEntry>;
|
|
60
|
-
} & ({
|
|
61
60
|
/**
|
|
62
|
-
* Whether to cache the task
|
|
61
|
+
* Whether and how to cache the task.
|
|
62
|
+
*
|
|
63
|
+
* - Omitted or `true`: caching enabled with default settings (same as `{}`)
|
|
64
|
+
* - `false`: caching disabled
|
|
65
|
+
* - Object: caching enabled with the given settings
|
|
63
66
|
*/
|
|
64
|
-
cache?:
|
|
67
|
+
cache?: TaskCache;
|
|
68
|
+
};
|
|
69
|
+
type TaskCache = boolean | TaskCacheConfig;
|
|
70
|
+
type TaskCacheConfig = {
|
|
65
71
|
/**
|
|
66
72
|
* Environment variable names to be fingerprinted and passed to the task.
|
|
67
73
|
*/
|
|
@@ -92,12 +98,7 @@ type Task = {
|
|
|
92
98
|
* - Negative patterns (e.g. `"!dist/cache/**"`) exclude matched files
|
|
93
99
|
*/
|
|
94
100
|
output?: Array<string | GlobWithBase | AutoTracking>;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Whether to cache the task
|
|
98
|
-
*/
|
|
99
|
-
cache: false;
|
|
100
|
-
});
|
|
101
|
+
};
|
|
101
102
|
type TaskDefinition = Task | Command;
|
|
102
103
|
type UserGlobalCacheConfig = boolean | {
|
|
103
104
|
/**
|
|
@@ -112,7 +113,8 @@ type UserGlobalCacheConfig = boolean | {
|
|
|
112
113
|
/**
|
|
113
114
|
* Global cache kill switch for task entries.
|
|
114
115
|
*
|
|
115
|
-
* When `false`, overrides all tasks to disable caching, even tasks with `cache: true
|
|
116
|
+
* When `false`, overrides all tasks to disable caching, even tasks with `cache: true`
|
|
117
|
+
* or a `cache` object.
|
|
116
118
|
* When `true`, respects each task's individual `cache` setting
|
|
117
119
|
* (each task's `cache` defaults to `true` if omitted).
|
|
118
120
|
*
|
|
@@ -287,6 +289,7 @@ type ViteUserConfigFnObject = (env: ConfigEnv) => UserConfig;
|
|
|
287
289
|
type ViteUserConfigFnPromise = (env: ConfigEnv) => Promise<UserConfig>;
|
|
288
290
|
type ViteUserConfigFn = (env: ConfigEnv) => UserConfig | Promise<UserConfig>;
|
|
289
291
|
type ViteUserConfigExport = UserConfig | Promise<UserConfig> | ViteUserConfigFnObject | ViteUserConfigFnPromise | ViteUserConfigFn;
|
|
292
|
+
type DefinedViteUserConfig<T extends ViteUserConfigExport> = T extends ViteUserConfigFnPromise ? ViteUserConfigFnPromise : T extends ViteUserConfigFnObject ? ViteUserConfigFnObject : T extends ViteUserConfigFn ? ViteUserConfigFn : T extends Promise<UserConfig> ? Promise<UserConfig> : UserConfig;
|
|
290
293
|
/**
|
|
291
294
|
* Match the `vitest` / `@vitest/*` family of bare specifiers — the imports a
|
|
292
295
|
* browser-mode Vite dev server must resolve. Any query string is stripped
|
|
@@ -374,11 +377,13 @@ declare function checkCoverageProviderVersion(coverage: {
|
|
|
374
377
|
};
|
|
375
378
|
readFile?: (path: string) => string;
|
|
376
379
|
}): void;
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
/**
|
|
381
|
+
* Keep a single generic signature so callback returns receive one contextual
|
|
382
|
+
* config type. Separate sync and async overloads make TypeScript widen nested
|
|
383
|
+
* literals in async callbacks before overload resolution (for example, an
|
|
384
|
+
* Oxlint rule severity of `'warn'` becomes `string`).
|
|
385
|
+
*/
|
|
386
|
+
declare function defineConfig$1<T extends ViteUserConfigExport>(config: T): DefinedViteUserConfig<T>;
|
|
382
387
|
/**
|
|
383
388
|
* `defineProject` counterpart of [[defineConfig]]. A migrated project config
|
|
384
389
|
* that uses `defineProject({ test: { browser: ... } })` — e.g. a file named by
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-
|
|
1
|
+
import { c as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-BqJiMVVU.js";
|
|
2
2
|
import { t as VITEST_RESOLVER_PACKAGES } from "./vitest-ecosystem-BU0AqZq-.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path, { resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
import { defineConfig, defineProject } from "vitest/config";
|
|
8
|
-
//#region ../../node_modules/.pnpm/tsdown@0.23.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.0_@tsdown+exe@0.23.0_@
|
|
8
|
+
//#region ../../node_modules/.pnpm/tsdown@0.23.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.0_@tsdown+exe@0.23.0_@type_540e13d22e6879071cae9cd3610e4dea/node_modules/tsdown/esm-shims.js
|
|
9
9
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
10
10
|
const getDirname = () => path.dirname(getFilename());
|
|
11
11
|
const __dirname = /* @__PURE__ */ getDirname();
|
|
@@ -523,6 +523,12 @@ function injectPluginIntoConfig(config) {
|
|
|
523
523
|
if (config instanceof Promise) return config.then(injectPlugin);
|
|
524
524
|
return injectPlugin(config);
|
|
525
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Keep a single generic signature so callback returns receive one contextual
|
|
528
|
+
* config type. Separate sync and async overloads make TypeScript widen nested
|
|
529
|
+
* literals in async callbacks before overload resolution (for example, an
|
|
530
|
+
* Oxlint rule severity of `'warn'` becomes `string`).
|
|
531
|
+
*/
|
|
526
532
|
function defineConfig$1(config) {
|
|
527
533
|
return defineConfig(injectPluginIntoConfig(config));
|
|
528
534
|
}
|
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-C_KGDLUZ.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.d.ts
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-Cf_5GHmY.js";
|
|
2
2
|
export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
|
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-DhEJaYRc.js";
|
|
2
2
|
export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
|