From 78f8e447212712f6c0c4f92f6bb4c3b497706492 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Fri, 22 May 2026 18:37:24 -0400 Subject: [PATCH] chore: migrate to vite+ --- .github/workflows/ci.yml | 34 +- .github/workflows/release.yml | 33 +- .oxfmtrc.json | 23 - .oxlintrc.json | 53 - .vite-hooks/pre-commit | 1 + .vscode/extensions.json | 7 +- .vscode/settings.json | 3 +- AGENTS.md | 35 +- README.md | 13 +- REGISTRY.md | 145 -- TODO.md | 6 +- apps/cli/package.json | 14 +- apps/cli/src/commands/add.ts | 13 +- apps/cli/src/commands/commands.test.ts | 2 +- apps/cli/src/commands/remove.ts | 8 +- apps/cli/src/lib/codemod-runner.ts | 16 +- apps/cli/src/lib/npm-version.test.ts | 2 +- apps/cli/src/lib/npm-version.ts | 9 +- apps/cli/src/lib/registry-loader.ts | 8 +- apps/cli/src/lib/wizard.ts | 27 +- apps/cli/tsdown.config.ts | 11 - apps/cli/vite.config.ts | 13 + apps/cli/vitest.config.ts | 3 - .../docs/{cli-reference.mdx => cli.mdx} | 6 +- apps/web/content/docs/concepts.mdx | 29 +- apps/web/content/docs/index.mdx | 2 +- apps/web/content/docs/meta.json | 2 +- apps/web/content/docs/registry.mdx | 175 +++ apps/web/package.json | 15 +- .../src/components/builder/project-setup.tsx | 2 +- .../web/src/components/builder/slot-cards.tsx | 3 + apps/web/src/components/command-preview.tsx | 2 +- .../components/detail/adapter-switcher.tsx | 9 +- .../src/components/package-manager-select.tsx | 6 +- apps/web/src/components/posthog-provider.tsx | 2 +- apps/web/src/components/theme-provider.tsx | 2 +- apps/web/src/components/ui/input-group.tsx | 2 +- apps/web/src/components/ui/sonner.tsx | 5 +- apps/web/src/components/ui/toggle-group.tsx | 2 + apps/web/src/lib/selection.test.ts | 313 ---- apps/web/src/routes/__root.tsx | 17 +- apps/web/src/routes/api.events.ts | 20 +- apps/web/src/routes/m.$slot.$id.tsx | 5 +- .../web/src/server/module-detail.functions.ts | 13 +- apps/web/src/server/registry-base.server.ts | 8 +- apps/web/src/styles.css | 7 + apps/web/turbo.json | 9 - apps/web/vite.config.ts | 8 +- package.json | 29 +- packages/codemods/package.json | 7 +- .../src/builtins/add-vite-plugin.test.ts | 2 +- .../src/builtins/append-to-file.test.ts | 2 +- .../codemods/src/builtins/append-to-file.ts | 3 + packages/codemods/src/builtins/index.ts | 8 +- .../codemods/src/builtins/re-export.test.ts | 2 +- packages/codemods/src/builtins/re-export.ts | 5 +- packages/codemods/src/env.test.ts | 2 +- packages/codemods/src/imports.test.ts | 2 +- packages/codemods/src/json.test.ts | 2 +- packages/codemods/src/json.ts | 66 +- packages/create-stanza/package.json | 11 +- packages/create-stanza/tsdown.config.ts | 16 - packages/create-stanza/vite.config.ts | 18 + packages/registry/package.json | 7 +- packages/registry/src/index.ts | 4 + packages/registry/src/manifest.test.ts | 2 +- packages/registry/src/module.ts | 50 +- packages/registry/src/resolver.test.ts | 2 +- packages/registry/src/resolver.ts | 7 +- pnpm-lock.yaml | 1391 +++++++++-------- pnpm-workspace.yaml | 17 +- scripts/registry-build.ts | 3 +- turbo.json | 25 - vite.config.ts | 106 ++ 74 files changed, 1373 insertions(+), 1559 deletions(-) delete mode 100644 .oxfmtrc.json delete mode 100644 .oxlintrc.json create mode 100755 .vite-hooks/pre-commit delete mode 100644 REGISTRY.md delete mode 100644 apps/cli/tsdown.config.ts create mode 100644 apps/cli/vite.config.ts delete mode 100644 apps/cli/vitest.config.ts rename apps/web/content/docs/{cli-reference.mdx => cli.mdx} (94%) create mode 100644 apps/web/content/docs/registry.mdx delete mode 100644 apps/web/src/lib/selection.test.ts delete mode 100644 apps/web/turbo.json delete mode 100644 packages/create-stanza/tsdown.config.ts create mode 100644 packages/create-stanza/vite.config.ts delete mode 100644 turbo.json create mode 100644 vite.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 358b9fe..68d95bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,45 +17,27 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Setup pnpm - uses: pnpm/action-setup@v6 - with: - version: 10 - - - name: Setup Node.js - uses: actions/setup-node@v6 + - uses: voidzero-dev/setup-vp@v1 with: node-version: 24 - cache: pnpm + cache: true - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: 1.3.14 - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Build registry + run: vp run registry:build - name: Lint - run: pnpm lint - - - name: Format check - run: pnpm fmt:check - - - name: Build registry - run: pnpm registry:build - - - name: Build web app - run: pnpm --filter @stanza/web build - - - name: Typecheck - run: pnpm check-types + run: vp check - name: Tests - run: pnpm test + run: vp test - - name: Build CLI bundle - run: pnpm --filter stanza-cli build + - name: Build + run: vp run build - name: Smoke-test built CLI run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1e0f9a..63bb8c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,39 +24,32 @@ jobs: # Changesets needs full history to compute the changelog. fetch-depth: 0 - - name: Setup pnpm - uses: pnpm/action-setup@v6 - with: - version: 10 - - - name: Setup Node.js - uses: actions/setup-node@v6 + - uses: voidzero-dev/setup-vp@v1 with: node-version: 24 - cache: pnpm + cache: true - name: Setup Bun uses: oven-sh/setup-bun@v2 - - name: Install dependencies - run: pnpm install --frozen-lockfile - - name: Build registry - run: pnpm registry:build + run: vp run registry:build - - name: Lint + typecheck + test - run: | - pnpm lint - pnpm fmt:check - pnpm check-types - pnpm test + - name: Lint + run: vp check + + - name: Tests + run: vp test + + - name: Build + run: vp run build:cli - name: Create release PR or publish id: changesets uses: changesets/action@v1 with: - version: pnpm changeset version - publish: pnpm release + version: vp exec changeset version + publish: vp run release title: "chore: release" commit: "chore: release" env: diff --git a/.oxfmtrc.json b/.oxfmtrc.json deleted file mode 100644 index 69149df..0000000 --- a/.oxfmtrc.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "./node_modules/oxfmt/configuration_schema.json", - "sortImports": {}, - "sortTailwindcss": { - "stylesheet": "apps/web/src/styles.css", - "functions": ["clsx", "cn", "cva", "tw"], - "preserveDuplicates": false, - "preserveWhitespace": false - }, - "sortPackageJson": true, - "ignorePatterns": [ - "**/node_modules/**", - "**/dist/**", - "**/.output/**", - "**/.turbo/**", - "**/.vercel/**", - "**/routeTree.gen.ts", - "**/coverage/**", - "apps/web/public/registry/**", - "registry/modules/*/logo*.svg", - "registry/modules/*/templates/**" - ] -} diff --git a/.oxlintrc.json b/.oxlintrc.json deleted file mode 100644 index ee96bec..0000000 --- a/.oxlintrc.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "$schema": "./node_modules/oxlint/configuration_schema.json", - "plugins": ["oxc", "eslint", "typescript", "unicorn", "import", "promise", "vitest"], - "categories": { - "correctness": "error", - "suspicious": "warn", - "perf": "warn" - }, - "rules": { - "no-console": "off", - "no-empty": ["error", { "allowEmptyCatch": true }], - "no-await-in-loop": "off", - "unicorn/no-null": "off", - "unicorn/filename-case": "off", - "unicorn/no-array-reduce": "off" - }, - "ignorePatterns": [ - "**/node_modules/**", - "**/dist/**", - "**/.output/**", - "**/.turbo/**", - "**/.vercel/**", - "**/*.gen.ts", - "**/coverage/**", - "registry/modules/*/templates/**" - ], - "overrides": [ - { - "files": ["**/*.test.ts", "**/*.test.tsx", "**/tests/**"], - "rules": { - "typescript/no-explicit-any": "off" - } - }, - { - "files": ["apps/web/**/*.tsx"], - "plugins": [ - "oxc", - "eslint", - "typescript", - "react", - "react-perf", - "promise", - "jsx-a11y", - "unicorn", - "import", - "vitest" - ], - "rules": { - "react/react-in-jsx-scope": "off" - } - } - ] -} diff --git a/.vite-hooks/pre-commit b/.vite-hooks/pre-commit new file mode 100755 index 0000000..85fb65b --- /dev/null +++ b/.vite-hooks/pre-commit @@ -0,0 +1 @@ +vp staged diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 5266426..46cef3b 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,3 @@ { - "recommendations": [ - "bradlc.vscode-tailwindcss", - "oxc.oxc-vscode", - "vercel.turbo-vsc", - "vitest.explorer" - ] + "recommendations": ["VoidZero.vite-plus-extension-pack"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index a5ac042..2eb24ce 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -35,5 +35,6 @@ }, "[css]": { "editor.defaultFormatter": "oxc.oxc-vscode" - } + }, + "oxc.fmt.configPath": "./vite.config.ts" } diff --git a/AGENTS.md b/AGENTS.md index a06daa9..d24c6c6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # Stanza -Shadcn-style CLI for assembling modular full-stack TS monorepos. Currently ships `init`, `add`, `remove`, `list`, `search` against these **categories**: `framework`, `styling`, `db`, `orm`, `auth`, `tooling`, `testing`. `swap` + `update` verbs and more categories (api, ai, ui, payments, deploy, email, monorepo) are planned — the manifest already reserves the fields they'll need (`modules[category][].version`, `regions`). See [REGISTRY.md](REGISTRY.md) for the module roadmap and [TODO.md](TODO.md) for active work. +Shadcn-style CLI for assembling modular full-stack TS monorepos. Currently ships `init`, `add`, `remove`, `list`, `search` against these **categories**: `framework`, `styling`, `db`, `orm`, `auth`, `tooling`, `testing`. `swap` + `update` verbs and more categories (api, ai, ui, payments, deploy, email, monorepo) are planned — the manifest already reserves the fields they'll need (`modules[category][].version`, `regions`). See the [module registry](apps/web/content/docs/registry.mdx) for the module roadmap and [TODO.md](TODO.md) for active work. Three things differentiate stanza from other scaffolders: @@ -10,7 +10,7 @@ Three things differentiate stanza from other scaffolders: ## Layout -- `apps/cli/` — `stanza-cli`, node entrypoint at `src/bin.ts` (run via tsx in dev, tsdown-built to `dist/bin.mjs` for publish) +- `apps/cli/` — `stanza-cli`, node entrypoint at `src/bin.ts` (run via tsx in dev, built to `dist/bin.mjs` for publish via `vp pack`) - `apps/web/` — `@stanza/web`, TanStack Start visual builder (Vite-native, no Vinxi) - `packages/registry/` — shared schema, category/peer resolver, Zod manifest validator - `packages/codemods/` — ts-morph helpers (idempotent + reversible) @@ -20,19 +20,18 @@ Three things differentiate stanza from other scaffolders: In a **generated project**, a module's output lands per its category's `home` (in the canonical [`CATEGORIES`](packages/registry/src/module.ts) array): `auth`/`db`/`orm` (`home: package`) install into an internal workspace package at `packages//` (named `@/`, consumed via `workspace:*`; `db` + `orm` share `packages/db/`); `framework`/`styling`/`testing` (`home: app`) wire the app shell; `tooling` (`home: repo`) writes config at the repo root + scripts in the root `package.json`. `categoryHome(id)`, `PACKAGE_DIRS`, and `categoryLabel(id)` are all derived from the array. -## Commands +The repo runs on the **Vite+ toolchain** (`vp`) — one CLI for dev/build/test/lint/fmt/check/pack, all configured by the root [`vite.config.ts`](vite.config.ts) (`test`/`lint`/`fmt`/`staged` blocks). There is **no** `turbo.json`, `.oxlintrc.json`, `.oxfmtrc.json`, or per-package `vitest.config.ts` — that config now lives in `vite.config.ts`. `vp run