@fougere/compiler 0.16.4-alpha.0 → 0.16.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/boot.d.ts.map +1 -1
- package/dist/boot.js +16 -2
- package/dist/boot.js.map +1 -1
- package/package.json +9 -8
- package/src/boot.ts +18 -2
package/dist/boot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,GAAG,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAOpJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,UAAU,WAAW;IACnB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,SAAS,CAAC;IAClC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,8EAA8E;IAC9E,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;IAC7C,qDAAqD;IACrD,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpC;;OAEG;IACH,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK;QAC9B,EAAE,CAAC,EAAE,OAAO,CAAC;QACb,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QACnD,6EAA6E;QAC7E,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1C,oFAAoF;QACpF,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;KAC7B,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,EAAE,CAAC;CACjD;AAED,iDAAiD;AACjD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAmE7D"}
|
package/dist/boot.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Logger, applyConfig, createApp } from '@fougere/core';
|
|
2
|
-
import { loadConfig, remotesOf, statedModules } from '@fougere/core/node';
|
|
2
|
+
import { getModuleLoader, loadConfig, remotesOf, statedModules } from '@fougere/core/node';
|
|
3
|
+
import { createJiti } from 'jiti';
|
|
4
|
+
import { resolve, sep } from 'node:path';
|
|
5
|
+
import { pathToFileURL } from 'node:url';
|
|
3
6
|
import { scanProject } from './scan/scanner.js';
|
|
4
7
|
/** Boot a Fougere app from fougere.config.ts. */
|
|
5
8
|
export async function boot(options) {
|
|
@@ -21,7 +24,7 @@ export async function boot(options) {
|
|
|
21
24
|
log.info('database initialized');
|
|
22
25
|
}
|
|
23
26
|
// What the config names by module — imported here, because core resolves no specifier.
|
|
24
|
-
const stated = await statedModules(config.fronds);
|
|
27
|
+
const stated = await statedModules(config.fronds, fromProject(root));
|
|
25
28
|
const only = options.only ?? options.fronds;
|
|
26
29
|
const hosted = stated.fronds.filter((frond) => !only || only.includes(frond.name));
|
|
27
30
|
log.debug('creating app (scan + container)');
|
|
@@ -62,4 +65,15 @@ export async function boot(options) {
|
|
|
62
65
|
log.info(`ready in ${ms}ms — ${app.fronds.length} frond(s)`);
|
|
63
66
|
return app;
|
|
64
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* A package a config names — `'@fougere/log'` — resolved from the PROJECT, whose dependency it is:
|
|
70
|
+
* core's own loader takes it for a file path. A path goes to whatever loader the caller installed,
|
|
71
|
+
* which knows the project's aliases.
|
|
72
|
+
*/
|
|
73
|
+
function fromProject(root) {
|
|
74
|
+
const project = createJiti(pathToFileURL(resolve(root) + sep).href, { interopDefault: true });
|
|
75
|
+
return (id, options) => (id.startsWith('.') || id.startsWith('/')
|
|
76
|
+
? getModuleLoader()(id, options)
|
|
77
|
+
: project.import(id));
|
|
78
|
+
}
|
|
65
79
|
//# sourceMappingURL=boot.js.map
|
package/dist/boot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAuF,MAAM,eAAe,CAAC;AACpJ,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAuF,MAAM,eAAe,CAAC;AACpJ,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,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CAAC,CAAC;IAE1E,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACtD,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,CAAC,MAAM,CAAC,MAAM,WAAW,CAAC,CAAC;IAE7D,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;IAE9F,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;QAC/D,CAAC,CAAC,eAAe,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC;QAChC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAqC,CAAC,CAAC;AAC9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/compiler",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5-alpha.0",
|
|
4
4
|
"description": "The scan: Fougere reading a project's source to produce the descriptors core boots from. Needs a filesystem and a TypeScript program.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -30,18 +30,19 @@
|
|
|
30
30
|
"src"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@typescript/typescript6": "^6.0.2"
|
|
33
|
+
"@typescript/typescript6": "^6.0.2",
|
|
34
|
+
"jiti": "^2.6.1"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
|
-
"@fougere/core": "^0.16.
|
|
37
|
-
"@fougere/container": "^0.16.
|
|
38
|
-
"@fougere/schema": "^0.16.
|
|
37
|
+
"@fougere/core": "^0.16.5-alpha.0",
|
|
38
|
+
"@fougere/container": "^0.16.5-alpha.0",
|
|
39
|
+
"@fougere/schema": "^0.16.5-alpha.0"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
|
-
"@fougere/core": "0.16.
|
|
42
|
-
"@fougere/schema": "0.16.
|
|
42
|
+
"@fougere/core": "0.16.5-alpha.0",
|
|
43
|
+
"@fougere/schema": "0.16.5-alpha.0",
|
|
43
44
|
"vitest": "^4.1.0",
|
|
44
|
-
"@fougere/container": "0.16.
|
|
45
|
+
"@fougere/container": "0.16.5-alpha.0"
|
|
45
46
|
},
|
|
46
47
|
"publishConfig": {
|
|
47
48
|
"access": "public"
|
package/src/boot.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Logger, applyConfig, createApp, type App, type CreateAppOptions, type Extension, type FougereConfig, type Transport } from '@fougere/core';
|
|
2
|
-
import { loadConfig, remotesOf, statedModules } from '@fougere/core/node';
|
|
2
|
+
import { getModuleLoader, loadConfig, remotesOf, statedModules, type ModuleLoader } from '@fougere/core/node';
|
|
3
|
+
import { createJiti } from 'jiti';
|
|
4
|
+
import { resolve, sep } from 'node:path';
|
|
5
|
+
import { pathToFileURL } from 'node:url';
|
|
3
6
|
import { scanProject } from './scan/scanner.js';
|
|
4
7
|
|
|
5
8
|
import type { Container } from '@fougere/container';
|
|
@@ -69,7 +72,7 @@ export async function boot(options: BootOptions): Promise<App> {
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
// What the config names by module — imported here, because core resolves no specifier.
|
|
72
|
-
const stated = await statedModules(config.fronds);
|
|
75
|
+
const stated = await statedModules(config.fronds, fromProject(root));
|
|
73
76
|
const only = options.only ?? options.fronds;
|
|
74
77
|
const hosted = stated.fronds.filter((frond) => !only || only.includes(frond.name));
|
|
75
78
|
|
|
@@ -114,3 +117,16 @@ export async function boot(options: BootOptions): Promise<App> {
|
|
|
114
117
|
|
|
115
118
|
return app;
|
|
116
119
|
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A package a config names — `'@fougere/log'` — resolved from the PROJECT, whose dependency it is:
|
|
123
|
+
* core's own loader takes it for a file path. A path goes to whatever loader the caller installed,
|
|
124
|
+
* which knows the project's aliases.
|
|
125
|
+
*/
|
|
126
|
+
function fromProject(root: string): ModuleLoader {
|
|
127
|
+
const project = createJiti(pathToFileURL(resolve(root) + sep).href, { interopDefault: true });
|
|
128
|
+
|
|
129
|
+
return (id, options) => (id.startsWith('.') || id.startsWith('/')
|
|
130
|
+
? getModuleLoader()(id, options)
|
|
131
|
+
: project.import(id) as Promise<Record<string, unknown>>);
|
|
132
|
+
}
|