diff --git a/.github/assets/theme-dark.webp b/.github/assets/theme-dark.webp new file mode 100644 index 000000000..ae7a55cb4 Binary files /dev/null and b/.github/assets/theme-dark.webp differ diff --git a/.github/assets/theme-light.webp b/.github/assets/theme-light.webp new file mode 100644 index 000000000..a4e46f12a Binary files /dev/null and b/.github/assets/theme-light.webp differ diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 000000000..bdcef788f --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,48 @@ +name: Deploy docs + +on: + push: + branches: [shadcn-theme] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: 24 + cache: yarn + - uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 + - run: yarn install --frozen-lockfile --ignore-scripts + - run: yarn workspace @aeei/docusaurus-theme build + - run: yarn workspace @aeei/docs-starter build + env: + ALGOLIA_APP_ID: ${{ vars.ALGOLIA_APP_ID }} + ALGOLIA_SEARCH_API_KEY: ${{ vars.ALGOLIA_SEARCH_API_KEY }} + ALGOLIA_INDEX_NAME: ${{ vars.ALGOLIA_INDEX_NAME }} + - uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + with: + path: examples/docs-starter/build + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 diff --git a/.github/workflows/theme-ci.yml b/.github/workflows/theme-ci.yml new file mode 100644 index 000000000..80c092436 --- /dev/null +++ b/.github/workflows/theme-ci.yml @@ -0,0 +1,54 @@ +name: Theme CI + +on: + pull_request: + push: + branches: [shadcn-theme] + +permissions: + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: 24 + cache: yarn + - run: yarn install --frozen-lockfile --ignore-scripts + - run: yarn workspace @aeei/docusaurus-theme build + - name: Theme contracts + run: >- + NODE_OPTIONS=--experimental-vm-modules yarn jest + packages/docusaurus-theme/src/package-contract.test.ts + packages/docusaurus-theme/src/theme/base-ui-contract.test.ts + packages/docusaurus-theme/src/theme/icon-contract.test.ts + packages/docusaurus-theme/src/theme/navbar-shell-contract.test.ts + packages/docusaurus-theme/src/theme/paginator-contract.test.ts + packages/docusaurus-theme/src/theme/prose-contract.test.ts + packages/docusaurus-theme/src/theme/registry-source-contract.test.ts + packages/docusaurus-theme/src/theme/sidebar-contract.test.ts + packages/docusaurus-theme/src/theme/style-contract.test.ts + examples/docs-starter/config-contract.test.ts + --runInBand + - run: yarn workspace @aeei/docs-starter build + - name: Package contents + working-directory: packages/docusaurus-theme + run: npm pack --dry-run + - run: npx playwright install --with-deps chromium + - name: Browser matrix + run: >- + yarn start-server-and-test + "yarn workspace @aeei/docs-starter serve --port 3001 --no-open" + http://127.0.0.1:3001/docusaurus-theme/ + "node scripts/audit-docs-starter.cjs && node scripts/audit-critical-ui-relations.cjs && PLAYWRIGHT_BASE_URL=http://127.0.0.1:3001/docusaurus-theme/ yarn test:e2e:theme" + - name: Upload browser failures + if: failure() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: docs-starter-browser-failures + path: artifacts/docs-starter + if-no-files-found: ignore diff --git a/.gitignore b/.gitignore index dbe1d8d34..b35eb37f2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ build dist lib lib-next +lib-theme # Dependencies /node_modules @@ -147,3 +148,8 @@ demo/**/*.json # Playwright visual_diffs/ +test-results/ +artifacts/ + +# Local pi session state +.pi/goals/ diff --git a/.pi/prompts/opsx-apply.md b/.pi/prompts/opsx-apply.md new file mode 100644 index 000000000..11502a191 --- /dev/null +++ b/.pi/prompts/opsx-apply.md @@ -0,0 +1,156 @@ +--- +description: Implement tasks from an OpenSpec change (Experimental) +--- + +Implement tasks from an OpenSpec change. + +**Input**: Optionally specify a change name (e.g., `/opsx-apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. +**Provided arguments**: $@ + +**Steps** + +1. **Select the change** + + If a name is provided, use it. Otherwise: + - Infer from conversation context if the user mentioned a change + - Auto-select if only one active change exists + - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select + + Always announce: "Using change: " and how to override (e.g., `/opsx-apply `). + +2. **Check status to understand the schema** + + ```bash + openspec status --change "" --json + ``` + + Parse the JSON to understand: + - `schemaName`: The workflow being used (e.g., "spec-driven") + - `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints + - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others) + +3. **Get apply instructions** + + ```bash + openspec instructions apply --change "" --json + ``` + + This returns: + - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema) + - Progress (total, complete, remaining) + - Task list with status + - Dynamic instruction based on current state + + **Handle states:** + - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx-continue` + - If `state: "all_done"`: congratulate, suggest archive + - Otherwise: proceed to implementation + + **Workspace guard:** If status JSON reports `actionContext.mode: "workspace-planning"` and `allowedEditRoots` is empty, explain that full workspace apply is not supported in this slice. Treat linked repos and folders as read-only context, ask the user to select an affected area through an explicit implementation workflow, and STOP before editing files. + +4. **Read context files** + + Read every file path listed under `contextFiles` from the apply instructions output. + The files depend on the schema being used: + - **spec-driven**: proposal, specs, design, tasks + - Other schemas: follow the contextFiles from CLI output + +5. **Show current progress** + + Display: + - Schema being used + - Progress: "N/M tasks complete" + - Remaining tasks overview + - Dynamic instruction from CLI + +6. **Implement tasks (loop until done or blocked)** + + For each pending task: + - Show which task is being worked on + - Make the code changes required + - Keep changes minimal and focused + - Mark task complete in the tasks file: `- [ ]` → `- [x]` + - Continue to next task + + **Pause if:** + - Task is unclear → ask for clarification + - Implementation reveals a design issue → suggest updating artifacts + - Error or blocker encountered → report and wait for guidance + - User interrupts + +7. **On completion or pause, show status** + + Display: + - Tasks completed this session + - Overall progress: "N/M tasks complete" + - If all done: suggest archive + - If paused: explain why and wait for guidance + +**Output During Implementation** + +``` +## Implementing: (schema: ) + +Working on task 3/7: +[...implementation happening...] +✓ Task complete + +Working on task 4/7: +[...implementation happening...] +✓ Task complete +``` + +**Output On Completion** + +``` +## Implementation Complete + +**Change:** +**Schema:** +**Progress:** 7/7 tasks complete ✓ + +### Completed This Session +- [x] Task 1 +- [x] Task 2 +... + +All tasks complete! You can archive this change with `/opsx-archive`. +``` + +**Output On Pause (Issue Encountered)** + +``` +## Implementation Paused + +**Change:** +**Schema:** +**Progress:** 4/7 tasks complete + +### Issue Encountered + + +**Options:** +1.