vite-plus 0.2.0 → 0.2.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/bin/oxfmt +6 -3
- package/bin/oxlint +6 -3
- package/bin/vpr +9 -0
- package/binding/index.cjs +53 -53
- package/binding/index.d.cts +86 -144
- package/dist/agent-D7O7mSeO.js +9456 -0
- package/dist/bin.js +10 -7
- package/dist/{cli-truncate-CWsmbK3p.js → cli-truncate-BVOlIIPy.js} +1 -1
- package/dist/config/bin.js +2 -2
- package/dist/{constants-CrfJQIUX.js → constants-NeTOxrzV.js} +7 -3
- package/dist/create/bin.js +22 -60
- package/dist/{define-config-2tfJoXr1.d.ts → define-config-BuMs_LKa.d.ts} +64 -9
- package/dist/{define-config-DJUehepE.js → define-config-CSgy0zML.js} +43 -18
- package/dist/{define-config-BGSjF6Xp.cjs → define-config-CrA3lZhQ.cjs} +61 -22
- package/dist/define-config.cjs +2 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +2 -2
- package/dist/{dist-Oxo16Y0q.js → dist-CKz3vcoG.js} +4 -4
- package/dist/dist-CtM2JRbM.js +3 -0
- package/dist/editor-CPzssglc.js +584 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-Dn87fvjk.js → json-DiRs8ceZ.js} +13 -1
- package/dist/{log-update-lyIiuflf.js → log-update-DHZRyJ2m.js} +2 -2
- package/dist/migration/bin.d.ts +1 -10
- package/dist/migration/bin.js +531 -170
- package/dist/migration/compat/worker.d.ts +1 -0
- package/dist/migration/compat/worker.js +35 -0
- package/dist/{oxlint-plugin-config-q8a5PFch.js → oxlint-plugin-config-C2Rqc_WQ.js} +1 -1
- package/dist/oxlint-plugin.js +78 -9
- package/dist/pack-bin.js +1 -1
- package/dist/{package-BHirM1_v.js → package-CU2g7URl.js} +52 -3
- package/dist/protocol-D99W10Qi.js +4 -0
- package/dist/{report-BHSkWqRR.js → report-BS7ULx7A.js} +2 -0
- package/dist/{resolve-vite-config-CmdsfQzS.js → resolve-vite-config-r91rIaPs.js} +14 -10
- package/dist/{rolldown-runtime-DnnnRqeS.js → rolldown-runtime-C7HZzL1F.js} +1 -1
- package/dist/staged/bin.js +23 -19
- package/dist/{tsconfig-CJ_StdFc.js → tsconfig-fvpxgUq2.js} +395 -200
- package/dist/version.js +2 -5
- package/dist/versions.js +5 -5
- package/dist/{wrap-ansi-k7Dn4VtV.js → wrap-ansi-DNjkuBEp.js} +1 -1
- package/dist/wrap-ansi-DUi52C6W.js +2 -0
- package/docs/_data/team.ts +9 -0
- package/docs/config/check.md +35 -0
- package/docs/config/index.md +2 -0
- package/docs/config/run.md +61 -12
- package/docs/guide/automatic-data-tracking.md +145 -0
- package/docs/guide/cache.md +14 -35
- package/docs/guide/check.md +16 -0
- package/docs/guide/ci.md +4 -0
- package/docs/guide/docker.md +175 -0
- package/docs/guide/env.md +12 -0
- package/docs/guide/github-actions-cache.md +165 -0
- package/docs/guide/install.md +12 -2
- package/docs/guide/migrate-rules.md +347 -0
- package/docs/guide/migrate.md +14 -0
- package/docs/guide/pack.md +8 -0
- package/docs/guide/run.md +33 -3
- package/docs/guide/troubleshooting.md +1 -1
- package/docs/guide/upgrade.md +43 -21
- package/docs/package.json +1 -1
- package/package.json +21 -20
- package/dist/agent-BD31CsvU.js +0 -3341
- package/dist/compat-Cql3K40m.js +0 -14
- package/dist/dist-DRJUd9bL.js +0 -3
- package/dist/workspace-Cjoc1c_A.js +0 -5830
- package/dist/wrap-ansi-CeQuiQ31.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { n as addMigrationWarning, r as createMigrationReport } from "../../report-BS7ULx7A.js";
|
|
2
|
+
import { t as ROLLDOWN_COMPAT_RESULT_PREFIX } from "../../protocol-D99W10Qi.js";
|
|
3
|
+
import { writeSync } from "node:fs";
|
|
4
|
+
//#region src/migration/compat/manual-chunks.ts
|
|
5
|
+
/**
|
|
6
|
+
* Check for Rolldown-incompatible manualChunks config patterns.
|
|
7
|
+
*/
|
|
8
|
+
function checkManualChunksCompat(output, report) {
|
|
9
|
+
const outputs = Array.isArray(output) ? output : output ? [output] : [];
|
|
10
|
+
for (const out of outputs) if (out.manualChunks != null && typeof out.manualChunks !== "function") {
|
|
11
|
+
addMigrationWarning(report, "Object-form `build.rollupOptions.output.manualChunks` is not supported by Rolldown. Convert it to function form or use `build.rolldownOptions.output.codeSplitting`. See: https://rolldown.rs/options/output#manualchunks and https://rolldown.rs/in-depth/manual-code-splitting");
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/migration/compat/worker.ts
|
|
17
|
+
async function main() {
|
|
18
|
+
const rootDir = process.argv[2];
|
|
19
|
+
if (!rootDir) return;
|
|
20
|
+
try {
|
|
21
|
+
const { resolveConfig } = await import("../../index.js");
|
|
22
|
+
const { withConfigMetadataResolution } = await import("../../define-config.js");
|
|
23
|
+
const config = await withConfigMetadataResolution(() => resolveConfig({
|
|
24
|
+
root: rootDir,
|
|
25
|
+
logLevel: "silent",
|
|
26
|
+
configLoader: "runner"
|
|
27
|
+
}, "build"));
|
|
28
|
+
const report = createMigrationReport();
|
|
29
|
+
checkManualChunksCompat(config.build?.rollupOptions?.output, report);
|
|
30
|
+
writeSync(process.stdout.fd, `${ROLLDOWN_COMPAT_RESULT_PREFIX}${JSON.stringify({ warnings: report.warnings })}\n`);
|
|
31
|
+
} catch {}
|
|
32
|
+
}
|
|
33
|
+
main().then(() => process.exit(0), () => process.exit(0));
|
|
34
|
+
//#endregion
|
|
35
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as VITE_PLUS_NAME } from "./constants-NeTOxrzV.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`;
|
package/dist/oxlint-plugin.js
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
import { n as VITE_PLUS_OXLINT_PLUGIN_NAME, t as PREFER_VITE_PLUS_IMPORTS_RULE_NAME } from "./oxlint-plugin-config-
|
|
1
|
+
import { n as VITE_PLUS_OXLINT_PLUGIN_NAME, t as PREFER_VITE_PLUS_IMPORTS_RULE_NAME } from "./oxlint-plugin-config-C2Rqc_WQ.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import fs from "node:fs";
|
|
2
4
|
import { definePlugin, defineRule } from "@oxlint/plugins";
|
|
5
|
+
//#region src/vite-config-entry-basenames.json
|
|
6
|
+
var vite_config_entry_basenames_default = [
|
|
7
|
+
"vite.config.ts",
|
|
8
|
+
"vite.config.mts",
|
|
9
|
+
"vite.config.cts",
|
|
10
|
+
"vite.config.js",
|
|
11
|
+
"vite.config.mjs",
|
|
12
|
+
"vite.config.cjs",
|
|
13
|
+
"vitest.config.ts",
|
|
14
|
+
"vitest.config.mts",
|
|
15
|
+
"vitest.config.cts",
|
|
16
|
+
"vitest.config.js",
|
|
17
|
+
"vitest.config.mjs",
|
|
18
|
+
"vitest.config.cjs"
|
|
19
|
+
];
|
|
20
|
+
//#endregion
|
|
3
21
|
//#region src/oxlint-plugin.ts
|
|
4
22
|
function isVitestFamilyDeclareModuleSpecifier(specifier) {
|
|
5
23
|
return specifier === "vitest" || specifier.startsWith("vitest/") || specifier === "@vitest/browser" || specifier.startsWith("@vitest/browser/") || specifier.startsWith("@vitest/browser-");
|
|
6
24
|
}
|
|
25
|
+
const VITE_CONFIG_FILE_BASENAMES = new Set(vite_config_entry_basenames_default);
|
|
26
|
+
function isViteSpecifier(specifier) {
|
|
27
|
+
return specifier === "vite" || specifier.startsWith("vite/");
|
|
28
|
+
}
|
|
29
|
+
function isViteConfigFile(filename) {
|
|
30
|
+
return VITE_CONFIG_FILE_BASENAMES.has(path.basename(filename));
|
|
31
|
+
}
|
|
7
32
|
function rewriteVitePlusImportSpecifier(specifier) {
|
|
8
33
|
if (specifier === "vite") return "vite-plus";
|
|
9
34
|
if (specifier.startsWith("vite/")) return `vite-plus/${specifier.slice(5)}`;
|
|
@@ -35,8 +60,46 @@ function quoteSpecifier(literal, replacement) {
|
|
|
35
60
|
const quote = literal.raw?.startsWith("'") ? "'" : "\"";
|
|
36
61
|
return `${quote}${replacement}${quote}`;
|
|
37
62
|
}
|
|
38
|
-
|
|
63
|
+
const nuxtTestUtilsPackageCache = /* @__PURE__ */ new Map();
|
|
64
|
+
function isUpstreamVitestSpecifier(specifier) {
|
|
65
|
+
return specifier === "vitest" || specifier.startsWith("vitest/");
|
|
66
|
+
}
|
|
67
|
+
function nearestPackageUsesNuxtTestUtils(filename) {
|
|
68
|
+
if (!path.isAbsolute(filename)) return false;
|
|
69
|
+
let directory = path.dirname(filename);
|
|
70
|
+
while (true) {
|
|
71
|
+
const packageJsonPath = path.join(directory, "package.json");
|
|
72
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
73
|
+
let mtimeMs;
|
|
74
|
+
try {
|
|
75
|
+
mtimeMs = fs.statSync(packageJsonPath).mtimeMs;
|
|
76
|
+
} catch {}
|
|
77
|
+
const cached = mtimeMs === void 0 ? void 0 : nuxtTestUtilsPackageCache.get(packageJsonPath);
|
|
78
|
+
if (cached !== void 0 && cached.mtimeMs === mtimeMs) return cached.usesNuxtTestUtils;
|
|
79
|
+
let usesNuxtTestUtils = false;
|
|
80
|
+
try {
|
|
81
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
82
|
+
usesNuxtTestUtils = [
|
|
83
|
+
pkg.dependencies,
|
|
84
|
+
pkg.devDependencies,
|
|
85
|
+
pkg.optionalDependencies
|
|
86
|
+
].some((dependencies) => dependencies?.["@nuxt/test-utils"] !== void 0);
|
|
87
|
+
} catch {}
|
|
88
|
+
if (mtimeMs !== void 0) nuxtTestUtilsPackageCache.set(packageJsonPath, {
|
|
89
|
+
mtimeMs,
|
|
90
|
+
usesNuxtTestUtils
|
|
91
|
+
});
|
|
92
|
+
return usesNuxtTestUtils;
|
|
93
|
+
}
|
|
94
|
+
const parent = path.dirname(directory);
|
|
95
|
+
if (parent === directory) return false;
|
|
96
|
+
directory = parent;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function maybeReportLiteral(context, literal, preserveUpstreamVitest = false, fileIsViteConfig = false) {
|
|
39
100
|
if (!literal || literal.type !== "Literal" || typeof literal.value !== "string") return;
|
|
101
|
+
if (preserveUpstreamVitest && isUpstreamVitestSpecifier(literal.value)) return;
|
|
102
|
+
if (!fileIsViteConfig && isViteSpecifier(literal.value)) return;
|
|
40
103
|
const replacement = rewriteVitePlusImportSpecifier(literal.value);
|
|
41
104
|
if (!replacement) return;
|
|
42
105
|
context.report({
|
|
@@ -63,30 +126,36 @@ const preferVitePlusImportsRule = defineRule({
|
|
|
63
126
|
messages: { preferVitePlusImports: "Use '{{to}}' instead of '{{from}}' in Vite+ projects." }
|
|
64
127
|
},
|
|
65
128
|
createOnce(context) {
|
|
129
|
+
let preserveUpstreamVitest = false;
|
|
130
|
+
let fileIsViteConfig = false;
|
|
66
131
|
return {
|
|
132
|
+
Program() {
|
|
133
|
+
preserveUpstreamVitest = nearestPackageUsesNuxtTestUtils(context.filename);
|
|
134
|
+
fileIsViteConfig = isViteConfigFile(context.filename);
|
|
135
|
+
},
|
|
67
136
|
ImportDeclaration(node) {
|
|
68
|
-
maybeReportLiteral(context, node.source);
|
|
137
|
+
maybeReportLiteral(context, node.source, preserveUpstreamVitest, fileIsViteConfig);
|
|
69
138
|
},
|
|
70
139
|
ExportAllDeclaration(node) {
|
|
71
|
-
maybeReportLiteral(context, node.source);
|
|
140
|
+
maybeReportLiteral(context, node.source, preserveUpstreamVitest, fileIsViteConfig);
|
|
72
141
|
},
|
|
73
142
|
ExportNamedDeclaration(node) {
|
|
74
|
-
maybeReportLiteral(context, node.source);
|
|
143
|
+
maybeReportLiteral(context, node.source, preserveUpstreamVitest, fileIsViteConfig);
|
|
75
144
|
},
|
|
76
145
|
ImportExpression(node) {
|
|
77
|
-
maybeReportLiteral(context, node.source);
|
|
146
|
+
maybeReportLiteral(context, node.source, preserveUpstreamVitest, fileIsViteConfig);
|
|
78
147
|
},
|
|
79
148
|
TSImportType(node) {
|
|
80
|
-
maybeReportLiteral(context, node.source);
|
|
149
|
+
maybeReportLiteral(context, node.source, preserveUpstreamVitest, fileIsViteConfig);
|
|
81
150
|
},
|
|
82
151
|
TSExternalModuleReference(node) {
|
|
83
|
-
maybeReportLiteral(context, node.expression);
|
|
152
|
+
maybeReportLiteral(context, node.expression, preserveUpstreamVitest, fileIsViteConfig);
|
|
84
153
|
},
|
|
85
154
|
TSModuleDeclaration(node) {
|
|
86
155
|
if (node.global) return;
|
|
87
156
|
const id = node.id;
|
|
88
157
|
if (id?.type === "Literal" && typeof id.value === "string" && isVitestFamilyDeclareModuleSpecifier(id.value)) return;
|
|
89
|
-
maybeReportLiteral(context, id);
|
|
158
|
+
maybeReportLiteral(context, id, preserveUpstreamVitest, fileIsViteConfig);
|
|
90
159
|
}
|
|
91
160
|
};
|
|
92
161
|
}
|
package/dist/pack-bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as resolveViteConfig } from "./resolve-vite-config-
|
|
2
|
+
import { a as resolveViteConfig } from "./resolve-vite-config-r91rIaPs.js";
|
|
3
3
|
import module from "node:module";
|
|
4
4
|
import { buildWithConfigs, enableDebug, globalLogger, resolveUserConfig } from "@voidzero-dev/vite-plus-core/pack";
|
|
5
5
|
//#region ../../node_modules/.pnpm/cac@7.0.0/node_modules/cac/dist/index.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./constants-
|
|
2
|
-
import {
|
|
1
|
+
import "./constants-NeTOxrzV.js";
|
|
2
|
+
import { i as readJsonFile } from "./json-DiRs8ceZ.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs";
|
|
@@ -138,9 +138,58 @@ function getScopeFromPackageName(packageName) {
|
|
|
138
138
|
if (packageName.startsWith("@")) return packageName.split("/")[0];
|
|
139
139
|
return "";
|
|
140
140
|
}
|
|
141
|
+
function findOwningPackageJson(resolvedPath, packageName) {
|
|
142
|
+
let currentDir;
|
|
143
|
+
try {
|
|
144
|
+
currentDir = fs.statSync(resolvedPath).isDirectory() ? resolvedPath : path.dirname(resolvedPath);
|
|
145
|
+
} catch {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
while (currentDir !== path.dirname(currentDir)) {
|
|
149
|
+
const candidate = path.join(currentDir, "package.json");
|
|
150
|
+
if (fs.existsSync(candidate)) try {
|
|
151
|
+
if (JSON.parse(fs.readFileSync(candidate, "utf8")).name === packageName) return candidate;
|
|
152
|
+
} catch {}
|
|
153
|
+
currentDir = path.dirname(currentDir);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function resolvePackageJsonWithNode(require, packageName) {
|
|
157
|
+
try {
|
|
158
|
+
return require.resolve(`${packageName}/package.json`);
|
|
159
|
+
} catch {}
|
|
160
|
+
try {
|
|
161
|
+
return findOwningPackageJson(require.resolve(packageName), packageName);
|
|
162
|
+
} catch {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function findPnpApiPath(projectPath) {
|
|
167
|
+
let currentDir = path.resolve(projectPath);
|
|
168
|
+
while (currentDir !== path.dirname(currentDir)) {
|
|
169
|
+
const candidate = path.join(currentDir, ".pnp.cjs");
|
|
170
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
171
|
+
currentDir = path.dirname(currentDir);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
141
174
|
function detectPackageMetadata(projectPath, packageName) {
|
|
175
|
+
const require = createRequire(path.join(projectPath, "noop.js"));
|
|
176
|
+
let pkgFilePath = resolvePackageJsonWithNode(require, packageName);
|
|
177
|
+
if (!pkgFilePath) {
|
|
178
|
+
const pnpApiPath = findPnpApiPath(projectPath);
|
|
179
|
+
if (!pnpApiPath) return;
|
|
180
|
+
try {
|
|
181
|
+
const pnpApi = createRequire(pnpApiPath)(pnpApiPath);
|
|
182
|
+
const issuer = path.join(projectPath, "noop.js");
|
|
183
|
+
if (pnpApi.findPackageLocator && !pnpApi.findPackageLocator(issuer)) return;
|
|
184
|
+
pnpApi.setup?.();
|
|
185
|
+
pkgFilePath = findOwningPackageJson(pnpApi.resolveToUnqualified(packageName, issuer), packageName);
|
|
186
|
+
if (!pkgFilePath) pkgFilePath = resolvePackageJsonWithNode(require, packageName);
|
|
187
|
+
} catch {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (!pkgFilePath) return;
|
|
142
192
|
try {
|
|
143
|
-
const pkgFilePath = createRequire(path.join(projectPath, "noop.js")).resolve(`${packageName}/package.json`);
|
|
144
193
|
const pkg = JSON.parse(fs.readFileSync(pkgFilePath, "utf8"));
|
|
145
194
|
return {
|
|
146
195
|
name: pkg.name,
|
|
@@ -9,6 +9,7 @@ function createMigrationReport() {
|
|
|
9
9
|
tsdownImportCount: 0,
|
|
10
10
|
wrappedPluginConfigCount: 0,
|
|
11
11
|
rewrittenImportFileCount: 0,
|
|
12
|
+
preservedUpstreamVitestImportFileCount: 0,
|
|
12
13
|
rewrittenImportErrors: [],
|
|
13
14
|
eslintMigrated: false,
|
|
14
15
|
prettierMigrated: false,
|
|
@@ -16,6 +17,7 @@ function createMigrationReport() {
|
|
|
16
17
|
gitHooksConfigured: false,
|
|
17
18
|
frameworkShimAdded: false,
|
|
18
19
|
packageManagerBootstrapConfigured: false,
|
|
20
|
+
dependencyUpgrades: [],
|
|
19
21
|
warnings: [],
|
|
20
22
|
manualSteps: []
|
|
21
23
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { u as withConfigMetadataResolution } from "./define-config-CSgy0zML.js";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import fs from "node:fs";
|
|
3
4
|
//#region src/resolve-vite-config.ts
|
|
@@ -61,17 +62,19 @@ function findWorkspaceRoot(startDir) {
|
|
|
61
62
|
*/
|
|
62
63
|
async function resolveViteConfig(cwd, options) {
|
|
63
64
|
const { resolveConfig } = await import("./index.js");
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
return withConfigMetadataResolution(async () => {
|
|
66
|
+
if (options?.traverseUp && !hasViteConfig(cwd)) {
|
|
67
|
+
const workspaceRoot = findWorkspaceRoot(cwd);
|
|
68
|
+
if (workspaceRoot) {
|
|
69
|
+
const configFile = findViteConfigUp(path.dirname(cwd), workspaceRoot);
|
|
70
|
+
if (configFile) return resolveConfig({
|
|
71
|
+
root: cwd,
|
|
72
|
+
configFile
|
|
73
|
+
}, "build");
|
|
74
|
+
}
|
|
72
75
|
}
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
return resolveConfig({ root: cwd }, "build");
|
|
77
|
+
});
|
|
75
78
|
}
|
|
76
79
|
async function resolveUniversalViteConfig(err, viteConfigCwd) {
|
|
77
80
|
if (err) throw err;
|
|
@@ -81,6 +84,7 @@ async function resolveUniversalViteConfig(err, viteConfigCwd) {
|
|
|
81
84
|
configFile: config.configFile,
|
|
82
85
|
lint: config.lint,
|
|
83
86
|
fmt: config.fmt,
|
|
87
|
+
check: config.check,
|
|
84
88
|
run: config.run,
|
|
85
89
|
staged: config.staged
|
|
86
90
|
});
|
|
@@ -21,6 +21,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
value: mod,
|
|
22
22
|
enumerable: true
|
|
23
23
|
}) : target, mod));
|
|
24
|
-
var __require = /*
|
|
24
|
+
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
25
25
|
//#endregion
|
|
26
26
|
export { __require as n, __toESM as r, __commonJSMin as t };
|
package/dist/staged/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-
|
|
1
|
+
import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-C7HZzL1F.js";
|
|
2
2
|
import { a as printHeader, n as errorMsg, r as log } from "../terminal-uTv0ZaMr.js";
|
|
3
|
-
import { a as resolveViteConfig } from "../resolve-vite-config-
|
|
3
|
+
import { a as resolveViteConfig } from "../resolve-vite-config-r91rIaPs.js";
|
|
4
4
|
import { t as lib_default } from "../lib-L3DWSRQp.js";
|
|
5
5
|
import { t as renderCliDoc } from "../help-YP84FSEz.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -8,7 +8,7 @@ import path, { basename, delimiter, dirname, normalize, resolve } from "node:pat
|
|
|
8
8
|
import { closeSync, constants, openSync, readSync, statSync } from "node:fs";
|
|
9
9
|
import { formatWithOptions, inspect, promisify } from "node:util";
|
|
10
10
|
import { cwd } from "node:process";
|
|
11
|
-
import
|
|
11
|
+
import l__default from "node:readline";
|
|
12
12
|
import nodeTty from "node:tty";
|
|
13
13
|
import { pathToFileURL } from "node:url";
|
|
14
14
|
import { EOL } from "node:os";
|
|
@@ -363,7 +363,7 @@ var I = class {
|
|
|
363
363
|
if (this._streamErr) t.push(this._streamErr);
|
|
364
364
|
if (this._streamOut) t.push(this._streamOut);
|
|
365
365
|
const n = b(t);
|
|
366
|
-
const r =
|
|
366
|
+
const r = l__default.createInterface({ input: n });
|
|
367
367
|
for await (const e of r) yield e.toString();
|
|
368
368
|
await this._processClosed;
|
|
369
369
|
e.removeAllListeners();
|
|
@@ -1544,9 +1544,9 @@ var DefaultRenderer = class DefaultRenderer {
|
|
|
1544
1544
|
this.logger.options.color = this.options.color;
|
|
1545
1545
|
}
|
|
1546
1546
|
async render() {
|
|
1547
|
-
const { createLogUpdate } = await import("../log-update-
|
|
1548
|
-
const { default: truncate } = await import("../cli-truncate-
|
|
1549
|
-
const { default: wrap } = await import("../wrap-ansi-
|
|
1547
|
+
const { createLogUpdate } = await import("../log-update-DHZRyJ2m.js");
|
|
1548
|
+
const { default: truncate } = await import("../cli-truncate-BVOlIIPy.js");
|
|
1549
|
+
const { default: wrap } = await import("../wrap-ansi-DUi52C6W.js");
|
|
1550
1550
|
this.updater = createLogUpdate(this.logger.process.stdout);
|
|
1551
1551
|
this.truncate = truncate;
|
|
1552
1552
|
this.wrap = wrap;
|
|
@@ -3807,7 +3807,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3807
3807
|
};
|
|
3808
3808
|
const extglobClose = (token) => {
|
|
3809
3809
|
const literal = input.slice(token.startIndex, state.index + 1);
|
|
3810
|
-
const
|
|
3810
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
3811
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
3811
3812
|
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
3812
3813
|
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
3813
3814
|
const open = tokens[token.tokensIndex];
|
|
@@ -3933,7 +3934,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3933
3934
|
if (inner.includes(":")) {
|
|
3934
3935
|
const idx = prev.value.lastIndexOf("[");
|
|
3935
3936
|
const pre = prev.value.slice(0, idx);
|
|
3936
|
-
const
|
|
3937
|
+
const rest = prev.value.slice(idx + 2);
|
|
3938
|
+
const posix = POSIX_REGEX_SOURCE[rest];
|
|
3937
3939
|
if (posix) {
|
|
3938
3940
|
prev.value = pre + posix;
|
|
3939
3941
|
state.backtrack = true;
|
|
@@ -5614,11 +5616,12 @@ var GitWorkflow = class {
|
|
|
5614
5616
|
async runTasks(ctx, task, { listrTasks, concurrent }) {
|
|
5615
5617
|
if (ctx.shouldFailOnChanges) {
|
|
5616
5618
|
debugLog$8("Calculating SHA-256 hash of unstaged changes because \"--fail-on-changes\" was used...");
|
|
5617
|
-
|
|
5619
|
+
const diff = await this.execGit([
|
|
5618
5620
|
"diff",
|
|
5619
5621
|
"--patch",
|
|
5620
5622
|
"--unified=0"
|
|
5621
|
-
])
|
|
5623
|
+
]);
|
|
5624
|
+
ctx.unstagedDiffSha256 = calculateSha256(diff);
|
|
5622
5625
|
debugLog$8("SHA-256 hash of unstaged changes is %s", ctx.unstagedDiffSha256);
|
|
5623
5626
|
}
|
|
5624
5627
|
return task.newListr(listrTasks, { concurrent });
|
|
@@ -5630,11 +5633,12 @@ var GitWorkflow = class {
|
|
|
5630
5633
|
async applyModifications(ctx) {
|
|
5631
5634
|
if (ctx.shouldFailOnChanges) {
|
|
5632
5635
|
debugLog$8("Calculating SHA-256 hash of changes after tasks because \"--fail-on-changes\" was used...");
|
|
5633
|
-
const
|
|
5636
|
+
const diff = await this.execGit([
|
|
5634
5637
|
"diff",
|
|
5635
5638
|
"--patch",
|
|
5636
5639
|
"--unified=0"
|
|
5637
|
-
])
|
|
5640
|
+
]);
|
|
5641
|
+
const diffSha256 = calculateSha256(diff);
|
|
5638
5642
|
debugLog$8("SHA-256 hash of changes after tasks is %s", diffSha256);
|
|
5639
5643
|
if (ctx.unstagedDiffSha256 !== diffSha256) {
|
|
5640
5644
|
ctx.errors.add(FailOnChangesError);
|
|
@@ -5912,7 +5916,7 @@ const jsonParse = async (filename) => {
|
|
|
5912
5916
|
const yamlParse = async (filename) => {
|
|
5913
5917
|
const isPackageFile = PACKAGE_YAML_FILES.includes(path.basename(filename));
|
|
5914
5918
|
try {
|
|
5915
|
-
const [YAML, content] = await Promise.all([import("../dist-
|
|
5919
|
+
const [YAML, content] = await Promise.all([import("../dist-CtM2JRbM.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)), readFile(filename)]);
|
|
5916
5920
|
const yaml = YAML.parse(content);
|
|
5917
5921
|
return isPackageFile ? yaml[CONFIG_NAME] : yaml;
|
|
5918
5922
|
} catch (error) {
|
|
@@ -5945,7 +5949,8 @@ const loaders = {
|
|
|
5945
5949
|
};
|
|
5946
5950
|
const loadConfigByExt = async (filename) => {
|
|
5947
5951
|
const filepath = path.resolve(filename);
|
|
5948
|
-
const
|
|
5952
|
+
const ext = path.extname(filepath) || NO_EXT;
|
|
5953
|
+
const loader = loaders[ext];
|
|
5949
5954
|
return {
|
|
5950
5955
|
config: await loader(filepath),
|
|
5951
5956
|
filepath
|
|
@@ -6486,9 +6491,7 @@ const validateOptions = async (options = {}, logger) => {
|
|
|
6486
6491
|
};
|
|
6487
6492
|
//#endregion
|
|
6488
6493
|
//#region ../../node_modules/.pnpm/lint-staged@16.4.0/node_modules/lint-staged/lib/version.js
|
|
6489
|
-
const getVersion = async () =>
|
|
6490
|
-
return JSON.parse(await fsPromises.readFile(new URL("../package.json", import.meta.url))).version;
|
|
6491
|
-
};
|
|
6494
|
+
const getVersion = async () => "16.4.0";
|
|
6492
6495
|
//#endregion
|
|
6493
6496
|
//#region ../../node_modules/.pnpm/lint-staged@16.4.0/node_modules/lint-staged/lib/index.js
|
|
6494
6497
|
const debugLog = createDebug("lint-staged");
|
|
@@ -6541,7 +6544,8 @@ const lintStaged = async ({ allowEmpty = false, color = SUPPORTS_COLOR, concurre
|
|
|
6541
6544
|
enableDebug(logger);
|
|
6542
6545
|
debugLog("Running `lint-staged@%s` on Node.js %s (%s)", await getVersion(), process.version, process.platform);
|
|
6543
6546
|
}
|
|
6544
|
-
|
|
6547
|
+
const gitVersion = await execGit(["version", "--build-options"], { cwd });
|
|
6548
|
+
debugLog("%s", gitVersion);
|
|
6545
6549
|
const options = {
|
|
6546
6550
|
allowEmpty,
|
|
6547
6551
|
color,
|