@fougere/cli 0.12.5-alpha.0 → 0.13.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/.fougere/scan.generated.d.ts +3 -0
- package/dist/.fougere/scan.generated.d.ts.map +1 -0
- package/dist/.fougere/scan.generated.js +140 -0
- package/dist/.fougere/scan.generated.js.map +1 -0
- package/dist/app/commands/BuildCommand.d.ts +18 -0
- package/dist/app/commands/BuildCommand.d.ts.map +1 -0
- package/dist/app/commands/BuildCommand.js +35 -0
- package/dist/app/commands/BuildCommand.js.map +1 -0
- package/dist/app/commands/CallCommand.d.ts +16 -0
- package/dist/app/commands/CallCommand.d.ts.map +1 -0
- package/dist/app/commands/CallCommand.js +73 -0
- package/dist/app/commands/CallCommand.js.map +1 -0
- package/dist/app/commands/CheckCommand.d.ts +11 -0
- package/dist/app/commands/CheckCommand.d.ts.map +1 -0
- package/dist/app/commands/CheckCommand.js +59 -0
- package/dist/app/commands/CheckCommand.js.map +1 -0
- package/dist/app/commands/CompletionCommand.d.ts +7 -0
- package/dist/app/commands/CompletionCommand.d.ts.map +1 -0
- package/dist/app/commands/CompletionCommand.js +23 -0
- package/dist/app/commands/CompletionCommand.js.map +1 -0
- package/dist/app/commands/DevtoolsCommand.d.ts +20 -0
- package/dist/app/commands/DevtoolsCommand.d.ts.map +1 -0
- package/dist/app/commands/DevtoolsCommand.js +79 -0
- package/dist/app/commands/DevtoolsCommand.js.map +1 -0
- package/dist/app/commands/ExplainCommand.d.ts +18 -0
- package/dist/app/commands/ExplainCommand.d.ts.map +1 -0
- package/dist/app/commands/ExplainCommand.js +111 -0
- package/dist/app/commands/ExplainCommand.js.map +1 -0
- package/dist/app/commands/FreezeCommand.d.ts +21 -0
- package/dist/app/commands/FreezeCommand.d.ts.map +1 -0
- package/dist/app/commands/FreezeCommand.js +102 -0
- package/dist/app/commands/FreezeCommand.js.map +1 -0
- package/dist/app/commands/GrantCommand.d.ts +18 -0
- package/dist/app/commands/GrantCommand.d.ts.map +1 -0
- package/dist/app/commands/GrantCommand.js +39 -0
- package/dist/app/commands/GrantCommand.js.map +1 -0
- package/dist/app/commands/GraphCommand.d.ts +11 -0
- package/dist/app/commands/GraphCommand.d.ts.map +1 -0
- package/dist/app/commands/GraphCommand.js +72 -0
- package/dist/app/commands/GraphCommand.js.map +1 -0
- package/dist/app/commands/KeysCommand.d.ts +22 -0
- package/dist/app/commands/KeysCommand.d.ts.map +1 -0
- package/dist/app/commands/KeysCommand.js +50 -0
- package/dist/app/commands/KeysCommand.js.map +1 -0
- package/dist/app/commands/LoadCommand.d.ts +19 -0
- package/dist/app/commands/LoadCommand.d.ts.map +1 -0
- package/dist/app/commands/LoadCommand.js +37 -0
- package/dist/app/commands/LoadCommand.js.map +1 -0
- package/dist/app/commands/MigrateCommand.d.ts +17 -0
- package/dist/app/commands/MigrateCommand.d.ts.map +1 -0
- package/dist/app/commands/MigrateCommand.js +47 -0
- package/dist/app/commands/MigrateCommand.js.map +1 -0
- package/dist/app/commands/NewCommand.d.ts +24 -0
- package/dist/app/commands/NewCommand.d.ts.map +1 -0
- package/dist/app/commands/NewCommand.js +108 -0
- package/dist/app/commands/NewCommand.js.map +1 -0
- package/dist/app/commands/ServeCommand.d.ts +17 -0
- package/dist/app/commands/ServeCommand.d.ts.map +1 -0
- package/dist/app/commands/ServeCommand.js +92 -0
- package/dist/app/commands/ServeCommand.js.map +1 -0
- package/dist/app/commands/grant-material.d.ts +5 -0
- package/dist/app/commands/grant-material.d.ts.map +1 -0
- package/{app/commands/grant-material.ts → dist/app/commands/grant-material.js} +2 -2
- package/dist/app/commands/grant-material.js.map +1 -0
- package/dist/fronds/analysis/entities/Build.d.ts +10 -0
- package/dist/fronds/analysis/entities/Build.d.ts.map +1 -0
- package/dist/fronds/analysis/entities/Build.js +9 -0
- package/dist/fronds/analysis/entities/Build.js.map +1 -0
- package/dist/fronds/analysis/entities/Check.d.ts +8 -0
- package/dist/fronds/analysis/entities/Check.d.ts.map +1 -0
- package/dist/fronds/analysis/entities/Check.js +7 -0
- package/dist/fronds/analysis/entities/Check.js.map +1 -0
- package/dist/fronds/analysis/entities/Devtools.d.ts +10 -0
- package/dist/fronds/analysis/entities/Devtools.d.ts.map +1 -0
- package/dist/fronds/analysis/entities/Devtools.js +9 -0
- package/dist/fronds/analysis/entities/Devtools.js.map +1 -0
- package/dist/fronds/analysis/entities/Explain.d.ts +11 -0
- package/dist/fronds/analysis/entities/Explain.d.ts.map +1 -0
- package/dist/fronds/analysis/entities/Explain.js +10 -0
- package/dist/fronds/analysis/entities/Explain.js.map +1 -0
- package/dist/fronds/analysis/entities/Freeze.d.ts +10 -0
- package/dist/fronds/analysis/entities/Freeze.d.ts.map +1 -0
- package/dist/fronds/analysis/entities/Freeze.js +9 -0
- package/dist/fronds/analysis/entities/Freeze.js.map +1 -0
- package/dist/fronds/analysis/entities/Graph.d.ts +9 -0
- package/dist/fronds/analysis/entities/Graph.d.ts.map +1 -0
- package/dist/fronds/analysis/entities/Graph.js +8 -0
- package/dist/fronds/analysis/entities/Graph.js.map +1 -0
- package/dist/fronds/analysis/entities/Load.d.ts +10 -0
- package/dist/fronds/analysis/entities/Load.d.ts.map +1 -0
- package/dist/fronds/analysis/entities/Load.js +9 -0
- package/dist/fronds/analysis/entities/Load.js.map +1 -0
- package/dist/fronds/analysis/entities/Migrate.d.ts +10 -0
- package/dist/fronds/analysis/entities/Migrate.d.ts.map +1 -0
- package/dist/fronds/analysis/entities/Migrate.js +9 -0
- package/dist/fronds/analysis/entities/Migrate.js.map +1 -0
- package/dist/fronds/analysis/handlers/BuildHandler.d.ts +50 -0
- package/dist/fronds/analysis/handlers/BuildHandler.d.ts.map +1 -0
- package/dist/fronds/analysis/handlers/BuildHandler.js +63 -0
- package/dist/fronds/analysis/handlers/BuildHandler.js.map +1 -0
- package/dist/fronds/analysis/handlers/CheckHandler.d.ts +30 -0
- package/dist/fronds/analysis/handlers/CheckHandler.d.ts.map +1 -0
- package/dist/fronds/analysis/handlers/CheckHandler.js +196 -0
- package/dist/fronds/analysis/handlers/CheckHandler.js.map +1 -0
- package/dist/fronds/analysis/handlers/DevtoolsHandler.d.ts +45 -0
- package/dist/fronds/analysis/handlers/DevtoolsHandler.d.ts.map +1 -0
- package/dist/fronds/analysis/handlers/DevtoolsHandler.js +61 -0
- package/dist/fronds/analysis/handlers/DevtoolsHandler.js.map +1 -0
- package/dist/fronds/analysis/handlers/ExplainHandler.d.ts +99 -0
- package/dist/fronds/analysis/handlers/ExplainHandler.d.ts.map +1 -0
- package/dist/fronds/analysis/handlers/ExplainHandler.js +157 -0
- package/dist/fronds/analysis/handlers/ExplainHandler.js.map +1 -0
- package/dist/fronds/analysis/handlers/FreezeHandler.d.ts +55 -0
- package/dist/fronds/analysis/handlers/FreezeHandler.d.ts.map +1 -0
- package/dist/fronds/analysis/handlers/FreezeHandler.js +145 -0
- package/dist/fronds/analysis/handlers/FreezeHandler.js.map +1 -0
- package/dist/fronds/analysis/handlers/GraphHandler.d.ts +23 -0
- package/dist/fronds/analysis/handlers/GraphHandler.d.ts.map +1 -0
- package/dist/fronds/analysis/handlers/GraphHandler.js +23 -0
- package/dist/fronds/analysis/handlers/GraphHandler.js.map +1 -0
- package/dist/fronds/analysis/handlers/LoadHandler.d.ts +26 -0
- package/dist/fronds/analysis/handlers/LoadHandler.d.ts.map +1 -0
- package/dist/fronds/analysis/handlers/LoadHandler.js +35 -0
- package/dist/fronds/analysis/handlers/LoadHandler.js.map +1 -0
- package/dist/fronds/analysis/handlers/MigrateHandler.d.ts +34 -0
- package/dist/fronds/analysis/handlers/MigrateHandler.d.ts.map +1 -0
- package/dist/fronds/analysis/handlers/MigrateHandler.js +92 -0
- package/dist/fronds/analysis/handlers/MigrateHandler.js.map +1 -0
- package/dist/fronds/analysis/services/ProjectScan.d.ts +22 -0
- package/dist/fronds/analysis/services/ProjectScan.d.ts.map +1 -0
- package/dist/fronds/analysis/services/ProjectScan.js +48 -0
- package/dist/fronds/analysis/services/ProjectScan.js.map +1 -0
- package/dist/fronds/analysis/versions.d.ts +21 -0
- package/dist/fronds/analysis/versions.d.ts.map +1 -0
- package/dist/fronds/analysis/versions.js +48 -0
- package/dist/fronds/analysis/versions.js.map +1 -0
- package/dist/fronds/scaffold/entities/BuildFrond.d.ts +7 -0
- package/dist/fronds/scaffold/entities/BuildFrond.d.ts.map +1 -0
- package/dist/fronds/scaffold/entities/BuildFrond.js +6 -0
- package/dist/fronds/scaffold/entities/BuildFrond.js.map +1 -0
- package/dist/fronds/scaffold/entities/Call.d.ts +8 -0
- package/dist/fronds/scaffold/entities/Call.d.ts.map +1 -0
- package/{fronds/scaffold/entities/Call.ts → dist/fronds/scaffold/entities/Call.js} +4 -3
- package/dist/fronds/scaffold/entities/Call.js.map +1 -0
- package/dist/fronds/scaffold/entities/Completion.d.ts +7 -0
- package/dist/fronds/scaffold/entities/Completion.d.ts.map +1 -0
- package/dist/fronds/scaffold/entities/Completion.js +6 -0
- package/dist/fronds/scaffold/entities/Completion.js.map +1 -0
- package/dist/fronds/scaffold/entities/Grant.d.ts +8 -0
- package/dist/fronds/scaffold/entities/Grant.d.ts.map +1 -0
- package/{fronds/scaffold/entities/Grant.ts → dist/fronds/scaffold/entities/Grant.js} +4 -3
- package/dist/fronds/scaffold/entities/Grant.js.map +1 -0
- package/dist/fronds/scaffold/entities/Keys.d.ts +6 -0
- package/dist/fronds/scaffold/entities/Keys.d.ts.map +1 -0
- package/{fronds/scaffold/entities/Keys.ts → dist/fronds/scaffold/entities/Keys.js} +3 -2
- package/dist/fronds/scaffold/entities/Keys.js.map +1 -0
- package/dist/fronds/scaffold/entities/New.d.ts +19 -0
- package/dist/fronds/scaffold/entities/New.d.ts.map +1 -0
- package/dist/fronds/scaffold/entities/New.js +18 -0
- package/dist/fronds/scaffold/entities/New.js.map +1 -0
- package/dist/fronds/scaffold/entities/Serve.d.ts +10 -0
- package/dist/fronds/scaffold/entities/Serve.d.ts.map +1 -0
- package/dist/fronds/scaffold/entities/Serve.js +9 -0
- package/dist/fronds/scaffold/entities/Serve.js.map +1 -0
- package/dist/fronds/scaffold/entities/Sync.d.ts +8 -0
- package/dist/fronds/scaffold/entities/Sync.d.ts.map +1 -0
- package/dist/fronds/scaffold/entities/Sync.js +7 -0
- package/dist/fronds/scaffold/entities/Sync.js.map +1 -0
- package/dist/fronds/scaffold/handlers/BuildFrondHandler.d.ts +11 -0
- package/dist/fronds/scaffold/handlers/BuildFrondHandler.d.ts.map +1 -0
- package/dist/fronds/scaffold/handlers/BuildFrondHandler.js +82 -0
- package/dist/fronds/scaffold/handlers/BuildFrondHandler.js.map +1 -0
- package/dist/fronds/scaffold/handlers/CallHandler.d.ts +10 -0
- package/dist/fronds/scaffold/handlers/CallHandler.d.ts.map +1 -0
- package/{fronds/scaffold/handlers/CallHandler.ts → dist/fronds/scaffold/handlers/CallHandler.js} +3 -2
- package/dist/fronds/scaffold/handlers/CallHandler.js.map +1 -0
- package/dist/fronds/scaffold/handlers/CompletionHandler.d.ts +9 -0
- package/dist/fronds/scaffold/handlers/CompletionHandler.d.ts.map +1 -0
- package/{fronds/scaffold/handlers/CompletionHandler.ts → dist/fronds/scaffold/handlers/CompletionHandler.js} +3 -2
- package/dist/fronds/scaffold/handlers/CompletionHandler.js.map +1 -0
- package/dist/fronds/scaffold/handlers/GrantHandler.d.ts +9 -0
- package/dist/fronds/scaffold/handlers/GrantHandler.d.ts.map +1 -0
- package/{fronds/scaffold/handlers/GrantHandler.ts → dist/fronds/scaffold/handlers/GrantHandler.js} +3 -2
- package/dist/fronds/scaffold/handlers/GrantHandler.js.map +1 -0
- package/dist/fronds/scaffold/handlers/KeysHandler.d.ts +9 -0
- package/dist/fronds/scaffold/handlers/KeysHandler.d.ts.map +1 -0
- package/{fronds/scaffold/handlers/KeysHandler.ts → dist/fronds/scaffold/handlers/KeysHandler.js} +3 -2
- package/dist/fronds/scaffold/handlers/KeysHandler.js.map +1 -0
- package/dist/fronds/scaffold/handlers/NewHandler.d.ts +9 -0
- package/dist/fronds/scaffold/handlers/NewHandler.d.ts.map +1 -0
- package/{fronds/scaffold/handlers/NewHandler.ts → dist/fronds/scaffold/handlers/NewHandler.js} +3 -2
- package/dist/fronds/scaffold/handlers/NewHandler.js.map +1 -0
- package/dist/fronds/scaffold/handlers/ServeHandler.d.ts +10 -0
- package/dist/fronds/scaffold/handlers/ServeHandler.d.ts.map +1 -0
- package/{fronds/scaffold/handlers/ServeHandler.ts → dist/fronds/scaffold/handlers/ServeHandler.js} +3 -2
- package/dist/fronds/scaffold/handlers/ServeHandler.js.map +1 -0
- package/dist/fronds/scaffold/handlers/SyncHandler.d.ts +18 -0
- package/dist/fronds/scaffold/handlers/SyncHandler.d.ts.map +1 -0
- package/dist/fronds/scaffold/handlers/SyncHandler.js +327 -0
- package/dist/fronds/scaffold/handlers/SyncHandler.js.map +1 -0
- package/dist/fronds/scaffold/services/ProjectWriter.d.ts +54 -0
- package/dist/fronds/scaffold/services/ProjectWriter.d.ts.map +1 -0
- package/dist/fronds/scaffold/services/ProjectWriter.js +315 -0
- package/dist/fronds/scaffold/services/ProjectWriter.js.map +1 -0
- package/dist/src/bin.d.ts.map +1 -0
- package/dist/src/bin.js +11 -0
- package/dist/src/bin.js.map +1 -0
- package/dist/src/bridge.d.ts.map +1 -0
- package/dist/src/bridge.js.map +1 -0
- package/dist/src/completion.d.ts.map +1 -0
- package/dist/src/completion.js.map +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/loader.d.ts.map +1 -0
- package/dist/src/loader.js.map +1 -0
- package/dist/src/machine.d.ts.map +1 -0
- package/dist/src/machine.js.map +1 -0
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.d.ts.map +1 -0
- package/dist/src/main.js +19 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/runner.d.ts.map +1 -0
- package/dist/{runner.js → src/runner.js} +22 -22
- package/dist/src/runner.js.map +1 -0
- package/dist/src/theme.d.ts.map +1 -0
- package/dist/src/theme.js.map +1 -0
- package/dist/src/typescript/EntityTypes.d.ts.map +1 -0
- package/dist/src/typescript/EntityTypes.js.map +1 -0
- package/dist/src/typescript/FacadeTypes.d.ts.map +1 -0
- package/dist/src/typescript/FacadeTypes.js.map +1 -0
- package/dist/src/typescript/syntax.d.ts.map +1 -0
- package/dist/src/typescript/syntax.js.map +1 -0
- package/dist/{ui.d.ts → src/ui.d.ts} +0 -1
- package/dist/src/ui.d.ts.map +1 -0
- package/dist/{ui.js → src/ui.js} +24 -22
- package/dist/src/ui.js.map +1 -0
- package/package.json +25 -29
- package/templates/frond/fronds/tsconfig.json +17 -0
- package/templates/workspace/fronds/tsconfig.json +2 -4
- package/templates/workspace/package.json +1 -1
- package/templates/workspace/pnpm-workspace.yaml +5 -3
- package/app/commands/BuildCommand.ts +0 -43
- package/app/commands/CallCommand.ts +0 -70
- package/app/commands/CheckCommand.ts +0 -70
- package/app/commands/CompletionCommand.ts +0 -24
- package/app/commands/DevtoolsCommand.ts +0 -92
- package/app/commands/ExplainCommand.ts +0 -136
- package/app/commands/FreezeCommand.ts +0 -119
- package/app/commands/GrantCommand.ts +0 -46
- package/app/commands/GraphCommand.ts +0 -91
- package/app/commands/KeysCommand.ts +0 -57
- package/app/commands/LoadCommand.ts +0 -46
- package/app/commands/MigrateCommand.ts +0 -61
- package/app/commands/NewCommand.ts +0 -137
- package/app/commands/ServeCommand.ts +0 -108
- package/dist/bin.d.ts.map +0 -1
- package/dist/bin.js +0 -64
- package/dist/bin.js.map +0 -1
- package/dist/bridge.d.ts.map +0 -1
- package/dist/bridge.js.map +0 -1
- package/dist/completion.d.ts.map +0 -1
- package/dist/completion.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js.map +0 -1
- package/dist/machine.d.ts.map +0 -1
- package/dist/machine.js.map +0 -1
- package/dist/runner.d.ts.map +0 -1
- package/dist/runner.js.map +0 -1
- package/dist/theme.d.ts.map +0 -1
- package/dist/theme.js.map +0 -1
- package/dist/typescript/EntityTypes.d.ts.map +0 -1
- package/dist/typescript/EntityTypes.js.map +0 -1
- package/dist/typescript/FacadeTypes.d.ts.map +0 -1
- package/dist/typescript/FacadeTypes.js.map +0 -1
- package/dist/typescript/syntax.d.ts.map +0 -1
- package/dist/typescript/syntax.js.map +0 -1
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js.map +0 -1
- package/fronds/analysis/entities/Build.ts +0 -8
- package/fronds/analysis/entities/Check.ts +0 -6
- package/fronds/analysis/entities/Devtools.ts +0 -8
- package/fronds/analysis/entities/Explain.ts +0 -9
- package/fronds/analysis/entities/Freeze.ts +0 -8
- package/fronds/analysis/entities/Graph.ts +0 -7
- package/fronds/analysis/entities/Load.ts +0 -8
- package/fronds/analysis/entities/Migrate.ts +0 -8
- package/fronds/analysis/handlers/BuildHandler.ts +0 -87
- package/fronds/analysis/handlers/CheckHandler.ts +0 -217
- package/fronds/analysis/handlers/DevtoolsHandler.ts +0 -97
- package/fronds/analysis/handlers/ExplainHandler.ts +0 -263
- package/fronds/analysis/handlers/FreezeHandler.ts +0 -183
- package/fronds/analysis/handlers/GraphHandler.ts +0 -38
- package/fronds/analysis/handlers/LoadHandler.ts +0 -44
- package/fronds/analysis/handlers/MigrateHandler.ts +0 -110
- package/fronds/analysis/services/ProjectScan.ts +0 -55
- package/fronds/analysis/versions.ts +0 -59
- package/fronds/scaffold/entities/BuildFrond.ts +0 -5
- package/fronds/scaffold/entities/Completion.ts +0 -5
- package/fronds/scaffold/entities/New.ts +0 -19
- package/fronds/scaffold/entities/Serve.ts +0 -8
- package/fronds/scaffold/entities/Sync.ts +0 -6
- package/fronds/scaffold/handlers/BuildFrondHandler.ts +0 -96
- package/fronds/scaffold/handlers/SyncHandler.ts +0 -376
- package/fronds/scaffold/services/ProjectWriter.ts +0 -339
- package/fronds/shims.d.ts +0 -9
- package/src/bin.ts +0 -77
- package/src/bridge.ts +0 -118
- package/src/completion.ts +0 -145
- package/src/index.ts +0 -1
- package/src/loader.ts +0 -28
- package/src/machine.ts +0 -17
- package/src/runner.ts +0 -152
- package/src/theme.ts +0 -19
- package/src/typescript/EntityTypes.ts +0 -92
- package/src/typescript/FacadeTypes.ts +0 -50
- package/src/typescript/syntax.ts +0 -11
- package/src/ui.ts +0 -142
- package/templates/flat/AGENTS.md +0 -14
- package/templates/flat/CLAUDE.md +0 -87
- package/templates/flat/_gitignore +0 -6
- package/templates/flat/app/app.vue +0 -25
- package/templates/flat/app/pages/index.vue +0 -7
- package/templates/flat/fougere.config.ts +0 -7
- package/templates/flat/nuxt.config.ts +0 -4
- package/templates/flat/package.json +0 -24
- package/templates/flat/pnpm-workspace.yaml +0 -6
- package/templates/flat/tsconfig.frond.json +0 -25
- package/templates/flat/tsconfig.json +0 -3
- /package/dist/{bin.d.ts → src/bin.d.ts} +0 -0
- /package/dist/{bridge.d.ts → src/bridge.d.ts} +0 -0
- /package/dist/{bridge.js → src/bridge.js} +0 -0
- /package/dist/{completion.d.ts → src/completion.d.ts} +0 -0
- /package/dist/{completion.js → src/completion.js} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{loader.d.ts → src/loader.d.ts} +0 -0
- /package/dist/{loader.js → src/loader.js} +0 -0
- /package/dist/{machine.d.ts → src/machine.d.ts} +0 -0
- /package/dist/{machine.js → src/machine.js} +0 -0
- /package/dist/{runner.d.ts → src/runner.d.ts} +0 -0
- /package/dist/{theme.d.ts → src/theme.d.ts} +0 -0
- /package/dist/{theme.js → src/theme.js} +0 -0
- /package/dist/{typescript → src/typescript}/EntityTypes.d.ts +0 -0
- /package/dist/{typescript → src/typescript}/EntityTypes.js +0 -0
- /package/dist/{typescript → src/typescript}/FacadeTypes.d.ts +0 -0
- /package/dist/{typescript → src/typescript}/FacadeTypes.js +0 -0
- /package/dist/{typescript → src/typescript}/syntax.d.ts +0 -0
- /package/dist/{typescript → src/typescript}/syntax.js +0 -0
package/dist/{ui.js → src/ui.js}
RENAMED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
/** Fougere CLI UI — beautiful terminal interface. */
|
|
2
|
-
import
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
3
|
import pc from 'picocolors';
|
|
4
|
-
import { consola } from 'consola';
|
|
5
4
|
import { defaultTheme } from './theme.js';
|
|
5
|
+
const load = createRequire(import.meta.url);
|
|
6
|
+
let loaded;
|
|
7
|
+
/** Loaded at the first prompt or line it draws — `fougere --help` draws none. */
|
|
8
|
+
const clack = () => (loaded ??= load('@clack/prompts'));
|
|
6
9
|
export function ui(options) {
|
|
7
10
|
const c = { ...defaultTheme, ...options?.colors };
|
|
8
11
|
return {
|
|
9
12
|
// ── Lifecycle ─────────────────────────────────
|
|
10
13
|
/** Start a new CLI session with a branded header. */
|
|
11
14
|
intro(title = 'Fougere') {
|
|
12
|
-
clack.intro(c.brand(title));
|
|
15
|
+
clack().intro(c.brand(title));
|
|
13
16
|
},
|
|
14
17
|
/** End the session with a message. */
|
|
15
18
|
outro(message) {
|
|
16
|
-
clack.outro(c.success(message));
|
|
19
|
+
clack().outro(c.success(message));
|
|
17
20
|
},
|
|
18
21
|
/** Cancel and exit. */
|
|
19
22
|
cancel(message = 'Cancelled.') {
|
|
20
|
-
clack.cancel(c.muted(message));
|
|
23
|
+
clack().cancel(c.muted(message));
|
|
21
24
|
process.exit(0);
|
|
22
25
|
},
|
|
23
26
|
// ── Prompts ───────────────────────────────────
|
|
24
27
|
/** Text input. */
|
|
25
28
|
async text(opts) {
|
|
26
|
-
const result = await clack.text(opts);
|
|
27
|
-
if (clack.isCancel(result)) {
|
|
29
|
+
const result = await clack().text(opts);
|
|
30
|
+
if (clack().isCancel(result)) {
|
|
28
31
|
this.cancel();
|
|
29
32
|
return '';
|
|
30
33
|
}
|
|
@@ -32,8 +35,8 @@ export function ui(options) {
|
|
|
32
35
|
},
|
|
33
36
|
/** Yes/no confirmation. */
|
|
34
37
|
async confirm(opts) {
|
|
35
|
-
const result = await clack.confirm(opts);
|
|
36
|
-
if (clack.isCancel(result)) {
|
|
38
|
+
const result = await clack().confirm(opts);
|
|
39
|
+
if (clack().isCancel(result)) {
|
|
37
40
|
this.cancel();
|
|
38
41
|
return false;
|
|
39
42
|
}
|
|
@@ -41,8 +44,8 @@ export function ui(options) {
|
|
|
41
44
|
},
|
|
42
45
|
/** Select one from a list. */
|
|
43
46
|
async select(opts) {
|
|
44
|
-
const result = await clack.select(opts);
|
|
45
|
-
if (clack.isCancel(result)) {
|
|
47
|
+
const result = await clack().select(opts);
|
|
48
|
+
if (clack().isCancel(result)) {
|
|
46
49
|
this.cancel();
|
|
47
50
|
return '';
|
|
48
51
|
}
|
|
@@ -50,8 +53,8 @@ export function ui(options) {
|
|
|
50
53
|
},
|
|
51
54
|
/** Multi-select from a list. */
|
|
52
55
|
async multiselect(opts) {
|
|
53
|
-
const result = await clack.multiselect(opts);
|
|
54
|
-
if (clack.isCancel(result)) {
|
|
56
|
+
const result = await clack().multiselect(opts);
|
|
57
|
+
if (clack().isCancel(result)) {
|
|
55
58
|
this.cancel();
|
|
56
59
|
return [];
|
|
57
60
|
}
|
|
@@ -60,7 +63,7 @@ export function ui(options) {
|
|
|
60
63
|
// ── Spinner ───────────────────────────────────
|
|
61
64
|
/** Start a spinner. Returns stop/update functions. */
|
|
62
65
|
spinner(message) {
|
|
63
|
-
const s = clack.spinner();
|
|
66
|
+
const s = clack().spinner();
|
|
64
67
|
s.start(message);
|
|
65
68
|
return {
|
|
66
69
|
update: (msg) => s.message(msg),
|
|
@@ -70,32 +73,31 @@ export function ui(options) {
|
|
|
70
73
|
// ── Output ────────────────────────────────────
|
|
71
74
|
/** Informational message. */
|
|
72
75
|
info(message) {
|
|
73
|
-
clack.log.info(message);
|
|
76
|
+
clack().log.info(message);
|
|
74
77
|
},
|
|
75
78
|
/** Success message. */
|
|
76
79
|
success(message) {
|
|
77
|
-
clack.log.success(c.success(message));
|
|
80
|
+
clack().log.success(c.success(message));
|
|
78
81
|
},
|
|
79
82
|
/** Warning message. */
|
|
80
83
|
warn(message) {
|
|
81
|
-
clack.log.warn(c.warn(message));
|
|
84
|
+
clack().log.warn(c.warn(message));
|
|
82
85
|
},
|
|
83
86
|
/** Error message. */
|
|
84
87
|
error(message) {
|
|
85
|
-
clack.log.error(c.error(message));
|
|
88
|
+
clack().log.error(c.error(message));
|
|
86
89
|
},
|
|
87
90
|
/** Step indicator. */
|
|
88
91
|
step(message) {
|
|
89
|
-
clack.log.step(message);
|
|
92
|
+
clack().log.step(message);
|
|
90
93
|
},
|
|
91
94
|
/** Note box — multiline content in a box. */
|
|
92
95
|
note(message, title) {
|
|
93
|
-
clack.note(message, title);
|
|
96
|
+
clack().note(message, title);
|
|
94
97
|
},
|
|
95
|
-
// ── Raw colors
|
|
98
|
+
// ── Raw colors ────────────────────────────────
|
|
96
99
|
colors: c,
|
|
97
100
|
pc,
|
|
98
|
-
consola,
|
|
99
101
|
};
|
|
100
102
|
}
|
|
101
103
|
//# sourceMappingURL=ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/ui.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0-alpha.0",
|
|
4
4
|
"description": "The Fougere CLI — compose a workspace, serve a frond, call an operation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -16,54 +16,50 @@
|
|
|
16
16
|
"directory": "packages/cli"
|
|
17
17
|
},
|
|
18
18
|
"type": "module",
|
|
19
|
-
"main": "dist/index.js",
|
|
20
|
-
"types": "dist/index.d.ts",
|
|
19
|
+
"main": "dist/src/index.js",
|
|
20
|
+
"types": "dist/src/index.d.ts",
|
|
21
21
|
"bin": {
|
|
22
|
-
"fougere": "dist/bin.js"
|
|
22
|
+
"fougere": "dist/src/bin.js"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
|
-
"types": "./dist/index.d.ts",
|
|
27
|
-
"import": "./dist/index.js"
|
|
26
|
+
"types": "./dist/src/index.d.ts",
|
|
27
|
+
"import": "./dist/src/index.js"
|
|
28
28
|
},
|
|
29
|
-
"./bin": "./dist/bin.js"
|
|
29
|
+
"./bin": "./dist/src/bin.js"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
|
-
"
|
|
34
|
-
"fronds",
|
|
35
|
-
"templates",
|
|
36
|
-
"src"
|
|
33
|
+
"templates"
|
|
37
34
|
],
|
|
38
35
|
"dependencies": {
|
|
39
36
|
"@clack/prompts": "^0.10.0",
|
|
37
|
+
"@fougere/compiler": "0.13.0-alpha.0",
|
|
38
|
+
"@fougere/container": "0.13.0-alpha.0",
|
|
39
|
+
"@fougere/core": "0.13.0-alpha.0",
|
|
40
|
+
"@fougere/defaults": "0.13.0-alpha.0",
|
|
41
|
+
"@fougere/schema": "0.13.0-alpha.0",
|
|
42
|
+
"@fougere/testing": "0.13.0-alpha.0",
|
|
43
|
+
"@fougere/transport-http": "0.13.0-alpha.0",
|
|
40
44
|
"citty": "^0.2.1",
|
|
41
|
-
"consola": "^3.4.2",
|
|
42
45
|
"jiti": "^2.4.2",
|
|
43
46
|
"picocolors": "^1.1.1",
|
|
44
|
-
"safe-regex": "^2.1.1"
|
|
45
|
-
"@fougere/compiler": "0.12.5-alpha.0",
|
|
46
|
-
"@fougere/container": "0.12.5-alpha.0",
|
|
47
|
-
"@fougere/core": "0.12.5-alpha.0",
|
|
48
|
-
"@fougere/schema": "0.12.5-alpha.0",
|
|
49
|
-
"@fougere/testing": "0.12.5-alpha.0",
|
|
50
|
-
"@fougere/transport-http": "0.12.5-alpha.0",
|
|
51
|
-
"@fougere/defaults": "0.12.5-alpha.0"
|
|
47
|
+
"safe-regex": "^2.1.1"
|
|
52
48
|
},
|
|
53
49
|
"devDependencies": {
|
|
54
|
-
"
|
|
55
|
-
"@fougere/next": "0.
|
|
56
|
-
"@fougere/nuxt": "0.
|
|
57
|
-
"@fougere/oclif": "0.
|
|
58
|
-
"@fougere/react": "0.
|
|
59
|
-
"@fougere/
|
|
60
|
-
"
|
|
50
|
+
"@fougere/admin": "0.13.0-alpha.0",
|
|
51
|
+
"@fougere/next": "0.13.0-alpha.0",
|
|
52
|
+
"@fougere/nuxt": "0.13.0-alpha.0",
|
|
53
|
+
"@fougere/oclif": "0.13.0-alpha.0",
|
|
54
|
+
"@fougere/react": "0.13.0-alpha.0",
|
|
55
|
+
"@fougere/svelte": "0.13.0-alpha.0",
|
|
56
|
+
"vitest": "^4.1.0"
|
|
61
57
|
},
|
|
62
58
|
"publishConfig": {
|
|
63
59
|
"access": "public"
|
|
64
60
|
},
|
|
65
61
|
"peerDependencies": {
|
|
66
|
-
"@fougere/adapter-sql": "^0.
|
|
62
|
+
"@fougere/adapter-sql": "^0.13.0-alpha.0"
|
|
67
63
|
},
|
|
68
64
|
"peerDependenciesMeta": {
|
|
69
65
|
"@fougere/adapter-sql": {
|
|
@@ -71,7 +67,7 @@
|
|
|
71
67
|
}
|
|
72
68
|
},
|
|
73
69
|
"scripts": {
|
|
74
|
-
"build": "rm -rf dist && tsc && chmod +x dist/
|
|
70
|
+
"build": "rm -rf dist && node scripts/scan.ts && tsc && chmod +x dist/src/bin.js",
|
|
75
71
|
"test": "vitest run",
|
|
76
72
|
"test:watch": "vitest",
|
|
77
73
|
"typecheck": "tsc --noEmit && tsc -p tsconfig.runtime.json && tsc -p tsconfig.templates.json"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
// A frond is autonomous TypeScript domain code — it typechecks on its own, against this file.
|
|
3
|
+
"extends": "@fougere/core/tsconfig",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "ES2022",
|
|
6
|
+
"module": "Node16",
|
|
7
|
+
"moduleResolution": "Node16",
|
|
8
|
+
"lib": ["ESNext"],
|
|
9
|
+
"types": ["node"],
|
|
10
|
+
"strict": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"rootDir": "."
|
|
15
|
+
},
|
|
16
|
+
"include": ["."]
|
|
17
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// A frond is autonomous TypeScript domain code — it typechecks on its own, against
|
|
3
3
|
// this file, without Nuxt and without `.nuxt/tsconfig.json`. `pnpm typecheck` at the
|
|
4
4
|
// workspace root runs it, and it is the cheapest judge you have.
|
|
5
|
+
"extends": "@fougere/core/tsconfig",
|
|
5
6
|
"compilerOptions": {
|
|
6
7
|
"target": "ES2022",
|
|
7
8
|
"module": "Node16",
|
|
@@ -12,10 +13,7 @@
|
|
|
12
13
|
"esModuleInterop": true,
|
|
13
14
|
"skipLibCheck": true,
|
|
14
15
|
"noEmit": true,
|
|
15
|
-
"rootDir": "."
|
|
16
|
-
// A frond names its neighbours, it does not walk to them: the alias the Nuxt module
|
|
17
|
-
// registers at runtime (`@fronds/<name>` → the frond directory), stated for the compiler.
|
|
18
|
-
"paths": { "@fronds/*": ["./*"] }
|
|
16
|
+
"rootDir": "."
|
|
19
17
|
},
|
|
20
18
|
"include": ["."]
|
|
21
19
|
}
|
|
@@ -2,9 +2,11 @@ packages:
|
|
|
2
2
|
- fronds/*
|
|
3
3
|
- apps/*
|
|
4
4
|
|
|
5
|
-
# pnpm 11 fails an install rather than warning about a build script it was not
|
|
6
|
-
# told to run, and it reads the allowlist here — `pnpm.onlyBuiltDependencies` in
|
|
7
|
-
# package.json is the pnpm 10 location, now ignored in silence.
|
|
8
5
|
allowBuilds:
|
|
9
6
|
better-sqlite3: true
|
|
10
7
|
esbuild: true
|
|
8
|
+
|
|
9
|
+
# A project is created the day a version is published: the delay pnpm can apply to a fresh
|
|
10
|
+
# release would hold back the very version the scaffold was written for.
|
|
11
|
+
minimumReleaseAgeExclude:
|
|
12
|
+
- '@fougere/*'
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { createAppRunner } from '@fougere/core';
|
|
2
|
-
import type { App } from '@fougere/core';
|
|
3
|
-
import type { ui as createUi } from '../../src/ui.js';
|
|
4
|
-
import type { BuildReport } from '../../fronds/analysis/handlers/BuildHandler.js';
|
|
5
|
-
import pc from 'picocolors';
|
|
6
|
-
import { machineWanted, printMachine } from '../../src/machine.js';
|
|
7
|
-
|
|
8
|
-
type Ui = ReturnType<typeof createUi>;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* `fougere build` — the scan, written down.
|
|
12
|
-
*
|
|
13
|
-
* It reports what the module HOLDS rather than that it was written: a build that found
|
|
14
|
-
* one frond where the project has three has succeeded at the wrong thing, and the path
|
|
15
|
-
* alone does not say so.
|
|
16
|
-
*/
|
|
17
|
-
export default class BuildCommand {
|
|
18
|
-
constructor(private app: App, private ui: Ui) {}
|
|
19
|
-
|
|
20
|
-
async run(raw: Record<string, unknown>) {
|
|
21
|
-
const built = (await createAppRunner(this.app)(
|
|
22
|
-
{ entity: 'build', op: 'execute' },
|
|
23
|
-
{ params: {}, query: {}, input: raw, state: {} },
|
|
24
|
-
)) as BuildReport;
|
|
25
|
-
|
|
26
|
-
if (machineWanted(raw)) return printMachine(built);
|
|
27
|
-
|
|
28
|
-
if (built.fronds.length === 0) {
|
|
29
|
-
this.ui.warn('No fronds found. Run this from a Fougere project root.');
|
|
30
|
-
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
this.ui.success(`${built.path} — ${built.fronds.length} frond(s), ${built.entities} entities, ${built.handlers} handlers`);
|
|
35
|
-
this.ui.step(built.fronds.map((name) => pc.bold(name)).join(', '));
|
|
36
|
-
|
|
37
|
-
// A diagnostic travels INTO the module, so a boot from it says the same thing. Saying
|
|
38
|
-
// it here too is not a duplicate: this is the moment someone can still fix the source.
|
|
39
|
-
for (const diagnostic of built.diagnostics) this.ui.warn(diagnostic);
|
|
40
|
-
|
|
41
|
-
this.ui.step(pc.dim('hand it to createApp as `scan:` — nothing reads a disk after this'));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { createAppRunner } from '@fougere/core';
|
|
2
|
-
import { lowerFirst } from '@fougere/core/contract';
|
|
3
|
-
import { bootApp } from '@fougere/defaults';
|
|
4
|
-
import type { App } from '@fougere/core';
|
|
5
|
-
import type { ui as createUi } from '../../src/ui.js';
|
|
6
|
-
|
|
7
|
-
type Ui = ReturnType<typeof createUi>;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Parse `--field value` / `--field=value` / `--flag` from the raw argv.
|
|
11
|
-
* `call`'s payload is free-form (any entity's fields), so it can't be declared
|
|
12
|
-
* on the Call entity — citty would boolean-ify undeclared flags. We read the
|
|
13
|
-
* tail ourselves; positionals (the target) are ignored (not `--`-prefixed).
|
|
14
|
-
*/
|
|
15
|
-
function parseFlags(tokens: string[]): Record<string, unknown> {
|
|
16
|
-
const out: Record<string, unknown> = {};
|
|
17
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
18
|
-
const t = tokens[i];
|
|
19
|
-
if (!t.startsWith('--')) continue;
|
|
20
|
-
const eq = t.indexOf('=');
|
|
21
|
-
if (eq !== -1) { out[t.slice(2, eq)] = t.slice(eq + 1); continue; }
|
|
22
|
-
const key = t.slice(2);
|
|
23
|
-
const next = tokens[i + 1];
|
|
24
|
-
if (next === undefined || next.startsWith('--')) out[key] = true;
|
|
25
|
-
else { out[key] = next; i++; }
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return out;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The client end of the gradient: drive one operation on the project's app and
|
|
33
|
-
* print the result. It follows the topology — if `remotes:` sends the frond
|
|
34
|
-
* elsewhere, the call travels there. Same envelope every consumer uses.
|
|
35
|
-
*/
|
|
36
|
-
export default class CallCommand {
|
|
37
|
-
constructor(private app: App, private ui: Ui) {}
|
|
38
|
-
|
|
39
|
-
async run(raw: Record<string, unknown>) {
|
|
40
|
-
const target = raw.operation as string | undefined;
|
|
41
|
-
if (!target || !target.includes('.')) {
|
|
42
|
-
this.ui.error('Usage: fougere call <entity>.<op> [--field value …]');
|
|
43
|
-
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const [entityName, op] = target.split('.');
|
|
47
|
-
|
|
48
|
-
// Flags → invocation, by the same rule the framework's binding uses:
|
|
49
|
-
// a primitive param (like `id`) resolves from `params`, an object from
|
|
50
|
-
// `body`. So `--id` is a route param, every other flag is the body.
|
|
51
|
-
const flags = parseFlags(process.argv.slice(2));
|
|
52
|
-
const params: Record<string, string> = {};
|
|
53
|
-
const input: Record<string, unknown> = {};
|
|
54
|
-
for (const [k, v] of Object.entries(flags)) {
|
|
55
|
-
if (k === 'id') params.id = String(v);
|
|
56
|
-
else input[k] = v;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const app = await bootApp(process.cwd(), {});
|
|
60
|
-
try {
|
|
61
|
-
const result = await createAppRunner(app)(
|
|
62
|
-
{ entity: lowerFirst(entityName), op },
|
|
63
|
-
{ params, query: {}, input, state: {} },
|
|
64
|
-
);
|
|
65
|
-
this.ui.note(JSON.stringify(result, null, 2), target);
|
|
66
|
-
} finally {
|
|
67
|
-
await app.dispose();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { CheckResult } from '../../fronds/analysis/handlers/CheckHandler.js';
|
|
2
|
-
import type { Diagnostic } from '@fougere/core';
|
|
3
|
-
import type { App } from '@fougere/core';
|
|
4
|
-
import { createAppRunner } from '@fougere/core';
|
|
5
|
-
import type { ui as createUi } from '../../src/ui.js';
|
|
6
|
-
import pc from 'picocolors';
|
|
7
|
-
import { relative } from 'node:path';
|
|
8
|
-
import { machineWanted, printMachine } from '../../src/machine.js';
|
|
9
|
-
|
|
10
|
-
type Ui = ReturnType<typeof createUi>;
|
|
11
|
-
|
|
12
|
-
export default class CheckCommand {
|
|
13
|
-
constructor(private app: App, private ui: Ui) {}
|
|
14
|
-
|
|
15
|
-
async run(raw: Record<string, unknown>) {
|
|
16
|
-
// Ride the call contract — the same envelope every consumer uses.
|
|
17
|
-
const result = await createAppRunner(this.app)(
|
|
18
|
-
{ entity: 'check', op: 'execute' },
|
|
19
|
-
{ params: {}, query: {}, input: raw, state: {} },
|
|
20
|
-
) as CheckResult;
|
|
21
|
-
|
|
22
|
-
// A non-zero exit is what makes this usable in CI, so it is decided before the two
|
|
23
|
-
// renderings rather than inside the terminal one.
|
|
24
|
-
const blocking = result.findings.filter((f) => f.severity === 'blocking').length;
|
|
25
|
-
if (blocking > 0) process.exitCode = 1;
|
|
26
|
-
|
|
27
|
-
if (machineWanted(raw)) return printMachine(result);
|
|
28
|
-
|
|
29
|
-
if (result.fronds === 0) {
|
|
30
|
-
this.ui.warn('No fronds found. Run this from a Fougere project root.');
|
|
31
|
-
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
this.ui.step(`${pc.bold(String(result.fronds))} frond(s), ${pc.bold(String(result.handlers))} handler(s)`);
|
|
36
|
-
|
|
37
|
-
if (result.findings.length === 0) {
|
|
38
|
-
this.ui.success('Nothing to report.');
|
|
39
|
-
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
this.ui.note(result.findings.map(render).join('\n\n'), 'Findings');
|
|
44
|
-
|
|
45
|
-
// Warnings do not fail: an unresolvable base class with no operation is ordinary,
|
|
46
|
-
// and a check that cries wolf stops being read.
|
|
47
|
-
this.ui.info(`${blocking} blocking, ${result.findings.length - blocking} warning(s)`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function render(f: Diagnostic): string {
|
|
52
|
-
const mark = f.severity === 'blocking' ? pc.red('✗') : pc.yellow('⚠');
|
|
53
|
-
const where = relative(process.cwd(), f.filePath) || f.filePath;
|
|
54
|
-
const what = f.subject ? ` ${f.subject}` : '';
|
|
55
|
-
|
|
56
|
-
return ` ${mark} ${pc.bold(`[${f.code}]`)}${what}\n${wrap(f.message, 76, ' ')}\n ${pc.dim(where)}`;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** A box grows to its longest line, so a one-line sentence makes an unreadable box. */
|
|
60
|
-
function wrap(text: string, width: number, indent: string): string {
|
|
61
|
-
const lines: string[] = [];
|
|
62
|
-
let line = '';
|
|
63
|
-
for (const word of text.split(' ')) {
|
|
64
|
-
if (line && line.length + 1 + word.length > width) { lines.push(line); line = word; }
|
|
65
|
-
else line = line ? `${line} ${word}` : word;
|
|
66
|
-
}
|
|
67
|
-
if (line) lines.push(line);
|
|
68
|
-
|
|
69
|
-
return lines.map((l) => indent + l).join('\n');
|
|
70
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { App } from '@fougere/core';
|
|
2
|
-
// `dist/`, not `src/` — app/ ships raw and is loaded by jiti at runtime, but the
|
|
3
|
-
// published package carries only dist/, app/, fronds/ and templates/.
|
|
4
|
-
import { generateZshCompletion, generateBashCompletion } from '../../dist/completion.js';
|
|
5
|
-
|
|
6
|
-
export default class CompletionCommand {
|
|
7
|
-
constructor(private app: App) {}
|
|
8
|
-
|
|
9
|
-
async run(raw: Record<string, unknown>) {
|
|
10
|
-
const shell = (raw.shell as string) || detectShell();
|
|
11
|
-
const script = shell === 'bash'
|
|
12
|
-
? generateBashCompletion(this.app)
|
|
13
|
-
: generateZshCompletion(this.app);
|
|
14
|
-
console.log(script);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function detectShell(): string {
|
|
19
|
-
const shell = process.env.SHELL ?? '';
|
|
20
|
-
if (shell.includes('zsh')) return 'zsh';
|
|
21
|
-
if (shell.includes('bash')) return 'bash';
|
|
22
|
-
|
|
23
|
-
return 'zsh';
|
|
24
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { createAppRunner } from '@fougere/core';
|
|
2
|
-
import type { App, CallRecord } from '@fougere/core';
|
|
3
|
-
import type { CallsView } from '../../fronds/analysis/handlers/DevtoolsHandler.js';
|
|
4
|
-
import type { ui as createUi } from '../../src/ui.js';
|
|
5
|
-
import { machineWanted, printMachine } from '../../src/machine.js';
|
|
6
|
-
import pc from 'picocolors';
|
|
7
|
-
|
|
8
|
-
type Ui = ReturnType<typeof createUi>;
|
|
9
|
-
|
|
10
|
-
/** How long between two reads. Fast enough to read as a stream, cheap enough to ignore. */
|
|
11
|
-
const EVERY_MS = 500;
|
|
12
|
-
|
|
13
|
-
const ROUTE = { local: pc.green, remote: pc.cyan, system: pc.magenta } as const;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* `fougere devtools` — the call log of every running app of this project, followed.
|
|
17
|
-
*
|
|
18
|
-
* A cursor per address, because each app numbers its own ring: asking for what this reader
|
|
19
|
-
* has not seen is the whole protocol, and it is per source or nothing.
|
|
20
|
-
*/
|
|
21
|
-
export default class DevtoolsCommand {
|
|
22
|
-
constructor(private app: App, private ui: Ui) {}
|
|
23
|
-
|
|
24
|
-
async run(raw: Record<string, unknown>) {
|
|
25
|
-
const since: Record<string, number> = {};
|
|
26
|
-
|
|
27
|
-
if (machineWanted(raw)) return printMachine(await this.view(raw, since));
|
|
28
|
-
|
|
29
|
-
const first = await this.view(raw, since);
|
|
30
|
-
this.announce(first);
|
|
31
|
-
|
|
32
|
-
const told: Record<string, number> = {};
|
|
33
|
-
for (let view = first; ; view = await this.view(raw, since)) {
|
|
34
|
-
for (const source of view.sources) {
|
|
35
|
-
since[source.url] = source.cursor;
|
|
36
|
-
|
|
37
|
-
// Said once per address, and only when it grows: a ring that dropped is not a
|
|
38
|
-
// quiet period, and repeating it every half second would bury the calls.
|
|
39
|
-
if (source.dropped > (told[source.url] ?? 0)) {
|
|
40
|
-
this.ui.warn(`${source.url} dropped ${source.dropped - (told[source.url] ?? 0)} call(s) — its ring is smaller than this traffic`);
|
|
41
|
-
told[source.url] = source.dropped;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
for (const call of view.calls) process.stdout.write(render(call, view.sources.length > 1) + '\n');
|
|
46
|
-
await new Promise((wake) => setTimeout(wake, EVERY_MS));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** What is being watched, and what refused — stated before the first line scrolls. */
|
|
51
|
-
private announce(view: CallsView): void {
|
|
52
|
-
for (const source of view.sources) {
|
|
53
|
-
const name = source.frond ? `${pc.bold(source.frond)} ${pc.dim(source.url)}` : pc.bold(source.url);
|
|
54
|
-
if (source.refusal) this.ui.warn(`${name} — ${source.refusal}`);
|
|
55
|
-
else this.ui.step(`following ${name}`);
|
|
56
|
-
}
|
|
57
|
-
this.ui.info(pc.dim('ctrl-c to stop'));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
private view(raw: Record<string, unknown>, since: Record<string, number>): Promise<CallsView> {
|
|
61
|
-
return createAppRunner(this.app)(
|
|
62
|
-
{ entity: 'devtools', op: 'execute' },
|
|
63
|
-
{ params: {}, query: {}, input: { ...raw, since }, state: {} },
|
|
64
|
-
) as Promise<CallsView>;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function render(call: CallRecord & { source: string }, many: boolean): string {
|
|
69
|
-
// Padded BEFORE colouring: an escape sequence counts in a string's length, so padding a
|
|
70
|
-
// coloured value moves the column by however many bytes the colour took.
|
|
71
|
-
const at = many ? pc.dim(pad(new URL(call.source).port || call.source, 5)) : '';
|
|
72
|
-
const frond = pc.dim(pad(call.frond ?? '—', 9));
|
|
73
|
-
const address = pc.bold(pad(`${call.entity}.${call.operation}${call.surface ? `/${call.surface}` : ''}`, 22));
|
|
74
|
-
const route = call.route
|
|
75
|
-
? (ROUTE[call.route] ?? pc.dim)(pad(call.route, 9))
|
|
76
|
-
: pc.red(pad('unrouted', 9));
|
|
77
|
-
const took = pc.dim(lead(call.ms === undefined ? '' : `${call.ms}ms`, 7));
|
|
78
|
-
const verdict = call.verdict === 'failed'
|
|
79
|
-
? pc.red(call.refusal?.code ?? 'failed')
|
|
80
|
-
: call.verdict === 'ok' ? pc.dim('ok') : pc.yellow('running');
|
|
81
|
-
|
|
82
|
-
return [at, frond, address, route, took, verdict, call.trace ? pc.dim(call.trace.slice(3, 11)) : '']
|
|
83
|
-
.filter(Boolean).join(' ');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function pad(value: string, width: number): string {
|
|
87
|
-
return value.length >= width ? value : value + ' '.repeat(width - value.length);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function lead(value: string, width: number): string {
|
|
91
|
-
return value.length >= width ? value : ' '.repeat(width - value.length) + value;
|
|
92
|
-
}
|