diff --git a/.github/workflows/changeset-check.yml b/.github/workflows/changeset-check.yml deleted file mode 100644 index cfc208b..0000000 --- a/.github/workflows/changeset-check.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Changeset Check - -on: - pull_request: - branches: - - master - - main - -jobs: - changeset-check: - name: Check for changesets - runs-on: ubuntu-latest - # Skip for changesets version PRs - if: ${{ github.head_ref != 'changeset-release/master' && github.head_ref != 'changeset-release/main' }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Check if package changes require changeset - run: | - # Get list of changed files - CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) - - # Check if any package files were changed - PACKAGE_CHANGES=$(echo "$CHANGED_FILES" | grep -E "^packages/" || true) - - if [ -z "$PACKAGE_CHANGES" ]; then - echo "โœ… No package changes detected, changeset not required" - exit 0 - fi - - echo "๐Ÿ“ฆ Package changes detected:" - echo "$PACKAGE_CHANGES" - echo "" - - # Check if there are any changeset files (excluding README) - CHANGESETS=$(find .changeset -name "*.md" ! -name "README.md" 2>/dev/null | wc -l) - - if [ "$CHANGESETS" -eq 0 ]; then - echo "" - echo "::error::Package changes detected but no changeset found!" - echo "" - echo "Please run 'pnpm changeset' to create one, then commit the file." - echo "" - echo "If this change doesn't need a release, create an empty changeset:" - echo " pnpm changeset --empty" - exit 1 - fi - - echo "" - echo "โœ… Found $CHANGESETS changeset(s) for package changes" diff --git a/.github/workflows/template-sync-check.yml b/.github/workflows/template-sync-check.yml deleted file mode 100644 index 0cbafef..0000000 --- a/.github/workflows/template-sync-check.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Template Sync Check - -on: - pull_request: - branches: [master, main, develop] - push: - branches: [master, main, develop] - -jobs: - check-sync: - name: Verify Template is Synced - runs-on: ubuntu-24.04 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - - - name: Run sync script - run: ./scripts/sync-template.sh - - - name: Check for differences - run: | - if [ -n "$(git status --porcelain packages/bhono-app/templates/)" ]; then - echo "::error::Template is out of sync with boilerplate!" - echo "" - echo "The following files differ:" - git status --porcelain packages/bhono-app/templates/ - echo "" - echo "Run 'pnpm sync:template' locally and commit the changes." - exit 1 - else - echo "Template is in sync with boilerplate." - fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 2594fc1..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: CI - -# Quality gates for the @etus/bhono CLI โ€” the only deliverable shipped from -# this monorepo. The boilerplate code under src/ is template material that -# gets scaffolded into new projects; its quality is enforced locally via the -# pre-push hook (typecheck + tests) where the developer's own ~/.npmrc has -# @etus scope access. CI installs only the CLI workspace via filter, but -# pnpm still resolves the full lockfile โ€” so NPM_TOKEN with @etus read -# scope is needed on every cache-missing run (lockfile changes invalidate -# the pnpm store cache between runs). - -on: - push: - branches: [main, master, develop] - pull_request: - branches: [main, master, develop] - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - CI: true - NODE_VERSION: '20' - PNPM_VERSION: '10.15.1' - -jobs: - cli: - name: Code Quality (CLI) - runs-on: ubuntu-24.04 - timeout-minutes: 10 - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: ${{ env.PNPM_VERSION }} - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - registry-url: 'https://registry.npmjs.org/' - - - name: Install CLI dependencies only - # --filter '@etus/bhono...' restricts what ends up in node_modules, - # but pnpm still resolves the full lockfile โ€” so the @etus/* tarball - # auth check still runs and needs NPM_TOKEN with @etus read scope. - run: pnpm install --frozen-lockfile --filter '@etus/bhono...' - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Test CLI - run: pnpm -C packages/bhono-app test:run - - - name: Build CLI - run: pnpm -C packages/bhono-app build diff --git a/.gitignore b/.gitignore index 33c42ff..4771656 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,11 @@ tests/e2e/.auth/ coverage/ playwright-report/ test-results/ +tests/**/__screenshots__/ +tests/e2e/blob-results/ +*.webm +*.zip +.nyc_output/ # Local Linear configuration .claude/linear-config.json diff --git a/.husky/pre-push b/.husky/pre-push index 5c69db8..c919b06 100644 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,26 +1,31 @@ #!/usr/bin/env sh -echo "๐Ÿ” Running pre-push checks..." +# Coverage gates are enforced by vitest via the test scripts below: +# server: vitest.config.ts (statements 85 / branches 80 / functions 85 / lines 85) +# client: vitest.config.frontend.ts (statements 65 / branches 70 / functions 58 / lines 67) +# If coverage drops below threshold, the test command exits non-zero and the push aborts. -# Type checking -echo "๐Ÿ“ Type checking..." -pnpm typecheck || { - echo "โŒ Type check failed. Push aborted." - exit 1 -} +echo "๐Ÿ” Running pre-push checks..." -# Server unit tests only (faster, more reliable) -echo "๐Ÿงช Running server unit tests..." -pnpm test:unit:server || { - echo "โŒ Server unit tests failed. Push aborted." - exit 1 +run() { + name="$1" + shift + echo "" + echo "$name" + "$@" || { + echo "โŒ $name failed. Push aborted." + exit 1 + } } -# Build verification -echo "๐Ÿ—๏ธ Verifying build..." -pnpm build || { - echo "โŒ Build failed. Push aborted." - exit 1 -} +run "๐Ÿ“ Type checking" pnpm typecheck +run "๐Ÿงน Linting" pnpm lint +run "๐Ÿงช Server tests + coverage gate" pnpm test:unit:server +run "๐Ÿงช Client tests + coverage gate" pnpm test:unit:client +run "๐Ÿ—๏ธ App build" pnpm build +run "๐Ÿ” Template sync check" pnpm sync:template:check +run "๐Ÿงช CLI tests" pnpm -C packages/bhono-app test:run +run "๐Ÿ—๏ธ CLI build" pnpm -C packages/bhono-app build +echo "" echo "โœ… All pre-push checks passed!" diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..9a5e138 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +@etus:registry=https://registry.npmjs.org/ +//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} diff --git a/packages/bhono-app/templates/base/.claude/commands/linear/implement-issue.md b/packages/bhono-app/templates/base/.claude/commands/linear/implement-issue.md index a8cb18b..a7528cb 100644 --- a/packages/bhono-app/templates/base/.claude/commands/linear/implement-issue.md +++ b/packages/bhono-app/templates/base/.claude/commands/linear/implement-issue.md @@ -192,7 +192,7 @@ Fix any issues before proceeding. |---------------|-------------------|--------| | `packages/bhono-app/src/*` | **YES** | CLI code published to npm | | `packages/bhono-app/templates/*` | **YES** | Templates shipped to users | -| `packages/create-bhono-app/*` | **YES** | Published to npm | +| `packages/create-bhono/*` | **YES** | Published to npm | | `src/*` (app code) | **NO** | Not published, internal app | | `tests/*` | **NO** | Test-only changes | | `config/*`, `.github/*` | **NO** | Build/CI infrastructure | diff --git a/packages/bhono-app/templates/base/.npmrc b/packages/bhono-app/templates/base/.npmrc new file mode 100644 index 0000000..9a5e138 --- /dev/null +++ b/packages/bhono-app/templates/base/.npmrc @@ -0,0 +1,2 @@ +@etus:registry=https://registry.npmjs.org/ +//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} diff --git a/packages/bhono-app/templates/base/_gitignore b/packages/bhono-app/templates/base/_gitignore index 33c42ff..4771656 100644 --- a/packages/bhono-app/templates/base/_gitignore +++ b/packages/bhono-app/templates/base/_gitignore @@ -15,6 +15,11 @@ tests/e2e/.auth/ coverage/ playwright-report/ test-results/ +tests/**/__screenshots__/ +tests/e2e/blob-results/ +*.webm +*.zip +.nyc_output/ # Local Linear configuration .claude/linear-config.json