@milesroxas/design-hub 0.11.2 → 0.13.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.
Files changed (87) hide show
  1. package/README.md +8 -6
  2. package/core/prototype.test.ts +52 -0
  3. package/core/prototype.ts +59 -0
  4. package/core/review/model.ts +20 -0
  5. package/core/review/service.test.ts +262 -37
  6. package/core/review/service.ts +276 -52
  7. package/core/review/store.ts +12 -6
  8. package/core/review/suite-kv.ts +17 -0
  9. package/dist/core/prototype.d.ts +50 -0
  10. package/dist/core/prototype.js +38 -0
  11. package/dist/core/review/model.d.ts +22 -0
  12. package/dist/core/review/model.js +8 -0
  13. package/dist/core/review/service.d.ts +98 -18
  14. package/dist/core/review/service.js +248 -46
  15. package/dist/core/review/store.d.ts +10 -4
  16. package/dist/core/review/store.js +2 -2
  17. package/dist/core/review/suite-kv.d.ts +7 -0
  18. package/dist/core/review/suite-kv.js +12 -0
  19. package/dist/scripts/client.d.ts +3 -3
  20. package/dist/scripts/client.js +55 -69
  21. package/dist/scripts/lib/cli.js +5 -0
  22. package/dist/scripts/lib/dns.d.ts +32 -0
  23. package/dist/scripts/lib/dns.js +69 -1
  24. package/dist/scripts/lib/fake-host.d.ts +35 -11
  25. package/dist/scripts/lib/fake-host.js +27 -13
  26. package/dist/scripts/lib/host.d.ts +13 -25
  27. package/dist/scripts/lib/host.js +15 -324
  28. package/dist/scripts/lib/studio-deps.d.ts +16 -0
  29. package/dist/scripts/lib/studio-deps.js +41 -16
  30. package/dist/scripts/lib/studios.d.ts +17 -5
  31. package/dist/scripts/lib/studios.js +25 -5
  32. package/dist/scripts/lib/vercel-host.d.ts +17 -0
  33. package/dist/scripts/lib/vercel-host.js +410 -0
  34. package/dist/scripts/people.d.ts +7 -4
  35. package/dist/scripts/people.js +147 -39
  36. package/dist/scripts/share.js +3 -2
  37. package/dist/scripts/studio.d.ts +10 -4
  38. package/dist/scripts/studio.js +136 -22
  39. package/dist/server/api.d.ts +12 -13
  40. package/dist/server/api.js +141 -52
  41. package/dist/server/gate.d.ts +97 -0
  42. package/dist/server/gate.js +537 -0
  43. package/dist/server/hosts.d.ts +3 -3
  44. package/dist/server/hosts.js +10 -10
  45. package/dist/server/mark.d.ts +17 -0
  46. package/dist/server/mark.js +46 -1
  47. package/dist/server/session.d.ts +9 -1
  48. package/dist/server/session.js +10 -3
  49. package/dist/server/stores/backends.d.ts +22 -0
  50. package/dist/server/stores/backends.js +96 -0
  51. package/dist/server/{fake-upstash.js → stores/fake-upstash.js} +1 -1
  52. package/dist/server/stores/index.d.ts +41 -0
  53. package/dist/server/stores/index.js +63 -0
  54. package/dist/server/stores/pglite.d.ts +16 -0
  55. package/dist/server/stores/pglite.js +98 -0
  56. package/dist/server/stores/postgres.d.ts +63 -0
  57. package/dist/server/stores/postgres.js +153 -0
  58. package/dist/server/{upstash.d.ts → stores/upstash.d.ts} +1 -1
  59. package/dist/vercel/files.js +1 -1
  60. package/dist/vercel/proxy.d.ts +6 -78
  61. package/dist/vercel/proxy.js +18 -359
  62. package/dist/vite/plugin.d.ts +6 -2
  63. package/dist/vite/plugin.js +22 -4
  64. package/package.json +3 -1
  65. package/shell/Index.tsx +29 -0
  66. package/shell/review/People.tsx +79 -49
  67. package/shell/review/Review.tsx +49 -1
  68. package/shell/review/ThreadCard.tsx +13 -1
  69. package/shell/review/client.ts +54 -21
  70. package/shell/review/review.css +1 -0
  71. package/shell/review/unsent.test.ts +63 -0
  72. package/shell/review/unsent.ts +64 -0
  73. package/shell/review/view.ts +22 -6
  74. package/shell/studio/ClientHub.tsx +9 -36
  75. package/shell/studio/StudioHub.tsx +293 -0
  76. package/shell/studio/hub.css +80 -5
  77. package/shell/studio/page.tsx +57 -0
  78. package/shell/studio/studio.html +14 -0
  79. package/shell/studio/studio.tsx +19 -0
  80. package/skills/miles-deploy/SKILL.md +17 -6
  81. package/skills/miles-design-hub/SKILL.md +3 -3
  82. package/skills/miles-review/SKILL.md +1 -1
  83. package/templates/studio/.env.example +3 -0
  84. package/templates/studio/README.md +45 -13
  85. package/templates/studio/package.json +1 -1
  86. /package/dist/server/{fake-upstash.d.ts → stores/fake-upstash.d.ts} +0 -0
  87. /package/dist/server/{upstash.js → stores/upstash.js} +0 -0
@@ -0,0 +1,57 @@
1
+ // What the client hub and the studio hub share: who is signed in with the
2
+ // one list the page shows, loaded together, and the page around it (its
3
+ // head, its body, and who is signed in at the foot).
4
+ import { type ReactNode, useEffect, useState } from 'react';
5
+ import { call, type Me } from '../review/client';
6
+
7
+ /** A hub's data: loading, failed (signed out, or anything else), or ready with who is signed in and the list. */
8
+ export type HubLoaded<T extends object> =
9
+ | { status: 'loading' }
10
+ | { status: 'error'; signedOut: boolean }
11
+ | ({ status: 'ready'; me: Me | null } & T);
12
+
13
+ /** Who is signed in, and the answer to `op`, the page's one list. */
14
+ export function useHubData<T extends object>(op: string): HubLoaded<T> {
15
+ const [loaded, setLoaded] = useState<HubLoaded<T>>({ status: 'loading' });
16
+ useEffect(() => {
17
+ let current = true;
18
+ Promise.all([call<{ person: Me | null }>('me'), call<T>(op)]).then(
19
+ ([{ person }, data]) => current && setLoaded({ status: 'ready', me: person, ...data }),
20
+ // By status, not body: the review API's 401 is JSON, the gate's in front of it is text.
21
+ (error: { status?: number }) =>
22
+ current && setLoaded({ status: 'error', signedOut: error.status === 401 }),
23
+ );
24
+ return () => {
25
+ current = false;
26
+ };
27
+ }, [op]);
28
+ return loaded;
29
+ }
30
+
31
+ /** The page: its title and voice, its body, and who is signed in once that is known. */
32
+ export function HubPage({
33
+ title,
34
+ voice,
35
+ me,
36
+ children,
37
+ }: {
38
+ title: string;
39
+ voice: string;
40
+ me: Me | null;
41
+ children: ReactNode;
42
+ }) {
43
+ return (
44
+ <main className="hub">
45
+ <header className="hub-head">
46
+ <h1>{title}</h1>
47
+ <p className="hub-voice">{voice}</p>
48
+ </header>
49
+ {children}
50
+ {me ? (
51
+ <footer className="hub-foot">
52
+ Signed in as {me.name}, {me.team}
53
+ </footer>
54
+ ) : null}
55
+ </main>
56
+ );
57
+ }
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en" class="sys">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
6
+ <meta name="robots" content="noindex, nofollow" />
7
+ <title>Clients</title>
8
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
9
+ </head>
10
+ <body>
11
+ <div id="root"></div>
12
+ <script type="module" src="./studio.tsx"></script>
13
+ </body>
14
+ </html>
@@ -0,0 +1,19 @@
1
+ // A studio site's studio hub, at the root of the studio's own host
2
+ // (`studio.<apex>`): every client of the studio and its projects, each with
3
+ // an Open that signs the Studio person in on the client's host (a handoff).
4
+ // Built apart from the client hub, below /_studio/ (`studioConfig` in
5
+ // vite/plugin.ts), so no client's host ever serves it. It wears the hub's
6
+ // neutral system look, as the client hub does.
7
+ import '@kit/base.css';
8
+ import '@kit/prefs';
9
+ import '../system.css';
10
+ import './hub.css';
11
+ import { StrictMode } from 'react';
12
+ import { createRoot } from 'react-dom/client';
13
+ import { StudioHub } from './StudioHub';
14
+
15
+ createRoot(document.getElementById('root')!).render(
16
+ <StrictMode>
17
+ <StudioHub />
18
+ </StrictMode>,
19
+ );
@@ -5,7 +5,7 @@ description: "Share the prototypes through a studio and hand out sign-in links:
5
5
 
6
6
  # Share
7
7
 
8
- A project is shared through a **studio**: one site that serves every client of the studio. A client has its own address, `<client>.<apex>`, and each of its projects sits at `/<project>/` below it. A person signs in once on their client's address and sees every project the studio has shared with that client, and nothing of any other client. The user never types a command: run them and send any link they must click.
8
+ A project is shared through a **studio**: one site that serves every client of the studio. A client has its own address, `<client>.<apex>`, and each of its projects sits at `/<project>/` below it. A person signs in once on their client's address and sees every project the studio has shared with that client, and nothing of any other client. The studio's own people sign in at `studio.<apex>`: it lists every client with its projects, **Open hub** goes into one with one click, already signed in, and **People** manages each client's people and the studio's own. No client reaches it. The user never types a command: run them and send any link they must click.
9
9
 
10
10
  There is no password. Each person is named and signs in with their own one-time link. A link signs in one device, then stops working. An unused link signs in whoever opens it first, so it goes only to its person.
11
11
 
@@ -18,7 +18,7 @@ A studio runs on its owner's hosting account. Ask the owner, in one plain questi
18
18
  - **DNS:** a record `client add` adds or prints, or one `client archive` removes.
19
19
  - **Skipping a pre-flight step** with `--skip`.
20
20
 
21
- `project link`, `share`, `people` and `comments` act only inside the studio's own store, for the linked project and its client. Run them when the user asks.
21
+ `project link`, `share`, `people` and `comments` act only inside the studio's own store, for the linked project and its client, and `people --studio` for the studio's own people. Run them when the user asks.
22
22
 
23
23
  ## Signing in to Vercel
24
24
 
@@ -54,9 +54,10 @@ pnpm studio create --dir <folder outside any project> --slug <studio> --apex <do
54
54
  - `--dns cloudflare`: one record per client through Cloudflare's API. Pass `--cloudflare-token-file <file>` holding a token with DNS edit on the zone, never the token itself.
55
55
  - `--dns manual`: `client add` prints the record for the owner to add.
56
56
  - With `cloudflare` or `manual`, each client's address is public in certificate logs from the moment it is added. To keep a client's name out of them, add it with `--host <codename>`.
57
- - The first time on a team it can stop on the Upstash terms. Send the owner the message in its `fix` as written, then run it again when they say it is done.
57
+ - `--kv upstash` (the default) makes a free Upstash for Redis database. `--kv postgres` makes a free Neon Postgres database, or with `--database <name>` connects a Postgres database the team already has on Vercel (Neon or Supabase). Ask the owner which only if they named Postgres; the choice is kept in `studio.json` and never changes.
58
+ - The first time on a team it can stop on the Upstash or Neon terms. Send the owner the message in its `fix` as written, then run it again when they say it is done.
58
59
 
59
- It makes the folder, sets up the site on the team with its own database and file store, deploys it and lists it on this machine. The owner is its first Studio person. Commit the folder to a private repo if the owner wants it on another machine; its `.env` stays out of git.
60
+ It makes the folder, sets up the site on the team with its own database and file store, deploys it, adds `studio.<apex>` and lists it on this machine. The owner is its first Studio person. `link` is the owner's sign-in link on `studio.<apex>`, printed once, by the run that first finds the host answering: send it to the owner only. Until then `studioHost.state` is `waiting` with a `fix`, and `pnpm studio deploy --studio <slug>` prints the link once the host answers. Commit the folder to a private repo if the owner wants it on another machine; its `.env` stays out of git.
60
61
 
61
62
  To move the studio to a newer Design Hub: `pnpm add @milesroxas/design-hub@<version>` in its folder, then, with the owner's word, `pnpm studio deploy --studio <slug>`.
62
63
 
@@ -69,7 +70,7 @@ pnpm client add <client> --studio <studio> --name "<client name>" \
69
70
  --person "<their first person>" --team "<their company>" [--host <codename>]
70
71
  ```
71
72
 
72
- It adds the address, its DNS record (or prints it, `dns.record`, for the owner to add, then run it again), checks the address answers from this studio's site, and prints two links: one for the client's first person (`links.client`) and one for the owner on the client's address (`links.studio`). A link that shows Not found opens within a minute.
73
+ It adds the address, its DNS record (or prints it, `dns.record`, for the owner to add, then run it again), checks the address answers from this studio's site, and prints one link, for the client's first person (`links.client`). The owner needs none: the client is listed on `studio.<apex>`, and **Open hub** there signs them in on its address. A link that shows Not found opens within a minute. `pnpm client list --studio <studio>` lists every client.
73
74
 
74
75
  - How long the client's people keep access: `pnpm client access <client> --studio <studio> --access 3m|6m|open`. Without a client it is the studio's default. Absent, it is 3 months.
75
76
  - A client that has finished: with the owner's word, `pnpm client archive <client> --studio <studio>`. Run it again if it stops part way. The slug can be used again two minutes later, and starts empty.
@@ -124,7 +125,17 @@ People belong to the linked project's client. Each gets their own link, on the c
124
125
  pnpm people add --name "<name>"
125
126
  ```
126
127
 
127
- A Client is the default kind. Their team, shown beside their name, is the client's name; a Studio person's is the studio's. `--team` overrides it, only for someone outside both (a freelancer's own company). `--kind studio` makes a Studio person, who sees every client of the studio; the command says so in `notice`. Studio adds people from the People tab too (the round comments button, then **⋯**, **People**).
128
+ A Client is the default kind. Their team, shown beside their name, is the client's name; a Studio person's is the studio's. `--team` overrides it, only for someone outside both (a freelancer's own company). Studio adds people from the People tab too (the round comments button, then **⋯**, **People**), and on `studio.<apex>` with **People** beside the client.
129
+
130
+ The studio's own people sign in at `studio.<apex>` and see every client. From any project on this machine, linked or not:
131
+
132
+ ```bash
133
+ pnpm people add --name "<name>" --studio <studio> # a Studio person, their link on studio.<apex>
134
+ pnpm people --studio <studio> # the studio's people, with their ids
135
+ pnpm people link <id> --studio <studio> # a new link for one of them, the owner too
136
+ ```
137
+
138
+ `owner` in the studio folder's `studio.json` is the owner's id. A Studio person's link is on `studio.<apex>` once it answers; before then `--studio` refuses `add`, `link` and `sign-out`, changes nothing and says why (`studio_host_waiting`). In a linked project, `--kind studio`, or `add --studio` for the project's own studio, prints a `notice` that they see every client. On `studio.<apex>`, **People** under **Studio people** adds Studio people and gives another Studio person a new link; a person's own row there has no actions, so a user's own new link comes from `pnpm people link <their id> --studio <studio>` or from someone else in the studio. Use the command when the owner lost their link or wants a second device.
128
139
 
129
140
  - **A link signs in one device, then stops working.** Opening it shows who it is for and a Continue button; Continue uses it up. Why: a mail or chat preview opens links too, and must not use one up. An unused link lasts 14 days.
130
141
  - **Another device, or a link that stopped working:** `pnpm people link <id>` gives one more link. Their other devices stay signed in.
@@ -89,12 +89,12 @@ It picks a port nothing holds and no other project claims, writes it to `.env` a
89
89
 
90
90
  The user does nothing in a terminal here; each step that needs them is one link to click.
91
91
 
92
- 1. A new client, with the owner's word: `pnpm --dir <path> signin` first (signed out, it prints a `url`: send it to the user, then `pnpm --dir <path> signin --wait 300`), then `pnpm --dir <path> client add <client> --studio <studio> --name "<client name>" --person "<client's first person>" --team "<their company>"`. `links.client` is for that person only: put it in a message addressed to them, and tell the user not to open it, since it signs in whoever opens it first. `links.studio` is the studio owner's link on the client's address: it is the user's when they are the owner. `miles-deploy` has the rest.
92
+ 1. A new client, with the owner's word: `pnpm --dir <path> signin` first (signed out, it prints a `url`: send it to the user, then `pnpm --dir <path> signin --wait 300`), then `pnpm --dir <path> client add <client> --studio <studio> --name "<client name>" --person "<client's first person>" --team "<their company>"`. `links.client` is for that person only: put it in a message addressed to them, and tell the user not to open it, since it signs in whoever opens it first. It is the only link `client add` prints: the studio opens the client from `studio.<apex>`. `miles-deploy` has the rest.
93
93
  2. `pnpm --dir <path> project link --studio <studio> --client <client> --project <name>`, then commit `.design-hub/studio.json`.
94
94
  3. `pnpm --dir <path> share`. On `ok: false`, follow `stage` and `fix` (the pre-flight steps are in `miles-deploy`).
95
- 4. The user's own Studio link, unless `links.studio` was theirs: when `pnpm --dir <path> people` lists them, `pnpm --dir <path> people link <id>`; else `pnpm --dir <path> people add --name "<user>" --kind studio`.
95
+ 4. The user's own Studio link, on `studio.<apex>`, only when they have no device signed in there: when `pnpm --dir <path> people --studio <studio>` lists them, `pnpm --dir <path> people link <id> --studio <studio>`; else `pnpm --dir <path> people add --name "<user>" --studio <studio>`.
96
96
 
97
- Give the user the `address` and their own `link` in the closing message, say the link signs in one device and then stops working, that each prototype is internal until they switch it to client-facing, and that the address shows the samples until the first feature replaces them.
97
+ Give the user the `address`, and their own `link` when step 4 made one, in the closing message. Say the link signs in one device and then stops working, that `studio.<apex>` lists every client and opens this one with one click, that each prototype is internal until they switch it to client-facing, and that the address shows the samples until the first feature replaces them.
98
98
 
99
99
  ## 5. Record what was answered
100
100
 
@@ -32,7 +32,7 @@ Each thread line starts with its label and its audience: `- #I3 (internal) Ed (S
32
32
 
33
33
  - Every person is **Studio** or **Client**. Both comment, reply, edit their own words, and resolve or reopen any thread they can see. A Client sees client-facing threads only; Studio sees all, internal ones included. A thread's audience never changes: to tell the client what an internal thread says, Studio writes a new client-facing comment in the panel. Never paste internal words into a client-facing one without the user's say. Studio also deletes any comment, sorts comments and manages people; a Client deletes only their own. The studio's team are Studio; everyone on the client's side is Client, the default.
34
34
  - **Team** is the company: `Studio`, or the client's name. It shows beside every name, so a reviewer reads who said what.
35
- - People belong to the linked project's client. The studio's owner gets a link on each new client's address from `client add`; anyone else comes from `pnpm people add --name <n> [--kind studio]`, or from the People tab.
35
+ - People belong to the linked project's client. Anyone comes from `pnpm people add --name <n>`, the People tab, or **People** beside the client on `studio.<apex>`. The studio's own people sign in at `studio.<apex>` and open every client from there: `pnpm people add --name <n> --studio <studio>`, and `pnpm people link <id> --studio <studio>` for a new link.
36
36
  - A link signs in one device, then stops working; unused, it lasts 14 days. `pnpm people link <id>` gives another for another device, `sign-out <id>` ends every session and gives one new link, and `revoke <id>` ends their access everywhere within five minutes. `miles-deploy` holds the rest: access length, the handover.
37
37
  - Never paste a link into a commit, a document, a ticket or a comment. Why: whoever opens it first signs in as that person.
38
38
 
@@ -2,8 +2,11 @@
2
2
  # `studio link`; never committed or deployed. The site's Production env holds
3
3
  # the same GATE_SECRET and store names. Studios share none of these.
4
4
  GATE_SECRET=
5
+ # The database: Upstash's two names, or Postgres's (DATABASE_URL or POSTGRES_URL), never both kinds.
5
6
  KV_REST_API_URL=
6
7
  KV_REST_API_TOKEN=
8
+ DATABASE_URL=
9
+ POSTGRES_URL=
7
10
  BLOB_READ_WRITE_TOKEN=
8
11
  # Only with Cloudflare DNS: a token with DNS edit on the apex's zone.
9
12
  CLOUDFLARE_API_TOKEN=
@@ -1,8 +1,12 @@
1
1
  # A Design Hub studio site
2
2
 
3
3
  One deployment serves every client of a studio: the sign-in gate, the review
4
- API, each client's hub at `<client>.<apex>`, and every project's build at
5
- `<client>.<apex>/<project>/`, read from a private Vercel Blob store. Projects
4
+ API, each client's hub at `<client>.<apex>`, every project's build at
5
+ `<client>.<apex>/<project>/`, read from a private Vercel Blob store, and the
6
+ studio hub at `studio.<apex>`. Studio people sign in there and see every
7
+ client with its projects; Open goes into a client's hub with one click,
8
+ already signed in; and each client's people, and the studio's own, are
9
+ managed there. No client's host serves the studio hub. Projects
6
10
  stay in their own repos: each is linked to a client once (`design-hub project
7
11
  link`), and `design-hub share` run in it uploads its build here.
8
12
 
@@ -10,7 +14,7 @@ link`), and `design-hub share` run in it uploads its build here.
10
14
  | --- | --- |
11
15
  | `studio.json` | The studio's id, slug, apex, name, Vercel team and project, and DNS mode. No secrets. |
12
16
  | `proxy.ts`, `api/review.ts`, `api/files.ts` | One-line entries from `@milesroxas/design-hub/vercel`. |
13
- | `build.mjs` | Builds the client hub page and the gate's font into `dist/`. |
17
+ | `build.mjs` | Builds the client hub page, the studio hub page and the gate's font into `dist/`. |
14
18
  | `.env` | The studio's secrets, gitignored. `.env.example` names them. |
15
19
  | `pnpm-lock.yaml` | Written by the install `studio create` and `studio deploy` run here. Kept and deployed: Vercel picks its pnpm from it, and without one its install fails. |
16
20
 
@@ -25,16 +29,23 @@ design-hub studio create --dir <folder> --slug <studio> --apex <domain> \
25
29
  design-hub client add <client> --studio <studio> --name "<client name>" --person "<their name>"
26
30
  design-hub client access <client> --studio <studio> --access 3m|6m|open|studio
27
31
  design-hub client archive <client> --studio <studio>
32
+ design-hub client list --studio <studio>
28
33
  design-hub studio deploy --studio <studio> # installs and builds here, deploys, removes every older deployment
29
34
  design-hub studio link --dir <folder> # this folder on another machine
35
+ design-hub people link <your id> --studio <studio> # a new sign-in link for you, on studio.<apex>
36
+ design-hub people add --name "<name>" --studio <studio> # a Studio person, their link on studio.<apex>
30
37
  ```
31
38
 
39
+ `people` here, or with `--studio` from anywhere on the machine, is the
40
+ studio's own people: Studio people only. `people list` names each id, your
41
+ own (`owner` in `studio.json`) too.
42
+
32
43
  In a project, once its studio is listed on the machine:
33
44
 
34
45
  ```bash
35
46
  design-hub project link --studio <studio> --client <client> --project <project> # commit .design-hub/studio.json
36
47
  design-hub share # prints https://<client host>/<project>/
37
- design-hub people add --name "<name>" # a link on the client's host
48
+ design-hub people add --name "<name>" # a Client person, their link on the client's host
38
49
  ```
39
50
 
40
51
  - **DNS.** `vercel`: the apex is on Vercel's nameservers and one wildcard serves
@@ -44,24 +55,45 @@ design-hub people add --name "<name>"
44
55
  `client add` prints the record to add, then is run again. With either of the
45
56
  last two a client's host is public in certificate logs: `--host <codename>`
46
57
  keeps its name out.
58
+ - **The database.** Upstash for Redis (`--kv upstash`, the default) or
59
+ Postgres (`--kv postgres`): a new Neon database on its free plan, or any
60
+ Postgres the team has on Vercel (Neon, Supabase) with `--database <name>`.
61
+ The site finds it from its env: `KV_REST_API_URL` and `KV_REST_API_TOKEN`
62
+ for Upstash, `DATABASE_URL` or `POSTGRES_URL` for Postgres. If both kinds
63
+ are set, the site says it is not set up and every command stops: remove
64
+ the one the studio does not use. Postgres keeps everything in one table,
65
+ `design_hub_kv`, which `studio create` and `studio deploy` make. The table
66
+ is closed to every role but its owner, so a Supabase anon key reads nothing.
47
67
  - **One database per studio.** `studio create` marks the studio's database
48
68
  with the id in `studio.json`, and refuses one that is another studio's or
49
69
  already holds a studio's data, before writing to it; refused, it takes the
50
70
  database's credentials out of `.env` and disconnects it again if it
51
- connected it. Every `client` and `project` command, and `share`,
52
- `design-hub people` and `comments` in a linked project, check the mark
53
- first. `people` and `comments` do not run in this folder: they act for a
54
- linked project's client. Never connect one database to two studios
55
- (`--database` names one no studio uses).
71
+ connected it. Every `client` and `project` command, `people`, and `share`
72
+ and `comments` in a linked project, check the mark first. `comments` does
73
+ not run in this folder: it acts for a linked project's client. Never
74
+ connect one database to two studios (`--database` names one no studio
75
+ uses).
76
+ - **One file store per studio.** `studio create` marks the file store with
77
+ the same id (`studio/id.txt`), and refuses one another studio marked.
78
+ `share`, `client add` and `client archive` check it before they write or
79
+ remove a file; a store from before the mark gets it on first use.
56
80
  - **Shares.** `share` builds the project at `/<project>/`, uploads every file
57
81
  (dotfiles skipped) under a new random build id, and only then points the
58
82
  project at it, so a half-finished upload is never served; one that fails is
59
83
  removed. The live build and the two newest others are kept. The address it
60
84
  prints is the client's own host, never a deployment.
61
- - **Links.** `client add` prints one link for the client's first person and one
62
- for you, both on the client's own host. Each signs in one device, then stops
63
- working. A session works on its own client's host only, a Studio person's
64
- too, and is checked against the store again every five minutes.
85
+ - **The studio host.** `studio create` (or `studio deploy`, for a studio made
86
+ before it had one) adds `studio.<apex>`: its DNS record, its domain on the
87
+ site, and a proof that it answers as this studio. The run that first proves
88
+ it prints the owner's link there; later runs leave it alone and print none.
89
+ A new link for the owner: `people link <owner id> --studio <studio>`.
90
+ - **Links.** `client add` prints one link, for the client's first person, on
91
+ the client's own host. A Studio person's link is on `studio.<apex>` once it
92
+ answers, from `people` and from the studio hub. Each link signs in one
93
+ device, then stops working. A session works on its own host only, a Studio
94
+ person's too, and is checked against the store again every five minutes.
95
+ Open on the studio hub signs the Studio person in on the client's host with
96
+ a one-time handoff that lasts 60 seconds.
65
97
  - **Access.** A person's own length, else the client's (`client access`), else
66
98
  the studio's (`client access` with no client), else three months.
67
99
  - **Archive.** First everything of the client that can be read: its host stops
@@ -9,7 +9,7 @@
9
9
  "build": "node build.mjs"
10
10
  },
11
11
  "dependencies": {
12
- "@milesroxas/design-hub": "0.11.2",
12
+ "@milesroxas/design-hub": "0.13.0",
13
13
  "react": "^19.3.1",
14
14
  "react-dom": "^19.3.1"
15
15
  }
File without changes