vite-plus 0.1.20-alpha.0 → 0.1.20-alpha.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/LICENSE +28 -0
- package/README.md +10 -0
- package/binding/index.cjs +1 -0
- package/binding/index.d.cts +8 -0
- package/dist/{agent-iabUQh_f.js → agent-B8Iy9rtN.js} +63 -4
- package/dist/bin.js +2 -2
- package/dist/config/bin.js +3 -4
- package/dist/create/bin.js +809 -38
- package/dist/{define-config-hLuWEqIf.d.ts → define-config-bKSulJaG.d.ts} +14 -0
- package/dist/define-config.d.ts +1 -1
- package/dist/dist-D2_BiE1V.js +3 -0
- package/dist/{dist-Dkzst9fl.js → dist-DjG9AYbK.js} +13 -0
- package/dist/index.d.ts +1 -1
- package/dist/migration/bin.js +8 -67
- package/dist/pack-bin.js +1 -1
- package/dist/{package-D_LD1iiI.js → package-CrKanQYM.js} +135 -4
- package/dist/{resolve-vite-config-B_w1u1j4.js → resolve-vite-config-C1KX9CZU.js} +1 -1
- package/dist/staged/bin.js +25 -20
- package/dist/{terminal-P9aw9Fib.js → terminal-CxTMfsxZ.js} +12 -1
- package/dist/version.js +3 -5
- package/dist/versions.js +3 -3
- package/dist/{workspace-oCv-zJ1i.js → workspace-DKef4Mgk.js} +3 -3
- package/docs/config/create.md +35 -0
- package/docs/guide/check.md +4 -1
- package/docs/guide/create.md +150 -1
- package/docs/guide/ide-integration.md +56 -1
- package/package.json +15 -14
- package/dist/dist-CXwOXAks.js +0 -3
package/LICENSE
CHANGED
|
@@ -672,6 +672,34 @@ Repository: https://github.com/lukeed/mri
|
|
|
672
672
|
|
|
673
673
|
---------------------------------------
|
|
674
674
|
|
|
675
|
+
## nanotar
|
|
676
|
+
License: MIT
|
|
677
|
+
Repository: https://github.com/unjs/nanotar
|
|
678
|
+
|
|
679
|
+
> MIT License
|
|
680
|
+
>
|
|
681
|
+
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
682
|
+
>
|
|
683
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
684
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
685
|
+
> in the Software without restriction, including without limitation the rights
|
|
686
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
687
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
688
|
+
> furnished to do so, subject to the following conditions:
|
|
689
|
+
>
|
|
690
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
691
|
+
> copies or substantial portions of the Software.
|
|
692
|
+
>
|
|
693
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
694
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
695
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
696
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
697
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
698
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
699
|
+
> SOFTWARE.
|
|
700
|
+
|
|
701
|
+
---------------------------------------
|
|
702
|
+
|
|
675
703
|
## picocolors
|
|
676
704
|
License: ISC
|
|
677
705
|
By: Alexey Raspopov
|
package/README.md
CHANGED
|
@@ -150,6 +150,16 @@ vp create
|
|
|
150
150
|
|
|
151
151
|
You can run `vp create` inside of a project to add new apps or libraries to your project.
|
|
152
152
|
|
|
153
|
+
Organizations can expose a curated set of templates under their npm scope by
|
|
154
|
+
publishing `@org/create` with a `createConfig.templates` manifest in its `package.json`.
|
|
155
|
+
Once published, `vp create @org` opens an interactive picker over those
|
|
156
|
+
templates, and setting `create: { defaultTemplate: '@org' }` in
|
|
157
|
+
`vite.config.ts` makes it the default for bare `vp create`. See the
|
|
158
|
+
[Organization Templates guide](https://viteplus.dev/guide/create#organization-templates)
|
|
159
|
+
for the authoring workflow and
|
|
160
|
+
[`create.defaultTemplate`](https://viteplus.dev/config/create) for the
|
|
161
|
+
config reference.
|
|
162
|
+
|
|
153
163
|
### Migrating an existing project
|
|
154
164
|
|
|
155
165
|
You can migrate an existing project to Vite+:
|
package/binding/index.cjs
CHANGED
|
@@ -775,4 +775,5 @@ module.exports.rewritePrettier = nativeBinding.rewritePrettier;
|
|
|
775
775
|
module.exports.rewriteScripts = nativeBinding.rewriteScripts;
|
|
776
776
|
module.exports.run = nativeBinding.run;
|
|
777
777
|
module.exports.runCommand = nativeBinding.runCommand;
|
|
778
|
+
module.exports.shouldPrintVitePlusHeader = nativeBinding.shouldPrintVitePlusHeader;
|
|
778
779
|
module.exports.vitePlusHeader = nativeBinding.vitePlusHeader;
|
package/binding/index.d.cts
CHANGED
|
@@ -369,5 +369,13 @@ export interface RunCommandResult {
|
|
|
369
369
|
pathAccesses: Record<string, PathAccess>;
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
+
/**
|
|
373
|
+
* Whether the Vite+ banner should be emitted in the current environment.
|
|
374
|
+
*
|
|
375
|
+
* Mirrors `vite_shared::header::should_print_header` so both CLIs apply
|
|
376
|
+
* the same TTY + git-hook gating without duplicating the rules in JS.
|
|
377
|
+
*/
|
|
378
|
+
export declare function shouldPrintVitePlusHeader(): boolean;
|
|
379
|
+
|
|
372
380
|
/** Render the Vite+ header using the Rust implementation. */
|
|
373
381
|
export declare function vitePlusHeader(): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
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
3
|
import { a as require_cross_spawn, i as runCommandSilently, n as hasBaseUrlInTsconfig, r as removeDeprecatedTsconfigFalseOption, t as findTsconfigFiles } from "./tsconfig-DQTf06oN.js";
|
|
4
|
-
import { t as accent } from "./terminal-
|
|
5
|
-
import { t as require_dist } from "./dist-
|
|
6
|
-
import { c as
|
|
4
|
+
import { t as accent } from "./terminal-CxTMfsxZ.js";
|
|
5
|
+
import { t as require_dist } from "./dist-DjG9AYbK.js";
|
|
6
|
+
import { c as editJsonFile, l as isJsonFile, n as detectPackageMetadata, u as readJsonFile } from "./package-CrKanQYM.js";
|
|
7
7
|
import { n as addMigrationWarning, t as addManualStep } from "./report-DbrfjWiP.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { downloadPackageManager, mergeJsonConfig, mergeTsdownConfig, rewriteEslint, rewriteImportsInDirectory, rewritePrettier, rewriteScripts } from "../binding/index.js";
|
|
@@ -1339,6 +1339,7 @@ const log = {
|
|
|
1339
1339
|
symbol: import_picocolors.default.yellow(S_WARN)
|
|
1340
1340
|
});
|
|
1341
1341
|
},
|
|
1342
|
+
/** alias for `log.warn()`. */
|
|
1342
1343
|
warning: (message, opts) => {
|
|
1343
1344
|
log.warn(message, opts);
|
|
1344
1345
|
},
|
|
@@ -4752,6 +4753,64 @@ function migrateNodeVersionManagerFile(projectPath, detection, report) {
|
|
|
4752
4753
|
} else if (detection.voltaPresent) log.info("You can now remove the \"volta\" field from package.json manually.");
|
|
4753
4754
|
return true;
|
|
4754
4755
|
}
|
|
4756
|
+
function warnPackageLevelEslint() {
|
|
4757
|
+
log.warn("ESLint detected in workspace packages but no root config found. Package-level ESLint must be migrated manually.");
|
|
4758
|
+
}
|
|
4759
|
+
function warnLegacyEslintConfig(legacyConfigFile) {
|
|
4760
|
+
log.warn(`Legacy ESLint configuration detected (${legacyConfigFile}). Automatic migration to Oxlint requires ESLint v9+ with flat config format (eslint.config.*). Please upgrade to ESLint v9 first: https://eslint.org/docs/latest/use/migrate-to-9.0.0`);
|
|
4761
|
+
}
|
|
4762
|
+
async function confirmEslintMigration(interactive) {
|
|
4763
|
+
if (interactive) {
|
|
4764
|
+
const confirmed = await confirm({
|
|
4765
|
+
message: "Migrate ESLint rules to Oxlint using @oxlint/migrate?\n " + styleText("gray", "Oxlint is Vite+'s built-in linter — significantly faster than ESLint with compatible rule support. @oxlint/migrate converts your existing rules automatically."),
|
|
4766
|
+
initialValue: true
|
|
4767
|
+
});
|
|
4768
|
+
if (q(confirmed)) cancelAndExit();
|
|
4769
|
+
return confirmed;
|
|
4770
|
+
}
|
|
4771
|
+
return true;
|
|
4772
|
+
}
|
|
4773
|
+
async function promptEslintMigration(projectPath, interactive, packages) {
|
|
4774
|
+
const eslintProject = detectEslintProject(projectPath, packages);
|
|
4775
|
+
if (eslintProject.hasDependency && !eslintProject.configFile && eslintProject.legacyConfigFile) {
|
|
4776
|
+
warnLegacyEslintConfig(eslintProject.legacyConfigFile);
|
|
4777
|
+
return false;
|
|
4778
|
+
}
|
|
4779
|
+
if (!eslintProject.hasDependency) return false;
|
|
4780
|
+
if (!eslintProject.configFile) {
|
|
4781
|
+
warnPackageLevelEslint();
|
|
4782
|
+
return false;
|
|
4783
|
+
}
|
|
4784
|
+
if (!await confirmEslintMigration(interactive)) return false;
|
|
4785
|
+
if (!await migrateEslintToOxlint(projectPath, interactive, eslintProject.configFile, packages)) cancelAndExit("ESLint migration failed.", 1);
|
|
4786
|
+
return true;
|
|
4787
|
+
}
|
|
4788
|
+
function warnPackageLevelPrettier() {
|
|
4789
|
+
log.warn("Prettier detected in workspace packages but no root config found. Package-level Prettier must be migrated manually.");
|
|
4790
|
+
}
|
|
4791
|
+
async function confirmPrettierMigration(interactive) {
|
|
4792
|
+
if (interactive) {
|
|
4793
|
+
const confirmed = await confirm({
|
|
4794
|
+
message: "Migrate Prettier to Oxfmt?\n " + styleText("gray", "Oxfmt is Vite+'s built-in formatter that replaces Prettier with faster performance. Your configuration will be converted automatically."),
|
|
4795
|
+
initialValue: true
|
|
4796
|
+
});
|
|
4797
|
+
if (q(confirmed)) cancelAndExit();
|
|
4798
|
+
return confirmed;
|
|
4799
|
+
}
|
|
4800
|
+
log.info("Prettier configuration detected. Auto-migrating to Oxfmt...");
|
|
4801
|
+
return true;
|
|
4802
|
+
}
|
|
4803
|
+
async function promptPrettierMigration(projectPath, interactive, packages) {
|
|
4804
|
+
const prettierProject = detectPrettierProject(projectPath, packages);
|
|
4805
|
+
if (!prettierProject.hasDependency) return false;
|
|
4806
|
+
if (!prettierProject.configFile) {
|
|
4807
|
+
warnPackageLevelPrettier();
|
|
4808
|
+
return false;
|
|
4809
|
+
}
|
|
4810
|
+
if (!await confirmPrettierMigration(interactive)) return false;
|
|
4811
|
+
if (!await migratePrettierToOxfmt(projectPath, interactive, prettierProject.configFile, packages)) cancelAndExit("Prettier migration failed.", 1);
|
|
4812
|
+
return true;
|
|
4813
|
+
}
|
|
4755
4814
|
//#endregion
|
|
4756
4815
|
//#region src/utils/agent.ts
|
|
4757
4816
|
const AGENTS = [
|
|
@@ -5061,4 +5120,4 @@ function getMarkedRange(content, startMarker, endMarker) {
|
|
|
5061
5120
|
};
|
|
5062
5121
|
}
|
|
5063
5122
|
//#endregion
|
|
5064
|
-
export {
|
|
5123
|
+
export { outro as $, warnLegacyEslintConfig as A, runViteInstall as B, preflightGitHooksSetup as C, rewriteMonorepoProject as D, rewriteMonorepo as E, cancelAndExit as F, DependencyType as G, upgradeYarn as H, defaultInteractive as I, cancel as J, PackageManager as K, downloadPackageManager$1 as L, warnPackageLevelPrettier as M, editYamlFile as N, rewriteStandaloneProject as O, readYamlFile as P, multiselect as Q, promptGitHooks as R, migratePrettierToOxfmt as S, promptPrettierMigration as T, displayRelative as U, selectPackageManager as V, templatesDir as W, intro as X, confirm as Y, log as Z, hasStagedConfigInViteConfig as _, writeAgentInstructions as a, migrateEslintToOxlint as b, checkVitestVersion as c, detectEslintProject as d, select as et, detectFramework as f, hasFrameworkShim as g, ensurePreCommitHook as h, updateExistingAgentInstructions as i, q as it, warnPackageLevelEslint as j, setPackageManager as k, confirmEslintMigration as l, detectPrettierProject as m, detectExistingAgentTargetPaths as n, text as nt, addFrameworkShim as o, detectNodeVersionManagerFile as p, require_semver as q, selectAgentTargetPaths as r, require_picocolors as rt, checkViteVersion as s, detectAgentConflicts as t, spinner as tt, confirmPrettierMigration as u, installGitHooks as v, promptEslintMigration as w, migrateNodeVersionManagerFile as x, mergeViteConfigFiles as y, runViteFmt as z };
|
package/dist/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
2
|
import { i as runCommandSilently, n as hasBaseUrlInTsconfig } from "./tsconfig-DQTf06oN.js";
|
|
3
|
-
import { n as errorMsg,
|
|
4
|
-
import {
|
|
3
|
+
import { n as errorMsg, r as log, s as warnMsg, t as accent } from "./terminal-CxTMfsxZ.js";
|
|
4
|
+
import { r as resolveUniversalViteConfig } from "./resolve-vite-config-C1KX9CZU.js";
|
|
5
5
|
import path, { dirname, join } from "node:path";
|
|
6
6
|
import { mergeJsonConfig, run } from "../binding/index.js";
|
|
7
7
|
import fs, { existsSync, realpathSync } from "node:fs";
|
package/dist/config/bin.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { r as log } from "../terminal-
|
|
2
|
-
import {
|
|
1
|
+
import { a as printHeader, r as log } from "../terminal-CxTMfsxZ.js";
|
|
2
|
+
import { I as defaultInteractive, R as promptGitHooks, _ as hasStagedConfigInViteConfig, h as ensurePreCommitHook, i as updateExistingAgentInstructions } from "../agent-B8Iy9rtN.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";
|
|
6
|
-
import { vitePlusHeader } from "../../binding/index.js";
|
|
7
6
|
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
8
7
|
import { spawnSync } from "node:child_process";
|
|
9
8
|
//#region src/config/hooks.ts
|
|
@@ -135,7 +134,7 @@ async function main() {
|
|
|
135
134
|
}]
|
|
136
135
|
}]
|
|
137
136
|
});
|
|
138
|
-
|
|
137
|
+
printHeader();
|
|
139
138
|
log(helpMessage);
|
|
140
139
|
return;
|
|
141
140
|
}
|