@fougere/nuxt 0.6.0-alpha.0 → 0.8.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.
- package/dist/module.d.ts +10 -17
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +41 -31
- package/dist/module.js.map +1 -1
- package/dist/runtime/composables/useCurrentUser.d.ts.map +1 -1
- package/dist/runtime/composables/useCurrentUser.js +1 -8
- package/dist/runtime/composables/useCurrentUser.js.map +1 -1
- package/dist/runtime/composables/useFormFor.d.ts +2 -4
- package/dist/runtime/composables/useFormFor.d.ts.map +1 -1
- package/dist/runtime/composables/useFormFor.js +8 -23
- package/dist/runtime/composables/useFormFor.js.map +1 -1
- package/dist/runtime/composables/useFougereData.d.ts.map +1 -1
- package/dist/runtime/composables/useFougereData.js +2 -13
- package/dist/runtime/composables/useFougereData.js.map +1 -1
- package/dist/runtime/plugins/session.server.js +1 -6
- package/dist/runtime/plugins/session.server.js.map +1 -1
- package/dist/runtime/server/api/crud.js +1 -17
- package/dist/runtime/server/api/crud.js.map +1 -1
- package/dist/runtime/server/routes/call.post.js +2 -23
- package/dist/runtime/server/routes/call.post.js.map +1 -1
- package/dist/runtime/server/routes/session.get.js +2 -3
- package/dist/runtime/server/routes/session.get.js.map +1 -1
- package/dist/runtime/server/utils/boot.d.ts +1 -11
- package/dist/runtime/server/utils/boot.d.ts.map +1 -1
- package/dist/runtime/server/utils/boot.js +1 -11
- package/dist/runtime/server/utils/boot.js.map +1 -1
- package/dist/runtime/server/utils/invoke.d.ts.map +1 -1
- package/dist/runtime/server/utils/invoke.js +1 -9
- package/dist/runtime/server/utils/invoke.js.map +1 -1
- package/package.json +4 -4
- package/src/module.ts +45 -46
- package/src/runtime/composables/useCurrentUser.ts +1 -8
- package/src/runtime/composables/useFormFor.ts +8 -23
- package/src/runtime/composables/useFougereData.ts +2 -13
- package/src/runtime/plugins/session.server.ts +1 -6
- package/src/runtime/server/api/crud.ts +1 -17
- package/src/runtime/server/routes/call.post.ts +2 -23
- package/src/runtime/server/routes/session.get.ts +2 -3
- package/src/runtime/server/utils/boot.ts +1 -11
- package/src/runtime/server/utils/invoke.ts +1 -9
package/dist/module.d.ts
CHANGED
|
@@ -2,24 +2,11 @@ import type { SeedEntry, FougereConfig } from '@fougere/core';
|
|
|
2
2
|
export interface FougereModuleOptions {
|
|
3
3
|
/** Override fougere.config.ts values from nuxt.config. Optional. */
|
|
4
4
|
db?: FougereConfig['db'];
|
|
5
|
-
/**
|
|
6
|
-
* Where `fronds/` lives, relative to the app's rootDir. Default: the app
|
|
7
|
-
* itself. Set to `../..` for an app under `apps/*` in a workspace whose
|
|
8
|
-
* fronds are shared at the root. Config and `.fougere` stay app-local.
|
|
9
|
-
*/
|
|
5
|
+
/** Where `fronds/` lives, relative to the app's rootDir. */
|
|
10
6
|
root?: string;
|
|
11
7
|
/**
|
|
12
|
-
* One key per EXTENSION, and the key is the package suffix AND the export name —
|
|
13
|
-
* `
|
|
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.
|
|
8
|
+
* One key per EXTENSION, and the key is the package suffix AND the export name — `calls` is
|
|
9
|
+
* `import { calls } from '@fougere/calls'`.
|
|
23
10
|
*/
|
|
24
11
|
/** `@fougere/observability` — a span per operation, the four signals, OTLP. */
|
|
25
12
|
observability?: Record<string, unknown> | false;
|
|
@@ -40,5 +27,11 @@ extensions?: {
|
|
|
40
27
|
options: unknown;
|
|
41
28
|
}[],
|
|
42
29
|
/** The app's own `fronds.ts`, when it states what it hosts instead of being scanned. */
|
|
43
|
-
statedPath?: string
|
|
30
|
+
statedPath?: string,
|
|
31
|
+
/**
|
|
32
|
+
* Where a relative `db.path` is counted from. Written as a LITERAL because the plugin
|
|
33
|
+
* runs with Nitro's own directory: `apps/nuxt` made a second, empty database beside
|
|
34
|
+
* itself while the workspace held the real one, and said nothing.
|
|
35
|
+
*/
|
|
36
|
+
root?: string): string;
|
|
44
37
|
//# sourceMappingURL=module.d.ts.map
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAK9D,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,EAAE,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IACzB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;IAChD,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;CACzC;AAKD,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,CAI/F;AAUD,QAAA,MAAM,MAAM,sFAiQV,CAAC;eAEY,MAAM;AA2CrB,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,SAAS,EAAE,EAClB,cAAc,EAAE,MAAM;AACtB,sFAAsF;AACtF,UAAU,GAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAO;AACpD,wFAAwF;AACxF,UAAU,CAAC,EAAE,MAAM;AACnB;;;;GAIG;AACH,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,CA6HR"}
|
package/dist/module.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fougere/nuxt — Nuxt module: scans fronds, registers the four
|
|
3
|
-
* primitives (useQuery/useCommand, useFormFor, useCurrentUser) and the
|
|
4
|
-
* server surface (call envelope, session, REST bridge, auth).
|
|
5
|
-
*/
|
|
1
|
+
/** @fougere/nuxt — Nuxt module. */
|
|
6
2
|
import { defineNuxtModule, addServerHandler, addServerImportsDir, addServerPlugin, addPlugin, addTemplate, addImports, createResolver, useLogger, } from '@nuxt/kit';
|
|
7
3
|
import { orderSeeds } from '@fougere/core';
|
|
8
4
|
import { scanProject, emitStatement, frondAliases, frondPackage, watchPathsOf, resolveConventions, setModuleLoader, loadCascadedConfig, } from '@fougere/core/node';
|
|
@@ -10,13 +6,7 @@ import { declaresStorage } from '@fougere/defaults';
|
|
|
10
6
|
import { createJiti } from 'jiti';
|
|
11
7
|
import { resolve, relative } from 'node:path';
|
|
12
8
|
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
|
-
*/
|
|
9
|
+
/** The extension keys, in the order they are mounted. */
|
|
20
10
|
const EXTENSION_KEYS = ['observability', 'calls'];
|
|
21
11
|
/** What the project asked for, in mount order. `false` is how a key is turned off. */
|
|
22
12
|
export function extensionsOf(options) {
|
|
@@ -59,6 +49,16 @@ const module = defineNuxtModule({
|
|
|
59
49
|
}
|
|
60
50
|
// invoke reads the current request (state) through nitro's async context
|
|
61
51
|
nitroConfig.experimental = { ...nitroConfig.experimental, asyncContext: true };
|
|
52
|
+
// A provider's container key IS its class name, read off the constructor at boot.
|
|
53
|
+
// esbuild lowers `static readonly` fields and renames the declaration doing it, so
|
|
54
|
+
// `class Communes { static readonly SOURCE = … }` registers as `_Communes` and the
|
|
55
|
+
// handler that asks for `Communes` gets a container miss — measured on Nitro's dev
|
|
56
|
+
// pass, ten classes, the six with statics renamed and the four without untouched.
|
|
57
|
+
// Same statement as `mangle.reserved` below, on the pass that builds the server.
|
|
58
|
+
nitroConfig.esbuild = {
|
|
59
|
+
...nitroConfig.esbuild,
|
|
60
|
+
options: { ...nitroConfig.esbuild?.options, keepNames: true },
|
|
61
|
+
};
|
|
62
62
|
});
|
|
63
63
|
// ── 0. A TS-aware loader, installed twice on purpose ──
|
|
64
64
|
// The Vite alias below covers `.vue` pages; this covers the SCAN, which loads a
|
|
@@ -79,6 +79,13 @@ const module = defineNuxtModule({
|
|
|
79
79
|
const fileConfig = await loadCascadedConfig(scanRoot, rootDir);
|
|
80
80
|
const optionsOverride = Object.fromEntries(Object.entries(options).filter(([, v]) => v !== undefined));
|
|
81
81
|
const config = { db: 'sqlite', ...fileConfig, ...optionsOverride };
|
|
82
|
+
// Nitro replaces `console` with consola, whose own threshold sits at `info` — and a
|
|
83
|
+
// Logger line at `debug` goes out through `console.debug`, which consola then drops.
|
|
84
|
+
// Measured: the level was `debug`, the boot logged nothing, and the silence read as
|
|
85
|
+
// an app doing nothing rather than a host filtering.
|
|
86
|
+
if ((process.env.FOUGERE_LOG_LEVEL ?? config.logLevel) === 'debug') {
|
|
87
|
+
useLogger('fougere').warn('logLevel is debug, and Nitro\'s console drops that level — run with CONSOLA_LEVEL=4 to see it.');
|
|
88
|
+
}
|
|
82
89
|
const conventions = resolveConventions(config.conventions);
|
|
83
90
|
// Now the names are known, so the loader can resolve them — and the scan below runs
|
|
84
91
|
// with them installed, which is what lets it read a frond that names its neighbour.
|
|
@@ -222,7 +229,7 @@ const module = defineNuxtModule({
|
|
|
222
229
|
// 500 on every call in `nuxt dev`, 200 once the statement is the only source.
|
|
223
230
|
// A codegen inside one repo also had nothing to carry: `fougere sync` writes classes
|
|
224
231
|
// because its source is ANOTHER repo, and here the author can just import.
|
|
225
|
-
const
|
|
232
|
+
const frondsFile = ['fronds.ts', 'fronds.mts', 'fronds.js', 'fronds.mjs']
|
|
226
233
|
.map((f) => resolve(scanRoot, f)).find((f) => existsSync(f));
|
|
227
234
|
// No statement of its own: the build writes the one the scan implies, so the runtime
|
|
228
235
|
// never reaches `scanProject`. That fallback works — it has a disk under Nuxt — but it
|
|
@@ -232,7 +239,7 @@ const module = defineNuxtModule({
|
|
|
232
239
|
// do (`Post.js` for `Post.ts`), and Nitro externalizes a `.mjs` it can hand to Node —
|
|
233
240
|
// which then resolves `@fronds/*` against a package that does not exist, since an alias
|
|
234
241
|
// is a bundler's. Measured both ways, in-process: `.mjs` answers 500, `.ts` answers.
|
|
235
|
-
const statedPath =
|
|
242
|
+
const statedPath = frondsFile ?? addTemplate({
|
|
236
243
|
filename: 'fougere-fronds.ts',
|
|
237
244
|
write: true,
|
|
238
245
|
getContents: () => emitStatement(scan),
|
|
@@ -242,7 +249,7 @@ const module = defineNuxtModule({
|
|
|
242
249
|
const bootTpl = addTemplate({
|
|
243
250
|
filename: 'fougere-boot.ts',
|
|
244
251
|
write: true,
|
|
245
|
-
getContents: () => generateBootPlugin(config, allSeeds, runtimeResolve('server/utils/boot'), extensionsOf(options), statedPath),
|
|
252
|
+
getContents: () => generateBootPlugin(config, allSeeds, runtimeResolve('server/utils/boot'), extensionsOf(options), statedPath, scanRoot),
|
|
246
253
|
});
|
|
247
254
|
addServerPlugin(bootTpl.dst);
|
|
248
255
|
},
|
|
@@ -251,27 +258,21 @@ export default module;
|
|
|
251
258
|
// ── Boot plugin generation ─────────────────────────
|
|
252
259
|
// Exported (not just module-internal) so its output is unit-testable without
|
|
253
260
|
// spinning up a whole Nuxt build.
|
|
254
|
-
/**
|
|
255
|
-
* What of the config a generated plugin can carry: values, never providers.
|
|
256
|
-
*
|
|
257
|
-
* `auth` holds a live object built by `betterAuth(...)`, so it cannot be written into a
|
|
258
|
-
* module — and it needs a database, which a codegen'd host has already resolved its own
|
|
259
|
-
* way. The rest is data and travels.
|
|
260
|
-
*/
|
|
261
|
+
/** What of the config a generated plugin can carry: values, never providers. */
|
|
261
262
|
function carried(config) {
|
|
262
|
-
const { remotes, adapters, sources } = config;
|
|
263
|
+
const { remotes, adapters, sources, logLevel } = config;
|
|
263
264
|
return {
|
|
264
265
|
...(remotes ? { remotes } : {}),
|
|
265
266
|
...(adapters ? { adapters } : {}),
|
|
266
267
|
...(sources ? { sources } : {}),
|
|
268
|
+
// The host hands its config over, so nothing re-reads the file at runtime — a key
|
|
269
|
+
// left out here is a key the app declared and no one applies.
|
|
270
|
+
...(logLevel ? { logLevel } : {}),
|
|
267
271
|
};
|
|
268
272
|
}
|
|
269
273
|
/**
|
|
270
274
|
* The entity names a SYNCED remote brought in — `fougere sync` writes the classes under
|
|
271
275
|
* `.fougere/`, and a consumer designates them exactly as it designates its own.
|
|
272
|
-
*
|
|
273
|
-
* By filename and not by loading them: this runs before the loader is installed, and a
|
|
274
|
-
* class file is named after its class by the same convention the scan reads.
|
|
275
276
|
*/
|
|
276
277
|
async function syncedEntityNames(rootDir, conventions) {
|
|
277
278
|
const remotesPath = resolve(rootDir, '.fougere', 'remotes.json');
|
|
@@ -300,7 +301,13 @@ export function generateBootPlugin(config, seeds, fougereAppPath,
|
|
|
300
301
|
/** What `fougere:` named, in mount order. Empty is the whole of "changed nothing". */
|
|
301
302
|
extensions = [],
|
|
302
303
|
/** The app's own `fronds.ts`, when it states what it hosts instead of being scanned. */
|
|
303
|
-
statedPath
|
|
304
|
+
statedPath,
|
|
305
|
+
/**
|
|
306
|
+
* Where a relative `db.path` is counted from. Written as a LITERAL because the plugin
|
|
307
|
+
* runs with Nitro's own directory: `apps/nuxt` made a second, empty database beside
|
|
308
|
+
* itself while the workspace held the real one, and said nothing.
|
|
309
|
+
*/
|
|
310
|
+
root) {
|
|
304
311
|
const lines = [];
|
|
305
312
|
lines.push(`// Auto-generated by @fougere/nuxt — do not edit`);
|
|
306
313
|
// Explicit imports — nitro's auto-imports don't reach this template in a prod build
|
|
@@ -368,15 +375,18 @@ statedPath) {
|
|
|
368
375
|
// codegen'd plugin and fougereApp.ts's own fallback) land on the same file.
|
|
369
376
|
// The second argument only appears when there is something to say: an app with one
|
|
370
377
|
// database generates exactly the line it generated before.
|
|
371
|
-
const sourcesArg = sources ? `, ${JSON.stringify(sources)}` : '';
|
|
372
|
-
|
|
378
|
+
const sourcesArg = sources || root ? `, ${JSON.stringify(sources ?? undefined)}` : '';
|
|
379
|
+
const rootArg = root ? `, ${JSON.stringify(root)}` : '';
|
|
380
|
+
lines.push(` const storage = resolveStorage(${JSON.stringify(db)}${sourcesArg}${rootArg});`);
|
|
373
381
|
lines.push(``);
|
|
374
382
|
lines.push(` configureFougere({`);
|
|
375
383
|
if (statedPath)
|
|
376
384
|
lines.push(` fronds,`);
|
|
377
385
|
lines.push(` config: ${JSON.stringify(carried(config))},`);
|
|
378
|
-
|
|
379
|
-
|
|
386
|
+
// The whole thing, not a hand-picked few of its members: the three this used to name
|
|
387
|
+
// left `transacted` and `close` behind, so a `Together` always compensated and the
|
|
388
|
+
// connection was never released — under Nuxt only, which is where the app really runs.
|
|
389
|
+
lines.push(` storage,`);
|
|
380
390
|
// Two members of the ascent, named — not a claim on everything after the boot. The
|
|
381
391
|
// storage's is core's own declaration (`migrating`), so this codegen states no order and
|
|
382
392
|
// cannot mistype the name it would otherwise be silently adding beside.
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,gBAAg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AC,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentUser.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/useCurrentUser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCurrentUser.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/useCurrentUser.ts"],"names":[],"mappings":"AAGA,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"}
|
|
@@ -1,11 +1,4 @@
|
|
|
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
|
-
*/
|
|
1
|
+
/** The session. */
|
|
9
2
|
import { useState, useRequestFetch } from '#imports';
|
|
10
3
|
import { computed } from 'vue';
|
|
11
4
|
export function useCurrentUser() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentUser.js","sourceRoot":"","sources":["../../../src/runtime/composables/useCurrentUser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useCurrentUser.js","sourceRoot":"","sources":["../../../src/runtime/composables/useCurrentUser.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,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"}
|
|
@@ -10,10 +10,8 @@ export interface FormOptions {
|
|
|
10
10
|
export declare function useFormFor<T = Record<string, unknown>>(entity: FormEntity, options?: FormOptions): {
|
|
11
11
|
fields: FormField[];
|
|
12
12
|
/**
|
|
13
|
-
* The same fields, keyed by name — a form that lays its inputs out by hand binds
|
|
14
|
-
*
|
|
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.
|
|
13
|
+
* The same fields, keyed by name — a form that lays its inputs out by hand binds one at a time
|
|
14
|
+
* (`v-bind="fieldsByName.email.attrs"`), and still states no rule of its own.
|
|
17
15
|
*/
|
|
18
16
|
fieldsByName: Record<string, FormField>;
|
|
19
17
|
values: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormFor.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/useFormFor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFormFor.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/useFormFor.ts"],"names":[],"mappings":"AAIA,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;;IA4CjG;;;OAGG;kBACiE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;;;kBApBtE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;;IAyBxC,+EAA+E;;;EAIlF"}
|
|
@@ -1,13 +1,4 @@
|
|
|
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
|
-
*/
|
|
1
|
+
/** The form contract — state, validation, submission, error mapping. */
|
|
11
2
|
import { reactive, computed } from 'vue';
|
|
12
3
|
import { lowerFirst, validationErrorsOf } from '@fougere/core/contract';
|
|
13
4
|
import { useCommand } from './useFougereData.js';
|
|
@@ -26,8 +17,8 @@ export function useFormFor(entity, options = {}) {
|
|
|
26
17
|
for (const key of Object.keys(errors))
|
|
27
18
|
delete errors[key];
|
|
28
19
|
}
|
|
29
|
-
/** Local pre-
|
|
30
|
-
function
|
|
20
|
+
/** Local pre-verdict — same rules as the handler, saves a lost round-trip. */
|
|
21
|
+
function validator() {
|
|
31
22
|
clearErrors();
|
|
32
23
|
const result = entity.validate(payloadOf(values));
|
|
33
24
|
if (result.success)
|
|
@@ -35,16 +26,12 @@ export function useFormFor(entity, options = {}) {
|
|
|
35
26
|
Object.assign(errors, errorsByField(result.errors));
|
|
36
27
|
return false;
|
|
37
28
|
}
|
|
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
|
-
*/
|
|
29
|
+
/** Validate locally, then send through the command. */
|
|
43
30
|
async function submit() {
|
|
44
|
-
if (!
|
|
31
|
+
if (!validator())
|
|
45
32
|
return null;
|
|
46
33
|
try {
|
|
47
|
-
return await command.execute({ params: options.params,
|
|
34
|
+
return await command.execute({ params: options.params, input: payloadOf(values) });
|
|
48
35
|
}
|
|
49
36
|
catch (err) {
|
|
50
37
|
const refusals = validationErrorsOf(err);
|
|
@@ -58,10 +45,8 @@ export function useFormFor(entity, options = {}) {
|
|
|
58
45
|
return {
|
|
59
46
|
fields,
|
|
60
47
|
/**
|
|
61
|
-
* The same fields, keyed by name — a form that lays its inputs out by hand binds
|
|
62
|
-
*
|
|
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.
|
|
48
|
+
* The same fields, keyed by name — a form that lays its inputs out by hand binds one at a time
|
|
49
|
+
* (`v-bind="fieldsByName.email.attrs"`), and still states no rule of its own.
|
|
65
50
|
*/
|
|
66
51
|
fieldsByName: Object.fromEntries(fields.map((f) => [f.name, f])),
|
|
67
52
|
values,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormFor.js","sourceRoot":"","sources":["../../../src/runtime/composables/useFormFor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useFormFor.js","sourceRoot":"","sources":["../../../src/runtime/composables/useFormFor.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAmC,MAAM,qBAAqB,CAAC;AAW9G,MAAM,UAAU,UAAU,CAA8B,MAAkB,EAAE,OAAO,GAAgB,EAAE;IACnG,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAE5D,qFAAqF;IACrF,iFAAiF;IACjF,iFAAiF;IACjF,+DAA+D;IAC/D,MAAM,MAAM,GAAG,QAAQ,CACrB,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACxF,CAAC;IACF,MAAM,MAAM,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,UAAU,CAAI,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,QAAQ,CAAC,CAAC;IAE9D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OAAO,CAAC,OAAO;QACxB,+EAA+E;QAC/E,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,KAAK,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFougereData.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/useFougereData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFougereData.d.ts","sourceRoot":"","sources":["../../../src/runtime/composables/useFougereData.ts"],"names":[],"mappings":"AAKA,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"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The couple — useQuery (reads) and useCommand (writes), the two dual gestures of
|
|
3
|
-
*
|
|
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).
|
|
2
|
+
* The couple — useQuery (reads) and useCommand (writes), the two dual gestures of a page talking
|
|
3
|
+
* to a Frond, in Vue.
|
|
15
4
|
*/
|
|
16
5
|
import { useAsyncData, useRequestFetch, refreshNuxtData } from '#imports';
|
|
17
6
|
import { ref, computed, toValue, onScopeDispose } from 'vue';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFougereData.js","sourceRoot":"","sources":["../../../src/runtime/composables/useFougereData.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useFougereData.js","sourceRoot":"","sources":["../../../src/runtime/composables/useFougereData.ts"],"names":[],"mappings":"AAAA;;;GAGG;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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,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
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
|
-
*/
|
|
1
|
+
/** Session hydration — server half of useCurrentUser. */
|
|
7
2
|
import { defineNuxtPlugin, useRequestEvent, useState } from '#imports';
|
|
8
3
|
import { sessionViewOf } from '@fougere/app/client';
|
|
9
4
|
export default defineNuxtPlugin(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.server.js","sourceRoot":"","sources":["../../../src/runtime/plugins/session.server.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"session.server.js","sourceRoot":"","sources":["../../../src/runtime/plugins/session.server.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,aAAa,EAAoB,MAAM,qBAAqB,CAAC;AAEtE,eAAe,gBAAgB,CAAC,GAAG,EAAE;IACnC,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,QAAQ,CAAc,iBAAiB,EAAE,GAAG,EAAE,CAC5C,aAAa,CAAC,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,CAA4B,CAAC,CACjE,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* REST catch-all — the h3 half of a door whose decisions live in `@fougere/app`.
|
|
3
|
-
*
|
|
4
|
-
* It used to derive its own answers: its own `pluralize`, its own "segment = op or
|
|
5
|
-
* id", and its own method rule — which was no rule at all. A known operation name
|
|
6
|
-
* won whatever the verb, so `GET /api/blog/posts/delete?id=…` reached the mutating
|
|
7
|
-
* method with the session cookie a browser attaches to any navigation, and a
|
|
8
|
-
* body-less `DELETE /api/blog/posts` was read as `create`.
|
|
9
|
-
*
|
|
10
|
-
* `schema-rest` already answers all three in one place, `exposed === false`
|
|
11
|
-
* included — so the fix was not a guard added here, it was the removal of the
|
|
12
|
-
* second answer. `serveRest` is now the third: the same decision serves Next, and
|
|
13
|
-
* neither adapter restates it.
|
|
14
|
-
*
|
|
15
|
-
* What stays here is translation: read the h3 event, write the h3 answer. The state
|
|
16
|
-
* is stamped from `event.context` — what the server resolved, never the wire.
|
|
17
|
-
*/
|
|
1
|
+
/** REST catch-all — the h3 half of a door whose decisions live in `@fougere/app`. */
|
|
18
2
|
import { defineEventHandler, readBody, getQuery, createError, setResponseStatus, setResponseHeaders } from 'h3';
|
|
19
3
|
import { serveRest, useFougereApp } from '@fougere/app';
|
|
20
4
|
export default defineEventHandler(async (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.js","sourceRoot":"","sources":["../../../../src/runtime/server/api/crud.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"crud.js","sourceRoot":"","sources":["../../../../src/runtime/server/api/crud.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAChH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAExD,eAAe,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;IAChD,MAAM,GAAG,GAAG,MAAM,aAAa,EAAE,CAAC;IAElC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,OAAO,CAAC;IAE5E,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE;QACnC,MAAM;QACN,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC7D,KAAK,EAAE,QAAQ,CAAC,KAAK,CAA2B;QAChD,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;QACjD,KAAK,EAAE,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAA4B;KACxD,CAAC,CAAC;IAEH,oFAAoF;IACpF,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO;IAEpC,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC7B,IAAI,OAAO,CAAC,OAAO;YAAE,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAChE,MAAM,WAAW,CAAC;YAChB,UAAU,EAAE,OAAO,CAAC,MAAM;YAC1B,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO;YAC7B,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC;AACtB,CAAC,CAAC,CAAC"}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Receiving end for the browser — the h3 half. The decision (which audience, which
|
|
3
|
-
* runner, what a parse failure answers) lives in `@fougere/app`; what stays here is
|
|
4
|
-
* getting a JSON payload out of an h3 event, which is the one thing that genuinely
|
|
5
|
-
* differs between hosts. Next reads `await request.json()` and needs none of this.
|
|
6
|
-
*
|
|
7
|
-
* Trust boundary, unchanged: the browser sits outside the topology, so `state` is
|
|
8
|
-
* stamped from the server-resolved session (event.context), never taken from the wire.
|
|
9
|
-
*/
|
|
1
|
+
/** Receiving end for the browser — the h3 half. */
|
|
10
2
|
import { defineEventHandler } from 'h3';
|
|
11
3
|
import { serveRpc, rpcParseError, useFougereApp } from '@fougere/app';
|
|
12
4
|
import { MAX_BODY_BYTES } from '@fougere/core';
|
|
@@ -49,20 +41,7 @@ async function readWebBody(req) {
|
|
|
49
41
|
return req.json();
|
|
50
42
|
return {};
|
|
51
43
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Read the JSON-RPC payload from the h3 event, agnostic to h3 version AND trust
|
|
54
|
-
* boundary. We read the event's shape directly instead of calling `readBody`,
|
|
55
|
-
* whose static `from 'h3'` import can bind to a different h3 major than the one
|
|
56
|
-
* that shaped the event (nitro's runtime is v1 here; devtools drag in v2) —
|
|
57
|
-
* `readBody` v2 on a v1 event throws `event.req.text is not a function`.
|
|
58
|
-
*
|
|
59
|
-
* Two shapes occur, both verified:
|
|
60
|
-
* - SSR internal `$fetch`: a synthetic event whose `node.req.body` is already
|
|
61
|
-
* the raw JSON string — the mock stream is not readable, never drain it.
|
|
62
|
-
* - Browser POST: a real IncomingMessage, drained via stream events (`for
|
|
63
|
-
* await` fails: the SSR mock has no async iterator).
|
|
64
|
-
* The `event.req.json()` branch is the future once nitro is fully on h3 v2.
|
|
65
|
-
*/
|
|
44
|
+
/** Read the JSON-RPC payload from the h3 event, agnostic to h3 version AND trust boundary. */
|
|
66
45
|
async function readJsonBody(event) {
|
|
67
46
|
const rawNodeReq = event.node?.req;
|
|
68
47
|
const nodeReq = rawNodeReq && typeof rawNodeReq === 'object' ? rawNodeReq : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.post.js","sourceRoot":"","sources":["../../../../src/runtime/server/routes/call.post.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"call.post.js","sourceRoot":"","sources":["../../../../src/runtime/server/routes/call.post.ts"],"names":[],"mapp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AE,GAAG,IAAI,CAAC,QAAQ;gBAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9F,OAAO,CAAC,EAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QACH,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,eAAe,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;IAChD,MAAM,GAAG,GAAG,MAAM,aAAa,EAAE,CAAC;IAClC,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,GAAG,EAAE;YACzB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC;YAC/B,KAAK,EAAE,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAA4B;SACxD,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA+B,EAAE,UAAU,KAAK,GAAG;YAAE,MAAM,GAAG,CAAC;QACpE,OAAO,aAAa,EAAE,CAAC;IACzB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The session view over the wire — same resolution the hydration reads,
|
|
3
|
-
*
|
|
4
|
-
* family as /_fougere/call.
|
|
2
|
+
* The session view over the wire — same resolution the hydration reads, for a client refreshing
|
|
3
|
+
* after login/logout.
|
|
5
4
|
*/
|
|
6
5
|
import { defineEventHandler } from 'h3';
|
|
7
6
|
import { sessionViewOf } from '@fougere/app';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.get.js","sourceRoot":"","sources":["../../../../src/runtime/server/routes/session.get.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"session.get.js","sourceRoot":"","sources":["../../../../src/runtime/server/routes/session.get.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,eAAe,kBAAkB,CAAC,CAAC,KAAK,EAAE,EAAE,CAC1C,aAAa,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAA4B,CAAC,CAChE,CAAC"}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The boot, re-exported under a path inside this package.
|
|
3
|
-
*
|
|
4
|
-
* Every runtime file here reaches `@fougere/app` by name, because it is resolved
|
|
5
|
-
* from this package's own node_modules. The generated Nitro plugin cannot: it is
|
|
6
|
-
* written into the user's `.nuxt/`, so a bare `@fougere/app` would be resolved from
|
|
7
|
-
* the USER's project, where a transitive dependency is not visible under pnpm.
|
|
8
|
-
*
|
|
9
|
-
* So the codegen imports this file by absolute path, and this file — which does sit
|
|
10
|
-
* in `@fougere/nuxt` — does the resolving. One indirection, one reason.
|
|
11
|
-
*/
|
|
1
|
+
/** The boot, re-exported under a path inside this package. */
|
|
12
2
|
export { configureFougere, extendFougere, useFougereApp, type FougereServerConfig } from '@fougere/app';
|
|
13
3
|
//# sourceMappingURL=boot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../../src/runtime/server/utils/boot.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../../../src/runtime/server/utils/boot.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The boot, re-exported under a path inside this package.
|
|
3
|
-
*
|
|
4
|
-
* Every runtime file here reaches `@fougere/app` by name, because it is resolved
|
|
5
|
-
* from this package's own node_modules. The generated Nitro plugin cannot: it is
|
|
6
|
-
* written into the user's `.nuxt/`, so a bare `@fougere/app` would be resolved from
|
|
7
|
-
* the USER's project, where a transitive dependency is not visible under pnpm.
|
|
8
|
-
*
|
|
9
|
-
* So the codegen imports this file by absolute path, and this file — which does sit
|
|
10
|
-
* in `@fougere/nuxt` — does the resolving. One indirection, one reason.
|
|
11
|
-
*/
|
|
1
|
+
/** The boot, re-exported under a path inside this package. */
|
|
12
2
|
export { configureFougere, extendFougere, useFougereApp } from '@fougere/app';
|
|
13
3
|
//# sourceMappingURL=boot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../../../src/runtime/server/utils/boot.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../../../src/runtime/server/utils/boot.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAA4B,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../../../src/runtime/server/utils/invoke.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../../../src/runtime/server/utils/invoke.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElE,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACpC,KAAK,SAAS,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE5C,wBAAsB,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1G,wBAAsB,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The server dual of the couple — same designation (class + verb), same return,
|
|
3
|
-
* same errors. `invokeOn` places the call (local façade → direct in-memory
|
|
4
|
-
* execution, a frond in `remotes` → JSON-RPC on the wire); what this file owns is
|
|
5
|
-
* the one host-specific part: finding the current request.
|
|
6
|
-
*
|
|
7
|
-
* In request context the current session rides along (event.context →
|
|
8
|
-
* invocation.state); outside a request, state is empty or explicit.
|
|
9
|
-
*/
|
|
1
|
+
/** The server dual of the couple — same designation (class + verb), same return, same errors. */
|
|
10
2
|
import { useEvent } from 'nitropack/runtime';
|
|
11
3
|
import { invokeOn, useFougereApp } from '@fougere/app';
|
|
12
4
|
export async function invoke(target, opOrInput, input) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../../../../src/runtime/server/utils/invoke.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../../../../src/runtime/server/utils/invoke.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQvD,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,MAA+B,EAC/B,SAA8B,EAC9B,KAAiB;IAEjB,MAAM,GAAG,GAAG,MAAM,aAAa,EAAE,CAAC;IAClC,OAAO,QAAQ,CAAI,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,YAAY;IACnB,IAAI,CAAC;QACH,OAAO,CAAC,QAAQ,EAAE,EAAE,OAAO,IAAI,EAAE,CAA4B,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-alpha.0",
|
|
4
4
|
"description": "The Nuxt module: Fougere's client primitives and server surface.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@nuxt/kit": "^4.5.1",
|
|
35
35
|
"jiti": "^2.6.1",
|
|
36
|
-
"@fougere/
|
|
37
|
-
"@fougere/defaults": "0.
|
|
38
|
-
"@fougere/
|
|
36
|
+
"@fougere/app": "0.8.0-alpha.0",
|
|
37
|
+
"@fougere/defaults": "0.8.0-alpha.0",
|
|
38
|
+
"@fougere/core": "0.8.0-alpha.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@nuxt/schema": "^4.5.1",
|
package/src/module.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fougere/nuxt — Nuxt module: scans fronds, registers the four
|
|
3
|
-
* primitives (useQuery/useCommand, useFormFor, useCurrentUser) and the
|
|
4
|
-
* server surface (call envelope, session, REST bridge, auth).
|
|
5
|
-
*/
|
|
1
|
+
/** @fougere/nuxt — Nuxt module. */
|
|
6
2
|
import {
|
|
7
3
|
defineNuxtModule,
|
|
8
4
|
addServerHandler,
|
|
@@ -29,25 +25,12 @@ import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
|
29
25
|
export interface FougereModuleOptions {
|
|
30
26
|
/** Override fougere.config.ts values from nuxt.config. Optional. */
|
|
31
27
|
db?: FougereConfig['db'];
|
|
32
|
-
/**
|
|
33
|
-
* Where `fronds/` lives, relative to the app's rootDir. Default: the app
|
|
34
|
-
* itself. Set to `../..` for an app under `apps/*` in a workspace whose
|
|
35
|
-
* fronds are shared at the root. Config and `.fougere` stay app-local.
|
|
36
|
-
*/
|
|
28
|
+
/** Where `fronds/` lives, relative to the app's rootDir. */
|
|
37
29
|
root?: string;
|
|
38
30
|
|
|
39
31
|
/**
|
|
40
|
-
* One key per EXTENSION, and the key is the package suffix AND the export name —
|
|
41
|
-
* `
|
|
42
|
-
* keep in step with the packages, the same rule the scan applies to `@fronds/<name>`.
|
|
43
|
-
*
|
|
44
|
-
* An extension is a FUNCTION and this module writes a FILE, so a project cannot pass one
|
|
45
|
-
* here: it names one, and the options travel beside it as data.
|
|
46
|
-
*
|
|
47
|
-
* The keys are declared rather than left open on purpose. An open record would derive
|
|
48
|
-
* everything and accept `callz: {}` in silence — the failure this repo already records
|
|
49
|
-
* for `adapters:`, which "fails OPEN, giving neither completion nor a guard". The price
|
|
50
|
-
* is that a new extension package adds a key here.
|
|
32
|
+
* One key per EXTENSION, and the key is the package suffix AND the export name — `calls` is
|
|
33
|
+
* `import { calls } from '@fougere/calls'`.
|
|
51
34
|
*/
|
|
52
35
|
/** `@fougere/observability` — a span per operation, the four signals, OTLP. */
|
|
53
36
|
observability?: Record<string, unknown> | false;
|
|
@@ -55,13 +38,7 @@ export interface FougereModuleOptions {
|
|
|
55
38
|
calls?: Record<string, unknown> | false;
|
|
56
39
|
}
|
|
57
40
|
|
|
58
|
-
/**
|
|
59
|
-
* The extension keys, in the order they are mounted.
|
|
60
|
-
*
|
|
61
|
-
* A list and not the options object's own keys: the ORDER is ours, not the project's.
|
|
62
|
-
* `observability` installs the middleware that opens the span every log line written
|
|
63
|
-
* inside a call will carry — mounted the other way round, the lines leave uncorrelated.
|
|
64
|
-
*/
|
|
41
|
+
/** The extension keys, in the order they are mounted. */
|
|
65
42
|
const EXTENSION_KEYS = ['observability', 'calls'] as const;
|
|
66
43
|
|
|
67
44
|
/** What the project asked for, in mount order. `false` is how a key is turned off. */
|
|
@@ -113,6 +90,16 @@ const module = defineNuxtModule<FougereModuleOptions>({
|
|
|
113
90
|
}
|
|
114
91
|
// invoke reads the current request (state) through nitro's async context
|
|
115
92
|
nitroConfig.experimental = { ...nitroConfig.experimental, asyncContext: true };
|
|
93
|
+
// A provider's container key IS its class name, read off the constructor at boot.
|
|
94
|
+
// esbuild lowers `static readonly` fields and renames the declaration doing it, so
|
|
95
|
+
// `class Communes { static readonly SOURCE = … }` registers as `_Communes` and the
|
|
96
|
+
// handler that asks for `Communes` gets a container miss — measured on Nitro's dev
|
|
97
|
+
// pass, ten classes, the six with statics renamed and the four without untouched.
|
|
98
|
+
// Same statement as `mangle.reserved` below, on the pass that builds the server.
|
|
99
|
+
nitroConfig.esbuild = {
|
|
100
|
+
...nitroConfig.esbuild,
|
|
101
|
+
options: { ...nitroConfig.esbuild?.options, keepNames: true },
|
|
102
|
+
};
|
|
116
103
|
});
|
|
117
104
|
|
|
118
105
|
// ── 0. A TS-aware loader, installed twice on purpose ──
|
|
@@ -137,6 +124,15 @@ const module = defineNuxtModule<FougereModuleOptions>({
|
|
|
137
124
|
Object.entries(options).filter(([, v]) => v !== undefined),
|
|
138
125
|
) as Partial<FougereConfig>;
|
|
139
126
|
const config: FougereConfig = { db: 'sqlite', ...fileConfig, ...optionsOverride };
|
|
127
|
+
// Nitro replaces `console` with consola, whose own threshold sits at `info` — and a
|
|
128
|
+
// Logger line at `debug` goes out through `console.debug`, which consola then drops.
|
|
129
|
+
// Measured: the level was `debug`, the boot logged nothing, and the silence read as
|
|
130
|
+
// an app doing nothing rather than a host filtering.
|
|
131
|
+
if ((process.env.FOUGERE_LOG_LEVEL ?? config.logLevel) === 'debug') {
|
|
132
|
+
useLogger('fougere').warn(
|
|
133
|
+
'logLevel is debug, and Nitro\'s console drops that level — run with CONSOLA_LEVEL=4 to see it.',
|
|
134
|
+
);
|
|
135
|
+
}
|
|
140
136
|
const conventions = resolveConventions(config.conventions);
|
|
141
137
|
|
|
142
138
|
// Now the names are known, so the loader can resolve them — and the scan below runs
|
|
@@ -290,7 +286,7 @@ const module = defineNuxtModule<FougereModuleOptions>({
|
|
|
290
286
|
// 500 on every call in `nuxt dev`, 200 once the statement is the only source.
|
|
291
287
|
// A codegen inside one repo also had nothing to carry: `fougere sync` writes classes
|
|
292
288
|
// because its source is ANOTHER repo, and here the author can just import.
|
|
293
|
-
const
|
|
289
|
+
const frondsFile = ['fronds.ts', 'fronds.mts', 'fronds.js', 'fronds.mjs']
|
|
294
290
|
.map((f) => resolve(scanRoot, f)).find((f) => existsSync(f));
|
|
295
291
|
|
|
296
292
|
// No statement of its own: the build writes the one the scan implies, so the runtime
|
|
@@ -301,7 +297,7 @@ const module = defineNuxtModule<FougereModuleOptions>({
|
|
|
301
297
|
// do (`Post.js` for `Post.ts`), and Nitro externalizes a `.mjs` it can hand to Node —
|
|
302
298
|
// which then resolves `@fronds/*` against a package that does not exist, since an alias
|
|
303
299
|
// is a bundler's. Measured both ways, in-process: `.mjs` answers 500, `.ts` answers.
|
|
304
|
-
const statedPath =
|
|
300
|
+
const statedPath = frondsFile ?? addTemplate({
|
|
305
301
|
filename: 'fougere-fronds.ts',
|
|
306
302
|
write: true,
|
|
307
303
|
getContents: () => emitStatement(scan),
|
|
@@ -312,7 +308,7 @@ const module = defineNuxtModule<FougereModuleOptions>({
|
|
|
312
308
|
const bootTpl = addTemplate({
|
|
313
309
|
filename: 'fougere-boot.ts',
|
|
314
310
|
write: true,
|
|
315
|
-
getContents: () => generateBootPlugin(config, allSeeds, runtimeResolve('server/utils/boot'), extensionsOf(options), statedPath),
|
|
311
|
+
getContents: () => generateBootPlugin(config, allSeeds, runtimeResolve('server/utils/boot'), extensionsOf(options), statedPath, scanRoot),
|
|
316
312
|
});
|
|
317
313
|
addServerPlugin(bootTpl.dst);
|
|
318
314
|
|
|
@@ -325,28 +321,22 @@ export default module;
|
|
|
325
321
|
// Exported (not just module-internal) so its output is unit-testable without
|
|
326
322
|
// spinning up a whole Nuxt build.
|
|
327
323
|
|
|
328
|
-
/**
|
|
329
|
-
* What of the config a generated plugin can carry: values, never providers.
|
|
330
|
-
*
|
|
331
|
-
* `auth` holds a live object built by `betterAuth(...)`, so it cannot be written into a
|
|
332
|
-
* module — and it needs a database, which a codegen'd host has already resolved its own
|
|
333
|
-
* way. The rest is data and travels.
|
|
334
|
-
*/
|
|
324
|
+
/** What of the config a generated plugin can carry: values, never providers. */
|
|
335
325
|
function carried(config: FougereConfig): Partial<FougereConfig> {
|
|
336
|
-
const { remotes, adapters, sources } = config as FougereConfig & { sources?: unknown };
|
|
326
|
+
const { remotes, adapters, sources, logLevel } = config as FougereConfig & { sources?: unknown };
|
|
337
327
|
return {
|
|
338
328
|
...(remotes ? { remotes } : {}),
|
|
339
329
|
...(adapters ? { adapters } : {}),
|
|
340
330
|
...(sources ? { sources } : {}),
|
|
331
|
+
// The host hands its config over, so nothing re-reads the file at runtime — a key
|
|
332
|
+
// left out here is a key the app declared and no one applies.
|
|
333
|
+
...(logLevel ? { logLevel } : {}),
|
|
341
334
|
} as Partial<FougereConfig>;
|
|
342
335
|
}
|
|
343
336
|
|
|
344
337
|
/**
|
|
345
338
|
* The entity names a SYNCED remote brought in — `fougere sync` writes the classes under
|
|
346
339
|
* `.fougere/`, and a consumer designates them exactly as it designates its own.
|
|
347
|
-
*
|
|
348
|
-
* By filename and not by loading them: this runs before the loader is installed, and a
|
|
349
|
-
* class file is named after its class by the same convention the scan reads.
|
|
350
340
|
*/
|
|
351
341
|
async function syncedEntityNames(rootDir: string, conventions: Conventions): Promise<string[]> {
|
|
352
342
|
const remotesPath = resolve(rootDir, '.fougere', 'remotes.json');
|
|
@@ -376,6 +366,12 @@ export function generateBootPlugin(
|
|
|
376
366
|
extensions: { key: string; options: unknown }[] = [],
|
|
377
367
|
/** The app's own `fronds.ts`, when it states what it hosts instead of being scanned. */
|
|
378
368
|
statedPath?: string,
|
|
369
|
+
/**
|
|
370
|
+
* Where a relative `db.path` is counted from. Written as a LITERAL because the plugin
|
|
371
|
+
* runs with Nitro's own directory: `apps/nuxt` made a second, empty database beside
|
|
372
|
+
* itself while the workspace held the real one, and said nothing.
|
|
373
|
+
*/
|
|
374
|
+
root?: string,
|
|
379
375
|
): string {
|
|
380
376
|
const lines: string[] = [];
|
|
381
377
|
lines.push(`// Auto-generated by @fougere/nuxt — do not edit`);
|
|
@@ -447,14 +443,17 @@ export function generateBootPlugin(
|
|
|
447
443
|
// codegen'd plugin and fougereApp.ts's own fallback) land on the same file.
|
|
448
444
|
// The second argument only appears when there is something to say: an app with one
|
|
449
445
|
// database generates exactly the line it generated before.
|
|
450
|
-
const sourcesArg = sources ? `, ${JSON.stringify(sources)}` : '';
|
|
451
|
-
|
|
446
|
+
const sourcesArg = sources || root ? `, ${JSON.stringify(sources ?? undefined)}` : '';
|
|
447
|
+
const rootArg = root ? `, ${JSON.stringify(root)}` : '';
|
|
448
|
+
lines.push(` const storage = resolveStorage(${JSON.stringify(db)}${sourcesArg}${rootArg});`);
|
|
452
449
|
lines.push(``);
|
|
453
450
|
lines.push(` configureFougere({`);
|
|
454
451
|
if (statedPath) lines.push(` fronds,`);
|
|
455
452
|
lines.push(` config: ${JSON.stringify(carried(config))},`);
|
|
456
|
-
|
|
457
|
-
|
|
453
|
+
// The whole thing, not a hand-picked few of its members: the three this used to name
|
|
454
|
+
// left `transacted` and `close` behind, so a `Together` always compensated and the
|
|
455
|
+
// connection was never released — under Nuxt only, which is where the app really runs.
|
|
456
|
+
lines.push(` storage,`);
|
|
458
457
|
// Two members of the ascent, named — not a claim on everything after the boot. The
|
|
459
458
|
// storage's is core's own declaration (`migrating`), so this codegen states no order and
|
|
460
459
|
// cannot mistype the name it would otherwise be silently adding beside.
|
|
@@ -1,11 +1,4 @@
|
|
|
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
|
-
*/
|
|
1
|
+
/** The session. */
|
|
9
2
|
import { useState, useRequestFetch } from '#imports';
|
|
10
3
|
import { computed } from 'vue';
|
|
11
4
|
import type { SessionView } from '@fougere/app/client';
|
|
@@ -1,13 +1,4 @@
|
|
|
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
|
-
*/
|
|
1
|
+
/** The form contract — state, validation, submission, error mapping. */
|
|
11
2
|
import { reactive, computed } from 'vue';
|
|
12
3
|
import { lowerFirst, validationErrorsOf } from '@fougere/core/contract';
|
|
13
4
|
import { useCommand } from './useFougereData.js';
|
|
@@ -40,8 +31,8 @@ export function useFormFor<T = Record<string, unknown>>(entity: FormEntity, opti
|
|
|
40
31
|
for (const key of Object.keys(errors)) delete errors[key];
|
|
41
32
|
}
|
|
42
33
|
|
|
43
|
-
/** Local pre-
|
|
44
|
-
function
|
|
34
|
+
/** Local pre-verdict — same rules as the handler, saves a lost round-trip. */
|
|
35
|
+
function validator(): boolean {
|
|
45
36
|
clearErrors();
|
|
46
37
|
const result = entity.validate(payloadOf(values));
|
|
47
38
|
if (result.success) return true;
|
|
@@ -49,15 +40,11 @@ export function useFormFor<T = Record<string, unknown>>(entity: FormEntity, opti
|
|
|
49
40
|
return false;
|
|
50
41
|
}
|
|
51
42
|
|
|
52
|
-
/**
|
|
53
|
-
* Judge locally, then send through the command. Returns the created/updated
|
|
54
|
-
* value, or null when a judge (either side) rejected — the errors land per
|
|
55
|
-
* field either way, the form never knows who judged.
|
|
56
|
-
*/
|
|
43
|
+
/** Validate locally, then send through the command. */
|
|
57
44
|
async function submit(): Promise<T | null> {
|
|
58
|
-
if (!
|
|
45
|
+
if (!validator()) return null;
|
|
59
46
|
try {
|
|
60
|
-
return await command.execute({ params: options.params,
|
|
47
|
+
return await command.execute({ params: options.params, input: payloadOf(values) });
|
|
61
48
|
} catch (err) {
|
|
62
49
|
const refusals = validationErrorsOf(err);
|
|
63
50
|
if (refusals) {
|
|
@@ -71,10 +58,8 @@ export function useFormFor<T = Record<string, unknown>>(entity: FormEntity, opti
|
|
|
71
58
|
return {
|
|
72
59
|
fields,
|
|
73
60
|
/**
|
|
74
|
-
* The same fields, keyed by name — a form that lays its inputs out by hand binds
|
|
75
|
-
*
|
|
76
|
-
* its own. Without it, a page retypes `type="email"` next to a card that says
|
|
77
|
-
* `format: 'email'`, and the browser enforces the page rather than the declaration.
|
|
61
|
+
* The same fields, keyed by name — a form that lays its inputs out by hand binds one at a time
|
|
62
|
+
* (`v-bind="fieldsByName.email.attrs"`), and still states no rule of its own.
|
|
78
63
|
*/
|
|
79
64
|
fieldsByName: Object.fromEntries(fields.map((f) => [f.name, f])) as Record<string, FormField>,
|
|
80
65
|
values,
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The couple — useQuery (reads) and useCommand (writes), the two dual gestures of
|
|
3
|
-
*
|
|
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).
|
|
2
|
+
* The couple — useQuery (reads) and useCommand (writes), the two dual gestures of a page talking
|
|
3
|
+
* to a Frond, in Vue.
|
|
15
4
|
*/
|
|
16
5
|
import { useAsyncData, useRequestFetch, refreshNuxtData } from '#imports';
|
|
17
6
|
import { ref, computed, toValue, onScopeDispose, type MaybeRefOrGetter, type Ref } from 'vue';
|
|
@@ -1,9 +1,4 @@
|
|
|
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
|
-
*/
|
|
1
|
+
/** Session hydration — server half of useCurrentUser. */
|
|
7
2
|
import { defineNuxtPlugin, useRequestEvent, useState } from '#imports';
|
|
8
3
|
import { sessionViewOf, type SessionView } from '@fougere/app/client';
|
|
9
4
|
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* REST catch-all — the h3 half of a door whose decisions live in `@fougere/app`.
|
|
3
|
-
*
|
|
4
|
-
* It used to derive its own answers: its own `pluralize`, its own "segment = op or
|
|
5
|
-
* id", and its own method rule — which was no rule at all. A known operation name
|
|
6
|
-
* won whatever the verb, so `GET /api/blog/posts/delete?id=…` reached the mutating
|
|
7
|
-
* method with the session cookie a browser attaches to any navigation, and a
|
|
8
|
-
* body-less `DELETE /api/blog/posts` was read as `create`.
|
|
9
|
-
*
|
|
10
|
-
* `schema-rest` already answers all three in one place, `exposed === false`
|
|
11
|
-
* included — so the fix was not a guard added here, it was the removal of the
|
|
12
|
-
* second answer. `serveRest` is now the third: the same decision serves Next, and
|
|
13
|
-
* neither adapter restates it.
|
|
14
|
-
*
|
|
15
|
-
* What stays here is translation: read the h3 event, write the h3 answer. The state
|
|
16
|
-
* is stamped from `event.context` — what the server resolved, never the wire.
|
|
17
|
-
*/
|
|
1
|
+
/** REST catch-all — the h3 half of a door whose decisions live in `@fougere/app`. */
|
|
18
2
|
import { defineEventHandler, readBody, getQuery, createError, setResponseStatus, setResponseHeaders } from 'h3';
|
|
19
3
|
import { serveRest, useFougereApp } from '@fougere/app';
|
|
20
4
|
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Receiving end for the browser — the h3 half. The decision (which audience, which
|
|
3
|
-
* runner, what a parse failure answers) lives in `@fougere/app`; what stays here is
|
|
4
|
-
* getting a JSON payload out of an h3 event, which is the one thing that genuinely
|
|
5
|
-
* differs between hosts. Next reads `await request.json()` and needs none of this.
|
|
6
|
-
*
|
|
7
|
-
* Trust boundary, unchanged: the browser sits outside the topology, so `state` is
|
|
8
|
-
* stamped from the server-resolved session (event.context), never taken from the wire.
|
|
9
|
-
*/
|
|
1
|
+
/** Receiving end for the browser — the h3 half. */
|
|
10
2
|
import { defineEventHandler } from 'h3';
|
|
11
3
|
import { serveRpc, rpcParseError, useFougereApp } from '@fougere/app';
|
|
12
4
|
import { MAX_BODY_BYTES } from '@fougere/core';
|
|
@@ -63,20 +55,7 @@ async function readWebBody(req: WebReq): Promise<unknown> {
|
|
|
63
55
|
return {};
|
|
64
56
|
}
|
|
65
57
|
|
|
66
|
-
/**
|
|
67
|
-
* Read the JSON-RPC payload from the h3 event, agnostic to h3 version AND trust
|
|
68
|
-
* boundary. We read the event's shape directly instead of calling `readBody`,
|
|
69
|
-
* whose static `from 'h3'` import can bind to a different h3 major than the one
|
|
70
|
-
* that shaped the event (nitro's runtime is v1 here; devtools drag in v2) —
|
|
71
|
-
* `readBody` v2 on a v1 event throws `event.req.text is not a function`.
|
|
72
|
-
*
|
|
73
|
-
* Two shapes occur, both verified:
|
|
74
|
-
* - SSR internal `$fetch`: a synthetic event whose `node.req.body` is already
|
|
75
|
-
* the raw JSON string — the mock stream is not readable, never drain it.
|
|
76
|
-
* - Browser POST: a real IncomingMessage, drained via stream events (`for
|
|
77
|
-
* await` fails: the SSR mock has no async iterator).
|
|
78
|
-
* The `event.req.json()` branch is the future once nitro is fully on h3 v2.
|
|
79
|
-
*/
|
|
58
|
+
/** Read the JSON-RPC payload from the h3 event, agnostic to h3 version AND trust boundary. */
|
|
80
59
|
async function readJsonBody(event: { req?: unknown; node?: { req?: unknown } }): Promise<unknown> {
|
|
81
60
|
const rawNodeReq = event.node?.req;
|
|
82
61
|
const nodeReq = rawNodeReq && typeof rawNodeReq === 'object' ? rawNodeReq as NodeReq : undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The session view over the wire — same resolution the hydration reads,
|
|
3
|
-
*
|
|
4
|
-
* family as /_fougere/call.
|
|
2
|
+
* The session view over the wire — same resolution the hydration reads, for a client refreshing
|
|
3
|
+
* after login/logout.
|
|
5
4
|
*/
|
|
6
5
|
import { defineEventHandler } from 'h3';
|
|
7
6
|
import { sessionViewOf } from '@fougere/app';
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The boot, re-exported under a path inside this package.
|
|
3
|
-
*
|
|
4
|
-
* Every runtime file here reaches `@fougere/app` by name, because it is resolved
|
|
5
|
-
* from this package's own node_modules. The generated Nitro plugin cannot: it is
|
|
6
|
-
* written into the user's `.nuxt/`, so a bare `@fougere/app` would be resolved from
|
|
7
|
-
* the USER's project, where a transitive dependency is not visible under pnpm.
|
|
8
|
-
*
|
|
9
|
-
* So the codegen imports this file by absolute path, and this file — which does sit
|
|
10
|
-
* in `@fougere/nuxt` — does the resolving. One indirection, one reason.
|
|
11
|
-
*/
|
|
1
|
+
/** The boot, re-exported under a path inside this package. */
|
|
12
2
|
export { configureFougere, extendFougere, useFougereApp, type FougereServerConfig } from '@fougere/app';
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The server dual of the couple — same designation (class + verb), same return,
|
|
3
|
-
* same errors. `invokeOn` places the call (local façade → direct in-memory
|
|
4
|
-
* execution, a frond in `remotes` → JSON-RPC on the wire); what this file owns is
|
|
5
|
-
* the one host-specific part: finding the current request.
|
|
6
|
-
*
|
|
7
|
-
* In request context the current session rides along (event.context →
|
|
8
|
-
* invocation.state); outside a request, state is empty or explicit.
|
|
9
|
-
*/
|
|
1
|
+
/** The server dual of the couple — same designation (class + verb), same return, same errors. */
|
|
10
2
|
import { useEvent } from 'nitropack/runtime';
|
|
11
3
|
import { invokeOn, useFougereApp } from '@fougere/app';
|
|
12
4
|
import type { FrondCall, InvocationContext } from '@fougere/core';
|