-
Notifications
You must be signed in to change notification settings - Fork 185
docs: add getting started guide #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| # Getting Started | ||
|
|
||
| ## Overview | ||
|
|
||
| Vite+ is a unified toolchain for modern web development that extends Vite with powerful monorepo capabilities. It combines: | ||
|
|
||
| - **Dev Server**: Vite's blazing-fast development experience with native ES modules and instant HMR | ||
| - **Build Tool**: Optimized production builds powered by Rolldown | ||
| - **Task Runner**: Intelligent monorepo task execution with caching and dependency resolution | ||
| - **Testing**: Built-in test runner with workspace support | ||
| - **Linting**: Integrated oxlint for fast code quality checks | ||
| - **Formatting**: Integrated oxfmt for consistent code formatting | ||
| - **Code Generation**: Scaffolding for new projects and monorepo workspaces | ||
| - **Dependency Management**: Integrated dependency management with pnpm, yarn, npm and bun(coming soon) | ||
|
fengmk2 marked this conversation as resolved.
fengmk2 marked this conversation as resolved.
|
||
|
|
||
| All in a single, cohesive tool designed for scale, speed, and developer sanity. | ||
|
|
||
| ## Installation | ||
|
|
||
| ### Global CLI | ||
|
|
||
| Add the following to your `~/.npmrc`: | ||
|
|
||
| ```ini | ||
| //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} | ||
| @voidzero-dev:registry=https://npm.pkg.github.com/ | ||
| ``` | ||
|
|
||
| Create a [classic personal access token](https://docs.github.com/en/packages/learn-github-packages/about-permissions-for-github-packages#about-scopes-and-permissions-for-package-registries) and install the global CLI: | ||
|
|
||
| ```bash | ||
| GITHUB_TOKEN=<your-token> npm install -g @voidzero-dev/global | ||
| ``` | ||
|
|
||
| Using 1Password CLI: | ||
|
|
||
| ```bash | ||
| GITHUB_TOKEN=$(op read "op://YOUR_GITHUB_TOKEN_PATH") npm install -g @voidzero-dev/global | ||
| ``` | ||
|
|
||
| ## Scaffolding Your First Vite+ Project | ||
|
|
||
| Create a Vite+ project: | ||
|
|
||
| ```bash | ||
| vite gen | ||
| ``` | ||
|
|
||
| Follow the prompts to select your preferred framework and configuration. | ||
|
|
||
| ## Core Commands | ||
|
|
||
| Vite+ provides built-in commands that work seamlessly in both single-package and monorepo setups: | ||
|
|
||
| ```bash | ||
| # Development | ||
| vite dev # Start dev server | ||
|
|
||
| # Build | ||
| vite build # Build for production | ||
|
|
||
| # Test | ||
| vite test # Run tests | ||
|
|
||
| # Lint | ||
| vite lint # Lint code with oxlint | ||
|
fengmk2 marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| ## Monorepo Task Execution | ||
|
|
||
| Vite+ includes a powerful task runner for managing tasks across monorepo packages: | ||
|
|
||
| ### Run tasks recursively | ||
|
|
||
| ```bash | ||
| vite run build -r # Build all packages with topological ordering | ||
| vite run test -r # Test all packages | ||
| ``` | ||
|
|
||
| ### Run tasks for specific packages | ||
|
|
||
| ```bash | ||
| vite run app#build web#build # Build specific packages | ||
| vite run @scope/*#test # Test all packages matching pattern | ||
| ``` | ||
|
|
||
| ### Current package | ||
|
|
||
| ```bash | ||
| vite dev # Run dev script in current package | ||
| ``` | ||
|
|
||
| ## Task Dependencies | ||
|
|
||
| Tasks automatically respect dependencies: | ||
|
|
||
| 1. **Explicit dependencies** - Defined in `vite-task.json`: | ||
|
|
||
| ```json | ||
| { | ||
| "tasks": { | ||
| "test": { | ||
| "command": "jest", | ||
| "dependsOn": ["build", "lint"] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| 2. **Implicit dependencies** - Based on `package.json` relationships when using `--topological` (default for `-r`): | ||
| - If package A depends on package B, then `A#build` automatically depends on `B#build` | ||
|
|
||
| Disable topological ordering: | ||
|
|
||
| ```bash | ||
| vite run build -r --no-topological | ||
| ``` | ||
|
|
||
| ## Intelligent Caching | ||
|
|
||
| Vite+ caches task outputs to speed up repeated builds: | ||
|
|
||
| - Automatically detects when inputs change | ||
| - Skips tasks when outputs are cached | ||
| - Shares cache across team members (when configured) | ||
|
|
||
| View cache operations: | ||
|
|
||
| ```bash | ||
| vite run build -r --debug | ||
| ``` | ||
|
|
||
| ## Next Steps | ||
|
|
||
| - Learn more about [task configuration](/guide/tasks) | ||
| - Explore [caching strategies](/guide/caching) | ||
| - Set up [monorepo workspaces](/guide/monorepo) | ||
| - Customize [Vite+ configuration](/config/) | ||
|
fengmk2 marked this conversation as resolved.
fengmk2 marked this conversation as resolved.
|
||
|
|
||
| ## Community & Support | ||
|
|
||
| Get help and stay updated: | ||
|
|
||
| - [GitHub Issues](https://github.com/voidzero-dev/vite-plus/issues) | ||
| - [GitHub Discussions](https://github.com/voidzero-dev/vite-plus/discussions) | ||
|
|
||
| --- | ||
|
|
||
| ::: tip Requirements | ||
| Vite+ requires Node.js 20.19+, 22.12+ or 24.12+ | ||
|
fengmk2 marked this conversation as resolved.
fengmk2 marked this conversation as resolved.
|
||
| ::: | ||
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.