@fougere/app 0.5.0-alpha.1 → 0.7.0-alpha.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 (59) hide show
  1. package/dist/auth.d.ts +1 -7
  2. package/dist/auth.d.ts.map +1 -1
  3. package/dist/auth.js.map +1 -1
  4. package/dist/boot.d.ts +14 -96
  5. package/dist/boot.d.ts.map +1 -1
  6. package/dist/boot.js +19 -217
  7. package/dist/boot.js.map +1 -1
  8. package/dist/client.d.ts +5 -24
  9. package/dist/client.d.ts.map +1 -1
  10. package/dist/client.js +6 -32
  11. package/dist/client.js.map +1 -1
  12. package/dist/express.d.ts +2 -12
  13. package/dist/express.d.ts.map +1 -1
  14. package/dist/express.js +4 -52
  15. package/dist/express.js.map +1 -1
  16. package/dist/form.d.ts +11 -56
  17. package/dist/form.d.ts.map +1 -1
  18. package/dist/form.js +15 -33
  19. package/dist/form.js.map +1 -1
  20. package/dist/graphql.d.ts +2 -28
  21. package/dist/graphql.d.ts.map +1 -1
  22. package/dist/graphql.js +1 -6
  23. package/dist/graphql.js.map +1 -1
  24. package/dist/index.d.ts +3 -12
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +4 -12
  27. package/dist/index.js.map +1 -1
  28. package/dist/rest.d.ts +2 -16
  29. package/dist/rest.d.ts.map +1 -1
  30. package/dist/rest.js +4 -34
  31. package/dist/rest.js.map +1 -1
  32. package/dist/serve.d.ts +10 -57
  33. package/dist/serve.d.ts.map +1 -1
  34. package/dist/serve.js +12 -55
  35. package/dist/serve.js.map +1 -1
  36. package/dist/session.d.ts +2 -7
  37. package/dist/session.d.ts.map +1 -1
  38. package/dist/session.js +2 -7
  39. package/dist/session.js.map +1 -1
  40. package/dist/state.d.ts.map +1 -1
  41. package/dist/state.js +1 -11
  42. package/dist/state.js.map +1 -1
  43. package/dist/web.d.ts +3 -19
  44. package/dist/web.d.ts.map +1 -1
  45. package/dist/web.js +4 -32
  46. package/dist/web.js.map +1 -1
  47. package/package.json +11 -10
  48. package/src/auth.ts +1 -7
  49. package/src/boot.ts +31 -260
  50. package/src/client.ts +7 -33
  51. package/src/express.ts +4 -52
  52. package/src/form.ts +20 -73
  53. package/src/graphql.ts +2 -28
  54. package/src/index.ts +4 -12
  55. package/src/rest.ts +4 -34
  56. package/src/serve.ts +13 -60
  57. package/src/session.ts +2 -7
  58. package/src/state.ts +1 -11
  59. package/src/web.ts +4 -32
package/dist/auth.d.ts CHANGED
@@ -1,10 +1,4 @@
1
- /**
2
- * Auth accessor — reads the AuthRuntime that the core mounted on the app.
3
- *
4
- * Auth is no longer a separate singleton: it lives on `app.auth`, built once
5
- * during boot from the `auth` field of fougere.config.ts. This accessor is a
6
- * thin async helper for server code (middleware, routes, /api/me).
7
- */
1
+ /** Auth accessor — reads the AuthRuntime that the core mounted on the app. */
8
2
  import type { AuthRuntime } from '@fougere/core';
9
3
  /** Get the auth runtime resolved at boot. Throws if no `auth` was declared in fougere.config.ts. */
10
4
  export declare function useFougereAuth(): Promise<AuthRuntime>;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,oGAAoG;AACpG,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAQ3D"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,oGAAoG;AACpG,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAQ3D"}
package/dist/auth.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,oGAAoG;AACpG,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,GAAG,GAAG,MAAM,aAAa,EAAE,CAAC;IAClC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC"}
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,oGAAoG;AACpG,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,GAAG,GAAG,MAAM,aAAa,EAAE,CAAC;IAClC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC"}
package/dist/boot.d.ts CHANGED
@@ -1,71 +1,23 @@
1
- import type { App, CreateAppOptions, EntityOrm, FougereConfig, Transport } from '@fougere/core';
2
- import { type SchemaView } from '@fougere/schema';
1
+ import type { App, CreateAppOptions, FougereConfig, Transport } from '@fougere/core';
2
+ import type { ResolvedStorage } from '@fougere/defaults';
3
3
  export interface FougereServerConfig {
4
- /** Storage handle. Forwarded to the auth provider via AuthContext.db. */
5
- db?: unknown;
6
- /** Per-entity ORM factory. */
7
- ormFactory?: (entity: SchemaView, name: string) => EntityOrm;
8
4
  /**
9
- * What this app takes on beyond its fronds, each stating what it does and what it undoes.
10
- *
11
- * It replaced `afterBoot`, which a host used to CLAIM the whole post-boot to get its own
12
- * seeding — Nuxt's generated plugin did exactly that, and its copy of the seeding loop
13
- * drifted. Declaring `{ name: 'seeds', up }` replaces that one member and leaves the
14
- * rest of the ascent alone.
5
+ * The whole data layer, as `resolveStorage` composed it where the rows are, which source
6
+ * transacts, what to close. Handed over as ONE subject: a host that passed the factory alone
7
+ * lost the transaction and the connection's owner, and nothing said so.
15
8
  */
9
+ storage?: ResolvedStorage;
10
+ /** What this app takes on beyond its fronds, each stating what it does and what it undoes. */
16
11
  extensions?: CreateAppOptions['extensions'];
17
- /**
18
- * What the boot line names as the host — 'Nuxt/Nitro', 'Next'. Stated by the
19
- * adapter, never sniffed: a boot that guesses its host from what happens to be
20
- * importable is the hidden runtime the doctrine refuses.
21
- */
12
+ /** What the boot line names as the host — 'Nuxt/Nitro', 'Next'. */
22
13
  host?: string;
23
- /**
24
- * What this app is built from, when the host already knows.
25
- *
26
- * Absent, `boot()` reads the fronds off the disk — right on a server, impossible on a
27
- * runtime that has none: measured on workerd, `readdir` throws through unenv's shim and
28
- * the app comes up with ZERO fronds, so every page renders and every door answers
29
- * NOT_FOUND. A host that scanned at BUILD time can say so instead, and `fougere build`
30
- * writes exactly this value down.
31
- *
32
- * Same slot as `CreateAppOptions.scan` and for the same reason: producing the value
33
- * reads a disk, consuming it does not.
34
- */
14
+ /** What this app is built from, when the host already knows. */
35
15
  scan?: CreateAppOptions['scan'];
36
- /**
37
- * What this app STATES it hosts — `frond('blog', { entities: [Post] })`.
38
- *
39
- * Stating this and no `scan` is how a host stops scanning at boot: nothing reads a
40
- * disk, nothing loads `typescript`, and what was not named does not exist. It is the
41
- * one door Next, Vite, React, Svelte and a bare Express share — none of them scans on
42
- * its own, they all arrive here, and this line used to end in a scan for every one.
43
- */
16
+ /** What this app STATES it hosts — `frond('blog', { entities: [Post] })`. */
44
17
  fronds?: CreateAppOptions['fronds'];
45
- /**
46
- * What `fougere.config.ts` says, when the host already read it.
47
- *
48
- * The same rule as `scan`, and found the same way: `boot()` re-reads the file at
49
- * runtime, which a Worker cannot do — measured, a consumer's `remotes:` never reached
50
- * the boot and its pages rendered empty with nothing said. A host that read the config
51
- * at BUILD time states it here instead.
52
- *
53
- * `auth` is deliberately not part of what a codegen'd host can carry: it holds a live
54
- * provider, not a value. An app that authenticates reads its own config.
55
- */
18
+ /** What `fougere.config.ts` says, when the host already read it. */
56
19
  config?: Partial<FougereConfig>;
57
- /**
58
- * Who performs an outgoing call, when the default cannot.
59
- *
60
- * `boot()` builds an HTTP transport from `remotes:` and that is right nearly
61
- * everywhere. It is not right on Cloudflare: a Worker calling a sibling's public URL
62
- * is refused by the edge with error 1042, so two Workers of one account reach each
63
- * other through a SERVICE BINDING and through nothing else. A binding is a value only
64
- * the host holds, so only the host can state this.
65
- *
66
- * It replaces the default entirely — signing included, since a host that builds its
67
- * own transport is the one that knows what to put on the wire.
68
- */
20
+ /** Who performs an outgoing call, when the default cannot. */
69
21
  remoteTransport?: (url: string) => Transport;
70
22
  }
71
23
  /**
@@ -73,44 +25,10 @@ export interface FougereServerConfig {
73
25
  * setup based on `config.db` in fougere.config.ts.
74
26
  */
75
27
  export declare function configureFougere(config: FougereServerConfig): void;
76
- /**
77
- * Add to what is already stated, instead of replacing it.
78
- *
79
- * A host states its app in PIECES when the pieces are known at different moments: a
80
- * build writes the scan and the config into a generated plugin, and a value only the
81
- * running process holds — a Cloudflare service binding — cannot be written there at all.
82
- * Its dual is `configureFougere`, which replaces; `reloadFougere` depends on that
83
- * replacement, so merging silently would have broken the turn of the ring.
84
- */
28
+ /** Add to what is already stated, instead of replacing it. */
85
29
  export declare function extendFougere(config: Partial<FougereServerConfig>): void;
86
30
  /** Get the booted Fougere app. Lazy — boots on first call, then caches. */
87
31
  export declare function useFougereApp(): Promise<App>;
88
- /**
89
- * Turn the ring: instantiate the app again, then let the previous one go.
90
- *
91
- * This is what "reload" means for anything the config CONSUMED — a value that built
92
- * something cannot move under what it built, so the thing is built again. Its dual is
93
- * `applyConfig`, for values that are merely consulted and need no turn at all.
94
- *
95
- * Every door reaches the app through `useFougereApp()` inside the request it serves and
96
- * none holds it across two, which is what makes the swap invisible: the next request
97
- * lands on the new app whether or not the old one has finished being released.
98
- *
99
- * A call already running finishes on the OLD app: it is drained before being released,
100
- * so nothing has its storage closed underneath it. `timeoutMs` bounds that wait, and a
101
- * drain that runs out REJECTS — the app is left alone rather than released under work,
102
- * because a caller who cannot wait must choose that on purpose.
103
- */
32
+ /** Turn the ring. */
104
33
  export declare function reloadFougere(timeoutMs?: number): Promise<App>;
105
- /**
106
- * The store an app with no `db` runs on.
107
- *
108
- * It used to ignore both its arguments — `(_entity, _name)` — so it forced the field
109
- * name `id`, minted a uuid whatever the entity declared, and realized none of the
110
- * lifecycle rules: `created()` stamped nothing, a declared default stayed absent. The
111
- * same page therefore behaved one way here and another way on SQLite.
112
- *
113
- * It reads the axes now, through the one realization every storage shares.
114
- */
115
- export declare function createMemoryOrm(entity: SchemaView, name: string): EntityOrm;
116
34
  //# sourceMappingURL=boot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI5E,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,8BAA8B;IAC9B,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC;IAC7D;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC5C;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa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,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;CAC9C;AASD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,QAG3D;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,QAGjE;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,CAK5C;AAED,qBAAqB;AACrB,wBAAsB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAWpE"}
package/dist/boot.js CHANGED
@@ -1,27 +1,8 @@
1
- import { Role } from '@fougere/schema';
2
- import { Lifecycle } from '@fougere/schema';
3
- /**
4
- * Fougere server bootstrap — single entry point for an app's lifecycle,
5
- * whatever hosts it.
6
- *
7
- * Nothing here knows h3, Nitro, Vue or React: a boot reads `fougere.config.ts`,
8
- * scans fronds off the filesystem and hands back an `App`. That is why it lives
9
- * in `@fougere/app` rather than in one of the two adapters — the second host
10
- * would otherwise have copied it, and a copied boot drifts (the seeding loop
11
- * already did, `core/src/boot/seed.ts`).
12
- *
13
- * Default path (zero-config): fougere.config.ts declares `db: 'sqlite'` and
14
- * everything else; this module auto-resolves the storage handle, builds an
15
- * ormFactory, runs auto-DDL from the entities, and boots the app.
16
- *
17
- * Escape hatch: `configureFougere({ db, ormFactory })` can be called from the
18
- * host's own startup (a Nitro plugin, a Next instrumentation hook) if the user
19
- * wants a custom data layer — alternative driver, managed migrations, etc.
20
- */
1
+ /** Fougere server bootstrap single entry point for an app's lifecycle, whatever hosts it. */
21
2
  import { createApp, identityFromEnv, Logger, migrating, seeding } from '@fougere/core';
22
3
  import { scanProject, loadCascadedConfig, setModuleLoader, frondAliases, resolveConventions } from '@fougere/core/node';
23
4
  import { createContainer } from '@fougere/container';
24
- import { applyCreate, applyUpdate } from '@fougere/schema';
5
+ import { createMemoryStorage } from '@fougere/adapter-memory';
25
6
  // ── State ────────────────────────────────────────
26
7
  let _config = {};
27
8
  let _appPromise = null;
@@ -34,15 +15,7 @@ export function configureFougere(config) {
34
15
  _config = config;
35
16
  _appPromise = null;
36
17
  }
37
- /**
38
- * Add to what is already stated, instead of replacing it.
39
- *
40
- * A host states its app in PIECES when the pieces are known at different moments: a
41
- * build writes the scan and the config into a generated plugin, and a value only the
42
- * running process holds — a Cloudflare service binding — cannot be written there at all.
43
- * Its dual is `configureFougere`, which replaces; `reloadFougere` depends on that
44
- * replacement, so merging silently would have broken the turn of the ring.
45
- */
18
+ /** Add to what is already stated, instead of replacing it. */
46
19
  export function extendFougere(config) {
47
20
  _config = { ..._config, ...config };
48
21
  _appPromise = null;
@@ -54,22 +27,7 @@ export function useFougereApp() {
54
27
  }
55
28
  return _appPromise;
56
29
  }
57
- /**
58
- * Turn the ring: instantiate the app again, then let the previous one go.
59
- *
60
- * This is what "reload" means for anything the config CONSUMED — a value that built
61
- * something cannot move under what it built, so the thing is built again. Its dual is
62
- * `applyConfig`, for values that are merely consulted and need no turn at all.
63
- *
64
- * Every door reaches the app through `useFougereApp()` inside the request it serves and
65
- * none holds it across two, which is what makes the swap invisible: the next request
66
- * lands on the new app whether or not the old one has finished being released.
67
- *
68
- * A call already running finishes on the OLD app: it is drained before being released,
69
- * so nothing has its storage closed underneath it. `timeoutMs` bounds that wait, and a
70
- * drain that runs out REJECTS — the app is left alone rather than released under work,
71
- * because a caller who cannot wait must choose that on purpose.
72
- */
30
+ /** Turn the ring. */
73
31
  export async function reloadFougere(timeoutMs) {
74
32
  const previous = _appPromise;
75
33
  _appPromise = null;
@@ -124,33 +82,16 @@ async function boot() {
124
82
  // Auto-resolve the data layer from config.db when the user didn't provide a
125
83
  // custom one via configureFougere. The resolution itself lives in @fougere/defaults
126
84
  // — this host must not know which storage package backs `db:`.
127
- let db = _config.db;
128
- let ormFactory = _config.ormFactory;
129
- // The storage's two halves, kept together: its ascent is an extension, its connection
130
- // is not — it is opened here, before the container, so it closes after the container.
131
- let storageMigrate;
132
- let closeStorage;
133
- // Where the rows are, and how to open a transaction there — read from the same storage
134
- // resolution, because a frame's realization is decided by `sources:` and nothing else.
135
- let sourceOf;
136
- let transacted;
137
- if (!ormFactory) {
85
+ let storage = _config.storage;
86
+ if (!storage) {
138
87
  const { resolveStorage } = await import('@fougere/defaults');
139
- const storage = resolveStorage(fileConfig.db, fileConfig.sources);
140
- if (storage.ormFactory) {
141
- log.debug('auto-resolving storage from config.db');
142
- db = storage.db;
143
- ormFactory = storage.ormFactory;
144
- sourceOf = storage.sourceOf;
145
- transacted = storage.transacted;
146
- storageMigrate = storage.migrate;
147
- closeStorage = storage.close;
148
- }
149
- else {
150
- log.debug('no db declared — falling back to in-memory ORM');
151
- ormFactory = createMemoryOrm;
152
- }
88
+ storage = resolveStorage(fileConfig.db, fileConfig.sources);
89
+ log.debug(storage.storageFactory ? 'auto-resolving storage from config.db' : 'no db declared — falling back to in-memory storage');
153
90
  }
91
+ // The storage's two halves, kept together: its ascent is an extension, its connection
92
+ // is not — it is opened here, before the container, so it closes after the container.
93
+ const storageFactory = storage.storageFactory ?? createMemoryStorage;
94
+ const storageMigrate = storage.migrate;
154
95
  // Layer-2 wiring: `remotes: { catalog: 'http://...' }` in fougere.config.ts
155
96
  // is all the user writes — the default transport comes from here.
156
97
  // The host's word wins here too — and where it speaks, nothing below runs: building
@@ -180,19 +121,16 @@ async function boot() {
180
121
  ? { scan: await scanProject(root, undefined, conventions) }
181
122
  : {}),
182
123
  createContainer,
183
- ormFactory,
184
- sourceOf,
185
- transacted,
186
- db,
124
+ storageFactory,
125
+ sourceOf: storage.sourceOf,
126
+ transacts: storage.transacts,
127
+ transacted: storage.transacted,
128
+ db: storage.db,
187
129
  auth: fileConfig.auth,
188
130
  adapters: fileConfig.adapters,
189
131
  remotes: fileConfig.remotes,
190
132
  remoteTransport,
191
- /**
192
- * The whole ascent, one ordered list: tables, then rows, then what the host adds.
193
- * A host wanting its OWN seeding declares `{ name: 'seeds', … }` and replaces that
194
- * member — it no longer has to claim everything after the boot to get it.
195
- */
133
+ /** The whole ascent, one ordered list. */
196
134
  extensions: [
197
135
  // The slot is declared even when this host resolved no storage — a host that resolved
198
136
  // its own (the Nitro plugin does, for its bundler) then REPLACES this member in place
@@ -204,147 +142,11 @@ async function boot() {
204
142
  // Opened before the container, so released after it. Never wired here until now:
205
143
  // this host boots the storage and no host closed one, which is what made a reload
206
144
  // leak the pool of every app it discarded.
207
- onDispose: closeStorage,
145
+ onDispose: storage.close,
208
146
  });
209
147
  log.info(`ascent: ${app.extensions().join(' → ') || 'nothing declared'}`);
210
148
  const ms = (performance.now() - bootStart).toFixed(0);
211
149
  log.info(`ready in ${ms}ms — ${app.fronds.length} frond(s)${app.auth ? ` + auth (${app.auth.basePath})` : ''}`);
212
150
  return app;
213
151
  }
214
- // ── Fallback ORM ─────────────────────────────────
215
- /**
216
- * The store an app with no `db` runs on.
217
- *
218
- * It used to ignore both its arguments — `(_entity, _name)` — so it forced the field
219
- * name `id`, minted a uuid whatever the entity declared, and realized none of the
220
- * lifecycle rules: `created()` stamped nothing, a declared default stayed absent. The
221
- * same page therefore behaved one way here and another way on SQLite.
222
- *
223
- * It reads the axes now, through the one realization every storage shares.
224
- */
225
- export function createMemoryOrm(entity, name) {
226
- const fields = entity.getFields();
227
- const pk = Object.entries(fields).find(([, field]) => Role.of(field).isPrimary)?.[0] ?? 'id';
228
- const store = new Map();
229
- // `EntityOrm.findById(id: string)` — but a key can hold a number, and a Map keyed on
230
- // `1` does not answer `'1'`. SQL never had the question; here the divergence was
231
- // silent and only on this storage.
232
- const keyOf = (value) => String(value);
233
- // Same contract as SQL: a criterion may name a SET, and an empty set matches nothing.
234
- const matches = (row, criteria) => Object.entries(criteria).every(([key, value]) => Array.isArray(value)
235
- ? value.some((v) => Object.is(row[key], v))
236
- : Object.is(row[key], value));
237
- return {
238
- client: store,
239
- async list(options) {
240
- let items = [...store.values()];
241
- if (options?.where)
242
- items = items.filter((row) => matches(row, options.where));
243
- // Held before the page is cut, and after the filter: `total` answers "how many
244
- // match", which is what a paginator divides. Reading `store.size` at the end
245
- // answered a different question — every row the store holds, including the ones
246
- // the filter exists to keep out of this caller's sight.
247
- const matching = items.length;
248
- const limit = options?.limit;
249
- const offset = options?.page && limit ? (options.page - 1) * limit : options?.offset ?? 0;
250
- if (offset > 0)
251
- items = items.slice(offset);
252
- const hasMore = limit ? items.length > limit : false;
253
- if (limit)
254
- items = items.slice(0, limit);
255
- const result = items;
256
- result.hasMore = hasMore;
257
- result.endCursor = items.length > 0 ? String(items[items.length - 1][pk] ?? '') : undefined;
258
- if (options?.count)
259
- result.total = matching;
260
- return result;
261
- },
262
- async findById(id) { return store.get(keyOf(id)); },
263
- async findBy(criteria) {
264
- return [...store.values()].find((row) => matches(row, criteria));
265
- },
266
- async findAllBy(criteria) {
267
- return [...store.values()].filter((row) => matches(row, criteria));
268
- },
269
- // Same contract as SQL: a map keyed by the primary key, a miss being an absent key.
270
- async findByKeys(ids) {
271
- const found = new Map();
272
- for (const id of ids) {
273
- const row = store.get(keyOf(id));
274
- if (row)
275
- found.set(String(id), row);
276
- }
277
- return found;
278
- },
279
- // The dual, same contract as SQL: grouped by the value read off the ROW.
280
- async findAllByKeys(field, keys) {
281
- const grouped = new Map();
282
- if (keys.length === 0)
283
- return grouped;
284
- const wanted = new Set(keys.map(String));
285
- for (const row of store.values()) {
286
- const key = String(row[field]);
287
- if (!wanted.has(key))
288
- continue;
289
- const held = grouped.get(key);
290
- if (held)
291
- held.push(row);
292
- else
293
- grouped.set(key, [row]);
294
- }
295
- return grouped;
296
- },
297
- // Same contract as SQL: the key and the creation stamps survive an overwrite.
298
- async upsert(input) {
299
- const record = applyCreate(fields, applyUpdate(fields, input));
300
- const id = record[pk];
301
- if (id === undefined)
302
- throw new Error(`${name}.upsert(): no \`${pk}\` — an upsert needs the key it writes at.`);
303
- const held = store.get(keyOf(id));
304
- if (held) {
305
- for (const [key, field] of Object.entries(fields)) {
306
- if (key === pk || Lifecycle.of(field).stampedOnce)
307
- record[key] = held[key];
308
- }
309
- }
310
- store.set(keyOf(id), record);
311
- return record;
312
- },
313
- async upsertAll(inputs) {
314
- for (const input of inputs)
315
- await this.upsert(input);
316
- return inputs.length;
317
- },
318
- async create(input) {
319
- const record = applyCreate(fields, input);
320
- const id = record[pk];
321
- // `primary(text())` declares no generator, so nothing fills the hole and the
322
- // caller has to. Keying on `undefined` would let the second create overwrite the
323
- // first, in silence — the old version hid this by inventing an `id` field the
324
- // entity never declared.
325
- if (id === undefined) {
326
- throw new Error(`${name}.create: '${pk}' is the primary key and nothing supplied it — this entity declares no generator for it.`);
327
- }
328
- // A create is not an upsert. `Map.set` overwrites, so a second create under the
329
- // same key answered "created" while destroying the previous row — SQL answers a
330
- // constraint violation, and a store that loses data silently is worse than one
331
- // that fails.
332
- if (store.has(keyOf(id))) {
333
- throw new Error(`${name}.create: '${pk}' ${JSON.stringify(id)} already exists.`);
334
- }
335
- store.set(keyOf(id), record);
336
- return record;
337
- },
338
- async update(id, input) {
339
- const existing = store.get(keyOf(id));
340
- if (!existing)
341
- throw new Error(`Not found: ${id}`);
342
- const updated = { ...existing, ...applyUpdate(fields, input), [pk]: existing[pk] };
343
- store.set(keyOf(id), updated);
344
- return updated;
345
- },
346
- async delete(id) { return store.delete(keyOf(id)); },
347
- output(_schema) { return this; },
348
- };
349
- }
350
152
  //# sourceMappingURL=boot.js.map
package/dist/boot.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,WAAW,E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Q;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,UAAU,EAAE,OAAO,CAAC,UAAmB;QACvC,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,eAAe;QACf,0CAA0C;QAC1C,UAAU,EAAE;YACV,sFAAsF;YACtF,sFAAsF;YACtF,sEAAsE;YACtE,SAAS,CAAC,cAAc,CAAC;YACzB,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;YAClD,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;SAC9B;QACD,iFAAiF;QACjF,kFAAkF;QAClF,2CAA2C;QAC3C,SAAS,EAAE,OAAO,CAAC,KAAK;KACzB,CAAC,CAAC;IAEH,GAAG,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC;IAE1E,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtD,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,CAAC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEhH,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/client.d.ts CHANGED
@@ -1,17 +1,6 @@
1
1
  /**
2
- * The couple, minus the reactivity — everything `useQuery`/`useCommand` decide
3
- * before a framework's state primitives get involved.
4
- *
5
- * Designation is class + verb: the imported entity class carries the metadata,
6
- * its name carries the registration key. That is true in Vue and in React, and so
7
- * is the link — a successful command on an entity revalidates every mounted query
8
- * on that entity, because the entity is designated on both sides and nothing has
9
- * to be declared. What differs between hosts is only HOW a value becomes reactive
10
- * and how a revalidation is triggered, which is ~50 lines each and belongs to them.
11
- *
12
- * Browser-safe by construction: this module reaches `@fougere/core/contract` and
13
- * the transport's client subpath, never the boot. `@fougere/app/client` is the
14
- * subpath that keeps it that way.
2
+ * The couple, minus the reactivity — everything `useQuery`/`useCommand` decide before a
3
+ * framework's state primitives get involved.
15
4
  */
16
5
  import { FougereError, type InvocationContext, type FrondCall } from '@fougere/core/contract';
17
6
  /** An entity class is a designation: its name is the registration key. */
@@ -19,7 +8,7 @@ export type EntityClass = {
19
8
  name: string;
20
9
  };
21
10
  /** What a page provides of an invocation — the rest is stamped server-side. */
22
- export type CallInput = Partial<Pick<InvocationContext, 'params' | 'query' | 'body'>>;
11
+ export type CallInput = Partial<Pick<InvocationContext, 'params' | 'query' | 'input'>>;
23
12
  /** The one door the browser knows. A named surface adds `/{surface}` to it. */
24
13
  export declare const CALL_ENDPOINT = "/_fougere/call";
25
14
  export type Fetcher = <T>(url: string, options: {
@@ -30,11 +19,7 @@ export type Fetcher = <T>(url: string, options: {
30
19
  export declare function entityKeyOf(entity: EntityClass): string;
31
20
  export declare function callOf(entity: EntityClass, op: string): FrondCall;
32
21
  export declare function invocationOf(input?: CallInput): InvocationContext;
33
- /**
34
- * The cache key of a read. Same designation and same input means the same key —
35
- * which is what lets two components asking the same thing share one request, and
36
- * what the command side matches against to revalidate.
37
- */
22
+ /** The cache key of a read. */
38
23
  export declare function queryKeyOf(entityKey: string, op: string, input?: CallInput): string;
39
24
  export declare function sendCall(fetcher: Fetcher, call: FrondCall, invocation: InvocationContext, endpoint?: string): Promise<unknown>;
40
25
  /** Register a mounted read. Returns the unregistration, for the host's scope teardown. */
@@ -53,11 +38,7 @@ export declare function pageOf(data: unknown): {
53
38
  hasMore?: boolean;
54
39
  endCursor?: string;
55
40
  };
56
- /**
57
- * Whatever failed, as the error the primitives promise. A transport failure is not
58
- * a domain refusal, so it arrives under SERVICE_UNAVAILABLE rather than borrowing a
59
- * code the server never sent.
60
- */
41
+ /** Whatever failed, as the error the primitives promise. */
61
42
  export declare function asFougereError(err: unknown, entityKey: string, op: string): FougereError;
62
43
  export { formFieldsOf, tableColumnsOf, payloadOf, errorsByField, type FormEntity, type FormField, type TableColumn, } from './form.js';
63
44
  export { sessionViewOf, type SessionView } from './session.js';
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,YAAY,EAGZ,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAC;AAGhC,0EAA0E;AAC1E,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,+EAA+E;AAC/E,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;AAEtF,+EAA+E;AAC/E,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAIjG,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAEvD;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CAEjE;AAED,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,iBAAiB,CAEjE;AAED;;;;GAIG;AACH,wBAAgB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0F;AAC1F,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,IAAI,CAKrE;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvD;AAKD,qEAAqE;AACrE,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAKlE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAE/C;AAED,yFAAyF;AACzF,eAAO,MAAM,OAAO,EAAE,OAOrB,CAAC;AAIF,yFAAyF;AACzF,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC,EAAE,CAM7C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAE/F;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAUxF;AAKD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,SAAS,EACT,aAAa,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC"}
package/dist/client.js CHANGED
@@ -1,17 +1,6 @@
1
1
  /**
2
- * The couple, minus the reactivity — everything `useQuery`/`useCommand` decide
3
- * before a framework's state primitives get involved.
4
- *
5
- * Designation is class + verb: the imported entity class carries the metadata,
6
- * its name carries the registration key. That is true in Vue and in React, and so
7
- * is the link — a successful command on an entity revalidates every mounted query
8
- * on that entity, because the entity is designated on both sides and nothing has
9
- * to be declared. What differs between hosts is only HOW a value becomes reactive
10
- * and how a revalidation is triggered, which is ~50 lines each and belongs to them.
11
- *
12
- * Browser-safe by construction: this module reaches `@fougere/core/contract` and
13
- * the transport's client subpath, never the boot. `@fougere/app/client` is the
14
- * subpath that keeps it that way.
2
+ * The couple, minus the reactivity — everything `useQuery`/`useCommand` decide before a
3
+ * framework's state primitives get involved.
15
4
  */
16
5
  import { FougereError, ErrorCode, lowerFirst, } from '@fougere/core/contract';
17
6
  import { frameCall, unframeResponse } from '@fougere/transport-http/client';
@@ -26,13 +15,9 @@ export function callOf(entity, op) {
26
15
  return { entity: entityKeyOf(entity), op };
27
16
  }
28
17
  export function invocationOf(input) {
29
- return { params: {}, query: {}, body: undefined, state: {}, ...input };
18
+ return { params: {}, query: {}, input: undefined, state: {}, ...input };
30
19
  }
31
- /**
32
- * The cache key of a read. Same designation and same input means the same key —
33
- * which is what lets two components asking the same thing share one request, and
34
- * what the command side matches against to revalidate.
35
- */
20
+ /** The cache key of a read. */
36
21
  export function queryKeyOf(entityKey, op, input) {
37
22
  return `fougere:${entityKey}.${op}:${JSON.stringify(input ?? {})}`;
38
23
  }
@@ -57,14 +42,7 @@ export function trackQuery(entityKey, key) {
57
42
  export function mountedKeys(entityKey) {
58
43
  return [...(mounted.get(entityKey) ?? [])];
59
44
  }
60
- /**
61
- * `mountedKeys` says WHICH reads a command invalidates; these say how to make one
62
- * happen. Both halves turned out to be host-independent — Nuxt is the exception,
63
- * because `refreshNuxtData` already is this registry.
64
- *
65
- * They lived in `@fougere/react` until a second non-Nuxt client needed them, which
66
- * is when it became visible that nothing in them is React.
67
- */
45
+ /** `mountedKeys` says WHICH reads a command invalidates; these say how to make one happen. */
68
46
  const refetchers = new Map();
69
47
  /** Register a mounted read's refetch. Returns the unregistration. */
70
48
  export function onRefetch(key, run) {
@@ -100,11 +78,7 @@ export function itemsOf(data) {
100
78
  export function pageOf(data) {
101
79
  return (data ?? {});
102
80
  }
103
- /**
104
- * Whatever failed, as the error the primitives promise. A transport failure is not
105
- * a domain refusal, so it arrives under SERVICE_UNAVAILABLE rather than borrowing a
106
- * code the server never sent.
107
- */
81
+ /** Whatever failed, as the error the primitives promise. */
108
82
  export function asFougereError(err, entityKey, op) {
109
83
  return err instanceof FougereError
110
84
  ? err
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,YAAY,EACZ,SAAS,EACT,UAAU,GAGX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAoB,MAAM,gCAAgC,CAAC;AAQ9F,+EAA+E;AAC/E,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAI9C,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,uDAAuD;AACvD,MAAM,UAAU,WAAW,CAAC,MAAmB;IAC7C,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,MAAmB,EAAE,EAAU;IACpD,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAiB;IAC5C,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC;AACzE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB,EAAE,EAAU,EAAE,KAAiB;IACzE,OAAO,WAAW,SAAS,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;AACrE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,OA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