@fougere/defaults 0.11.0-alpha.0 → 0.12.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/index.d.ts CHANGED
@@ -5,7 +5,9 @@ export { layerOf, resolveStorage, storageFrom } from './storage/ResolvedStorage.
5
5
  export type { DbConfig } from './storage/DbConfig.js';
6
6
  export type { ResolvedStorage } from './storage/ResolvedStorage.js';
7
7
  export interface BootAppOptions {
8
- /** Boot only these fronds (by name). Absent = every discovered frond. */
8
+ /** Boot only these fronds, by name. Absent = every discovered frond. */
9
+ only?: string[];
10
+ /** @deprecated The name `only:` now carries. */
9
11
  fronds?: string[];
10
12
  /**
11
13
  * Follow `remotes:` from config (default true). A host process (`serve`)
@@ -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;AAQhE,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,yEAAyE;IACzE,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,CAenF"}
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,CAcnF"}
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { boot } from '@fougere/compiler';
2
- import { loadConfig } from '@fougere/core/node';
3
- import { createContainer } from '@fougere/container';
2
+ import { loadConfig, remotesOf } from '@fougere/core/node';
4
3
  import { createHttpTransport } from '@fougere/transport-http';
5
4
  import { resolveStorage } from './storage/ResolvedStorage.js';
6
5
  export { declaresStorage } from './storage/DeclaredStorage.js';
@@ -11,12 +10,11 @@ export { layerOf, resolveStorage, storageFrom } from './storage/ResolvedStorage.
11
10
  */
12
11
  export async function bootApp(root, opts = {}) {
13
12
  const config = await loadConfig(root);
14
- const remotes = config.remotes ?? {};
13
+ const remotes = remotesOf(config);
15
14
  const useRemotes = (opts.topology ?? true) && Object.keys(remotes).length > 0;
16
15
  return boot({
17
16
  root,
18
- createContainer,
19
- fronds: opts.fronds,
17
+ only: opts.only ?? opts.fronds,
20
18
  remotes: useRemotes ? remotes : undefined,
21
19
  remoteTransport: useRemotes ? (url) => createHttpTransport(url) : undefined,
22
20
  // One resolver, one place that knows a storage package.
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,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,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;AAmBpF;;;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,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;IACrC,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAE9E,OAAO,IAAI,CAAC;QACV,IAAI;QACJ,eAAe;QACf,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;QACzC,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,mBAAmB,CAA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CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3E,wDAAwD;QACxD,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,EAAc,EAAG,GAA6B,CAAC,OAAgB,EAAE,IAAI,CAAC;QACtG,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fougere/defaults",
3
- "version": "0.11.0-alpha.0",
3
+ "version": "0.12.0-alpha.0",
4
4
  "description": "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/core": "0.11.0-alpha.0",
33
- "@fougere/compiler": "0.11.0-alpha.0",
34
- "@fougere/adapter-sql": "0.11.0-alpha.0",
35
- "@fougere/transport-http": "0.11.0-alpha.0",
36
- "@fougere/container": "0.11.0-alpha.0"
32
+ "@fougere/transport-http": "0.12.0-alpha.0",
33
+ "@fougere/adapter-sql": "0.12.0-alpha.0",
34
+ "@fougere/container": "0.12.0-alpha.0",
35
+ "@fougere/core": "0.12.0-alpha.0",
36
+ "@fougere/compiler": "0.12.0-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.11.0-alpha.0"
45
+ "@fougere/schema": "0.12.0-alpha.0"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "rm -rf dist && tsc",
package/src/index.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  /** @fougere/defaults — the conventional boot, declared once. */
2
2
  import { type App, type CreateAppOptions } from '@fougere/core';
3
3
  import { boot } from '@fougere/compiler';
4
- import { loadConfig } from '@fougere/core/node';
5
- import { createContainer } from '@fougere/container';
4
+ import { loadConfig, remotesOf } from '@fougere/core/node';
6
5
  import { createHttpTransport } from '@fougere/transport-http';
7
6
  import { type DbConfig } from './storage/DbConfig.js';
8
7
  import { resolveStorage } from './storage/ResolvedStorage.js';
@@ -13,7 +12,9 @@ export type { DbConfig } from './storage/DbConfig.js';
13
12
  export type { ResolvedStorage } from './storage/ResolvedStorage.js';
14
13
 
15
14
  export interface BootAppOptions {
16
- /** Boot only these fronds (by name). Absent = every discovered frond. */
15
+ /** Boot only these fronds, by name. Absent = every discovered frond. */
16
+ only?: string[];
17
+ /** @deprecated The name `only:` now carries. */
17
18
  fronds?: string[];
18
19
  /**
19
20
  * Follow `remotes:` from config (default true). A host process (`serve`)
@@ -33,13 +34,12 @@ export interface BootAppOptions {
33
34
  */
34
35
  export async function bootApp(root: string, opts: BootAppOptions = {}): Promise<App> {
35
36
  const config = await loadConfig(root);
36
- const remotes = config.remotes ?? {};
37
+ const remotes = remotesOf(config);
37
38
  const useRemotes = (opts.topology ?? true) && Object.keys(remotes).length > 0;
38
39
 
39
40
  return boot({
40
41
  root,
41
- createContainer,
42
- fronds: opts.fronds,
42
+ only: opts.only ?? opts.fronds,
43
43
  remotes: useRemotes ? remotes : undefined,
44
44
  remoteTransport: useRemotes ? (url) => createHttpTransport(url) : undefined,
45
45
  // One resolver, one place that knows a storage package.