vite-plus 0.3.3 → 1.0.0-rc.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/LICENSE +35 -146
- package/README.md +3 -3
- package/binding/index.cjs +57 -54
- package/binding/index.d.cts +9 -0
- package/dist/{agent-Cu6-tXIP.js → agent-Dinpyd-k.js} +6 -5
- package/dist/bin.js +48 -18
- package/dist/config/bin.js +2 -2
- package/dist/constants-CiKwrA0v.js +356 -0
- package/dist/create/bin.js +18 -12
- package/dist/{define-config-DPNEJxPz.d.ts → define-config-B9usMnEa.d.ts} +51 -10
- package/dist/{define-config-D0mevyb3.cjs → define-config-CBccpane.cjs} +173 -44
- package/dist/{define-config-IgzmnvvV.js → define-config-jhuYJ7Tb.js} +158 -42
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/documentation-DqcZSthV.js +11 -0
- package/dist/{editor-4sjlHmUh.js → editor-DMBczTdj.js} +205 -152
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-cULBl7Pi.js → json-JP24qHUF.js} +14 -6
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +3122 -15
- package/dist/{oxlint-plugin-config-BVqEe9KY.js → oxlint-plugin-config-BgsDA6ua.js} +1 -1
- package/dist/oxlint-plugin.js +9 -7
- package/dist/pack-bin.js +1 -1
- package/dist/{package-CHH8jWan.js → package-B85H2Nw0.js} +6 -2
- package/dist/{vitest-ecosystem-BiRqcaRI.js → package-overrides-Dpn4scvN.js} +1 -7
- package/dist/{prompts-k14KgthC.js → prompts-CQobX7uP.js} +2 -2
- package/dist/{resolve-vite-config-BqvS2P98.js → resolve-vite-config-BUFUmi8h.js} +2 -2
- package/dist/{resolve-vite-config-CTOTuqTi.js → resolve-vite-config-I8fmpR7I.js} +1 -1
- package/dist/staged/bin.js +1205 -3317
- package/dist/sync-versions/bin.js +3 -2
- package/dist/sync-versions/bin.mjs +17 -2
- package/dist/test/browser/context.js +1 -1
- package/dist/test/browser/providers/playwright/context.js +1 -1
- package/dist/test/browser/providers/preview/context.js +1 -1
- package/dist/test/browser-playwright/context.js +1 -1
- package/dist/test/browser-preview/context.js +1 -1
- package/dist/test/context.d.ts +2 -942
- package/dist/test/context.js +1 -1
- package/dist/test/internal/traces.js +1 -0
- package/dist/test/locators.d.ts +2 -294
- package/dist/test/matchers.d.ts +2 -29
- package/dist/test/mocker.d.ts +2 -0
- package/dist/test/mocker.js +1 -0
- package/dist/test/{browser-webdriverio/context.js → plugins/browser-context.d.ts} +1 -0
- package/dist/test/plugins/browser-context.js +1 -1
- package/dist/test/plugins/browser-locators.d.ts +2 -0
- package/dist/test/plugins/browser-playwright.d.ts +2 -0
- package/dist/test/plugins/browser-preview.d.ts +2 -0
- package/dist/test/plugins/browser.d.ts +2 -0
- package/dist/test/plugins/mocker-automock.d.ts +2 -0
- package/dist/test/plugins/mocker-browser.d.ts +2 -0
- package/dist/test/plugins/mocker-node.d.ts +2 -0
- package/dist/test/plugins/mocker-redirect.d.ts +2 -0
- package/dist/test/plugins/mocker-register.d.ts +2 -0
- package/dist/test/plugins/mocker-transforms.d.ts +2 -0
- package/dist/test/plugins/mocker.d.ts +2 -0
- package/dist/test/plugins/pretty-format.d.ts +2 -0
- package/dist/test/plugins/snapshot-environment.d.ts +2 -0
- package/dist/test/plugins/snapshot-manager.d.ts +2 -0
- package/dist/test/plugins/snapshot.d.ts +2 -0
- package/dist/test/plugins/spy.d.ts +2 -0
- package/dist/test/plugins/utils-constants.d.ts +2 -0
- package/dist/test/plugins/utils-diff.d.ts +2 -0
- package/dist/test/plugins/utils-display.d.ts +2 -0
- package/dist/test/plugins/utils-error.d.ts +2 -0
- package/dist/test/plugins/utils-helpers.d.ts +2 -0
- package/dist/test/plugins/utils-offset.d.ts +2 -0
- package/dist/test/plugins/utils-resolver.d.ts +2 -0
- package/dist/test/plugins/utils-serialize.d.ts +2 -0
- package/dist/test/plugins/utils-source-map-node.d.ts +2 -0
- package/dist/test/plugins/utils-source-map.d.ts +2 -0
- package/dist/test/plugins/utils-timers.d.ts +2 -0
- package/dist/test/plugins/utils.d.ts +2 -0
- package/dist/toolchain.js +8 -8
- package/dist/toolchain.json +8 -8
- package/dist/{tsconfig-C3h9CVTA.js → tsconfig-Buo0RSzz.js} +8 -4
- package/dist/{tsconfig-euB-GmIE.js → tsconfig-C1VeTG9k.js} +1 -1
- package/dist/version.js +5 -3
- package/dist/versions.js +4 -4
- package/dist/vitest-ecosystem-BU0AqZq-.js +23 -0
- package/dist/vitest-v5-entry-points-DthU1e_O.js +25 -0
- package/docs/config/fmt.md +2 -2
- package/docs/config/lint.md +2 -2
- package/docs/config/run.md +1 -1
- package/docs/guide/check.md +2 -0
- package/docs/guide/commit-hooks.md +8 -1
- package/docs/guide/env.md +18 -13
- package/docs/guide/fmt.md +4 -2
- package/docs/guide/index.md +1 -1
- package/docs/guide/install.md +1 -1
- package/docs/guide/lint.md +3 -1
- package/docs/guide/local-cli.md +3 -3
- package/docs/guide/migrate-rules.md +16 -12
- package/docs/guide/migrate.md +86 -20
- package/docs/guide/monorepo.md +5 -1
- package/docs/guide/test.md +2 -0
- package/docs/guide/troubleshooting.md +3 -3
- package/docs/guide/vitest-v5.md +221 -0
- package/package.json +64 -87
- package/bin/oxfmt +0 -33
- package/bin/oxlint +0 -38
- package/dist/cli-truncate-Bg3RDXpi.js +0 -865
- package/dist/constants-C2dTOTe-.js +0 -80
- package/dist/is-fullwidth-code-point-BUNlIICg.js +0 -8
- package/dist/log-update-CoW8Z4Dl.js +0 -491
- package/dist/strip-ansi-C3wrWz9t.js +0 -853
- package/dist/test/browser/providers/webdriverio/context.d.ts +0 -1
- package/dist/test/browser/providers/webdriverio/context.js +0 -1
- package/dist/test/browser/providers/webdriverio.d.ts +0 -77
- package/dist/test/browser/providers/webdriverio.js +0 -1
- package/dist/test/browser-webdriverio/context.d.ts +0 -1
- package/dist/test/browser-webdriverio.d.ts +0 -77
- package/dist/test/browser-webdriverio.js +0 -1
- package/dist/test/coverage.d.ts +0 -2
- package/dist/test/coverage.js +0 -1
- package/dist/test/environments.d.ts +0 -2
- package/dist/test/environments.js +0 -1
- package/dist/test/plugins/browser-webdriverio.js +0 -1
- package/dist/test/plugins/expect.js +0 -1
- package/dist/test/plugins/runner-types.js +0 -1
- package/dist/test/plugins/runner-utils.js +0 -1
- package/dist/test/plugins/runner.js +0 -1
- package/dist/test/reporters.d.ts +0 -2
- package/dist/test/reporters.js +0 -1
- package/dist/test/runners.d.ts +0 -2
- package/dist/test/runners.js +0 -1
- package/dist/test/snapshot.d.ts +0 -2
- package/dist/test/snapshot.js +0 -1
- package/dist/test/suite.d.ts +0 -2
- package/dist/test/suite.js +0 -1
- package/dist/tsgolint-path-CbDReEOx.js +0 -34
- package/dist/tsgolint-path.d.ts +0 -7
- package/dist/tsgolint-path.js +0 -2
- package/dist/wrap-ansi-DNjkuBEp.js +0 -157
- package/dist/wrap-ansi-DUi52C6W.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as VITE_PLUS_NAME } from "./constants-
|
|
1
|
+
import { u as VITE_PLUS_NAME } from "./constants-CiKwrA0v.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,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v as exports } from "./constants-CiKwrA0v.js";
|
|
2
|
+
import { n as VITE_PLUS_OXLINT_PLUGIN_NAME, t as PREFER_VITE_PLUS_IMPORTS_RULE_NAME } from "./oxlint-plugin-config-BgsDA6ua.js";
|
|
3
|
+
import { t as vitest_v5_entry_points_default } from "./vitest-v5-entry-points-DthU1e_O.js";
|
|
2
4
|
import path from "node:path";
|
|
3
5
|
import fs from "node:fs";
|
|
4
6
|
import { definePlugin, defineRule } from "@oxlint/plugins";
|
|
@@ -56,7 +58,11 @@ function rewriteVitePlusImportSpecifier(specifier) {
|
|
|
56
58
|
if (specifier === "vitest/config") return "vite-plus";
|
|
57
59
|
if (specifier === "vitest") return "vite-plus/test";
|
|
58
60
|
if (specifier === "vitest/package.json") return null;
|
|
59
|
-
if (specifier
|
|
61
|
+
if (specifier in vitest_v5_entry_points_default) return vitest_v5_entry_points_default[specifier];
|
|
62
|
+
if (specifier.startsWith("vitest/")) {
|
|
63
|
+
const subpath = `./test/${specifier.slice(7)}`;
|
|
64
|
+
return subpath in exports ? `vite-plus${subpath.slice(1)}` : null;
|
|
65
|
+
}
|
|
60
66
|
if (specifier === "@vitest/browser") return "vite-plus/test/browser";
|
|
61
67
|
const browserSubpathRewrites = {
|
|
62
68
|
"@vitest/browser/context": "vite-plus/test/browser/context",
|
|
@@ -66,11 +72,7 @@ function rewriteVitePlusImportSpecifier(specifier) {
|
|
|
66
72
|
"@vitest/browser/utils": "vite-plus/test/utils"
|
|
67
73
|
};
|
|
68
74
|
if (specifier in browserSubpathRewrites) return browserSubpathRewrites[specifier];
|
|
69
|
-
for (const [prefix, provider] of [
|
|
70
|
-
["@vitest/browser-playwright", "playwright"],
|
|
71
|
-
["@vitest/browser-preview", "preview"],
|
|
72
|
-
["@vitest/browser-webdriverio", "webdriverio"]
|
|
73
|
-
]) {
|
|
75
|
+
for (const [prefix, provider] of [["@vitest/browser-playwright", "playwright"], ["@vitest/browser-preview", "preview"]]) {
|
|
74
76
|
if (specifier === prefix) return `vite-plus/test/${prefix.slice(8)}`;
|
|
75
77
|
if (specifier === `${prefix}/context`) return "vite-plus/test/browser/context";
|
|
76
78
|
if (specifier === `${prefix}/provider`) return `vite-plus/test/browser/providers/${provider}`;
|
package/dist/pack-bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as cac } from "./dist-DfmT__Aw.js";
|
|
3
|
-
import { o as resolveViteConfig } from "./resolve-vite-config-
|
|
3
|
+
import { o as resolveViteConfig } from "./resolve-vite-config-BUFUmi8h.js";
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
import { buildWithConfigs, enableDebug, globalLogger, resolveUserConfig } from "vite/pack";
|
|
6
6
|
//#region src/pack-bin.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./constants-
|
|
2
|
-
import { i as readJsonFile } from "./json-
|
|
1
|
+
import "./constants-CiKwrA0v.js";
|
|
2
|
+
import { i as readJsonFile } from "./json-JP24qHUF.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs";
|
|
@@ -157,6 +157,10 @@ function resolvePackageJsonWithNode(require, packageName) {
|
|
|
157
157
|
try {
|
|
158
158
|
return require.resolve(`${packageName}/package.json`);
|
|
159
159
|
} catch {}
|
|
160
|
+
for (const searchPath of require.resolve.paths(packageName) ?? []) {
|
|
161
|
+
const candidate = path.join(searchPath, packageName, "package.json");
|
|
162
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
163
|
+
}
|
|
160
164
|
try {
|
|
161
165
|
return findOwningPackageJson(require.resolve(packageName), packageName);
|
|
162
166
|
} catch {
|
|
@@ -14,10 +14,4 @@ function extractOverrideTargetName(key) {
|
|
|
14
14
|
return versionAt > 0 ? target.slice(0, versionAt) : target;
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
|
-
|
|
18
|
-
const VITEST_ALIGN_EXCLUDED = /* @__PURE__ */ new Set(["@vitest/eslint-plugin", "@vitest/coverage-c8"]);
|
|
19
|
-
function isAlignableVitestEcosystemPackage(name) {
|
|
20
|
-
return name.startsWith("@vitest/") && !VITEST_ALIGN_EXCLUDED.has(name);
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { extractOverrideTargetName as n, isAlignableVitestEcosystemPackage as t };
|
|
17
|
+
export { extractOverrideTargetName as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-CMFfr-1z.js";
|
|
2
2
|
import { t as accent } from "./terminal-MKGAuy-p.js";
|
|
3
|
-
import { f as VITE_PLUS_VERSION } from "./constants-
|
|
4
|
-
import { a as writeJsonFile, i as readJsonFile } from "./json-
|
|
3
|
+
import { f as VITE_PLUS_VERSION } from "./constants-CiKwrA0v.js";
|
|
4
|
+
import { a as writeJsonFile, i as readJsonFile } from "./json-JP24qHUF.js";
|
|
5
5
|
import { t as require_semver } from "./semver-CaDAb8vV.js";
|
|
6
6
|
import { n as runCommandSilently } from "./command-CguLh2KL.js";
|
|
7
7
|
import { t as require_dist } from "./dist-BDYZP12R.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as VITE_CONFIG_FILES } from "./constants-
|
|
2
|
-
import { u as withConfigMetadataResolution } from "./define-config-
|
|
1
|
+
import { l as VITE_CONFIG_FILES } from "./constants-CiKwrA0v.js";
|
|
2
|
+
import { u as withConfigMetadataResolution } from "./define-config-jhuYJ7Tb.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
//#region src/resolve-vite-config.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveUniversalViteConfig } from "./resolve-vite-config-
|
|
1
|
+
import { a as resolveUniversalViteConfig } from "./resolve-vite-config-BUFUmi8h.js";
|
|
2
2
|
export { resolveUniversalViteConfig };
|