@milesroxas/design-hub 0.12.0 → 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.
- package/README.md +4 -4
- package/core/review/service.test.ts +39 -38
- package/core/review/store.ts +2 -2
- package/core/review/suite-kv.ts +17 -0
- package/dist/core/review/store.js +2 -2
- package/dist/core/review/suite-kv.d.ts +7 -0
- package/dist/core/review/suite-kv.js +12 -0
- package/dist/scripts/client.js +3 -3
- package/dist/scripts/lib/cli.js +5 -0
- package/dist/scripts/lib/fake-host.d.ts +1 -2
- package/dist/scripts/lib/fake-host.js +20 -9
- package/dist/scripts/lib/host.d.ts +13 -25
- package/dist/scripts/lib/host.js +15 -324
- package/dist/scripts/lib/studio-deps.d.ts +16 -0
- package/dist/scripts/lib/studio-deps.js +41 -16
- package/dist/scripts/lib/studios.d.ts +14 -4
- package/dist/scripts/lib/studios.js +23 -5
- package/dist/scripts/lib/vercel-host.d.ts +17 -0
- package/dist/scripts/lib/vercel-host.js +410 -0
- package/dist/scripts/share.js +3 -2
- package/dist/scripts/studio.d.ts +8 -2
- package/dist/scripts/studio.js +38 -14
- package/dist/server/api.d.ts +6 -5
- package/dist/server/api.js +12 -10
- package/dist/server/gate.d.ts +97 -0
- package/dist/server/gate.js +537 -0
- package/dist/server/mark.d.ts +17 -0
- package/dist/server/mark.js +46 -1
- package/dist/server/session.d.ts +2 -1
- package/dist/server/session.js +2 -2
- package/dist/server/stores/backends.d.ts +22 -0
- package/dist/server/stores/backends.js +96 -0
- package/dist/server/{fake-upstash.js → stores/fake-upstash.js} +1 -1
- package/dist/server/stores/index.d.ts +41 -0
- package/dist/server/stores/index.js +63 -0
- package/dist/server/stores/pglite.d.ts +16 -0
- package/dist/server/stores/pglite.js +98 -0
- package/dist/server/stores/postgres.d.ts +63 -0
- package/dist/server/stores/postgres.js +153 -0
- package/dist/server/{upstash.d.ts → stores/upstash.d.ts} +1 -1
- package/dist/vercel/files.js +1 -1
- package/dist/vercel/proxy.d.ts +6 -82
- package/dist/vercel/proxy.js +18 -525
- package/dist/vite/plugin.js +1 -1
- package/package.json +3 -1
- package/skills/miles-deploy/SKILL.md +2 -1
- package/templates/studio/.env.example +3 -0
- package/templates/studio/README.md +13 -0
- package/templates/studio/package.json +1 -1
- /package/dist/server/{fake-upstash.d.ts → stores/fake-upstash.d.ts} +0 -0
- /package/dist/server/{upstash.js → stores/upstash.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milesroxas/design-hub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "The Design Hub product: the hub that lists and serves prototypes, the review panel and its API, the sign-in gate, the kit, and the design-hub CLI. A project installs it and keeps only its prototypes, kit materials and docs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -72,10 +72,12 @@
|
|
|
72
72
|
"marked": "^18.1.2",
|
|
73
73
|
"motion": "^14.6.0",
|
|
74
74
|
"postcss": "^8.5.32",
|
|
75
|
+
"postgres": "3.4.9",
|
|
75
76
|
"typescript": "^7.0.2",
|
|
76
77
|
"vite": "~8.3.5"
|
|
77
78
|
},
|
|
78
79
|
"devDependencies": {
|
|
80
|
+
"@electric-sql/pglite": "0.5.16",
|
|
79
81
|
"react": "^19.3.1",
|
|
80
82
|
"react-dom": "^19.3.1"
|
|
81
83
|
},
|
|
@@ -54,7 +54,8 @@ 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
|
-
-
|
|
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
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
|
|
|
@@ -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=
|
|
@@ -55,6 +55,15 @@ design-hub people add --name "<name>"
|
|
|
55
55
|
`client add` prints the record to add, then is run again. With either of the
|
|
56
56
|
last two a client's host is public in certificate logs: `--host <codename>`
|
|
57
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.
|
|
58
67
|
- **One database per studio.** `studio create` marks the studio's database
|
|
59
68
|
with the id in `studio.json`, and refuses one that is another studio's or
|
|
60
69
|
already holds a studio's data, before writing to it; refused, it takes the
|
|
@@ -64,6 +73,10 @@ design-hub people add --name "<name>"
|
|
|
64
73
|
not run in this folder: it acts for a linked project's client. Never
|
|
65
74
|
connect one database to two studios (`--database` names one no studio
|
|
66
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.
|
|
67
80
|
- **Shares.** `share` builds the project at `/<project>/`, uploads every file
|
|
68
81
|
(dotfiles skipped) under a new random build id, and only then points the
|
|
69
82
|
project at it, so a half-finished upload is never served; one that fails is
|
|
File without changes
|
|
File without changes
|