staticforge 0.0.0-stage → 0.1.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.
Files changed (123) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -2
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/bin.d.ts +3 -0
  5. package/dist/bin.d.ts.map +1 -0
  6. package/dist/bin.js +4 -0
  7. package/dist/bin.js.map +1 -0
  8. package/dist/browser.d.ts +3 -0
  9. package/dist/browser.d.ts.map +1 -0
  10. package/dist/browser.js +18 -0
  11. package/dist/browser.js.map +1 -0
  12. package/dist/cloud.d.ts +31 -0
  13. package/dist/cloud.d.ts.map +1 -0
  14. package/dist/cloud.js +102 -0
  15. package/dist/cloud.js.map +1 -0
  16. package/dist/command.d.ts +54 -0
  17. package/dist/command.d.ts.map +1 -0
  18. package/dist/command.js +70 -0
  19. package/dist/command.js.map +1 -0
  20. package/dist/commands/build.d.ts +4 -0
  21. package/dist/commands/build.d.ts.map +1 -0
  22. package/dist/commands/build.js +54 -0
  23. package/dist/commands/build.js.map +1 -0
  24. package/dist/commands/check.d.ts +4 -0
  25. package/dist/commands/check.d.ts.map +1 -0
  26. package/dist/commands/check.js +100 -0
  27. package/dist/commands/check.js.map +1 -0
  28. package/dist/commands/config.d.ts +4 -0
  29. package/dist/commands/config.d.ts.map +1 -0
  30. package/dist/commands/config.js +27 -0
  31. package/dist/commands/config.js.map +1 -0
  32. package/dist/commands/deploy.d.ts +4 -0
  33. package/dist/commands/deploy.d.ts.map +1 -0
  34. package/dist/commands/deploy.js +184 -0
  35. package/dist/commands/deploy.js.map +1 -0
  36. package/dist/commands/dev.d.ts +4 -0
  37. package/dist/commands/dev.d.ts.map +1 -0
  38. package/dist/commands/dev.js +81 -0
  39. package/dist/commands/dev.js.map +1 -0
  40. package/dist/commands/iac.d.ts +4 -0
  41. package/dist/commands/iac.d.ts.map +1 -0
  42. package/dist/commands/iac.js +64 -0
  43. package/dist/commands/iac.js.map +1 -0
  44. package/dist/commands/init.d.ts +4 -0
  45. package/dist/commands/init.d.ts.map +1 -0
  46. package/dist/commands/init.js +55 -0
  47. package/dist/commands/init.js.map +1 -0
  48. package/dist/commands/mcp.d.ts +4 -0
  49. package/dist/commands/mcp.d.ts.map +1 -0
  50. package/dist/commands/mcp.js +46 -0
  51. package/dist/commands/mcp.js.map +1 -0
  52. package/dist/commands/new.d.ts +4 -0
  53. package/dist/commands/new.d.ts.map +1 -0
  54. package/dist/commands/new.js +30 -0
  55. package/dist/commands/new.js.map +1 -0
  56. package/dist/commands/preview.d.ts +4 -0
  57. package/dist/commands/preview.d.ts.map +1 -0
  58. package/dist/commands/preview.js +34 -0
  59. package/dist/commands/preview.js.map +1 -0
  60. package/dist/commands/provision.d.ts +11 -0
  61. package/dist/commands/provision.d.ts.map +1 -0
  62. package/dist/commands/provision.js +133 -0
  63. package/dist/commands/provision.js.map +1 -0
  64. package/dist/commands/schema.d.ts +4 -0
  65. package/dist/commands/schema.d.ts.map +1 -0
  66. package/dist/commands/schema.js +21 -0
  67. package/dist/commands/schema.js.map +1 -0
  68. package/dist/commands/version.d.ts +4 -0
  69. package/dist/commands/version.d.ts.map +1 -0
  70. package/dist/commands/version.js +17 -0
  71. package/dist/commands/version.js.map +1 -0
  72. package/dist/context.d.ts +27 -0
  73. package/dist/context.d.ts.map +1 -0
  74. package/dist/context.js +19 -0
  75. package/dist/context.js.map +1 -0
  76. package/dist/io.d.ts +19 -0
  77. package/dist/io.d.ts.map +1 -0
  78. package/dist/io.js +34 -0
  79. package/dist/io.js.map +1 -0
  80. package/dist/main.d.ts +10 -0
  81. package/dist/main.d.ts.map +1 -0
  82. package/dist/main.js +81 -0
  83. package/dist/main.js.map +1 -0
  84. package/dist/mcp/invoke.d.ts +29 -0
  85. package/dist/mcp/invoke.d.ts.map +1 -0
  86. package/dist/mcp/invoke.js +82 -0
  87. package/dist/mcp/invoke.js.map +1 -0
  88. package/dist/mcp/server.d.ts +25 -0
  89. package/dist/mcp/server.d.ts.map +1 -0
  90. package/dist/mcp/server.js +531 -0
  91. package/dist/mcp/server.js.map +1 -0
  92. package/dist/output.d.ts +17 -0
  93. package/dist/output.d.ts.map +1 -0
  94. package/dist/output.js +37 -0
  95. package/dist/output.js.map +1 -0
  96. package/dist/paths.d.ts +3 -0
  97. package/dist/paths.d.ts.map +1 -0
  98. package/dist/paths.js +9 -0
  99. package/dist/paths.js.map +1 -0
  100. package/dist/project.d.ts +10 -0
  101. package/dist/project.d.ts.map +1 -0
  102. package/dist/project.js +20 -0
  103. package/dist/project.js.map +1 -0
  104. package/dist/schemas.d.ts +16 -0
  105. package/dist/schemas.d.ts.map +1 -0
  106. package/dist/schemas.js +241 -0
  107. package/dist/schemas.js.map +1 -0
  108. package/dist/server-options.d.ts +12 -0
  109. package/dist/server-options.d.ts.map +1 -0
  110. package/dist/server-options.js +26 -0
  111. package/dist/server-options.js.map +1 -0
  112. package/dist/version.d.ts +3 -0
  113. package/dist/version.d.ts.map +1 -0
  114. package/dist/version.js +4 -0
  115. package/dist/version.js.map +1 -0
  116. package/dist/workers.d.ts +7 -0
  117. package/dist/workers.d.ts.map +1 -0
  118. package/dist/workers.js +20 -0
  119. package/dist/workers.js.map +1 -0
  120. package/package.json +64 -3
  121. package/schema/diagnostics.schema.json +183 -0
  122. package/schema/output.schema.json +1537 -0
  123. package/schema/staticforge.schema.json +649 -0
package/dist/bin.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
package/dist/bin.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { run } from './main.js';
3
+ process.exitCode = await run(process.argv);
4
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,OAAO,CAAC,QAAQ,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Open a URL in the default browser; failures are ignored (e.g. headless machines). */
2
+ export declare function openBrowser(url: string): void;
3
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAc7C"}
@@ -0,0 +1,18 @@
1
+ import { spawn } from 'node:child_process';
2
+ /** Open a URL in the default browser; failures are ignored (e.g. headless machines). */
3
+ export function openBrowser(url) {
4
+ const [command, args] = process.platform === 'darwin'
5
+ ? ['open', [url]]
6
+ : process.platform === 'win32'
7
+ ? ['cmd', ['/c', 'start', '""', url]]
8
+ : ['xdg-open', [url]];
9
+ try {
10
+ spawn(command, args, { stdio: 'ignore', detached: true })
11
+ .on('error', () => { })
12
+ .unref();
13
+ }
14
+ catch {
15
+ // No browser available.
16
+ }
17
+ }
18
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,wFAAwF;AACxF,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,GACnB,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAC3B,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO;YAC5B,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,IAAI,CAAC;QACH,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;aACtD,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC;aACrB,KAAK,EAAE,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACP,wBAAwB;IAC1B,CAAC;AACH,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type LoadedConfig, type TargetConfig } from '@staticforge/core';
2
+ import { type Confirm, type IacRunOptions, type PlanSummary } from '@staticforge/iac';
3
+ import type { Deployer, Provider } from '@staticforge/provider-api';
4
+ import type { Runtime } from './command.js';
5
+ import type { CommandContext } from './context.js';
6
+ /**
7
+ * The provider of a target; tests inject fakes through the runtime. Providers
8
+ * are loaded on demand: their cloud SDKs would slow down every other command.
9
+ */
10
+ export declare function providerFor(runtime: Runtime, target: TargetConfig): Promise<Provider>;
11
+ export interface TargetContext {
12
+ loaded: LoadedConfig;
13
+ targetName: string;
14
+ target: TargetConfig;
15
+ provider: Provider;
16
+ iac: IacRunOptions;
17
+ }
18
+ export declare function targetContext(runtime: Runtime, ctx: CommandContext, loaded: LoadedConfig, targetName: string, localState?: boolean): Promise<TargetContext>;
19
+ /** The target's deployer, with its infrastructure outputs (cached, or read from state). */
20
+ export declare function deployerFor(ctx: CommandContext, target: TargetContext): Promise<Deployer>;
21
+ /** Human summary of a plan: one line per resource plus the totals. */
22
+ export declare function formatPlan(plan: PlanSummary): string;
23
+ /**
24
+ * The confirmation for a change: none with --yes, a prompt when interactive,
25
+ * otherwise SF_CONFIRMATION_REQUIRED (CI never applies by accident).
26
+ */
27
+ export declare function confirmer(ctx: CommandContext, yes: boolean, flag?: string): Confirm | undefined;
28
+ /** Ask a yes/no question without a plan (rollback, preview removal). */
29
+ export declare function confirmAction(ctx: CommandContext, yes: boolean, question: string): Promise<void>;
30
+ export declare const truthy: (value: string | undefined) => boolean;
31
+ //# sourceMappingURL=cloud.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,YAAY,EAIlB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,WAAW,EAEjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD;;;GAGG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAM3F;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,MAAM,EAClB,UAAU,UAAQ,GACjB,OAAO,CAAC,aAAa,CAAC,CAkBxB;AAED,2FAA2F;AAC3F,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAY/F;AAYD,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAYpD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,SAAU,GAAG,OAAO,GAAG,SAAS,CAiBhG;AAED,wEAAwE;AACxE,wBAAsB,aAAa,CACjC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAef;AAED,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,OACwB,CAAC"}
package/dist/cloud.js ADDED
@@ -0,0 +1,102 @@
1
+ import { ErrorCode, SforgeError, getTarget, } from '@staticforge/core';
2
+ import { targetOutputs, } from '@staticforge/iac';
3
+ import { loadProjectConfigAt } from './project.js';
4
+ /**
5
+ * The provider of a target; tests inject fakes through the runtime. Providers
6
+ * are loaded on demand: their cloud SDKs would slow down every other command.
7
+ */
8
+ export async function providerFor(runtime, target) {
9
+ const injected = runtime.providers?.[target.provider];
10
+ if (injected !== undefined)
11
+ return injected;
12
+ return target.provider === 'aws'
13
+ ? (await import('@staticforge/aws')).createAwsProvider()
14
+ : (await import('@staticforge/azure')).createAzureProvider();
15
+ }
16
+ export async function targetContext(runtime, ctx, loaded, targetName, localState = false) {
17
+ const target = getTarget(loaded.config, targetName);
18
+ const provider = await providerFor(runtime, target);
19
+ return {
20
+ loaded,
21
+ targetName,
22
+ target,
23
+ provider,
24
+ iac: {
25
+ rootDir: loaded.rootDir,
26
+ config: loaded.config,
27
+ targetName,
28
+ profile: provider.iac,
29
+ env: ctx.io.env,
30
+ logger: ctx.logger,
31
+ localState,
32
+ },
33
+ };
34
+ }
35
+ /** The target's deployer, with its infrastructure outputs (cached, or read from state). */
36
+ export async function deployerFor(ctx, target) {
37
+ const outputs = await targetOutputs(target.iac);
38
+ return target.provider.createDeployer({
39
+ rootDir: target.loaded.rootDir,
40
+ config: target.loaded.config,
41
+ targetName: target.targetName,
42
+ target: target.target,
43
+ outputs,
44
+ env: ctx.io.env,
45
+ logger: ctx.logger,
46
+ loadConfig: (dir) => loadProjectConfigAt(dir),
47
+ });
48
+ }
49
+ const SYMBOLS = {
50
+ create: '+',
51
+ update: '~',
52
+ delete: '-',
53
+ replace: '-/+',
54
+ read: '<=',
55
+ move: '->',
56
+ noop: ' ',
57
+ };
58
+ /** Human summary of a plan: one line per resource plus the totals. */
59
+ export function formatPlan(plan) {
60
+ const lines = plan.resources.map((r) => ` ${SYMBOLS[r.action] ?? '?'} ${r.address} (${r.action})`);
61
+ for (const d of plan.drift)
62
+ lines.push(` ! ${d.address} changed outside OpenTofu/Terraform (${d.action})`);
63
+ lines.push(plan.changes
64
+ ? `Plan: ${plan.add} to add, ${plan.change} to change, ${plan.remove} to destroy.`
65
+ : 'No changes. The infrastructure matches the configuration.');
66
+ return lines.join('\n');
67
+ }
68
+ /**
69
+ * The confirmation for a change: none with --yes, a prompt when interactive,
70
+ * otherwise SF_CONFIRMATION_REQUIRED (CI never applies by accident).
71
+ */
72
+ export function confirmer(ctx, yes, flag = '--yes') {
73
+ if (yes)
74
+ return undefined;
75
+ return async (question, plan) => {
76
+ if (!ctx.interactive) {
77
+ throw new SforgeError(ErrorCode.ConfirmationRequired, `${question.replace(/\?$/, '')}: confirmation required`, {
78
+ details: { plan },
79
+ hint: `Pass ${flag} to confirm in non-interactive runs (CI, --json, no TTY).`,
80
+ });
81
+ }
82
+ ctx.io.stderr.write(`${formatPlan(plan)}\n`);
83
+ const answer = await ctx.io.prompt(`${question} Type "yes" to continue: `);
84
+ return answer.trim().toLowerCase() === 'yes';
85
+ };
86
+ }
87
+ /** Ask a yes/no question without a plan (rollback, preview removal). */
88
+ export async function confirmAction(ctx, yes, question) {
89
+ if (yes)
90
+ return;
91
+ if (!ctx.interactive) {
92
+ throw new SforgeError(ErrorCode.ConfirmationRequired, `${question.replace(/\?$/, '')}: confirmation required`, {
93
+ hint: 'Pass --yes to confirm in non-interactive runs (CI, --json, no TTY).',
94
+ });
95
+ }
96
+ const answer = await ctx.io.prompt(`${question} Type "yes" to continue: `);
97
+ if (answer.trim().toLowerCase() !== 'yes') {
98
+ throw new SforgeError(ErrorCode.Aborted, 'Cancelled; nothing was changed');
99
+ }
100
+ }
101
+ export const truthy = (value) => value !== undefined && value !== '' && value !== 'false' && value !== '0';
102
+ //# sourceMappingURL=cloud.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud.js","sourceRoot":"","sources":["../src/cloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EACT,WAAW,EACX,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,aAAa,GACd,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAgB,EAAE,MAAoB;IACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC5C,OAAO,MAAM,CAAC,QAAQ,KAAK,KAAK;QAC9B,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,EAAE;QACxD,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACjE,CAAC;AAUD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAgB,EAChB,GAAmB,EACnB,MAAoB,EACpB,UAAkB,EAClB,UAAU,GAAG,KAAK;IAElB,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACpD,OAAO;QACL,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;IAC/C,CAAC,CAAC;AACJ,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAmB,EACnB,GAAY,EACZ,QAAgB;IAEhB,IAAI,GAAG;QAAE,OAAO;IAChB,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACrB,MAAM,IAAI,WAAW,CACnB,SAAS,CAAC,oBAAoB,EAC9B,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,yBAAyB,EACvD;YACE,IAAI,EAAE,qEAAqE;SAC5E,CACF,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,QAAQ,2BAA2B,CAAC,CAAC;IAC3E,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1C,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC,OAAO,EAAE,gCAAgC,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAyB,EAAW,EAAE,CAC3D,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,GAAG,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { Command } from 'commander';
2
+ import { ExitCode } from '@staticforge/core';
3
+ import type { Provider } from '@staticforge/provider-api';
4
+ import { type CommandContext } from './context.js';
5
+ import type { Io } from './io.js';
6
+ import { type Envelope } from './output.js';
7
+ /** Mutable state shared by all commands of one CLI invocation. */
8
+ export interface Runtime {
9
+ io: Io;
10
+ exitCode: ExitCode;
11
+ /** Cloud providers to use instead of the real ones (tests). */
12
+ providers?: Partial<Record<Provider['id'], Provider>>;
13
+ /**
14
+ * Receives every command's outcome, in --json mode or not, before a
15
+ * long-running command starts waiting (in-process callers: the MCP server).
16
+ */
17
+ onResult?(outcome: Outcome): void;
18
+ }
19
+ export interface Outcome {
20
+ envelope: Envelope;
21
+ /** The human-readable rendering, when the command has one. */
22
+ text?: string;
23
+ /** The current data of a long-running command (e.g. the dev server's latest build). */
24
+ live?: () => unknown;
25
+ }
26
+ export interface CommandResult<T> {
27
+ data: T;
28
+ /** Defaults to true. False marks a completed run that found failures (exit code 1). */
29
+ ok?: boolean;
30
+ /** Human-readable rendering written to stdout when not in --json mode. */
31
+ text?: string;
32
+ /**
33
+ * For long-running commands (servers): the result is written as soon as the
34
+ * command is ready, then the process stays up until this settles.
35
+ */
36
+ wait?: Promise<void>;
37
+ /** For long-running commands: the current `data`, for {@link Runtime.onResult}. */
38
+ live?: () => T;
39
+ }
40
+ export interface ActionInput {
41
+ /** Positional arguments in declaration order. */
42
+ args: unknown[];
43
+ /** The command's own (non-global) options. */
44
+ options: Record<string, unknown>;
45
+ }
46
+ export type Handler<T> = (ctx: CommandContext, input: ActionInput) => Promise<CommandResult<T>>;
47
+ /** "config validate" for `sforge config validate`. */
48
+ export declare function commandPath(command: Command): string;
49
+ /**
50
+ * Adapt a handler to a commander action: builds the context, renders the result
51
+ * (text or JSON envelope) and maps errors to stable codes and exit codes.
52
+ */
53
+ export declare function action<T>(runtime: Runtime, handler: Handler<T>): (...raw: unknown[]) => Promise<void>;
54
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAA4B,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,QAAQ,EAAy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O,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,IAC/C,GAAG,KAAK,OAAO,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CA+ChD"}
@@ -0,0 +1,70 @@
1
+ import { ExitCode, ErrorCode, toSforgeError } from '@staticforge/core';
2
+ import { createContext } from './context.js';
3
+ import { OUTPUT_SCHEMA_VERSION } from './output.js';
4
+ /** "config validate" for `sforge config validate`. */
5
+ export function commandPath(command) {
6
+ const names = [];
7
+ for (let c = command; c?.parent; c = c.parent)
8
+ names.unshift(c.name());
9
+ return names.join(' ');
10
+ }
11
+ function writeEnvelope(io, envelope) {
12
+ io.stdout.write(`${JSON.stringify(envelope, null, 2)}\n`);
13
+ }
14
+ /**
15
+ * Adapt a handler to a commander action: builds the context, renders the result
16
+ * (text or JSON envelope) and maps errors to stable codes and exit codes.
17
+ */
18
+ export function action(runtime, handler) {
19
+ return async (...raw) => {
20
+ const command = raw.at(-1);
21
+ const ctx = createContext(command, runtime.io);
22
+ const name = commandPath(command);
23
+ try {
24
+ const result = await handler(ctx, { args: raw.slice(0, -2), options: command.opts() });
25
+ const ok = result.ok ?? true;
26
+ const envelope = {
27
+ schemaVersion: OUTPUT_SCHEMA_VERSION,
28
+ command: name,
29
+ ok,
30
+ data: result.data,
31
+ };
32
+ runtime.onResult?.({
33
+ envelope,
34
+ ...(result.text !== undefined && { text: result.text }),
35
+ ...(result.live && { live: result.live }),
36
+ });
37
+ if (ctx.json) {
38
+ writeEnvelope(runtime.io, envelope);
39
+ }
40
+ else if (result.text !== undefined) {
41
+ runtime.io.stdout.write(result.text.endsWith('\n') ? result.text : `${result.text}\n`);
42
+ }
43
+ runtime.exitCode = ok ? ExitCode.Ok : ExitCode.Failure;
44
+ await result.wait;
45
+ }
46
+ catch (thrown) {
47
+ const error = toSforgeError(thrown);
48
+ const envelope = {
49
+ schemaVersion: OUTPUT_SCHEMA_VERSION,
50
+ command: name,
51
+ ok: false,
52
+ error: error.toJSON(),
53
+ };
54
+ runtime.onResult?.({ envelope });
55
+ if (ctx.json) {
56
+ writeEnvelope(runtime.io, envelope);
57
+ }
58
+ else {
59
+ ctx.logger.error(error.message);
60
+ if (error.hint !== undefined)
61
+ ctx.logger.info(`hint: ${error.hint}`);
62
+ }
63
+ if (error.code === ErrorCode.Internal && thrown instanceof Error && thrown.stack) {
64
+ ctx.logger.debug(thrown.stack);
65
+ }
66
+ runtime.exitCode = error.exitCode;
67
+ }
68
+ };
69
+ }
70
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvE,OAAO,EAAuB,aAAa,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EAAiB,qBAAqB,EAAE,MAAM,aAAa,CAAC;AA+CnE,sDAAsD;AACtD,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,CAAC,GAAmB,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM;QAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACvF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,aAAa,CAAC,EAAM,EAAE,QAAkB;IAC/C,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAI,OAAgB,EAAE,OAAmB;IAC7D,OAAO,KAAK,EAAE,GAAG,GAAc,EAAiB,EAAE;QAChD,MAAM,OAAO,GAAG,GAAG,CAAC,EAA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QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;YACvD,MAAM,MAAM,CAAC,IAAI,CAAC;QACpB,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;YACpC,MAAM,QAAQ,GAAa;gBACzB,aAAa,EAAE,qBAAqB;gBACpC,OAAO,EAAE,IAAI;gBACb,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;aACtB,CAAC;YACF,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;YACjC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;gBACb,aAAa,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YACtC,CAAC;iBAAM,CAAC;gBACN,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAChC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;oBAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACvE,CAAC;YACD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,QAAQ,IAAI,MAAM,YAAY,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACjF,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjC,CAAC;YACD,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QACpC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Command } from 'commander';
2
+ import { type Runtime } from '../command.js';
3
+ export declare function registerBuildCommand(program: Command, runtime: Runtime): void;
4
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;AAMrD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAiD7E"}
@@ -0,0 +1,54 @@
1
+ import { formatDiagnostic } from '@staticforge/core';
2
+ import { action } from '../command.js';
3
+ import { displayPath } from '../paths.js';
4
+ import { loadProjectConfig } from '../project.js';
5
+ import { VERSION } from '../version.js';
6
+ import { addWorkersOption, withWorkers } from '../workers.js';
7
+ export function registerBuildCommand(program, runtime) {
8
+ addWorkersOption(program
9
+ .command('build')
10
+ .description('Build the site into the output directory')
11
+ .option('--drafts', 'include pages marked draft: true')
12
+ .option('--out <dir>', 'output directory (default: build.outDir)')
13
+ .option('--base-url <url>', 'site URL for canonical links (default: site.baseUrl)')).action(action(runtime, async (ctx, { options }) => {
14
+ const { buildSite } = await import('@staticforge/build');
15
+ const loaded = await loadProjectConfig(ctx);
16
+ const { rootDir } = loaded;
17
+ const config = withWorkers(loaded.config, options);
18
+ const result = await buildSite({
19
+ rootDir,
20
+ config,
21
+ drafts: options.drafts === true ? true : undefined,
22
+ outDir: options.out,
23
+ baseUrl: options.baseUrl,
24
+ generator: `staticforge ${VERSION}`,
25
+ logger: ctx.logger,
26
+ });
27
+ if (!ctx.json) {
28
+ for (const d of result.diagnostics) {
29
+ const line = formatDiagnostic(d);
30
+ if (d.severity === 'error')
31
+ ctx.logger.error(line);
32
+ else if (d.severity === 'warning')
33
+ ctx.logger.warn(line);
34
+ else
35
+ ctx.logger.info(line);
36
+ if (d.hint !== undefined)
37
+ ctx.logger.debug(` hint: ${d.hint}`);
38
+ }
39
+ }
40
+ const { error, warning } = result.summary;
41
+ const outDir = displayPath(ctx.cwd, result.outDir);
42
+ return {
43
+ ok: result.ok,
44
+ data: result,
45
+ text: `Built ${result.pages.length} page${result.pages.length === 1 ? '' : 's'} ` +
46
+ `(${result.fileCount} files) into ${outDir} in ${result.durationMs}ms: ` +
47
+ `${error} error${error === 1 ? '' : 's'}, ${warning} warning${warning === 1 ? '' : 's'}` +
48
+ (result.drafts.skipped.length > 0
49
+ ? `, ${result.drafts.skipped.length} draft(s) skipped`
50
+ : ''),
51
+ };
52
+ }));
53
+ }
54
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,UAAU,oBAAoB,CAAC,OAAgB,EAAE,OAAgB;IACrE,gBAAgB,CACd,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,0CAA0C,CAAC;SACvD,MAAM,CAAC,UAAU,EAAE,kCAAkC,CAAC;SACtD,MAAM,CAAC,aAAa,EAAE,0CAA0C,CAAC;SACjE,MAAM,CAAC,kBAAkB,EAAE,sDAAsD,CAAC,CACtF,CAAC,MAAM,CACN,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACzC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,C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,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,IAAI,EACF,SAAS,MAAM,CAAC,KAAK,CAAC,MAAM,QAAQ,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG;gBAC3E,IAAI,MAAM,CAAC,SAAS,gBAAgB,MAAM,OAAO,MAAM,CAAC,UAAU,MAAM;gBACxE,GAAG,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,OAAO,WAAW,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE;gBACxF,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;oBAC/B,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,mBAAmB;oBACtD,CAAC,CAAC,EAAE,CAAC;SACV,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type Command } from 'commander';
2
+ import { type Runtime } from '../command.js';
3
+ export declare function registerCheckCommand(program: Command, runtime: Runtime): void;
4
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAGjD,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;AAmBrD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAuG7E"}
@@ -0,0 +1,100 @@
1
+ import { existsSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join, relative, resolve, sep } from 'node:path';
3
+ import { Option } from 'commander';
4
+ import { ErrorCode, SforgeError, shouldUseColor } from '@staticforge/core';
5
+ import { action } from '../command.js';
6
+ import { displayPath } from '../paths.js';
7
+ import { loadProjectConfig } from '../project.js';
8
+ import { VERSION } from '../version.js';
9
+ import { addWorkersOption, withWorkers } from '../workers.js';
10
+ /** Directory of the enclosing git repository, if any. */
11
+ function gitRoot(dir) {
12
+ for (let d = resolve(dir);; d = dirname(d)) {
13
+ if (existsSync(join(d, '.git')))
14
+ return d;
15
+ if (dirname(d) === d)
16
+ return undefined;
17
+ }
18
+ }
19
+ const truthy = (value) => value !== undefined && value !== '' && value !== 'false' && value !== '0';
20
+ export function registerCheckCommand(program, runtime) {
21
+ addWorkersOption(program
22
+ .command('check')
23
+ .description('Build the site to a temporary directory and check it for accessibility and correctness')
24
+ .option('--fix', 'apply safe fixes to the source files, then check again')
25
+ .option('--dry-run', 'with --fix: print the fixes as a diff instead of applying them')
26
+ .option('--headless', 'run rendered checks in headless Chromium (default: check.headless)')
27
+ .option('--no-headless', 'skip rendered checks')
28
+ .option('--pages <globs...>', 'only check pages whose URL or source matches, e.g. "/blog/**"')
29
+ .addOption(new Option('--format <format>', 'report format')
30
+ .choices(['pretty', 'json', 'sarif', 'junit'])
31
+ .default('pretty'))
32
+ .option('--output <file>', 'write the report to a file instead of stdout')
33
+ .addOption(new Option('--fail-on <severity>', 'exit 1 on problems at or above (default: check.failOn)').choices(['error', 'warning']))
34
+ .option('--drafts', 'include pages marked draft: true')).action(action(runtime, async (ctx, { options }) => {
35
+ const format = options.format;
36
+ const output = options.output;
37
+ if (options.dryRun === true && options.fix !== true) {
38
+ throw new SforgeError(ErrorCode.Usage, '--dry-run requires --fix');
39
+ }
40
+ if (ctx.json && format !== 'pretty' && format !== 'json' && output === undefined) {
41
+ throw new SforgeError(ErrorCode.Usage, `--format ${format} and --json both write to stdout`, {
42
+ hint: `Write the ${format} report to a file with --output <file>.`,
43
+ });
44
+ }
45
+ const { checkSite, formatJunit, formatPretty, formatSarif } = await import('@staticforge/checker');
46
+ const loaded = await loadProjectConfig(ctx);
47
+ const { rootDir } = loaded;
48
+ const config = withWorkers(loaded.config, options);
49
+ const env = ctx.io.env;
50
+ const headless = options.headless;
51
+ const result = await checkSite({
52
+ rootDir,
53
+ config,
54
+ ...(headless !== undefined && { headless }),
55
+ // An explicit --headless, or CI, must not silently skip rendered checks.
56
+ requireBrowser: headless === true || truthy(env.CI),
57
+ ...(env.SFORGE_CHROMIUM_PATH && { executablePath: env.SFORGE_CHROMIUM_PATH }),
58
+ ...(options.pages !== undefined && { pages: options.pages }),
59
+ ...(options.fix === true && { fix: options.dryRun === true ? 'dry-run' : 'apply' }),
60
+ ...(options.failOn !== undefined && { failOn: options.failOn }),
61
+ ...(options.drafts === true && { drafts: true }),
62
+ generator: `staticforge ${VERSION}`,
63
+ logger: ctx.logger,
64
+ });
65
+ const render = (as, color) => {
66
+ switch (as) {
67
+ case 'json':
68
+ return JSON.stringify(result, null, 2);
69
+ case 'sarif': {
70
+ const repo = gitRoot(rootDir);
71
+ const prefix = repo === undefined ? '' : relative(repo, rootDir).split(sep).join('/');
72
+ return JSON.stringify(formatSarif(result, {
73
+ toolVersion: VERSION,
74
+ uriPrefix: prefix === '' ? '' : `${prefix}/`,
75
+ fallbackFile: relative(rootDir, loaded.path).split(sep).join('/'),
76
+ }), null, 2);
77
+ }
78
+ case 'junit':
79
+ return formatJunit(result);
80
+ default:
81
+ return formatPretty(result, { color });
82
+ }
83
+ };
84
+ const color = ctx.color && shouldUseColor(ctx.io.stdout, env);
85
+ let text;
86
+ if (output !== undefined) {
87
+ const path = resolve(ctx.cwd, output);
88
+ writeFileSync(path, `${render(format, false)}\n`);
89
+ text = `${formatPretty(result, { color })}\nWrote ${format} report to ${displayPath(ctx.cwd, path)}`;
90
+ }
91
+ else {
92
+ text = render(format, color);
93
+ }
94
+ if (result.fixes?.applied === false && format === 'pretty' && output === undefined) {
95
+ text = `${result.fixes.diff}\n${text}`;
96
+ }
97
+ return { ok: result.ok, data: result,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AC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9D,IAAI,IAAY,CAAC;QACjB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YACtC,aAAa,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAClD,IAAI,GAAG,GAAG,YAAY,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,WAAW,MAAM,cAAc,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC;QACvG,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACnF,IAAI,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QACzC,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Command } from 'commander';
2
+ import { type Runtime } from '../command.js';
3
+ export declare function registerConfigCommands(program: Command, runtime: Runtime): void;
4
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;AAGrD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CA6B/E"}
@@ -0,0 +1,27 @@
1
+ import { action } from '../command.js';
2
+ import { loadProjectConfig } from '../project.js';
3
+ export function registerConfigCommands(program, runtime) {
4
+ const config = program.command('config').description('Inspect and validate the project config');
5
+ config
6
+ .command('validate')
7
+ .description('Validate the config file and report problems')
8
+ .action(action(runtime, async (ctx) => {
9
+ const loaded = await loadProjectConfig(ctx);
10
+ const targets = Object.keys(loaded.config.targets);
11
+ return {
12
+ data: { valid: true, path: loaded.path, rootDir: loaded.rootDir, targets },
13
+ text: `Config is valid: ${loaded.path}`,
14
+ };
15
+ }));
16
+ config
17
+ .command('show')
18
+ .description('Print the resolved config, with defaults applied')
19
+ .action(action(runtime, async (ctx) => {
20
+ const loaded = await loadProjectConfig(ctx);
21
+ return {
22
+ data: { path: loaded.path, config: loaded.config },
23
+ text: JSON.stringify(loaded.config, null, 2),
24
+ };
25
+ }));
26
+ }
27
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,UAAU,sBAAsB,CAAC,OAAgB,EAAE,OAAgB;IACvE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,yCAAyC,CAAC,CAAC;IAEhG,MAAM;SACH,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CACL,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnD,OAAO;YACL,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE;YAC1E,IAAI,EAAE,oBAAoB,MAAM,CAAC,IAAI,EAAE;SACxC,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEJ,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CACL,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC5C,OAAO;YACL,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;YAClD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;SAC7C,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACN,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Command } from 'commander';
2
+ import { type Runtime } from '../command.js';
3
+ export declare function registerDeployCommands(program: Command, runtime: Runtime): void;
4
+ //# sourceMappingURL=deploy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;AAoErD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAiJ/E"}