outfitter 0.2.6 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -28
- package/dist/cli.js +3 -2
- package/dist/index.d.ts +95 -135
- package/dist/index.js +8 -15
- package/dist/shared/{chunk-k59f60cp.js → chunk-3pwh8ys4.js} +3092 -2625
- package/package.json +36 -22
- package/dist/actions.d.ts +0 -2
- package/dist/actions.js +0 -34
- package/dist/commands/add.d.ts +0 -54
- package/dist/commands/add.js +0 -16
- package/dist/commands/check.d.ts +0 -91
- package/dist/commands/check.js +0 -14
- package/dist/commands/demo.d.ts +0 -21
- package/dist/commands/demo.js +0 -8
- package/dist/commands/docs-module-loader.d.ts +0 -2
- package/dist/commands/docs-module-loader.js +0 -8
- package/dist/commands/doctor.d.ts +0 -2
- package/dist/commands/doctor.js +0 -13
- package/dist/commands/init.d.ts +0 -7
- package/dist/commands/init.js +0 -31
- package/dist/commands/migrate-kit.d.ts +0 -2
- package/dist/commands/migrate-kit.js +0 -15
- package/dist/commands/repo.d.ts +0 -3
- package/dist/commands/repo.js +0 -9
- package/dist/commands/scaffold.d.ts +0 -4
- package/dist/commands/scaffold.js +0 -31
- package/dist/commands/shared-deps.d.ts +0 -36
- package/dist/commands/shared-deps.js +0 -10
- package/dist/commands/upgrade-codemods.d.ts +0 -42
- package/dist/commands/upgrade-codemods.js +0 -15
- package/dist/commands/upgrade-planner.d.ts +0 -58
- package/dist/commands/upgrade-planner.js +0 -8
- package/dist/commands/upgrade-workspace.d.ts +0 -76
- package/dist/commands/upgrade-workspace.js +0 -16
- package/dist/commands/upgrade.d.ts +0 -214
- package/dist/commands/upgrade.js +0 -25
- package/dist/create/index.d.ts +0 -5
- package/dist/create/index.js +0 -29
- package/dist/create/planner.d.ts +0 -3
- package/dist/create/planner.js +0 -21
- package/dist/create/presets.d.ts +0 -3
- package/dist/create/presets.js +0 -12
- package/dist/create/types.d.ts +0 -2
- package/dist/create/types.js +0 -1
- package/dist/engine/blocks.d.ts +0 -3
- package/dist/engine/blocks.js +0 -12
- package/dist/engine/collector.d.ts +0 -2
- package/dist/engine/collector.js +0 -8
- package/dist/engine/config.d.ts +0 -3
- package/dist/engine/config.js +0 -12
- package/dist/engine/executor.d.ts +0 -3
- package/dist/engine/executor.js +0 -16
- package/dist/engine/index.d.ts +0 -8
- package/dist/engine/index.js +0 -59
- package/dist/engine/names.d.ts +0 -2
- package/dist/engine/names.js +0 -16
- package/dist/engine/post-scaffold.d.ts +0 -3
- package/dist/engine/post-scaffold.js +0 -8
- package/dist/engine/render-plan.d.ts +0 -7
- package/dist/engine/render-plan.js +0 -9
- package/dist/engine/template.d.ts +0 -3
- package/dist/engine/template.js +0 -17
- package/dist/engine/types.d.ts +0 -2
- package/dist/engine/types.js +0 -8
- package/dist/engine/workspace.d.ts +0 -3
- package/dist/engine/workspace.js +0 -13
- package/dist/manifest.d.ts +0 -71
- package/dist/manifest.js +0 -16
- package/dist/output-mode.d.ts +0 -2
- package/dist/output-mode.js +0 -10
- package/dist/shared/outfitter-193jvzg4.d.ts +0 -5
- package/dist/shared/outfitter-1dd0k853.js +0 -194
- package/dist/shared/outfitter-1dvma85c.js +0 -322
- package/dist/shared/outfitter-1h7k8xxt.js +0 -29
- package/dist/shared/outfitter-2ngep1h2.d.ts +0 -5
- package/dist/shared/outfitter-2np85etz.js +0 -95
- package/dist/shared/outfitter-33w361tc.d.ts +0 -18
- package/dist/shared/outfitter-344t1r38.js +0 -1
- package/dist/shared/outfitter-3weh61w7.d.ts +0 -25
- package/dist/shared/outfitter-4s9meh3j.js +0 -221
- package/dist/shared/outfitter-66b25bj8.js +0 -125
- package/dist/shared/outfitter-6bkqjk86.d.ts +0 -3
- package/dist/shared/outfitter-79vfxt6y.js +0 -269
- package/dist/shared/outfitter-7ha7p61k.d.ts +0 -6
- package/dist/shared/outfitter-7r12fj7f.js +0 -30
- package/dist/shared/outfitter-8y2dfx6n.js +0 -11
- package/dist/shared/outfitter-9x1brcmq.js +0 -184
- package/dist/shared/outfitter-9zqc2njf.js +0 -859
- package/dist/shared/outfitter-a79xrm12.d.ts +0 -17
- package/dist/shared/outfitter-amc4jbs1.d.ts +0 -50
- package/dist/shared/outfitter-ara3djt0.js +0 -73
- package/dist/shared/outfitter-avhm5z6w.js +0 -82
- package/dist/shared/outfitter-bkwpbkr9.d.ts +0 -63
- package/dist/shared/outfitter-bn9c8p2e.js +0 -204
- package/dist/shared/outfitter-bpr28y54.js +0 -70
- package/dist/shared/outfitter-cwq39bv4.d.ts +0 -48
- package/dist/shared/outfitter-d7pq7d0k.js +0 -196
- package/dist/shared/outfitter-dd0btgec.d.ts +0 -40
- package/dist/shared/outfitter-e2zz5wv7.d.ts +0 -51
- package/dist/shared/outfitter-ehp18x1n.js +0 -1
- package/dist/shared/outfitter-gdvm5c0b.d.ts +0 -4
- package/dist/shared/outfitter-h1mnzzd1.d.ts +0 -14
- package/dist/shared/outfitter-hvsaxgcp.js +0 -1
- package/dist/shared/outfitter-hws10ze7.js +0 -532
- package/dist/shared/outfitter-j833sxws.js +0 -61
- package/dist/shared/outfitter-j8yc7294.d.ts +0 -22
- package/dist/shared/outfitter-k112c427.js +0 -21
- package/dist/shared/outfitter-k56rmt24.d.ts +0 -30
- package/dist/shared/outfitter-ksa1pp4t.d.ts +0 -4
- package/dist/shared/outfitter-ksyvwmb5.js +0 -191
- package/dist/shared/outfitter-mdt37hqm.js +0 -4
- package/dist/shared/outfitter-mtbpabf3.js +0 -91
- package/dist/shared/outfitter-mxz69pgy.js +0 -713
- package/dist/shared/outfitter-npemy7ta.d.ts +0 -53
- package/dist/shared/outfitter-npyfbdmc.d.ts +0 -6
- package/dist/shared/outfitter-pyy1zkfh.d.ts +0 -133
- package/dist/shared/outfitter-q9agarmb.js +0 -42
- package/dist/shared/outfitter-qfh36ddg.d.ts +0 -66
- package/dist/shared/outfitter-qn864k6h.js +0 -581
- package/dist/shared/outfitter-rdc5v5ms.js +0 -746
- package/dist/shared/outfitter-sgtq57qr.d.ts +0 -5
- package/dist/shared/outfitter-ttjr95y9.js +0 -98
- package/dist/shared/outfitter-vh4xgb93.js +0 -35
- package/dist/shared/outfitter-yvksv5qb.js +0 -322
- package/dist/shared/outfitter-zwyvewr1.js +0 -36
- package/dist/targets/index.d.ts +0 -4
- package/dist/targets/index.js +0 -29
- package/dist/targets/registry.d.ts +0 -3
- package/dist/targets/registry.js +0 -28
- package/dist/targets/types.d.ts +0 -2
- package/dist/targets/types.js +0 -1
- package/templates/.gitkeep +0 -0
- package/templates/basic/.gitignore.template +0 -30
- package/templates/basic/.lefthook.yml.template +0 -26
- package/templates/basic/package.json.template +0 -46
- package/templates/basic/src/index.ts.template +0 -26
- package/templates/basic/tsconfig.json.template +0 -34
- package/templates/cli/.gitignore.template +0 -4
- package/templates/cli/.lefthook.yml.template +0 -26
- package/templates/cli/README.md.template +0 -35
- package/templates/cli/biome.json.template +0 -4
- package/templates/cli/package.json.template +0 -45
- package/templates/cli/src/cli.ts.template +0 -8
- package/templates/cli/src/index.ts.template +0 -7
- package/templates/cli/src/program.ts.template +0 -31
- package/templates/cli/tsconfig.json.template +0 -34
- package/templates/daemon/.gitignore.template +0 -4
- package/templates/daemon/.lefthook.yml.template +0 -26
- package/templates/daemon/README.md.template +0 -67
- package/templates/daemon/biome.json.template +0 -4
- package/templates/daemon/package.json.template +0 -48
- package/templates/daemon/src/cli.ts.template +0 -96
- package/templates/daemon/src/daemon-main.ts.template +0 -79
- package/templates/daemon/src/daemon.ts.template +0 -11
- package/templates/daemon/src/index.ts.template +0 -7
- package/templates/daemon/tsconfig.json.template +0 -23
- package/templates/mcp/.gitignore.template +0 -4
- package/templates/mcp/.lefthook.yml.template +0 -26
- package/templates/mcp/README.md.template +0 -54
- package/templates/mcp/biome.json.template +0 -4
- package/templates/mcp/package.json.template +0 -45
- package/templates/mcp/src/index.ts.template +0 -7
- package/templates/mcp/src/mcp.ts.template +0 -79
- package/templates/mcp/src/server.ts.template +0 -15
- package/templates/mcp/tsconfig.json.template +0 -23
- package/templates/minimal/.gitignore.template +0 -30
- package/templates/minimal/.lefthook.yml.template +0 -26
- package/templates/minimal/package.json.template +0 -46
- package/templates/minimal/src/index.ts.template +0 -26
- package/templates/minimal/tsconfig.json.template +0 -34
package/README.md
CHANGED
|
@@ -40,8 +40,7 @@ Top-level commands:
|
|
|
40
40
|
- `scaffold <target> [name]` - Add a new capability to an existing project
|
|
41
41
|
- `add <block>` - Add a tooling block (`claude`, `biome`, `lefthook`, `bootstrap`, `scaffolding`)
|
|
42
42
|
- `repo <action> <subject>` - Repository maintenance namespace (`check|sync|export`)
|
|
43
|
-
- `
|
|
44
|
-
- `update` - Check installed `@outfitter/*` versions and optionally show migration guidance
|
|
43
|
+
- `upgrade` - Check installed `@outfitter/*` versions and optionally show migration guidance
|
|
45
44
|
- `doctor` - Validate local environment and project dependencies
|
|
46
45
|
- `demo [section]` - Forward to the dedicated demo CLI (`outfitter-demo`)
|
|
47
46
|
|
|
@@ -63,7 +62,6 @@ Options:
|
|
|
63
62
|
- `-n, --name <name>` - Package name
|
|
64
63
|
- `-b, --bin <name>` - Binary name
|
|
65
64
|
- `-p, --preset <preset>` - Preset (`minimal`, `cli`, `mcp`, `daemon`)
|
|
66
|
-
- `-t, --template <template>` - Deprecated alias for `--preset`
|
|
67
65
|
- `-s, --structure <mode>` - Project structure (`single` | `workspace`)
|
|
68
66
|
- `--workspace-name <name>` - Workspace root package name
|
|
69
67
|
- `--local` - Use `workspace:*` for `@outfitter/*` dependencies
|
|
@@ -83,7 +81,7 @@ Examples:
|
|
|
83
81
|
outfitter init my-lib --preset minimal --yes
|
|
84
82
|
outfitter init cli my-project --yes
|
|
85
83
|
outfitter init my-workspace --preset mcp --structure workspace --workspace-name @acme/root
|
|
86
|
-
outfitter init . --
|
|
84
|
+
outfitter init . --preset minimal --name my-lib
|
|
87
85
|
```
|
|
88
86
|
|
|
89
87
|
### `scaffold`
|
|
@@ -165,25 +163,6 @@ outfitter repo check exports --json
|
|
|
165
163
|
outfitter repo check readme
|
|
166
164
|
```
|
|
167
165
|
|
|
168
|
-
### `migrate kit`
|
|
169
|
-
|
|
170
|
-
Codemod for kit-first foundation adoption.
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
outfitter migrate kit [directory] [options]
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Options:
|
|
177
|
-
|
|
178
|
-
- `--dry-run` - Preview changes without writing files
|
|
179
|
-
|
|
180
|
-
Examples:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
outfitter migrate kit --dry-run
|
|
184
|
-
outfitter migrate kit .
|
|
185
|
-
```
|
|
186
|
-
|
|
187
166
|
### `upgrade`
|
|
188
167
|
|
|
189
168
|
Check installed `@outfitter/*` packages against npm versions.
|
|
@@ -231,10 +210,58 @@ Options:
|
|
|
231
210
|
|
|
232
211
|
Use `outfitter-demo` (or `cli-demo`) directly for the dedicated demo app.
|
|
233
212
|
|
|
213
|
+
### `schema`
|
|
214
|
+
|
|
215
|
+
Machine-readable introspection of registered actions. Agents can discover CLI capabilities without scraping `--help`.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
outfitter schema # Human-readable summary
|
|
219
|
+
outfitter schema <action-id> # Detail view for a single action
|
|
220
|
+
outfitter schema --output json # Machine-readable JSON manifest
|
|
221
|
+
outfitter schema --output json --pretty # Pretty-printed JSON
|
|
222
|
+
outfitter schema --surface cli # Filter by surface
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Subcommands for surface map management:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
outfitter schema generate # Write .outfitter/surface.json
|
|
229
|
+
outfitter schema generate --dry-run # Print without writing
|
|
230
|
+
outfitter schema diff # Compare runtime vs committed
|
|
231
|
+
outfitter schema diff --output json # Structured diff as JSON
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### `check`
|
|
235
|
+
|
|
236
|
+
Compare local config blocks against the registry for drift detection.
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
outfitter check [options]
|
|
240
|
+
outfitter check tsdoc [options]
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Options:
|
|
244
|
+
|
|
245
|
+
- `-v, --verbose` - Show diffs for drifted files
|
|
246
|
+
- `-b, --block <name>` - Check a specific block only
|
|
247
|
+
- `-o, --output <mode>` - Output mode (`human`, `json`, `jsonl`)
|
|
248
|
+
- `--cwd <path>` - Working directory
|
|
249
|
+
|
|
250
|
+
`check tsdoc` checks TSDoc coverage on exported declarations:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
outfitter check tsdoc # Human-readable coverage report
|
|
254
|
+
outfitter check tsdoc --strict # Fail if coverage is below threshold
|
|
255
|
+
outfitter check tsdoc --output json # Machine-readable JSON output
|
|
256
|
+
outfitter check tsdoc --summary # Compact output
|
|
257
|
+
outfitter check tsdoc --level undocumented # Filter by coverage level
|
|
258
|
+
outfitter check tsdoc --package @outfitter/cli # Filter to specific package
|
|
259
|
+
```
|
|
260
|
+
|
|
234
261
|
## Command Conventions
|
|
235
262
|
|
|
236
263
|
Canonical boundary and command conventions are documented in
|
|
237
|
-
[
|
|
264
|
+
[Architecture: Boundary Conventions](../../docs/ARCHITECTURE.md#boundary-conventions).
|
|
238
265
|
|
|
239
266
|
Quick model status:
|
|
240
267
|
|
|
@@ -250,10 +277,8 @@ Root exports:
|
|
|
250
277
|
import {
|
|
251
278
|
runDoctor,
|
|
252
279
|
runInit,
|
|
253
|
-
runMigrateKit,
|
|
254
280
|
runScaffold,
|
|
255
281
|
type InitOptions,
|
|
256
|
-
type MigrateKitOptions,
|
|
257
282
|
type ScaffoldOptions,
|
|
258
283
|
} from "outfitter";
|
|
259
284
|
```
|
|
@@ -262,7 +287,7 @@ Command subpath exports:
|
|
|
262
287
|
|
|
263
288
|
```typescript
|
|
264
289
|
import { runAdd } from "outfitter/commands/add";
|
|
265
|
-
import {
|
|
290
|
+
import { runUpgrade } from "outfitter/commands/upgrade";
|
|
266
291
|
```
|
|
267
292
|
|
|
268
293
|
Example:
|
|
@@ -284,7 +309,7 @@ if (result.isErr()) {
|
|
|
284
309
|
|
|
285
310
|
## Requirements
|
|
286
311
|
|
|
287
|
-
- Bun >= 1.3.
|
|
312
|
+
- Bun >= 1.3.9
|
|
288
313
|
|
|
289
314
|
## Related Packages
|
|
290
315
|
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createRepoCommand,
|
|
4
4
|
outfitterActions
|
|
5
|
-
} from "./shared/chunk-
|
|
5
|
+
} from "./shared/chunk-3pwh8ys4.js";
|
|
6
6
|
|
|
7
7
|
// src/cli.ts
|
|
8
8
|
import { readFileSync } from "node:fs";
|
|
@@ -43,7 +43,8 @@ function createProgram() {
|
|
|
43
43
|
requestId,
|
|
44
44
|
logger: logger.child({ action: action.id, requestId })
|
|
45
45
|
});
|
|
46
|
-
}
|
|
46
|
+
},
|
|
47
|
+
schema: { programName: "outfitter", surface: {} }
|
|
47
48
|
})) {
|
|
48
49
|
cli.register(command);
|
|
49
50
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,19 +13,19 @@ interface DoctorOptions {
|
|
|
13
13
|
* Result of a single health check.
|
|
14
14
|
*/
|
|
15
15
|
interface CheckResult {
|
|
16
|
-
/** Whether the check passed */
|
|
17
|
-
readonly passed: boolean;
|
|
18
16
|
/** Error message if check failed */
|
|
19
17
|
readonly error?: string;
|
|
18
|
+
/** Whether the check passed */
|
|
19
|
+
readonly passed: boolean;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Bun version check result.
|
|
23
23
|
*/
|
|
24
24
|
interface BunVersionCheck extends CheckResult {
|
|
25
|
-
/** Current Bun version */
|
|
26
|
-
readonly version: string;
|
|
27
25
|
/** Required minimum version */
|
|
28
26
|
readonly required: string;
|
|
27
|
+
/** Current Bun version */
|
|
28
|
+
readonly version: string;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Package.json validation result.
|
|
@@ -51,8 +51,6 @@ interface DependenciesCheck extends CheckResult {
|
|
|
51
51
|
interface ConfigFilesCheck {
|
|
52
52
|
/** Whether tsconfig.json exists */
|
|
53
53
|
readonly tsconfig: boolean;
|
|
54
|
-
/** Whether biome.json exists */
|
|
55
|
-
readonly biome?: boolean;
|
|
56
54
|
}
|
|
57
55
|
/**
|
|
58
56
|
* Directories check result.
|
|
@@ -60,17 +58,15 @@ interface ConfigFilesCheck {
|
|
|
60
58
|
interface DirectoriesCheck {
|
|
61
59
|
/** Whether src directory exists */
|
|
62
60
|
readonly src: boolean;
|
|
63
|
-
/** Whether tests directory exists */
|
|
64
|
-
readonly tests?: boolean;
|
|
65
61
|
}
|
|
66
62
|
/**
|
|
67
63
|
* Summary of all checks.
|
|
68
64
|
*/
|
|
69
65
|
interface DoctorSummary {
|
|
70
|
-
/** Number of passed checks */
|
|
71
|
-
readonly passed: number;
|
|
72
66
|
/** Number of failed checks */
|
|
73
67
|
readonly failed: number;
|
|
68
|
+
/** Number of passed checks */
|
|
69
|
+
readonly passed: number;
|
|
74
70
|
/** Total number of checks */
|
|
75
71
|
readonly total: number;
|
|
76
72
|
}
|
|
@@ -86,10 +82,27 @@ interface DoctorResult {
|
|
|
86
82
|
readonly configFiles: ConfigFilesCheck;
|
|
87
83
|
readonly directories: DirectoriesCheck;
|
|
88
84
|
};
|
|
85
|
+
/** Exit code (0 = all passed, 1 = some failed) */
|
|
86
|
+
readonly exitCode: number;
|
|
87
|
+
/** Whether this is a workspace root (affects which checks apply) */
|
|
88
|
+
readonly isWorkspaceRoot?: boolean;
|
|
89
|
+
/** Checks intentionally skipped at workspace root */
|
|
90
|
+
readonly skippedChecks?: readonly string[];
|
|
89
91
|
/** Summary of all checks */
|
|
90
92
|
readonly summary: DoctorSummary;
|
|
91
|
-
/**
|
|
93
|
+
/** Per-member summary when running at a workspace root */
|
|
94
|
+
readonly workspaceMembers?: readonly WorkspaceMemberHealth[];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Health summary for a workspace member package.
|
|
98
|
+
*/
|
|
99
|
+
interface WorkspaceMemberHealth {
|
|
100
|
+
/** Member exit code (0 = pass, 1 = failed checks) */
|
|
92
101
|
readonly exitCode: number;
|
|
102
|
+
/** Workspace-relative member path (for example, apps/my-cli) */
|
|
103
|
+
readonly path: string;
|
|
104
|
+
/** Summary for the member doctor run */
|
|
105
|
+
readonly summary: DoctorSummary;
|
|
93
106
|
}
|
|
94
107
|
/**
|
|
95
108
|
* Runs the doctor command programmatically.
|
|
@@ -137,18 +150,18 @@ import { Result as Result3 } from "@outfitter/contracts";
|
|
|
137
150
|
import { AddBlockResult } from "@outfitter/tooling";
|
|
138
151
|
import { Command as Command2 } from "commander";
|
|
139
152
|
interface PostScaffoldResult {
|
|
140
|
-
readonly installResult: "success" | "failed" | "skipped";
|
|
141
|
-
readonly installError?: string | undefined;
|
|
142
|
-
readonly gitInitResult: "success" | "failed" | "skipped" | "already-repo";
|
|
143
153
|
readonly gitCommitResult: "success" | "failed" | "skipped";
|
|
144
154
|
readonly gitError?: string | undefined;
|
|
155
|
+
readonly gitInitResult: "success" | "failed" | "skipped" | "already-repo";
|
|
156
|
+
readonly installError?: string | undefined;
|
|
157
|
+
readonly installResult: "success" | "failed" | "skipped";
|
|
145
158
|
readonly nextSteps: readonly string[];
|
|
146
159
|
}
|
|
147
160
|
import { NotFoundError, Result as Result2, ValidationError } from "@outfitter/contracts";
|
|
148
161
|
/**
|
|
149
162
|
* Unique identifier for a scaffold target.
|
|
150
163
|
*/
|
|
151
|
-
type TargetId = "minimal" | "cli" | "mcp" | "daemon" | "
|
|
164
|
+
type TargetId = "minimal" | "cli" | "mcp" | "daemon" | "library" | "full-stack" | "api" | "worker" | "web";
|
|
152
165
|
/**
|
|
153
166
|
* Whether the target produces a runnable application or a library package.
|
|
154
167
|
*/
|
|
@@ -165,14 +178,14 @@ type TargetScope = "init-only" | "scaffold-only" | "both";
|
|
|
165
178
|
* Complete definition for a scaffold target.
|
|
166
179
|
*/
|
|
167
180
|
interface TargetDefinition {
|
|
168
|
-
readonly id: TargetId;
|
|
169
|
-
readonly description: string;
|
|
170
181
|
readonly category: TargetCategory;
|
|
171
|
-
readonly placement: "apps" | "packages";
|
|
172
|
-
readonly templateDir: string;
|
|
173
182
|
readonly defaultBlocks: readonly string[];
|
|
174
|
-
readonly
|
|
183
|
+
readonly description: string;
|
|
184
|
+
readonly id: TargetId;
|
|
185
|
+
readonly placement: "apps" | "packages";
|
|
186
|
+
readonly presetDir: string;
|
|
175
187
|
readonly scope: TargetScope;
|
|
188
|
+
readonly status: TargetStatus;
|
|
176
189
|
}
|
|
177
190
|
declare const TARGET_REGISTRY: ReadonlyMap<TargetId, TargetDefinition>;
|
|
178
191
|
declare const TARGET_IDS: readonly TargetId[];
|
|
@@ -190,45 +203,43 @@ declare function listTargets(filter?: {
|
|
|
190
203
|
readonly category?: TargetCategory;
|
|
191
204
|
}): readonly TargetDefinition[];
|
|
192
205
|
type InitStructure = "single" | "workspace";
|
|
193
|
-
type InitPresetId = Extract<TargetId, "minimal" | "cli" | "mcp" | "daemon">;
|
|
206
|
+
type InitPresetId = Extract<TargetId, "minimal" | "cli" | "mcp" | "daemon" | "library" | "full-stack">;
|
|
194
207
|
/**
|
|
195
208
|
* Options for the init command.
|
|
196
209
|
*/
|
|
197
210
|
interface InitOptions {
|
|
198
|
-
readonly targetDir: string;
|
|
199
|
-
readonly name: string | undefined;
|
|
200
211
|
readonly bin?: string | undefined;
|
|
212
|
+
readonly dryRun?: boolean | undefined;
|
|
213
|
+
readonly force: boolean;
|
|
214
|
+
readonly installTimeout?: number | undefined;
|
|
215
|
+
readonly local?: boolean | undefined;
|
|
216
|
+
readonly name: string | undefined;
|
|
217
|
+
readonly noTooling?: boolean | undefined;
|
|
201
218
|
readonly preset?: InitPresetId | undefined;
|
|
202
|
-
|
|
203
|
-
readonly
|
|
219
|
+
readonly skipCommit?: boolean | undefined;
|
|
220
|
+
readonly skipGit?: boolean | undefined;
|
|
221
|
+
readonly skipInstall?: boolean | undefined;
|
|
204
222
|
readonly structure?: InitStructure | undefined;
|
|
205
|
-
readonly
|
|
206
|
-
readonly local?: boolean | undefined;
|
|
207
|
-
readonly force: boolean;
|
|
223
|
+
readonly targetDir: string;
|
|
208
224
|
readonly with?: string | undefined;
|
|
209
|
-
readonly
|
|
225
|
+
readonly workspaceName?: string | undefined;
|
|
210
226
|
readonly yes?: boolean | undefined;
|
|
211
|
-
readonly dryRun?: boolean | undefined;
|
|
212
|
-
readonly skipInstall?: boolean | undefined;
|
|
213
|
-
readonly skipGit?: boolean | undefined;
|
|
214
|
-
readonly skipCommit?: boolean | undefined;
|
|
215
|
-
readonly installTimeout?: number | undefined;
|
|
216
227
|
}
|
|
217
228
|
/**
|
|
218
229
|
* Result of running init.
|
|
219
230
|
*/
|
|
220
231
|
interface InitResult {
|
|
221
|
-
readonly structure: InitStructure;
|
|
222
|
-
readonly rootDir: string;
|
|
223
|
-
readonly projectDir: string;
|
|
224
|
-
readonly preset: InitPresetId;
|
|
225
|
-
readonly packageName: string;
|
|
226
232
|
readonly blocksAdded?: AddBlockResult | undefined;
|
|
227
|
-
readonly postScaffold: PostScaffoldResult;
|
|
228
233
|
readonly dryRunPlan?: {
|
|
229
234
|
readonly operations: readonly unknown[];
|
|
230
235
|
readonly summary: Record<string, number>;
|
|
231
236
|
} | undefined;
|
|
237
|
+
readonly packageName: string;
|
|
238
|
+
readonly postScaffold: PostScaffoldResult;
|
|
239
|
+
readonly preset: InitPresetId;
|
|
240
|
+
readonly projectDir: string;
|
|
241
|
+
readonly rootDir: string;
|
|
242
|
+
readonly structure: InitStructure;
|
|
232
243
|
}
|
|
233
244
|
/**
|
|
234
245
|
* Error returned when initialization fails.
|
|
@@ -245,67 +256,15 @@ declare function printInitResults(result: InitResult, options?: {
|
|
|
245
256
|
* @deprecated Use action-registry CLI wiring via `buildCliCommands(outfitterActions, ...)`.
|
|
246
257
|
*/
|
|
247
258
|
declare function initCommand(program: Command2): void;
|
|
248
|
-
import {
|
|
249
|
-
import { Result as Result4 } from "@outfitter/contracts";
|
|
250
|
-
import { Command as Command3 } from "commander";
|
|
251
|
-
interface DiffPreview {
|
|
252
|
-
readonly path: string;
|
|
253
|
-
readonly preview: string;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Options for the migrate-kit command.
|
|
257
|
-
*/
|
|
258
|
-
interface MigrateKitOptions {
|
|
259
|
-
/** Target directory to migrate (defaults to cwd). */
|
|
260
|
-
readonly targetDir?: string | undefined;
|
|
261
|
-
/** Run codemod without writing changes to disk. */
|
|
262
|
-
readonly dryRun?: boolean | undefined;
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Result from migrate-kit execution.
|
|
266
|
-
*/
|
|
267
|
-
interface MigrateKitResult {
|
|
268
|
-
readonly targetDir: string;
|
|
269
|
-
readonly dryRun: boolean;
|
|
270
|
-
readonly packageJsonFiles: number;
|
|
271
|
-
readonly sourceFiles: number;
|
|
272
|
-
readonly manifestUpdates: number;
|
|
273
|
-
readonly importRewrites: number;
|
|
274
|
-
readonly changedFiles: readonly string[];
|
|
275
|
-
readonly diffs: readonly DiffPreview[];
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Error returned when migration fails.
|
|
279
|
-
*/
|
|
280
|
-
declare class MigrateKitError extends Error {
|
|
281
|
-
readonly _tag: "MigrateKitError";
|
|
282
|
-
constructor(message: string);
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Runs the migrate-kit codemod programmatically.
|
|
286
|
-
*/
|
|
287
|
-
declare function runMigrateKit(options: MigrateKitOptions): Promise<Result4<MigrateKitResult, MigrateKitError>>;
|
|
288
|
-
/**
|
|
289
|
-
* Print migrate-kit results.
|
|
290
|
-
*/
|
|
291
|
-
declare function printMigrateKitResults(result: MigrateKitResult, options?: {
|
|
292
|
-
mode?: OutputMode3;
|
|
293
|
-
}): Promise<void>;
|
|
294
|
-
/**
|
|
295
|
-
* Register `migrate kit` command directly on Commander.
|
|
296
|
-
*
|
|
297
|
-
* @deprecated Use action-registry CLI wiring via `buildCliCommands(outfitterActions, ...)`.
|
|
298
|
-
*/
|
|
299
|
-
declare function migrateKitCommand(program: Command3): void;
|
|
300
|
-
import { Command as Command5 } from "commander";
|
|
259
|
+
import { Command as Command4 } from "commander";
|
|
301
260
|
type DocsMdxMode = "strict" | "lossy";
|
|
302
261
|
interface DocsBaseOptions {
|
|
303
262
|
readonly cwd?: string;
|
|
304
|
-
readonly workspaceRoot?: string;
|
|
305
|
-
readonly packagesDir?: string;
|
|
306
|
-
readonly outputDir?: string;
|
|
307
263
|
readonly excludedFilenames?: readonly string[];
|
|
308
264
|
readonly mdxMode?: DocsMdxMode;
|
|
265
|
+
readonly outputDir?: string;
|
|
266
|
+
readonly packagesDir?: string;
|
|
267
|
+
readonly workspaceRoot?: string;
|
|
309
268
|
}
|
|
310
269
|
interface ExecuteCheckCommandOptions extends DocsBaseOptions {}
|
|
311
270
|
interface ExecuteSyncCommandOptions extends DocsBaseOptions {}
|
|
@@ -317,70 +276,70 @@ interface ExecuteExportCommandOptions extends DocsBaseOptions {
|
|
|
317
276
|
}
|
|
318
277
|
type RepoCheckSubject = "docs" | "exports" | "readme" | "registry" | "changeset" | "tree" | "boundary-invocations";
|
|
319
278
|
interface RepoCommandIo {
|
|
320
|
-
readonly out?: (line: string) => void;
|
|
321
279
|
readonly err?: (line: string) => void;
|
|
280
|
+
readonly out?: (line: string) => void;
|
|
322
281
|
}
|
|
323
282
|
interface RepoToolingInvocation {
|
|
324
|
-
readonly command: "check-exports" | "check-readme-imports" | "check-bunup-registry" | "check-changeset" | "check-clean-tree" | "check-boundary-invocations";
|
|
325
283
|
readonly args: readonly string[];
|
|
284
|
+
readonly command: "check-exports" | "check-readme-imports" | "check-bunup-registry" | "check-changeset" | "check-clean-tree" | "check-boundary-invocations";
|
|
326
285
|
readonly cwd: string;
|
|
327
286
|
}
|
|
328
287
|
interface CreateRepoCommandOptions {
|
|
329
288
|
readonly commandName?: string;
|
|
330
289
|
readonly io?: RepoCommandIo;
|
|
331
290
|
readonly runDocsCheck?: (options: ExecuteCheckCommandOptions, io: Required<RepoCommandIo>) => Promise<number>;
|
|
332
|
-
readonly runDocsSync?: (options: ExecuteSyncCommandOptions, io: Required<RepoCommandIo>) => Promise<number>;
|
|
333
291
|
readonly runDocsExport?: (options: ExecuteExportCommandOptions, io: Required<RepoCommandIo>) => Promise<number>;
|
|
292
|
+
readonly runDocsSync?: (options: ExecuteSyncCommandOptions, io: Required<RepoCommandIo>) => Promise<number>;
|
|
334
293
|
readonly runToolingCommand?: (input: RepoToolingInvocation) => Promise<number>;
|
|
335
294
|
}
|
|
336
|
-
declare function createRepoCommand(options?: CreateRepoCommandOptions):
|
|
337
|
-
import { OutputMode as
|
|
338
|
-
import { Result as
|
|
295
|
+
declare function createRepoCommand(options?: CreateRepoCommandOptions): Command4;
|
|
296
|
+
import { OutputMode as OutputMode3 } from "@outfitter/cli/types";
|
|
297
|
+
import { Result as Result4 } from "@outfitter/contracts";
|
|
339
298
|
import { AddBlockResult as AddBlockResult2 } from "@outfitter/tooling";
|
|
340
|
-
import { Command as
|
|
299
|
+
import { Command as Command5 } from "commander";
|
|
341
300
|
interface ScaffoldOptions {
|
|
342
|
-
readonly
|
|
343
|
-
readonly
|
|
301
|
+
readonly cwd: string;
|
|
302
|
+
readonly dryRun: boolean;
|
|
344
303
|
readonly force: boolean;
|
|
304
|
+
readonly installTimeout?: number | undefined;
|
|
305
|
+
readonly local?: boolean | undefined;
|
|
306
|
+
readonly name?: string | undefined;
|
|
307
|
+
readonly noTooling?: boolean | undefined;
|
|
345
308
|
readonly skipInstall: boolean;
|
|
346
|
-
readonly
|
|
309
|
+
readonly target: string;
|
|
347
310
|
readonly with?: string | undefined;
|
|
348
|
-
readonly noTooling?: boolean | undefined;
|
|
349
|
-
readonly local?: boolean | undefined;
|
|
350
|
-
readonly cwd: string;
|
|
351
|
-
readonly installTimeout?: number | undefined;
|
|
352
311
|
}
|
|
353
312
|
interface ScaffoldCommandResult {
|
|
354
|
-
readonly
|
|
355
|
-
readonly rootDir: string;
|
|
356
|
-
readonly targetDir: string;
|
|
313
|
+
readonly blocksAdded?: AddBlockResult2 | undefined;
|
|
357
314
|
readonly converted: boolean;
|
|
315
|
+
readonly dryRunPlan?: {
|
|
316
|
+
readonly operations: readonly unknown[];
|
|
317
|
+
readonly summary: Record<string, number>;
|
|
318
|
+
} | undefined;
|
|
358
319
|
readonly movedExisting?: {
|
|
359
320
|
readonly from: string;
|
|
360
321
|
readonly to: string;
|
|
361
322
|
readonly name: string;
|
|
362
323
|
} | undefined;
|
|
363
|
-
readonly workspacePatternsUpdated: boolean;
|
|
364
|
-
readonly blocksAdded?: AddBlockResult2 | undefined;
|
|
365
324
|
readonly postScaffold: PostScaffoldResult;
|
|
366
|
-
readonly
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
325
|
+
readonly rootDir: string;
|
|
326
|
+
readonly target: string;
|
|
327
|
+
readonly targetDir: string;
|
|
328
|
+
readonly workspacePatternsUpdated: boolean;
|
|
370
329
|
}
|
|
371
330
|
declare class ScaffoldCommandError extends Error {
|
|
372
331
|
readonly _tag: "ScaffoldCommandError";
|
|
373
332
|
constructor(message: string);
|
|
374
333
|
}
|
|
375
|
-
declare function runScaffold(options: ScaffoldOptions): Promise<
|
|
334
|
+
declare function runScaffold(options: ScaffoldOptions): Promise<Result4<ScaffoldCommandResult, ScaffoldCommandError>>;
|
|
376
335
|
declare function printScaffoldResults(result: ScaffoldCommandResult, options?: {
|
|
377
|
-
readonly mode?:
|
|
336
|
+
readonly mode?: OutputMode3;
|
|
378
337
|
}): Promise<void>;
|
|
379
338
|
/**
|
|
380
339
|
* @deprecated Use action-registry CLI wiring via `buildCliCommands(outfitterActions, ...)`.
|
|
381
340
|
*/
|
|
382
|
-
declare function scaffoldCommand(program:
|
|
383
|
-
import { Result as
|
|
341
|
+
declare function scaffoldCommand(program: Command5): void;
|
|
342
|
+
import { Result as Result5, ValidationError as ValidationError2 } from "@outfitter/contracts";
|
|
384
343
|
/**
|
|
385
344
|
* Create planner types for kit-first project scaffolding.
|
|
386
345
|
*
|
|
@@ -389,26 +348,27 @@ import { Result as Result6, ValidationError as ValidationError2 } from "@outfitt
|
|
|
389
348
|
*/
|
|
390
349
|
type CreatePresetId = "basic" | "cli" | "daemon" | "mcp";
|
|
391
350
|
interface CreatePresetDefinition {
|
|
351
|
+
readonly defaultBlocks: readonly string[];
|
|
392
352
|
readonly id: CreatePresetId;
|
|
393
|
-
readonly
|
|
353
|
+
readonly presetDir: CreatePresetId;
|
|
394
354
|
readonly summary: string;
|
|
395
|
-
readonly defaultBlocks: readonly string[];
|
|
396
355
|
}
|
|
397
356
|
interface CreateProjectInput {
|
|
398
|
-
readonly name: string;
|
|
399
|
-
readonly targetDir: string;
|
|
400
|
-
readonly preset: CreatePresetId;
|
|
401
|
-
readonly packageName?: string;
|
|
402
357
|
readonly description?: string;
|
|
403
|
-
readonly version?: string;
|
|
404
358
|
readonly includeTooling?: boolean;
|
|
405
359
|
readonly local?: boolean;
|
|
360
|
+
readonly name: string;
|
|
361
|
+
readonly packageName?: string;
|
|
362
|
+
readonly preset: CreatePresetId;
|
|
363
|
+
readonly targetDir: string;
|
|
364
|
+
readonly version?: string;
|
|
406
365
|
readonly year?: string;
|
|
407
366
|
}
|
|
408
367
|
type CreatePlanChange = {
|
|
409
|
-
readonly type: "copy-
|
|
410
|
-
readonly
|
|
368
|
+
readonly type: "copy-preset";
|
|
369
|
+
readonly preset: string;
|
|
411
370
|
readonly targetDir: string;
|
|
371
|
+
readonly includeTooling: boolean;
|
|
412
372
|
readonly overlayBaseTemplate: boolean;
|
|
413
373
|
} | {
|
|
414
374
|
readonly type: "inject-shared-config";
|
|
@@ -420,6 +380,7 @@ type CreatePlanChange = {
|
|
|
420
380
|
readonly blocks: readonly string[];
|
|
421
381
|
};
|
|
422
382
|
interface CreateProjectPlan {
|
|
383
|
+
readonly changes: readonly CreatePlanChange[];
|
|
423
384
|
readonly preset: CreatePresetDefinition;
|
|
424
385
|
readonly values: {
|
|
425
386
|
readonly packageName: string;
|
|
@@ -429,10 +390,9 @@ interface CreateProjectPlan {
|
|
|
429
390
|
readonly binName: string;
|
|
430
391
|
readonly year: string;
|
|
431
392
|
};
|
|
432
|
-
readonly changes: readonly CreatePlanChange[];
|
|
433
393
|
}
|
|
434
|
-
declare function planCreateProject(input: CreateProjectInput):
|
|
394
|
+
declare function planCreateProject(input: CreateProjectInput): Result5<CreateProjectPlan, ValidationError2>;
|
|
435
395
|
declare const CREATE_PRESETS: Readonly<Record<CreatePresetId, CreatePresetDefinition>>;
|
|
436
396
|
declare const CREATE_PRESET_IDS: CreatePresetId[];
|
|
437
397
|
declare function getCreatePreset(id: string): CreatePresetDefinition | undefined;
|
|
438
|
-
export { scaffoldCommand, runScaffold,
|
|
398
|
+
export { scaffoldCommand, runScaffold, runInit, runDoctor, resolvePlacement, printScaffoldResults, printInitResults, printDoctorResults, planCreateProject, outfitterActions, listTargets, initCommand, getTarget, getScaffoldTarget, getReadyTarget, getInitTarget, getCreatePreset, doctorCommand, createRepoCommand, TargetStatus, TargetScope, TargetId, TargetDefinition, TargetCategory, TARGET_REGISTRY, TARGET_IDS, ScaffoldOptions, ScaffoldCommandResult, ScaffoldCommandError, SCAFFOLD_TARGET_IDS, RepoToolingInvocation, RepoCommandIo, RepoCheckSubject, READY_TARGET_IDS, PackageJsonCheck, InitStructure, InitResult, InitPresetId, InitOptions, InitError, INIT_TARGET_IDS, DoctorSummary, DoctorResult, DoctorOptions, DirectoriesCheck, DependenciesCheck, CreateRepoCommandOptions, CreateProjectPlan, CreateProjectInput, CreatePresetId, CreatePresetDefinition, CreatePlanChange, ConfigFilesCheck, CheckResult, CREATE_PRESET_IDS, CREATE_PRESETS, BunVersionCheck };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
INIT_TARGET_IDS,
|
|
3
3
|
InitError,
|
|
4
|
-
MigrateKitError,
|
|
5
4
|
READY_TARGET_IDS,
|
|
6
5
|
SCAFFOLD_TARGET_IDS,
|
|
7
6
|
ScaffoldCommandError,
|
|
@@ -17,19 +16,16 @@ import {
|
|
|
17
16
|
getTarget,
|
|
18
17
|
initCommand,
|
|
19
18
|
listTargets,
|
|
20
|
-
migrateKitCommand,
|
|
21
19
|
outfitterActions,
|
|
22
20
|
printDoctorResults,
|
|
23
21
|
printInitResults,
|
|
24
|
-
printMigrateKitResults,
|
|
25
22
|
printScaffoldResults,
|
|
26
23
|
resolvePlacement,
|
|
27
24
|
runDoctor,
|
|
28
25
|
runInit,
|
|
29
|
-
runMigrateKit,
|
|
30
26
|
runScaffold,
|
|
31
27
|
scaffoldCommand
|
|
32
|
-
} from "./shared/chunk-
|
|
28
|
+
} from "./shared/chunk-3pwh8ys4.js";
|
|
33
29
|
// src/create/planner.ts
|
|
34
30
|
import { Result, ValidationError } from "@outfitter/contracts";
|
|
35
31
|
|
|
@@ -37,25 +33,25 @@ import { Result, ValidationError } from "@outfitter/contracts";
|
|
|
37
33
|
var CREATE_PRESETS = {
|
|
38
34
|
basic: {
|
|
39
35
|
id: "basic",
|
|
40
|
-
|
|
36
|
+
presetDir: "basic",
|
|
41
37
|
summary: "Minimal Bun + TypeScript project.",
|
|
42
38
|
defaultBlocks: ["scaffolding"]
|
|
43
39
|
},
|
|
44
40
|
cli: {
|
|
45
41
|
id: "cli",
|
|
46
|
-
|
|
42
|
+
presetDir: "cli",
|
|
47
43
|
summary: "CLI starter with Outfitter command ergonomics.",
|
|
48
44
|
defaultBlocks: ["scaffolding"]
|
|
49
45
|
},
|
|
50
46
|
daemon: {
|
|
51
47
|
id: "daemon",
|
|
52
|
-
|
|
48
|
+
presetDir: "daemon",
|
|
53
49
|
summary: "Daemon + control CLI starter.",
|
|
54
50
|
defaultBlocks: ["scaffolding"]
|
|
55
51
|
},
|
|
56
52
|
mcp: {
|
|
57
53
|
id: "mcp",
|
|
58
|
-
|
|
54
|
+
presetDir: "mcp",
|
|
59
55
|
summary: "MCP server starter.",
|
|
60
56
|
defaultBlocks: ["scaffolding"]
|
|
61
57
|
}
|
|
@@ -109,9 +105,10 @@ function planCreateProject(input) {
|
|
|
109
105
|
const defaultBlocks = includeTooling ? [...preset.defaultBlocks] : [];
|
|
110
106
|
const changes = [
|
|
111
107
|
{
|
|
112
|
-
type: "copy-
|
|
113
|
-
|
|
108
|
+
type: "copy-preset",
|
|
109
|
+
preset: preset.presetDir,
|
|
114
110
|
targetDir,
|
|
111
|
+
includeTooling,
|
|
115
112
|
overlayBaseTemplate: true
|
|
116
113
|
},
|
|
117
114
|
{ type: "inject-shared-config" }
|
|
@@ -139,17 +136,14 @@ function planCreateProject(input) {
|
|
|
139
136
|
export {
|
|
140
137
|
scaffoldCommand,
|
|
141
138
|
runScaffold,
|
|
142
|
-
runMigrateKit,
|
|
143
139
|
runInit,
|
|
144
140
|
runDoctor,
|
|
145
141
|
resolvePlacement,
|
|
146
142
|
printScaffoldResults,
|
|
147
|
-
printMigrateKitResults,
|
|
148
143
|
printInitResults,
|
|
149
144
|
printDoctorResults,
|
|
150
145
|
planCreateProject,
|
|
151
146
|
outfitterActions,
|
|
152
|
-
migrateKitCommand,
|
|
153
147
|
listTargets,
|
|
154
148
|
initCommand,
|
|
155
149
|
getTarget,
|
|
@@ -164,7 +158,6 @@ export {
|
|
|
164
158
|
ScaffoldCommandError,
|
|
165
159
|
SCAFFOLD_TARGET_IDS,
|
|
166
160
|
READY_TARGET_IDS,
|
|
167
|
-
MigrateKitError,
|
|
168
161
|
InitError,
|
|
169
162
|
INIT_TARGET_IDS,
|
|
170
163
|
CREATE_PRESET_IDS,
|