vite-plus 1.4.0 → 1.5.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/binding/index.cjs +54 -54
- package/binding/index.d.cts +31 -0
- package/dist/{agent-D8oxxhVR.js → agent-DkQD3xqe.js} +2 -2
- package/dist/bin.js +15 -7
- package/dist/config/bin.js +5 -5
- package/dist/{constants-DRUnJ_Dz.js → constants-D2P2aVKb.js} +6 -2
- package/dist/create/bin.js +114 -64
- package/dist/{define-config-rPhYIFSn.d.ts → define-config-BrvHRi-G.d.ts} +30 -2
- package/dist/{define-config-Cv2P6NT2.cjs → define-config-CwtQqYC1.cjs} +35 -3
- package/dist/{define-config-ChwJcu5e.js → define-config-wR57OZG_.js} +30 -5
- package/dist/define-config.cjs +2 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +1 -1
- package/dist/{editor-ClL78D8u.js → editor-aOy1T15H.js} +1266 -884
- package/dist/hooks/bin.js +2 -2
- package/dist/{hooks-xRcJPc-O.js → hooks-w_e2whkQ.js} +40 -21
- package/dist/index.cjs +4 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +1302 -311
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BVpqYdcC.js → oxlint-plugin-config-CHsI_zKo.js} +1 -1
- package/dist/oxlint-plugin.js +29 -4
- package/dist/pack-bin.js +2 -2
- package/dist/{package-DzsomcUD.js → package-DfFo6-E-.js} +1 -1
- package/dist/{prompts-GL1vj0wk.js → prompts-C7DI63WP.js} +3 -3
- package/dist/register.d.ts +1 -0
- package/dist/register.js +12 -0
- package/dist/{report-DLHO30yZ.js → report-BEdpIQvC.js} +2 -0
- package/dist/{resolve-vite-config-QO6cC0SP.js → resolve-vite-config-33bzSaeT.js} +1 -1
- package/dist/{resolve-vite-config-Dn5896A4.js → resolve-vite-config-Cx3cnVVI.js} +2 -2
- package/dist/script-esm-hooks.d.ts +5 -2
- package/dist/script-esm-hooks.js +5 -2
- package/dist/script-preload.cjs +24 -1
- package/dist/script-register.js +7 -2
- package/dist/script-watch.js +135 -41
- package/dist/staged/bin.js +2 -2
- package/dist/sync-versions/bin.js +1 -1
- package/dist/toolchain.js +13 -13
- package/dist/toolchain.json +13 -13
- package/dist/{tsconfig-Do6MAG_f.js → tsconfig-BE3Wj9OX.js} +1 -1
- package/dist/{tsconfig-LE_mAwe_.js → tsconfig-shNmmCE_.js} +2 -2
- package/dist/version.js +2 -2
- package/dist/versions.js +6 -6
- package/docs/config/check.md +2 -0
- package/docs/config/fmt.md +1 -1
- package/docs/config/lint.md +1 -1
- package/docs/config/run.md +6 -2
- package/docs/config/staged.md +1 -1
- package/docs/guide/check.md +5 -1
- package/docs/guide/ci.md +2 -2
- package/docs/guide/create.md +1 -1
- package/docs/guide/env.md +1 -1
- package/docs/guide/global-cli.md +12 -8
- package/docs/guide/homebrew.md +127 -0
- package/docs/guide/ide-integration.md +1 -3
- package/docs/guide/implode.md +5 -3
- package/docs/guide/local-cli.md +21 -0
- package/docs/guide/migrate-rules.md +81 -22
- package/docs/guide/migrate.md +9 -9
- package/docs/guide/run.md +23 -1
- package/docs/guide/test.md +1 -1
- package/docs/guide/troubleshooting.md +1 -1
- package/docs/guide/upgrade.md +12 -6
- package/docs/guide/vitest-v5.md +2 -2
- package/docs/guide/vpx.md +44 -4
- package/package.json +39 -33
package/dist/hooks/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import { d as status, i as enable, r as disable } from "../hooks-xRcJPc-O.js";
|
|
1
|
+
import { d as status, i as enable, r as disable } from "../hooks-w_e2whkQ.js";
|
|
3
2
|
import { t as unwrapCliParseOutcome } from "../cli-parse-aeUeFDlC.js";
|
|
3
|
+
import { i as log } from "../terminal-BcuPUy-j.js";
|
|
4
4
|
import { parseHooksArgs } from "../../binding/index.js";
|
|
5
5
|
// src/hooks/bin.ts
|
|
6
6
|
function applyResult(result) {
|
|
@@ -168,39 +168,68 @@ function gitConfigLocalMissing(key) {
|
|
|
168
168
|
key
|
|
169
169
|
]).status === 1;
|
|
170
170
|
}
|
|
171
|
+
const GIT_CONFIG_LOCK_STATUSES = /* @__PURE__ */ new Set([255, 4294967295]);
|
|
172
|
+
const GIT_CONFIG_NO_LOCK_RETRY = ["-c", "core.configLockTimeout=0"];
|
|
173
|
+
const GIT_CONFIG_LOCK_RETRY_DELAYS_MS = [
|
|
174
|
+
50,
|
|
175
|
+
100,
|
|
176
|
+
200,
|
|
177
|
+
400,
|
|
178
|
+
800
|
|
179
|
+
];
|
|
180
|
+
function sleepSync(ms) {
|
|
181
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
182
|
+
}
|
|
183
|
+
function writeGitConfig(args, isApplied) {
|
|
184
|
+
const gitArgs = [...GIT_CONFIG_NO_LOCK_RETRY, ...args];
|
|
185
|
+
let result = spawnSync("git", gitArgs);
|
|
186
|
+
for (const delay of GIT_CONFIG_LOCK_RETRY_DELAYS_MS) {
|
|
187
|
+
if (!GIT_CONFIG_LOCK_STATUSES.has(result.status)) break;
|
|
188
|
+
sleepSync(delay);
|
|
189
|
+
if (isApplied()) return {
|
|
190
|
+
status: 0,
|
|
191
|
+
stderr: ""
|
|
192
|
+
};
|
|
193
|
+
result = spawnSync("git", gitArgs);
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
status: result.status,
|
|
197
|
+
stderr: result.stderr?.toString().trim() ?? ""
|
|
198
|
+
};
|
|
199
|
+
}
|
|
171
200
|
function gitConfigSet(key, value) {
|
|
172
201
|
if (gitConfigLocalHas(key, value)) return { ok: true };
|
|
173
|
-
const result =
|
|
202
|
+
const result = writeGitConfig([
|
|
174
203
|
"config",
|
|
175
204
|
"--local",
|
|
176
205
|
key,
|
|
177
206
|
value
|
|
178
|
-
]);
|
|
207
|
+
], () => gitConfigLocalHas(key, value));
|
|
179
208
|
if (result.status == null) return {
|
|
180
209
|
ok: false,
|
|
181
210
|
error: "git command not found"
|
|
182
211
|
};
|
|
183
212
|
if (result.status !== 0) return {
|
|
184
213
|
ok: false,
|
|
185
|
-
error: result.stderr
|
|
214
|
+
error: result.stderr || `failed to set ${key}`
|
|
186
215
|
};
|
|
187
216
|
return { ok: true };
|
|
188
217
|
}
|
|
189
218
|
function gitConfigUnset(key) {
|
|
190
219
|
if (gitConfigLocalMissing(key)) return { ok: true };
|
|
191
|
-
const result =
|
|
220
|
+
const result = writeGitConfig([
|
|
192
221
|
"config",
|
|
193
222
|
"--local",
|
|
194
223
|
"--unset-all",
|
|
195
224
|
key
|
|
196
|
-
]);
|
|
225
|
+
], () => gitConfigLocalMissing(key));
|
|
197
226
|
if (result.status == null) return {
|
|
198
227
|
ok: false,
|
|
199
228
|
error: "git command not found"
|
|
200
229
|
};
|
|
201
230
|
if (result.status !== 0 && result.status !== 5) return {
|
|
202
231
|
ok: false,
|
|
203
|
-
error: result.stderr
|
|
232
|
+
error: result.stderr || `failed to unset ${key}`
|
|
204
233
|
};
|
|
205
234
|
return { ok: true };
|
|
206
235
|
}
|
|
@@ -426,21 +455,11 @@ function install(dir, options = {}) {
|
|
|
426
455
|
writeFileSync(internal(hook), HOOK_STUB_SCRIPT, { mode: 493 });
|
|
427
456
|
chmodSync(internal(hook), 493);
|
|
428
457
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
]);
|
|
435
|
-
if (status == null) return {
|
|
436
|
-
message: "git command not found",
|
|
437
|
-
isError: true
|
|
438
|
-
};
|
|
439
|
-
if (status) return {
|
|
440
|
-
message: "" + stderr,
|
|
441
|
-
isError: true
|
|
442
|
-
};
|
|
443
|
-
}
|
|
458
|
+
const storeHooksPath = gitConfigSet("core.hooksPath", location.target);
|
|
459
|
+
if (!storeHooksPath.ok) return {
|
|
460
|
+
message: storeHooksPath.error || "failed to set core.hooksPath",
|
|
461
|
+
isError: true
|
|
462
|
+
};
|
|
444
463
|
const clearDisabled = setHooksUserDisabled(false);
|
|
445
464
|
if (!clearDisabled.ok) return {
|
|
446
465
|
message: clearDisabled.error || "failed to clear hooks disabled preference",
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_define_config = require("./define-config-
|
|
1
|
+
const require_define_config = require("./define-config-CwtQqYC1.cjs");
|
|
2
2
|
// src/index.cts
|
|
3
3
|
const vite = require("vite");
|
|
4
4
|
const { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } = require("vitest/config");
|
|
5
|
-
const { defineConfig, defineProject, lazyPlugins } = (require_define_config.init_define_config(), require_define_config.__toCommonJS(require_define_config.define_config_exports));
|
|
5
|
+
const { defineConfig, defineProject, lazyPlugins, resolveConfigFromFile } = (require_define_config.init_define_config(), require_define_config.__toCommonJS(require_define_config.define_config_exports));
|
|
6
6
|
module.exports = {
|
|
7
7
|
...vite,
|
|
8
8
|
configDefaults,
|
|
@@ -12,5 +12,6 @@ module.exports = {
|
|
|
12
12
|
defaultInclude,
|
|
13
13
|
defineProject,
|
|
14
14
|
defineConfig,
|
|
15
|
-
lazyPlugins
|
|
15
|
+
lazyPlugins,
|
|
16
|
+
resolveConfigFromFile
|
|
16
17
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as lazyPlugins, n as ResolveConfigFromFileOptions, o as defineConfig, s as defineProject, u as resolveConfigFromFile } from "./define-config-BrvHRi-G.js";
|
|
2
2
|
import { TestProjectConfiguration, TestProjectInlineConfiguration, TestTagDefinition, TestUserConfig, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, ViteUserConfig, ViteUserConfigExport, ViteUserConfigFn, ViteUserConfigFnObject, ViteUserConfigFnPromise, WatcherTriggerPattern, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
|
|
3
3
|
export * from "vite";
|
|
4
|
-
export { type TestProjectConfiguration, type TestProjectInlineConfiguration, type TestTagDefinition, type TestUserConfig, type UserProjectConfigExport, type UserProjectConfigFn, type UserWorkspaceConfig, type ViteUserConfig, type ViteUserConfigExport, type ViteUserConfigFn, type ViteUserConfigFnObject, type ViteUserConfigFnPromise, type WatcherTriggerPattern, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins };
|
|
4
|
+
export { type ResolveConfigFromFileOptions, type TestProjectConfiguration, type TestProjectInlineConfiguration, type TestTagDefinition, type TestUserConfig, type UserProjectConfigExport, type UserProjectConfigFn, type UserWorkspaceConfig, type ViteUserConfig, type ViteUserConfigExport, type ViteUserConfigFn, type ViteUserConfigFnObject, type ViteUserConfigFnPromise, type WatcherTriggerPattern, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins, resolveConfigFromFile };
|
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, l as resolveConfigFromFile, o as defineProject } from "./define-config-wR57OZG_.js";
|
|
2
2
|
import { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
|
|
3
3
|
export * from "vite";
|
|
4
|
-
export { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins };
|
|
4
|
+
export { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins, resolveConfigFromFile };
|
package/dist/lint-plugins.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./define-config-
|
|
2
|
+
require("./define-config-CwtQqYC1.cjs");
|
|
3
3
|
let _oxlint_plugins = require("@oxlint/plugins");
|
|
4
4
|
Object.defineProperty(exports, "definePlugin", {
|
|
5
5
|
enumerable: true,
|