@fougere/app 0.2.0-alpha.2 → 0.3.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/boot.d.ts +75 -3
- package/dist/boot.d.ts.map +1 -1
- package/dist/boot.js +120 -39
- package/dist/boot.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -3
- package/dist/client.js.map +1 -1
- package/dist/form.d.ts +25 -0
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +47 -8
- package/dist/form.js.map +1 -1
- package/dist/graphql.d.ts +12 -5
- package/dist/graphql.d.ts.map +1 -1
- package/dist/graphql.js +13 -33
- package/dist/graphql.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +10 -24
package/dist/boot.d.ts
CHANGED
|
@@ -1,26 +1,98 @@
|
|
|
1
|
-
import type { App, EntityOrm } from '@fougere/core';
|
|
1
|
+
import type { App, CreateAppOptions, EntityOrm, FougereConfig, Transport } from '@fougere/core';
|
|
2
2
|
import { type SchemaView } from '@fougere/schema';
|
|
3
3
|
export interface FougereServerConfig {
|
|
4
4
|
/** Storage handle. Forwarded to the auth provider via AuthContext.db. */
|
|
5
5
|
db?: unknown;
|
|
6
6
|
/** Per-entity ORM factory. */
|
|
7
7
|
ormFactory?: (entity: SchemaView, name: string) => EntityOrm;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* What this app takes on beyond its fronds, each stating what it does and what it undoes.
|
|
10
|
+
*
|
|
11
|
+
* It replaced `afterBoot`, which a host used to CLAIM the whole post-boot to get its own
|
|
12
|
+
* seeding — Nuxt's generated plugin did exactly that, and its copy of the seeding loop
|
|
13
|
+
* drifted. Declaring `{ name: 'seeds', up }` replaces that one member and leaves the
|
|
14
|
+
* rest of the ascent alone.
|
|
15
|
+
*/
|
|
16
|
+
extensions?: CreateAppOptions['extensions'];
|
|
10
17
|
/**
|
|
11
18
|
* What the boot line names as the host — 'Nuxt/Nitro', 'Next'. Stated by the
|
|
12
19
|
* adapter, never sniffed: a boot that guesses its host from what happens to be
|
|
13
20
|
* importable is the hidden runtime the doctrine refuses.
|
|
14
21
|
*/
|
|
15
22
|
host?: string;
|
|
23
|
+
/**
|
|
24
|
+
* What this app is built from, when the host already knows.
|
|
25
|
+
*
|
|
26
|
+
* Absent, `boot()` reads the fronds off the disk — right on a server, impossible on a
|
|
27
|
+
* runtime that has none: measured on workerd, `readdir` throws through unenv's shim and
|
|
28
|
+
* the app comes up with ZERO fronds, so every page renders and every door answers
|
|
29
|
+
* NOT_FOUND. A host that scanned at BUILD time can say so instead, and `fougere build`
|
|
30
|
+
* writes exactly this value down.
|
|
31
|
+
*
|
|
32
|
+
* Same slot as `CreateAppOptions.scan` and for the same reason: producing the value
|
|
33
|
+
* reads a disk, consuming it does not.
|
|
34
|
+
*/
|
|
35
|
+
scan?: CreateAppOptions['scan'];
|
|
36
|
+
/**
|
|
37
|
+
* What `fougere.config.ts` says, when the host already read it.
|
|
38
|
+
*
|
|
39
|
+
* The same rule as `scan`, and found the same way: `boot()` re-reads the file at
|
|
40
|
+
* runtime, which a Worker cannot do — measured, a consumer's `remotes:` never reached
|
|
41
|
+
* the boot and its pages rendered empty with nothing said. A host that read the config
|
|
42
|
+
* at BUILD time states it here instead.
|
|
43
|
+
*
|
|
44
|
+
* `auth` is deliberately not part of what a codegen'd host can carry: it holds a live
|
|
45
|
+
* provider, not a value. An app that authenticates reads its own config.
|
|
46
|
+
*/
|
|
47
|
+
config?: Partial<FougereConfig>;
|
|
48
|
+
/**
|
|
49
|
+
* Who performs an outgoing call, when the default cannot.
|
|
50
|
+
*
|
|
51
|
+
* `boot()` builds an HTTP transport from `remotes:` and that is right nearly
|
|
52
|
+
* everywhere. It is not right on Cloudflare: a Worker calling a sibling's public URL
|
|
53
|
+
* is refused by the edge with error 1042, so two Workers of one account reach each
|
|
54
|
+
* other through a SERVICE BINDING and through nothing else. A binding is a value only
|
|
55
|
+
* the host holds, so only the host can state this.
|
|
56
|
+
*
|
|
57
|
+
* It replaces the default entirely — signing included, since a host that builds its
|
|
58
|
+
* own transport is the one that knows what to put on the wire.
|
|
59
|
+
*/
|
|
60
|
+
remoteTransport?: (url: string) => Transport;
|
|
16
61
|
}
|
|
17
62
|
/**
|
|
18
63
|
* Override the data layer — only needed if you don't want the convention-driven
|
|
19
64
|
* setup based on `config.db` in fougere.config.ts.
|
|
20
65
|
*/
|
|
21
66
|
export declare function configureFougere(config: FougereServerConfig): void;
|
|
67
|
+
/**
|
|
68
|
+
* Add to what is already stated, instead of replacing it.
|
|
69
|
+
*
|
|
70
|
+
* A host states its app in PIECES when the pieces are known at different moments: a
|
|
71
|
+
* build writes the scan and the config into a generated plugin, and a value only the
|
|
72
|
+
* running process holds — a Cloudflare service binding — cannot be written there at all.
|
|
73
|
+
* Its dual is `configureFougere`, which replaces; `reloadFougere` depends on that
|
|
74
|
+
* replacement, so merging silently would have broken the turn of the ring.
|
|
75
|
+
*/
|
|
76
|
+
export declare function extendFougere(config: Partial<FougereServerConfig>): void;
|
|
22
77
|
/** Get the booted Fougere app. Lazy — boots on first call, then caches. */
|
|
23
78
|
export declare function useFougereApp(): Promise<App>;
|
|
79
|
+
/**
|
|
80
|
+
* Turn the ring: instantiate the app again, then let the previous one go.
|
|
81
|
+
*
|
|
82
|
+
* This is what "reload" means for anything the config CONSUMED — a value that built
|
|
83
|
+
* something cannot move under what it built, so the thing is built again. Its dual is
|
|
84
|
+
* `applyConfig`, for values that are merely consulted and need no turn at all.
|
|
85
|
+
*
|
|
86
|
+
* Every door reaches the app through `useFougereApp()` inside the request it serves and
|
|
87
|
+
* none holds it across two, which is what makes the swap invisible: the next request
|
|
88
|
+
* lands on the new app whether or not the old one has finished being released.
|
|
89
|
+
*
|
|
90
|
+
* A call already running finishes on the OLD app: it is drained before being released,
|
|
91
|
+
* so nothing has its storage closed underneath it. `timeoutMs` bounds that wait, and a
|
|
92
|
+
* drain that runs out REJECTS — the app is left alone rather than released under work,
|
|
93
|
+
* because a caller who cannot wait must choose that on purpose.
|
|
94
|
+
*/
|
|
95
|
+
export declare function reloadFougere(timeoutMs?: number): Promise<App>;
|
|
24
96
|
/**
|
|
25
97
|
* The store an app with no `db` runs on.
|
|
26
98
|
*
|
package/dist/boot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI5E,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,8BAA8B;IAC9B,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC;IAC7D;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC5C;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;CAC9C;AASD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,QAG3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,QAGjE;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,CAK5C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAWpE;AAoID;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CA+G3E"}
|
package/dist/boot.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Role } from '@fougere/schema';
|
|
2
|
+
import { Lifecycle } from '@fougere/schema';
|
|
1
3
|
/**
|
|
2
4
|
* Fougere server bootstrap — single entry point for an app's lifecycle,
|
|
3
5
|
* whatever hosts it.
|
|
@@ -6,7 +8,7 @@
|
|
|
6
8
|
* scans fronds off the filesystem and hands back an `App`. That is why it lives
|
|
7
9
|
* in `@fougere/app` rather than in one of the two adapters — the second host
|
|
8
10
|
* would otherwise have copied it, and a copied boot drifts (the seeding loop
|
|
9
|
-
* already did, `core/src/seed.ts`).
|
|
11
|
+
* already did, `core/src/boot/seed.ts`).
|
|
10
12
|
*
|
|
11
13
|
* Default path (zero-config): fougere.config.ts declares `db: 'sqlite'` and
|
|
12
14
|
* everything else; this module auto-resolves the storage handle, builds an
|
|
@@ -16,7 +18,8 @@
|
|
|
16
18
|
* host's own startup (a Nitro plugin, a Next instrumentation hook) if the user
|
|
17
19
|
* wants a custom data layer — alternative driver, managed migrations, etc.
|
|
18
20
|
*/
|
|
19
|
-
import { createApp,
|
|
21
|
+
import { createApp, identityFromEnv, Logger, migrating, seeding } from '@fougere/core';
|
|
22
|
+
import { scanProject, loadCascadedConfig, setModuleLoader, frondAliases, resolveConventions } from '@fougere/core/node';
|
|
20
23
|
import { createContainer } from '@fougere/container';
|
|
21
24
|
import { applyCreate, applyUpdate } from '@fougere/schema';
|
|
22
25
|
// ── State ────────────────────────────────────────
|
|
@@ -31,6 +34,19 @@ export function configureFougere(config) {
|
|
|
31
34
|
_config = config;
|
|
32
35
|
_appPromise = null;
|
|
33
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Add to what is already stated, instead of replacing it.
|
|
39
|
+
*
|
|
40
|
+
* A host states its app in PIECES when the pieces are known at different moments: a
|
|
41
|
+
* build writes the scan and the config into a generated plugin, and a value only the
|
|
42
|
+
* running process holds — a Cloudflare service binding — cannot be written there at all.
|
|
43
|
+
* Its dual is `configureFougere`, which replaces; `reloadFougere` depends on that
|
|
44
|
+
* replacement, so merging silently would have broken the turn of the ring.
|
|
45
|
+
*/
|
|
46
|
+
export function extendFougere(config) {
|
|
47
|
+
_config = { ..._config, ...config };
|
|
48
|
+
_appPromise = null;
|
|
49
|
+
}
|
|
34
50
|
/** Get the booted Fougere app. Lazy — boots on first call, then caches. */
|
|
35
51
|
export function useFougereApp() {
|
|
36
52
|
if (!_appPromise) {
|
|
@@ -38,31 +54,86 @@ export function useFougereApp() {
|
|
|
38
54
|
}
|
|
39
55
|
return _appPromise;
|
|
40
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Turn the ring: instantiate the app again, then let the previous one go.
|
|
59
|
+
*
|
|
60
|
+
* This is what "reload" means for anything the config CONSUMED — a value that built
|
|
61
|
+
* something cannot move under what it built, so the thing is built again. Its dual is
|
|
62
|
+
* `applyConfig`, for values that are merely consulted and need no turn at all.
|
|
63
|
+
*
|
|
64
|
+
* Every door reaches the app through `useFougereApp()` inside the request it serves and
|
|
65
|
+
* none holds it across two, which is what makes the swap invisible: the next request
|
|
66
|
+
* lands on the new app whether or not the old one has finished being released.
|
|
67
|
+
*
|
|
68
|
+
* A call already running finishes on the OLD app: it is drained before being released,
|
|
69
|
+
* so nothing has its storage closed underneath it. `timeoutMs` bounds that wait, and a
|
|
70
|
+
* drain that runs out REJECTS — the app is left alone rather than released under work,
|
|
71
|
+
* because a caller who cannot wait must choose that on purpose.
|
|
72
|
+
*/
|
|
73
|
+
export async function reloadFougere(timeoutMs) {
|
|
74
|
+
const previous = _appPromise;
|
|
75
|
+
_appPromise = null;
|
|
76
|
+
// The new one first: a boot that fails leaves the previous app serving, still whole.
|
|
77
|
+
const next = await useFougereApp();
|
|
78
|
+
if (previous) {
|
|
79
|
+
const old = await previous;
|
|
80
|
+
await old.drain(timeoutMs);
|
|
81
|
+
await old.dispose();
|
|
82
|
+
}
|
|
83
|
+
return next;
|
|
84
|
+
}
|
|
41
85
|
// ── Boot ─────────────────────────────────────────
|
|
42
86
|
async function boot() {
|
|
43
87
|
const bootStart = performance.now();
|
|
44
|
-
const log = new Logger('boot'
|
|
88
|
+
const log = new Logger('boot');
|
|
45
89
|
log.info(`booting (${_config.host ?? 'app'})`);
|
|
46
90
|
const { createJiti } = await import('jiti');
|
|
47
91
|
// Nitro serves from a bundle, but the scan still reads frond sources from disk — so the
|
|
48
92
|
// named form a frond uses for its neighbour has to resolve here too.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
93
|
+
//
|
|
94
|
+
// Installed twice: the config names the scope the aliases are built from, so reading it
|
|
95
|
+
// must not need them. Nothing in `fougere.config.ts` may import `@fronds/*`.
|
|
96
|
+
//
|
|
97
|
+
// And installed only when something is going to READ a source. A host that handed in
|
|
98
|
+
// both its scan and its config has nothing left to load, and jiti cannot run where
|
|
99
|
+
// there is no module resolver: measured on workerd, `createJiti` threw
|
|
100
|
+
// `Cannot read properties of undefined (reading 'paths')` and every request answered
|
|
101
|
+
// 500 — the loader was being built for files that no longer needed opening.
|
|
102
|
+
const reads = _config.scan === undefined || _config.config === undefined;
|
|
103
|
+
const installLoader = (alias) => {
|
|
104
|
+
if (!reads)
|
|
105
|
+
return;
|
|
106
|
+
const jiti = createJiti(import.meta.url, { interopDefault: true, ...(alias ? { alias } : {}) });
|
|
107
|
+
setModuleLoader((filePath) => jiti.import(filePath));
|
|
108
|
+
};
|
|
109
|
+
installLoader();
|
|
54
110
|
// Config cascades along the workspace→app frontier: the workspace root (via
|
|
55
111
|
// FOUGERE_ROOT, where `remotes`/shared db live) is the base, the app (cwd)
|
|
56
112
|
// overrides. Same boundary the fronds cascade along. No `root` → both equal.
|
|
57
113
|
const configRoot = process.cwd();
|
|
58
114
|
const root = process.env.FOUGERE_ROOT ?? configRoot;
|
|
59
|
-
|
|
115
|
+
// The host's word wins, for the reason it wins on `scan`: it read the file already,
|
|
116
|
+
// and where there is no file a second read finds nothing and says nothing.
|
|
117
|
+
const fileConfig = _config.config
|
|
118
|
+
?? (await loadCascadedConfig(root, configRoot));
|
|
119
|
+
const conventions = resolveConventions(fileConfig.conventions);
|
|
120
|
+
// `frondAliases` reads a directory listing, so it is asked only when the loader it
|
|
121
|
+
// feeds is going to exist at all.
|
|
122
|
+
if (reads)
|
|
123
|
+
installLoader(await frondAliases(root, conventions));
|
|
60
124
|
// Auto-resolve the data layer from config.db when the user didn't provide a
|
|
61
125
|
// custom one via configureFougere. The resolution itself lives in @fougere/defaults
|
|
62
126
|
// — this host must not know which storage package backs `db:`.
|
|
63
127
|
let db = _config.db;
|
|
64
128
|
let ormFactory = _config.ormFactory;
|
|
65
|
-
|
|
129
|
+
// The storage's two halves, kept together: its ascent is an extension, its connection
|
|
130
|
+
// is not — it is opened here, before the container, so it closes after the container.
|
|
131
|
+
let storageMigrate;
|
|
132
|
+
let closeStorage;
|
|
133
|
+
// Where the rows are, and how to open a transaction there — read from the same storage
|
|
134
|
+
// resolution, because a frame's realization is decided by `sources:` and nothing else.
|
|
135
|
+
let sourceOf;
|
|
136
|
+
let transacted;
|
|
66
137
|
if (!ormFactory) {
|
|
67
138
|
const { resolveStorage } = await import('@fougere/defaults');
|
|
68
139
|
const storage = resolveStorage(fileConfig.db, fileConfig.sources);
|
|
@@ -70,7 +141,10 @@ async function boot() {
|
|
|
70
141
|
log.debug('auto-resolving storage from config.db');
|
|
71
142
|
db = storage.db;
|
|
72
143
|
ormFactory = storage.ormFactory;
|
|
73
|
-
|
|
144
|
+
sourceOf = storage.sourceOf;
|
|
145
|
+
transacted = storage.transacted;
|
|
146
|
+
storageMigrate = storage.migrate;
|
|
147
|
+
closeStorage = storage.close;
|
|
74
148
|
}
|
|
75
149
|
else {
|
|
76
150
|
log.debug('no db declared — falling back to in-memory ORM');
|
|
@@ -79,44 +153,51 @@ async function boot() {
|
|
|
79
153
|
}
|
|
80
154
|
// Layer-2 wiring: `remotes: { catalog: 'http://...' }` in fougere.config.ts
|
|
81
155
|
// is all the user writes — the default transport comes from here.
|
|
82
|
-
|
|
83
|
-
|
|
156
|
+
// The host's word wins here too — and where it speaks, nothing below runs: building
|
|
157
|
+
// the default would import the transport and read the environment for a key, both
|
|
158
|
+
// pointless once the caller has said who carries the call.
|
|
159
|
+
let remoteTransport = _config.remoteTransport;
|
|
160
|
+
if (!remoteTransport && Object.keys(fileConfig.remotes ?? {}).length > 0) {
|
|
84
161
|
log.debug(`remotes declared (${Object.keys(fileConfig.remotes).join(', ')}) — wiring HTTP transport`);
|
|
85
162
|
const { createHttpTransport } = await import('@fougere/transport-http');
|
|
86
|
-
|
|
163
|
+
// A call that leaves this process carries a proof of who sent it, when the
|
|
164
|
+
// deployment gave one. Without a key it travels as a bare claim, which only a
|
|
165
|
+
// receiver that trusts no root will take.
|
|
166
|
+
const { sign } = await identityFromEnv();
|
|
167
|
+
remoteTransport = (url) => createHttpTransport(url, { ...(sign ? { sign } : {}) });
|
|
87
168
|
}
|
|
88
169
|
const app = await createApp({
|
|
89
|
-
|
|
170
|
+
// The host's word wins: it scanned at build, and a second scan here would either
|
|
171
|
+
// repeat that work or — where there is no disk — find nothing and say so quietly.
|
|
172
|
+
scan: _config.scan ?? (await scanProject(root, undefined, conventions)),
|
|
90
173
|
createContainer,
|
|
91
174
|
ormFactory,
|
|
175
|
+
sourceOf,
|
|
176
|
+
transacted,
|
|
92
177
|
db,
|
|
93
178
|
auth: fileConfig.auth,
|
|
94
179
|
adapters: fileConfig.adapters,
|
|
95
180
|
remotes: fileConfig.remotes,
|
|
96
181
|
remoteTransport,
|
|
182
|
+
/**
|
|
183
|
+
* The whole ascent, one ordered list: tables, then rows, then what the host adds.
|
|
184
|
+
* A host wanting its OWN seeding declares `{ name: 'seeds', … }` and replaces that
|
|
185
|
+
* member — it no longer has to claim everything after the boot to get it.
|
|
186
|
+
*/
|
|
187
|
+
extensions: [
|
|
188
|
+
// The slot is declared even when this host resolved no storage — a host that resolved
|
|
189
|
+
// its own (the Nitro plugin does, for its bundler) then REPLACES this member in place
|
|
190
|
+
// instead of adding one after the seeds, which is rows before tables.
|
|
191
|
+
migrating(storageMigrate),
|
|
192
|
+
seeding((message) => log.info(`[seed]${message}`)),
|
|
193
|
+
...(_config.extensions ?? []),
|
|
194
|
+
],
|
|
195
|
+
// Opened before the container, so released after it. Never wired here until now:
|
|
196
|
+
// this host boots the storage and no host closed one, which is what made a reload
|
|
197
|
+
// leak the pool of every app it discarded.
|
|
198
|
+
onDispose: closeStorage,
|
|
97
199
|
});
|
|
98
|
-
|
|
99
|
-
// entity gained. Auth entities travel with the app, no synthetic frond needed.
|
|
100
|
-
if (migrateSchema) {
|
|
101
|
-
log.debug('migrating schema from entities');
|
|
102
|
-
await migrateSchema(app);
|
|
103
|
-
}
|
|
104
|
-
if (_config.afterBoot) {
|
|
105
|
-
// A host that declares `afterBoot` OWNS what happens after the boot, seeding
|
|
106
|
-
// included — Nuxt's generated Nitro plugin does exactly that, because Nitro
|
|
107
|
-
// bundles and the seed modules have to be spelled out as static imports for it.
|
|
108
|
-
log.debug('running afterBoot');
|
|
109
|
-
await _config.afterBoot(app);
|
|
110
|
-
log.info('afterBoot done');
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
// Nobody claimed it, so the boot seeds. The scan already carries each seed's
|
|
114
|
-
// data (`SeedEntry.data` is its resolved default export), and the order comes
|
|
115
|
-
// from core — the same `orderSeeds`/`runSeeds` pair Nuxt's plugin calls. A host
|
|
116
|
-
// that does not bundle its frond sources needs nothing else.
|
|
117
|
-
const { orderSeeds, runSeeds } = await import('@fougere/core');
|
|
118
|
-
await runSeeds(app, orderSeeds(app.fronds), (message) => log.info(`[seed]${message}`));
|
|
119
|
-
}
|
|
200
|
+
log.info(`ascent: ${app.extensions().join(' → ') || 'nothing declared'}`);
|
|
120
201
|
const ms = (performance.now() - bootStart).toFixed(0);
|
|
121
202
|
log.info(`ready in ${ms}ms — ${app.fronds.length} frond(s)${app.auth ? ` + auth (${app.auth.basePath})` : ''}`);
|
|
122
203
|
return app;
|
|
@@ -134,7 +215,7 @@ async function boot() {
|
|
|
134
215
|
*/
|
|
135
216
|
export function createMemoryOrm(entity, name) {
|
|
136
217
|
const fields = entity.getFields();
|
|
137
|
-
const pk = Object.entries(fields).find(([, field]) => field.
|
|
218
|
+
const pk = Object.entries(fields).find(([, field]) => Role.of(field).isPrimary)?.[0] ?? 'id';
|
|
138
219
|
const store = new Map();
|
|
139
220
|
// `EntityOrm.findById(id: string)` — but a key can hold a number, and a Map keyed on
|
|
140
221
|
// `1` does not answer `'1'`. SQL never had the question; here the divergence was
|
|
@@ -213,7 +294,7 @@ export function createMemoryOrm(entity, name) {
|
|
|
213
294
|
const held = store.get(keyOf(id));
|
|
214
295
|
if (held) {
|
|
215
296
|
for (const [key, field] of Object.entries(fields)) {
|
|
216
|
-
if (key === pk || (field.
|
|
297
|
+
if (key === pk || Lifecycle.of(field).stampedOnce)
|
|
217
298
|
record[key] = held[key];
|
|
218
299
|
}
|
|
219
300
|
}
|
package/dist/boot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,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AM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;YACnD,MAAM,OAAO,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;YACnF,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;YAC9B,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,EAAU,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,OAAmB,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC;KAC7C,CAAC;AACJ,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -59,6 +59,6 @@ export declare function pageOf(data: unknown): {
|
|
|
59
59
|
* code the server never sent.
|
|
60
60
|
*/
|
|
61
61
|
export declare function asFougereError(err: unknown, entityKey: string, op: string): FougereError;
|
|
62
|
-
export { formFieldsOf, payloadOf, errorsByField, type FormEntity, type FormField, } from './form.js';
|
|
62
|
+
export { formFieldsOf, tableColumnsOf, payloadOf, errorsByField, type FormEntity, type FormField, type TableColumn, } from './form.js';
|
|
63
63
|
export { sessionViewOf, type SessionView } from './session.js';
|
|
64
64
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,YAAY,EAGZ,KAAK,iBAAiB,EACtB,KAAK,SAAS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AK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAE/F;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAUxF;AAKD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,SAAS,EACT,aAAa,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* the transport's client subpath, never the boot. `@fougere/app/client` is the
|
|
14
14
|
* subpath that keeps it that way.
|
|
15
15
|
*/
|
|
16
|
-
import { FougereError, ErrorCode,
|
|
16
|
+
import { FougereError, ErrorCode, registrationKeyOf, } from '@fougere/core/contract';
|
|
17
17
|
import { frameCall, unframeResponse } from '@fougere/transport-http/client';
|
|
18
18
|
/** The one door the browser knows. A named surface adds `/{surface}` to it. */
|
|
19
19
|
export const CALL_ENDPOINT = '/_fougere/call';
|
|
20
20
|
let nextId = 1;
|
|
21
21
|
/** The registration key an entity class designates. */
|
|
22
22
|
export function entityKeyOf(entity) {
|
|
23
|
-
return
|
|
23
|
+
return registrationKeyOf(entity.name);
|
|
24
24
|
}
|
|
25
25
|
export function callOf(entity, op) {
|
|
26
26
|
return { entity: entityKeyOf(entity), op };
|
|
@@ -119,6 +119,6 @@ export function asFougereError(err, entityKey, op) {
|
|
|
119
119
|
// The form contract is host-independent too, and a form is client code — so it
|
|
120
120
|
// reaches the browser through this subpath rather than through the package root,
|
|
121
121
|
// which carries the boot.
|
|
122
|
-
export { formFieldsOf, payloadOf, errorsByField, } from './form.js';
|
|
122
|
+
export { formFieldsOf, tableColumnsOf, payloadOf, errorsByField, } from './form.js';
|
|
123
123
|
export { sessionViewOf } from './session.js';
|
|
124
124
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,YAAY,EACZ,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,YAAY,EACZ,SAAS,EACT,iBAAiB,GAGlB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAoB,MAAM,gCAAgC,CAAC;AAQ9F,+EAA+E;AAC/E,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAI9C,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,uDAAuD;AACvD,MAAM,UAAU,WAAW,CAAC,MAAmB;IAC7C,OAAO,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,MAAmB,EAAE,EAAU;IACpD,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAiB;IAC5C,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC;AACzE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB,EAAE,EAAU,EAAE,KAAiB;IACzE,OAAO,WAAW,SAAS,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;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GAAG,YAAY,YAAY;QAChC,CAAC,CAAC,GAAG;QACL,CAAC,CAAC,IAAI,YAAY,CAAC;YACf,IAAI,EAAE,SAAS,CAAC,mBAAmB;YACnC,OAAO,EAAG,GAAa,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC;YAC/C,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,GAAG;SACX,CAAC,CAAC;AACT,CAAC;AAED,+EAA+E;AAC/E,iFAAiF;AACjF,0BAA0B;AAC1B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,SAAS,EACT,aAAa,GAId,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAC"}
|
package/dist/form.d.ts
CHANGED
|
@@ -65,6 +65,31 @@ export interface FormField {
|
|
|
65
65
|
* lifecycle axis (any create rule makes absence legal).
|
|
66
66
|
*/
|
|
67
67
|
export declare function formFieldsOf(entity: FormEntity, entityKey: string): FormField[];
|
|
68
|
+
export interface TableColumn {
|
|
69
|
+
name: string;
|
|
70
|
+
/**
|
|
71
|
+
* How to print the value — the dual of {@link FormField.control}, and deliberately not
|
|
72
|
+
* the same list: a closed set prints as its value, a reference prints as a link.
|
|
73
|
+
*/
|
|
74
|
+
render: 'text' | 'number' | 'boolean' | 'date' | 'json' | 'link';
|
|
75
|
+
/** The same key a form uses for the same field — one convention, two projections. */
|
|
76
|
+
labelKey: string;
|
|
77
|
+
label: string;
|
|
78
|
+
/**
|
|
79
|
+
* The entity a `link` points at, under the key its door is named by. Always present on a
|
|
80
|
+
* reference: the card carries the target's name, and a card rebuilt with no sibling to
|
|
81
|
+
* resolve to keeps it as a stand-in rather than losing it.
|
|
82
|
+
*/
|
|
83
|
+
to?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The columns a list is made of: membership from the io projection (`outputFields` — what
|
|
87
|
+
* may leave), minus collections, because a cell holds one value and a `many()` is a page.
|
|
88
|
+
*
|
|
89
|
+
* Which column identifies the row is NOT answered here — `primaryFieldOf` answers it for a
|
|
90
|
+
* shape, and its own doc records what five private copies of that loop cost.
|
|
91
|
+
*/
|
|
92
|
+
export declare function tableColumnsOf(entity: FormEntity, entityKey: string): TableColumn[];
|
|
68
93
|
/**
|
|
69
94
|
* The wire body of the form's values — an empty control is an absent value
|
|
70
95
|
* at the create boundary (absence is judged by the lifecycle axis, an empty
|
package/dist/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAS,UAAU,EAAE,eAAe,EAAoB,MAAM,iBAAiB,CAAC;AAE5F;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC;AAcpC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC7E,QAAQ,EAAE,OAAO,CAAC;IAClB,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;QAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA6DD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,CAkB/E;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACjE,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAaD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE,CAYnF;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIlF;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO/E"}
|
package/dist/form.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { Lifecycle } from '@fougere/schema';
|
|
1
2
|
/**
|
|
2
3
|
* Form contract, pure part — derives what a create/edit form is made of
|
|
3
4
|
* from the entity's field axes. No Vue, no Nuxt: testable headless,
|
|
4
5
|
* usable by any renderer (the page owns the widgets).
|
|
5
6
|
*/
|
|
6
|
-
import { Anatomy, inputFields } from '@fougere/schema';
|
|
7
|
+
import { Anatomy, inputFields, outputFields, registrationKeyOf, Role } from '@fougere/schema';
|
|
7
8
|
/**
|
|
8
9
|
* The literal a field is born with, when it declares one.
|
|
9
10
|
*
|
|
@@ -13,10 +14,7 @@ import { Anatomy, inputFields } from '@fougere/schema';
|
|
|
13
14
|
* is decided at write time, so a form has nothing to show for them.
|
|
14
15
|
*/
|
|
15
16
|
function defaultOf(field) {
|
|
16
|
-
|
|
17
|
-
return create !== null && typeof create === 'object' && 'value' in create
|
|
18
|
-
? create.value
|
|
19
|
-
: undefined;
|
|
17
|
+
return Lifecycle.of(field).literal?.value;
|
|
20
18
|
}
|
|
21
19
|
/** The base JSON type of a shape — unwraps the `[T,'null']` union. */
|
|
22
20
|
function baseType(type) {
|
|
@@ -68,6 +66,13 @@ function attrsOf(field, control, required) {
|
|
|
68
66
|
};
|
|
69
67
|
return Object.fromEntries(Object.entries(attrs).filter(([, v]) => v !== undefined));
|
|
70
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* The label convention, spelled once for both projections: an i18n key by convention and
|
|
71
|
+
* the field's own name as the fallback. The schema never carries display text.
|
|
72
|
+
*/
|
|
73
|
+
function labelOf(name, entityKey) {
|
|
74
|
+
return { labelKey: `${entityKey}.${name}`, label: name.charAt(0).toUpperCase() + name.slice(1) };
|
|
75
|
+
}
|
|
71
76
|
/**
|
|
72
77
|
* The fields a create form is made of: membership from the io projection
|
|
73
78
|
* (`inputFields` — what a client may supply), requiredness from the
|
|
@@ -77,14 +82,13 @@ export function formFieldsOf(entity, entityKey) {
|
|
|
77
82
|
return Object.entries(inputFields(entity.getFields())).map(([name, field]) => {
|
|
78
83
|
const f = field;
|
|
79
84
|
const control = controlOf(f);
|
|
80
|
-
const required = f.
|
|
85
|
+
const required = Lifecycle.of(f).requiredAtCreate;
|
|
81
86
|
const attrs = attrsOf(f, control, required);
|
|
82
87
|
return {
|
|
83
88
|
name,
|
|
84
89
|
control,
|
|
85
90
|
required,
|
|
86
|
-
|
|
87
|
-
label: name.charAt(0).toUpperCase() + name.slice(1),
|
|
91
|
+
...labelOf(name, entityKey),
|
|
88
92
|
...(Array.isArray(enumOf(f))
|
|
89
93
|
? { options: enumOf(f).filter((value) => typeof value === 'string') }
|
|
90
94
|
: {}),
|
|
@@ -93,6 +97,41 @@ export function formFieldsOf(entity, entityKey) {
|
|
|
93
97
|
};
|
|
94
98
|
});
|
|
95
99
|
}
|
|
100
|
+
/** Asked of the relation before the shape: a reference's own shape is a bare string. */
|
|
101
|
+
function renderOf(field) {
|
|
102
|
+
if (Role.of(field).isReference)
|
|
103
|
+
return 'link';
|
|
104
|
+
const base = Anatomy.of(field.shape).base;
|
|
105
|
+
if (base?.type === 'number' || base?.type === 'integer')
|
|
106
|
+
return 'number';
|
|
107
|
+
if (base?.type === 'boolean')
|
|
108
|
+
return 'boolean';
|
|
109
|
+
if (base?.type === 'object' || base?.type === 'array')
|
|
110
|
+
return 'json';
|
|
111
|
+
if (base?.type === 'string' && base.format === 'date-time')
|
|
112
|
+
return 'date';
|
|
113
|
+
return 'text';
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The columns a list is made of: membership from the io projection (`outputFields` — what
|
|
117
|
+
* may leave), minus collections, because a cell holds one value and a `many()` is a page.
|
|
118
|
+
*
|
|
119
|
+
* Which column identifies the row is NOT answered here — `primaryFieldOf` answers it for a
|
|
120
|
+
* shape, and its own doc records what five private copies of that loop cost.
|
|
121
|
+
*/
|
|
122
|
+
export function tableColumnsOf(entity, entityKey) {
|
|
123
|
+
return Object.entries(outputFields(entity.getFields()))
|
|
124
|
+
.filter(([, field]) => !Role.of(field).isCollection)
|
|
125
|
+
.map(([name, field]) => {
|
|
126
|
+
const target = Role.of(field).target;
|
|
127
|
+
return {
|
|
128
|
+
name,
|
|
129
|
+
render: renderOf(field),
|
|
130
|
+
...labelOf(name, entityKey),
|
|
131
|
+
...(target ? { to: registrationKeyOf(target.name) } : {}),
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}
|
|
96
135
|
/**
|
|
97
136
|
* The wire body of the form's values — an empty control is an absent value
|
|
98
137
|
* at the create boundary (absence is judged by the lifecycle axis, an empty
|
package/dist/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAa9F;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,KAAY;IAC7B,OAAO,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC;AAC5C,CAAC;AAsDD,sEAAsE;AACtE,SAAS,QAAQ,CAAC,IAAa;IAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,MAAM,CAAY,IAAI,QAAQ,CAAC;IACvF,OAAQ,IAAe,IAAI,QAAQ,CAAC;AACtC,CAAC;AAED,wFAAwF;AACxF,MAAM,iBAAiB,GAAyC;IAC9D,WAAW,EAAE,MAAM;IACnB,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;CACX,CAAC;AAEF,SAAS,SAAS,CAAC,KAAY;IAC7B,wFAAwF;IACxF,wFAAwF;IACxF,oFAAoF;IACpF,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,EAAE,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM;QAAE,OAA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G,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC;QACjD,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC;IACjC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/graphql.d.ts
CHANGED
|
@@ -7,11 +7,18 @@
|
|
|
7
7
|
* then `registerGraphQL` on a router). Every one of those lines is convention —
|
|
8
8
|
* there is no decision in them — so the app declaring the adapter is enough.
|
|
9
9
|
*
|
|
10
|
-
* The
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* The package is imported LAZILY, the same shape `db: 'sqlite'` uses (`resolveStorage`
|
|
11
|
+
* pulls `@fougere/adapter-sql` only when a database is declared). A schema builder is
|
|
12
|
+
* heavy and most apps serve none, so a host must not carry one to find out. Declaring
|
|
13
|
+
* the adapter without installing it is refused by name, the way an unresolvable dialect is.
|
|
14
|
+
*
|
|
15
|
+
* This file used to BUILD the schema — a Pothos builder, `registerAll`, then `graphql()`
|
|
16
|
+
* — which made it the only schema constructor in the repo, in the package least entitled
|
|
17
|
+
* to be one. Two costs, one cause: the derivation sat away from the adapter whose job it
|
|
18
|
+
* is, and `graphql` guards its types with `instanceOf`, so a schema built on one side of
|
|
19
|
+
* the package boundary was refused on the other as coming *"from another module or
|
|
20
|
+
* realm"*. Both are gone: `@fougere/adapter-graphql` derives and executes, this door
|
|
21
|
+
* translates the result into an `Outcome`.
|
|
15
22
|
*/
|
|
16
23
|
import type { App } from '@fougere/core';
|
|
17
24
|
import type { Outcome } from './serve.js';
|
package/dist/graphql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../src/graphql.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../src/graphql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAyBD;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAoBtF"}
|
package/dist/graphql.js
CHANGED
|
@@ -1,34 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
const schemas = new WeakMap();
|
|
3
|
-
async function schemaFor(app, surface) {
|
|
4
|
-
const perApp = schemas.get(app) ?? new Map();
|
|
5
|
-
schemas.set(app, perApp);
|
|
6
|
-
const key = surface ?? '';
|
|
7
|
-
const built = perApp.get(key);
|
|
8
|
-
if (built)
|
|
9
|
-
return built;
|
|
10
|
-
let SchemaBuilder;
|
|
11
|
-
let registerAll;
|
|
1
|
+
async function executor() {
|
|
12
2
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
const { executeOn } = await import('@fougere/adapter-graphql');
|
|
4
|
+
return executeOn;
|
|
15
5
|
}
|
|
16
6
|
catch (cause) {
|
|
17
|
-
throw new Error("adapters: { graphql: true } is declared, but the
|
|
18
|
-
|
|
19
|
-
'
|
|
20
|
-
'
|
|
7
|
+
throw new Error("adapters: { graphql: true } is declared, but the package that serves it is not " +
|
|
8
|
+
'installed. Add `@fougere/adapter-graphql` — it is not a dependency of the host, ' +
|
|
9
|
+
'because an app that serves no GraphQL should not carry a schema builder to find ' +
|
|
10
|
+
'that out.', { cause });
|
|
21
11
|
}
|
|
22
|
-
// Every line here is convention: a builder, the two root types, and the entities
|
|
23
|
-
// the app already scanned. Nothing an app could usefully say differently — which is
|
|
24
|
-
// why declaring the adapter is the whole configuration.
|
|
25
|
-
const builder = new SchemaBuilder({});
|
|
26
|
-
builder.queryType({});
|
|
27
|
-
builder.mutationType({});
|
|
28
|
-
registerAll(builder, app, surface ? { surface } : undefined);
|
|
29
|
-
const schema = builder.toSchema();
|
|
30
|
-
perApp.set(key, schema);
|
|
31
|
-
return schema;
|
|
32
12
|
}
|
|
33
13
|
/**
|
|
34
14
|
* Execute a GraphQL request against the app's own operations.
|
|
@@ -42,14 +22,14 @@ export async function serveGraphQL(app, request) {
|
|
|
42
22
|
if (!request.query) {
|
|
43
23
|
return { kind: 'error', status: 400, body: { message: 'Missing query' } };
|
|
44
24
|
}
|
|
45
|
-
const
|
|
46
|
-
const result = await
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
variableValues: request.variables,
|
|
25
|
+
const executeOn = await executor();
|
|
26
|
+
const result = await executeOn(app, {
|
|
27
|
+
query: request.query,
|
|
28
|
+
variables: request.variables,
|
|
50
29
|
operationName: request.operationName,
|
|
30
|
+
surface: request.surface,
|
|
51
31
|
// The same state every other door stamps: what the server resolved, never the wire.
|
|
52
|
-
|
|
32
|
+
state: request.state,
|
|
53
33
|
});
|
|
54
34
|
// A GraphQL error is not an HTTP error: the transport succeeded, and the errors ride
|
|
55
35
|
// in the body where a client is required to look for them.
|
package/dist/graphql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../src/graphql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../src/graphql.ts"],"names":[],"mappings":"AA2CA,KAAK,UAAU,QAAQ;IACrB,IAAI,CAAC;QACH,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;QAC/D,OAAO,SAAiC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,iFAAiF;YACjF,kFAAkF;YAClF,kFAAkF;YAClF,WAAW,EACX,EAAE,KAAK,EAAE,CACV,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAQ,EAAE,OAAuB;IAClE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAEpD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,CAAC;IAC5E,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,QAAQ,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,oFAAoF;QACpF,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;IAEH,qFAAqF;IACrF,2DAA2D;IAC3D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAiC,EAAE,CAAC;AAC9E,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
* The root entry pulls in the boot, which reads the filesystem — client code wants
|
|
10
10
|
* `@fougere/app/client`.
|
|
11
11
|
*/
|
|
12
|
-
export { configureFougere, useFougereApp, createMemoryOrm, type FougereServerConfig, } from './boot.js';
|
|
12
|
+
export { configureFougere, extendFougere, useFougereApp, reloadFougere, createMemoryOrm, type FougereServerConfig, } from './boot.js';
|
|
13
13
|
export { useFougereAuth } from './auth.js';
|
|
14
14
|
export { tableOf, matchRoute, type Matchable, type RouteMatch, } from './rest.js';
|
|
15
15
|
export { serveRest, shapeRest, serveRpc, surfaceOf, rpcParseError, invokeOn, type DoorRequest, type Outcome, } from './serve.js';
|
|
16
|
-
export { formFieldsOf, payloadOf, errorsByField, type FormEntity, type FormField, } from './form.js';
|
|
16
|
+
export { formFieldsOf, tableColumnsOf, payloadOf, errorsByField, type FormEntity, type FormField, type TableColumn, } from './form.js';
|
|
17
17
|
export { sessionViewOf, type SessionView } from './session.js';
|
|
18
18
|
export { stateFor } from './state.js';
|
|
19
19
|
export { serveGraphQL, type GraphQLRequest } from './graphql.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,OAAO,EACP,UAAU,EACV,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,OAAO,GACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,EACb,KAAK,UAAU,EACf,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,OAAO,EACP,UAAU,EACV,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,OAAO,GACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,SAAS,EACT,aAAa,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
* The root entry pulls in the boot, which reads the filesystem — client code wants
|
|
10
10
|
* `@fougere/app/client`.
|
|
11
11
|
*/
|
|
12
|
-
export { configureFougere, useFougereApp, createMemoryOrm, } from './boot.js';
|
|
12
|
+
export { configureFougere, extendFougere, useFougereApp, reloadFougere, createMemoryOrm, } from './boot.js';
|
|
13
13
|
export { useFougereAuth } from './auth.js';
|
|
14
14
|
export { tableOf, matchRoute, } from './rest.js';
|
|
15
15
|
export { serveRest, shapeRest, serveRpc, surfaceOf, rpcParseError, invokeOn, } from './serve.js';
|
|
16
|
-
export { formFieldsOf, payloadOf, errorsByField, } from './form.js';
|
|
16
|
+
export { formFieldsOf, tableColumnsOf, payloadOf, errorsByField, } from './form.js';
|
|
17
17
|
export { sessionViewOf } from './session.js';
|
|
18
18
|
export { stateFor } from './state.js';
|
|
19
19
|
export { serveGraphQL } from './graphql.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,eAAe,GAEhB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,OAAO,EACP,UAAU,GAGX,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,GAGT,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,GAEhB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,OAAO,EACP,UAAU,GAGX,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,GAGT,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,SAAS,EACT,aAAa,GAId,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAuB,MAAM,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-alpha.0",
|
|
4
4
|
"description": "The host-independent half of a Fougere app: boot, call envelope, REST table, form contract.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -31,10 +31,6 @@
|
|
|
31
31
|
"types": "./dist/web.d.ts",
|
|
32
32
|
"import": "./dist/web.js"
|
|
33
33
|
},
|
|
34
|
-
"./router": {
|
|
35
|
-
"types": "./dist/router.d.ts",
|
|
36
|
-
"import": "./dist/router.js"
|
|
37
|
-
},
|
|
38
34
|
"./express": {
|
|
39
35
|
"types": "./dist/express.d.ts",
|
|
40
36
|
"import": "./dist/express.js"
|
|
@@ -45,37 +41,27 @@
|
|
|
45
41
|
],
|
|
46
42
|
"dependencies": {
|
|
47
43
|
"jiti": "^2.6.1",
|
|
48
|
-
"@fougere/core": "0.
|
|
49
|
-
"@fougere/
|
|
50
|
-
"@fougere/
|
|
51
|
-
"@fougere/transport-http": "0.
|
|
52
|
-
"@fougere/
|
|
53
|
-
"@fougere/
|
|
54
|
-
"@fougere/
|
|
44
|
+
"@fougere/core": "0.3.0-alpha.0",
|
|
45
|
+
"@fougere/defaults": "0.3.0-alpha.0",
|
|
46
|
+
"@fougere/http": "0.3.0-alpha.0",
|
|
47
|
+
"@fougere/transport-http": "0.3.0-alpha.0",
|
|
48
|
+
"@fougere/schema": "0.3.0-alpha.0",
|
|
49
|
+
"@fougere/adapter-rest": "0.3.0-alpha.0",
|
|
50
|
+
"@fougere/container": "0.3.0-alpha.0"
|
|
55
51
|
},
|
|
56
52
|
"devDependencies": {
|
|
57
53
|
"vitest": "^4.1.0",
|
|
58
|
-
"@
|
|
59
|
-
"graphql": "^16.13.1",
|
|
60
|
-
"@fougere/adapter-graphql": "0.2.0-alpha.2"
|
|
54
|
+
"@fougere/adapter-graphql": "0.3.0-alpha.0"
|
|
61
55
|
},
|
|
62
56
|
"publishConfig": {
|
|
63
57
|
"access": "public"
|
|
64
58
|
},
|
|
65
59
|
"peerDependencies": {
|
|
66
|
-
"@fougere/adapter-graphql": "^0.
|
|
67
|
-
"@pothos/core": "^4.0.0",
|
|
68
|
-
"graphql": "^16.0.0"
|
|
60
|
+
"@fougere/adapter-graphql": "^0.3.0-alpha.0"
|
|
69
61
|
},
|
|
70
62
|
"peerDependenciesMeta": {
|
|
71
63
|
"@fougere/adapter-graphql": {
|
|
72
64
|
"optional": true
|
|
73
|
-
},
|
|
74
|
-
"@pothos/core": {
|
|
75
|
-
"optional": true
|
|
76
|
-
},
|
|
77
|
-
"graphql": {
|
|
78
|
-
"optional": true
|
|
79
65
|
}
|
|
80
66
|
},
|
|
81
67
|
"scripts": {
|