From ebefac8763fac9f11bfab7606a4de2897f5bf475 Mon Sep 17 00:00:00 2001 From: nyatinte Date: Fri, 27 Mar 2026 17:13:42 +0900 Subject: [PATCH 1/2] migration vite-plus --- .oxfmtrc.jsonc | 23 - .oxlintrc.json | 36 -- .zed/settings.json | 200 +++++++- CLAUDE.md | 89 ++++ package.json | 22 +- pnpm-lock.yaml | 1139 +++++++++++++++++++++---------------------- pnpm-workspace.yaml | 23 + tsdown.config.ts | 7 - vite.config.ts | 47 ++ vitest.config.ts | 14 - 10 files changed, 912 insertions(+), 688 deletions(-) delete mode 100644 .oxfmtrc.jsonc delete mode 100644 .oxlintrc.json delete mode 100644 tsdown.config.ts create mode 100644 vite.config.ts delete mode 100644 vitest.config.ts diff --git a/.oxfmtrc.jsonc b/.oxfmtrc.jsonc deleted file mode 100644 index b1bb9b1..0000000 --- a/.oxfmtrc.jsonc +++ /dev/null @@ -1,23 +0,0 @@ -// Ultracite oxfmt Configuration -// https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html -{ - "$schema": "./node_modules/oxfmt/configuration_schema.json", - "printWidth": 80, - "tabWidth": 2, - "useTabs": false, - "semi": true, - "singleQuote": false, - "quoteProps": "as-needed", - "jsxSingleQuote": false, - "trailingComma": "es5", - "bracketSpacing": true, - "bracketSameLine": false, - "arrowParens": "always", - "endOfLine": "lf", - "experimentalSortPackageJson": true, - "experimentalSortImports": { - "ignoreCase": true, - "newlinesBetween": true, - "order": "asc", - }, -} diff --git a/.oxlintrc.json b/.oxlintrc.json deleted file mode 100644 index dc2e5df..0000000 --- a/.oxlintrc.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "$schema": "./node_modules/oxlint/configuration_schema.json", - "extends": ["./node_modules/ultracite/config/oxlint/core/.oxlintrc.json"], - "ignorePatterns": ["example/**"], - "rules": { - "func-style": "off", - "sort-keys": "off", - "no-shadow": "off", - "no-use-before-define": "off", - "no-promise-executor-return": "off", - "import/no-relative-parent-imports": "off", - "import/first": "off", - "promise/prefer-await-to-then": "off", - "promise/prefer-await-to-callbacks": "off", - "promise/avoid-new": "off", - "unicorn/no-array-for-each": "off", - "unicorn/no-await-expression-member": "off", - "typescript/consistent-type-imports": "off" - }, - "overrides": [ - { - "files": [ - "**/*.{test,spec}.{ts,tsx,js,jsx}", - "**/__tests__/**/*.{ts,tsx,js,jsx}", - "test/**/*.{ts,tsx,js,jsx}" - ], - "plugins": ["jest", "vitest"], - "rules": { - "jest/no-hooks": "off", - "jest/valid-title": "off", - "jest/prefer-called-with": "off", - "vitest/prefer-strict-boolean-matchers": "off" - } - } - ] -} diff --git a/.zed/settings.json b/.zed/settings.json index 3d6119e..a702101 100644 --- a/.zed/settings.json +++ b/.zed/settings.json @@ -18,7 +18,8 @@ "fixKind": "safe_fix", "run": "onType", "typeAware": true, - "unusedDisableDirectives": "deny" + "unusedDisableDirectives": "deny", + "configPath": "./.oxlintrc.json" } } }, @@ -46,7 +47,12 @@ "code_actions_on_format": { "source.fixAll.oxc": true, "source.organizeImports.oxc": true - } + }, + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "code_action": "source.fixAll.oxc" }, "TypeScript": { "formatter": { @@ -57,6 +63,10 @@ "code_actions_on_format": { "source.fixAll.oxc": true, "source.organizeImports.oxc": true + }, + "format_on_save": "on", + "prettier": { + "allowed": false } }, "TSX": { @@ -68,7 +78,193 @@ "code_actions_on_format": { "source.fixAll.oxc": true, "source.organizeImports.oxc": true + }, + "format_on_save": "on", + "prettier": { + "allowed": false } + }, + "CSS": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "GraphQL": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "Handlebars": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "HTML": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "JSX": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "JSON": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "JSON5": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "JSONC": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "Less": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "Markdown": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "MDX": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "SCSS": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "Vue.js": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] + }, + "YAML": { + "format_on_save": "on", + "prettier": { + "allowed": false + }, + "formatter": [ + { + "language_server": { + "name": "oxfmt" + } + } + ] } } } diff --git a/CLAUDE.md b/CLAUDE.md index 97eef2c..dfc87eb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,3 +43,92 @@ Uses Changesets. - `pnpm version-packages` applies pending changesets locally. - `pnpm release` publishes via Changesets. - `prepublishOnly` runs `pnpm build && pnpm build:man`, so release-related changes should keep the generated man page in sync. + + + +# Using Vite+, the Unified Toolchain for the Web + +This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, but it invokes Vite through `vp dev` and `vp build`. + +## Vite+ Workflow + +`vp` is a global binary that handles the full development lifecycle. Run `vp help` to print a list of commands and `vp --help` for information about a specific command. + +### Start + +- create - Create a new project from a template +- migrate - Migrate an existing project to Vite+ +- config - Configure hooks and agent integration +- staged - Run linters on staged files +- install (`i`) - Install dependencies +- env - Manage Node.js versions + +### Develop + +- dev - Run the development server +- check - Run format, lint, and TypeScript type checks +- lint - Lint code +- fmt - Format code +- test - Run tests + +### Execute + +- run - Run monorepo tasks +- exec - Execute a command from local `node_modules/.bin` +- dlx - Execute a package binary without installing it as a dependency +- cache - Manage the task cache + +### Build + +- build - Build for production +- pack - Build libraries +- preview - Preview production build + +### Manage Dependencies + +Vite+ automatically detects and wraps the underlying package manager such as pnpm, npm, or Yarn through the `packageManager` field in `package.json` or package manager-specific lockfiles. + +- add - Add packages to dependencies +- remove (`rm`, `un`, `uninstall`) - Remove packages from dependencies +- update (`up`) - Update packages to latest versions +- dedupe - Deduplicate dependencies +- outdated - Check for outdated packages +- list (`ls`) - List installed packages +- why (`explain`) - Show why a package is installed +- info (`view`, `show`) - View package information from the registry +- link (`ln`) / unlink - Manage local package links +- pm - Forward a command to the package manager + +### Maintain + +- upgrade - Update `vp` itself to the latest version + +These commands map to their corresponding tools. For example, `vp dev --port 3000` runs Vite's dev server and works the same as Vite. `vp test` runs JavaScript tests through the bundled Vitest. The version of all tools can be checked using `vp --version`. This is useful when researching documentation, features, and bugs. + +## Common Pitfalls + +- **Using the package manager directly:** Do not use pnpm, npm, or Yarn directly. Vite+ can handle all package manager operations. +- **Always use Vite commands to run tools:** Don't attempt to run `vp vitest` or `vp oxlint`. They do not exist. Use `vp test` and `vp lint` instead. +- **Running scripts:** Vite+ built-in commands (`vp dev`, `vp build`, `vp test`, etc.) always run the Vite+ built-in tool, not any `package.json` script of the same name. To run a custom script that shares a name with a built-in command, use `vp run