Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Vite+

The Unified Toolchain for the Web
**The Unified Toolchain for the Web**
_dev, build, test, lint, format, monorepo caching & more in a single dependency, built for scale, speed, and sanity_
3 changes: 3 additions & 0 deletions packages/global/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Using Vite+, the Unified Toolchain for the Web

*TODO*
Comment thread
cpojer marked this conversation as resolved.
Comment thread
fengmk2 marked this conversation as resolved.
1 change: 1 addition & 0 deletions packages/global/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"files": [
"bin",
"dist",
"AGENTS.md",
"templates",
"rules"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
◆ ✅ Merged .oxfmtrc.json into vite.config.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
25 changes: 25 additions & 0 deletions packages/global/snap-tests/migration-check/snap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
> vite migration --help # show help
Usage: vite migration [PATH] [OPTIONS]

Migrate standalone vite, vitest, oxlint, and oxfmt to unified vite-plus.

Arguments:
PATH Target directory to migrate (default: current directory)

Options:
--agent NAME Write agent instructions file into the project (e.g. chatgpt, claude, opencode).
--no-interactive Run in non-interactive mode (skip prompts and use defaults)
-h, --help Show this help message

Examples:
# Migrate current package
vite migration

# Migrate specific directory
vite migration my-app

# Non-interactive mode
vite migration --no-interactive

Aliases: migrate

3 changes: 3 additions & 0 deletions packages/global/snap-tests/migration-check/steps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"commands": ["vite migration --help # show help"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
◆ ✅ Merged tsdown.config.json into vite.config.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down Expand Up @@ -61,6 +63,8 @@ export default defineConfig({
● pnpm@<semver> installed
● Skipped writing AGENTS.md (already exists)
└ ✨ Migration completed!


Expand Down
4 changes: 4 additions & 0 deletions packages/global/snap-tests/migration-from-tsdown/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
● tsdown.config.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down Expand Up @@ -70,6 +72,8 @@ export default defineConfig({
● 📦 Please manually merge tsdown.config.ts into vite.config.ts, see https://viteplus.dev/migration/#tsdown
● Skipped writing AGENTS.md (already exists)
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
● vitest.config.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
● test/hello.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Arguments:
PATH Target directory to migrate (default: current directory)

Options:
--agent NAME Write agent instructions file into the project (e.g. chatgpt, claude, opencode).
--no-interactive Run in non-interactive mode (skip prompts and use defaults)
-h, --help Show this help message

Expand Down Expand Up @@ -34,6 +35,8 @@ Aliases: migrate
◆ ✅ Rewrote lint-staged config in .lintstagedrc.json
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
▲ Please migrate the lint-staged config manually, see https://viteplus.dev/migration/#lint-staged for more details
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
◆ ✅ Merged .oxlintrc.json into vite.config.js
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
● vite.config.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
● vite.config.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
2 changes: 2 additions & 0 deletions packages/global/snap-tests/migration-monorepo-pnpm/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
● vite.config.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
● packages/vite-plugin/src/index.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
2 changes: 2 additions & 0 deletions packages/global/snap-tests/migration-monorepo-yarn4/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
● vite.config.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
● src/index.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
● src/index.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
● src/index.ts
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
2 changes: 2 additions & 0 deletions packages/global/snap-tests/migration-subpath/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
● pnpm@<semver> installed
◆ Wrote agent instructions to AGENTS.md
└ ✨ Migration completed!


Expand Down
1 change: 1 addition & 0 deletions packages/global/snap-tests/new-check/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Arguments:
Options (before --):
--directory DIR Target directory for the generated project.
Only works for built-in templates; auto-detected for remote templates.
--agent NAME Write agent instructions file into the generated project (e.g. chatgpt, claude, opencode).
--no-interactive Run in non-interactive mode (skip prompts and use defaults)
--list List all available templates
-h, --help Show this help message
Expand Down
2 changes: 2 additions & 0 deletions packages/global/snap-tests/new-vite-monorepo/snap.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
> vite new vite:monorepo --no-interactive # create monorepo with default values
> ls vite-plus-monorepo | LC_ALL=C sort # check files created
AGENTS.md
README.md
apps
package.json
Expand Down Expand Up @@ -108,6 +109,7 @@ vite-plus-generator

> vite new vite:monorepo --no-interactive --directory my-vite-plus-monorepo # create monorepo with custom directory
> ls my-vite-plus-monorepo | LC_ALL=C sort # check files created
AGENTS.md
README.md
apps
package.json
Expand Down
19 changes: 19 additions & 0 deletions packages/global/src/migration/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
runViteInstall,
upgradeYarn,
cancelAndExit,
selectAgentTargetPath,
writeAgentInstructions,
} from '../utils/index.js';
import {
checkVitestVersion,
Expand All @@ -34,6 +36,7 @@ Arguments:
PATH Target directory to migrate (default: current directory)

Options:
--agent NAME Write agent instructions file into the project (e.g. chatgpt, claude, opencode).
--no-interactive Run in non-interactive mode (skip prompts and use defaults)
-h, --help Show this help message

Expand All @@ -53,6 +56,7 @@ Aliases: ${gray('migrate')}
export interface MigrationOptions {
interactive: boolean;
help?: boolean;
agent?: string;
}

function parseArgs() {
Expand All @@ -61,9 +65,11 @@ function parseArgs() {
const parsed = mri<{
help?: boolean;
interactive?: boolean;
agent?: string;
}>(args, {
alias: { h: 'help' },
boolean: ['help', 'interactive'],
string: ['agent'],
default: { interactive: defaultInteractive() },
});

Expand All @@ -79,6 +85,7 @@ function parseArgs() {
options: {
interactive: parsed.interactive,
help: parsed.help,
agent: parsed.agent,
} as MigrationOptions,
};
}
Expand Down Expand Up @@ -154,6 +161,18 @@ async function main() {
rewriteStandaloneProject(workspaceInfo.rootDir, workspaceInfo);
}

const selectedAgentTargetPath = await selectAgentTargetPath({
interactive: options.interactive,
agent: options.agent,
onCancel: () => cancelAndExit(),
});

await writeAgentInstructions({
projectRoot: workspaceInfo.rootDir,
targetPath: selectedAgentTargetPath,
interactive: options.interactive,
});

// reinstall after migration
await runViteInstall(workspaceInfo.rootDir, options.interactive);
prompts.outro(green('✨ Migration completed!'));
Expand Down
Loading
Loading