@fougere/nuxt 0.3.0-alpha.0 → 0.5.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 (60) hide show
  1. package/README.md +1 -1
  2. package/dist/module.d.ts +29 -2
  3. package/dist/module.d.ts.map +1 -1
  4. package/dist/module.js +91 -34
  5. package/dist/module.js.map +1 -1
  6. package/dist/runtime/composables/useCurrentUser.d.ts +8 -0
  7. package/dist/runtime/composables/useCurrentUser.d.ts.map +1 -0
  8. package/dist/runtime/composables/useCurrentUser.js +21 -0
  9. package/dist/runtime/composables/useCurrentUser.js.map +1 -0
  10. package/dist/runtime/composables/useFormFor.d.ts +27 -0
  11. package/dist/runtime/composables/useFormFor.d.ts.map +1 -0
  12. package/dist/runtime/composables/useFormFor.js +76 -0
  13. package/dist/runtime/composables/useFormFor.js.map +1 -0
  14. package/dist/runtime/composables/useFougereData.d.ts +21 -0
  15. package/dist/runtime/composables/useFougereData.d.ts.map +1 -0
  16. package/dist/runtime/composables/useFougereData.js +74 -0
  17. package/dist/runtime/composables/useFougereData.js.map +1 -0
  18. package/dist/runtime/plugins/session.server.d.ts +3 -0
  19. package/dist/runtime/plugins/session.server.d.ts.map +1 -0
  20. package/dist/runtime/plugins/session.server.js +13 -0
  21. package/dist/runtime/plugins/session.server.js.map +1 -0
  22. package/dist/runtime/server/api/crud.d.ts +3 -0
  23. package/dist/runtime/server/api/crud.d.ts.map +1 -0
  24. package/dist/runtime/server/api/crud.js +46 -0
  25. package/dist/runtime/server/api/crud.js.map +1 -0
  26. package/dist/runtime/server/auth/middleware/auth.d.ts +7 -0
  27. package/dist/runtime/server/auth/middleware/auth.d.ts.map +1 -0
  28. package/dist/runtime/server/auth/middleware/auth.js +32 -0
  29. package/dist/runtime/server/auth/middleware/auth.js.map +1 -0
  30. package/dist/runtime/server/auth/routes/api/me.get.d.ts +5 -0
  31. package/dist/runtime/server/auth/routes/api/me.get.d.ts.map +1 -0
  32. package/dist/runtime/server/auth/routes/api/me.get.js +10 -0
  33. package/dist/runtime/server/auth/routes/api/me.get.js.map +1 -0
  34. package/dist/runtime/server/auth/routes/auth/[...].d.ts +3 -0
  35. package/dist/runtime/server/auth/routes/auth/[...].d.ts.map +1 -0
  36. package/dist/runtime/server/auth/routes/auth/[...].js +8 -0
  37. package/dist/runtime/server/auth/routes/auth/[...].js.map +1 -0
  38. package/dist/runtime/server/routes/call.post.d.ts +3 -0
  39. package/dist/runtime/server/routes/call.post.d.ts.map +1 -0
  40. package/dist/runtime/server/routes/call.post.js +125 -0
  41. package/dist/runtime/server/routes/call.post.js.map +1 -0
  42. package/dist/runtime/server/routes/session.get.d.ts +3 -0
  43. package/dist/runtime/server/routes/session.get.d.ts.map +1 -0
  44. package/dist/runtime/server/routes/session.get.js +9 -0
  45. package/dist/runtime/server/routes/session.get.js.map +1 -0
  46. package/dist/runtime/server/utils/boot.d.ts +13 -0
  47. package/dist/runtime/server/utils/boot.d.ts.map +1 -0
  48. package/dist/runtime/server/utils/boot.js +13 -0
  49. package/dist/runtime/server/utils/boot.js.map +1 -0
  50. package/dist/runtime/server/utils/invoke.d.ts +9 -0
  51. package/dist/runtime/server/utils/invoke.d.ts.map +1 -0
  52. package/dist/runtime/server/utils/invoke.js +24 -0
  53. package/dist/runtime/server/utils/invoke.js.map +1 -0
  54. package/package.json +7 -7
  55. package/src/module.ts +501 -0
  56. package/src/runtime/composables/useFormFor.ts +2 -2
  57. package/src/runtime/composables/useFougereData.ts +11 -1
  58. package/src/runtime/server/auth/routes/auth/[...].ts +1 -1
  59. package/src/runtime/server/routes/call.post.ts +1 -1
  60. package/src/shims.d.ts +7 -0
package/README.md CHANGED
@@ -14,4 +14,4 @@ pnpm add @fougere/nuxt
14
14
 
15
15
  Part of [Fougere](https://github.com/chok/fougere) — one schema, a gradient from
16
16
  monolith to distributed, the same user code.
17
- Reference documentation: [the site](https://chok.github.io/fougere/) (en/fr).
17
+ Reference documentation: [the site](https://fougere.dev/) (en/fr).
package/dist/module.d.ts CHANGED
@@ -8,10 +8,37 @@ export interface FougereModuleOptions {
8
8
  * fronds are shared at the root. Config and `.fougere` stay app-local.
9
9
  */
10
10
  root?: string;
11
+ /**
12
+ * One key per EXTENSION, and the key is the package suffix AND the export name —
13
+ * `calls` is `import { calls } from '@fougere/calls'`. So the module holds no table to
14
+ * keep in step with the packages, the same rule the scan applies to `@fronds/<name>`.
15
+ *
16
+ * An extension is a FUNCTION and this module writes a FILE, so a project cannot pass one
17
+ * here: it names one, and the options travel beside it as data.
18
+ *
19
+ * The keys are declared rather than left open on purpose. An open record would derive
20
+ * everything and accept `callz: {}` in silence — the failure this repo already records
21
+ * for `adapters:`, which "fails OPEN, giving neither completion nor a guard". The price
22
+ * is that a new extension package adds a key here.
23
+ */
24
+ /** `@fougere/observability` — a span per operation, the four signals, OTLP. */
25
+ observability?: Record<string, unknown> | false;
26
+ /** `@fougere/calls` — the dev panel: a bounded log of what this process dispatched. */
27
+ calls?: Record<string, unknown> | false;
11
28
  }
29
+ /** What the project asked for, in mount order. `false` is how a key is turned off. */
30
+ export declare function extensionsOf(options: FougereModuleOptions): {
31
+ key: string;
32
+ options: unknown;
33
+ }[];
12
34
  declare const module: import("@nuxt/schema").NuxtModule<FougereModuleOptions, FougereModuleOptions, false>;
13
35
  export default module;
14
36
  export declare function generateBootPlugin(config: FougereConfig, seeds: SeedEntry[], fougereAppPath: string,
15
- /** The module `emitScan` wrote. Absent only in the tests that predate it. */
16
- scanPath?: string): string;
37
+ /** What `fougere:` named, in mount order. Empty is the whole of "changed nothing". */
38
+ extensions?: {
39
+ key: string;
40
+ options: unknown;
41
+ }[],
42
+ /** The app's own `fronds.ts`, when it states what it hosts instead of being scanned. */
43
+ statedPath?: string): string;
17
44
  //# sourceMappingURL=module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,SAAS,EAAE,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;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAO;AACpD,wFAAwF;AACxF,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CA0HR"}
package/dist/module.js CHANGED
@@ -5,11 +5,30 @@
5
5
  */
6
6
  import { defineNuxtModule, addServerHandler, addServerImportsDir, addServerPlugin, addPlugin, addTemplate, addImports, createResolver, useLogger, } from '@nuxt/kit';
7
7
  import { orderSeeds } from '@fougere/core';
8
- import { scanProject, emitScan, frondAliases, watchPathsOf, resolveConventions, setModuleLoader, loadCascadedConfig, } from '@fougere/core/node';
8
+ import { scanProject, emitStatement, frondAliases, frondPackage, watchPathsOf, resolveConventions, setModuleLoader, loadCascadedConfig, } from '@fougere/core/node';
9
9
  import { declaresStorage } from '@fougere/defaults';
10
10
  import { createJiti } from 'jiti';
11
- import { resolve } from 'node:path';
11
+ import { resolve, relative } from 'node:path';
12
12
  import { existsSync, readFileSync, readdirSync } from 'node:fs';
13
+ /**
14
+ * The extension keys, in the order they are mounted.
15
+ *
16
+ * A list and not the options object's own keys: the ORDER is ours, not the project's.
17
+ * `observability` installs the middleware that opens the span every log line written
18
+ * inside a call will carry — mounted the other way round, the lines leave uncorrelated.
19
+ */
20
+ const EXTENSION_KEYS = ['observability', 'calls'];
21
+ /** What the project asked for, in mount order. `false` is how a key is turned off. */
22
+ export function extensionsOf(options) {
23
+ return EXTENSION_KEYS
24
+ .filter((key) => options[key] !== undefined && options[key] !== false)
25
+ .map((key) => ({ key, options: options[key] }));
26
+ }
27
+ /**
28
+ * A frond directory as the pattern Nuxt tests for a restart: it matches the changed
29
+ * file against the path relative to the layer's app dir, so that is the base here.
30
+ */
31
+ const restartsOnFrom = (srcDir) => (dir) => new RegExp(`^${relative(srcDir, dir).replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}[\\\\/]`);
13
32
  const module = defineNuxtModule({
14
33
  meta: {
15
34
  name: '@fougere/nuxt',
@@ -17,7 +36,7 @@ const module = defineNuxtModule({
17
36
  },
18
37
  async setup(options, nuxt) {
19
38
  const { resolve: resolveModule } = createResolver(import.meta.url);
20
- const runtimeResolve = (...path) => resolveModule('../src/runtime', ...path);
39
+ const runtimeResolve = (...path) => resolveModule('./runtime', ...path);
21
40
  const rootDir = nuxt.options.rootDir;
22
41
  // Fronds may live at the workspace root (app under apps/*); config/.fougere stay app-local.
23
42
  const scanRoot = options.root ? resolve(rootDir, options.root) : rootDir;
@@ -75,7 +94,12 @@ const module = defineNuxtModule({
75
94
  // and a field you just added is simply absent with no error anywhere.
76
95
  for (const frond of fronds) {
77
96
  nuxt.options.alias[frond.source.package] = frond.source.path;
78
- nuxt.options.watch.push(...watchPathsOf(frond, scanRoot, conventions));
97
+ const watched = watchPathsOf(frond, scanRoot, conventions);
98
+ // Nuxt reads this list TWICE and a directory serves only the first read: the
99
+ // watcher adds string entries, while the restart test is `pattern === path`
100
+ // against the changed FILE — which a directory never equals. So each dir goes
101
+ // in twice, as itself and as the pattern that matches what lives under it.
102
+ nuxt.options.watch.push(...watched, ...watched.map(restartsOnFrom(nuxt.options.srcDir)));
79
103
  }
80
104
  // ── 1b-bis. Keep entity names through minification ──────────────────────
81
105
  //
@@ -122,7 +146,7 @@ const module = defineNuxtModule({
122
146
  const remotes = JSON.parse(readFileSync(remotesPath, 'utf-8'));
123
147
  for (const [name, meta] of Object.entries(remotes)) {
124
148
  // Don't override locally scanned fronds
125
- const specifier = `${conventions.scope}/${name}`;
149
+ const specifier = frondPackage(name, conventions);
126
150
  if (!nuxt.options.alias[specifier]) {
127
151
  nuxt.options.alias[specifier] = meta.path;
128
152
  // Ensure Vite/Nitro can resolve files inside synced remotes
@@ -184,27 +208,41 @@ const module = defineNuxtModule({
184
208
  handler: runtimeResolve('server/auth/routes/api/me.get'),
185
209
  });
186
210
  }
187
- // ── 6. The scan, written down (virtual — lives in .nuxt/) ───
211
+ // ── 6. What this app hosts ───
188
212
  //
189
- // The module ALREADY scanned, above. Without this the generated plugin scanned a
190
- // second time, at runtime which is right on a server and impossible on a Worker:
191
- // measured on workerd, `readdir` throws through unenv's shim and the app boots with
192
- // ZERO fronds. Every page renders, every door answers NOT_FOUND, and only the scan
193
- // diagnostics say why. One scan, one value, handed to the boot.
213
+ // A `fronds.ts` beside `fougere.config.ts` is the app STATING it — the same shape
214
+ // `configureFougere({ fronds })` gives every other host, made where the author can
215
+ // make it. The scan still runs at build and stays a CHECK: its diagnostics reach the
216
+ // console, and it becomes no module.
194
217
  //
195
- // `emitScan` writes imports relative to where the module SITS, so the destination is
196
- // settled before the source is produced `dst` is that path.
197
- const scanTpl = addTemplate({
198
- filename: 'fougere-scan.mjs',
218
+ // Nothing is generated, because a generated module was imported by ABSOLUTE path,
219
+ // which a bundler sees as `file://` and therefore external. Externalized, Node read
220
+ // the frond's `.ts` itself — stripping types but resolving `../entities/Post.js`
221
+ // literally, a file that is not on disk. Measured on demos/nuxt-blog in-process:
222
+ // 500 on every call in `nuxt dev`, 200 once the statement is the only source.
223
+ // A codegen inside one repo also had nothing to carry: `fougere sync` writes classes
224
+ // because its source is ANOTHER repo, and here the author can just import.
225
+ const stated = ['fronds.ts', 'fronds.mts', 'fronds.js', 'fronds.mjs']
226
+ .map((f) => resolve(scanRoot, f)).find((f) => existsSync(f));
227
+ // No statement of its own: the build writes the one the scan implies, so the runtime
228
+ // never reaches `scanProject`. That fallback works — it has a disk under Nuxt — but it
229
+ // loads `typescript` into a production boot, which is the whole of what a build is for.
230
+ // What is written is the STATEMENT (imports + `frond()`), never the scan result.
231
+ // `.ts`, and it is not cosmetic: the file spells its imports the way TypeScript sources
232
+ // do (`Post.js` for `Post.ts`), and Nitro externalizes a `.mjs` it can hand to Node —
233
+ // which then resolves `@fronds/*` against a package that does not exist, since an alias
234
+ // is a bundler's. Measured both ways, in-process: `.mjs` answers 500, `.ts` answers.
235
+ const statedPath = stated ?? addTemplate({
236
+ filename: 'fougere-fronds.ts',
199
237
  write: true,
200
- getContents: ({ nuxt: n }) => emitScan(scan, { outFile: resolve(n.options.buildDir, 'fougere-scan.mjs') }),
201
- });
238
+ getContents: () => emitStatement(scan),
239
+ }).dst;
202
240
  // ── 6b. Boot plugin (virtual — lives in .nuxt/) ───
203
241
  const allSeeds = orderSeeds(fronds);
204
242
  const bootTpl = addTemplate({
205
243
  filename: 'fougere-boot.ts',
206
244
  write: true,
207
- getContents: () => generateBootPlugin(config, allSeeds, runtimeResolve('server/utils/boot'), scanTpl.dst),
245
+ getContents: () => generateBootPlugin(config, allSeeds, runtimeResolve('server/utils/boot'), extensionsOf(options), statedPath),
208
246
  });
209
247
  addServerPlugin(bootTpl.dst);
210
248
  },
@@ -259,8 +297,10 @@ async function syncedEntityNames(rootDir, conventions) {
259
297
  }
260
298
  }
261
299
  export function generateBootPlugin(config, seeds, fougereAppPath,
262
- /** The module `emitScan` wrote. Absent only in the tests that predate it. */
263
- scanPath) {
300
+ /** What `fougere:` named, in mount order. Empty is the whole of "changed nothing". */
301
+ extensions = [],
302
+ /** The app's own `fronds.ts`, when it states what it hosts instead of being scanned. */
303
+ statedPath) {
264
304
  const lines = [];
265
305
  lines.push(`// Auto-generated by @fougere/nuxt — do not edit`);
266
306
  // Explicit imports — nitro's auto-imports don't reach this template in a prod build
@@ -268,8 +308,13 @@ scanPath) {
268
308
  lines.push(`import { configureFougere } from '${fougereAppPath}';`);
269
309
  // A STATIC import, because that is the one thing a bundler needs spelled out — and the
270
310
  // whole point is that nothing reads a directory once this file is built.
271
- if (scanPath)
272
- lines.push(`import { scan } from '${scanPath}';`);
311
+ // The extension is DROPPED, and that is what decides who reads the file: an extensionless
312
+ // specifier cannot be resolved by Node, so the bundler resolves it — and only a bundler
313
+ // applies the `@fronds/*` aliases the statement's own imports are written with. Left in
314
+ // place, the path resolves natively, Node reads the frond's `.ts` and every call answers
315
+ // 500. Measured both ways on demos/nuxt-blog, in-process.
316
+ if (statedPath)
317
+ lines.push(`import fronds from '${statedPath.replace(/\.(m?)[jt]sx?$/, '')}';`);
273
318
  const db = config.db ?? 'sqlite';
274
319
  const sources = config.sources;
275
320
  // `declaresStorage` is the canonical reader of `db:` — asked, not re-interpreted.
@@ -282,8 +327,10 @@ scanPath) {
282
327
  if (!declaresStorage(db)) {
283
328
  lines.push(``);
284
329
  lines.push(`export default defineNitroPlugin(() => {`);
285
- if (scanPath)
286
- lines.push(` configureFougere({ scan, config: ${JSON.stringify(carried(config))} });`);
330
+ // Always configure, even with nothing to host: `hostedBy` is where the absence is
331
+ // answered, by name and with both keys. Skipping the call boots a silent app instead.
332
+ const states = statedPath ? 'fronds, ' : '';
333
+ lines.push(` configureFougere({ ${states}config: ${JSON.stringify(carried(config))} });`);
287
334
  lines.push(`});`);
288
335
  return lines.join('\n') + '\n';
289
336
  }
@@ -292,6 +339,12 @@ scanPath) {
292
339
  lines.push(`import { resolveStorage } from '@fougere/defaults';`);
293
340
  // After the early return above: an app that declares no storage generates no imports.
294
341
  lines.push(`import { migrating${seeds.length ? ', runSeeds' : ''} } from '@fougere/core';`);
342
+ // One import per key the project named. The key IS the export and the package suffix, so
343
+ // a missing package is a build error naming the package — not a boot that silently lacks
344
+ // the panel someone asked for.
345
+ for (const { key } of extensions) {
346
+ lines.push(`import { ${key} } from '@fougere/${key}';`);
347
+ }
295
348
  lines.push(``);
296
349
  // Seed imports
297
350
  for (let i = 0; i < seeds.length; i++) {
@@ -301,15 +354,14 @@ scanPath) {
301
354
  lines.push(``);
302
355
  // Wrap all init in the plugin callback to avoid top-level native calls
303
356
  lines.push(`export default defineNitroPlugin(async () => {`);
304
- // The SCAN first, and on its own line: it names no engine, so nothing below can stop it
305
- // from being stated. Measured on workerd — `resolveStorage` threw on a native driver,
357
+ // What it HOSTS first, and on its own line: it names no engine, so nothing below can stop
358
+ // it from being stated. Measured on workerd — `resolveStorage` threw on a native driver,
306
359
  // Nitro swallowed the plugin whole, and the app came up with zero fronds and not a word.
307
- // Two unrelated facts had been sharing one failure.
308
- // The scan AND what the config says about topology both read at build, both stated
309
- // here rather than re-derived. `remotes` is the whole reason a consumer boots at all:
310
- // without it the app hosts nothing and reaches nothing, and its pages render empty.
311
- if (scanPath)
312
- lines.push(` configureFougere({ scan, config: ${JSON.stringify(carried(config))} });`);
360
+ // Two unrelated facts had been sharing one failure. `remotes` rides along for the same
361
+ // reason: it is the whole of why a consumer that hosts nothing boots at all.
362
+ const states = statedPath ? 'fronds, ' : '';
363
+ lines.push(` configureFougere({ ${states}config: ${JSON.stringify(carried(config))} });`);
364
+ lines.push(``);
313
365
  lines.push(` try {`);
314
366
  // Pass `db` through unchanged — resolveStorage (@fougere/defaults → setupSqlite)
315
367
  // is the one place that defaults an absent path, so both call sites (this
@@ -320,8 +372,8 @@ scanPath) {
320
372
  lines.push(` const storage = resolveStorage(${JSON.stringify(db)}${sourcesArg});`);
321
373
  lines.push(``);
322
374
  lines.push(` configureFougere({`);
323
- if (scanPath)
324
- lines.push(` scan,`);
375
+ if (statedPath)
376
+ lines.push(` fronds,`);
325
377
  lines.push(` config: ${JSON.stringify(carried(config))},`);
326
378
  lines.push(` db: storage.db,`);
327
379
  lines.push(` ormFactory: storage.ormFactory,`);
@@ -347,6 +399,11 @@ scanPath) {
347
399
  }
348
400
  lines.push(` ], (message) => console.log('[fougere:seed]' + message)) },`);
349
401
  }
402
+ // After the framework's own members, never before: tables, then rows, then what the host
403
+ // adds. A key named 'seeds' would REPLACE core's, which is the delta rule of AppLifecycle.
404
+ for (const { key, options } of extensions) {
405
+ lines.push(` ${key}(${JSON.stringify(options ?? {})}),`);
406
+ }
350
407
  lines.push(` ],`);
351
408
  lines.push(` });`);
352
409
  // A storage that could not be opened is REPORTED, never swallowed. Nitro takes a
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,SAAS,GACV,M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AAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACpE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,4BAA4B,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,iBAAiB,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACrI,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;IACpF,CAAC;IAED,yFAAyF;IACzF,2FAA2F;IAC3F,KAAK,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,UAAU,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,iFAAiF;IACjF,oFAAoF;IACpF,qFAAqF;IACrF,yFAAyF;IACzF,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAClC,KAAK,CAAC,IAAI,CAAC,uGAAuG,CAAC,CAAC;IACpH,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IACxC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAElB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { SessionView } from '@fougere/app/client';
2
+ export declare function useCurrentUser<TUser = Record<string, unknown>>(): {
3
+ session: import("vue").Ref<SessionView, SessionView>;
4
+ user: import("vue").ComputedRef<TUser | null>;
5
+ loggedIn: import("vue").ComputedRef<boolean>;
6
+ refresh: () => Promise<void>;
7
+ };
8
+ //# sourceMappingURL=useCurrentUser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCurrentUser.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/useCurrentUser.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,wBAAgB,cAAc,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;mBAOlC,OAAO,CAAC,IAAI,CAAC;EAKxC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The session: resolved once server-side, hydrated with the page, read
3
+ * here as reactive state. refresh() re-reads it after a client-side
4
+ * auth change (login, logout) — no page reload, no hand-rolled /api/me.
5
+ *
6
+ * `session` is the whole view (extensible context); `user` is its
7
+ * everyday projection.
8
+ */
9
+ import { useState, useRequestFetch } from '#imports';
10
+ import { computed } from 'vue';
11
+ export function useCurrentUser() {
12
+ const session = useState('fougere:session', () => ({ user: null }));
13
+ const fetcher = useRequestFetch();
14
+ const user = computed(() => (session.value.user ?? null));
15
+ const loggedIn = computed(() => session.value.user != null);
16
+ async function refresh() {
17
+ session.value = await fetcher('/_fougere/session');
18
+ }
19
+ return { session, user, loggedIn, refresh };
20
+ }
21
+ //# sourceMappingURL=useCurrentUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCurrentUser.js","sourceRoot":"","sources":["../../../src/runtime/composables/useCurrentUser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAG/B,MAAM,UAAU,cAAc;IAC5B,MAAM,OAAO,GAAG,QAAQ,CAAc,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACjF,MAAM,OAAO,GAAG,eAAe,EAAE,CAAC;IAElC,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAiB,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;IAE5D,KAAK,UAAU,OAAO;QACpB,OAAO,CAAC,KAAK,GAAG,MAAM,OAAO,CAAc,mBAAmB,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { type FormEntity, type FormField } from '@fougere/app/client';
2
+ export interface FormOptions {
3
+ /** Command the submit rides. Default: 'create'. */
4
+ op?: string;
5
+ /** Initial values (edit mode: the loaded entity). */
6
+ initial?: Record<string, unknown>;
7
+ /** Call params designating the target (edit mode: { id }). */
8
+ params?: Record<string, string>;
9
+ }
10
+ export declare function useFormFor<T = Record<string, unknown>>(entity: FormEntity, options?: FormOptions): {
11
+ fields: FormField[];
12
+ /**
13
+ * The same fields, keyed by name — a form that lays its inputs out by hand binds
14
+ * one at a time (`v-bind="fieldsByName.email.attrs"`), and still states no rule of
15
+ * its own. Without it, a page retypes `type="email"` next to a card that says
16
+ * `format: 'email'`, and the browser enforces the page rather than the declaration.
17
+ */
18
+ fieldsByName: Record<string, FormField>;
19
+ values: Record<string, unknown>;
20
+ errors: Record<string, string>;
21
+ submit: () => Promise<T | null>;
22
+ loading: import("vue").Ref<boolean, boolean>;
23
+ /** Non-validation failure of the last submit (unreachable host, conflict…). */
24
+ error: import("vue").Ref<import("@fougere/core/contract").FougereError | null, import("@fougere/core/contract").FougereError | null>;
25
+ valid: import("vue").ComputedRef<boolean>;
26
+ };
27
+ //# sourceMappingURL=useFormFor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormFor.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/useFormFor.ts"],"names":[],"mappings":"AAaA,OAAO,EAA0C,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE9G,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,wBAAgB,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,WAAgB;;IAgDjG;;;;;OAKG;kBACiE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;;;kBAtBtE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;;IA2BxC,+EAA+E;;;EAIlF"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * The form contract — state, validation, submission, error mapping.
3
+ * Never a widget: the page owns the rendering, this owns the mechanics.
4
+ *
5
+ * The cycle composes the other primitives: fields from the io axes,
6
+ * local pre-judgment with the same rules the handler enforces (one
7
+ * declaration, both sides), submission through the command (so the
8
+ * entity link revalidates mounted queries), and per-field errors in
9
+ * the same `{ path, message }` shape whoever judged.
10
+ */
11
+ import { reactive, computed } from 'vue';
12
+ import { lowerFirst, validationErrorsOf } from '@fougere/core/contract';
13
+ import { useCommand } from './useFougereData.js';
14
+ import { formFieldsOf, payloadOf, errorsByField } from '@fougere/app/client';
15
+ export function useFormFor(entity, options = {}) {
16
+ const entityKey = lowerFirst(entity.name);
17
+ const fields = formFieldsOf(entity, entityKey);
18
+ // `initial` wins over the declared default: editing a row shows the row, including a
19
+ // value the author deliberately changed away from that default. On a create form
20
+ // there is no `initial`, so the field opens on what is about to be written — the
21
+ // schema's own literal, shown rather than guessed by the page.
22
+ const values = reactive(Object.fromEntries(fields.map((f) => [f.name, options.initial?.[f.name] ?? f.default])));
23
+ const errors = reactive({});
24
+ const command = useCommand(entity, options.op ?? 'create');
25
+ function clearErrors() {
26
+ for (const key of Object.keys(errors))
27
+ delete errors[key];
28
+ }
29
+ /** Local pre-judgment — same rules as the handler, saves a lost round-trip. */
30
+ function judge() {
31
+ clearErrors();
32
+ const result = entity.validate(payloadOf(values));
33
+ if (result.success)
34
+ return true;
35
+ Object.assign(errors, errorsByField(result.errors));
36
+ return false;
37
+ }
38
+ /**
39
+ * Judge locally, then send through the command. Returns the created/updated
40
+ * value, or null when a judge (either side) rejected — the errors land per
41
+ * field either way, the form never knows who judged.
42
+ */
43
+ async function submit() {
44
+ if (!judge())
45
+ return null;
46
+ try {
47
+ return await command.execute({ params: options.params, body: payloadOf(values) });
48
+ }
49
+ catch (err) {
50
+ const refusals = validationErrorsOf(err);
51
+ if (refusals) {
52
+ Object.assign(errors, errorsByField(refusals));
53
+ return null;
54
+ }
55
+ throw err;
56
+ }
57
+ }
58
+ return {
59
+ fields,
60
+ /**
61
+ * The same fields, keyed by name — a form that lays its inputs out by hand binds
62
+ * one at a time (`v-bind="fieldsByName.email.attrs"`), and still states no rule of
63
+ * its own. Without it, a page retypes `type="email"` next to a card that says
64
+ * `format: 'email'`, and the browser enforces the page rather than the declaration.
65
+ */
66
+ fieldsByName: Object.fromEntries(fields.map((f) => [f.name, f])),
67
+ values,
68
+ errors,
69
+ submit,
70
+ loading: command.loading,
71
+ /** Non-validation failure of the last submit (unreachable host, conflict…). */
72
+ error: command.error,
73
+ valid: computed(() => Object.keys(errors).length === 0),
74
+ };
75
+ }
76
+ //# sourceMappingURL=useFormFor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormFor.js","sourceRoot":"","sources":["../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ter, type Ref } from 'vue';
2
+ import type { FougereError } from '@fougere/core/contract';
3
+ import { type CallInput, type EntityClass } from '@fougere/app/client';
4
+ export type { CallInput };
5
+ export declare function useQuery<T = Record<string, unknown>>(entity: EntityClass, op: string, input?: MaybeRefOrGetter<CallInput | undefined>, opts?: {
6
+ immediate?: boolean;
7
+ }): Promise<{
8
+ data: Ref<T | null>;
9
+ items: import("vue").ComputedRef<T[]>;
10
+ total: import("vue").ComputedRef<number | undefined>;
11
+ hasMore: import("vue").ComputedRef<boolean | undefined>;
12
+ loading: Ref<boolean, boolean>;
13
+ error: Ref<import("#imports").NuxtError<unknown> | undefined, import("#imports").NuxtError<unknown> | undefined>;
14
+ refresh: () => Promise<void>;
15
+ }>;
16
+ export declare function useCommand<T = unknown>(entity: EntityClass, op: string): {
17
+ execute: (input?: CallInput) => Promise<T>;
18
+ loading: Ref<boolean, boolean>;
19
+ error: Ref<FougereError | null, FougereError | null>;
20
+ };
21
+ //# sourceMappingURL=useFougereData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFougereData.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/useFougereData.ts"],"names":[],"mappings":"AAgBA,OAAO,EAA0C,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAWL,KAAK,SAAS,EACd,KAAK,WAAW,EAEjB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,wBAAsB,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxD,MAAM,EAAE,WAAW,EACnB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,gBAAgB,CAAC,SAAS,GAAG,SAAS,CAAC,EAC/C,IAAI,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE;UA0Bd,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;;;;;;aAQP,MAAM,OAAO,CAAC,IAAI,CAAC;GAE1C;AAED,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM;sBAOtC,SAAS,KAAG,OAAO,CAAC,CAAC,CAAC;;;EAkBtD"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The couple — useQuery (reads) and useCommand (writes), the two dual gestures of
3
+ * a page talking to a Frond, in Vue.
4
+ *
5
+ * What the gestures ARE lives in `@fougere/app/client`: designation is class +
6
+ * verb, the key derives from designation plus input, and a successful command on
7
+ * an entity revalidates every mounted query on that entity. What lives here is
8
+ * Vue — `useAsyncData` for the read, refs for the pending flags, `onScopeDispose`
9
+ * for unregistration. The React adapter states the same three facts against its
10
+ * own primitives, and neither restates the rules.
11
+ *
12
+ * Both gestures ride the call envelope: the browser POSTs JSON-RPC to
13
+ * /_fougere/call; during SSR Nuxt collapses the same call to an in-process fetch
14
+ * (no network, no port).
15
+ */
16
+ import { useAsyncData, useRequestFetch, refreshNuxtData } from '#imports';
17
+ import { ref, computed, toValue, onScopeDispose } from 'vue';
18
+ import { callOf, entityKeyOf, invocationOf, queryKeyOf, sendCall, trackQuery, mountedKeys, itemsOf, pageOf, asFougereError, } from '@fougere/app/client';
19
+ export async function useQuery(entity, op, input, opts) {
20
+ const entityKey = entityKeyOf(entity);
21
+ const call = callOf(entity, op);
22
+ const key = queryKeyOf(entityKey, op, toValue(input));
23
+ const fetcher = useRequestFetch();
24
+ // Register before any await — the link and scope cleanup need the setup scope.
25
+ if (import.meta.client) {
26
+ onScopeDispose(trackQuery(entityKey, key));
27
+ }
28
+ const { data, pending, error, refresh } = await useAsyncData(key, () => sendCall(fetcher, call, invocationOf(toValue(input))), {
29
+ ...(input === undefined ? {} : { watch: [() => toValue(input)] }),
30
+ ...(opts?.immediate === false ? { immediate: false } : {}),
31
+ });
32
+ const items = computed(() => itemsOf(data.value));
33
+ const total = computed(() => pageOf(data.value).total);
34
+ const hasMore = computed(() => pageOf(data.value).hasMore);
35
+ return {
36
+ data: data,
37
+ items,
38
+ total,
39
+ hasMore,
40
+ loading: pending,
41
+ error,
42
+ // Nuxt does not export AsyncDataExecuteOptions, so the inferred signature cannot
43
+ // be named from outside; callers pass nothing.
44
+ refresh: refresh,
45
+ };
46
+ }
47
+ export function useCommand(entity, op) {
48
+ const entityKey = entityKeyOf(entity);
49
+ const call = callOf(entity, op);
50
+ const fetcher = useRequestFetch();
51
+ const loading = ref(false);
52
+ const error = ref(null);
53
+ async function execute(input) {
54
+ loading.value = true;
55
+ error.value = null;
56
+ try {
57
+ const result = (await sendCall(fetcher, call, invocationOf(input)));
58
+ // The link: same entity designated on both sides → revalidate its queries.
59
+ const keys = mountedKeys(entityKey);
60
+ if (keys.length)
61
+ await refreshNuxtData(keys);
62
+ return result;
63
+ }
64
+ catch (err) {
65
+ error.value = asFougereError(err, entityKey, op);
66
+ throw error.value;
67
+ }
68
+ finally {
69
+ loading.value = false;
70
+ }
71
+ }
72
+ return { execute, loading, error };
73
+ }
74
+ //# sourceMappingURL=useFougereData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFougereData.js","sourceRoot":"","sources":["../../../src/runtime/composables/useFougereData.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAmC,MAAM,KAAK,CAAC;AAE9F,OAAO,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,OAAO,EACP,MAAM,EACN,cAAc,GAIf,MAAM,qBAAqB,CAAC;AAI7B,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,MAAmB,EACnB,EAAU,EACV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ED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACrC,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("#imports").Plugin<Record<string, unknown>> & import("#imports").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
3
+ //# sourceMappingURL=session.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.server.d.ts","sourceRoot":"","sources":["../../../src/runtime/plugins/session.server.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Session hydration — server half of useCurrentUser. The auth middleware
3
+ * already resolved the user onto event.context; this plugin copies the
4
+ * session view into state so it rides the payload to the client. The
5
+ * page arrives already knowing its user — no round-trip.
6
+ */
7
+ import { defineNuxtPlugin, useRequestEvent, useState } from '#imports';
8
+ import { sessionViewOf } from '@fougere/app/client';
9
+ export default defineNuxtPlugin(() => {
10
+ const event = useRequestEvent();
11
+ useState('fougere:session', () => sessionViewOf((event?.context ?? {})));
12
+ });
13
+ //# sourceMappingURL=session.server.js.map