@fougere/defaults 0.12.4-alpha.0 → 0.12.5-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/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +7 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAOhE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACpF,YAAY,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;CAC7C;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAOhE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACpF,YAAY,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;CAC7C;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,CAkBnF"}
|
package/dist/index.js
CHANGED
|
@@ -10,12 +10,16 @@ export { layerOf, resolveStorage, storageFrom } from './storage/ResolvedStorage.
|
|
|
10
10
|
*/
|
|
11
11
|
export async function bootApp(root, opts = {}) {
|
|
12
12
|
const config = await loadConfig(root);
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
// What this process serves is never remote to it, whatever `fronds:` says of it elsewhere:
|
|
14
|
+
// `fougere serve blog` refused to start on a config that places `blog` at an address.
|
|
15
|
+
const served = new Set(opts.only ?? opts.fronds ?? []);
|
|
16
|
+
const elsewhere = Object.fromEntries(Object.entries(remotesOf(config)).filter(([frond]) => !served.has(frond)));
|
|
17
|
+
const useRemotes = (opts.topology ?? true) && Object.keys(elsewhere).length > 0;
|
|
15
18
|
return boot({
|
|
16
19
|
root,
|
|
17
20
|
only: opts.only ?? opts.fronds,
|
|
18
|
-
|
|
21
|
+
// `{}` and never undefined: `boot` reads the config's own `fronds:` when handed nothing.
|
|
22
|
+
remotes: useRemotes ? elsewhere : {},
|
|
19
23
|
remoteTransport: useRemotes ? (url) => createHttpTransport(url) : undefined,
|
|
20
24
|
// One resolver, one place that knows a storage package.
|
|
21
25
|
db: (cfg) => resolveStorage(cfg.db, cfg.sources, root),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAqBpF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,IAAI,GAAmB,EAAE;IACnE,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAqBpF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,IAAI,GAAmB,EAA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"The conventional boot of a Fougere app — the one place storage is wired.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"src"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@fougere/
|
|
33
|
-
"@fougere/
|
|
34
|
-
"@fougere/
|
|
35
|
-
"@fougere/
|
|
36
|
-
"@fougere/compiler": "0.12.
|
|
32
|
+
"@fougere/transport-http": "0.12.5-alpha.0",
|
|
33
|
+
"@fougere/container": "0.12.5-alpha.0",
|
|
34
|
+
"@fougere/core": "0.12.5-alpha.0",
|
|
35
|
+
"@fougere/adapter-sql": "0.12.5-alpha.0",
|
|
36
|
+
"@fougere/compiler": "0.12.5-alpha.0"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"kysely": "^0.28.17",
|
|
43
43
|
"better-sqlite3": "^13.0.3",
|
|
44
44
|
"@types/better-sqlite3": "^7.6.13",
|
|
45
|
-
"@fougere/schema": "0.12.
|
|
45
|
+
"@fougere/schema": "0.12.5-alpha.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "rm -rf dist && tsc",
|
package/src/index.ts
CHANGED
|
@@ -34,13 +34,17 @@ export interface BootAppOptions {
|
|
|
34
34
|
*/
|
|
35
35
|
export async function bootApp(root: string, opts: BootAppOptions = {}): Promise<App> {
|
|
36
36
|
const config = await loadConfig(root);
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
// What this process serves is never remote to it, whatever `fronds:` says of it elsewhere:
|
|
38
|
+
// `fougere serve blog` refused to start on a config that places `blog` at an address.
|
|
39
|
+
const served = new Set(opts.only ?? opts.fronds ?? []);
|
|
40
|
+
const elsewhere = Object.fromEntries(Object.entries(remotesOf(config)).filter(([frond]) => !served.has(frond)));
|
|
41
|
+
const useRemotes = (opts.topology ?? true) && Object.keys(elsewhere).length > 0;
|
|
39
42
|
|
|
40
43
|
return boot({
|
|
41
44
|
root,
|
|
42
45
|
only: opts.only ?? opts.fronds,
|
|
43
|
-
|
|
46
|
+
// `{}` and never undefined: `boot` reads the config's own `fronds:` when handed nothing.
|
|
47
|
+
remotes: useRemotes ? elsewhere : {},
|
|
44
48
|
remoteTransport: useRemotes ? (url) => createHttpTransport(url) : undefined,
|
|
45
49
|
// One resolver, one place that knows a storage package.
|
|
46
50
|
db: (cfg) => resolveStorage(cfg.db as DbConfig, (cfg as { sources?: unknown }).sources as never, root),
|