vite-plus 1.3.0 → 1.4.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/AGENTS.md +4 -0
- package/LICENSE +1 -878
- package/README.md +1 -1
- package/bin/vpx +9 -0
- package/binding/index.cjs +59 -54
- package/binding/index.d.cts +128 -2
- package/dist/{agent-97KmGCyL.js → agent-D8oxxhVR.js} +5 -7
- package/dist/bin.js +25 -32
- package/dist/{cli-parse-DHE8NrBU.js → cli-parse-aeUeFDlC.js} +2 -3
- package/dist/command-TjS_6y9O.js +1 -0
- package/dist/{command-CdMBoZFD.js → command-rY79K5NI.js} +28 -30
- package/dist/{comparison-CmVirWIW-DUGaiYqF.js → comparison-CmVirWIW-UlEf2maz.js} +1 -2
- package/dist/config/bin.js +8 -10
- package/dist/{constants-DR55DpRm.js → constants-DRUnJ_Dz.js} +3 -5
- package/dist/create/bin.d.ts +4 -8
- package/dist/create/bin.js +46 -65
- package/dist/{define-config-CvE5pHqB.js → define-config-ChwJcu5e.js} +6 -9
- package/dist/{define-config-BxDc_9BK.cjs → define-config-Cv2P6NT2.cjs} +7 -12
- package/dist/{define-config-Bexdd6RZ.d.ts → define-config-rPhYIFSn.d.ts} +1 -11
- 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-DIpm7mot.js → dist-Bs0SObNC.js} +73 -145
- package/dist/{dist-Cqz8OtiO.js → dist-CdkMvIiQ.js} +11 -5
- package/dist/dist-zDZV5eEc.js +3 -0
- package/dist/{documentation-DqcZSthV.js → documentation-cv_y0Auv.js} +1 -2
- package/dist/{editor-CtJGQP7C.js → editor-ClL78D8u.js} +1490 -4209
- package/dist/{help-BmKpeOP9.js → help-B03t_iQ4.js} +1 -2
- package/dist/hooks/bin.js +4 -5
- package/dist/{hooks-DhwsWb46.js → hooks-xRcJPc-O.js} +5 -4
- package/dist/index.cjs +2 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-JP24qHUF.js → json-kl84kDyH.js} +9 -18
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +719 -184
- package/dist/migration/compat/worker.js +4 -6
- package/dist/{oxlint-plugin-config-BIzrO2y2.js → oxlint-plugin-config-BVpqYdcC.js} +3 -4
- package/dist/oxlint-plugin.d.ts +0 -2
- package/dist/oxlint-plugin.js +6 -7
- package/dist/{pack-BK38MLVZ.d.ts → pack-ARPFMefW.d.ts} +0 -2
- package/dist/pack-bin.d.ts +1 -3
- package/dist/pack-bin.js +3 -4
- package/dist/pack.d.ts +1 -1
- package/dist/{package-CQDXTm6j.js → package-DzsomcUD.js} +10 -95
- package/dist/{package-overrides-D1RcXSFl.js → package-overrides-Ci8GXouY.js} +5 -8
- package/dist/picomatch-DEUoj81q.js +1916 -0
- package/dist/{prompts-1xNz_ne0.js → prompts-GL1vj0wk.js} +30 -50
- package/dist/{protocol-D99W10Qi.js → protocol-CkNmY-Mr.js} +1 -2
- package/dist/{report-NhQk8VHb.js → report-DLHO30yZ.js} +2 -2
- package/dist/{resolve-vite-config-BVr1SUNg.js → resolve-vite-config-Dn5896A4.js} +9 -25
- package/dist/resolve-vite-config-QO6cC0SP.js +1 -0
- package/dist/{rolldown-runtime-kJ_i4yPo.js → rolldown-runtime-DegdyBIC.js} +1 -2
- package/dist/script-esm-hooks.d.ts +8 -0
- package/dist/script-esm-hooks.js +24 -0
- package/dist/script-hooks-9Fof5UMY.js +176 -0
- package/dist/script-preload.cjs +468 -0
- package/dist/script-register.d.ts +1 -0
- package/dist/script-register.js +22 -0
- package/dist/script-watch.d.ts +1 -0
- package/dist/script-watch.js +1908 -0
- package/dist/staged/bin.js +53 -2011
- package/dist/sync-versions/bin.js +26 -48
- package/dist/sync-versions/bin.mjs +109 -217
- package/dist/{terminal-MKGAuy-p.js → terminal-BcuPUy-j.js} +1 -2
- package/dist/toolchain.js +35 -9
- package/dist/toolchain.json +35 -9
- package/dist/{tsconfig-zWgHiQ3X.js → tsconfig-Do6MAG_f.js} +1 -1
- package/dist/{tsconfig-BZu7kl-x.js → tsconfig-LE_mAwe_.js} +8 -10
- package/dist/version.d.ts +1 -3
- package/dist/version.js +5 -6
- package/dist/versions.js +4 -4
- package/dist/{vitest-ecosystem-BU0AqZq-.js → vitest-ecosystem-BeEYz-qF.js} +1 -2
- package/dist/{vitest-v5-entry-points-DthU1e_O.js → vitest-v5-entry-points-NyJsFeux.js} +1 -2
- package/dist/vpx-bin.d.ts +1 -0
- package/dist/vpx-bin.js +232 -0
- package/dist/vpx-script-EXgV5QOf.js +434 -0
- package/docs/config/run.md +4 -0
- package/docs/guide/check.md +1 -0
- package/docs/guide/ci.md +13 -3
- package/docs/guide/env.md +11 -4
- package/docs/guide/global-cli.md +52 -0
- package/docs/guide/migrate-rules.md +48 -5
- package/docs/guide/migrate.md +5 -5
- package/docs/guide/package-management.md +1 -1
- package/docs/guide/vpx.md +170 -9
- package/package.json +20 -17
- package/dist/command-DVTILtS-.js +0 -1
- package/dist/dist-Dhu07wmN.js +0 -3
- package/dist/resolve-vite-config-7WDtXO4G.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as addMigrationWarning, r as createMigrationReport } from "../../report-
|
|
2
|
-
import { t as ROLLDOWN_COMPAT_RESULT_PREFIX } from "../../protocol-
|
|
1
|
+
import { n as addMigrationWarning, r as createMigrationReport } from "../../report-DLHO30yZ.js";
|
|
2
|
+
import { t as ROLLDOWN_COMPAT_RESULT_PREFIX } from "../../protocol-CkNmY-Mr.js";
|
|
3
3
|
import { writeSync } from "node:fs";
|
|
4
|
-
|
|
4
|
+
// src/migration/compat/manual-chunks.ts
|
|
5
5
|
/**
|
|
6
6
|
* Check for Rolldown-incompatible manualChunks config patterns.
|
|
7
7
|
*/
|
|
@@ -12,8 +12,7 @@ function checkManualChunksCompat(output, report) {
|
|
|
12
12
|
break;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
//#region src/migration/compat/worker.ts
|
|
15
|
+
// src/migration/compat/worker.ts
|
|
17
16
|
async function main() {
|
|
18
17
|
const rootDir = process.argv[2];
|
|
19
18
|
if (!rootDir) return;
|
|
@@ -31,5 +30,4 @@ async function main() {
|
|
|
31
30
|
} catch {}
|
|
32
31
|
}
|
|
33
32
|
main().then(() => process.exit(0), () => process.exit(0));
|
|
34
|
-
//#endregion
|
|
35
33
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as VITE_PLUS_NAME } from "./constants-
|
|
2
|
-
|
|
1
|
+
import { u as VITE_PLUS_NAME } from "./constants-DRUnJ_Dz.js";
|
|
2
|
+
// 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`;
|
|
5
5
|
const PREFER_VITE_PLUS_IMPORTS_RULE_NAME = "prefer-vite-plus-imports";
|
|
@@ -33,5 +33,4 @@ function createDefaultVitePlusLintConfig(options) {
|
|
|
33
33
|
};
|
|
34
34
|
return config;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
export { ensureVitePlusImportRuleDefaults as i, VITE_PLUS_OXLINT_PLUGIN_NAME as n, createDefaultVitePlusLintConfig as r, PREFER_VITE_PLUS_IMPORTS_RULE_NAME as t };
|
|
36
|
+
export { ensureVitePlusImportRuleDefaults as a, createDefaultVitePlusLintConfig as i, PREFER_VITE_PLUS_IMPORTS_RULE_NAME as n, VITE_PLUS_OXLINT_PLUGIN_NAME as r, PREFER_VITE_PLUS_IMPORTS_RULE as t };
|
package/dist/oxlint-plugin.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
//#region src/oxlint-plugin.d.ts
|
|
2
1
|
declare function rewriteVitePlusImportSpecifier(specifier: string): string | null;
|
|
3
2
|
export declare const preferVitePlusImportsRule: import("@oxlint/plugins").Rule;
|
|
4
3
|
declare const plugin: import("@oxlint/plugins").Plugin;
|
|
5
|
-
//#endregion
|
|
6
4
|
export { plugin as default, rewriteVitePlusImportSpecifier };
|
package/dist/oxlint-plugin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { v as exports } from "./constants-
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as vitest_v5_entry_points_default } from "./vitest-v5-entry-points-
|
|
1
|
+
import { v as exports } from "./constants-DRUnJ_Dz.js";
|
|
2
|
+
import { n as PREFER_VITE_PLUS_IMPORTS_RULE_NAME, r as VITE_PLUS_OXLINT_PLUGIN_NAME } from "./oxlint-plugin-config-BVpqYdcC.js";
|
|
3
|
+
import { t as vitest_v5_entry_points_default } from "./vitest-v5-entry-points-NyJsFeux.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
import { definePlugin, defineRule } from "@oxlint/plugins";
|
|
7
|
-
|
|
7
|
+
// src/vite-config-entry-basenames.json
|
|
8
8
|
var vite_config_entry_basenames_default = [
|
|
9
9
|
"vite.config.ts",
|
|
10
10
|
"vite.config.mts",
|
|
@@ -19,8 +19,7 @@ var vite_config_entry_basenames_default = [
|
|
|
19
19
|
"vitest.config.mjs",
|
|
20
20
|
"vitest.config.cjs"
|
|
21
21
|
];
|
|
22
|
-
|
|
23
|
-
//#region src/oxlint-plugin.ts
|
|
22
|
+
// src/oxlint-plugin.ts
|
|
24
23
|
function isVitestFamilyDeclareModuleSpecifier(specifier) {
|
|
25
24
|
return specifier === "vitest" || specifier.startsWith("vitest/") || specifier === "@vitest/browser" || specifier.startsWith("@vitest/browser/") || specifier.startsWith("@vitest/browser-");
|
|
26
25
|
}
|
|
@@ -54,6 +53,7 @@ const OXLINT_CONFIG_SURFACE_EXPORTS = /* @__PURE__ */ new Set([
|
|
|
54
53
|
]);
|
|
55
54
|
function rewriteVitePlusImportSpecifier(specifier) {
|
|
56
55
|
if (specifier === "vite") return "vite-plus";
|
|
56
|
+
if (specifier === "vite/rolldown" || specifier.startsWith("vite/rolldown/")) return null;
|
|
57
57
|
if (specifier.startsWith("vite/")) return `vite-plus/${specifier.slice(5)}`;
|
|
58
58
|
if (specifier === "vitest/config") return "vite-plus";
|
|
59
59
|
if (specifier === "vitest") return "vite-plus/test";
|
|
@@ -227,5 +227,4 @@ const plugin = definePlugin({
|
|
|
227
227
|
meta: { name: VITE_PLUS_OXLINT_PLUGIN_NAME },
|
|
228
228
|
rules: { [PREFER_VITE_PLUS_IMPORTS_RULE_NAME]: preferVitePlusImportsRule }
|
|
229
229
|
});
|
|
230
|
-
//#endregion
|
|
231
230
|
export { plugin as default, preferVitePlusImportsRule, rewriteVitePlusImportSpecifier };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UserConfig } from "vite/pack";
|
|
2
|
-
//#region src/pack.d.ts
|
|
3
2
|
interface PackUserConfig extends UserConfig {
|
|
4
3
|
/**
|
|
5
4
|
* When loading env variables from `envFile`, only include variables with these prefixes.
|
|
@@ -7,5 +6,4 @@ interface PackUserConfig extends UserConfig {
|
|
|
7
6
|
*/
|
|
8
7
|
envPrefix?: string | string[];
|
|
9
8
|
}
|
|
10
|
-
//#endregion
|
|
11
9
|
export { PackUserConfig as t };
|
package/dist/pack-bin.d.ts
CHANGED
package/dist/pack-bin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as cac } from "./dist-
|
|
3
|
-
import {
|
|
2
|
+
import { t as cac } from "./dist-CdkMvIiQ.js";
|
|
3
|
+
import { a as resolveViteConfig } from "./resolve-vite-config-Dn5896A4.js";
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { buildWithConfigs, enableDebug, globalLogger, resolveUserConfig } from "vite/pack";
|
|
7
|
-
|
|
7
|
+
// src/pack-bin.ts
|
|
8
8
|
const RE_DTS = /\.d\.[cm]?ts$/;
|
|
9
9
|
const EXTERNAL_DTS_PKG_RE = /^(?:postcss|lightningcss|vitest|@vitest\/[^/]+|vite-plus)(?:\/|$)/;
|
|
10
10
|
/**
|
|
@@ -99,5 +99,4 @@ async function runCLI() {
|
|
|
99
99
|
}
|
|
100
100
|
if (module.enableCompileCache) module.enableCompileCache();
|
|
101
101
|
await runCLI();
|
|
102
|
-
//#endregion
|
|
103
102
|
export { runCLI };
|
package/dist/pack.d.ts
CHANGED
|
@@ -1,63 +1,10 @@
|
|
|
1
|
-
import "./constants-
|
|
2
|
-
import { i as readJsonFile } from "./json-
|
|
1
|
+
import "./constants-DRUnJ_Dz.js";
|
|
2
|
+
import { i as readJsonFile } from "./json-kl84kDyH.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { resolveNpmAuthorization, resolveNpmRegistry } from "../binding/index.js";
|
|
5
6
|
import fs from "node:fs";
|
|
6
|
-
|
|
7
|
-
//#region src/utils/npm-config.ts
|
|
8
|
-
function expandNpmrcValue(raw) {
|
|
9
|
-
let value = raw.trim();
|
|
10
|
-
if (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'")) value = value.slice(1, -1);
|
|
11
|
-
return value.replaceAll(/\$\{([A-Z0-9_]+)\}/gi, (_, name) => process.env[name] ?? "");
|
|
12
|
-
}
|
|
13
|
-
function parseNpmrc(contents, into) {
|
|
14
|
-
for (const rawLine of contents.split(/\r?\n/)) {
|
|
15
|
-
const line = rawLine.trim();
|
|
16
|
-
if (!line || line.startsWith("#") || line.startsWith(";")) continue;
|
|
17
|
-
const eq = line.indexOf("=");
|
|
18
|
-
if (eq === -1) continue;
|
|
19
|
-
const key = line.slice(0, eq).trim();
|
|
20
|
-
const value = expandNpmrcValue(line.slice(eq + 1));
|
|
21
|
-
if (key) into.set(key, value);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function loadFileInto(filePath, config) {
|
|
25
|
-
try {
|
|
26
|
-
parseNpmrc(fs.readFileSync(filePath, "utf8"), config);
|
|
27
|
-
} catch {}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Rebuilt on every call so tests that mutate `process.env` mid-run see
|
|
31
|
-
* fresh config. Each `vp create` hits this ≤4 times (registry + auth on
|
|
32
|
-
* packument + auth on tarball), which is cheap enough vs. the network
|
|
33
|
-
* work that a cache isn't worth the test-determinism cost.
|
|
34
|
-
*/
|
|
35
|
-
function getNpmConfig() {
|
|
36
|
-
const config = /* @__PURE__ */ new Map();
|
|
37
|
-
const homeNpmrc = path.resolve(os.homedir(), ".npmrc");
|
|
38
|
-
loadFileInto(homeNpmrc, config);
|
|
39
|
-
const projectRcs = [];
|
|
40
|
-
let dir = path.resolve(process.cwd());
|
|
41
|
-
const seen = /* @__PURE__ */ new Set();
|
|
42
|
-
while (dir && !seen.has(dir)) {
|
|
43
|
-
seen.add(dir);
|
|
44
|
-
const candidate = path.resolve(dir, ".npmrc");
|
|
45
|
-
if (candidate !== homeNpmrc && fs.existsSync(candidate)) projectRcs.push(candidate);
|
|
46
|
-
const parent = path.dirname(dir);
|
|
47
|
-
if (parent === dir) break;
|
|
48
|
-
dir = parent;
|
|
49
|
-
}
|
|
50
|
-
for (let i = projectRcs.length - 1; i >= 0; i -= 1) loadFileInto(projectRcs[i], config);
|
|
51
|
-
for (const [envKey, envValue] of Object.entries(process.env)) {
|
|
52
|
-
if (envValue === void 0) continue;
|
|
53
|
-
if (envKey.startsWith("npm_config_")) config.set(envKey.slice(11), envValue);
|
|
54
|
-
else if (envKey.startsWith("NPM_CONFIG_")) config.set(envKey.slice(11).toLowerCase(), envValue);
|
|
55
|
-
}
|
|
56
|
-
return config;
|
|
57
|
-
}
|
|
58
|
-
function normalizeRegistryUrl(url) {
|
|
59
|
-
return url.replace(/\/+$/, "");
|
|
60
|
-
}
|
|
7
|
+
// src/utils/npm-config.ts
|
|
61
8
|
/**
|
|
62
9
|
* Resolve the npm registry base URL for the given scope (or the default
|
|
63
10
|
* registry when `scope` is omitted). Honors `@scope:registry=...` entries
|
|
@@ -65,45 +12,15 @@ function normalizeRegistryUrl(url) {
|
|
|
65
12
|
* vars so private / mirrored registries work for org manifest fetches.
|
|
66
13
|
*/
|
|
67
14
|
function getNpmRegistry(scope) {
|
|
68
|
-
|
|
69
|
-
if (scope) {
|
|
70
|
-
const normalizedScope = scope.startsWith("@") ? scope : `@${scope}`;
|
|
71
|
-
const scoped = config.get(`${normalizedScope}:registry`);
|
|
72
|
-
if (scoped) return normalizeRegistryUrl(scoped);
|
|
73
|
-
}
|
|
74
|
-
return normalizeRegistryUrl(config.get("registry") || "https://registry.npmjs.org");
|
|
15
|
+
return resolveNpmRegistry(process.cwd(), scope?.replace(/^@/, ""));
|
|
75
16
|
}
|
|
76
17
|
/**
|
|
77
|
-
* Build the `Authorization` header value for a registry URL
|
|
78
|
-
*
|
|
79
|
-
*
|
|
18
|
+
* Build the `Authorization` header value for a registry URL from the
|
|
19
|
+
* matching `//host[/path]/:_authToken=...` / `:_auth=...` entries in
|
|
20
|
+
* `.npmrc`. Returns `undefined` when no credential is configured.
|
|
80
21
|
*/
|
|
81
22
|
function getNpmAuthHeader(registryOrUrl) {
|
|
82
|
-
|
|
83
|
-
try {
|
|
84
|
-
parsed = new URL(registryOrUrl);
|
|
85
|
-
} catch {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
const config = getNpmConfig();
|
|
89
|
-
const segments = parsed.pathname.split("/").filter(Boolean);
|
|
90
|
-
const candidates = [];
|
|
91
|
-
for (let i = segments.length; i >= 0; i -= 1) {
|
|
92
|
-
const subPath = i === 0 ? "/" : `/${segments.slice(0, i).join("/")}/`;
|
|
93
|
-
candidates.push(`//${parsed.host}${subPath}`);
|
|
94
|
-
}
|
|
95
|
-
for (const prefix of candidates) {
|
|
96
|
-
const token = config.get(`${prefix}:_authToken`);
|
|
97
|
-
if (token) return `Bearer ${token}`;
|
|
98
|
-
const basic = config.get(`${prefix}:_auth`);
|
|
99
|
-
if (basic) return `Basic ${basic}`;
|
|
100
|
-
const username = config.get(`${prefix}:username`);
|
|
101
|
-
const passwordB64 = config.get(`${prefix}:_password`);
|
|
102
|
-
if (username && passwordB64) {
|
|
103
|
-
const password = Buffer.from(passwordB64, "base64").toString("utf8");
|
|
104
|
-
return `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
23
|
+
return resolveNpmAuthorization(process.cwd(), registryOrUrl) ?? void 0;
|
|
107
24
|
}
|
|
108
25
|
/**
|
|
109
26
|
* `fetch` wrapper for npm registry URLs that retries with an
|
|
@@ -132,8 +49,7 @@ async function fetchNpmResource(url, init) {
|
|
|
132
49
|
signal: AbortSignal.timeout(timeoutMs)
|
|
133
50
|
});
|
|
134
51
|
}
|
|
135
|
-
|
|
136
|
-
//#region src/utils/package.ts
|
|
52
|
+
// src/utils/package.ts
|
|
137
53
|
function getScopeFromPackageName(packageName) {
|
|
138
54
|
if (packageName.startsWith("@")) return packageName.split("/")[0];
|
|
139
55
|
return "";
|
|
@@ -243,5 +159,4 @@ async function checkNpmPackageExists(packageName) {
|
|
|
243
159
|
return true;
|
|
244
160
|
}
|
|
245
161
|
}
|
|
246
|
-
//#endregion
|
|
247
162
|
export { hasVitePlusDependency as a, getNpmRegistry as c, hasPackageManagerDeclaration as i, detectPackageMetadata as n, readNearestPackageJson as o, getScopeFromPackageName as r, fetchNpmResource as s, checkNpmPackageExists as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as GREATER_LESS_THAN, b as safeRegex, c as LOOSE_PLAIN, d as XRANGE_PLAIN, f as XRANGE_PLAIN_LOOSE, g as formatComparableVersion, i as FULL_PLAIN, m as compareParsed, o as LONE_CARET, s as LONE_TILDE, t as BUILD, x as tryParse, y as parse } from "./comparison-CmVirWIW-
|
|
2
|
-
|
|
1
|
+
import { a as GREATER_LESS_THAN, b as safeRegex, c as LOOSE_PLAIN, d as XRANGE_PLAIN, f as XRANGE_PLAIN_LOOSE, g as formatComparableVersion, i as FULL_PLAIN, m as compareParsed, o as LONE_CARET, s as LONE_TILDE, t as BUILD, x as tryParse, y as parse } from "./comparison-CmVirWIW-UlEf2maz.js";
|
|
2
|
+
// ../../node_modules/.pnpm/verkit@0.5.0/node_modules/verkit/dist/set-BGFWKKE8.js
|
|
3
3
|
const STRICT_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${FULL_PLAIN})$|^$`);
|
|
4
4
|
const LOOSE_COMPARATOR$1 = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
5
5
|
function formatComparator(comparator) {
|
|
@@ -53,8 +53,7 @@ function parsedComparatorsIntersect(left, right, options = {}) {
|
|
|
53
53
|
if (comparison < 0 && left.operator.startsWith(">") && right.operator.startsWith("<")) return true;
|
|
54
54
|
return comparison > 0 && left.operator.startsWith("<") && right.operator.startsWith(">");
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
//#region ../../node_modules/.pnpm/verkit@0.5.0/node_modules/verkit/dist/range-C5wjdo9a.js
|
|
56
|
+
// ../../node_modules/.pnpm/verkit@0.5.0/node_modules/verkit/dist/range-C5wjdo9a.js
|
|
58
57
|
function formatRange(range) {
|
|
59
58
|
return range.sets.map((set) => set.map(formatComparator).join(" ")).join("||");
|
|
60
59
|
}
|
|
@@ -391,15 +390,14 @@ function isRangeSubset(subset, superset, options = {}) {
|
|
|
391
390
|
}
|
|
392
391
|
return true;
|
|
393
392
|
}
|
|
394
|
-
|
|
395
|
-
//#region src/utils/package-overrides.ts
|
|
393
|
+
// src/utils/package-overrides.ts
|
|
396
394
|
function extractOverrideTargetName(key) {
|
|
397
395
|
let target = key.trim();
|
|
398
396
|
for (let delimiter = target.search(/[^ |@]>/); delimiter !== -1; delimiter = target.search(/[^ |@]>/)) target = target.slice(delimiter + 2).trim();
|
|
399
397
|
if (!target) return target;
|
|
400
398
|
if (target.includes("/")) {
|
|
401
399
|
const segments = target.split("/");
|
|
402
|
-
const last = segments
|
|
400
|
+
const last = segments.at(-1);
|
|
403
401
|
const scope = segments[segments.length - 2];
|
|
404
402
|
target = scope?.startsWith("@") ? `${scope}/${last}` : last;
|
|
405
403
|
}
|
|
@@ -407,5 +405,4 @@ function extractOverrideTargetName(key) {
|
|
|
407
405
|
const versionAt = target.indexOf("@", nameStart);
|
|
408
406
|
return versionAt > 0 ? target.slice(0, versionAt) : target;
|
|
409
407
|
}
|
|
410
|
-
//#endregion
|
|
411
408
|
export { rangeToComparators as a, normalizeRange as i, findMinimumForRange as n, rangesIntersect as o, isRangeSubset as r, satisfies as s, extractOverrideTargetName as t };
|