@milesroxas/create-design-hub 0.10.0 → 0.11.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/index.mjs CHANGED
@@ -79,7 +79,7 @@ const errors = validate(values);
79
79
  if (Object.keys(errors).length) fail(Object.values(errors).join(' '), { errors });
80
80
  const { path, visibility = 'none', link, track = [] } = values;
81
81
  const name = basename(path);
82
- // dev claims the folder's port on its first start; bootstrap is only for its flags (TypeSafe, Vercel, Conductor).
82
+ // dev claims the folder's port on its first start; bootstrap is only for its flags (TypeSafe, Conductor).
83
83
  const next =
84
84
  values['no-install'] && track.length
85
85
  ? `pnpm --dir "${path}" install, then pnpm --dir "${path}" exec design-hub ${tracksArgs(values).join(' ')}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milesroxas/create-design-hub",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Create a Design Hub project: the thin folder of prototypes, kit materials and docs that installs the @milesroxas/design-hub package. Runs as `npm create @milesroxas/design-hub`.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "devDependencies": {
34
34
  "@biomejs/biome": "2.6.3",
35
- "@milesroxas/design-hub": "0.10.0"
35
+ "@milesroxas/design-hub": "0.11.0"
36
36
  },
37
37
  "scripts": {
38
38
  "check": "biome check --config-path ../design-hub/configs/biome .",
@@ -2,26 +2,11 @@
2
2
  # machine at the time. Never commit .env.
3
3
  PORT=
4
4
 
5
- # The gate for the deployed prototypes (proxy.ts). Each person signs in with
6
- # their own one-time link; this secret signs their session cookie. Set it in the
7
- # Vercel project's Environment Variables for Production and Preview; `pnpm
8
- # bootstrap --vercel <project>` does it. Never commit it, never send it.
9
- # GATE_SECRET: 32+ random bytes, base64 or hex (openssl rand -base64 32).
10
- # Replacing it signs everyone out.
11
- GATE_SECRET=
12
-
13
5
  # Optional: TypeSafe's Jev checks (the fidelity guard, the pre-flight, comment
14
6
  # triage, the skill hint). Set by `pnpm bootstrap --typesafe-key <key>`. Only this
15
7
  # file turns it on, never a key in the shell. Absent, every Jev question is skipped.
16
8
  TYPESAFE_API_KEY=
17
9
 
18
- # Optional: the review store (comments and people) on the deployed site.
19
- # `pnpm bootstrap --vercel <project> --review` adds Upstash Redis through the
20
- # Vercel Marketplace and copies these two here, so `pnpm comments` and
21
- # `pnpm people` reach the same store. Absent, they use the local dev store.
22
- KV_REST_API_URL=
23
- KV_REST_API_TOKEN=
24
-
25
10
  # Optional: `pnpm fixtures-pull` reads real content from the website's CMS.
26
11
  # Fill only the platform's lines. Read-only access is enough.
27
12
  # Webflow: a site token with the cms:read scope.
@@ -47,9 +47,11 @@ pnpm guide <feature> # the feature's walkthrough, docs/spri
47
47
  pnpm export <slug> # brand artboards to exports/<slug>/: PNG for posts, PDF for slides and print (miles-brand)
48
48
  pnpm check # TypeScript and Biome; must pass before you report done
49
49
  pnpm fix # Biome format and safe fixes
50
+ pnpm project link --studio <s> --client <c> --project <p> # put the project in a client of a studio, once (miles-deploy)
50
51
  pnpm preflight # every check a share link needs (miles-deploy)
51
- pnpm signin # Vercel sign-in as a link for the user to click; --wait 300 after (miles-deploy)
52
- pnpm share # preflight, deploy, wait, check the live gate, print the handover (miles-deploy)
52
+ pnpm share # preflight, build, upload into the studio, print the address (miles-deploy)
53
+ pnpm people add --name <n> --team <t> # a person's own sign-in link, on the client's address (miles-deploy)
54
+ pnpm signin # Vercel sign-in as a link for the user to click, for the studio commands (miles-deploy)
53
55
  pnpm comments pull # review comments into docs/sprints/<feature>/comments.md (miles-review)
54
56
  pnpm fixtures-pull <slug> --collection <id> --map key=path # real fixtures from the CMS: Webflow, Payload, WordPress, or --from a JSON file (miles-get-hostile)
55
57
  pnpm commands # every command, with its flags, as JSON
@@ -67,7 +69,7 @@ DESIGN.md PRODUCT.md the design system's named rules (Brand for collateral)
67
69
  exports/ exported collateral, gitignored; rebuilt from the prototype any time
68
70
  .design-hub/project.json the tracks and website platform (pnpm tracks set rewrites it)
69
71
  .design-hub/checks.json the Jev thresholds (design-hub calibrate --write rewrites it)
70
- api/review.ts proxy.ts vercel.json the deploy entries; one line each, never edited
72
+ .design-hub/studio.json the studio, client and project this project is shared into (pnpm project link writes it); committed, no secret
71
73
  ```
72
74
 
73
75
  Each track's sample is the reference for its conventions: `prototypes/sample-list/` for product, `prototypes/sample-page/` for website, `prototypes/sample-social/` for brand. Setup keeps only the samples of the project's tracks; delete one, with its `docs/sprints/` folder, once its track has a feature of its own.
@@ -84,14 +86,14 @@ The README's `## States` table lists every state the prototype holds and how to
84
86
 
85
87
  ## Who sees a prototype
86
88
 
87
- - A new prototype is **Internal**: only Studio can open it. A Studio person marks it **Client-facing** with the switch beside it on the hub's index (no command reads or sets it); a Client's index lists only client-facing prototypes. Say so when you hand a new one over. A switch flipped under `pnpm dev` writes this machine's store only; the deployed site keeps its own.
88
- - Everything in `prototypes/<slug>/` (code, README, styles, fixtures, images) ships only to people who may see that prototype. The deployed site refuses its page and files to a Client while it is internal.
89
+ - A new prototype is **Internal**: only Studio can open it. A Studio person marks it **Client-facing** with the switch beside it on the hub's index (no command reads or sets it); a Client's index lists only client-facing prototypes. Say so when you hand a new one over. A switch flipped under `pnpm dev` writes this machine's store only; the studio keeps its own.
90
+ - Everything in `prototypes/<slug>/` (code, README, styles, fixtures, images) ships only to people who may see that prototype. The studio refuses its page and files to a Client while it is internal.
89
91
  - Never reach into another prototype's files (an import, a CSS `@import` or `url()`, a `new URL`): the build refuses it, naming both. No web worker in a prototype either: the build refuses it (a worker in `kit/` that uses no prototype's files is fine). Run `pnpm build` before you share: it checks more than `pnpm dev` does. Never put shared code directly in `prototypes/` or in a folder there without a README: the build refuses it; shared code belongs in `kit/`. Write styles in plain CSS (or `.pcss`): Sass, Less and Stylus are refused in prototypes and in `kit/`, in `pnpm dev` and `pnpm build`, because their own imports resolve where no check sees them. The build also fails when a file outside a prototype's folder is one of that prototype's files whole (the same bytes, a `data:` URI of it, or its whole text as a string), however it got there; it does not look for part of a file, so shared lines and rules build. A `new URL` whose path is built at run time is not seen until its content lands outside the folder.
90
92
  - A prototype's small images and SVGs are files of their own, never `data:` URIs, so the site can refuse them to a Client while the prototype is internal.
91
93
  - `kit/` is shared with every signed-in person, clients included: nothing client-secret goes there, and nothing in it may point into a prototype's folder (the build refuses it). A link from one prototype's page to another's is fine.
92
94
  - A dial is **Internal** too: a client's Controls panel has only the View tools until a dial is marked client-facing. Mark one in code with `client(...)` from `@kit/dials` only when the user asks for clients to have it; otherwise leave it, and Studio marks it with the eye beside its row in the Controls panel, which overrules the code on that site. Never mark fixtures, roles or scenarios: they are how the studio tests. An internal dial's name, range and default are still in the page's code a client's browser loads, so a dial's name never says what a client must not read. A client reads an internal dial's default, so the default is the value to present.
93
95
  - Walkthrough text (`docs/sprints/<feature>/guide.md`) and feature names go to every signed-in person, clients included, whether or not the feature's prototypes are client-facing: a walkthrough must not name or describe internal work until the client may see it.
94
- - `guide`, `api` and `assets` are the hub's paths, never a slug (`pnpm new` refuses them).
96
+ - `invite`, `api`, `_gate`, `_p`, `assets`, `guide`, `index.html` and `favicon.svg` are the hub's paths: a prototype may not be named any of them (`pnpm new` refuses them).
95
97
 
96
98
  ## A feature
97
99
 
@@ -145,8 +147,8 @@ The `miles-*` skills in `.claude/skills/` come from the `@milesroxas/design-hub`
145
147
  | `miles-new-feature` | Starting a feature or a prototype: the folder, the README, `docs/sprints/<feature>/`. |
146
148
  | `miles-get-hostile` | Writing `fixtures.json` or deciding what an edge case looks like. |
147
149
  | `miles-paper-to-prototype` | Every Paper MCP read. Maps Paper output onto the kit's tokens and components. |
148
- | `miles-deploy` | Deploying, sharing or updating the link, signing in to Vercel, adding people and sending each their sign-in link, a new link for another device, how long access lasts, turning on comments, checking the work before any of those. The user never types these commands: run them and send any link they must click. |
149
- | `miles-review` | Comments from the deployed prototypes, and who may comment. |
150
+ | `miles-deploy` | Sharing or updating the link, the studio and its clients, linking this project to a client, signing in to Vercel, adding people and sending each their sign-in link, a new link for another device, how long access lasts, checking the work before any of those. The user never types these commands: run them and send any link they must click. |
151
+ | `miles-review` | Comments on the shared prototypes, and who may comment. |
150
152
  | `miles-port` | Turning an approved prototype into production. |
151
153
  | `miles-brand` | Brand collateral: social posts, slides, print; artboards, formats and export. |
152
154
  | `miles-worktrees` | Worktrees, parallel agents, Conductor or any harness, and port collisions. |
@@ -17,8 +17,9 @@ Not a developer? The [guide](https://github.com/milesroxas/design-hub/tree/main/
17
17
  | `kit/` | The project's materials: `tokens.css`, `shell.ts` (brand and navigation), `icons.ts`, the disposable `AppShell` and `SiteShell`. |
18
18
  | `docs/sprints/<feature>/` | A feature's design doc, walkthrough, pulled comments and port report. |
19
19
  | `DESIGN.md`, `PRODUCT.md` | The recorded design system and who the product is for. |
20
+ | `.design-hub/studio.json` | The studio, client and project this project is shared into. Written by `pnpm project link`, committed. |
20
21
  | `.claude/` | Claude Code hooks and the `miles-*` skills (`pnpm skills` refreshes them from the package and adds any script they need). |
21
22
 
22
- The rules for people and agents are in [AGENTS.md](AGENTS.md). Sharing a link, who can sign in and review comments: ask Claude to share, add someone or turn on comments (the `miles-deploy` and `miles-review` skills run every command), or `pnpm commands` for every command.
23
+ The rules for people and agents are in [AGENTS.md](AGENTS.md). The project is shared through a studio: one site that gives each client its own address, with every project of that client below it. Sharing a link, who can sign in and review comments: ask Claude to share or add someone (the `miles-deploy` and `miles-review` skills run every command), or `pnpm commands` for every command.
23
24
 
24
25
  Design Hub upgrades itself when a Claude Code session starts here. To upgrade by hand: `pnpm exec design-hub upgrade`. To turn the automatic upgrade off: `DESIGN_HUB_AUTO_UPDATE=0` in `.env`.
@@ -12,7 +12,6 @@ dist/
12
12
 
13
13
  # Exported collateral: files to hand over, rebuilt from the prototype any time
14
14
  exports/
15
- .vercel/
16
15
 
17
16
  # Environment and secrets
18
17
  .env
@@ -22,10 +21,11 @@ exports/
22
21
  # Logs
23
22
  *.log
24
23
 
25
- # Local state: the Jev log and its labels, the dev review store. checks.json (the thresholds) and project.json (the tracks) stay.
24
+ # Local state: the Jev log and its labels, the dev review store. checks.json (the thresholds), project.json (the tracks) and studio.json (the studio link) stay.
26
25
  .design-hub/*
27
26
  !.design-hub/checks.json
28
27
  !.design-hub/project.json
28
+ !.design-hub/studio.json
29
29
 
30
30
  # Obsidian per-machine state (docs/ is an Obsidian vault)
31
31
  docs/.obsidian/workspace*.json
@@ -20,6 +20,9 @@
20
20
  "preflight": "design-hub preflight",
21
21
  "signin": "design-hub signin",
22
22
  "share": "design-hub share",
23
+ "project": "design-hub project",
24
+ "studio": "design-hub studio",
25
+ "client": "design-hub client",
23
26
  "comments": "design-hub comments",
24
27
  "people": "design-hub people",
25
28
  "calibrate": "design-hub calibrate",
@@ -6,5 +6,5 @@
6
6
  "@milesroxas/design-hub/kit/*": ["./node_modules/@milesroxas/design-hub/kit/*"]
7
7
  }
8
8
  },
9
- "include": ["prototypes", "kit", "api", "proxy.ts"]
9
+ "include": ["prototypes", "kit"]
10
10
  }
@@ -1,5 +0,0 @@
1
- // The review API on Vercel. The project's thresholds travel with it.
2
- import { reviewFunction } from '@milesroxas/design-hub/vercel';
3
- import checks from '../.design-hub/checks.json' with { type: 'json' };
4
-
5
- export default reviewFunction(checks);
package/template/proxy.ts DELETED
@@ -1,4 +0,0 @@
1
- // The sign-in gate in front of every deployed path (vercel.json, proxy.entrypoint).
2
- import { createProxy } from '@milesroxas/design-hub/vercel';
3
-
4
- export default createProxy({ siteName: 'Prototypes' });
@@ -1,49 +0,0 @@
1
- {
2
- "$schema": "https://openapi.vercel.sh/vercel.json",
3
- "framework": "vite",
4
- "installCommand": "pnpm install --frozen-lockfile",
5
- "buildCommand": "pnpm build",
6
- "outputDirectory": "dist",
7
- "proxy": {
8
- "entrypoint": "proxy.ts",
9
- "matcher": ["/(.*)"]
10
- },
11
- "rewrites": [
12
- {
13
- "source": "/((?!api/).*)",
14
- "destination": "/index.html"
15
- }
16
- ],
17
- "headers": [
18
- {
19
- "source": "/(.*)",
20
- "headers": [
21
- {
22
- "key": "X-Robots-Tag",
23
- "value": "noindex, nofollow, noarchive"
24
- },
25
- {
26
- "key": "X-Content-Type-Options",
27
- "value": "nosniff"
28
- },
29
- {
30
- "key": "X-Frame-Options",
31
- "value": "DENY"
32
- },
33
- {
34
- "key": "Referrer-Policy",
35
- "value": "same-origin"
36
- },
37
- {
38
- "key": "Strict-Transport-Security",
39
- "value": "max-age=31536000; includeSubDomains"
40
- }
41
- ]
42
- }
43
- ],
44
- "functions": {
45
- "api/review.ts": {
46
- "maxDuration": 10
47
- }
48
- }
49
- }