@fougere/cli 0.2.0-alpha.0 → 0.2.0-alpha.2
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/CheckCommand.ts +1 -1
- package/app/commands/GraphCommand.ts +1 -1
- package/app/commands/NewCommand.ts +1 -1
- package/app/commands/ServeCommand.ts +2 -2
- package/dist/bin.js +1 -1
- package/dist/bin.js.map +1 -1
- package/dist/bridge.js +2 -2
- package/dist/bridge.js.map +1 -1
- package/dist/runner.js +1 -1
- package/dist/runner.js.map +1 -1
- package/dist/theme.d.ts +10 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +10 -0
- package/dist/theme.js.map +1 -0
- package/dist/ui.d.ts +74 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +111 -0
- package/dist/ui.js.map +1 -0
- package/fronds/analysis/handlers/CheckHandler.ts +28 -1
- package/fronds/scaffold/services/ProjectWriter.ts +20 -2
- package/package.json +8 -7
- package/templates/apps/nuxt/package.json +2 -2
- package/templates/flat/CLAUDE.md +2 -2
- package/templates/flat/package.json +2 -2
- package/templates/frond/CLAUDE.md +2 -2
- package/templates/frond/package.json +2 -2
- package/templates/frond/serve.mjs +1 -1
- package/templates/workspace/CLAUDE.md +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createAppRunner } from '@fougere/core';
|
|
2
2
|
import { toRegistrationName } from '@fougere/core/contract';
|
|
3
|
-
import { bootAppFromConfig } from '@fougere/
|
|
3
|
+
import { bootAppFromConfig } from '@fougere/defaults';
|
|
4
4
|
import type { App } from '@fougere/core';
|
|
5
|
-
import type { ui as createUi } from '
|
|
5
|
+
import type { ui as createUi } from '../../src/ui.js';
|
|
6
6
|
|
|
7
7
|
type Ui = ReturnType<typeof createUi>;
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CheckResult, Finding } from '../../fronds/analysis/handlers/CheckHandler.js';
|
|
2
2
|
import type { App } from '@fougere/core';
|
|
3
3
|
import { createAppRunner } from '@fougere/core';
|
|
4
|
-
import type { ui as createUi } from '
|
|
4
|
+
import type { ui as createUi } from '../../src/ui.js';
|
|
5
5
|
import pc from 'picocolors';
|
|
6
6
|
import { relative } from 'node:path';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GraphResult } from '../../fronds/analysis/handlers/GraphHandler.js';
|
|
2
2
|
import type { EntityNode, DomainCluster, App } from '@fougere/core';
|
|
3
3
|
import { createAppRunner } from '@fougere/core';
|
|
4
|
-
import type { ui as createUi } from '
|
|
4
|
+
import type { ui as createUi } from '../../src/ui.js';
|
|
5
5
|
import pc from 'picocolors';
|
|
6
6
|
|
|
7
7
|
type Ui = ReturnType<typeof createUi>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import ProjectWriter from '../../fronds/scaffold/services/ProjectWriter.js';
|
|
4
|
-
import type { ui as createUi } from '
|
|
4
|
+
import type { ui as createUi } from '../../src/ui.js';
|
|
5
5
|
import type { App } from '@fougere/core';
|
|
6
6
|
|
|
7
7
|
type Ui = ReturnType<typeof createUi>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLocalRunner } from '@fougere/core';
|
|
2
|
-
import { bootAppFromConfig } from '@fougere/
|
|
2
|
+
import { bootAppFromConfig } from '@fougere/defaults';
|
|
3
3
|
import { serve } from '@fougere/transport-http';
|
|
4
4
|
import type { App } from '@fougere/core';
|
|
5
|
-
import type { ui as createUi } from '
|
|
5
|
+
import type { ui as createUi } from '../../src/ui.js';
|
|
6
6
|
|
|
7
7
|
type Ui = ReturnType<typeof createUi>;
|
|
8
8
|
|
package/dist/bin.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { createApp, setModuleLoader } from '@fougere/core';
|
|
10
10
|
import { createContainer } from '@fougere/container';
|
|
11
|
-
import { ui } from '
|
|
11
|
+
import { ui } from './ui.js';
|
|
12
12
|
import { run } from './runner.js';
|
|
13
13
|
const { createJiti } = await import('jiti');
|
|
14
14
|
const jiti = createJiti(import.meta.url, { interopDefault: true });
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5C,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;AACnE,eAAe,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAqC,CAAC,CAAC;AAEzF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;AACxD,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC;AACpC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;AACpC,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAE9C,+EAA+E;AAC/E,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,MAAM,CAAC;AAEzC,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC;IAC1B,IAAI,EAAE,OAAO;IACb,eAAe,EAAE,GAAG,EAAE,CAAC,SAAS;CACjC,CAAC,CAAC;AAEH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAEpC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC"}
|
package/dist/bridge.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Anatomy, inputFields } from '@fougere/schema';
|
|
2
2
|
function toKebab(name) {
|
|
3
3
|
return name.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase());
|
|
4
4
|
}
|
|
@@ -14,7 +14,7 @@ export function entityToArgs(fields) {
|
|
|
14
14
|
// A `default(v)` travels as the create rule `{ value }` — citty shows it.
|
|
15
15
|
const create = field.lifecycle?.create;
|
|
16
16
|
const defaultValue = typeof create === 'object' && 'value' in create ? create.value : undefined;
|
|
17
|
-
const { base: shape, nullable } =
|
|
17
|
+
const { base: shape, nullable } = Anatomy.of(field.shape);
|
|
18
18
|
const kebab = toKebab(key);
|
|
19
19
|
const def = {
|
|
20
20
|
description: field.meta?.description,
|
package/dist/bridge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGvD,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,WA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,eAAe,EAAE,CAAC;gBACpB,CAAC;qBAAM,CAAC;oBACL,GAA+B,CAAC,IAAI,GAAG,QAAQ,CAAC;gBACnD,CAAC;gBACD,IAAI,YAAY,KAAK,SAAS;oBAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;gBACnE,MAAM;YACR;gBACG,GAA+B,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrD,CAAC;QAED,IAAI,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;IAC1C,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/runner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAppRunner } from '@fougere/core';
|
|
2
2
|
import { toRegistrationName } from '@fougere/core/contract';
|
|
3
3
|
import { defineCommand, runMain } from 'citty';
|
|
4
|
-
import { ui } from '
|
|
4
|
+
import { ui } from './ui.js';
|
|
5
5
|
import { entityToArgs } from './bridge.js';
|
|
6
6
|
import { readdir } from 'node:fs/promises';
|
|
7
7
|
import { join } from 'node:path';
|
package/dist/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,a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,CAAC,CAAC,CAAC,CAAC;oBAClB,CAAC;gBACH,CAAC;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,aAAa,CAAC;QACzB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE;QACrD,WAAW;KACZ,CAAC,CAAC;IAEH,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ThemeColors {
|
|
2
|
+
brand: (text: string) => string;
|
|
3
|
+
success: (text: string) => string;
|
|
4
|
+
error: (text: string) => string;
|
|
5
|
+
warn: (text: string) => string;
|
|
6
|
+
muted: (text: string) => string;
|
|
7
|
+
bold: (text: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare const defaultTheme: ThemeColors;
|
|
10
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAChC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/B,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,YAAY,EAAE,WAO1B,CAAC"}
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAW5B,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,KAAK,EAAE,EAAE,CAAC,KAAK;IACf,OAAO,EAAE,EAAE,CAAC,KAAK;IACjB,KAAK,EAAE,EAAE,CAAC,GAAG;IACb,IAAI,EAAE,EAAE,CAAC,MAAM;IACf,KAAK,EAAE,EAAE,CAAC,GAAG;IACb,IAAI,EAAE,EAAE,CAAC,IAAI;CACd,CAAC"}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type ThemeColors } from './theme.js';
|
|
2
|
+
export interface UiTheme {
|
|
3
|
+
colors?: Partial<ThemeColors>;
|
|
4
|
+
}
|
|
5
|
+
export declare function ui(options?: UiTheme): {
|
|
6
|
+
/** Start a new CLI session with a branded header. */
|
|
7
|
+
intro(title?: string): void;
|
|
8
|
+
/** End the session with a message. */
|
|
9
|
+
outro(message: string): void;
|
|
10
|
+
/** Cancel and exit. */
|
|
11
|
+
cancel(message?: string): never;
|
|
12
|
+
/** Text input. */
|
|
13
|
+
text(opts: {
|
|
14
|
+
message: string;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
validate?: (value: string) => string | undefined;
|
|
18
|
+
}): Promise<string>;
|
|
19
|
+
/** Yes/no confirmation. */
|
|
20
|
+
confirm(opts: {
|
|
21
|
+
message: string;
|
|
22
|
+
initialValue?: boolean;
|
|
23
|
+
}): Promise<boolean>;
|
|
24
|
+
/** Select one from a list. */
|
|
25
|
+
select(opts: {
|
|
26
|
+
message: string;
|
|
27
|
+
options: {
|
|
28
|
+
value: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
hint?: string;
|
|
31
|
+
}[];
|
|
32
|
+
initialValue?: string;
|
|
33
|
+
}): Promise<string>;
|
|
34
|
+
/** Multi-select from a list. */
|
|
35
|
+
multiselect(opts: {
|
|
36
|
+
message: string;
|
|
37
|
+
options: {
|
|
38
|
+
value: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
hint?: string;
|
|
41
|
+
}[];
|
|
42
|
+
required?: boolean;
|
|
43
|
+
}): Promise<string[]>;
|
|
44
|
+
/** Start a spinner. Returns stop/update functions. */
|
|
45
|
+
spinner(message?: string): {
|
|
46
|
+
update: (msg: string) => void;
|
|
47
|
+
stop: (msg?: string) => void;
|
|
48
|
+
};
|
|
49
|
+
/** Informational message. */
|
|
50
|
+
info(message: string): void;
|
|
51
|
+
/** Success message. */
|
|
52
|
+
success(message: string): void;
|
|
53
|
+
/** Warning message. */
|
|
54
|
+
warn(message: string): void;
|
|
55
|
+
/** Error message. */
|
|
56
|
+
error(message: string): void;
|
|
57
|
+
/** Step indicator. */
|
|
58
|
+
step(message: string): void;
|
|
59
|
+
/** Note box — multiline content in a box. */
|
|
60
|
+
note(message: string, title?: string): void;
|
|
61
|
+
colors: {
|
|
62
|
+
brand: (text: string) => string;
|
|
63
|
+
success: (text: string) => string;
|
|
64
|
+
error: (text: string) => string;
|
|
65
|
+
warn: (text: string) => string;
|
|
66
|
+
muted: (text: string) => string;
|
|
67
|
+
bold: (text: string) => string;
|
|
68
|
+
};
|
|
69
|
+
pc: import("picocolors/types.js").Colors & {
|
|
70
|
+
createColors: (enabled?: boolean) => import("picocolors/types.js").Colors;
|
|
71
|
+
};
|
|
72
|
+
consola: import("consola").ConsolaInstance;
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAcA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,WAAW,OAAO;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B;AAED,wBAAgB,EAAE,CAAC,OAAO,CAAC,EAAE,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*
|
|
4
|
+
* Wraps @clack/prompts + picocolors + consola into a cohesive API.
|
|
5
|
+
*
|
|
6
|
+
* This was `@fougere/cli-ui`, a published package with exactly one consumer —
|
|
7
|
+
* the CLI it is named after. A second name in the registry that nobody would
|
|
8
|
+
* ever install on purpose is a name, not a boundary. Same dependency profile,
|
|
9
|
+
* so it folds in as a module; a subpath export is one line the day something
|
|
10
|
+
* outside the CLI wants it.
|
|
11
|
+
*/
|
|
12
|
+
import * as clack from '@clack/prompts';
|
|
13
|
+
import pc from 'picocolors';
|
|
14
|
+
import { consola } from 'consola';
|
|
15
|
+
import { defaultTheme } from './theme.js';
|
|
16
|
+
export function ui(options) {
|
|
17
|
+
const c = { ...defaultTheme, ...options?.colors };
|
|
18
|
+
return {
|
|
19
|
+
// ── Lifecycle ─────────────────────────────────
|
|
20
|
+
/** Start a new CLI session with a branded header. */
|
|
21
|
+
intro(title = 'Fougere') {
|
|
22
|
+
clack.intro(c.brand(title));
|
|
23
|
+
},
|
|
24
|
+
/** End the session with a message. */
|
|
25
|
+
outro(message) {
|
|
26
|
+
clack.outro(c.success(message));
|
|
27
|
+
},
|
|
28
|
+
/** Cancel and exit. */
|
|
29
|
+
cancel(message = 'Cancelled.') {
|
|
30
|
+
clack.cancel(c.muted(message));
|
|
31
|
+
process.exit(0);
|
|
32
|
+
},
|
|
33
|
+
// ── Prompts ───────────────────────────────────
|
|
34
|
+
/** Text input. */
|
|
35
|
+
async text(opts) {
|
|
36
|
+
const result = await clack.text(opts);
|
|
37
|
+
if (clack.isCancel(result)) {
|
|
38
|
+
this.cancel();
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
},
|
|
43
|
+
/** Yes/no confirmation. */
|
|
44
|
+
async confirm(opts) {
|
|
45
|
+
const result = await clack.confirm(opts);
|
|
46
|
+
if (clack.isCancel(result)) {
|
|
47
|
+
this.cancel();
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
},
|
|
52
|
+
/** Select one from a list. */
|
|
53
|
+
async select(opts) {
|
|
54
|
+
const result = await clack.select(opts);
|
|
55
|
+
if (clack.isCancel(result)) {
|
|
56
|
+
this.cancel();
|
|
57
|
+
return '';
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
},
|
|
61
|
+
/** Multi-select from a list. */
|
|
62
|
+
async multiselect(opts) {
|
|
63
|
+
const result = await clack.multiselect(opts);
|
|
64
|
+
if (clack.isCancel(result)) {
|
|
65
|
+
this.cancel();
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
},
|
|
70
|
+
// ── Spinner ───────────────────────────────────
|
|
71
|
+
/** Start a spinner. Returns stop/update functions. */
|
|
72
|
+
spinner(message) {
|
|
73
|
+
const s = clack.spinner();
|
|
74
|
+
s.start(message);
|
|
75
|
+
return {
|
|
76
|
+
update: (msg) => s.message(msg),
|
|
77
|
+
stop: (msg) => s.stop(msg),
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
// ── Output ────────────────────────────────────
|
|
81
|
+
/** Informational message. */
|
|
82
|
+
info(message) {
|
|
83
|
+
clack.log.info(message);
|
|
84
|
+
},
|
|
85
|
+
/** Success message. */
|
|
86
|
+
success(message) {
|
|
87
|
+
clack.log.success(c.success(message));
|
|
88
|
+
},
|
|
89
|
+
/** Warning message. */
|
|
90
|
+
warn(message) {
|
|
91
|
+
clack.log.warn(c.warn(message));
|
|
92
|
+
},
|
|
93
|
+
/** Error message. */
|
|
94
|
+
error(message) {
|
|
95
|
+
clack.log.error(c.error(message));
|
|
96
|
+
},
|
|
97
|
+
/** Step indicator. */
|
|
98
|
+
step(message) {
|
|
99
|
+
clack.log.step(message);
|
|
100
|
+
},
|
|
101
|
+
/** Note box — multiline content in a box. */
|
|
102
|
+
note(message, title) {
|
|
103
|
+
clack.note(message, title);
|
|
104
|
+
},
|
|
105
|
+
// ── Raw colors/consola ────────────────────────
|
|
106
|
+
colors: c,
|
|
107
|
+
pc,
|
|
108
|
+
consola,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,YAAY,EAAoB,MAAM,YAAY,CAAC;AAM5D,MAAM,UAAU,EAAE,CAAC,OAAiB;IAClC,MAAM,CAAC,GAAG,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC;IAElD,OAAO;QACL,iDAAiD;QAEjD,qDAAqD;QACrD,KAAK,CAAC,KAAK,GAAG,SAAS;YACrB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9B,CAAC;QAED,sCAAsC;QACtC,KAAK,CAAC,OAAe;YACnB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,CAAC;QAED,uBAAuB;QACvB,MAAM,CAAC,OAAO,GAAG,YAAY;YAC3B,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAC/B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,iDAAiD;QAEjD,kBAAkB;QAClB,KAAK,CAAC,IAAI,CAAC,IAAwH;YACjI,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACtC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAAC,IA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AAO,CAAC,GAAG,CAAC;gBACvC,IAAI,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;aACpC,CAAC;QACJ,CAAC;QAED,iDAAiD;QAEjD,6BAA6B;QAC7B,IAAI,CAAC,OAAe;YAClB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QAED,uBAAuB;QACvB,OAAO,CAAC,OAAe;YACrB,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,CAAC;QAED,uBAAuB;QACvB,IAAI,CAAC,OAAe;YAClB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,CAAC;QAED,qBAAqB;QACrB,KAAK,CAAC,OAAe;YACnB,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACpC,CAAC;QAED,sBAAsB;QACtB,IAAI,CAAC,OAAe;YAClB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QAED,6CAA6C;QAC7C,IAAI,CAAC,OAAe,EAAE,KAAc;YAClC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;QAED,iDAAiD;QAEjD,MAAM,EAAE,CAAC;QACT,EAAE;QACF,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildGraph, clusterEntities, crossFrondImports, resolveContracts, type ScanDiagnostic } from '@fougere/core';
|
|
2
2
|
import ProjectScan from '../services/ProjectScan.js';
|
|
3
3
|
|
|
4
4
|
/** One thing that does not hold, in the terms of whoever has to fix it. */
|
|
@@ -35,6 +35,9 @@ export interface CheckResult {
|
|
|
35
35
|
* A rule about an ABSENCE is only sound if the analysis attests it looked, which
|
|
36
36
|
* is why the first bullet had to exist before this command could.
|
|
37
37
|
*/
|
|
38
|
+
/** Shared with `fougere graph` — one threshold, so the two never disagree. */
|
|
39
|
+
const DOMAIN_SPLIT_MIN_ENTITIES = 6;
|
|
40
|
+
|
|
38
41
|
export default class CheckHandler {
|
|
39
42
|
constructor(private projectScan: ProjectScan) {}
|
|
40
43
|
|
|
@@ -67,6 +70,30 @@ export default class CheckHandler {
|
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Entity groups with no `ref()` between them, in one frond. Reported as a FACT, not a
|
|
75
|
+
* verdict: it means either a missing relation or a frond that has not been named, and
|
|
76
|
+
* nothing here can tell which. `fougere graph` shows the groups.
|
|
77
|
+
*/
|
|
78
|
+
if (fronds.length === 1) {
|
|
79
|
+
// `clusterEntities`, not `suggestSplit`: the latter invents a cut on a connected
|
|
80
|
+
// graph, which is its job and not this question. Here only real components count.
|
|
81
|
+
const nodes = buildGraph(fronds);
|
|
82
|
+
const clusters = clusterEntities(nodes);
|
|
83
|
+
// Same threshold as `fougere graph`'s own tip: below it, two components are a small
|
|
84
|
+
// app that has not grown its links yet, not a frond holding two domains.
|
|
85
|
+
if (clusters.length > 1 && nodes.size >= DOMAIN_SPLIT_MIN_ENTITIES) {
|
|
86
|
+
findings.push({
|
|
87
|
+
severity: 'warning',
|
|
88
|
+
code: 'frond-holds-several-domains',
|
|
89
|
+
filePath: fronds[0].source.path,
|
|
90
|
+
message: `'${fronds[0].name}': ${clusters.length} entity groups with no relation between `
|
|
91
|
+
+ `them (${clusters.map((c) => c.name).join(', ')}). Either a relation is missing, or `
|
|
92
|
+
+ `they are separate fronds — see \`fougere graph\`.`,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
70
97
|
/**
|
|
71
98
|
* A warning, not a refusal: it resolves today and the app runs. What it costs is
|
|
72
99
|
* paid once, late — the day the frond it reaches into is deployed on its own.
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import { cpSync, existsSync, renameSync, readFileSync, writeFileSync, readdirSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The monorepo's `packages/`, found by its workspace marker rather than counted
|
|
7
|
+
* in `..` from this file. Counting encoded how deep the CLI itself sat, so the
|
|
8
|
+
* day `cli/` moved into a family, `--local` linked four packages instead of
|
|
9
|
+
* twenty-one — silently, because the scan below simply found less.
|
|
10
|
+
*
|
|
11
|
+
* Returns undefined outside the monorepo, which is every installed copy.
|
|
12
|
+
*/
|
|
13
|
+
function monorepoPackages(): string | undefined {
|
|
14
|
+
let d = fileURLToPath(new URL('.', import.meta.url));
|
|
15
|
+
while (d !== dirname(d)) {
|
|
16
|
+
if (existsSync(join(d, 'pnpm-workspace.yaml'))) return join(d, 'packages');
|
|
17
|
+
d = dirname(d);
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
5
22
|
/**
|
|
6
23
|
* Scaffolds from real template files (create-vite pattern: stdlib copy, no
|
|
7
24
|
* token engine). The workspace model composes at every scale:
|
|
@@ -134,7 +151,8 @@ export default class ProjectWriter {
|
|
|
134
151
|
* packages aren't on npm yet). No-op once the packages are published.
|
|
135
152
|
*/
|
|
136
153
|
linkLocal(wsDir: string): void {
|
|
137
|
-
const packages =
|
|
154
|
+
const packages = monorepoPackages();
|
|
155
|
+
if (!packages) return;
|
|
138
156
|
// Read off the monorepo rather than listed here: a hand-kept map knew the seven
|
|
139
157
|
// packages the default templates use, so the first step beyond the default — a
|
|
140
158
|
// GraphQL surface, auth — added a dependency it had never heard of, which stayed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/cli",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.2",
|
|
4
4
|
"description": "The Fougere CLI — compose a workspace, serve a frond, call an operation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -35,15 +35,16 @@
|
|
|
35
35
|
"templates"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
+
"@clack/prompts": "^0.10.0",
|
|
38
39
|
"citty": "^0.2.1",
|
|
40
|
+
"consola": "^3.4.2",
|
|
39
41
|
"jiti": "^2.4.2",
|
|
40
42
|
"picocolors": "^1.1.1",
|
|
41
|
-
"@fougere/
|
|
42
|
-
"@fougere/
|
|
43
|
-
"@fougere/
|
|
44
|
-
"@fougere/
|
|
45
|
-
"@fougere/
|
|
46
|
-
"@fougere/transport-http": "0.2.0-alpha.0"
|
|
43
|
+
"@fougere/schema": "0.2.0-alpha.2",
|
|
44
|
+
"@fougere/container": "0.2.0-alpha.2",
|
|
45
|
+
"@fougere/core": "0.2.0-alpha.2",
|
|
46
|
+
"@fougere/defaults": "0.2.0-alpha.2",
|
|
47
|
+
"@fougere/transport-http": "0.2.0-alpha.2"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"vitest": "^4.1.0"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"@fougere/core": "latest",
|
|
11
11
|
"@fougere/nuxt": "latest",
|
|
12
12
|
"@fougere/schema": "latest",
|
|
13
|
-
"@fougere/
|
|
14
|
-
"better-sqlite3": "^
|
|
13
|
+
"@fougere/defaults": "latest",
|
|
14
|
+
"better-sqlite3": "^13.0.3",
|
|
15
15
|
"kysely": "^0.28.17",
|
|
16
16
|
"nuxt": "^4.5.1",
|
|
17
17
|
"@fougere/container": "latest"
|
package/templates/flat/CLAUDE.md
CHANGED
|
@@ -35,8 +35,8 @@ Before adding a surface, reach for its **projection**:
|
|
|
35
35
|
|
|
36
36
|
| surface | the call |
|
|
37
37
|
|---|---|
|
|
38
|
-
| REST | `generateRoutes(app)` then `registerRoutes(router, routes)` — `@fougere/
|
|
39
|
-
| GraphQL | `registerAll(builder, app)` then `registerGraphQL(router, builder.toSchema())` — `@fougere/
|
|
38
|
+
| REST | `generateRoutes(app)` then `registerRoutes(router, routes)` — `@fougere/adapter-rest` |
|
|
39
|
+
| GraphQL | `registerAll(builder, app)` then `registerGraphQL(router, builder.toSchema())` — `@fougere/adapter-graphql` |
|
|
40
40
|
|
|
41
41
|
Hand-writing the types (`buildSchema`, raw SDL, one Pothos resolver per field) rebuilds what the
|
|
42
42
|
projection already derives, and drops the judge on the way. `registerType` / `registerOperations`
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"@fougere/core": "latest",
|
|
13
13
|
"@fougere/nuxt": "latest",
|
|
14
14
|
"@fougere/schema": "latest",
|
|
15
|
-
"@fougere/
|
|
16
|
-
"better-sqlite3": "^
|
|
15
|
+
"@fougere/defaults": "latest",
|
|
16
|
+
"better-sqlite3": "^13.0.3",
|
|
17
17
|
"kysely": "^0.28.17",
|
|
18
18
|
"nuxt": "^4.5.1",
|
|
19
19
|
"@fougere/container": "latest"
|
|
@@ -35,8 +35,8 @@ Before adding a surface, reach for its **projection**:
|
|
|
35
35
|
|
|
36
36
|
| surface | the call |
|
|
37
37
|
|---|---|
|
|
38
|
-
| REST | `generateRoutes(app)` then `registerRoutes(router, routes)` — `@fougere/
|
|
39
|
-
| GraphQL | `registerAll(builder, app)` then `registerGraphQL(router, builder.toSchema())` — `@fougere/
|
|
38
|
+
| REST | `generateRoutes(app)` then `registerRoutes(router, routes)` — `@fougere/adapter-rest` |
|
|
39
|
+
| GraphQL | `registerAll(builder, app)` then `registerGraphQL(router, builder.toSchema())` — `@fougere/adapter-graphql` |
|
|
40
40
|
|
|
41
41
|
Hand-writing the types (`buildSchema`, raw SDL, one Pothos resolver per field) rebuilds what the
|
|
42
42
|
projection already derives, and drops the judge on the way. `registerType` / `registerOperations`
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@fougere/core": "latest",
|
|
10
10
|
"@fougere/schema": "latest",
|
|
11
|
-
"@fougere/
|
|
11
|
+
"@fougere/defaults": "latest",
|
|
12
12
|
"@fougere/transport-http": "latest",
|
|
13
|
-
"better-sqlite3": "^
|
|
13
|
+
"better-sqlite3": "^13.0.3",
|
|
14
14
|
"kysely": "^0.28.17",
|
|
15
15
|
"jiti": "^2.4.2",
|
|
16
16
|
"@fougere/container": "latest"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { createJiti } from 'jiti';
|
|
11
11
|
import { createLocalRunner, setModuleLoader, frondAliases, Logger } from '@fougere/core';
|
|
12
|
-
import { bootAppFromConfig } from '@fougere/
|
|
12
|
+
import { bootAppFromConfig } from '@fougere/defaults';
|
|
13
13
|
import { serve } from '@fougere/transport-http';
|
|
14
14
|
|
|
15
15
|
// `frondAliases` is what makes `@frond/<neighbour>/entities/X.js` resolve — the
|
|
@@ -35,8 +35,8 @@ Before adding a surface, reach for its **projection**:
|
|
|
35
35
|
|
|
36
36
|
| surface | the call |
|
|
37
37
|
|---|---|
|
|
38
|
-
| REST | `generateRoutes(app)` then `registerRoutes(router, routes)` — `@fougere/
|
|
39
|
-
| GraphQL | `registerAll(builder, app)` then `registerGraphQL(router, builder.toSchema())` — `@fougere/
|
|
38
|
+
| REST | `generateRoutes(app)` then `registerRoutes(router, routes)` — `@fougere/adapter-rest` |
|
|
39
|
+
| GraphQL | `registerAll(builder, app)` then `registerGraphQL(router, builder.toSchema())` — `@fougere/adapter-graphql` |
|
|
40
40
|
|
|
41
41
|
Hand-writing the types (`buildSchema`, raw SDL, one Pothos resolver per field) rebuilds what the
|
|
42
42
|
projection already derives, and drops the judge on the way. `registerType` / `registerOperations`
|