vite-plus 0.3.1 → 0.3.2
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 +1 -1
- package/bin/vp +1 -1
- package/binding/index.cjs +54 -55
- package/binding/index.d.cts +12 -0
- package/dist/{agent-C5jMYVfB.js → agent-C59HKB4Y.js} +2 -2
- package/dist/bin.js +6 -5
- package/dist/config/bin.js +2 -2
- package/dist/{constants-0IAVgpox.js → constants-IhOditRA.js} +2 -2
- package/dist/create/bin.js +19 -9
- package/dist/{define-config-U3_xg7i-.js → define-config-DAaCa0U_.js} +2 -2
- package/dist/{define-config-DIE9de46.cjs → define-config-DpAPETDf.cjs} +1 -1
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{editor-B5-lvRaU.js → editor-QOIGtmH4.js} +143 -36
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/lint-plugins-dev.d.ts +3 -0
- package/dist/lint-plugins-dev.js +2 -0
- package/dist/lint-plugins.cjs +21 -0
- package/dist/lint-plugins.d.ts +3 -0
- package/dist/lint-plugins.js +2 -0
- package/dist/migration/bin.js +7 -7
- package/dist/{oxlint-plugin-config-Drdl67Xp.js → oxlint-plugin-config-BU42tr8y.js} +1 -1
- package/dist/oxlint-plugin.js +93 -32
- package/dist/pack-bin.js +1 -1
- package/dist/{package-BZz2Ij68.js → package-BB-Jh_z3.js} +1 -1
- package/dist/{prompts-CtzEgFY-.js → prompts-CujFOJXu.js} +1 -1
- package/dist/{resolve-vite-config-Dnmc-lBc.js → resolve-vite-config-6Nox70uP.js} +1 -1
- package/dist/{resolve-vite-config-CGks1xR7.js → resolve-vite-config-CHHjsjKJ.js} +2 -2
- package/dist/staged/bin.js +1 -1
- package/dist/toolchain.js +8 -8
- package/dist/toolchain.json +8 -8
- package/dist/{tsconfig-CUggNuJR.js → tsconfig-DCtWfQPA.js} +2 -2
- package/dist/{tsconfig-VAbm4ZzJ.js → tsconfig-MXktI3SX.js} +1 -1
- package/dist/version.js +2 -2
- package/dist/versions.js +4 -4
- package/docs/config/fmt.md +4 -2
- package/docs/config/lint.md +4 -2
- package/docs/guide/env.md +29 -5
- package/docs/guide/fmt.md +3 -1
- package/docs/guide/install.md +1 -0
- package/docs/guide/installer-env-vars.md +35 -1
- package/docs/guide/lint.md +58 -1
- package/docs/guide/migrate-rules.md +38 -0
- package/docs/guide/migrate.md +1 -1
- package/docs/guide/monorepo.md +2 -0
- package/docs/guide/troubleshooting.md +14 -0
- package/package.json +23 -14
- package/templates/generator/README.md +14 -0
- package/templates/generator/bin/index.ts +54 -5
package/dist/create/bin.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-CMFfr-1z.js";
|
|
2
2
|
import { t as renderCliDoc } from "../help-BmKpeOP9.js";
|
|
3
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-
|
|
4
|
+
import { u as VITE_PLUS_NAME } from "../constants-IhOditRA.js";
|
|
5
5
|
import { i as readJsonFile, n as editJsonFile } from "../json-cULBl7Pi.js";
|
|
6
|
-
import { o as fetchNpmResource, r as getScopeFromPackageName, s as getNpmRegistry, t as checkNpmPackageExists } from "../package-
|
|
7
|
-
import { i as hasViteConfig, o as resolveViteConfig, r as findWorkspaceRoot, t as findViteConfig } from "../resolve-vite-config-
|
|
8
|
-
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-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { o as fetchNpmResource, r as getScopeFromPackageName, s as getNpmRegistry, t as checkNpmPackageExists } from "../package-BB-Jh_z3.js";
|
|
7
|
+
import { i as hasViteConfig, o as resolveViteConfig, r as findWorkspaceRoot, t as findViteConfig } from "../resolve-vite-config-CHHjsjKJ.js";
|
|
8
|
+
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-CujFOJXu.js";
|
|
9
|
+
import { t as require_semver } from "../semver-CaDAb8vV.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-C59HKB4Y.js";
|
|
11
|
+
import { F as addFrameworkShim, I as detectFramework, K as promptPrettierMigration, L as hasFrameworkShim, M as isBingoTemplate, N as updatePackageJsonWithDeps, P as updateWorkspaceConfig, Q as promptEslintMigration, S as injectCreateDefaultTemplate, V as promptTsupMigration, W as detectPrettierProject, Y as detectEslintProject, _ as installGitHooks, a as selectEditors, b as findGitRoot, c as rewriteMonorepoProject, h as setPackageManager, j as detectWorkspace$1, l as rewriteStandaloneProject, n as detectExistingEditors, o as writeEditorConfigs, s as rewriteMonorepo, x as initGitRepository, y as shouldSkipStagedMigrationForHooks, z as detectTsupProject } from "../editor-QOIGtmH4.js";
|
|
11
12
|
import { n as runCommandSilently, t as runCommand$1 } from "../command-CguLh2KL.js";
|
|
12
13
|
import { t as unwrapCliParseOutcome } from "../cli-parse-DHE8NrBU.js";
|
|
13
14
|
import path from "node:path";
|
|
@@ -96,6 +97,7 @@ function prependToPathToEnvs(extraPath, envs) {
|
|
|
96
97
|
}
|
|
97
98
|
//#endregion
|
|
98
99
|
//#region ../../node_modules/.pnpm/nanotar@0.3.0/node_modules/nanotar/dist/index.mjs
|
|
100
|
+
var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
|
|
99
101
|
const tarItemTypeMap = {
|
|
100
102
|
"0": "file",
|
|
101
103
|
"1": "hardLink",
|
|
@@ -263,10 +265,16 @@ function sanitizeHostForPath(host) {
|
|
|
263
265
|
* (via `.npmrc` scope mappings) don't share a cache slot. The registry
|
|
264
266
|
* guarantees `manifest.tarballUrl` is a valid URL, so any parse failure
|
|
265
267
|
* here is a real bug worth surfacing.
|
|
268
|
+
*
|
|
269
|
+
* Require a strict descendant of `cacheRoot` so sibling staging directories
|
|
270
|
+
* stay inside the cache, even if a caller skips `readOrgManifest` validation.
|
|
266
271
|
*/
|
|
267
|
-
function
|
|
272
|
+
function resolveExtractionDir(cacheRoot, manifest) {
|
|
268
273
|
const { host } = new URL(manifest.tarballUrl);
|
|
269
|
-
|
|
274
|
+
const resolvedRoot = path.resolve(cacheRoot);
|
|
275
|
+
const resolvedDir = path.resolve(resolvedRoot, sanitizeHostForPath(host), manifest.scope, "create", manifest.version);
|
|
276
|
+
if (!resolvedDir.startsWith(`${resolvedRoot}${path.sep}`)) throw new Error(`org template extraction path escapes the cache root: ${manifest.version}`);
|
|
277
|
+
return resolvedDir;
|
|
270
278
|
}
|
|
271
279
|
function parseIntegrity(integrity) {
|
|
272
280
|
const match = integrity.split(/\s+/)[0].match(/^(sha\d+)-(.+)$/);
|
|
@@ -446,7 +454,7 @@ async function cleanupStaleStagingDirs(destDir) {
|
|
|
446
454
|
* cleans up and returns the existing directory.
|
|
447
455
|
*/
|
|
448
456
|
async function ensureOrgPackageExtracted(manifest) {
|
|
449
|
-
const extractedRoot =
|
|
457
|
+
const extractedRoot = resolveExtractionDir(getCacheRoot(), manifest);
|
|
450
458
|
if (fs.existsSync(path.join(extractedRoot, "package.json"))) return extractedRoot;
|
|
451
459
|
const parent = path.dirname(extractedRoot);
|
|
452
460
|
await fs.promises.mkdir(parent, { recursive: true });
|
|
@@ -668,6 +676,7 @@ async function readOrgManifest(scope, requestedVersion) {
|
|
|
668
676
|
resolvedVersion = packument["dist-tags"]?.latest;
|
|
669
677
|
if (!resolvedVersion) return null;
|
|
670
678
|
}
|
|
679
|
+
if (import_semver.default.valid(resolvedVersion) === null) throw new OrgManifestSchemaError(`invalid version "${resolvedVersion}" (expected a semantic version)`, packageName);
|
|
671
680
|
const meta = packument.versions?.[resolvedVersion];
|
|
672
681
|
if (!meta) return null;
|
|
673
682
|
let templates = validateManifest(meta, packageName);
|
|
@@ -783,6 +792,7 @@ function discoverTemplate(templateName, templateArgs, workspaceInfo, interactive
|
|
|
783
792
|
if (isBingoTemplate(pkg)) {
|
|
784
793
|
type = TemplateType.bingo;
|
|
785
794
|
args.push("--skip-requests");
|
|
795
|
+
envs.VP_CREATE_INTERACTIVE = interactive === false ? "0" : "1";
|
|
786
796
|
}
|
|
787
797
|
return {
|
|
788
798
|
command: "node",
|
|
@@ -1,10 +1,10 @@
|
|
|
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-IhOditRA.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.23.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.0_@tsdown+exe@0.23.0_@
|
|
7
|
+
//#region ../../node_modules/.pnpm/tsdown@0.23.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.0_@tsdown+exe@0.23.0_@type_298964156353ef75a02894ab80b3a2e6/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,7 +37,7 @@ 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.3.
|
|
40
|
+
var version = "0.3.2", 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
43
|
VITEST_VERSION = "4.1.11";
|
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-DpAPETDf.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-DAaCa0U_.js";
|
|
2
2
|
export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { r as __toESM } from "./rolldown-runtime-CMFfr-1z.js";
|
|
2
|
-
import { a as SETUP_VP_VERSION, c as VITEST_VERSION, d as VITE_PLUS_OVERRIDE_PACKAGES, f as VITE_PLUS_VERSION, l as VITE_CONFIG_FILES, m as isForceOverrideMode, n as BASEURL_TSCONFIG_WARNING, o as TSDOWN_MIGRATION_SKILL_URL, s as VITEST_AGE_GATE_EXEMPT_PACKAGES, u as VITE_PLUS_NAME } from "./constants-
|
|
3
|
-
import { i as ensureVitePlusImportRuleDefaults, r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-
|
|
2
|
+
import { a as SETUP_VP_VERSION, c as VITEST_VERSION, d as VITE_PLUS_OVERRIDE_PACKAGES, f as VITE_PLUS_VERSION, l as VITE_CONFIG_FILES, m as isForceOverrideMode, n as BASEURL_TSCONFIG_WARNING, o as TSDOWN_MIGRATION_SKILL_URL, s as VITEST_AGE_GATE_EXEMPT_PACKAGES, u as VITE_PLUS_NAME } from "./constants-IhOditRA.js";
|
|
3
|
+
import { i as ensureVitePlusImportRuleDefaults, r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-BU42tr8y.js";
|
|
4
4
|
import { a as writeJsonFile, c as parse, i as readJsonFile, n as editJsonFile, o as applyEdits, r as isJsonFile, s as modify, t as detectFormattingOptions } from "./json-cULBl7Pi.js";
|
|
5
|
-
import { n as detectPackageMetadata, r as getScopeFromPackageName } from "./package-
|
|
6
|
-
import { C as multiselect, S as log, T as select, _ as getSpinner, b as confirm, d as readYamlFile, f as scalarString, g as getSilentSpinner, k as isCancel, t as cancelAndExit, u as editYamlFile, y as PackageManager } from "./prompts-
|
|
5
|
+
import { n as detectPackageMetadata, r as getScopeFromPackageName } from "./package-BB-Jh_z3.js";
|
|
6
|
+
import { C as multiselect, S as log, T as select, _ as getSpinner, b as confirm, d as readYamlFile, f as scalarString, g as getSilentSpinner, k as isCancel, t as cancelAndExit, u as editYamlFile, y as PackageManager } from "./prompts-CujFOJXu.js";
|
|
7
7
|
import { t as require_semver } from "./semver-CaDAb8vV.js";
|
|
8
|
-
import { l as displayRelative, u as rulesDir } from "./agent-
|
|
8
|
+
import { l as displayRelative, u as rulesDir } from "./agent-C59HKB4Y.js";
|
|
9
9
|
import { n as addMigrationWarning, t as addManualStep } from "./report-CK5TnTsr.js";
|
|
10
10
|
import { n as runCommandSilently, r as require_cross_spawn } from "./command-CguLh2KL.js";
|
|
11
11
|
import { t as require_dist } from "./dist-BDYZP12R.js";
|
|
12
|
-
import { a as hasBaseUrlInTsconfig, c as hasVitestTypesInTsconfig, l as removeDeprecatedTsconfigFalseOption, n as findTsconfigFiles, s as hasTypesToRewriteInTsconfig, u as rewriteTypesInTsconfig } from "./tsconfig-
|
|
12
|
+
import { a as hasBaseUrlInTsconfig, c as hasVitestTypesInTsconfig, l as removeDeprecatedTsconfigFalseOption, n as findTsconfigFiles, s as hasTypesToRewriteInTsconfig, u as rewriteTypesInTsconfig } from "./tsconfig-DCtWfQPA.js";
|
|
13
13
|
import { n as extractOverrideTargetName, t as isAlignableVitestEcosystemPackage } from "./vitest-ecosystem-BiRqcaRI.js";
|
|
14
14
|
import { i as findUnsafeHookInstallPath, t as SUPPORTED_GIT_HOOK_NAMES } from "./hooks-C-4gykWR.js";
|
|
15
15
|
import path, { posix, win32 } from "node:path";
|
|
@@ -62,13 +62,14 @@ const BROWSER_PROVIDER_PEER_DEPS = {
|
|
|
62
62
|
"@vitest/browser-playwright": "playwright",
|
|
63
63
|
"@vitest/browser-webdriverio": "webdriverio"
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
webdriverio: ["@wdio/cli", "@wdio/globals"]
|
|
68
|
-
};
|
|
65
|
+
const RUNTIME_PEER_INCLUDED_BY = { playwright: ["@playwright/test"] };
|
|
66
|
+
const PROVIDER_PEER_VERSION_SIBLINGS = { webdriverio: ["@wdio/cli", "@wdio/globals"] };
|
|
69
67
|
function findDeclaredSpec(pkg, name) {
|
|
70
68
|
return pkg.dependencies?.[name] ?? pkg.devDependencies?.[name] ?? pkg.peerDependencies?.[name] ?? pkg.optionalDependencies?.[name];
|
|
71
69
|
}
|
|
70
|
+
function hasProviderPeerDependency(pkg, runtimePeer) {
|
|
71
|
+
return findDeclaredSpec(pkg, runtimePeer) !== void 0 || (RUNTIME_PEER_INCLUDED_BY[runtimePeer] ?? []).some((packageName) => findDeclaredSpec(pkg, packageName) !== void 0);
|
|
72
|
+
}
|
|
72
73
|
function resolveProviderPeerSpec(pkg, peer, supportCatalog, catalogDependencyResolver) {
|
|
73
74
|
if (supportCatalog && catalogDependencyResolver?.("catalog:", peer) !== void 0) return "catalog:";
|
|
74
75
|
for (const sibling of PROVIDER_PEER_VERSION_SIBLINGS[peer] ?? []) {
|
|
@@ -175,6 +176,24 @@ function pnpmMajor(version) {
|
|
|
175
176
|
const coerced = version ? import_semver.default.coerce(version)?.version : void 0;
|
|
176
177
|
return coerced ? import_semver.default.major(coerced) : void 0;
|
|
177
178
|
}
|
|
179
|
+
const OXLINT_PLUGINS_PACKAGE = "@oxlint/plugins";
|
|
180
|
+
const OXLINT_PLUGIN_API_PACKAGES = ["oxlint", OXLINT_PLUGINS_PACKAGE];
|
|
181
|
+
function packageOwnsOxlintApi(pkg) {
|
|
182
|
+
return pkg.optionalDependencies?.["@oxlint/plugins"] !== void 0 || OXLINT_PLUGIN_API_PACKAGES.some((name) => pkg.dependencies?.[name] !== void 0 || pkg.peerDependencies?.[name] !== void 0);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Capture plugin owners before manifest edits, so the import rewriter can
|
|
186
|
+
* preserve their upstream API imports after those edits.
|
|
187
|
+
*/
|
|
188
|
+
function collectOxlintOwnerDirs(rootDir, packages) {
|
|
189
|
+
const owners = [];
|
|
190
|
+
const candidates = [rootDir, ...(packages ?? []).map((pkg) => path.join(rootDir, pkg.path))];
|
|
191
|
+
for (const dir of candidates) {
|
|
192
|
+
const pkg = readPackageJsonIfExists(path.join(dir, "package.json"));
|
|
193
|
+
if (pkg && packageOwnsOxlintApi(pkg)) owners.push(dir);
|
|
194
|
+
}
|
|
195
|
+
return owners;
|
|
196
|
+
}
|
|
178
197
|
//#endregion
|
|
179
198
|
//#region src/migration/detector.ts
|
|
180
199
|
const PRETTIER_PACKAGE_JSON_CONFIG = "package.json#prettier";
|
|
@@ -331,6 +350,18 @@ function detectEslintProject(projectPath, packages) {
|
|
|
331
350
|
legacyConfigFile
|
|
332
351
|
};
|
|
333
352
|
}
|
|
353
|
+
function extractSkippedRules(output) {
|
|
354
|
+
const lines = output.toString().replaceAll("\r\n", "\n").split("\n");
|
|
355
|
+
const start = lines.findIndex((line) => /^\s*Skipped \d+ rules:/.test(line));
|
|
356
|
+
if (start === -1) return;
|
|
357
|
+
const indentation = lines[start].search(/\S/);
|
|
358
|
+
const block = [lines[start].trim()];
|
|
359
|
+
for (const line of lines.slice(start + 1)) {
|
|
360
|
+
if (line.trim() === "" || line.search(/\S/) <= indentation) break;
|
|
361
|
+
block.push(` ${line.slice(indentation)}`);
|
|
362
|
+
}
|
|
363
|
+
return block.join("\n");
|
|
364
|
+
}
|
|
334
365
|
/**
|
|
335
366
|
* Run a `vp dlx @oxlint/migrate` step with graceful error handling.
|
|
336
367
|
* Returns true on success, false on failure (spawn error or non-zero exit).
|
|
@@ -352,13 +383,16 @@ async function runOxlintMigrateStep(vpBin, cwd, migratePackage, args, spinner, f
|
|
|
352
383
|
const stderr = result.stderr.toString().trim();
|
|
353
384
|
if (stderr) log.warn(`⚠ ${stderr}`);
|
|
354
385
|
log.info(manualHint);
|
|
355
|
-
return false;
|
|
386
|
+
return { ok: false };
|
|
356
387
|
}
|
|
357
|
-
return
|
|
388
|
+
return {
|
|
389
|
+
ok: true,
|
|
390
|
+
skippedRules: extractSkippedRules(result.stdout)
|
|
391
|
+
};
|
|
358
392
|
} catch {
|
|
359
393
|
spinner.stop(failMessage);
|
|
360
394
|
log.info(manualHint);
|
|
361
|
-
return false;
|
|
395
|
+
return { ok: false };
|
|
362
396
|
}
|
|
363
397
|
}
|
|
364
398
|
async function migrateEslintToOxlint(projectPath, interactive, eslintConfigFile, packages, options) {
|
|
@@ -374,10 +408,12 @@ async function migrateEslintToOxlint(projectPath, interactive, eslintConfigFile,
|
|
|
374
408
|
"--details"
|
|
375
409
|
];
|
|
376
410
|
spinner.start("Migrating ESLint config to Oxlint...");
|
|
377
|
-
|
|
411
|
+
const migrateResult = await runOxlintMigrateStep(vpBin, projectPath, migratePackage, migrateArgs, spinner, "ESLint migration failed", `You can run \`vp dlx ${migratePackage} ${migrateArgs.join(" ")}\` manually later`);
|
|
412
|
+
if (!migrateResult.ok) return false;
|
|
378
413
|
spinner.stop("ESLint config migrated to .oxlintrc.json");
|
|
414
|
+
if (migrateResult.skippedRules) warnMigration(migrateResult.skippedRules, options?.report);
|
|
379
415
|
spinner.start("Replacing ESLint comments with Oxlint equivalents...");
|
|
380
|
-
if (await runOxlintMigrateStep(vpBin, projectPath, migratePackage, ["--replace-eslint-comments"], spinner, "ESLint comment replacement failed", `You can run \`vp dlx ${migratePackage} --replace-eslint-comments\` manually later`)) spinner.stop("ESLint comments replaced");
|
|
416
|
+
if ((await runOxlintMigrateStep(vpBin, projectPath, migratePackage, ["--replace-eslint-comments"], spinner, "ESLint comment replacement failed", `You can run \`vp dlx ${migratePackage} --replace-eslint-comments\` manually later`)).ok) spinner.stop("ESLint comments replaced");
|
|
381
417
|
}
|
|
382
418
|
if (options?.report) options.report.eslintMigrated = true;
|
|
383
419
|
const preserveJsPlugins = collectJsPluginPackageNames(projectPath);
|
|
@@ -8069,6 +8105,12 @@ const VITEST_SCAN_SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
|
8069
8105
|
".vite",
|
|
8070
8106
|
".cache"
|
|
8071
8107
|
]);
|
|
8108
|
+
const OXLINT_RETENTION_SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
8109
|
+
"node_modules",
|
|
8110
|
+
".git",
|
|
8111
|
+
".hg",
|
|
8112
|
+
".svn"
|
|
8113
|
+
]);
|
|
8072
8114
|
/**
|
|
8073
8115
|
* Detect whether a package uses vitest's browser mode.
|
|
8074
8116
|
*
|
|
@@ -8093,26 +8135,35 @@ const VITEST_SCAN_SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
|
8093
8135
|
* is a separate package that the migration scans on its own pass, so the root
|
|
8094
8136
|
* package must not inherit a browser-mode signal from a sub-package.
|
|
8095
8137
|
*/
|
|
8096
|
-
function sourceTreeMatches(projectPath, matchesContent) {
|
|
8097
|
-
const
|
|
8138
|
+
function sourceTreeMatches(projectPath, matchesContent, options = {}) {
|
|
8139
|
+
const skipDirs = options.skipDirs ?? VITEST_SCAN_SKIP_DIRS;
|
|
8140
|
+
function scanDir(dir, isRoot) {
|
|
8098
8141
|
let entries;
|
|
8099
8142
|
try {
|
|
8100
8143
|
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
8101
8144
|
} catch {
|
|
8102
8145
|
return false;
|
|
8103
8146
|
}
|
|
8104
|
-
if (!isRoot && entries.some((e) => e.isFile() && e.name === "package.json")) return false;
|
|
8147
|
+
if (!options.crossPackageBoundaries && !isRoot && entries.some((e) => e.isFile() && e.name === "package.json")) return false;
|
|
8105
8148
|
for (const entry of entries) {
|
|
8106
8149
|
const entryPath = path.join(dir, entry.name);
|
|
8107
8150
|
if (entry.isDirectory()) {
|
|
8108
|
-
if (
|
|
8151
|
+
if (skipDirs.has(entry.name)) continue;
|
|
8109
8152
|
if (scanDir(entryPath, false)) return true;
|
|
8110
|
-
} else if (entry.isFile() && VITEST_SCAN_EXTENSIONS.has(path.extname(entry.name))) try {
|
|
8111
|
-
|
|
8153
|
+
} else if (entry.isFile() && (VITEST_SCAN_EXTENSIONS.has(path.extname(entry.name)) || options.includePackageReferences && entry.name === "package.json")) try {
|
|
8154
|
+
let content = fs.readFileSync(entryPath, "utf8");
|
|
8155
|
+
if (entry.name === "package.json") {
|
|
8156
|
+
const pkg = JSON.parse(content);
|
|
8157
|
+
content = JSON.stringify({
|
|
8158
|
+
imports: pkg.imports,
|
|
8159
|
+
scripts: pkg.scripts
|
|
8160
|
+
});
|
|
8161
|
+
}
|
|
8162
|
+
if (matchesContent(content)) return true;
|
|
8112
8163
|
} catch {}
|
|
8113
8164
|
}
|
|
8114
8165
|
return false;
|
|
8115
|
-
}
|
|
8166
|
+
}
|
|
8116
8167
|
return scanDir(projectPath, true);
|
|
8117
8168
|
}
|
|
8118
8169
|
function sourceTreeReferencesAny(projectPath, hints) {
|
|
@@ -8161,6 +8212,39 @@ function collectProviderSourceModes(projectPath) {
|
|
|
8161
8212
|
for (const provider of OPT_IN_BROWSER_PROVIDERS) modes[provider] = sourceTreeReferencesAny(projectPath, BROWSER_PROVIDER_SPECIFIER_HINTS[provider]);
|
|
8162
8213
|
return modes;
|
|
8163
8214
|
}
|
|
8215
|
+
/**
|
|
8216
|
+
* Check final source, build output, package import aliases, and package scripts.
|
|
8217
|
+
* A substring scan conservatively retains references the rewriter leaves alone,
|
|
8218
|
+
* including require calls, type references, and strings.
|
|
8219
|
+
*/
|
|
8220
|
+
function sourceTreeReferencesOxlintPluginsPackage(projectPath) {
|
|
8221
|
+
return sourceTreeMatches(projectPath, (content) => content.includes(OXLINT_PLUGINS_PACKAGE), {
|
|
8222
|
+
crossPackageBoundaries: true,
|
|
8223
|
+
includePackageReferences: true,
|
|
8224
|
+
skipDirs: OXLINT_RETENTION_SKIP_DIRS
|
|
8225
|
+
});
|
|
8226
|
+
}
|
|
8227
|
+
/**
|
|
8228
|
+
* Drop `@oxlint/plugins` from devDependencies once nothing names it any more.
|
|
8229
|
+
*
|
|
8230
|
+
* Runs AFTER the import rewrite, so the scan sees final source. Skips a package
|
|
8231
|
+
* that owns the API as a runtime or peer dependency, and skips any package
|
|
8232
|
+
* whose source or build output still names it.
|
|
8233
|
+
*/
|
|
8234
|
+
function dropDeadOxlintPluginsDependency(rootDir, packages) {
|
|
8235
|
+
const dirs = [rootDir, ...(packages ?? []).map((pkg) => path.join(rootDir, pkg.path))];
|
|
8236
|
+
for (const dir of dirs) {
|
|
8237
|
+
const packageJsonPath = path.join(dir, "package.json");
|
|
8238
|
+
const pkg = readPackageJsonIfExists(packageJsonPath);
|
|
8239
|
+
if (pkg?.devDependencies?.["@oxlint/plugins"] === void 0) continue;
|
|
8240
|
+
if (packageOwnsOxlintApi(pkg) || sourceTreeReferencesOxlintPluginsPackage(dir)) continue;
|
|
8241
|
+
editJsonFile(packageJsonPath, (json) => {
|
|
8242
|
+
if (json.devDependencies?.["@oxlint/plugins"] === void 0) return;
|
|
8243
|
+
delete json.devDependencies[OXLINT_PLUGINS_PACKAGE];
|
|
8244
|
+
return json;
|
|
8245
|
+
});
|
|
8246
|
+
}
|
|
8247
|
+
}
|
|
8164
8248
|
//#endregion
|
|
8165
8249
|
//#region src/migration/migrator/vite-plus-bootstrap.ts
|
|
8166
8250
|
function bunWorkspaceDeclaresPackages(workspaces) {
|
|
@@ -8301,8 +8385,7 @@ function reconcileVitePlusBootstrapPackage(projectPath, pkg, vitePlusVersion, pa
|
|
|
8301
8385
|
pkg.devDependencies[provider] = getCatalogDependencySpec(void 0, VITEST_VERSION, supportCatalog && packageManager !== PackageManager.bun, { preferredCatalogSpec: catalogDependencyResolver?.preferredCatalogSpec });
|
|
8302
8386
|
}
|
|
8303
8387
|
const frameworkPeer = BROWSER_PROVIDER_PEER_DEPS[provider];
|
|
8304
|
-
|
|
8305
|
-
if (frameworkPeer && !frameworkPresent) {
|
|
8388
|
+
if (!hasProviderPeerDependency(pkg, frameworkPeer)) {
|
|
8306
8389
|
pkg.devDependencies ??= {};
|
|
8307
8390
|
pkg.devDependencies[frameworkPeer] = resolveProviderPeerSpec(pkg, frameworkPeer, supportCatalog, catalogDependencyResolver);
|
|
8308
8391
|
}
|
|
@@ -8762,11 +8845,23 @@ function rewritePackageJson(pkg, packageManager, isMonorepo, skipStagedMigration
|
|
|
8762
8845
|
}
|
|
8763
8846
|
}
|
|
8764
8847
|
const hasBrowserDepSignal = VITEST_BROWSER_DEP_NAMES.some((name) => dependencyGroups.some(({ dependencies }) => dependencies?.[name] !== void 0));
|
|
8848
|
+
const ownsOxlintApi = packageOwnsOxlintApi(pkg);
|
|
8849
|
+
if (pkg.devDependencies?.["@oxlint/plugins"] !== void 0 && !ownsOxlintApi) needVitePlus = true;
|
|
8765
8850
|
for (const name of REMOVE_PACKAGES) {
|
|
8766
8851
|
let wasRemoved = false;
|
|
8767
|
-
for (const { dependencies } of dependencyGroups)
|
|
8768
|
-
|
|
8769
|
-
|
|
8852
|
+
for (const { dependencyField, dependencies } of dependencyGroups) {
|
|
8853
|
+
if (ownsOxlintApi && (dependencyField === "peerDependencies" || dependencyField === "dependencies") && OXLINT_PLUGIN_API_PACKAGES.includes(name)) {
|
|
8854
|
+
const current = dependencies?.[name];
|
|
8855
|
+
if (current?.startsWith("catalog:") && dependencies) {
|
|
8856
|
+
const resolved = catalogDependencyResolver?.(current, name);
|
|
8857
|
+
if (resolved) dependencies[name] = resolved;
|
|
8858
|
+
}
|
|
8859
|
+
continue;
|
|
8860
|
+
}
|
|
8861
|
+
if (dependencies?.[name]) {
|
|
8862
|
+
delete dependencies[name];
|
|
8863
|
+
wasRemoved = true;
|
|
8864
|
+
}
|
|
8770
8865
|
}
|
|
8771
8866
|
if (wasRemoved) needVitePlus = true;
|
|
8772
8867
|
}
|
|
@@ -8782,8 +8877,7 @@ function rewritePackageJson(pkg, packageManager, isMonorepo, skipStagedMigration
|
|
|
8782
8877
|
pkg.devDependencies[provider] = getCatalogDependencySpec(void 0, VITEST_VERSION, supportCatalog && packageManager !== PackageManager.bun, { preferredCatalogSpec: catalogDependencyResolver?.preferredCatalogSpec });
|
|
8783
8878
|
}
|
|
8784
8879
|
const peer = BROWSER_PROVIDER_PEER_DEPS[provider];
|
|
8785
|
-
|
|
8786
|
-
if (peer && !peerPresent) {
|
|
8880
|
+
if (!hasProviderPeerDependency(pkg, peer)) {
|
|
8787
8881
|
pkg.devDependencies ??= {};
|
|
8788
8882
|
pkg.devDependencies[peer] = resolveProviderPeerSpec(pkg, peer, supportCatalog, catalogDependencyResolver);
|
|
8789
8883
|
}
|
|
@@ -8911,15 +9005,21 @@ export default defineConfig({});
|
|
|
8911
9005
|
*/
|
|
8912
9006
|
function mergeTsdownConfigFile(projectPath, silent = false, report) {
|
|
8913
9007
|
const configs = detectConfigs(projectPath);
|
|
8914
|
-
if (!configs.tsdownConfig) return;
|
|
9008
|
+
if (!configs.tsdownConfig) return false;
|
|
9009
|
+
const createdViteConfig = !configs.viteConfig;
|
|
8915
9010
|
const viteConfig = ensureViteConfig(projectPath, configs, silent, report);
|
|
8916
9011
|
const fullViteConfigPath = path.join(projectPath, viteConfig);
|
|
8917
9012
|
const fullTsdownConfigPath = path.join(projectPath, configs.tsdownConfig);
|
|
8918
9013
|
if (configs.tsdownConfig.endsWith(".json")) {
|
|
8919
9014
|
mergeAndRemoveJsonConfig(projectPath, viteConfig, configs.tsdownConfig, "pack", silent, report);
|
|
8920
|
-
return;
|
|
9015
|
+
return createdViteConfig || !fs.existsSync(fullTsdownConfigPath);
|
|
8921
9016
|
}
|
|
8922
9017
|
const tsdownRelativePath = `./${configs.tsdownConfig}`;
|
|
9018
|
+
if (hasConfigKey(fullViteConfigPath, "pack")) {
|
|
9019
|
+
const viteConfigContent = fs.readFileSync(fullViteConfigPath, "utf8");
|
|
9020
|
+
if (![tsdownRelativePath, tsdownRelativePath.replace(/\.mts$/, ".mjs").replace(/\.cts$/, ".cjs").replace(/\.ts$/, ".js")].some((importPath) => viteConfigContent.includes(`from '${importPath}'`) || viteConfigContent.includes(`from "${importPath}"`))) infoMigration(`Please manually merge ${displayRelative(fullTsdownConfigPath)} into ${displayRelative(fullViteConfigPath)}, see https://viteplus.dev/guide/migrate#tsdown`, report);
|
|
9021
|
+
return false;
|
|
9022
|
+
}
|
|
8923
9023
|
const result = mergeTsdownConfig(fullViteConfigPath, tsdownRelativePath);
|
|
8924
9024
|
if (result.updated) {
|
|
8925
9025
|
fs.writeFileSync(fullViteConfigPath, result.content);
|
|
@@ -8927,6 +9027,7 @@ function mergeTsdownConfigFile(projectPath, silent = false, report) {
|
|
|
8927
9027
|
if (!silent) log.success(`✔ Added import for ${displayRelative(fullTsdownConfigPath)} in ${displayRelative(fullViteConfigPath)}`);
|
|
8928
9028
|
}
|
|
8929
9029
|
infoMigration(`Please manually merge ${displayRelative(fullTsdownConfigPath)} into ${displayRelative(fullViteConfigPath)}, see https://viteplus.dev/guide/migrate#tsdown`, report);
|
|
9030
|
+
return createdViteConfig || result.updated;
|
|
8930
9031
|
}
|
|
8931
9032
|
/**
|
|
8932
9033
|
* Merge oxlint and oxfmt config into vite.config.ts
|
|
@@ -9067,8 +9168,8 @@ function wrapLazyPluginsInViteConfig(projectPath, silent = false, report) {
|
|
|
9067
9168
|
* This rewrites vite/vitest imports to @voidzero-dev/vite-plus
|
|
9068
9169
|
* @param projectPath - The root directory to search for files
|
|
9069
9170
|
*/
|
|
9070
|
-
function rewriteAllImports(projectPath, silent = false, report, preserveNuxtVitestImports = true) {
|
|
9071
|
-
const result = rewriteImportsInDirectory(projectPath, preserveNuxtVitestImports);
|
|
9171
|
+
function rewriteAllImports(projectPath, silent = false, report, preserveNuxtVitestImports = true, oxlintOwnerDirs = []) {
|
|
9172
|
+
const result = rewriteImportsInDirectory(projectPath, preserveNuxtVitestImports, oxlintOwnerDirs);
|
|
9072
9173
|
const modified = result.modifiedFiles.length;
|
|
9073
9174
|
const preserved = result.preservedVitestFiles.length;
|
|
9074
9175
|
const errors = result.errors.length;
|
|
@@ -9577,11 +9678,13 @@ function finalizeCoreMigrationForExistingVitePlus(workspaceInfo, silent = false,
|
|
|
9577
9678
|
const result = {
|
|
9578
9679
|
scripts: false,
|
|
9579
9680
|
tsconfigTypes: false,
|
|
9580
|
-
imports: false
|
|
9681
|
+
imports: false,
|
|
9682
|
+
tsdownConfig: false
|
|
9581
9683
|
};
|
|
9582
9684
|
if (pending.scripts) for (const projectPath of projectPaths) result.scripts = rewriteCorePackageScripts(projectPath) || result.scripts;
|
|
9583
9685
|
if (pending.tsconfigTypes) for (const projectPath of projectPaths) result.tsconfigTypes = rewriteTsconfigTypes(projectPath, silent, report) || result.tsconfigTypes;
|
|
9584
9686
|
result.imports = rewriteAllImports(workspaceInfo.rootDir, silent, report, true);
|
|
9687
|
+
for (const projectPath of projectPaths) result.tsdownConfig = mergeTsdownConfigFile(projectPath, silent, report) || result.tsdownConfig;
|
|
9585
9688
|
return result;
|
|
9586
9689
|
}
|
|
9587
9690
|
//#endregion
|
|
@@ -9592,6 +9695,7 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
|
|
|
9592
9695
|
const packageManager = workspaceInfo.packageManager;
|
|
9593
9696
|
const catalogDependencyResolver = createCatalogDependencyResolver(projectPath, packageManager);
|
|
9594
9697
|
const vitestEcosystemPackages = collectVitestEcosystemInstallDependencyNames(projectPath);
|
|
9698
|
+
const oxlintOwnerDirs = collectOxlintOwnerDirs(projectPath, workspaceInfo.packages);
|
|
9595
9699
|
const providerSourceModes = collectProviderSourceModes(projectPath);
|
|
9596
9700
|
const browserMode = usesVitestBrowserMode(projectPath);
|
|
9597
9701
|
const retainedVitestModule = sourceTreeReferencesRetainedVitestModule(projectPath);
|
|
@@ -9688,7 +9792,8 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
|
|
|
9688
9792
|
injectLintTypeCheckDefaults(projectPath, silent, report);
|
|
9689
9793
|
injectFmtDefaults(projectPath, silent, report);
|
|
9690
9794
|
mergeTsdownConfigFile(projectPath, silent, report);
|
|
9691
|
-
rewriteAllImports(projectPath, silent, report, true);
|
|
9795
|
+
rewriteAllImports(projectPath, silent, report, true, oxlintOwnerDirs);
|
|
9796
|
+
dropDeadOxlintPluginsDependency(projectPath, workspaceInfo.packages);
|
|
9692
9797
|
wrapLazyPluginsInViteConfig(projectPath, silent, report);
|
|
9693
9798
|
setPackageManager(projectPath, workspaceInfo.downloadPackageManager);
|
|
9694
9799
|
}
|
|
@@ -9698,6 +9803,7 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
|
|
|
9698
9803
|
*/
|
|
9699
9804
|
function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, report) {
|
|
9700
9805
|
const catalogDependencyResolver = createCatalogDependencyResolver(workspaceInfo.rootDir, workspaceInfo.packageManager);
|
|
9806
|
+
const oxlintOwnerDirs = collectOxlintOwnerDirs(workspaceInfo.rootDir, workspaceInfo.packages);
|
|
9701
9807
|
const pnpmMajorVersion = pnpmMajor(workspaceInfo.downloadPackageManager.version);
|
|
9702
9808
|
const usePnpmWorkspaceSettings = pnpmSupportsWorkspaceSettings(workspaceInfo.downloadPackageManager.version);
|
|
9703
9809
|
const workspaceShouldAllowBrowserBuilds = workspaceUsesWebdriverio(workspaceInfo.rootDir, workspaceInfo.packages);
|
|
@@ -9724,7 +9830,8 @@ function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, rep
|
|
|
9724
9830
|
injectLintTypeCheckDefaults(workspaceInfo.rootDir, silent, report);
|
|
9725
9831
|
injectFmtDefaults(workspaceInfo.rootDir, silent, report);
|
|
9726
9832
|
mergeTsdownConfigFile(workspaceInfo.rootDir, silent, report);
|
|
9727
|
-
rewriteAllImports(workspaceInfo.rootDir, silent, report, true);
|
|
9833
|
+
rewriteAllImports(workspaceInfo.rootDir, silent, report, true, oxlintOwnerDirs);
|
|
9834
|
+
dropDeadOxlintPluginsDependency(workspaceInfo.rootDir, workspaceInfo.packages);
|
|
9728
9835
|
wrapLazyPluginsInViteConfig(workspaceInfo.rootDir, silent, report);
|
|
9729
9836
|
for (const pkg of workspaceInfo.packages) wrapLazyPluginsInViteConfig(path.join(workspaceInfo.rootDir, pkg.path), silent, report);
|
|
9730
9837
|
setPackageManager(workspaceInfo.rootDir, workspaceInfo.downloadPackageManager);
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_define_config = require("./define-config-
|
|
1
|
+
const require_define_config = require("./define-config-DpAPETDf.cjs");
|
|
2
2
|
//#region src/index.cts
|
|
3
3
|
const vite = require("vite");
|
|
4
4
|
const { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } = require("vitest/config");
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-
|
|
1
|
+
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-DAaCa0U_.js";
|
|
2
2
|
import { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
|
|
3
3
|
export * from "vite";
|
|
4
4
|
export { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./define-config-DpAPETDf.cjs");
|
|
3
|
+
let _oxlint_plugins = require("@oxlint/plugins");
|
|
4
|
+
Object.defineProperty(exports, "definePlugin", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return _oxlint_plugins.definePlugin;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(exports, "defineRule", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return _oxlint_plugins.defineRule;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "eslintCompatPlugin", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return _oxlint_plugins.eslintCompatPlugin;
|
|
20
|
+
}
|
|
21
|
+
});
|
package/dist/migration/bin.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { r as __toESM } from "../rolldown-runtime-CMFfr-1z.js";
|
|
2
2
|
import { a as muted, c as warnMsg, i as log, o as printHeader, r as formatDuration, t as accent } from "../terminal-MKGAuy-p.js";
|
|
3
|
-
import { a as SETUP_VP_VERSION, f as VITE_PLUS_VERSION, m as isForceOverrideMode } from "../constants-
|
|
3
|
+
import { a as SETUP_VP_VERSION, f as VITE_PLUS_VERSION, m as isForceOverrideMode } from "../constants-IhOditRA.js";
|
|
4
4
|
import { a as writeJsonFile, i as readJsonFile } from "../json-cULBl7Pi.js";
|
|
5
|
-
import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-
|
|
6
|
-
import { E as spinner, S as log$1, T as select, b as confirm, c as selectPackageManager, i as promptGitHooks, k as isCancel, l as upgradeYarn, n as defaultInteractive, o as runViteFmt, r as downloadPackageManager$1, s as runViteInstall, t as cancelAndExit, w as outro, y as PackageManager } from "../prompts-
|
|
5
|
+
import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-BB-Jh_z3.js";
|
|
6
|
+
import { E as spinner, S as log$1, T as select, b as confirm, c as selectPackageManager, i as promptGitHooks, k as isCancel, l as upgradeYarn, n as defaultInteractive, o as runViteFmt, r as downloadPackageManager$1, s as runViteInstall, t as cancelAndExit, w as outro, y as PackageManager } from "../prompts-CujFOJXu.js";
|
|
7
7
|
import { t as require_semver } from "../semver-CaDAb8vV.js";
|
|
8
|
-
import { i as selectAgentTargetPaths, l as displayRelative, n as detectAgentConflicts, r as detectExistingAgentTargetPaths, s as writeAgentInstructions } from "../agent-
|
|
8
|
+
import { i as selectAgentTargetPaths, l as displayRelative, n as detectAgentConflicts, r as detectExistingAgentTargetPaths, s as writeAgentInstructions } from "../agent-C59HKB4Y.js";
|
|
9
9
|
import { n as addMigrationWarning, r as createMigrationReport } from "../report-CK5TnTsr.js";
|
|
10
|
-
import { $ as warnIncompatibleEslintIntegration, A as detectYarnPnpMode, B as migrateTsupToTsdown, C as injectLintTypeCheckDefaults, D as detectVitePlusBootstrapPending, E as collectToolchainVersionChanges, F as addFrameworkShim, G as migratePrettierToOxfmt, H as warnMissingTsupConfig, I as detectFramework, J as confirmEslintMigration, L as hasFrameworkShim, O as ensureVitePlusBootstrap, R as confirmTsupMigration, T as mergeViteConfigFiles, U as confirmPrettierMigration, W as detectPrettierProject, X as detectIncompatibleEslintIntegration, Y as detectEslintProject, Z as migrateEslintToOxlint, _ as installGitHooks, d as finalizeCoreMigrationForExistingVitePlus, et as warnLegacyEslintConfig, f as detectNodeVersionManagerFile, g as detectLegacyGitHooksMigrationCandidate, i as selectEditor, j as detectWorkspace$1, k as configureYarnNodeModulesMode, l as rewriteStandaloneProject, m as migrateSetupVpVersion, nt as checkViteVersion, o as writeEditorConfigs, p as migrateNodeVersionManagerFile, q as warnPackageLevelPrettier, r as isJsonLikeFile, rt as checkVitestVersion, s as rewriteMonorepo, t as detectEditorConflicts, tt as warnPackageLevelEslint, u as detectPendingCoreMigration, v as preflightGitHooksSetup, w as mergeTsdownConfigFile, y as shouldSkipStagedMigrationForHooks, z as detectTsupProject } from "../editor-
|
|
10
|
+
import { $ as warnIncompatibleEslintIntegration, A as detectYarnPnpMode, B as migrateTsupToTsdown, C as injectLintTypeCheckDefaults, D as detectVitePlusBootstrapPending, E as collectToolchainVersionChanges, F as addFrameworkShim, G as migratePrettierToOxfmt, H as warnMissingTsupConfig, I as detectFramework, J as confirmEslintMigration, L as hasFrameworkShim, O as ensureVitePlusBootstrap, R as confirmTsupMigration, T as mergeViteConfigFiles, U as confirmPrettierMigration, W as detectPrettierProject, X as detectIncompatibleEslintIntegration, Y as detectEslintProject, Z as migrateEslintToOxlint, _ as installGitHooks, d as finalizeCoreMigrationForExistingVitePlus, et as warnLegacyEslintConfig, f as detectNodeVersionManagerFile, g as detectLegacyGitHooksMigrationCandidate, i as selectEditor, j as detectWorkspace$1, k as configureYarnNodeModulesMode, l as rewriteStandaloneProject, m as migrateSetupVpVersion, nt as checkViteVersion, o as writeEditorConfigs, p as migrateNodeVersionManagerFile, q as warnPackageLevelPrettier, r as isJsonLikeFile, rt as checkVitestVersion, s as rewriteMonorepo, t as detectEditorConflicts, tt as warnPackageLevelEslint, u as detectPendingCoreMigration, v as preflightGitHooksSetup, w as mergeTsdownConfigFile, y as shouldSkipStagedMigrationForHooks, z as detectTsupProject } from "../editor-QOIGtmH4.js";
|
|
11
11
|
import { n as runCommandSilently } from "../command-CguLh2KL.js";
|
|
12
|
-
import { a as hasBaseUrlInTsconfig, i as fixBaseUrlInTsconfig, t as confirmBaseUrlFix } from "../tsconfig-
|
|
12
|
+
import { a as hasBaseUrlInTsconfig, i as fixBaseUrlInTsconfig, t as confirmBaseUrlFix } from "../tsconfig-DCtWfQPA.js";
|
|
13
13
|
import { t as unwrapCliParseOutcome } from "../cli-parse-DHE8NrBU.js";
|
|
14
14
|
import { t as ROLLDOWN_COMPAT_RESULT_PREFIX } from "../protocol-D99W10Qi.js";
|
|
15
15
|
import path from "node:path";
|
|
@@ -887,7 +887,7 @@ async function main() {
|
|
|
887
887
|
report.dependencyUpgrades = await collectToolchainVersionChanges(workspaceInfoOptional.rootDir);
|
|
888
888
|
updateMigrationProgress("Rewriting toolchain imports across the workspace");
|
|
889
889
|
const coreMigrationResult = finalizeCoreMigrationForExistingVitePlus(workspaceInfoOptional, true, report, pendingCoreMigration);
|
|
890
|
-
if (coreMigrationResult.scripts || coreMigrationResult.tsconfigTypes || coreMigrationResult.imports) didMigrate = true;
|
|
890
|
+
if (coreMigrationResult.scripts || coreMigrationResult.tsconfigTypes || coreMigrationResult.imports || coreMigrationResult.tsdownConfig) didMigrate = true;
|
|
891
891
|
clearMigrationProgress();
|
|
892
892
|
const fullSetup = options.full === true;
|
|
893
893
|
const skippedSetupCandidates = !fullSetup && !hasExplicitExistingVitePlusSetupRequest(options) && hasExistingVitePlusMigrationCandidates(workspaceInfoOptional, options);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as VITE_PLUS_NAME } from "./constants-
|
|
1
|
+
import { u as VITE_PLUS_NAME } from "./constants-IhOditRA.js";
|
|
2
2
|
//#region src/oxlint-plugin-config.ts
|
|
3
3
|
const VITE_PLUS_OXLINT_PLUGIN_NAME = VITE_PLUS_NAME;
|
|
4
4
|
const VITE_PLUS_OXLINT_PLUGIN_SPECIFIER = `${VITE_PLUS_NAME}/oxlint-plugin`;
|