vite-plus 0.1.22 → 0.1.24
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 +119 -52
- package/binding/index.d.cts +3222 -2
- package/dist/agent-Nuk-9l77.js +2470 -0
- package/dist/bin.js +13 -8
- package/dist/cli-truncate-CWsmbK3p.js +867 -0
- package/dist/{compat-OlmU9EQz.js → compat-DXZgnEyq.js} +1 -1
- package/dist/config/bin.js +18 -5
- package/dist/{constants-kDaYqyWd.js → constants-DCBWlNrn.js} +7 -2
- package/dist/create/bin.d.ts +1 -1
- package/dist/create/bin.js +194 -87
- package/dist/{define-config-IMCGDS2K.d.ts → define-config-COdn-tsn.d.ts} +7 -5
- 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-Bapm49IR.js +3 -0
- package/dist/{dist-owlRxmBM.js → dist-BgQuvbtq.js} +136 -110
- package/dist/fmt.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/is-fullwidth-code-point-BUNlIICg.js +8 -0
- package/dist/lint.d.ts +1 -1
- package/dist/{log-update-NRrY6krx.js → log-update-lyIiuflf.js} +111 -24
- package/dist/migration/bin.js +81 -39
- package/dist/{oxlint-plugin-config-BkQeR4FR.js → oxlint-plugin-config-B89iKTKN.js} +1 -1
- package/dist/oxlint-plugin.d.ts +2 -4
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +1 -1
- package/dist/pack.d.ts +1 -1
- package/dist/{package-BoLLED6j.js → package-PmBUZ-ve.js} +2 -2
- package/dist/staged/bin.js +157 -424
- package/dist/strip-ansi-C3wrWz9t.js +853 -0
- package/dist/{agent-BWLe0i9g.js → tsconfig-DFb5BKyT.js} +681 -2114
- package/dist/version.js +5 -5
- package/dist/versions.js +7 -7
- package/dist/{workspace-Bi_9spVt.js → workspace-NL-m9wgM.js} +22 -21
- package/dist/wrap-ansi-CeQuiQ31.js +2 -0
- package/dist/{wrap-ansi-DtUeUCjE.js → wrap-ansi-k7Dn4VtV.js} +1 -1
- package/docs/_data/team.ts +3 -3
- package/docs/config/run.md +39 -4
- package/docs/guide/cache.md +10 -1
- package/docs/guide/env.md +3 -0
- package/docs/guide/ide-integration.md +2 -2
- package/docs/guide/index.md +4 -0
- package/docs/guide/install.md +19 -0
- package/docs/guide/migrate.md +1 -1
- package/docs/guide/run.md +2 -0
- package/docs/guide/troubleshooting.md +6 -29
- package/docs/guide/upgrade.md +12 -1
- package/package.json +20 -20
- package/templates/monorepo/_gitignore +1 -0
- package/dist/cli-truncate-B62YnW2m.js +0 -138
- package/dist/dist-DZfItHAr.js +0 -3
- package/dist/slice-ansi-e4todZeH.js +0 -113
- package/dist/strip-ansi-D-eYYcD2.js +0 -198
- package/dist/tsconfig-BVyzXJ_o.js +0 -517
- package/dist/wrap-ansi-3S3qJ7j8.js +0 -2
- /package/dist/{chunk-q7NCDQ7-.js → chunk-DnnnRqeS.js} +0 -0
- /package/dist/{define-config-GqLoRwH9.cjs → define-config-BR1Y88zz.cjs} +0 -0
- /package/dist/{define-config-CzWdQTt2.js → define-config-BRC7qPNE.js} +0 -0
- /package/dist/{help-DK5wuu34.js → help-YP84FSEz.js} +0 -0
- /package/dist/{lib-DpwyUJWo.js → lib-L3DWSRQp.js} +0 -0
- /package/dist/{main-DhsO6ndq.js → main-DpJl3LoU.js} +0 -0
- /package/dist/{pack-K7H72Cum.d.ts → pack-Ciiho0Tq.d.ts} +0 -0
- /package/dist/{report-CYPv1VK1.js → report-DgSBQUdz.js} +0 -0
- /package/dist/{resolve-vite-config-C5AjksTj.js → resolve-vite-config-TTvhycU1.js} +0 -0
- /package/dist/{terminal-D_Kg-AA6.js → terminal-uTv0ZaMr.js} +0 -0
package/dist/bin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-
|
|
3
|
-
import {
|
|
4
|
-
import { n as errorMsg, r as log, s as warnMsg, t as accent } from "./terminal-
|
|
5
|
-
import { r as resolveUniversalViteConfig } from "./resolve-vite-config-
|
|
1
|
+
import { i as VITE_PLUS_NAME, l as resolve$1, n as BASEURL_TSCONFIG_WARNING, r as DEFAULT_ENVS } from "./constants-DCBWlNrn.js";
|
|
2
|
+
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-B89iKTKN.js";
|
|
3
|
+
import { M as runCommandSilently, i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-DFb5BKyT.js";
|
|
4
|
+
import { n as errorMsg, r as log, s as warnMsg, t as accent } from "./terminal-uTv0ZaMr.js";
|
|
5
|
+
import { r as resolveUniversalViteConfig } from "./resolve-vite-config-TTvhycU1.js";
|
|
6
6
|
import path, { dirname, join } from "node:path";
|
|
7
7
|
import { hasConfigKey, mergeJsonConfig, run } from "../binding/index.js";
|
|
8
8
|
import fs, { existsSync, realpathSync } from "node:fs";
|
|
@@ -51,6 +51,9 @@ const INIT_COMMAND_SPECS = {
|
|
|
51
51
|
defaultConfigFiles: [".oxfmtrc.json", ".oxfmtrc.jsonc"]
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
+
function normalizeInitCommand(command) {
|
|
55
|
+
return command === "format" ? "fmt" : command;
|
|
56
|
+
}
|
|
54
57
|
const VITE_CONFIG_FILES = [
|
|
55
58
|
"vite.config.ts",
|
|
56
59
|
"vite.config.mts",
|
|
@@ -127,8 +130,9 @@ async function vpFmt(cwd, filePath) {
|
|
|
127
130
|
if (result.exitCode !== 0) warnMsg(`Failed to format ${filePath} with vp fmt:\n${result.stdout.toString()}${result.stderr.toString()}`);
|
|
128
131
|
}
|
|
129
132
|
function resolveInitSpec(command, args) {
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
const normalizedCommand = normalizeInitCommand(command);
|
|
134
|
+
if (!normalizedCommand) return null;
|
|
135
|
+
const spec = INIT_COMMAND_SPECS[normalizedCommand];
|
|
132
136
|
if (!spec || !hasTriggerFlag(args, spec.triggerFlags)) return null;
|
|
133
137
|
return spec;
|
|
134
138
|
}
|
|
@@ -157,7 +161,7 @@ function inspectInitCommand(command, args, projectPath = process.cwd()) {
|
|
|
157
161
|
async function applyToolInitConfigToViteConfig(command, args, projectPath = process.cwd()) {
|
|
158
162
|
const inspection = inspectInitCommand(command, args, projectPath);
|
|
159
163
|
if (!inspection.handled || !inspection.configKey) return { handled: false };
|
|
160
|
-
const spec = INIT_COMMAND_SPECS[command];
|
|
164
|
+
const spec = INIT_COMMAND_SPECS[normalizeInitCommand(command)];
|
|
161
165
|
const viteConfigPath = ensureViteConfigPath(projectPath);
|
|
162
166
|
const generatedConfigPath = resolveGeneratedConfigPath(projectPath, args, spec.defaultConfigFiles);
|
|
163
167
|
if (hasConfigKey(viteConfigPath, spec.configKey)) {
|
|
@@ -171,6 +175,7 @@ async function applyToolInitConfigToViteConfig(command, args, projectPath = proc
|
|
|
171
175
|
}
|
|
172
176
|
if (spec.configKey === "lint" && hasTriggerFlag(args, ["--init"])) {
|
|
173
177
|
const lintInitConfigPath = path.join(projectPath, ".vite-plus-lint-init.oxlintrc.json");
|
|
178
|
+
await fixBaseUrlInTsconfig(projectPath);
|
|
174
179
|
const hasBaseUrl = hasBaseUrlInTsconfig(projectPath);
|
|
175
180
|
const initConfig = createDefaultVitePlusLintConfig({ includeTypeAwareDefaults: !hasBaseUrl });
|
|
176
181
|
if (hasBaseUrl) warnMsg(BASEURL_TSCONFIG_WARNING);
|