Skip to content

Commit bc923f6

Browse files
authored
Merge pull request #4 from constructive-io/yyyyaaa/blocksredesign-billings
feat: reset blocks distribution and primitive documentation
2 parents 7378cd8 + 43a18b5 commit bc923f6

609 files changed

Lines changed: 17420 additions & 47985 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ jobs:
2323
timeout-minutes: 20
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v7
27+
with:
28+
persist-credentials: false
2729

2830
- name: Setup pnpm
29-
uses: pnpm/action-setup@v4
31+
uses: pnpm/action-setup@v6
3032

3133
- name: Setup Node.js
32-
uses: actions/setup-node@v4
34+
uses: actions/setup-node@v7
3335
with:
34-
node-version: '22'
36+
node-version: '24'
3537
cache: pnpm
3638

3739
- name: Install dependencies
@@ -48,13 +50,37 @@ jobs:
4850

4951
- name: Upload visual failure artifacts
5052
if: failure()
51-
uses: actions/upload-artifact@v4
53+
uses: actions/upload-artifact@v7
5254
with:
5355
name: playwright-results
5456
path: |
5557
apps/blocks/playwright-report
5658
apps/blocks/test-results
5759
if-no-files-found: ignore
5860

61+
pages:
62+
runs-on: ubuntu-latest
63+
timeout-minutes: 20
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v7
67+
with:
68+
persist-credentials: false
69+
70+
- name: Setup pnpm
71+
uses: pnpm/action-setup@v6
72+
73+
- name: Setup Node.js
74+
uses: actions/setup-node@v7
75+
with:
76+
node-version: '24'
77+
cache: pnpm
78+
79+
- name: Install dependencies
80+
run: pnpm install --frozen-lockfile
81+
82+
- name: Build and verify Pages artifact
83+
run: pnpm build:pages
84+
5985
# npm releases are intentionally manual. This workflow only validates package
6086
# tags; it contains no registry token, trusted-publishing step, or publish job.

.github/workflows/pages.yml

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,31 @@ on:
66
workflow_dispatch: {}
77

88
concurrency:
9-
group: pages
10-
cancel-in-progress: true
9+
group: pages-${{ github.ref }}
10+
cancel-in-progress: false
1111

1212
permissions:
1313
contents: read
14-
pages: write
15-
id-token: write
1614

1715
jobs:
1816
build:
1917
runs-on: ubuntu-latest
2018
timeout-minutes: 20
2119
steps:
2220
- name: Checkout
23-
uses: actions/checkout@v4
21+
uses: actions/checkout@v7
22+
with:
23+
persist-credentials: false
2424

2525
- name: Setup pnpm
26-
uses: pnpm/action-setup@v4
26+
uses: pnpm/action-setup@v6
2727

2828
- name: Setup Node.js
29-
uses: actions/setup-node@v4
29+
uses: actions/setup-node@v7
3030
with:
31-
node-version: '22'
31+
node-version: '24'
3232
cache: pnpm
3333

34-
- name: Configure GitHub Pages
35-
uses: actions/configure-pages@v5
36-
3734
- name: Install dependencies
3835
run: pnpm install --frozen-lockfile
3936

@@ -43,34 +40,24 @@ jobs:
4340
- name: Build static Blocks site
4441
run: pnpm build:pages
4542

46-
- name: Assemble Pages artifact
47-
run: |
48-
rm -rf _site
49-
mkdir -p _site/r
50-
cp -R apps/blocks/out/. _site/
51-
cp apps/registry/public/r/*.json _site/r/
52-
test -f _site/index.html
53-
test -f _site/blocks/index.html
54-
test -f _site/r/registry.json
55-
test -f _site/r/chat.json
56-
test -f _site/r/schema-builder.json
57-
grep -q '/blocks/_next/' _site/index.html
58-
! grep -R 'github.io/dashboard' _site
59-
6043
- name: Upload Pages artifact
61-
uses: actions/upload-pages-artifact@v4
44+
uses: actions/upload-pages-artifact@v5
6245
with:
63-
path: _site
46+
path: .artifacts/pages
6447

6548
deploy:
49+
if: github.ref == 'refs/heads/main'
6650
needs: build
6751
runs-on: ubuntu-latest
52+
permissions:
53+
pages: write
54+
id-token: write
6855
environment:
6956
name: github-pages
7057
url: ${{ steps.deployment.outputs.page_url }}
7158
steps:
7259
- name: Deploy GitHub Pages
7360
id: deployment
74-
uses: actions/deploy-pages@v4
61+
uses: actions/deploy-pages@v5
7562

7663
# npm publication is a maintainer-run local process and is intentionally absent.

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
24

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ This public monorepo owns the Constructive Blocks documentation, the
1616

1717
## Verification
1818

19-
Use Node 22 and pnpm 10.28.0, then run `pnpm check`, `pnpm build:pages`, and
19+
Use Node 24 LTS and pnpm 10.28.0, then run `pnpm check`, `pnpm build:pages`, and
2020
`pnpm pack:local` before release-related changes.

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ pnpm build:storybook
2727
pnpm pack:local
2828
```
2929

30-
Use Node 22 and pnpm 10.28.0.
30+
Use Node 24 LTS and pnpm 10.28.0.

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ component documentation, and published React packages.
55

66
## Workspaces
77

8-
- `apps/blocks`documentation, demos, flows, and canonical block source.
8+
- `apps/blocks`primitive documentation and canonical block source.
99
- `apps/registry` — private builder for the `@constructive` shadcn registry.
1010
- `packages/ui` — the `@constructive-io/ui` npm package and UI registry source.
1111
- `packages/schema-builder` — the shared schema-builder npm package and registry source.
@@ -14,6 +14,20 @@ The documentation site is published at
1414
<https://constructive-io.github.io/blocks/>. Registry JSON is served from
1515
`https://constructive-io.github.io/blocks/r/{name}.json`.
1616

17+
The npm and registry distributions are independent. After mapping the
18+
`@constructive` namespace in `components.json`, either surface can be used on
19+
its own:
20+
21+
```bash
22+
pnpm add @constructive-io/ui
23+
pnpm dlx shadcn@4.13.1 add @constructive/button
24+
```
25+
26+
The package exposes its Tailwind foundation at
27+
`@constructive-io/ui/globals.css`. Registry installs copy the required UI
28+
source and Constructive theme into the consumer and do not install the npm
29+
package. Registry consumers require shadcn CLI 4.13.1 or newer.
30+
1731
## Development
1832

1933
```bash
@@ -23,6 +37,9 @@ pnpm build:pages
2337
pnpm pack:local
2438
```
2539

40+
Development and release verification use Node 24 LTS and pnpm 10.28.0. All
41+
first-party executable tooling is TypeScript and runs through `tsx`.
42+
2643
`pnpm pack:local` builds the public packages and writes publishable tarballs to
2744
the ignored `.artifacts/npm` directory. Consume those tarballs from downstream
2845
projects before publishing so validation exercises the real package contents.

apps/blocks/README.md

Lines changed: 18 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,26 @@
1-
# Blocks
1+
# Blocks docs
22

3-
Docs and live-demo showcase for the **Constructive blocks registry** — the `@constructive` shadcn registry of data-bound blocks and UI primitives. Every block renders as a real, interactive demo next to its install command, props, and source.
3+
This Next.js app is the clean documentation surface for the Constructive UI foundation. It intentionally exposes only
4+
the landing page, setup guidance, and the 29 base primitive pages while the complete block catalog remains available
5+
through the public registry.
46

5-
Live: **https://constructive-io.github.io/blocks/** (GitHub Pages, static export under basePath `/blocks`).
7+
The same primitive implementation is shown through two distribution modes:
68

7-
## Develop
9+
- npm consumers import `@constructive-io/ui/<name>` and the package stylesheet.
10+
- shadcn consumers install `@constructive/<name>` as editable source without preinstalling the npm package.
11+
12+
## Development
813

914
```bash
10-
pnpm --filter blocks dev # Next.js + Turbopack on http://localhost:3005
15+
pnpm --filter blocks dev
16+
pnpm --filter blocks lint:types
17+
pnpm --filter blocks test
18+
pnpm --filter blocks build:pages
1119
```
1220

13-
`predev` regenerates artifacts first, so the dev server always reflects current content.
14-
15-
## Content model
16-
17-
Docs are **generated from source**, not hand-written per page. Authored inputs and the UI/schema package manifests feed two generators:
18-
19-
| Authored input | Generator | Generated output (DO NOT EDIT) |
20-
|----------------|-----------|--------------------------------|
21-
| `src/content/blocks/*.md`, `catalog/blocks.json`, all three registry manifests, sidecar `scripts/*content*.mjs` | `scripts/generate-manifest.mjs` | `src/blocks-manifest.json`, `src/lib/docs/registry-data.ts` |
22-
| `scripts/flows-content.mjs`, `registry.json` | `scripts/generate-flows.mjs` | `src/flows/flows.json` |
23-
24-
Run `pnpm gen` after changing any authored input. Never edit the generated files directly — `pnpm gen:check` re-runs the generators into a temp dir and fails on any drift. It runs in `prebuild` and in CI, so drift blocks the build.
25-
26-
## Scripts
27-
28-
| Script | Does |
29-
|--------|------|
30-
| `gen` | Regenerate manifest, docs data, and flows |
31-
| `gen:check` | Fail if generated files drift from their sources |
32-
| `check:flows` | Validate `flows.json`, namespaced installs, and pruned SDK fixtures |
33-
| `fixtures:refresh` | Refresh reachable SDK fixtures from an explicit generated source root |
34-
| `fixtures:check` | Fail when generated SDK imports drift from committed fixtures |
35-
| `check:selections` | Reject empty mutation selections in `src/blocks` |
36-
| `lint:types` | `tsc --noEmit` |
37-
| `test` | `vitest run` |
38-
| `test:visual` | Compare the static Pages site with the Playwright screenshot baselines |
39-
| `build:pages` | `BLOCKS_PAGES=1 next build` — static export for GitHub Pages |
40-
41-
## Layout
42-
43-
| Path | Role |
44-
|------|------|
45-
| `src/blocks` | Registry-shipped app block source (auth, org, user, chat, primitives, runtime, …) |
46-
| `src/generated` | Pruned, committed generated SDK fixtures used only by docs and tests |
47-
| `src/components/docs` | Docs site chrome — nav, preview frame, code surface, demos |
48-
| `src/app` | Next.js App Router routes |
49-
| `src/content/blocks` | Authored per-block markdown (generator input) |
50-
| `scripts` | Generators + drift/contract guards |
51-
52-
`src/blocks` is the source shadcn ships to consumers; everything else is the site that documents it.
53-
54-
## Deploy
21+
`src/lib/base-primitives.ts` is the single docs catalog. `pnpm gen:check` validates that every entry has an npm export,
22+
a registry item, and a preview that imports the npm subpath. The SDK fixture and mutation-selection checks remain in
23+
place for the canonical block source under `src/blocks`.
5524

56-
`.github/workflows/ci.yml` runs the repository validation suite. On `main`,
57-
`.github/workflows/pages.yml` repeats the validated build, assembles `_site/`
58-
the Blocks site plus registry JSON under `/r/` — and deploys it to GitHub Pages.
59-
Neither workflow publishes npm packages.
25+
The static Pages build uses `/blocks` as its deployment base path. Publishing npm packages remains a separate manual
26+
release step.

0 commit comments

Comments
 (0)