From 8e1a79a9de0dcd6d9a23f2b4e5070660b9bdf0ae Mon Sep 17 00:00:00 2001 From: sriramveeraghanta Date: Thu, 16 Jul 2026 22:08:52 +0530 Subject: [PATCH 1/4] chore: migrate toolchain from Vite+ (vp) to Turborepo + standalone tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unbundle the Vite+ (vp) toolchain into standalone tools orchestrated by Turborepo, preserving every capability and rule: - Orchestration: Vite Task -> Turborepo (turbo.json; `^build` orders @makeplane/propel's dist before propel-docs / storybook). - Library builds: `vp pack` -> tsdown (per-package tsdown.config.ts); attw + publint preserved. - Tests: `vp test` -> standalone Vitest (vitest.config.ts, @vitest/browser-playwright). - Lint/format: `vp check` -> standalone Oxlint (.oxlintrc.json — custom JS plugin + type-aware via oxlint-tsgolint) and Oxfmt (.oxfmtrc.json, pinned). - Package manager/runtime: `vp install` / `vp config` -> pnpm + corepack. - Pre-commit: vp `staged` -> simple-git-hooks + lint-staged (oxfmt). - Vite: the @voidzero-dev/vite-plus-core fork -> upstream vite@^8 (astro 7 needs it). - CI: setup-vp -> pnpm/action-setup + actions/setup-node; vp commands -> turbo/pnpm. Verified green: build (propel 2482 files, docs, plugin), typecheck, test (793 + 12), build-storybook (no vite-plus needed), lint (custom rule + type-aware fire), format; Turbo caching (FULL TURBO) confirmed. Claude-Session: https://claude.ai/code/session_01LjeZkZxitGSSzespQabk6E --- .github/workflows/ci.yml | 59 +- .github/workflows/release.yml | 18 +- .github/workflows/storybook.yml | 41 +- .gitignore | 3 + .oxfmtrc.json | 10 + .oxlintrc.json | 21 + .vite-hooks/pre-commit | 1 - AGENTS.md | 26 +- README.md | 40 +- apps/propel-docs/README.md | 22 +- apps/propel-docs/astro.config.mjs | 2 +- apps/propel-docs/package.json | 4 +- package.json | 27 +- packages/propel/AGENTS.md | 2 +- packages/propel/README.md | 14 +- packages/propel/package.json | 12 +- packages/propel/tsconfig.json | 2 +- packages/propel/tsdown.config.ts | 59 + packages/propel/vite.config.ts | 151 -- packages/propel/vitest.config.ts | 56 + packages/propel/vitest.shims.d.ts | 2 +- pnpm-lock.yaml | 1907 ++++++++++++++--- pnpm-workspace.yaml | 39 +- tools/oxlint-plugin-propel/README.md | 18 +- tools/oxlint-plugin-propel/package.json | 8 +- .../oxlint-plugin-propel/tests/index.test.ts | 2 +- tools/oxlint-plugin-propel/tsdown.config.ts | 9 + tools/oxlint-plugin-propel/vite.config.ts | 44 - turbo.json | 24 + vite.config.ts | 74 - 30 files changed, 1998 insertions(+), 699 deletions(-) create mode 100644 .oxfmtrc.json create mode 100644 .oxlintrc.json delete mode 100755 .vite-hooks/pre-commit create mode 100644 packages/propel/tsdown.config.ts delete mode 100644 packages/propel/vite.config.ts create mode 100644 packages/propel/vitest.config.ts create mode 100644 tools/oxlint-plugin-propel/tsdown.config.ts delete mode 100644 tools/oxlint-plugin-propel/vite.config.ts create mode 100644 turbo.json delete mode 100644 vite.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4684bb7d..6b5a1689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [main] +env: + TURBO_TELEMETRY_DISABLED: 1 + jobs: check: name: Check & Test & Build @@ -13,42 +16,32 @@ jobs: steps: - uses: actions/checkout@v6 - # setup-vp installs the Vite+ CLI, Node, the package manager, and caches - # the dep store. Run install explicitly before restoring the Vite Task - # cache, matching https://viteplus.dev/guide/github-actions-cache. - - uses: voidzero-dev/setup-vp@v1 + # pnpm (version pinned by package.json's `packageManager`) + Node, with the + # pnpm content store cached by setup-node. + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: node-version-file: .node-version - cache: true - run-install: false + cache: pnpm - - run: vp install + - run: pnpm install --frozen-lockfile - - name: Restore Vite Task cache - id: vite-task-cache - uses: actions/cache/restore@v6 + # Turborepo local cache: build/typecheck/test outputs are content-hashed and + # restored across runs (keyed by commit, falling back to the latest prior run). + - name: Restore Turbo cache + uses: actions/cache@v6 with: - path: node_modules/.vite/task-cache - key: vite-task-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + path: .turbo + key: turbo-${{ runner.os }}-${{ github.sha }} restore-keys: | - vite-task-${{ runner.os }}-${{ runner.arch }}- - - # apps/propel-docs type-checks its demos against @makeplane/propel's built - # dist (its published `exports`), and dist is gitignored — so pack propel - # before the workspace check, or those imports can't resolve (TS2307). - - run: vp run @makeplane/propel#build - - - run: vp run -w check - # Storybook stories run as browser tests (Vitest + Playwright), so CI needs - # the Chromium binary + its system deps. `pnpm` isn't on PATH under - # setup-vp, so run the package binary via `vp exec` (see viteplus.dev/guide/ci). - - run: vp exec --filter @makeplane/propel playwright install --with-deps chromium - - run: vp run -r test - - run: vp run -r build - - - name: Save Vite Task cache - if: success() - uses: actions/cache/save@v6 - with: - path: node_modules/.vite/task-cache - key: ${{ steps.vite-task-cache.outputs.cache-primary-key }} + turbo-${{ runner.os }}- + + - run: pnpm run lint + - run: pnpm run format:check + # `^build` builds @makeplane/propel's dist before propel-docs' typecheck/build. + - run: pnpm exec turbo run build typecheck + # Storybook stories run as browser tests (Vitest + Playwright), so CI needs the + # Chromium binary + its system deps. Run tests in a separate step (after build) so + # the headless browser doesn't contend with the CPU-heavy library builds. + - run: pnpm --filter @makeplane/propel exec playwright install --with-deps chromium + - run: pnpm exec turbo run test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af953c5d..348d46ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,9 @@ on: push: branches: [main] +env: + TURBO_TELEMETRY_DISABLED: 1 + jobs: release: name: Release @@ -15,23 +18,24 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: voidzero-dev/setup-vp@v1 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: node-version-file: .node-version - cache: true + cache: pnpm + + - run: pnpm install --frozen-lockfile - name: Build packages - run: vp run -r build + run: pnpm exec turbo run build # Opens/updates a "Version Packages" PR when changesets are present, and # publishes to npm when that PR is merged (i.e. when no changesets remain). - name: Create release PR or publish uses: changesets/action@v1 with: - # changesets/action@v1 splits these strings on whitespace before exec, - # so keep each command to a single Vite+ binary invocation. - version: vp exec -w changeset version - publish: vp exec -w changeset publish + version: pnpm exec changeset version + publish: pnpm exec changeset publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_CONFIG_PROVENANCE: "true" diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index a8a9b901..7c00730e 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -8,6 +8,9 @@ on: pull_request: workflow_dispatch: # manual redeploy (e.g. to restore production) +env: + TURBO_TELEMETRY_DISABLED: 1 + jobs: deploy: name: Build & deploy Storybook @@ -21,31 +24,23 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: voidzero-dev/setup-vp@v1 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: node-version-file: .node-version - cache: true - run-install: false + cache: pnpm - - run: vp install + - run: pnpm install --frozen-lockfile - - name: Restore Vite Task cache - id: vite-task-cache - uses: actions/cache/restore@v6 + - name: Restore Turbo cache + uses: actions/cache@v6 with: - path: node_modules/.vite/task-cache - key: vite-task-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + path: .turbo + key: turbo-storybook-${{ runner.os }}-${{ github.sha }} restore-keys: | - vite-task-${{ runner.os }}-${{ runner.arch }}- - - - run: vp run -r build-storybook + turbo-storybook-${{ runner.os }}- - - name: Save Vite Task cache - if: success() - uses: actions/cache/save@v6 - with: - path: node_modules/.vite/task-cache - key: ${{ steps.vite-task-cache.outputs.cache-primary-key }} + - run: pnpm exec turbo run build-storybook # PR → a versioned upload aliased to the PR number, which yields a stable # preview URL (pr--propel-storybook..workers.dev) without @@ -58,11 +53,11 @@ jobs: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} workingDirectory: packages/propel - # Run our lockfile wrangler (a @makeplane/propel devDep), not the action's - # own. `packageManager: npm` makes the action invoke `npx wrangler …`, - # and under setup-vp `npx` is a symlink to `vp` — so it runs the - # installed wrangler. Omitting `wranglerVersion` skips the action's - # install (and the npx fetch that flaked on @cloudflare/workerd-*). + # Run our lockfile wrangler (a @makeplane/propel devDep) via `npx wrangler`, + # not the action's own. `packageManager: npm` makes the action invoke + # `npx wrangler …`, which resolves the wrangler in packages/propel/node_modules/.bin. + # Omitting `wranglerVersion` skips the action's install (and the fetch that + # flaked on @cloudflare/workerd-*). packageManager: npm command: >- ${{ github.event_name == 'pull_request' diff --git a/.gitignore b/.gitignore index 64d46c8d..d5f41daa 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,9 @@ storybook-static # Astro build cache .astro +# Turborepo cache +.turbo + # Test coverage coverage diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 00000000..5e33a88e --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,10 @@ +{ + "ignorePatterns": ["**/dist/**", "**/.claude/**", "**/.agents/**"], + "sortTailwindcss": { + "functions": ["cva", "cx"], + "stylesheet": "packages/propel/tailwind.css" + }, + "sortImports": true, + "sortPackageJson": true, + "jsdoc": true +} diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 00000000..269e4e71 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,21 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "jsPlugins": ["./tools/oxlint-plugin-propel/src/index.ts"], + "ignorePatterns": [ + "**/.claude/**", + "**/.agents/**", + "**/.storybook/**", + "**/storybook-static/**", + "**/vite.config.ts", + "**/vitest.config.ts", + "**/tsdown.config.ts" + ], + "options": { + "typeAware": true, + "typeCheck": true + }, + "rules": { + "propel/prefer-tailwind-v4-shorthand": "error", + "typescript/consistent-type-definitions": ["error", "type"] + } +} diff --git a/.vite-hooks/pre-commit b/.vite-hooks/pre-commit deleted file mode 100755 index 85fb65b4..00000000 --- a/.vite-hooks/pre-commit +++ /dev/null @@ -1 +0,0 @@ -vp staged diff --git a/AGENTS.md b/AGENTS.md index 362b82a4..da09f000 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,16 +1,18 @@ - +# Toolchain: pnpm + Turborepo -# 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, and it invokes Vite through `vp dev` and `vp build`. Run `vp help` to print a list of commands and `vp --help` for information about a specific command. - -Docs are local at `node_modules/vite-plus/docs` or online at https://viteplus.dev/guide/. +This monorepo uses [pnpm](https://pnpm.io) (workspaces + catalog) for package +management and [Turborepo](https://turborepo.com) to orchestrate tasks. The +underlying tools run standalone: [tsdown](https://tsdown.dev) for library builds, +[Vitest](https://vitest.dev) for tests, and [Oxlint](https://oxc.rs) + [Oxfmt](https://oxc.rs) +for linting and formatting. Config lives in `turbo.json`, `.oxlintrc.json`, +`.oxfmtrc.json`, and per-package `tsdown.config.ts` / `vitest.config.ts`. ## Review Checklist -- [ ] Run `vp install` after pulling remote changes and before getting started. -- [ ] Run `vp check` and `vp test` to format, lint, type check and test changes. -- [ ] Check if there are `vite.config.ts` tasks or `package.json` scripts necessary for validation, run via `vp run