diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index df808ad510..29556704f1 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -3,12 +3,84 @@ import { defineConfig } from 'vitepress'; // https://vitepress.dev/reference/site-config export default defineConfig({ title: 'Vite+', + titleTemplate: ':title | The UnifiedToolchain for the Web', description: 'The Unified Toolchain for the Web', + head: [ + ['link', { rel: 'icon', href: 'https://viteplus.dev/favicon.svg' }], + ], themeConfig: { + logo: { src: 'https://viteplus.dev/favicon.svg', width: 24, height: 24 }, + // https://vitepress.dev/reference/default-theme-config nav: [ { text: 'Home', link: '/' }, - { text: 'Get Started', link: '/guide/' }, + { + text: 'Guide', + activeMatch: '/vite/guide/', + items: [ + { text: 'Vite Core', link: '/vite/guide/' }, + { text: 'Test', link: '/vite/guide/test/getting-started' }, + { text: 'Lint', link: '/vite/guide/lint/getting-started' }, + { text: 'Format', link: '/vite/guide/format/getting-started' }, + { text: 'Task Runner', link: '/vite/guide/task/getting-started' }, + { text: 'Library Bundler', link: '/lib/guide/getting-started' }, + { text: 'DevTools', link: '/guide/devtools/getting-started' }, + { text: 'Package Manager', link: '/guide/package-manager/getting-started' }, + ], + }, + { + text: 'Config', + activeMatch: '/config/', + items: [ + { text: 'Vite Core', link: '/config/' }, + { text: 'Test', link: '/config/test' }, + { text: 'Lint', link: '/config/lint' }, + { text: 'Format', link: '/config/format' }, + { text: 'Task Runner', link: '/config/task' }, + { text: 'Package Manager', link: '/config/package-manager' }, + ], + }, + { + text: 'APIs', + activeMatch: '/apis/', + items: [ + { text: 'Vite API', link: '/apis/' }, + { text: 'Environment API', link: '/apis/environment' }, + { text: 'Test API', link: '/apis/test' }, + { text: 'Lint API', link: '/apis/lint' }, + { text: 'Format API', link: '/apis/format' }, + { text: 'Task Runner API', link: '/apis/task-runner' }, + ], + }, + { + text: 'Plugins', + activeMatch: '/plugins/', + items: [ + { text: 'Vite Plugins', link: '/plugins/' }, + { text: 'Test Plugins', link: '/plugins/test' }, + { text: 'Lint Plugins', link: '/plugins/lint' }, + { text: 'Format Plugins', link: '/plugins/format' }, + { text: 'Task Runner Plugins', link: '/plugins/task-runner' }, + ], + }, + // { + // text: 'Test', + // activeMatch: '/plugins/', + // items: [ + // { text: 'Guide & API', link: '/test/guide/' }, + // { text: 'Config', link: '/test/config/' }, + // { text: 'Browser Mode', link: '/test/browser-mode/' }, + // ], + // }, + // { + // text: 'Format', + // activeMatch: '/plugins/', + // items: [ + // { text: 'Guide & API', link: '/test/guide/' }, + // { text: 'Config', link: '/test/config/' }, + // { text: 'Browser Mode', link: '/test/browser-mode/' }, + // ], + // }, { text: 'Resources', items: [ @@ -44,61 +116,552 @@ export default defineConfig({ ], sidebar: { - '/guide/': [ + '/vite/guide/': { + base: '/vite/guide/', + items: [ + { + text: 'Introduction', + items: [ + { + text: 'Getting Started', + link: 'index', + }, + { + text: 'Monorepo', + link: 'monorepo', + }, + { + text: 'Philosophy', + link: 'philosophy', + }, + { + text: 'Why Vite+', + link: 'why', + }, + { + text: 'Migration', + link: 'migration', + }, + ], + }, + { + text: 'Vite Core', + items: [ + { + text: 'Features', + link: 'features', + }, + { + text: 'CLI', + link: 'cli', + }, + { + text: 'Using Plugins', + link: 'using-plugins', + }, + { + text: 'Dependency Pre-Bundling', + link: 'dependency-pre-bundling', + }, + { + text: 'Static Asset Handling', + link: 'static-asset-handling', + }, + { + text: 'Building for Production', + link: 'building-for-production', + }, + { + text: 'Deploying a Static Site', + link: 'deploying-a-static-site', + }, + { + text: 'Env Variables and Modes', + link: 'env-variables-and-modes', + }, + { + text: 'Server-Side Rendering', + link: 'server-side-rendering', + }, + { + text: 'Backend Integration', + link: 'backend-integration', + }, + { + text: 'Troubleshooting', + link: 'troubleshooting', + }, + { + text: 'Performance', + link: 'performance', + }, + { + text: 'Migration from vite@7+', + link: 'migration', + }, + ], + }, + { + text: 'Test', + items: [ + { + text: 'Getting Started', + link: '/guide/test/getting-started', + }, + { + text: 'Features', + link: '/guide/test/features', + }, + { + text: 'CLI', + link: '/guide/test/cli', + }, + { + text: 'Test Filtering', + link: '/guide/test/test-filtering', + }, + { + text: '...', + link: '/guide/test/dependency-pre-bundling', + }, + { + text: 'Migration from vitest', + link: '/guide/test/migration-from-vitest', + }, + ], + }, + { + text: 'Lint', + items: [ + { + text: 'Getting Started', + link: '/guide/lint/getting-started', + }, + { + text: 'Features', + link: '/guide/lint/features', + }, + { + text: 'CLI', + link: '/guide/lint/cli', + }, + { + text: '...', + link: '/guide/test/dependency-pre-bundling', + }, + { + text: 'Migration from oxlint', + link: '/guide/test/migration-from-oxlint', + }, + { + text: 'Migration from ESLint', + link: '/guide/test/migration-from-eslint', + }, + ], + }, + { + text: 'Format', + items: [ + { + text: 'Getting Started', + link: '/guide/format/getting-started', + }, + { + text: 'Features', + link: '/guide/format/features', + }, + { + text: 'CLI', + link: '/guide/format/cli', + }, + { + text: 'Migration from oxfmt', + link: '/guide/format/migration-from-oxfmt', + }, + { + text: 'Migration from Prettier', + link: '/guide/format/migration-from-prettier', + }, + ], + }, + { + text: 'Task Runner', + items: [ + { + text: 'Getting Started', + link: 'task/getting-started', + }, + { + text: 'Features', + link: '/guide/task/features', + }, + { + text: 'CLI', + link: '/guide/task/cli', + }, + { + text: 'Migration from Turborepo', + link: '/guide/format/migration-from-turborepo', + }, + { + text: 'Migration from Nx', + link: '/guide/format/migration-from-nx', + }, + { + text: 'Migration from Lerna', + link: '/guide/format/migration-from-lerna', + }, + { + text: 'Migration from pnpm', + link: '/guide/format/migration-from-pnpm', + }, + { + text: 'Migration from yarn', + link: '/guide/format/migration-from-yarn', + }, + { + text: 'Migration from npm', + link: '/guide/format/migration-from-npm', + }, + { + text: 'Migration from bun', + link: '/guide/format/migration-from-bun', + }, + ], + }, + { + text: 'Library Bundler', + items: [ + { + text: 'Getting Started', + link: '/guide/library/getting-started', + }, + { + text: 'Features', + link: '/guide/library/features', + }, + { + text: 'CLI', + link: '/guide/library/cli', + }, + { + text: 'Migration from tsdown', + link: '/guide/library/migration-from-tsdown', + }, + { + text: 'Migration from tsup', + link: '/guide/library/migration-from-tsup', + }, + { + text: 'Migration from esbuild', + link: '/guide/library/migration-from-esbuild', + }, + ], + }, + { + text: 'DevTools', + items: [ + { + text: 'Getting Started', + link: '/guide/devtools/getting-started', + }, + { + text: 'Features', + link: '/guide/library/features', + }, + { + text: 'CLI', + link: '/guide/devtools/cli', + }, + ], + }, + { + text: 'Package Manager', + items: [ + { + text: 'Getting Started', + link: '/guide/package-manager/getting-started', + }, + { + text: 'Features', + link: '/guide/package-manager/features', + }, + { + text: 'CLI', + link: '/guide/package-manager/cli', + }, + ], + }, + ], + }, + '/lib/guide/': { + base: '/lib/guide/', + items: [ + { + text: 'Library Bundler', + items: [ + { + text: 'Introduction', + link: 'introduction', + }, + { + text: 'Getting Started', + link: 'getting-started', + }, + { + text: 'Migration from tsdown', + link: '/guide/library/migration-from-tsdown', + }, + { + text: 'Migration from tsup', + link: '/guide/library/migration-from-tsup', + }, + { + text: 'Migration from esbuild', + link: '/guide/library/migration-from-esbuild', + }, + ], + }, + { + text: 'Options', + items: [ + { + text: 'Entry', + link: 'entry', + }, + { + text: 'Config File', + link: 'config-file', + }, + { + text: 'Declaration Files (dts)', + link: 'dts', + }, + ], + }, + { + text: 'Recipes', + items: [ + { + text: 'Vue Support', + link: 'vue-support', + }, + { + text: 'React Support', + link: 'react-support', + }, + { + text: 'Svelte Support', + link: 'svelte-support', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Plugins', + link: 'plugins', + }, + { + text: 'Hooks', + link: 'hooks', + }, + { + text: 'Rolldown Options', + link: 'rolldown-options', + }, + { + text: 'Programmatic Usage', + link: 'programmatic-usage', + }, + ], + }, + { + text: 'API Reference', + items: [ + { + text: 'Command Line Interface', + link: 'command-line-interface', + }, + { + text: 'Config Options', + link: 'config-options', + }, + { + text: 'Type Definitions', + items: [ + { + text: 'AttwOptions', + link: 'attributes-options', + }, + { + text: 'BuildContext', + link: 'build-context', + }, + ], + }, + ], + }, + ], + }, + '/config/': [ { - text: 'Introduction', + text: 'Vite Core', items: [ { - text: 'Getting Started', - link: '/guide/', + text: 'Configuring Vite+', + link: '/config/', + }, + { + text: 'Shared Options', + link: '/config/shared-options', + }, + { + text: 'Server Options', + link: '/config/server-options', + }, + { + text: 'Build Options', + link: '/config/build-options', + }, + { + text: 'Preview Options', + link: '/config/preview-options', + }, + { + text: 'Dep Optimization Options', + link: '/config/dep-optimization-options', + }, + { + text: 'SSR Options', + link: '/config/ssr-options', }, { - text: 'Migration', - link: '/guide/migration', + text: 'Worker Options', + link: '/config/worker-options', }, ], }, { - text: 'Guide', + text: 'Test', items: [ { - text: 'Features', - link: '/guide/features', + text: 'Configuring Test', + link: '/config/test', }, { - text: 'Monorepo', - link: '/guide/monorepo', + text: 'Test Options', + link: '/config/test-options', }, + ], + }, + { + text: 'Lint', + items: [ { - text: 'Testing', - link: '/guide/testing', + text: 'Configuring Lint', + link: '/config/lint', }, { - text: 'Linting', - link: '/guide/linting', + text: 'Lint Options', + link: '/config/lint-options', }, + ], + }, + ], + '/apis/': [ + { + text: 'Vite Core API', + items: [ { - text: 'Formatting', - link: '/guide/formatting', + text: 'Plugin API', + link: '/apis/vite/plugin', }, { - text: 'Caching', - link: '/guide/caching', + text: 'HMR API', + link: '/apis/vite/hmr', }, { - text: 'CLI', - link: '/guide/cli', + text: 'JavaScript API', + link: '/apis/vite/javascript', }, ], }, - ], - '/config/': [ { - text: 'Config', + text: 'Environment API', items: [ { - text: 'Configuring Vite+', - link: '/config/', + text: 'Introduction', + link: '/apis/environment/introduction', + }, + { + text: 'Environment Instances', + link: '/apis/environment/instances', + }, + { + text: 'Plugins', + link: '/apis/environment/plugins', + }, + { + text: 'Frameworks', + link: '/apis/environment/frameworks', + }, + { + text: 'Runtimes', + link: '/apis/environment/runtimes', + }, + ], + }, + { + text: 'Test API', + items: [ + { + text: 'Introduction', + link: '/apis/test/introduction', + }, + { + text: 'Plugin API', + link: '/apis/test/plugin', + }, + ], + }, + { + text: 'Lint API', + items: [ + { + text: 'Introduction', + link: '/apis/lint/introduction', + }, + { + text: 'Plugin API', + link: '/apis/lint/plugin', + }, + ], + }, + { + text: 'Format API', + items: [ + { + text: 'Introduction', + link: '/apis/format/introduction', + }, + { + text: 'Plugin API', + link: '/apis/format/plugin', + }, + ], + }, + { + text: 'Task Runner API', + items: [ + { + text: 'Introduction', + link: '/apis/task-runner/introduction', + }, + { + text: 'Plugin API', + link: '/apis/task-runner/plugin', }, ], }, @@ -115,5 +678,9 @@ export default defineConfig({ outline: { level: [2, 3], }, + + search: { + provider: 'local', + }, }, }); diff --git a/docs/guide/caching.md b/docs/apis/index.md similarity index 100% rename from docs/guide/caching.md rename to docs/apis/index.md diff --git a/docs/index.md b/docs/index.md index 0568245b1e..12aba8ca87 100644 --- a/docs/index.md +++ b/docs/index.md @@ -9,7 +9,7 @@ hero: actions: - theme: brand text: Get Started - link: /guide/ + link: /vite/guide/ - theme: alt text: GitHub link: https://github.com/voidzero-dev/vite-plus diff --git a/docs/lib/guide/getting-started.md b/docs/lib/guide/getting-started.md new file mode 100644 index 0000000000..a99d92da6b --- /dev/null +++ b/docs/lib/guide/getting-started.md @@ -0,0 +1,13 @@ +# 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 + +All in a single, cohesive tool designed for scale, speed, and developer sanity. diff --git a/docs/guide/monorepo.md b/docs/vite/guide/caching.md similarity index 100% rename from docs/guide/monorepo.md rename to docs/vite/guide/caching.md diff --git a/docs/guide/cli.md b/docs/vite/guide/cli.md similarity index 99% rename from docs/guide/cli.md rename to docs/vite/guide/cli.md index f9d01d3adc..82deeb8064 100644 --- a/docs/guide/cli.md +++ b/docs/vite/guide/cli.md @@ -679,7 +679,7 @@ vite optimize [root] Locally preview the production build. Do not use this as a production server as it's not designed for it. -This command starts a server in the build directory (by default `dist`). Run `vite build` beforehand to ensure that the build directory is up-to-date. Depending on the project's configured [`appType`](../config/shared-options.md#apptype), it makes use of certain middleware. +This command starts a server in the build directory (by default `dist`). Run `vite build` beforehand to ensure that the build directory is up-to-date. Depending on the project's configured [`appType`](../../config/shared-options.md#apptype), it makes use of certain middleware. #### Usage diff --git a/docs/guide/index.md b/docs/vite/guide/index.md similarity index 94% rename from docs/guide/index.md rename to docs/vite/guide/index.md index 979d55e881..3061681576 100644 --- a/docs/guide/index.md +++ b/docs/vite/guide/index.md @@ -132,10 +132,10 @@ 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/) +- Learn more about [task configuration](./task/getting-started) +- Explore [caching strategies](./caching) +- Set up [monorepo workspaces](./monorepo) +- Customize [Vite+ configuration](../../config/) ## Community & Support diff --git a/docs/guide/migration.md b/docs/vite/guide/migration.md similarity index 100% rename from docs/guide/migration.md rename to docs/vite/guide/migration.md diff --git a/docs/guide/tasks.md b/docs/vite/guide/monorepo.md similarity index 100% rename from docs/guide/tasks.md rename to docs/vite/guide/monorepo.md diff --git a/docs/guide/troubleshooting.md b/docs/vite/guide/task/getting-started.md similarity index 100% rename from docs/guide/troubleshooting.md rename to docs/vite/guide/task/getting-started.md diff --git a/docs/vite/guide/tasks.md b/docs/vite/guide/tasks.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/vite/guide/troubleshooting.md b/docs/vite/guide/troubleshooting.md new file mode 100644 index 0000000000..e69de29bb2