Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 28 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,44 @@ on:
pull_request:
branches: [main]

env:
TURBO_TELEMETRY_DISABLED: 1

jobs:
check:
name: Check & Test & Build
runs-on: ubuntu-latest
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 }}-

# Format + lint + type-check (turbo `check` = check:format + check:lint +
# check:types). check:lint/check:types build each package's workspace
# dependencies first via `^build` (e.g. docs type-checks against
# @makeplane/propel's built dist), so no separate pre-build step is needed.
- run: pnpm check

# Storybook stories run as browser tests (Vitest + Playwright). The propel
# package's `pretest` hook installs the Chromium binary + system deps
# (`playwright install --with-deps chromium` when CI=true) before the run.
- run: pnpm test
- run: pnpm build
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches: [main]

env:
TURBO_TELEMETRY_DISABLED: 1

jobs:
release:
name: Release
Expand All @@ -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"
41 changes: 18 additions & 23 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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-<n>-propel-storybook.<subdomain>.workers.dev) without
Expand All @@ -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'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ storybook-static
# Astro build cache
.astro

# Turborepo cache
.turbo

# Test coverage
coverage

Expand Down
10 changes: 10 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ignorePatterns": ["**/dist/**", "**/.claude/**", "**/.agents/**"],
"sortTailwindcss": {
"functions": ["cva", "cx"],
"stylesheet": "packages/propel/tailwind.css"
},
"sortImports": true,
"sortPackageJson": true,
"jsdoc": true
}
17 changes: 17 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"jsPlugins": ["./tools/oxlint-plugin-propel/src/index.ts"],
"ignorePatterns": [
"**/dist/**",
"**/.claude/**",
"**/.agents/**",
"**/.storybook/**",
"**/storybook-static/**",
Comment thread
sriramveeraghanta marked this conversation as resolved.
"**/vitest.config.ts",
"**/tsdown.config.ts"
],
"rules": {
"propel/prefer-tailwind-v4-shorthand": "error",
"typescript/consistent-type-definitions": ["error", "type"]
}
}
1 change: 0 additions & 1 deletion .vite-hooks/pre-commit

This file was deleted.

26 changes: 14 additions & 12 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<!--VITE PLUS START-->
# 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 <command> --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 <script>`.
- [ ] If setup, runtime, or package-manager behavior looks wrong, run `vp env doctor` and include its output when asking for help.

<!--VITE PLUS END-->
- [ ] Run `pnpm install` after pulling remote changes and before getting started.
- [ ] Run `pnpm check` (check:format + check:lint + check:types) and `pnpm test`
before pushing. Use `pnpm fix` to auto-fix formatting + lint.
- [ ] Scripts follow a `check:*` / `fix:*` convention (`check:lint`, `check:format`,
`check:types`; `fix:lint`, `fix:format`), each a Turbo task defined in `turbo.json`
and per-package `package.json`. Run one package with
`pnpm exec turbo run <task> --filter=<package>`.
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# propel

A [Vite+](https://viteplus.dev) monorepo.
A [Turborepo](https://turborepo.com) + [pnpm](https://pnpm.io) monorepo.

## Docs

Expand All @@ -14,34 +14,35 @@ A [Vite+](https://viteplus.dev) monorepo.

## Prerequisites

Install the `vp` CLI globally:

```bash
# macOS / Linux
curl -fsSL https://vite.plus | bash

# Windows (PowerShell)
irm https://vite.plus/ps1 | iex
```
- [Node](https://nodejs.org) — the version in [`.node-version`](./.node-version).
- [pnpm](https://pnpm.io) — the version is pinned by `packageManager` in
`package.json`; enable it with `corepack enable`.

## Workspace layout

```
propel/
├── apps/ # applications (scaffold with `vp create vite:application`)
├── packages/ # shared libraries (scaffold with `vp create vite:library`)
└── tools/ # generators (scaffold with `vp create vite:generator`)
├── apps/ # applications (e.g. docs, the Astro docs site)
├── packages/ # shared libraries (e.g. @makeplane/propel)
└── tools/ # internal tooling (e.g. the Oxlint plugin)
```

## Common commands

```bash
vp install # install dependencies
vp dev # run dev servers
vp check # format + lint + type-check
vp test # run tests via Vitest
vp build # production build via Rolldown
vp run -r <task> # run task across all workspace packages
pnpm install # install dependencies
pnpm dev # run dev servers (turbo run dev)
pnpm build # build all packages (turbo run build)
pnpm test # run tests (turbo run test)
pnpm check # check:format + check:lint + check:types
pnpm check:lint # lint with Oxlint
pnpm check:format # verify formatting with Oxfmt
pnpm check:types # type-check
pnpm fix # auto-fix: fix:format + fix:lint
```

Run `vp help` for the full command list.
Tasks are orchestrated by [Turborepo](https://turborepo.com) (`turbo.json`). The
underlying tools are [tsdown](https://tsdown.dev) (library builds),
[Vitest](https://vitest.dev) (tests), and [Oxlint](https://oxc.rs) /
[Oxfmt](https://oxc.rs) (lint / format). Run a single package's task with
`pnpm exec turbo run <task> --filter=<package>`.
28 changes: 14 additions & 14 deletions apps/propel-docs/README.md → apps/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @makeplane/propel-docs
# docs

The documentation site for `@makeplane/propel`'s components. Built with Astro 7,
React islands (via `@astrojs/react`), and MDX for the component pages, styled
Expand All @@ -8,28 +8,28 @@ with propel's own Tailwind v4 tokens (`@makeplane/propel/styles`).

Run these from the repo root:

- `pnpm --filter @makeplane/propel-docs dev` — starts the dev server. In dev
- `pnpm --filter docs dev` — starts the dev server. In dev
mode, `astro.config.mjs` aliases `@makeplane/propel/components/*` and
`@makeplane/propel/styles` directly to propel's `src`, so editing a propel
component hot-reloads this site instantly — no propel build needed.
- `pnpm --filter @makeplane/propel-docs build` — production build. This first
runs `vp pack` on `@makeplane/propel` (to produce its `dist`), then runs
`astro build`, so the site resolves propel through its real, published
`dist` exports — the same way a consumer of the package would.
- `pnpm --filter @makeplane/propel-docs typecheck` — runs `astro check` (this
also packs propel first, for the same reason as `build`).
- `pnpm --filter @makeplane/propel-docs preview` — serves the built `dist`
- `pnpm exec turbo run build --filter docs` — production build.
Turbo's `^build` builds `@makeplane/propel`'s `dist` first, then this app runs
`astro build`, so the site resolves propel through its real, published `dist`
exports — the same way a consumer of the package would.
- `pnpm exec turbo run check:types --filter docs` — runs
`astro check` (Turbo builds propel first, same as `build`).
- `pnpm --filter docs preview` — serves the built `dist`
output locally for a final check before deploying.

## IMPORTANT: the deploy seam

The production build resolves `@makeplane/propel` through its built `dist`,
and `packages/propel/dist` is gitignored — it is not committed. Any CI or
Cloudflare build **must build propel before the site**. Use this package's
`build` script (`pnpm --filter @makeplane/propel-docs build`, which packs
propel first) rather than invoking `astro build` directly. A bare
`astro build` on a fresh checkout will fail to resolve
`@makeplane/propel/components/*`, since no `dist` exists yet.
Cloudflare build **must build propel before the site**. Running the build through
Turbo (`turbo run build`) handles this: the `^build` dependency in `turbo.json`
builds propel's `dist` before this app's `astro build`. A bare `astro build` on a
fresh checkout will fail to resolve `@makeplane/propel/components/*`, since no
`dist` exists yet.

## Deployment placeholders

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import { defineConfig } from "astro/config";
const __dirname = fileURLToPath(new URL(".", import.meta.url));

// Dev-mode alias to propel's real source, so editing a component hot-reloads
// this docs site without needing `vp pack --watch` running in parallel.
// this docs site without needing a propel watch build (`tsdown --watch`) in parallel.
// Production builds resolve `@makeplane/propel` through its normal workspace
// package + dist exports instead (no alias).
const isDev = process.argv.includes("dev");
const propelSrc = resolve(__dirname, "../../packages/propel/src");

export default defineConfig({
// TODO: replace with the real deployed domain once one is assigned.
site: "https://propel-docs.example.com",
site: "https://docs.example.com",
integrations: [mdx(), react(), sitemap()],
vite: {
plugins: [tailwindcss()],
Expand Down
Loading
Loading