@milesroxas/design-hub 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/catalog.test.ts +10 -1
- package/core/catalog.ts +11 -0
- package/core/cms.test.ts +103 -0
- package/core/cms.ts +178 -0
- package/core/export.test.ts +127 -0
- package/core/export.ts +120 -0
- package/core/formats.ts +60 -0
- package/core/project.test.ts +71 -0
- package/core/project.ts +147 -0
- package/dist/core/catalog.d.ts +5 -0
- package/dist/core/catalog.js +10 -0
- package/dist/core/cms.d.ts +40 -0
- package/dist/core/cms.js +141 -0
- package/dist/core/export.d.ts +52 -0
- package/dist/core/export.js +84 -0
- package/dist/core/formats.d.ts +90 -0
- package/dist/core/formats.js +39 -0
- package/dist/core/project.d.ts +56 -0
- package/dist/core/project.js +121 -0
- package/dist/scripts/bootstrap.d.ts +12 -0
- package/dist/scripts/bootstrap.js +62 -13
- package/dist/scripts/cli.js +4 -0
- package/dist/scripts/commands.js +4 -0
- package/dist/scripts/dev.d.ts +2 -2
- package/dist/scripts/dev.js +13 -2
- package/dist/scripts/export.d.ts +42 -0
- package/dist/scripts/export.js +192 -0
- package/dist/scripts/fixtures-pull.d.ts +31 -19
- package/dist/scripts/fixtures-pull.js +102 -62
- package/dist/scripts/lib/cdp.d.ts +11 -0
- package/dist/scripts/lib/cdp.js +110 -0
- package/dist/scripts/new.d.ts +13 -1
- package/dist/scripts/new.js +43 -4
- package/dist/scripts/skills.js +4 -0
- package/dist/scripts/tracks.d.ts +40 -0
- package/dist/scripts/tracks.js +93 -0
- package/dist/server/env.d.ts +15 -3
- package/dist/server/env.js +23 -5
- package/dist/server/paths.d.ts +2 -0
- package/dist/server/paths.js +2 -0
- package/dist/server/project.d.ts +7 -0
- package/dist/server/project.js +29 -0
- package/dist/vite/plugin.d.ts +3 -3
- package/dist/vite/plugin.js +7 -4
- package/kit/Artboard.tsx +160 -0
- package/kit/artboard.css +47 -0
- package/kit/dials.tsx +2 -1
- package/package.json +1 -1
- package/shell/Index.tsx +49 -4
- package/shell/main.tsx +6 -2
- package/shell/shell.css +7 -3
- package/skills/miles-brand/SKILL.md +52 -0
- package/skills/miles-design-hub/SKILL.md +60 -25
- package/skills/miles-get-hostile/SKILL.md +7 -5
- package/skills/miles-new-feature/SKILL.md +8 -7
- package/skills/miles-port/SKILL.md +14 -2
- package/skills/miles-port/references/emdash.md +43 -0
- package/skills/miles-port/references/payload.md +31 -0
- package/skills/miles-port/references/wordpress.md +31 -0
- package/skills/miles-prototype/SKILL.md +2 -2
- package/skills/miles-worktrees/SKILL.md +56 -0
- package/templates/app/README.md +1 -0
- package/templates/brand/README.md +48 -0
- package/templates/brand/index.tsx +16 -0
- package/templates/brand/styles.css +5 -0
- package/templates/site/README.md +42 -0
- package/templates/site/index.tsx +22 -0
- package/templates/site/styles.css +6 -0
- package/templates/space/README.md +1 -0
- package/skills/miles-conductor/SKILL.md +0 -37
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: miles-worktrees
|
|
3
|
+
description: "Run this project in more than one checkout at once: git worktrees, T3 Code, Conductor, Claude Code, Cursor, or any harness that gives each agent its own folder. A port per folder, the harness port variables, the machine port registry, Conductor's settings file, and what checkouts never share. Load when the user mentions worktrees, workspaces, parallel agents, a harness, or a dev server that answers with the wrong project. Triggers on: worktree, worktrees, workspace, workspaces, parallel agents, Conductor, T3 Code, CONDUCTOR_PORT, DESIGN_HUB_PORT, port taken, port collision, wrong site, ports.json, port registry."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Worktrees and parallel agents
|
|
7
|
+
|
|
8
|
+
Every checkout of this project is its own folder with its own dev server and its own port: the main clone, each `git worktree`, each harness workspace. Two folders on one port is the failure everything here prevents. The second server refuses to start, or the browser shows the other folder's prototypes with no error.
|
|
9
|
+
|
|
10
|
+
## Start a new checkout
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm install
|
|
14
|
+
pnpm dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Nothing else is needed, in any harness. On its first start `pnpm dev` claims a free port for the folder and writes it to `.env` and `.claude/launch.json`; later starts reuse it. Both files are gitignored because they belong to the folder, so worktrees never conflict on them. `pnpm bootstrap` remains the full setup (TypeSafe key, Vercel) but is not needed to run.
|
|
18
|
+
|
|
19
|
+
Some harnesses copy `.env` from the main checkout. That is fine: the copied `PORT` is claimed by the other folder, so this folder gets its own and the dev server says so on stderr. The copied `GATE_*` and `TYPESAFE_API_KEY` keep working.
|
|
20
|
+
|
|
21
|
+
## Ports
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Which port does the dev server use?
|
|
25
|
+
├── $DESIGN_HUB_PORT set → that port. Any harness or script that hands out ports sets this.
|
|
26
|
+
├── $CONDUCTOR_PORT set → that port. Conductor sets it per workspace.
|
|
27
|
+
└── neither → this folder's PORT in .env, claimed in the machine registry
|
|
28
|
+
(~/.config/design-hub/ports.json; $DESIGN_HUB_PORTS moves it).
|
|
29
|
+
A port another folder claims is skipped, running or not.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
A harness port never enters `.env` or the registry: the harness owns that range. A bare `$PORT` is ignored on purpose. Why: shells and other tools export it for their own servers, and the hub would start on it.
|
|
33
|
+
|
|
34
|
+
A claim lasts as long as its folder. A deleted worktree's claim is dropped the next time any folder claims a port.
|
|
35
|
+
|
|
36
|
+
On a taken port, `pnpm dev` refuses to start (`strictPort`) and `pnpm bootstrap` names the process and its folder. Then:
|
|
37
|
+
|
|
38
|
+
1. Never pass another port. Why: the harness's Open button, `.env` and `.claude/launch.json` keep pointing at the configured one, so a second port is a server nobody opens.
|
|
39
|
+
2. Find the holder: `lsof -nP -iTCP:<port> -sTCP:LISTEN`, then `lsof -a -p <pid> -d cwd` for its folder.
|
|
40
|
+
3. An orphaned server of this folder: stop it. A server of another folder or project: ask the user before stopping it.
|
|
41
|
+
|
|
42
|
+
## Harnesses
|
|
43
|
+
|
|
44
|
+
- **T3 Code, Claude Code worktrees, Cursor, plain `git worktree add`.** Nothing to configure. A harness setup step needs only `pnpm install`. A harness that starts the server itself and picks ports sets `DESIGN_HUB_PORT`.
|
|
45
|
+
- **Conductor.**
|
|
46
|
+
1. From the project root: `pnpm bootstrap --conductor --branch <integration branch>`. It writes `.conductor/settings.toml`: setup installs and bootstraps each new workspace, run starts `pnpm dev`, and the preview URL is the workspace's `$CONDUCTOR_PORT`. A file the user has edited is kept, and the JSON warns that it differs.
|
|
47
|
+
2. Commit `.conductor/settings.toml`. `.conductor/settings.local.toml` is gitignored, for one person's overrides.
|
|
48
|
+
3. Tell the user to add the repository in Conductor and set its base branch to the same branch. Conductor keeps that setting in its app only, so nothing in the repo can set or check it.
|
|
49
|
+
|
|
50
|
+
Conductor never checks that its port is free. Why it matters: a server orphaned in another project can hold it, and the Open button then shows that project. The bootstrap in the workspace's setup fails loudly when that happens.
|
|
51
|
+
|
|
52
|
+
## Nothing shared
|
|
53
|
+
|
|
54
|
+
Checkouts share no database and no container. The review store's local copy is a file in each checkout's `.design-hub/`, and the deployed store is remote, so two checkouts never see each other's local comments.
|
|
55
|
+
|
|
56
|
+
When the user keeps their own record of which project owns which port, add this folder's port to it too.
|
package/templates/app/README.md
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: {{title}}
|
|
3
|
+
summary: One line on what this piece is for.
|
|
4
|
+
context: board
|
|
5
|
+
track: {{track}}
|
|
6
|
+
status: exploring
|
|
7
|
+
kind: {{kind}}
|
|
8
|
+
feature: {{feature}}
|
|
9
|
+
created: {{created}}
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# {{title}}
|
|
13
|
+
|
|
14
|
+
## Problem
|
|
15
|
+
|
|
16
|
+
What the piece has to do, where it appears, and for whom. Write this before any artboard.
|
|
17
|
+
|
|
18
|
+
## Question
|
|
19
|
+
|
|
20
|
+
The one decision this board exists to make.
|
|
21
|
+
|
|
22
|
+
## Formats
|
|
23
|
+
|
|
24
|
+
| Artboard | Format | Where it runs |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| | | |
|
|
27
|
+
|
|
28
|
+
Formats come from `@kit/Artboard` (`post-square`, `post-portrait`, `story`, `link-preview`, `banner`, `slide`, `a4`, `letter`). Each artboard is drawn at its real pixel size; a story keeps type and logos out of its top and bottom 250px.
|
|
29
|
+
|
|
30
|
+
## States
|
|
31
|
+
|
|
32
|
+
Every state the board holds, one row each: each fixture set, each layout and each tone a dial reaches. `miles-port` and the export read this table.
|
|
33
|
+
|
|
34
|
+
| State | How to reach it |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| | |
|
|
37
|
+
|
|
38
|
+
## Fixtures
|
|
39
|
+
|
|
40
|
+
`fixtures.json` holds `real` (the copy and images this piece runs with) and `missing` (no image, no subhead). `@kit/fixtures` derives `longest`, `empty` and `max`. Say where `real` came from.
|
|
41
|
+
|
|
42
|
+
## Export
|
|
43
|
+
|
|
44
|
+
`pnpm export {{slug}}` writes PNGs for posts and a PDF for slides and print into `exports/{{slug}}/`. Name the dial state that ships in the Decision, and export with it (`--dials`).
|
|
45
|
+
|
|
46
|
+
## Decision
|
|
47
|
+
|
|
48
|
+
Empty until picked. What was chosen, its values, and what was rejected and why.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Artboard, Board } from '@kit/Artboard';
|
|
2
|
+
import './styles.css';
|
|
3
|
+
|
|
4
|
+
export default function Prototype() {
|
|
5
|
+
return (
|
|
6
|
+
<Board title="{{title}}" lede="Replace with the question from README.md.">
|
|
7
|
+
<Artboard format="post-square" name="square">
|
|
8
|
+
<div className="piece">
|
|
9
|
+
<p className="piece-kicker">Kicker</p>
|
|
10
|
+
<h2 className="piece-headline">The headline, at the size it ships</h2>
|
|
11
|
+
<p className="piece-sub">Every value here is in real pixels: this artboard is 1080 wide.</p>
|
|
12
|
+
</div>
|
|
13
|
+
</Artboard>
|
|
14
|
+
</Board>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* Values are real pixels at the artboard's size (1080 wide for posts). */
|
|
2
|
+
.piece { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 24px; padding: 96px; background: var(--bg-brand-solid, var(--bg-primary)); color: var(--text-white, var(--text-primary)); }
|
|
3
|
+
.piece-kicker { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.8; }
|
|
4
|
+
.piece-headline { font-size: 88px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; max-width: 16ch; }
|
|
5
|
+
.piece-sub { font-size: 32px; line-height: 44px; max-width: 30ch; opacity: 0.85; }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: {{title}}
|
|
3
|
+
summary: One line on what this explores.
|
|
4
|
+
context: app
|
|
5
|
+
track: {{track}}
|
|
6
|
+
status: exploring
|
|
7
|
+
kind: {{kind}}
|
|
8
|
+
feature: {{feature}}
|
|
9
|
+
created: {{created}}
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# {{title}}
|
|
13
|
+
|
|
14
|
+
## Problem
|
|
15
|
+
|
|
16
|
+
What is wrong or unknown today, and for whom. Write this before any code.
|
|
17
|
+
|
|
18
|
+
## Question
|
|
19
|
+
|
|
20
|
+
The one decision this prototype exists to make.
|
|
21
|
+
|
|
22
|
+
## Flows
|
|
23
|
+
|
|
24
|
+
| Flow | Starts from | Edge cases |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| | | |
|
|
27
|
+
|
|
28
|
+
## States
|
|
29
|
+
|
|
30
|
+
Every state the prototype holds, one row each. The fidelity guard and `miles-port` read this table: a state that is not here does not exist to them.
|
|
31
|
+
|
|
32
|
+
| State | How to reach it |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| | |
|
|
35
|
+
|
|
36
|
+
## Fixtures
|
|
37
|
+
|
|
38
|
+
`fixtures.json` holds `real` and `missing`; `@kit/fixtures` derives `longest`, `empty` and `max`. Say where `real` came from (which CMS collection, or the comp) and the design's maximum count. A website's content is the CMS's: name the collection and the fields each section reads, so the port maps them by name.
|
|
39
|
+
|
|
40
|
+
## Decision
|
|
41
|
+
|
|
42
|
+
Empty until picked. What was chosen, its values, and what was rejected and why. Then delete the folder.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SiteShell } from '@kit/SiteShell';
|
|
2
|
+
import { Button, notInPrototype } from '@kit/ui';
|
|
3
|
+
import './styles.css';
|
|
4
|
+
|
|
5
|
+
export default function Prototype() {
|
|
6
|
+
return (
|
|
7
|
+
<SiteShell>
|
|
8
|
+
<section className="page-hero">
|
|
9
|
+
<h1>{{title}}</h1>
|
|
10
|
+
<p className="page-lede">Replace with the question from README.md.</p>
|
|
11
|
+
<Button kind="primary" label="Get started" onClick={() => notInPrototype('The call to action')} />
|
|
12
|
+
</section>
|
|
13
|
+
<section className="page-section">
|
|
14
|
+
<h2>The section under test</h2>
|
|
15
|
+
<p>
|
|
16
|
+
Build the page here with @kit/ui, section by section, each reading its content from fixtures.json
|
|
17
|
+
the way the CMS will hand it over.
|
|
18
|
+
</p>
|
|
19
|
+
</section>
|
|
20
|
+
</SiteShell>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
.page-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 48px 0 64px; }
|
|
2
|
+
.page-hero h1 { font-size: 48px; line-height: 1.1; letter-spacing: -0.02em; max-width: 18ch; text-wrap: balance; }
|
|
3
|
+
.page-lede { font-size: 18px; line-height: 28px; color: var(--text-secondary); max-width: 56ch; }
|
|
4
|
+
.page-section { display: flex; flex-direction: column; gap: 8px; padding: 48px 0; border-top: 1px solid var(--border-secondary); }
|
|
5
|
+
.page-section h2 { font-size: 24px; line-height: 32px; }
|
|
6
|
+
.page-section p { color: var(--text-secondary); max-width: 64ch; }
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: miles-conductor
|
|
3
|
-
description: "Run this project in Conductor (conductor.build) workspaces: the settings file, a port per workspace, and the machine port registry that keeps projects off each other's ports. Load when the user mentions Conductor, workspaces, parallel agents, or a dev server that answers with the wrong project. Triggers on: Conductor, workspace, workspaces, CONDUCTOR_PORT, parallel agents, port taken, port collision, wrong site, ports.json, port registry."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Conductor
|
|
7
|
-
|
|
8
|
-
Conductor gives each workspace its own `$CONDUCTOR_PORT`, but never checks that the port is free. A dev server orphaned in another project can still hold it, and the workspace's Open button then shows the other project with no error. Everything here exists to make that failure loud.
|
|
9
|
-
|
|
10
|
-
## Set up
|
|
11
|
-
|
|
12
|
-
1. From the project root: `pnpm bootstrap --conductor --branch <integration branch>`. It writes `.conductor/settings.toml`: setup runs `pnpm bootstrap` in each new workspace, run starts `pnpm dev`, and the preview URL is the workspace's port. A file the user has edited is kept, and the JSON warns that it differs.
|
|
13
|
-
2. Commit `.conductor/settings.toml`. `.conductor/settings.local.toml` is gitignored, for one person's overrides.
|
|
14
|
-
3. Tell the user to add the repository in Conductor and set its base branch to the same branch. Conductor keeps that setting in its app only, so nothing in the repo can set or check it.
|
|
15
|
-
|
|
16
|
-
## Ports
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
Where is the dev server running?
|
|
20
|
-
├── A Conductor workspace → $CONDUCTOR_PORT, always. The dev server reads it before .env.
|
|
21
|
-
│ It never enters the machine registry: Conductor owns that range.
|
|
22
|
-
└── A main checkout → the port pnpm bootstrap picked, written to .env and claimed in
|
|
23
|
-
~/.config/design-hub/ports.json ($DESIGN_HUB_PORTS overrides the path).
|
|
24
|
-
Bootstrap skips every port another project claims, running or not.
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
On a taken port, `pnpm dev` refuses to start (`strictPort`) and `pnpm bootstrap` names the process and its folder. Then:
|
|
28
|
-
|
|
29
|
-
1. Never pass another port. Why: the Open button and `.claude/launch.json` keep pointing at the configured one, so a second port is a server nobody opens.
|
|
30
|
-
2. Find the holder: `lsof -nP -iTCP:<port> -sTCP:LISTEN`, then `lsof -a -p <pid> -d cwd` for its folder.
|
|
31
|
-
3. An orphaned server of this project: stop it. A server of another project: ask the user before stopping it.
|
|
32
|
-
|
|
33
|
-
When the user keeps their own record of which project owns which port, add this project's port to it too.
|
|
34
|
-
|
|
35
|
-
## Nothing shared
|
|
36
|
-
|
|
37
|
-
Workspaces share no database and no container. The review store's local copy is a file in each checkout's `.design-hub/`, and the deployed store is remote, so two workspaces never see each other's local comments.
|