vite-plus 0.1.21-alpha.4 → 0.1.21-alpha.5
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/dist/{agent-DiG-2b1c.js → agent-DfrgUb6p.js} +11 -1
- package/dist/bin.js +1 -1
- package/dist/config/bin.js +1 -1
- package/dist/create/bin.js +3 -3
- package/dist/migration/bin.js +2 -2
- package/dist/pack-client.d.ts +1 -0
- package/dist/{tsconfig-BQeK6Jxp.js → tsconfig-lBAWm4sf.js} +32 -1
- package/dist/{workspace-BPbxWCNF.js → workspace-B9iIR57G.js} +1 -1
- package/docs/_data/team.ts +62 -62
- package/docs/config/fmt.md +2 -0
- package/docs/config/index.md +1 -1
- package/docs/config/lint.md +2 -0
- package/docs/config/run.md +1 -0
- package/docs/guide/ci.md +8 -14
- package/docs/guide/create.md +5 -5
- package/docs/guide/monorepo.md +176 -0
- package/docs/guide/troubleshooting.md +0 -1
- package/docs/package.json +1 -1
- package/package.json +16 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./chunk-q7NCDQ7-.js";
|
|
2
2
|
import { c as VITE_PLUS_VERSION, i as BASEURL_TSCONFIG_WARNING, l as isForceOverrideMode, o as VITE_PLUS_NAME, s as VITE_PLUS_OVERRIDE_PACKAGES } from "./main-A6UrSTYb.js";
|
|
3
|
-
import {
|
|
3
|
+
import { i as rewriteTypesInTsconfig, n as hasBaseUrlInTsconfig, o as runCommandSilently, r as removeDeprecatedTsconfigFalseOption, s as require_cross_spawn, t as findTsconfigFiles } from "./tsconfig-lBAWm4sf.js";
|
|
4
4
|
import { t as accent } from "./terminal-CxTMfsxZ.js";
|
|
5
5
|
import { t as require_dist } from "./dist-DjG9AYbK.js";
|
|
6
6
|
import { c as editJsonFile, l as isJsonFile, n as detectPackageMetadata, u as readJsonFile } from "./package-CrKanQYM.js";
|
|
@@ -3722,6 +3722,13 @@ function cleanupDeprecatedTsconfigOptions(projectPath, silent = false, report) {
|
|
|
3722
3722
|
warnMigration(`Removed \`"${name}": false\` from ${displayRelative(filePath)} — this option has been deprecated. See https://github.com/oxc-project/tsgolint/issues/351, https://github.com/microsoft/TypeScript/issues/62529`, report);
|
|
3723
3723
|
}
|
|
3724
3724
|
}
|
|
3725
|
+
function rewriteTsconfigTypes(projectPath, silent = false, report) {
|
|
3726
|
+
const files = findTsconfigFiles(projectPath);
|
|
3727
|
+
for (const filePath of files) if (rewriteTypesInTsconfig(filePath)) {
|
|
3728
|
+
if (report) report.removedConfigCount++;
|
|
3729
|
+
if (!silent) log.success(`✔ Rewrote types in ${displayRelative(filePath)}`);
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3725
3732
|
const FRAMEWORK_SHIMS = {
|
|
3726
3733
|
vue: [
|
|
3727
3734
|
"declare module '*.vue' {",
|
|
@@ -3852,6 +3859,7 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
|
|
|
3852
3859
|
}
|
|
3853
3860
|
if (!skipStagedMigration) rewriteLintStagedConfigFile(projectPath, report);
|
|
3854
3861
|
cleanupDeprecatedTsconfigOptions(projectPath, silent, report);
|
|
3862
|
+
rewriteTsconfigTypes(projectPath, silent, report);
|
|
3855
3863
|
mergeViteConfigFiles(projectPath, silent, report);
|
|
3856
3864
|
injectLintTypeCheckDefaults(projectPath, silent, report);
|
|
3857
3865
|
injectFmtDefaults(projectPath, silent, report);
|
|
@@ -3872,6 +3880,7 @@ function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, rep
|
|
|
3872
3880
|
for (const pkg of workspaceInfo.packages) rewriteMonorepoProject(path.join(workspaceInfo.rootDir, pkg.path), workspaceInfo.packageManager, skipStagedMigration, silent, report, catalogDependencyResolver);
|
|
3873
3881
|
if (!skipStagedMigration) rewriteLintStagedConfigFile(workspaceInfo.rootDir, report);
|
|
3874
3882
|
cleanupDeprecatedTsconfigOptions(workspaceInfo.rootDir, silent, report);
|
|
3883
|
+
rewriteTsconfigTypes(workspaceInfo.rootDir, silent, report);
|
|
3875
3884
|
mergeViteConfigFiles(workspaceInfo.rootDir, silent, report);
|
|
3876
3885
|
injectLintTypeCheckDefaults(workspaceInfo.rootDir, silent, report);
|
|
3877
3886
|
injectFmtDefaults(workspaceInfo.rootDir, silent, report);
|
|
@@ -3885,6 +3894,7 @@ function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, rep
|
|
|
3885
3894
|
*/
|
|
3886
3895
|
function rewriteMonorepoProject(projectPath, packageManager, skipStagedMigration, silent = false, report, catalogDependencyResolver) {
|
|
3887
3896
|
cleanupDeprecatedTsconfigOptions(projectPath, silent, report);
|
|
3897
|
+
rewriteTsconfigTypes(projectPath, silent, report);
|
|
3888
3898
|
mergeViteConfigFiles(projectPath, silent, report);
|
|
3889
3899
|
mergeTsdownConfigFile(projectPath, silent, report);
|
|
3890
3900
|
const packageJsonPath = path.join(projectPath, "package.json");
|
package/dist/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as DEFAULT_ENVS, i as BASEURL_TSCONFIG_WARNING, o as VITE_PLUS_NAME, u as resolve$1 } from "./main-A6UrSTYb.js";
|
|
2
|
-
import {
|
|
2
|
+
import { n as hasBaseUrlInTsconfig, o as runCommandSilently } from "./tsconfig-lBAWm4sf.js";
|
|
3
3
|
import { n as errorMsg, r as log, s as warnMsg, t as accent } from "./terminal-CxTMfsxZ.js";
|
|
4
4
|
import { r as resolveUniversalViteConfig } from "./resolve-vite-config-C1KX9CZU.js";
|
|
5
5
|
import path, { dirname, join } from "node:path";
|
package/dist/config/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as printHeader, r as log } from "../terminal-CxTMfsxZ.js";
|
|
2
|
-
import { L as defaultInteractive, _ as hasStagedConfigInViteConfig, h as ensurePreCommitHook, i as updateExistingAgentInstructions, z as promptGitHooks } from "../agent-
|
|
2
|
+
import { L as defaultInteractive, _ as hasStagedConfigInViteConfig, h as ensurePreCommitHook, i as updateExistingAgentInstructions, z as promptGitHooks } from "../agent-DfrgUb6p.js";
|
|
3
3
|
import { t as lib_default } from "../lib-BamM40b7.js";
|
|
4
4
|
import { t as renderCliDoc } from "../help-BtkjXtRM.js";
|
|
5
5
|
import { join } from "node:path";
|
package/dist/create/bin.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "../chunk-q7NCDQ7-.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as runCommand$1, o as runCommandSilently, s as require_cross_spawn } from "../tsconfig-lBAWm4sf.js";
|
|
3
3
|
import { a as printHeader, i as muted, o as success, r as log, t as accent } from "../terminal-CxTMfsxZ.js";
|
|
4
4
|
import { i as resolveViteConfig, n as hasViteConfig, t as findWorkspaceRoot } from "../resolve-vite-config-C1KX9CZU.js";
|
|
5
|
-
import { $ as multiselect, A as setPackageManager, B as runViteFmt, D as rewriteMonorepo, E as promptPrettierMigration, G as templatesDir, H as selectPackageManager, K as DependencyType, L as defaultInteractive, O as rewriteMonorepoProject, Q as log$1, R as downloadPackageManager$1, T as promptEslintMigration, V as runViteInstall, W as displayRelative, X as confirm, Y as cancel, Z as intro, a as writeAgentInstructions, at as q, d as detectEslintProject, f as detectFramework, g as hasFrameworkShim, it as require_picocolors, k as rewriteStandaloneProject, m as detectPrettierProject, n as detectExistingAgentTargetPaths, nt as spinner, o as addFrameworkShim, q as PackageManager, r as selectAgentTargetPaths, rt as text, tt as select, v as injectCreateDefaultTemplate, y as installGitHooks, z as promptGitHooks } from "../agent-
|
|
5
|
+
import { $ as multiselect, A as setPackageManager, B as runViteFmt, D as rewriteMonorepo, E as promptPrettierMigration, G as templatesDir, H as selectPackageManager, K as DependencyType, L as defaultInteractive, O as rewriteMonorepoProject, Q as log$1, R as downloadPackageManager$1, T as promptEslintMigration, V as runViteInstall, W as displayRelative, X as confirm, Y as cancel, Z as intro, a as writeAgentInstructions, at as q, d as detectEslintProject, f as detectFramework, g as hasFrameworkShim, it as require_picocolors, k as rewriteStandaloneProject, m as detectPrettierProject, n as detectExistingAgentTargetPaths, nt as spinner, o as addFrameworkShim, q as PackageManager, r as selectAgentTargetPaths, rt as text, tt as select, v as injectCreateDefaultTemplate, y as installGitHooks, z as promptGitHooks } from "../agent-DfrgUb6p.js";
|
|
6
6
|
import { t as lib_default } from "../lib-BamM40b7.js";
|
|
7
7
|
import { c as editJsonFile, o as fetchNpmResource, s as getNpmRegistry, t as checkNpmPackageExists, u as readJsonFile } from "../package-CrKanQYM.js";
|
|
8
|
-
import { a as detectExistingEditors, c as writeEditorConfigs, n as updatePackageJsonWithDeps, r as updateWorkspaceConfig, s as selectEditors, t as detectWorkspace$1 } from "../workspace-
|
|
8
|
+
import { a as detectExistingEditors, c as writeEditorConfigs, n as updatePackageJsonWithDeps, r as updateWorkspaceConfig, s as selectEditors, t as detectWorkspace$1 } from "../workspace-B9iIR57G.js";
|
|
9
9
|
import { t as renderCliDoc } from "../help-BtkjXtRM.js";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { runCommand, vitePlusHeader } from "../../binding/index.js";
|
package/dist/migration/bin.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as __toESM } from "../chunk-q7NCDQ7-.js";
|
|
2
2
|
import { l as isForceOverrideMode } from "../main-A6UrSTYb.js";
|
|
3
3
|
import { a as printHeader, i as muted, r as log, t as accent } from "../terminal-CxTMfsxZ.js";
|
|
4
|
-
import { C as migratePrettierToOxfmt, D as rewriteMonorepo, E as promptPrettierMigration, H as selectPackageManager, I as cancelAndExit, J as require_semver, L as defaultInteractive, M as warnPackageLevelEslint, N as warnPackageLevelPrettier, Q as log$1, R as downloadPackageManager, S as migrateNodeVersionManagerFile, T as promptEslintMigration, U as upgradeYarn, V as runViteInstall, W as displayRelative, X as confirm, a as writeAgentInstructions, at as q, b as mergeViteConfigFiles, c as checkVitestVersion, d as detectEslintProject, et as outro, f as detectFramework, g as hasFrameworkShim, j as warnLegacyEslintConfig, k as rewriteStandaloneProject, l as confirmEslintMigration, m as detectPrettierProject, n as detectExistingAgentTargetPaths, nt as spinner, o as addFrameworkShim, p as detectNodeVersionManagerFile, q as PackageManager, r as selectAgentTargetPaths, s as checkViteVersion, t as detectAgentConflicts, tt as select, u as confirmPrettierMigration, w as preflightGitHooksSetup, x as migrateEslintToOxlint, y as installGitHooks, z as promptGitHooks } from "../agent-
|
|
4
|
+
import { C as migratePrettierToOxfmt, D as rewriteMonorepo, E as promptPrettierMigration, H as selectPackageManager, I as cancelAndExit, J as require_semver, L as defaultInteractive, M as warnPackageLevelEslint, N as warnPackageLevelPrettier, Q as log$1, R as downloadPackageManager, S as migrateNodeVersionManagerFile, T as promptEslintMigration, U as upgradeYarn, V as runViteInstall, W as displayRelative, X as confirm, a as writeAgentInstructions, at as q, b as mergeViteConfigFiles, c as checkVitestVersion, d as detectEslintProject, et as outro, f as detectFramework, g as hasFrameworkShim, j as warnLegacyEslintConfig, k as rewriteStandaloneProject, l as confirmEslintMigration, m as detectPrettierProject, n as detectExistingAgentTargetPaths, nt as spinner, o as addFrameworkShim, p as detectNodeVersionManagerFile, q as PackageManager, r as selectAgentTargetPaths, s as checkViteVersion, t as detectAgentConflicts, tt as select, u as confirmPrettierMigration, w as preflightGitHooksSetup, x as migrateEslintToOxlint, y as installGitHooks, z as promptGitHooks } from "../agent-DfrgUb6p.js";
|
|
5
5
|
import { t as lib_default } from "../lib-BamM40b7.js";
|
|
6
6
|
import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-CrKanQYM.js";
|
|
7
7
|
import { r as createMigrationReport } from "../report-DbrfjWiP.js";
|
|
8
|
-
import { c as writeEditorConfigs, i as detectEditorConflicts, o as selectEditor, t as detectWorkspace } from "../workspace-
|
|
8
|
+
import { c as writeEditorConfigs, i as detectEditorConflicts, o as selectEditor, t as detectWorkspace } from "../workspace-B9iIR57G.js";
|
|
9
9
|
import { t as renderCliDoc } from "../help-BtkjXtRM.js";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { styleText } from "node:util";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="@voidzero-dev/vite-plus-core/pack/client" />
|
|
@@ -482,5 +482,36 @@ function removeDeprecatedTsconfigFalseOption(filePath, optionName) {
|
|
|
482
482
|
fs.writeFileSync(filePath, newText);
|
|
483
483
|
return true;
|
|
484
484
|
}
|
|
485
|
+
function rewriteTypesInTsconfig(filePath) {
|
|
486
|
+
let text;
|
|
487
|
+
try {
|
|
488
|
+
text = fs.readFileSync(filePath, "utf-8");
|
|
489
|
+
} catch {
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
const types = parse(text)?.compilerOptions?.types;
|
|
493
|
+
if (!Array.isArray(types)) return false;
|
|
494
|
+
const REPLACEMENTS = {
|
|
495
|
+
"tsdown/client": "vite-plus/pack/client",
|
|
496
|
+
"vite/client": "vite-plus/client"
|
|
497
|
+
};
|
|
498
|
+
const toReplace = types.map((t, i) => typeof t === "string" && t in REPLACEMENTS ? {
|
|
499
|
+
i,
|
|
500
|
+
newVal: REPLACEMENTS[t]
|
|
501
|
+
} : null).filter((x) => x !== null);
|
|
502
|
+
if (toReplace.length === 0) return false;
|
|
503
|
+
let currentText = text;
|
|
504
|
+
for (let j = toReplace.length - 1; j >= 0; j--) {
|
|
505
|
+
const { i, newVal } = toReplace[j];
|
|
506
|
+
const edits = modify(currentText, [
|
|
507
|
+
"compilerOptions",
|
|
508
|
+
"types",
|
|
509
|
+
i
|
|
510
|
+
], newVal, {});
|
|
511
|
+
if (edits.length > 0) currentText = applyEdits(currentText, edits);
|
|
512
|
+
}
|
|
513
|
+
fs.writeFileSync(filePath, currentText);
|
|
514
|
+
return true;
|
|
515
|
+
}
|
|
485
516
|
//#endregion
|
|
486
|
-
export {
|
|
517
|
+
export { runCommand as a, rewriteTypesInTsconfig as i, hasBaseUrlInTsconfig as n, runCommandSilently as o, removeDeprecatedTsconfigFalseOption as r, require_cross_spawn as s, findTsconfigFiles as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as multiselect, F as readYamlFile, P as editYamlFile, Q as log, at as q, q as PackageManager, tt as select } from "./agent-
|
|
1
|
+
import { $ as multiselect, F as readYamlFile, P as editYamlFile, Q as log, at as q, q as PackageManager, tt as select } from "./agent-DfrgUb6p.js";
|
|
2
2
|
import { t as require_dist } from "./dist-DjG9AYbK.js";
|
|
3
3
|
import { c as editJsonFile, d as writeJsonFile, r as getScopeFromPackageName, u as readJsonFile } from "./package-CrKanQYM.js";
|
|
4
4
|
import path, { posix, win32 } from "node:path";
|
package/docs/_data/team.ts
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
import type { DefaultTheme } from
|
|
1
|
+
import type { DefaultTheme } from 'vitepress';
|
|
2
2
|
|
|
3
3
|
export const core: DefaultTheme.TeamMember[] = [
|
|
4
4
|
{
|
|
5
|
-
avatar:
|
|
6
|
-
name:
|
|
5
|
+
avatar: 'https://github.com/fengmk2.png',
|
|
6
|
+
name: 'MK',
|
|
7
7
|
links: [
|
|
8
|
-
{ icon:
|
|
9
|
-
{ icon:
|
|
8
|
+
{ icon: 'github', link: 'https://github.com/fengmk2' },
|
|
9
|
+
{ icon: 'x', link: 'https://x.com/fengmk2' },
|
|
10
10
|
],
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
avatar:
|
|
14
|
-
name:
|
|
13
|
+
avatar: 'https://github.com/branchseer.png',
|
|
14
|
+
name: 'Wang Chi',
|
|
15
15
|
links: [
|
|
16
|
-
{ icon:
|
|
17
|
-
{ icon:
|
|
16
|
+
{ icon: 'github', link: 'https://github.com/branchseer' },
|
|
17
|
+
{ icon: 'x', link: 'https://x.com/branchseer' },
|
|
18
18
|
],
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
avatar:
|
|
22
|
-
name:
|
|
21
|
+
avatar: 'https://github.com/Brooooooklyn.png',
|
|
22
|
+
name: 'Long Yinan',
|
|
23
23
|
links: [
|
|
24
|
-
{ icon:
|
|
25
|
-
{ icon:
|
|
24
|
+
{ icon: 'github', link: 'https://github.com/Brooooooklyn' },
|
|
25
|
+
{ icon: 'x', link: 'https://x.com/Brooooook_lyn' },
|
|
26
26
|
],
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
avatar:
|
|
30
|
-
name:
|
|
29
|
+
avatar: 'https://github.com/cpojer.png',
|
|
30
|
+
name: 'Christoph Nakazawa',
|
|
31
31
|
links: [
|
|
32
|
-
{ icon:
|
|
33
|
-
{ icon:
|
|
34
|
-
{ icon:
|
|
32
|
+
{ icon: 'github', link: 'https://github.com/cpojer' },
|
|
33
|
+
{ icon: 'x', link: 'https://x.com/cpojer' },
|
|
34
|
+
{ icon: 'bluesky', link: 'https://bsky.app/profile/christoph.nkzw.tech' },
|
|
35
35
|
],
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
avatar:
|
|
39
|
-
name:
|
|
38
|
+
avatar: 'https://github.com/TheAlexLichter.png',
|
|
39
|
+
name: 'Alexander Lichter',
|
|
40
40
|
links: [
|
|
41
|
-
{ icon:
|
|
42
|
-
{ icon:
|
|
43
|
-
{ icon:
|
|
41
|
+
{ icon: 'github', link: 'https://github.com/TheAlexLichter' },
|
|
42
|
+
{ icon: 'x', link: 'https://x.com/TheAlexLichter' },
|
|
43
|
+
{ icon: 'bluesky', link: 'https://bsky.app/profile/thealexlichter.com' },
|
|
44
44
|
],
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
avatar:
|
|
48
|
-
name:
|
|
47
|
+
avatar: 'https://github.com/camc314.png',
|
|
48
|
+
name: 'Cameron Clark',
|
|
49
49
|
links: [
|
|
50
|
-
{ icon:
|
|
51
|
-
{ icon:
|
|
50
|
+
{ icon: 'github', link: 'https://github.com/camc314' },
|
|
51
|
+
{ icon: 'x', link: 'https://x.com/cameron_C2' },
|
|
52
52
|
],
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
avatar:
|
|
56
|
-
name:
|
|
55
|
+
avatar: 'https://github.com/leaysgur.png',
|
|
56
|
+
name: 'Yuji Sugiura',
|
|
57
57
|
links: [
|
|
58
|
-
{ icon:
|
|
59
|
-
{ icon:
|
|
58
|
+
{ icon: 'github', link: 'https://github.com/leaysgur' },
|
|
59
|
+
{ icon: 'x', link: 'https://x.com/leaysgur' },
|
|
60
60
|
],
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
|
-
avatar:
|
|
64
|
-
name:
|
|
63
|
+
avatar: 'https://github.com/mdong1909.png',
|
|
64
|
+
name: 'Michael Dong',
|
|
65
65
|
links: [
|
|
66
|
-
{ icon:
|
|
67
|
-
{ icon:
|
|
68
|
-
{ icon:
|
|
66
|
+
{ icon: 'github', link: 'https://github.com/mdong1909' },
|
|
67
|
+
{ icon: 'x', link: 'https://x.com/mdong1909' },
|
|
68
|
+
{ icon: 'linkedin', link: 'https://www.linkedin.com/in/michael-d-612b5b50/' },
|
|
69
69
|
],
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
avatar:
|
|
73
|
-
name:
|
|
72
|
+
avatar: 'https://github.com/kazupon.png',
|
|
73
|
+
name: 'kazupon',
|
|
74
74
|
links: [
|
|
75
|
-
{ icon:
|
|
76
|
-
{ icon:
|
|
77
|
-
{ icon:
|
|
75
|
+
{ icon: 'github', link: 'https://github.com/kazupon' },
|
|
76
|
+
{ icon: 'x', link: 'https://x.com/kazupon' },
|
|
77
|
+
{ icon: 'bluesky', link: 'https://bsky.app/profile/kazupon.dev' },
|
|
78
78
|
],
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
|
-
avatar:
|
|
82
|
-
name:
|
|
81
|
+
avatar: 'https://github.com/ubugeeei.png',
|
|
82
|
+
name: 'ubugeeei',
|
|
83
83
|
links: [
|
|
84
|
-
{ icon:
|
|
85
|
-
{ icon:
|
|
84
|
+
{ icon: 'github', link: 'https://github.com/ubugeeei' },
|
|
85
|
+
{ icon: 'x', link: 'https://x.com/ubugeeei' },
|
|
86
86
|
],
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
avatar:
|
|
90
|
-
name:
|
|
91
|
-
links: [{ icon:
|
|
89
|
+
avatar: 'https://github.com/nekomoyi.png',
|
|
90
|
+
name: 'nekomoyi',
|
|
91
|
+
links: [{ icon: 'github', link: 'https://github.com/nekomoyi' }],
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
|
-
avatar:
|
|
95
|
-
name:
|
|
94
|
+
avatar: 'https://github.com/HaasStefan.png',
|
|
95
|
+
name: 'Stefan Haas',
|
|
96
96
|
links: [
|
|
97
|
-
{ icon:
|
|
98
|
-
{ icon:
|
|
99
|
-
{ icon:
|
|
97
|
+
{ icon: 'github', link: 'https://github.com/HaasStefan' },
|
|
98
|
+
{ icon: 'x', link: 'https://x.com/StefanvHaas' },
|
|
99
|
+
{ icon: 'linkedin', link: 'https://www.linkedin.com/in/stefan-haas-angular' },
|
|
100
100
|
],
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
|
-
avatar:
|
|
104
|
-
name:
|
|
103
|
+
avatar: 'https://github.com/naokihaba.png',
|
|
104
|
+
name: 'naokihaba',
|
|
105
105
|
links: [
|
|
106
|
-
{ icon:
|
|
107
|
-
{ icon:
|
|
108
|
-
{ icon:
|
|
106
|
+
{ icon: 'github', link: 'https://github.com/naokihaba' },
|
|
107
|
+
{ icon: 'x', link: 'https://x.com/naokihaba' },
|
|
108
|
+
{ icon: 'bluesky', link: 'https://bsky.app/profile/naokihaba.com' },
|
|
109
109
|
],
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
|
-
avatar:
|
|
113
|
-
name:
|
|
112
|
+
avatar: 'https://github.com/jong-kyung.png',
|
|
113
|
+
name: 'JongKyung Lee',
|
|
114
114
|
links: [
|
|
115
|
-
{ icon:
|
|
116
|
-
{ icon:
|
|
115
|
+
{ icon: 'github', link: 'https://github.com/jong-kyung' },
|
|
116
|
+
{ icon: 'linkedin', link: 'https://www.linkedin.com/in/jong-kyung' },
|
|
117
117
|
],
|
|
118
118
|
},
|
|
119
119
|
];
|
package/docs/config/fmt.md
CHANGED
package/docs/config/index.md
CHANGED
|
@@ -28,4 +28,4 @@ Vite+ extends the basic Vite configuration with these additions:
|
|
|
28
28
|
- [`test`](/config/test) for Vitest
|
|
29
29
|
- [`run`](/config/run) for Vite Task
|
|
30
30
|
- [`pack`](/config/pack) for tsdown
|
|
31
|
-
- [`staged`](/config/staged) for staged-file checks
|
|
31
|
+
- [`staged`](/config/staged) for staged-file checks
|
package/docs/config/lint.md
CHANGED
|
@@ -22,3 +22,5 @@ export default defineConfig({
|
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
We recommend enabling both `options.typeAware` and `options.typeCheck` so `vp lint` and `vp check` can use the full type-aware path.
|
|
25
|
+
|
|
26
|
+
For package-specific lint rules in a workspace, use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) from the root `vite.config.ts`.
|
package/docs/config/run.md
CHANGED
package/docs/guide/ci.md
CHANGED
|
@@ -13,7 +13,7 @@ That means you usually do not need separate `setup-node`, package-manager setup,
|
|
|
13
13
|
```yaml [.github/workflows/ci.yml]
|
|
14
14
|
- uses: voidzero-dev/setup-vp@v1
|
|
15
15
|
with:
|
|
16
|
-
node-version: '
|
|
16
|
+
node-version: '24'
|
|
17
17
|
cache: true
|
|
18
18
|
- run: vp install
|
|
19
19
|
- run: vp check
|
|
@@ -30,23 +30,17 @@ If you are migrating an existing GitHub Actions workflow, you can often replace
|
|
|
30
30
|
#### Before:
|
|
31
31
|
|
|
32
32
|
```yaml [.github/workflows/ci.yml]
|
|
33
|
-
- uses:
|
|
34
|
-
with:
|
|
35
|
-
node-version: '24'
|
|
36
|
-
|
|
37
|
-
- uses: pnpm/action-setup@v4
|
|
33
|
+
- uses: pnpm/action-setup@v6
|
|
38
34
|
with:
|
|
39
|
-
version:
|
|
40
|
-
|
|
41
|
-
- name: Get pnpm store path
|
|
42
|
-
run: pnpm store path
|
|
35
|
+
version: 11
|
|
43
36
|
|
|
44
|
-
- uses: actions/
|
|
37
|
+
- uses: actions/setup-node@v6
|
|
45
38
|
with:
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
node-version: '24'
|
|
40
|
+
cache: pnpm
|
|
48
41
|
|
|
49
|
-
- run: pnpm
|
|
42
|
+
- run: pnpm ci && pnpm dev:setup
|
|
43
|
+
- run: pnpm check
|
|
50
44
|
- run: pnpm test
|
|
51
45
|
```
|
|
52
46
|
|
package/docs/guide/create.md
CHANGED
|
@@ -174,12 +174,12 @@ The manifest lives at `createConfig.templates` in `@org/create`'s `package.json`
|
|
|
174
174
|
|
|
175
175
|
Each entry supports:
|
|
176
176
|
|
|
177
|
-
| Field | Required | Notes
|
|
178
|
-
| ------------- | -------- |
|
|
179
|
-
| `name` | yes | Kebab-case identifier. Used by `vp create @org:<name>` for direct selection. Must be unique within the array.
|
|
180
|
-
| `description` | yes | One-line description shown in the picker.
|
|
177
|
+
| Field | Required | Notes |
|
|
178
|
+
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
179
|
+
| `name` | yes | Kebab-case identifier. Used by `vp create @org:<name>` for direct selection. Must be unique within the array. |
|
|
180
|
+
| `description` | yes | One-line description shown in the picker. |
|
|
181
181
|
| `template` | yes | An npm specifier (`@org/template-foo`, optionally `@version`), a GitHub URL (`github:user/repo`), a `vite:*` builtin, a local workspace package name, or a relative path (`./templates/foo`) that resolves against the `@org/create` root. |
|
|
182
|
-
| `monorepo` | no | If `true`, marks this entry as a monorepo-creating template. Hidden from the picker when `vp create` runs inside an existing monorepo, mirroring the built-in `vite:monorepo` filter.
|
|
182
|
+
| `monorepo` | no | If `true`, marks this entry as a monorepo-creating template. Hidden from the picker when `vp create` runs inside an existing monorepo, mirroring the built-in `vite:monorepo` filter. |
|
|
183
183
|
|
|
184
184
|
An invalid manifest is a hard error, not a silent fall-through — a maintainer who shipped a manifest should hear about the offending field, e.g. `@your-org/create: createConfig.templates[2].template must be a non-empty string`.
|
|
185
185
|
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Monorepo
|
|
2
|
+
|
|
3
|
+
Vite+ supports monorepos with `vite.config.ts` at the root. You can define the defaults for `lint`, `fmt`, etc. at the root, and use `overrides` to apply package-specific lint and format settings.
|
|
4
|
+
|
|
5
|
+
Because `vite.config.ts` is just JavaScript, you can choose to put your entire config into this file or compose it using regular JavaScript imports. You can still have separate `vite.config.ts` files in each package for the Vite, Vitest, framework or runtime configuration.
|
|
6
|
+
|
|
7
|
+
## Root Config With Overrides
|
|
8
|
+
|
|
9
|
+
Use `lint.overrides` for Oxlint rules that only apply to some packages:
|
|
10
|
+
|
|
11
|
+
```ts [vite.config.ts]
|
|
12
|
+
import { defineConfig } from 'vite-plus';
|
|
13
|
+
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
lint: {
|
|
16
|
+
plugins: ['typescript'],
|
|
17
|
+
options: {
|
|
18
|
+
typeAware: true,
|
|
19
|
+
typeCheck: true,
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
23
|
+
},
|
|
24
|
+
overrides: [
|
|
25
|
+
{
|
|
26
|
+
files: ['apps/web/**', 'packages/ui/**'],
|
|
27
|
+
plugins: ['typescript', 'react'],
|
|
28
|
+
rules: {
|
|
29
|
+
'react/self-closing-comp': 'error',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
files: ['apps/api/**'],
|
|
34
|
+
env: {
|
|
35
|
+
node: true,
|
|
36
|
+
},
|
|
37
|
+
rules: {
|
|
38
|
+
'no-console': 'off',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
files: ['**/*.test.ts', '**/*.spec.ts'],
|
|
43
|
+
plugins: ['typescript', 'vitest'],
|
|
44
|
+
rules: {
|
|
45
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
46
|
+
'vitest/no-disabled-tests': 'error',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Globs are resolved from the root `vite.config.ts`, so use workspace paths such as `apps/web/**`, `apps/api/**`, and `packages/ui/**`.
|
|
55
|
+
|
|
56
|
+
::: tip
|
|
57
|
+
When a `lint.overrides` entry sets `plugins`, that list replaces the base `lint.plugins` list for matched files. Include every plugin needed by that file group, such as `['typescript', 'react']`. Omit `plugins` only when the override should inherit the base list unchanged.
|
|
58
|
+
:::
|
|
59
|
+
|
|
60
|
+
## Format Overrides
|
|
61
|
+
|
|
62
|
+
Use `fmt.overrides` for file or package-specific Oxfmt options. Formatter overrides put their settings under `options`:
|
|
63
|
+
|
|
64
|
+
```ts [vite.config.ts]
|
|
65
|
+
import { defineConfig } from 'vite-plus';
|
|
66
|
+
|
|
67
|
+
export default defineConfig({
|
|
68
|
+
fmt: {
|
|
69
|
+
singleQuote: true,
|
|
70
|
+
semi: true,
|
|
71
|
+
overrides: [
|
|
72
|
+
{
|
|
73
|
+
files: ['apps/api/**'],
|
|
74
|
+
options: {
|
|
75
|
+
printWidth: 120,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
files: ['**/*.md'],
|
|
80
|
+
options: {
|
|
81
|
+
proseWrap: 'always',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Composing Configuration Files
|
|
90
|
+
|
|
91
|
+
You can split configuration across your repository and compose them using JavaScript imports. Export JavaScript objects from nearby files or packages, import them in the root config, and merge them into the matching override.
|
|
92
|
+
|
|
93
|
+
```ts [tooling/lint/react.ts]
|
|
94
|
+
import type { OxlintOverride } from 'vite-plus/lint';
|
|
95
|
+
|
|
96
|
+
export const reactLint = {
|
|
97
|
+
plugins: ['typescript', 'react'],
|
|
98
|
+
rules: {
|
|
99
|
+
'react/self-closing-comp': 'error',
|
|
100
|
+
},
|
|
101
|
+
} satisfies Omit<OxlintOverride, 'files'>;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```ts [tooling/lint/node.ts]
|
|
105
|
+
import type { OxlintOverride } from 'vite-plus/lint';
|
|
106
|
+
|
|
107
|
+
export const nodeLint = {
|
|
108
|
+
env: {
|
|
109
|
+
node: true,
|
|
110
|
+
},
|
|
111
|
+
rules: {
|
|
112
|
+
'no-console': 'off',
|
|
113
|
+
},
|
|
114
|
+
} satisfies Omit<OxlintOverride, 'files'>;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
```ts [vite.config.ts]
|
|
118
|
+
import { defineConfig } from 'vite-plus';
|
|
119
|
+
|
|
120
|
+
import { nodeLint } from './tooling/lint/node';
|
|
121
|
+
import { reactLint } from './tooling/lint/react';
|
|
122
|
+
|
|
123
|
+
export default defineConfig({
|
|
124
|
+
lint: {
|
|
125
|
+
plugins: ['typescript'],
|
|
126
|
+
options: {
|
|
127
|
+
typeAware: true,
|
|
128
|
+
typeCheck: true,
|
|
129
|
+
},
|
|
130
|
+
overrides: [
|
|
131
|
+
{
|
|
132
|
+
files: ['apps/web/**', 'packages/ui/**'],
|
|
133
|
+
...reactLint,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
files: ['apps/api/**'],
|
|
137
|
+
...nodeLint,
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
This keeps the behavior centralized while letting each team or package own the pieces of config it needs.
|
|
145
|
+
|
|
146
|
+
## App Commands
|
|
147
|
+
|
|
148
|
+
The root `vite.config.ts` is most valuable for shared linting, formatting, staged checks, and task definitions. For project-specific development, build, and test behavior, use the setup that best matches each app:
|
|
149
|
+
|
|
150
|
+
- Pass a folder to built-in Vite commands when you want to target one app:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
vp dev apps/web
|
|
154
|
+
vp build apps/web
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
- Keep package-specific scripts in each package when the command differs per app:
|
|
158
|
+
|
|
159
|
+
```json [apps/api/package.json]
|
|
160
|
+
{
|
|
161
|
+
"scripts": {
|
|
162
|
+
"dev": "tsx watch src/index.ts",
|
|
163
|
+
"build": "tsc -p tsconfig.json"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
- Run scripts across the workspace with `vp run`:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
vp run -r build
|
|
172
|
+
vp run -r --parallel dev
|
|
173
|
+
vp run --filter ./apps/web build
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
See the [Run guide](/guide/run) for recursive, parallel, filtered, and cached workspace tasks.
|
|
@@ -22,7 +22,6 @@ If you are migrating an existing project and it still depends on older Vite or V
|
|
|
22
22
|
|
|
23
23
|
The Oxlint type checker path powered by `tsgolint` does not support `baseUrl`, so Vite+ skips `typeAware` and `typeCheck` when that setting is present.
|
|
24
24
|
|
|
25
|
-
|
|
26
25
|
## `vp lint` / `vp fmt` may fail to read `vite.config.ts`
|
|
27
26
|
|
|
28
27
|
`vp lint`, `vp fmt`, and the Oxc VS Code extension all read the `lint` / `fmt` blocks from `vite.config.ts`. Today that support has important limitations.
|
package/docs/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plus",
|
|
3
|
-
"version": "0.1.21-alpha.
|
|
3
|
+
"version": "0.1.21-alpha.5",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -79,6 +79,9 @@
|
|
|
79
79
|
"types": "./dist/pack.d.ts",
|
|
80
80
|
"import": "./dist/pack.js"
|
|
81
81
|
},
|
|
82
|
+
"./pack/client": {
|
|
83
|
+
"types": "./dist/pack-client.d.ts"
|
|
84
|
+
},
|
|
82
85
|
"./versions": {
|
|
83
86
|
"types": "./dist/versions.d.ts",
|
|
84
87
|
"default": "./dist/versions.js"
|
|
@@ -322,8 +325,8 @@
|
|
|
322
325
|
"oxfmt": "=0.48.0",
|
|
323
326
|
"oxlint": "=1.63.0",
|
|
324
327
|
"oxlint-tsgolint": "=0.22.1",
|
|
325
|
-
"@voidzero-dev/vite-plus-
|
|
326
|
-
"@voidzero-dev/vite-plus-
|
|
328
|
+
"@voidzero-dev/vite-plus-core": "0.1.21-alpha.5",
|
|
329
|
+
"@voidzero-dev/vite-plus-test": "0.1.21-alpha.5"
|
|
327
330
|
},
|
|
328
331
|
"devDependencies": {
|
|
329
332
|
"@napi-rs/cli": "^3.6.1",
|
|
@@ -349,8 +352,8 @@
|
|
|
349
352
|
"validate-npm-package-name": "^7.0.2",
|
|
350
353
|
"yaml": "^2.8.1",
|
|
351
354
|
"@voidzero-dev/vite-plus-prompts": "0.0.0",
|
|
352
|
-
"
|
|
353
|
-
"
|
|
355
|
+
"@voidzero-dev/vite-plus-tools": "0.0.0",
|
|
356
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.21-alpha.5"
|
|
354
357
|
},
|
|
355
358
|
"napi": {
|
|
356
359
|
"binaryName": "vite-plus",
|
|
@@ -370,14 +373,14 @@
|
|
|
370
373
|
"node": "^20.19.0 || >=22.12.0"
|
|
371
374
|
},
|
|
372
375
|
"optionalDependencies": {
|
|
373
|
-
"@voidzero-dev/vite-plus-darwin-arm64": "0.1.21-alpha.
|
|
374
|
-
"@voidzero-dev/vite-plus-darwin-x64": "0.1.21-alpha.
|
|
375
|
-
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.21-alpha.
|
|
376
|
-
"@voidzero-dev/vite-plus-linux-arm64-musl": "0.1.21-alpha.
|
|
377
|
-
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.21-alpha.
|
|
378
|
-
"@voidzero-dev/vite-plus-linux-x64-musl": "0.1.21-alpha.
|
|
379
|
-
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.21-alpha.
|
|
380
|
-
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.21-alpha.
|
|
376
|
+
"@voidzero-dev/vite-plus-darwin-arm64": "0.1.21-alpha.5",
|
|
377
|
+
"@voidzero-dev/vite-plus-darwin-x64": "0.1.21-alpha.5",
|
|
378
|
+
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.21-alpha.5",
|
|
379
|
+
"@voidzero-dev/vite-plus-linux-arm64-musl": "0.1.21-alpha.5",
|
|
380
|
+
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.21-alpha.5",
|
|
381
|
+
"@voidzero-dev/vite-plus-linux-x64-musl": "0.1.21-alpha.5",
|
|
382
|
+
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.21-alpha.5",
|
|
383
|
+
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.21-alpha.5"
|
|
381
384
|
},
|
|
382
385
|
"scripts": {
|
|
383
386
|
"build": "oxnode -C dev ./build.ts",
|