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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,+EAA+E;AAC/E,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,IAAY;IACnD,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAChC,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,GAAG,CAAC;IAC3B,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type LoadedConfig } from '@staticforge/core';
2
+ import type { CommandContext } from './context.js';
3
+ /**
4
+ * Load the project config for a command. `import ... from 'staticforge'` in a
5
+ * JS/TS config resolves to the running CLI, so projects need not install it.
6
+ */
7
+ export declare function loadProjectConfig(ctx: CommandContext): Promise<LoadedConfig>;
8
+ /** Load the config of the project in `dir` (e.g. another checkout of the same repository). */
9
+ export declare function loadProjectConfigAt(dir: string): Promise<LoadedConfig>;
10
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAc,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAOnD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAM5E;AAED,8FAA8F;AAC9F,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEtE"}
@@ -0,0 +1,20 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { loadConfig } from '@staticforge/core';
3
+ /** This package's public entry point, as source under tests and compiled in dist/. */
4
+ const selfEntry = fileURLToPath(new URL(import.meta.url.endsWith('.ts') ? './main.ts' : './main.js', import.meta.url));
5
+ /**
6
+ * Load the project config for a command. `import ... from 'staticforge'` in a
7
+ * JS/TS config resolves to the running CLI, so projects need not install it.
8
+ */
9
+ export function loadProjectConfig(ctx) {
10
+ return loadConfig({
11
+ cwd: ctx.cwd,
12
+ configPath: ctx.configPath,
13
+ aliases: { staticforge: selfEntry },
14
+ });
15
+ }
16
+ /** Load the config of the project in `dir` (e.g. another checkout of the same repository). */
17
+ export function loadProjectConfigAt(dir) {
18
+ return loadConfig({ cwd: dir, aliases: { staticforge: selfEntry } });
19
+ }
20
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAqB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGlE,sFAAsF;AACtF,MAAM,SAAS,GAAG,aAAa,CAC7B,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CACtF,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAmB;IACnD,OAAO,UAAU,CAAC;QAChB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,OAAO,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE;KACpC,CAAC,CAAC;AACL,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,OAAO,UAAU,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * JSON Schemas of each command's `data` under `--json`. They are part of the
3
+ * output envelope schema (`sforge schema output`) and the MCP tools' output
4
+ * schemas; tests validate real command output against them.
5
+ */
6
+ type Schema = Record<string, unknown>;
7
+ /** Definitions shared by several commands, referenced as `#/$defs/<name>`. */
8
+ export declare function sharedDefs(): Record<string, Schema>;
9
+ /** Command path (e.g. "config show") → schema of its `data`. `mcp` writes no envelope. */
10
+ export declare function commandDataSchemas(): Record<string, Schema>;
11
+ /** `$defs` key of a command's data schema: "config show" → "config-show-data". */
12
+ export declare function dataDefName(command: string): string;
13
+ /** A command's data schema as a standalone document (MCP tool output schemas). */
14
+ export declare function standaloneDataSchema(command: string): Schema;
15
+ export {};
16
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAwCtC,8EAA8E;AAC9E,wBAAgB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmDnD;AAuDD,0FAA0F;AAC1F,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmI3D;AAED,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI5D"}
@@ -0,0 +1,241 @@
1
+ import { checkReportJsonSchema } from '@staticforge/checker/report-schema';
2
+ import { diagnosticJsonSchema } from '@staticforge/core';
3
+ const string = (description) => ({
4
+ type: 'string',
5
+ ...(description !== undefined && { description }),
6
+ });
7
+ const count = (description) => ({
8
+ type: 'integer',
9
+ minimum: 0,
10
+ ...(description !== undefined && { description }),
11
+ });
12
+ const boolean = (description) => ({
13
+ type: 'boolean',
14
+ ...(description !== undefined && { description }),
15
+ });
16
+ const strings = (description) => ({
17
+ type: 'array',
18
+ items: { type: 'string' },
19
+ ...(description !== undefined && { description }),
20
+ });
21
+ const ref = (name) => ({ $ref: `#/$defs/${name}` });
22
+ const nullable = (schema) => ({ anyOf: [schema, { type: 'null' }] });
23
+ /** A closed object: `required` properties first, then optional ones. */
24
+ function object(required, optional = {}) {
25
+ return {
26
+ type: 'object',
27
+ required: Object.keys(required),
28
+ additionalProperties: false,
29
+ properties: { ...required, ...optional },
30
+ };
31
+ }
32
+ const described = (schema, description) => ({ ...schema, description });
33
+ const outputs = described({ type: 'object' }, 'Non-sensitive infrastructure outputs (OpenTofu/Terraform `output` values).');
34
+ /** Definitions shared by several commands, referenced as `#/$defs/<name>`. */
35
+ export function sharedDefs() {
36
+ return {
37
+ diagnostic: diagnosticJsonSchema(),
38
+ summary: object({ error: count(), warning: count(), info: count() }),
39
+ error: object({
40
+ code: { type: 'string', pattern: '^SF_[A-Z_]+$' },
41
+ message: string(),
42
+ }, { details: {}, hint: string() }),
43
+ builtPage: object({
44
+ url: string('URL of the page, e.g. "/about/".'),
45
+ output: string('Path of the HTML file relative to the output directory.'),
46
+ layout: string('Layout used, or "document" for HTML documents that pass through.'),
47
+ }, { source: string('Project-relative source file; absent for generated pages.') }),
48
+ resourceChange: object({
49
+ address: string('Resource address, e.g. "module.site.aws_s3_bucket.site".'),
50
+ action: { enum: ['create', 'update', 'delete', 'replace', 'read', 'noop', 'move'] },
51
+ }),
52
+ plan: object({
53
+ changes: boolean('True when applying the plan would change something.'),
54
+ add: count(),
55
+ change: count(),
56
+ remove: count(),
57
+ import: count(),
58
+ resources: { type: 'array', items: ref('resourceChange') },
59
+ drift: described({ type: 'array', items: ref('resourceChange') }, 'Changes made outside OpenTofu/Terraform, found while refreshing.'),
60
+ }, { planFile: string('Saved plan file.') }),
61
+ engine: object({ name: { enum: ['tofu', 'terraform'] }, version: string() }),
62
+ deployedVersion: object({
63
+ id: string('Version id (`<UTC timestamp>-<git sha>`) or preview id.'),
64
+ createdAt: string('ISO 8601 time of the deploy.'),
65
+ files: count(),
66
+ bytes: count(),
67
+ active: boolean('True for the version production serves.'),
68
+ preview: boolean(),
69
+ }, { gitSha: string(), url: string() }),
70
+ };
71
+ }
72
+ function buildData() {
73
+ return object({
74
+ ok: boolean('False when the build reported errors.'),
75
+ outDir: string('Absolute output directory.'),
76
+ pages: { type: 'array', items: ref('builtPage') },
77
+ fileCount: count('Files written, including pages.'),
78
+ drafts: object({ skipped: strings('Draft sources left out of the build.') }),
79
+ diagnostics: { type: 'array', items: ref('diagnostic') },
80
+ summary: ref('summary'),
81
+ durationMs: count(),
82
+ });
83
+ }
84
+ /** The check report schema, minus its document-level keys (its `$defs` are shared). */
85
+ function checkData() {
86
+ const schema = checkReportJsonSchema();
87
+ for (const key of ['$schema', '$id', '$defs', 'title'])
88
+ delete schema[key];
89
+ return schema;
90
+ }
91
+ const server = {
92
+ url: string('Where the server listens, e.g. "http://127.0.0.1:4321/".'),
93
+ host: string(),
94
+ port: count(),
95
+ };
96
+ const targetName = string('Target name from the config.');
97
+ function deployData() {
98
+ return object({
99
+ target: targetName,
100
+ provider: { enum: ['aws', 'azure'] },
101
+ versionId: string('The new version id, or the preview id.'),
102
+ url: string('Where the version or preview is served.'),
103
+ preview: boolean(),
104
+ uploaded: count('Files sent from this machine.'),
105
+ copied: count('Unchanged files copied server-side from the previous version.'),
106
+ skipped: count('Unchanged files already in place (preview redeploys).'),
107
+ deleted: count('Files removed (preview redeploys).'),
108
+ bytes: count('Bytes uploaded.'),
109
+ pruned: strings('Older versions removed beyond retainVersions.'),
110
+ invalidated: boolean('Whether the CDN cache was invalidated.'),
111
+ dryRun: boolean('True when nothing was changed.'),
112
+ buildDir: string('The deployed build directory.'),
113
+ }, {
114
+ previousVersionId: string('The version production served before.'),
115
+ check: object({ summary: ref('summary'), rendered: { enum: ['ran', 'skipped', 'off'] } }),
116
+ });
117
+ }
118
+ /** Command path (e.g. "config show") → schema of its `data`. `mcp` writes no envelope. */
119
+ export function commandDataSchemas() {
120
+ return {
121
+ init: object({
122
+ rootDir: string(),
123
+ configPath: string(),
124
+ created: strings('Project-relative paths written.'),
125
+ skipped: strings('Project-relative paths left alone because they existed.'),
126
+ }),
127
+ new: object({
128
+ file: string('Project-relative path of the new source file.'),
129
+ url: string('URL the page will have.'),
130
+ }),
131
+ build: buildData(),
132
+ check: checkData(),
133
+ dev: object({
134
+ ...server,
135
+ rootDir: string(),
136
+ build: object({
137
+ ok: boolean(),
138
+ diagnostics: described({ type: 'array', items: ref('diagnostic') }, 'Build diagnostics plus the static checker findings.'),
139
+ }, {
140
+ summary: ref('summary'),
141
+ pages: { type: 'array', items: ref('builtPage') },
142
+ error: described(ref('error'), 'Set when the build could not run.'),
143
+ }),
144
+ }),
145
+ preview: object({ ...server, dir: string('The directory served.') }),
146
+ provision: object({
147
+ target: targetName,
148
+ provider: string(),
149
+ engine: ref('engine'),
150
+ workspace: string('The generated OpenTofu/Terraform workspace.'),
151
+ plan: ref('plan'),
152
+ applied: boolean('False for --diff, when nothing changed, or when declined.'),
153
+ notices: strings('Instructions for the user, e.g. DNS records to create.'),
154
+ }, {
155
+ bootstrap: object({ backend: string(), description: string(), created: boolean() }),
156
+ apply: object({ add: count(), change: count(), remove: count() }),
157
+ outputs,
158
+ pending: boolean('True when provisioning stopped after the pre-phase (--no-wait).'),
159
+ }),
160
+ status: object({
161
+ target: targetName,
162
+ provider: string(),
163
+ engine: ref('engine'),
164
+ drift: { type: 'array', items: ref('resourceChange') },
165
+ drifted: boolean(),
166
+ outputs,
167
+ versionId: described(nullable(string()), 'The version production serves.'),
168
+ }, { url: string() }),
169
+ destroy: object({
170
+ target: targetName,
171
+ provider: string(),
172
+ plan: ref('plan'),
173
+ destroyed: boolean(),
174
+ }),
175
+ iac: {
176
+ oneOf: [
177
+ object({
178
+ target: targetName,
179
+ workspace: string(),
180
+ engine: object({
181
+ name: { enum: ['tofu', 'terraform'] },
182
+ path: string(),
183
+ version: string(),
184
+ source: { enum: ['env', 'path', 'cache', 'download'] },
185
+ }),
186
+ }),
187
+ object({
188
+ target: targetName,
189
+ command: string(),
190
+ exitCode: { type: 'integer' },
191
+ workspace: string(),
192
+ diagnostics: {
193
+ type: 'array',
194
+ items: object({ severity: { enum: ['error', 'warning'] }, summary: string() }, { detail: string(), address: string(), file: string(), line: count() }),
195
+ },
196
+ }),
197
+ ],
198
+ },
199
+ deploy: deployData(),
200
+ versions: object({
201
+ target: targetName,
202
+ versions: described({ type: 'array', items: ref('deployedVersion') }, 'Production versions (newest first), then previews.'),
203
+ }),
204
+ rollback: object({
205
+ target: targetName,
206
+ versionId: string('The version now served.'),
207
+ previousVersionId: nullable(string()),
208
+ url: string(),
209
+ }),
210
+ 'preview-destroy': object({
211
+ target: targetName,
212
+ previewId: string(),
213
+ deleted: count('Files removed.'),
214
+ existed: boolean(),
215
+ }),
216
+ 'config validate': object({
217
+ valid: { const: true },
218
+ path: string('The config file.'),
219
+ rootDir: string(),
220
+ targets: strings('Target names.'),
221
+ }),
222
+ 'config show': object({
223
+ path: string('The config file.'),
224
+ config: described({ type: 'object' }, 'The resolved config with defaults applied (see `sforge schema config`).'),
225
+ }),
226
+ schema: described({ type: 'object' }, 'The requested JSON Schema.'),
227
+ version: object({ version: string(), node: string(), platform: string(), arch: string() }),
228
+ };
229
+ }
230
+ /** `$defs` key of a command's data schema: "config show" → "config-show-data". */
231
+ export function dataDefName(command) {
232
+ return `${command.replace(/ /g, '-')}-data`;
233
+ }
234
+ /** A command's data schema as a standalone document (MCP tool output schemas). */
235
+ export function standaloneDataSchema(command) {
236
+ const data = commandDataSchemas()[command];
237
+ if (data === undefined)
238
+ throw new Error(`No data schema for "${command}"`);
239
+ return { ...data, $defs: sharedDefs() };
240
+ }
241
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAUzD,MAAM,MAAM,GAAG,CAAC,WAAoB,EAAU,EAAE,CAAC,CAAC;IAChD,IAAI,EAAE,QAAQ;IACd,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,CAAC;CAClD,CAAC,CAAC;AACH,MAAM,KAAK,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1C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type Command } from 'commander';
2
+ import type { Logger } from '@staticforge/core';
3
+ export interface ServerFlags {
4
+ port: number;
5
+ host: string | true | undefined;
6
+ open?: boolean;
7
+ }
8
+ /** Options shared by `dev` and `preview`. */
9
+ export declare function addServerOptions(command: Command, defaultPort: number): Command;
10
+ /** Listen on loopback unless asked otherwise, and warn when exposing to the network. */
11
+ export declare function hostFrom(flags: ServerFlags, logger: Logger): string;
12
+ //# sourceMappingURL=server-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-options.d.ts","sourceRoot":"","sources":["../src/server-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAwB,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAUD,6CAA6C;AAC7C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAK/E;AAED,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOnE"}
@@ -0,0 +1,26 @@
1
+ import { InvalidArgumentError } from 'commander';
2
+ function parsePort(value) {
3
+ const port = Number(value);
4
+ if (!Number.isInteger(port) || port < 0 || port > 65535) {
5
+ throw new InvalidArgumentError('must be an integer from 0 to 65535 (0 picks a free port)');
6
+ }
7
+ return port;
8
+ }
9
+ /** Options shared by `dev` and `preview`. */
10
+ export function addServerOptions(command, defaultPort) {
11
+ return command
12
+ .option('-p, --port <port>', 'port to listen on (0 picks a free port)', parsePort, defaultPort)
13
+ .option('--host [address]', 'address to listen on; without a value, all interfaces (0.0.0.0)')
14
+ .option('--open', 'open the site in a browser');
15
+ }
16
+ /** Listen on loopback unless asked otherwise, and warn when exposing to the network. */
17
+ export function hostFrom(flags, logger) {
18
+ if (flags.host === undefined)
19
+ return '127.0.0.1';
20
+ const host = flags.host === true ? '0.0.0.0' : flags.host;
21
+ if (!['127.0.0.1', 'localhost', '::1'].includes(host)) {
22
+ logger.warn(`Listening on ${host}: the site is reachable from other machines on the network`);
23
+ }
24
+ return host;
25
+ }
26
+ //# sourceMappingURL=server-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-options.js","sourceRoot":"","sources":["../src/server-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAS/D,SAAS,SAAS,CAAC,KAAa;IAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,KAAK,EAAE,CAAC;QACxD,MAAM,IAAI,oBAAoB,CAAC,0DAA0D,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,gBAAgB,CAAC,OAAgB,EAAE,WAAmB;IACpE,OAAO,OAAO;SACX,MAAM,CAAC,mBAAmB,EAAE,yCAAyC,EAAE,SAAS,EAAE,WAAW,CAAC;SAC9F,MAAM,CAAC,kBAAkB,EAAE,iEAAiE,CAAC;SAC7F,MAAM,CAAC,QAAQ,EAAE,4BAA4B,CAAC,CAAC;AACpD,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,QAAQ,CAAC,KAAkB,EAAE,MAAc;IACzD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IACjD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;IAC1D,IAAI,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACtD,MAAM,CAAC,IAAI,CAAC,gBAAgB,IAAI,4DAA4D,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The CLI package version, read from package.json (works from both src/ and dist/). */
2
+ export declare const VERSION: string;
3
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,eAAO,MAAM,OAAO,EAAE,MAIb,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { readFileSync } from 'node:fs';
2
+ /** The CLI package version, read from package.json (works from both src/ and dist/). */
3
+ export const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
4
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAClB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAG7E,CAAC,OAAO,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type Command } from 'commander';
2
+ import type { SforgeConfig } from '@staticforge/core';
3
+ /** `--workers`, shared by the commands that build or check. */
4
+ export declare function addWorkersOption(command: Command): Command;
5
+ /** The config with `--workers` applied. */
6
+ export declare function withWorkers(config: SforgeConfig, options: Record<string, unknown>): SforgeConfig;
7
+ //# sourceMappingURL=workers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workers.d.ts","sourceRoot":"","sources":["../src/workers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAwB,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAatD,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAM1D;AAED,2CAA2C;AAC3C,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,CAGhG"}
@@ -0,0 +1,20 @@
1
+ import { InvalidArgumentError } from 'commander';
2
+ function parseWorkers(value) {
3
+ if (value === 'auto')
4
+ return value;
5
+ const n = Number(value);
6
+ if (!Number.isInteger(n) || n < 0 || n > 64) {
7
+ throw new InvalidArgumentError('must be "auto" or an integer from 0 to 64 (0: main thread only)');
8
+ }
9
+ return n;
10
+ }
11
+ /** `--workers`, shared by the commands that build or check. */
12
+ export function addWorkersOption(command) {
13
+ return command.option('--workers <n>', 'worker threads for parsing, rendering and checking (default: build.workers; 0: none)', parseWorkers);
14
+ }
15
+ /** The config with `--workers` applied. */
16
+ export function withWorkers(config, options) {
17
+ const workers = options.workers;
18
+ return workers === undefined ? config : { ...config, build: { ...config.build, workers } };
19
+ }
20
+ //# sourceMappingURL=workers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workers.js","sourceRoot":"","sources":["../src/workers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAG/D,SAAS,YAAY,CAAC,KAAa;IACjC,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACnC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QAC5C,MAAM,IAAI,oBAAoB,CAC5B,iEAAiE,CAClE,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,OAAO,OAAO,CAAC,MAAM,CACnB,eAAe,EACf,sFAAsF,EACtF,YAAY,CACb,CAAC;AACJ,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,WAAW,CAAC,MAAoB,EAAE,OAAgC;IAChF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAsC,CAAC;IAC/D,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;AAC7F,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "staticforge",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "CLI-first static site generator with accessibility checking and multi-cloud deploys",
5
+ "keywords": [
6
+ "staticforge",
7
+ "static-site-generator",
8
+ "ssg",
9
+ "accessibility",
10
+ "wcag",
11
+ "cli",
12
+ "mcp",
13
+ "aws",
14
+ "cloudfront",
15
+ "azure",
16
+ "static-web-apps"
17
+ ],
18
+ "homepage": "https://github.com/elchanio-76/sforge#readme",
19
+ "bugs": {
20
+ "url": "https://github.com/elchanio-76/sforge/issues"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/elchanio-76/sforge.git",
25
+ "directory": "packages/cli"
26
+ },
27
+ "license": "MIT",
28
+ "author": "Eleftherios Chaniotakis",
29
+ "type": "module",
30
+ "bin": {
31
+ "sforge": "./dist/bin.js"
32
+ },
33
+ "exports": {
34
+ ".": {
35
+ "@staticforge/source": "./src/main.ts",
36
+ "types": "./dist/main.d.ts",
37
+ "default": "./dist/main.js"
38
+ }
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "schema"
43
+ ],
44
+ "engines": {
45
+ "node": "^22.22.0 || >=24.8.0"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "dependencies": {
51
+ "@modelcontextprotocol/server": "^2.4.0",
52
+ "@staticforge/aws": "0.1.0",
53
+ "@staticforge/azure": "0.1.0",
54
+ "@staticforge/build": "0.1.0",
55
+ "@staticforge/checker": "0.1.0",
56
+ "@staticforge/core": "0.1.0",
57
+ "@staticforge/dev-server": "0.1.0",
58
+ "@staticforge/iac": "0.1.0",
59
+ "@staticforge/provider-api": "0.1.0",
60
+ "commander": "^15.0.0",
61
+ "zod": "^4.6.7"
62
+ },
63
+ "devDependencies": {
64
+ "@modelcontextprotocol/client": "^2.4.0",
65
+ "ajv": "^8.20.0"
66
+ }
6
67
  }