create-feltkit 0.3.4 → 0.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-feltkit",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Create a FeltKit application: npm create feltkit@latest my-app (add -- --template managed for Managed FeltDB)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -214,25 +214,31 @@ without their FeltDB settings.
214
214
  `.feltkit/deploy/.env`, then run the same `docker compose` command. With your own FeltDB
215
215
  server (`--target self-hosted`), create a key for the app's namespace (`feltdb-server keys
216
216
  create --keys <keys.json> --name tasks --namespace tasks --scope state:read,state:write`) and
217
- put `FELTDB_URL` and `FELTDB_TOKEN` in `.env`. On Vercel (`--target vercel`), follow
218
- `.feltkit/deploy/DEPLOY.md`: `npx vercel link`, `npx vercel env add …` for each variable, then
219
- `npx vercel deploy --prod`, all in `.feltkit/deploy`. Either container refuses to start without its
217
+ put `FELTDB_URL` and `FELTDB_TOKEN` in `.env`. On Vercel (`--target vercel`), create the app in
218
+ Managed FeltDB (`npx feltdb init-managed --contract .feltkit/deploy/feltdb.contract.json
219
+ --runtime-scopes minimal`, which writes `.env.local`), then run `npx feltkit vercel deploy`. It links
220
+ the Vercel project the first time, uploads only the settings the deployment needs, deploys, and
221
+ signs you in: it prints the app's URL, your session token, and a one-time link to production
222
+ Studio. Either container refuses to start without its
220
223
  settings, and checks the database answers, so it never keeps data on its own disk. For
221
224
  Fly.io, plain Docker, or other hosts, follow `.feltkit/deploy/DEPLOY.md`.
222
225
 
223
226
  Open <http://localhost:3000>.
224
227
 
225
228
  4. **Sign in.** Production has no development sign-in (Ada and Grace are for development).
226
- Until you connect your own login, create a session token, *with the app stopped* (only one
227
- process may open the state), and paste it into the app's sign-in screen:
229
+ Until you connect your own login, sign in with a session token pasted into the app's sign-in
230
+ screen. On Vercel, `npx feltkit vercel deploy` printed yours. To sign in someone else (or
231
+ yourself again), run this in the project's folder:
228
232
 
229
233
  ```bash
230
234
  npx feltkit session create --env production --type user --id you --role member
231
235
  ```
232
236
 
233
- Run it in `.feltkit/deploy` for the Node run (or anywhere with the target's `FELTDB_*`
234
- variables set: then the app may keep running, since its sessions are in FeltDB). For the one-container Docker run, use a one-off container on the same
235
- volume while the app's container is stopped:
237
+ When the deployment's data is in FeltDB (Vercel, `--target hosted`, `--target self-hosted`), it
238
+ uses the deployment's settings from `.env.local` and the app keeps running; it refuses rather
239
+ than write anywhere else when they are missing. For the Node run, use `.feltkit/deploy` with
240
+ the app stopped (only one process may open its state). For the one-container Docker run, use a
241
+ one-off container on the same volume while the app's container is stopped:
236
242
 
237
243
  ```bash
238
244
  docker run --rm -v tasks-data:/data tasks node node_modules/@feltdb/feltkit/bin/feltkit.js session create --env production --type user --id you --role member
@@ -241,6 +247,11 @@ without their FeltDB settings.
241
247
  For real users, add `auth.authenticate` to `feltkit({ ... })` to verify requests with your
242
248
  identity provider.
243
249
 
250
+ 5. **Manage it.** On Vercel, production Studio is on (at `/_feltkit/` of your app). Run
251
+ `npx feltkit manage` for a one-time sign-in link, or use **Manage in production Studio** on
252
+ the Settings page of your local Studio (`npm run dev`), which also shows where production's data
253
+ is and links to the live app.
254
+
244
255
  **Production settings** (from your secret manager, never in the repository). With one
245
256
  container, none is required:
246
257
 
@@ -13,7 +13,7 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "dependencies": {
16
- "@feltdb/feltkit": "0.3.4",
16
+ "@feltdb/feltkit": "0.3.6",
17
17
  "react": "19.2.0",
18
18
  "react-dom": "19.2.0"
19
19
  },
@@ -144,7 +144,8 @@ function TokenSignIn() {
144
144
  return (
145
145
  <form className="stack" onSubmit={submit}>
146
146
  <p className="muted">
147
- Sign in with a session token. Create one on the server (with the app stopped):
147
+ Sign in with a session token. <code>npx feltkit vercel deploy</code> prints yours the first time it deploys. To make another, run this in your project's folder (it uses your
148
+ deployment's FeltDB settings from <code>.env.local</code>):
148
149
  </p>
149
150
  <code className="block">npx feltkit session create --env production --type user --id you --role member</code>
150
151
  <input type="password" value={token} onChange={(e) => setToken(e.target.value)} placeholder="Session token (fks_…)" aria-label="Session token" autoComplete="off" />
@@ -20,7 +20,7 @@
20
20
  "deploy:fly": "node scripts/deploy-fly.mjs"
21
21
  },
22
22
  "dependencies": {
23
- "@feltdb/feltkit": "0.3.4"
23
+ "@feltdb/feltkit": "0.3.6"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@feltdb/core": "0.16.1",