create-feltkit 0.3.5 → 0.3.7

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.5",
3
+ "version": "0.3.7",
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,33 +214,55 @@ 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
239
245
  ```
240
246
 
247
+ **On AppBoundry** (`npx feltkit build --target appboundry`, then `appboundry run tasks.app`),
248
+ `feltkit session create` does not apply: the artifact runs without this project or FeltKit's
249
+ CLI. AppBoundry's operators create users with your app's roles and issue their sessions:
250
+
251
+ ```bash
252
+ appboundry admin users add you --role member --state <installation>
253
+ appboundry admin sessions issue --user you --state <installation>
254
+ ```
255
+
256
+ See AppBoundry's production operations guide for bootstrapping the first operator.
257
+
241
258
  For real users, add `auth.authenticate` to `feltkit({ ... })` to verify requests with your
242
259
  identity provider.
243
260
 
261
+ 5. **Manage it.** On Vercel, production Studio is on (at `/_feltkit/` of your app). Run
262
+ `npx feltkit manage` for a one-time sign-in link, or use **Manage in production Studio** on
263
+ the Settings page of your local Studio (`npm run dev`), which also shows where production's data
264
+ is and links to the live app.
265
+
244
266
  **Production settings** (from your secret manager, never in the repository). With one
245
267
  container, none is required:
246
268
 
@@ -1,3 +1,4 @@
1
1
  node_modules/
2
2
  dist/
3
3
  .feltkit/
4
+ *.app/
@@ -13,7 +13,7 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "dependencies": {
16
- "@feltdb/feltkit": "0.3.5",
16
+ "@feltdb/feltkit": "0.3.7",
17
17
  "react": "19.2.0",
18
18
  "react-dom": "19.2.0"
19
19
  },
@@ -144,9 +144,12 @@ 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 from whoever runs this deployment. If FeltKit deployed it, <code>npx feltkit vercel deploy</code> printed yours the first time; to make another, run
148
+ this in your project's folder (it uses your 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>
151
+ <p className="muted">If AppBoundry runs this app (from its <code>.app</code> artifact), its operator creates your user and issues your session instead:</p>
152
+ <code className="block">appboundry admin sessions issue --user you --state &lt;installation&gt;</code>
150
153
  <input type="password" value={token} onChange={(e) => setToken(e.target.value)} placeholder="Session token (fks_…)" aria-label="Session token" autoComplete="off" />
151
154
  <button type="submit" disabled={!token.trim()}>
152
155
  Sign in
@@ -5,3 +5,4 @@ dist/
5
5
  .env
6
6
  .env.*
7
7
  .feltdb/
8
+ *.app/
@@ -20,7 +20,7 @@
20
20
  "deploy:fly": "node scripts/deploy-fly.mjs"
21
21
  },
22
22
  "dependencies": {
23
- "@feltdb/feltkit": "0.3.5"
23
+ "@feltdb/feltkit": "0.3.7"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@feltdb/core": "0.16.1",