@fougere/cli 0.8.4-alpha.0 → 0.9.0-alpha.1
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/app/commands/CallCommand.ts +2 -2
- package/app/commands/ServeCommand.ts +3 -3
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/fronds/analysis/services/ProjectScan.ts +1 -1
- package/package.json +8 -8
- package/src/index.ts +0 -2
- package/templates/frond/serve.mjs +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAppRunner } from '@fougere/core';
|
|
2
2
|
import { lowerFirst } from '@fougere/core/contract';
|
|
3
|
-
import {
|
|
3
|
+
import { bootApp } from '@fougere/defaults';
|
|
4
4
|
import type { App } from '@fougere/core';
|
|
5
5
|
import type { ui as createUi } from '../../src/ui.js';
|
|
6
6
|
|
|
@@ -54,7 +54,7 @@ export default class CallCommand {
|
|
|
54
54
|
else input[k] = v;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
const app = await
|
|
57
|
+
const app = await bootApp(process.cwd(), {});
|
|
58
58
|
try {
|
|
59
59
|
const result = await createAppRunner(app)(
|
|
60
60
|
{ entity: lowerFirst(entityName), op },
|
|
@@ -2,7 +2,7 @@ import { createLocalRunner, identityFromEnv } from '@fougere/core';
|
|
|
2
2
|
import { watchPathsOf } from '@fougere/compiler';
|
|
3
3
|
import { installLoader } from '../../src/loader.js';
|
|
4
4
|
import type { Conventions } from '@fougere/core';
|
|
5
|
-
import {
|
|
5
|
+
import { bootApp } from '@fougere/defaults';
|
|
6
6
|
import { serve } from '@fougere/transport-http';
|
|
7
7
|
import { watch } from 'node:fs';
|
|
8
8
|
import type { App, Transport } from '@fougere/core';
|
|
@@ -36,7 +36,7 @@ export default class ServeCommand {
|
|
|
36
36
|
// the same way rather than the first one being special.
|
|
37
37
|
const conventions = await installLoader(root, watching);
|
|
38
38
|
|
|
39
|
-
let hosted = await
|
|
39
|
+
let hosted = await bootApp(root, { fronds: [frond], topology: false });
|
|
40
40
|
if (!hosted.fronds.some((f) => f.name === frond)) {
|
|
41
41
|
this.ui.error(`Frond '${frond}' introuvable dans ce projet.`);
|
|
42
42
|
return;
|
|
@@ -64,7 +64,7 @@ export default class ServeCommand {
|
|
|
64
64
|
const started = Date.now();
|
|
65
65
|
let next: App;
|
|
66
66
|
try {
|
|
67
|
-
next = await
|
|
67
|
+
next = await bootApp(root, { fronds: [frond], topology: false });
|
|
68
68
|
} catch (error) {
|
|
69
69
|
// The previous app keeps serving: a dev loop that dies on a typo is worse than
|
|
70
70
|
// one that holds the last state which booted.
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { resolve } from 'node:path';
|
|
|
11
11
|
* CLI's cwd, install a jiti loader so the scan can import TypeScript sources, scan.
|
|
12
12
|
* Two copies of one gesture, and the second was written by copying the first.
|
|
13
13
|
*
|
|
14
|
-
* Not a boot: `
|
|
14
|
+
* Not a boot: `bootApp` runs migrations and seeds, so an analysis command
|
|
15
15
|
* that booted would write to the target's database. The cost is stated rather than
|
|
16
16
|
* hidden, though — the scan IMPORTS the modules it reads, so a frond's top-level
|
|
17
17
|
* code runs. "No application cycle, no database", not "no side effect".
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-alpha.1",
|
|
4
4
|
"description": "The Fougere CLI — compose a workspace, serve a frond, call an operation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"jiti": "^2.4.2",
|
|
43
43
|
"picocolors": "^1.1.1",
|
|
44
44
|
"safe-regex": "^2.1.1",
|
|
45
|
-
"@fougere/
|
|
46
|
-
"@fougere/
|
|
47
|
-
"@fougere/
|
|
48
|
-
"@fougere/
|
|
49
|
-
"@fougere/
|
|
50
|
-
"@fougere/
|
|
51
|
-
"@fougere/
|
|
45
|
+
"@fougere/adapter-sql": "0.9.0-alpha.1",
|
|
46
|
+
"@fougere/core": "0.9.0-alpha.1",
|
|
47
|
+
"@fougere/container": "0.9.0-alpha.1",
|
|
48
|
+
"@fougere/defaults": "0.9.0-alpha.1",
|
|
49
|
+
"@fougere/schema": "0.9.0-alpha.1",
|
|
50
|
+
"@fougere/compiler": "0.9.0-alpha.1",
|
|
51
|
+
"@fougere/transport-http": "0.9.0-alpha.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"vitest": "^4.1.0"
|
package/src/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { createJiti } from 'jiti';
|
|
|
11
11
|
import { createLocalRunner, Logger } from '@fougere/core';
|
|
12
12
|
import { frondAliases } from '@fougere/compiler';
|
|
13
13
|
import { setModuleLoader } from '@fougere/core/node';
|
|
14
|
-
import {
|
|
14
|
+
import { bootApp } from '@fougere/defaults';
|
|
15
15
|
import { serve } from '@fougere/transport-http';
|
|
16
16
|
|
|
17
17
|
// `frondAliases` is what makes `@fronds/<neighbour>/entities/X.js` resolve — the
|
|
@@ -28,7 +28,7 @@ const log = new Logger('frond-host');
|
|
|
28
28
|
|
|
29
29
|
// `topology: false` — this process *is* the frond, it doesn't route back out.
|
|
30
30
|
// Storage comes from fougere.config.ts; this host names no engine.
|
|
31
|
-
const app = await
|
|
31
|
+
const app = await bootApp(process.cwd(), { topology: false });
|
|
32
32
|
|
|
33
33
|
const { port } = await serve(createLocalRunner(app), { port: Number(process.env.PORT ?? 4000) });
|
|
34
34
|
log.info(`frond served — POST http://127.0.0.1:${port}/_fougere/call`);
|