outfitter 0.3.2 → 0.3.4
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 +33 -5
- package/dist/actions/add.d.ts +18 -0
- package/dist/actions/add.js +14 -0
- package/dist/actions/check-automation.d.ts +20 -0
- package/dist/actions/check-automation.js +27 -0
- package/dist/actions/check.d.ts +34 -0
- package/dist/actions/check.js +19 -0
- package/dist/actions/demo.d.ts +12 -0
- package/dist/actions/demo.js +11 -0
- package/dist/actions/docs-output-mode.d.ts +4 -0
- package/dist/actions/docs-output-mode.js +8 -0
- package/dist/actions/docs.d.ts +25 -0
- package/dist/actions/docs.js +31 -0
- package/dist/actions/doctor.d.ts +10 -0
- package/dist/actions/doctor.js +15 -0
- package/dist/actions/init.d.ts +28 -0
- package/dist/actions/init.js +31 -0
- package/dist/actions/scaffold.d.ts +19 -0
- package/dist/actions/scaffold.js +21 -0
- package/dist/actions/shared.d.ts +61 -0
- package/dist/actions/shared.js +30 -0
- package/dist/actions/upgrade.d.ts +17 -0
- package/dist/actions/upgrade.js +21 -0
- package/dist/actions.d.ts +2 -0
- package/dist/actions.js +66 -0
- package/dist/cli.js +66 -4
- package/dist/commands/add.d.ts +54 -0
- package/dist/commands/add.js +16 -0
- package/dist/commands/check-action-ceremony.d.ts +55 -0
- package/dist/commands/check-action-ceremony.js +15 -0
- package/dist/commands/check-docs-sentinel.d.ts +27 -0
- package/dist/commands/check-docs-sentinel.js +18 -0
- package/dist/commands/check-orchestrator.d.ts +2 -0
- package/dist/commands/check-orchestrator.js +17 -0
- package/dist/commands/check-preset-versions.d.ts +20 -0
- package/dist/commands/check-preset-versions.js +15 -0
- package/dist/commands/check-publish-guardrails.d.ts +38 -0
- package/dist/commands/check-publish-guardrails.js +19 -0
- package/dist/commands/check-surface-map-format.d.ts +29 -0
- package/dist/commands/check-surface-map-format.js +19 -0
- package/dist/commands/check-surface-map.d.ts +20 -0
- package/dist/commands/check-surface-map.js +15 -0
- package/dist/commands/check-tsdoc.d.ts +3 -0
- package/dist/commands/check-tsdoc.js +9 -0
- package/dist/commands/check.d.ts +93 -0
- package/dist/commands/check.js +14 -0
- package/dist/commands/demo.d.ts +21 -0
- package/dist/commands/demo.js +8 -0
- package/dist/commands/docs-api.d.ts +4 -0
- package/dist/commands/docs-api.js +13 -0
- package/dist/commands/docs-export.d.ts +4 -0
- package/dist/commands/docs-export.js +12 -0
- package/dist/commands/docs-list.d.ts +3 -0
- package/dist/commands/docs-list.js +13 -0
- package/dist/commands/docs-module-loader.d.ts +2 -0
- package/dist/commands/docs-module-loader.js +8 -0
- package/dist/commands/docs-search.d.ts +3 -0
- package/dist/commands/docs-search.js +13 -0
- package/dist/commands/docs-show.d.ts +3 -0
- package/dist/commands/docs-show.js +13 -0
- package/dist/commands/docs-types.d.ts +21 -0
- package/dist/commands/docs-types.js +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.js +17 -0
- package/dist/commands/init-execution.d.ts +8 -0
- package/dist/commands/init-execution.js +11 -0
- package/dist/commands/init-option-resolution.d.ts +5 -0
- package/dist/commands/init-option-resolution.js +14 -0
- package/dist/commands/init-output.d.ts +9 -0
- package/dist/commands/init-output.js +11 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.js +24 -0
- package/dist/commands/jq-utils.d.ts +17 -0
- package/dist/commands/jq-utils.js +8 -0
- package/dist/commands/repo.d.ts +3 -0
- package/dist/commands/repo.js +13 -0
- package/dist/commands/scaffold-output.d.ts +4 -0
- package/dist/commands/scaffold-output.js +11 -0
- package/dist/commands/scaffold-planning.d.ts +65 -0
- package/dist/commands/scaffold-planning.js +20 -0
- package/dist/commands/scaffold.d.ts +4 -0
- package/dist/commands/scaffold.js +26 -0
- package/dist/commands/shared-deps.d.ts +22 -0
- package/dist/commands/shared-deps.js +11 -0
- package/dist/commands/upgrade-apply.d.ts +14 -0
- package/dist/commands/upgrade-apply.js +8 -0
- package/dist/commands/upgrade-codemods.d.ts +47 -0
- package/dist/commands/upgrade-codemods.js +14 -0
- package/dist/commands/upgrade-latest-version.d.ts +8 -0
- package/dist/commands/upgrade-latest-version.js +8 -0
- package/dist/commands/upgrade-migration-docs.d.ts +3 -0
- package/dist/commands/upgrade-migration-docs.js +15 -0
- package/dist/commands/upgrade-migration-frontmatter.d.ts +2 -0
- package/dist/commands/upgrade-migration-frontmatter.js +10 -0
- package/dist/commands/upgrade-migration-guides.d.ts +5 -0
- package/dist/commands/upgrade-migration-guides.js +10 -0
- package/dist/commands/upgrade-output.d.ts +5 -0
- package/dist/commands/upgrade-output.js +11 -0
- package/dist/commands/upgrade-planner.d.ts +58 -0
- package/dist/commands/upgrade-planner.js +8 -0
- package/dist/commands/upgrade-report.d.ts +5 -0
- package/dist/commands/upgrade-report.js +8 -0
- package/dist/commands/upgrade-workspace.d.ts +2 -0
- package/dist/commands/upgrade-workspace.js +16 -0
- package/dist/commands/upgrade.d.ts +5 -0
- package/dist/commands/upgrade.js +37 -0
- package/dist/create/index.d.ts +5 -0
- package/dist/create/index.js +2 -0
- package/dist/create/planner.d.ts +3 -0
- package/dist/create/planner.js +85 -0
- package/dist/create/presets.d.ts +3 -0
- package/dist/create/presets.js +12 -0
- package/dist/create/types.d.ts +2 -0
- package/dist/create/types.js +1 -0
- package/dist/engine/blocks.d.ts +3 -0
- package/dist/engine/blocks.js +12 -0
- package/dist/engine/collector.d.ts +2 -0
- package/dist/engine/collector.js +8 -0
- package/dist/engine/config.d.ts +3 -0
- package/dist/engine/config.js +15 -0
- package/dist/engine/dependency-versions.d.ts +17 -0
- package/dist/engine/dependency-versions.js +12 -0
- package/dist/engine/executor.d.ts +3 -0
- package/dist/engine/executor.js +156 -0
- package/dist/engine/index.d.ts +10 -0
- package/dist/engine/index.js +54 -0
- package/dist/engine/names.d.ts +2 -0
- package/dist/engine/names.js +24 -0
- package/dist/engine/post-scaffold.d.ts +3 -0
- package/dist/engine/post-scaffold.js +8 -0
- package/dist/engine/preset.d.ts +3 -0
- package/dist/engine/preset.js +17 -0
- package/dist/engine/render-plan.d.ts +7 -0
- package/dist/engine/render-plan.js +9 -0
- package/dist/engine/template.d.ts +4 -0
- package/dist/engine/template.js +34 -0
- package/dist/engine/types.d.ts +2 -0
- package/dist/engine/types.js +8 -0
- package/dist/engine/workspace.d.ts +3 -0
- package/dist/engine/workspace.js +20 -0
- package/dist/index.d.ts +17 -397
- package/dist/index.js +7 -165
- package/dist/manifest.d.ts +71 -0
- package/dist/manifest.js +16 -0
- package/dist/output-mode.d.ts +2 -0
- package/dist/output-mode.js +10 -0
- package/dist/shared/outfitter-109s75x0.d.ts +76 -0
- package/dist/shared/outfitter-1fy7byz5.js +170 -0
- package/dist/shared/outfitter-1gmrtapz.js +325 -0
- package/dist/shared/outfitter-1h7k8xxt.js +29 -0
- package/dist/shared/outfitter-1tfa9hke.d.ts +55 -0
- package/dist/shared/outfitter-2nx0k4b3.d.ts +4 -0
- package/dist/shared/outfitter-2ysjerp6.d.ts +44 -0
- package/dist/shared/outfitter-2z61gp5w.js +29 -0
- package/dist/shared/outfitter-34vg353f.d.ts +82 -0
- package/dist/shared/outfitter-3dq4r10s.d.ts +24 -0
- package/dist/shared/outfitter-3rcrvva8.js +103 -0
- package/dist/shared/outfitter-3tx3adgj.js +278 -0
- package/dist/shared/outfitter-4q1zfmvc.js +154 -0
- package/dist/shared/outfitter-4s9meh3j.js +221 -0
- package/dist/shared/outfitter-507ra35w.js +285 -0
- package/dist/shared/outfitter-56jq0rh2.d.ts +42 -0
- package/dist/shared/outfitter-58rn1sj1.d.ts +30 -0
- package/dist/shared/outfitter-5d9wbzhh.d.ts +19 -0
- package/dist/shared/outfitter-5j7zee11.d.ts +180 -0
- package/dist/shared/outfitter-5r6q2749.d.ts +18 -0
- package/dist/shared/outfitter-5vx1bp7h.js +41 -0
- package/dist/shared/outfitter-6ddf91vh.js +190 -0
- package/dist/shared/outfitter-6mpkh3zn.js +432 -0
- package/dist/shared/outfitter-6rtcemk7.d.ts +18 -0
- package/dist/shared/outfitter-6t7xeyg1.js +159 -0
- package/dist/shared/outfitter-738z4c37.js +262 -0
- package/dist/shared/outfitter-76k25svs.js +322 -0
- package/dist/shared/outfitter-7n7vsz95.js +101 -0
- package/dist/shared/outfitter-7q9fnbwa.js +60 -0
- package/dist/shared/outfitter-7r12fj7f.js +30 -0
- package/dist/shared/outfitter-8ggmja91.js +301 -0
- package/dist/shared/outfitter-8kmak0wc.d.ts +4 -0
- package/dist/shared/outfitter-8y2dfx6n.js +11 -0
- package/dist/shared/outfitter-940h0x7b.js +71 -0
- package/dist/shared/outfitter-954y4mzx.d.ts +5 -0
- package/dist/shared/outfitter-a79xrm12.d.ts +17 -0
- package/dist/shared/outfitter-b9cpnr7e.js +110 -0
- package/dist/shared/outfitter-bpr28y54.js +70 -0
- package/dist/shared/outfitter-c7sbs7es.js +92 -0
- package/dist/shared/outfitter-cyhzstz0.js +93 -0
- package/dist/shared/outfitter-cyvr4r8d.d.ts +67 -0
- package/dist/shared/outfitter-d0kqashd.d.ts +98 -0
- package/dist/shared/outfitter-dmfac1w9.js +306 -0
- package/dist/shared/outfitter-e84cr97g.js +232 -0
- package/dist/shared/outfitter-ec83h4v2.js +17 -0
- package/dist/shared/outfitter-eepj7rf7.js +4 -0
- package/dist/shared/outfitter-ekb6t1zz.js +35 -0
- package/dist/shared/outfitter-ex8gn945.js +51 -0
- package/dist/shared/outfitter-f3a70135.js +75 -0
- package/dist/shared/outfitter-fbvfd5zq.d.ts +13 -0
- package/dist/shared/outfitter-fj2v5ffz.js +165 -0
- package/dist/shared/outfitter-fx1m251y.js +122 -0
- package/dist/shared/outfitter-fxry5n58.js +254 -0
- package/dist/shared/outfitter-g3hvjshg.js +1 -0
- package/dist/shared/outfitter-gdc7b7de.d.ts +5 -0
- package/dist/shared/outfitter-gyayfx5r.js +156 -0
- package/dist/shared/outfitter-h0wmtxw8.d.ts +23 -0
- package/dist/shared/outfitter-hcexcvxe.d.ts +25 -0
- package/dist/shared/outfitter-hf5bj2gq.js +117 -0
- package/dist/shared/outfitter-hsp8vy5m.d.ts +146 -0
- package/dist/shared/outfitter-htx4asgr.d.ts +52 -0
- package/dist/shared/outfitter-jwxggvz4.js +42 -0
- package/dist/shared/outfitter-ksyvwmb5.js +191 -0
- package/dist/shared/outfitter-m3ehh37q.d.ts +22 -0
- package/dist/shared/outfitter-mstr60zz.js +215 -0
- package/dist/shared/outfitter-n0ed012k.js +101 -0
- package/dist/shared/outfitter-n13pqaft.js +19 -0
- package/dist/shared/outfitter-nxvjxrmw.d.ts +48 -0
- package/dist/shared/outfitter-p2wn07b7.js +160 -0
- package/dist/shared/outfitter-px5sv5gn.js +321 -0
- package/dist/shared/outfitter-q1g58t85.js +8 -0
- package/dist/shared/outfitter-qsd5638j.js +378 -0
- package/dist/shared/outfitter-qsrx7m4w.js +72 -0
- package/dist/shared/outfitter-r2awqszh.d.ts +52 -0
- package/dist/shared/outfitter-rdpw2sbp.d.ts +77 -0
- package/dist/shared/outfitter-rp89dafm.js +109 -0
- package/dist/shared/outfitter-s1c0whzj.js +121 -0
- package/dist/shared/outfitter-ssrtakh3.js +342 -0
- package/dist/shared/outfitter-ssynegbs.js +167 -0
- package/dist/shared/outfitter-svts4wk2.js +36 -0
- package/dist/shared/outfitter-tavatb5p.js +166 -0
- package/dist/shared/outfitter-tqznjgbm.js +44 -0
- package/dist/shared/outfitter-ttjr95y9.js +98 -0
- package/dist/shared/outfitter-wcrp7d7m.d.ts +5 -0
- package/dist/shared/outfitter-wkt0a0ra.js +67 -0
- package/dist/shared/outfitter-wrcqq29p.js +132 -0
- package/dist/shared/outfitter-wyg1tpp5.d.ts +43 -0
- package/dist/shared/outfitter-x0vpb7tj.js +126 -0
- package/dist/shared/outfitter-x39awx8g.js +146 -0
- package/dist/shared/outfitter-x4cc5xsq.js +168 -0
- package/dist/shared/outfitter-x8w5sjnd.d.ts +39 -0
- package/dist/shared/outfitter-xr6g13nz.d.ts +50 -0
- package/dist/shared/outfitter-xs94pkfe.js +106 -0
- package/dist/shared/outfitter-xwzjgswj.js +488 -0
- package/dist/shared/outfitter-y37yfehn.d.ts +37 -0
- package/dist/shared/outfitter-y6ee0k45.d.ts +18 -0
- package/dist/shared/outfitter-ydw7x6bh.js +61 -0
- package/dist/shared/outfitter-yhb23pjc.js +89 -0
- package/dist/shared/outfitter-ypcvwg1s.js +91 -0
- package/dist/shared/outfitter-yywcypw8.js +53 -0
- package/dist/shared/outfitter-znbqe5zy.d.ts +45 -0
- package/dist/shared/outfitter-zng6w0t9.d.ts +4 -0
- package/dist/targets/index.d.ts +4 -0
- package/dist/targets/index.js +28 -0
- package/dist/targets/registry.d.ts +3 -0
- package/dist/targets/registry.js +221 -0
- package/dist/targets/types.d.ts +2 -0
- package/dist/targets/types.js +1 -0
- package/package.json +194 -35
- package/dist/shared/chunk-3pwh8ys4.js +0 -6461
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
actionInternalErr,
|
|
4
|
+
outputModeSchema,
|
|
5
|
+
resolveCwdFromPreset,
|
|
6
|
+
resolveOutputModeWithEnvFallback
|
|
7
|
+
} from "./outfitter-7n7vsz95.js";
|
|
8
|
+
import {
|
|
9
|
+
printCheckDocsSentinelResult,
|
|
10
|
+
runCheckDocsSentinel
|
|
11
|
+
} from "./outfitter-fj2v5ffz.js";
|
|
12
|
+
import {
|
|
13
|
+
printCheckSurfaceMapFormatResult,
|
|
14
|
+
runCheckSurfaceMapFormat
|
|
15
|
+
} from "./outfitter-gyayfx5r.js";
|
|
16
|
+
import {
|
|
17
|
+
printCheckActionCeremonyResult,
|
|
18
|
+
runCheckActionCeremony
|
|
19
|
+
} from "./outfitter-p2wn07b7.js";
|
|
20
|
+
import {
|
|
21
|
+
printCheckSurfaceMapResult,
|
|
22
|
+
runCheckSurfaceMap
|
|
23
|
+
} from "./outfitter-b9cpnr7e.js";
|
|
24
|
+
import {
|
|
25
|
+
printCheckPresetVersionsResult,
|
|
26
|
+
runCheckPresetVersions
|
|
27
|
+
} from "./outfitter-8ggmja91.js";
|
|
28
|
+
import {
|
|
29
|
+
printCheckPublishGuardrailsResult,
|
|
30
|
+
runCheckPublishGuardrails
|
|
31
|
+
} from "./outfitter-ssynegbs.js";
|
|
32
|
+
import {
|
|
33
|
+
resolveStructuredOutputMode
|
|
34
|
+
} from "./outfitter-7r12fj7f.js";
|
|
35
|
+
|
|
36
|
+
// apps/outfitter/src/actions/check-automation.ts
|
|
37
|
+
import { cwdPreset } from "@outfitter/cli/flags";
|
|
38
|
+
import { outputModePreset } from "@outfitter/cli/query";
|
|
39
|
+
import { defineAction, Result } from "@outfitter/contracts";
|
|
40
|
+
import { z } from "zod";
|
|
41
|
+
var checkAutomationInputSchema = z.object({
|
|
42
|
+
cwd: z.string(),
|
|
43
|
+
outputMode: outputModeSchema
|
|
44
|
+
});
|
|
45
|
+
var checkAutomationOutput = outputModePreset();
|
|
46
|
+
var checkAutomationCwd = cwdPreset();
|
|
47
|
+
function mapCheckAutomationInput(context) {
|
|
48
|
+
const { outputMode: presetOutputMode } = checkAutomationOutput.resolve(context.flags);
|
|
49
|
+
const outputMode = resolveOutputModeWithEnvFallback(context.flags, resolveStructuredOutputMode(presetOutputMode) ?? "human");
|
|
50
|
+
return {
|
|
51
|
+
cwd: resolveCwdFromPreset(context.flags, checkAutomationCwd),
|
|
52
|
+
outputMode
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
var checkPublishGuardrailsAction = defineAction({
|
|
56
|
+
id: "check.publish-guardrails",
|
|
57
|
+
description: "Validate publishable package manifests enforce prepublishOnly guardrails",
|
|
58
|
+
surfaces: ["cli"],
|
|
59
|
+
input: checkAutomationInputSchema,
|
|
60
|
+
cli: {
|
|
61
|
+
group: "check",
|
|
62
|
+
command: "publish-guardrails",
|
|
63
|
+
description: "Validate publishable package manifests enforce prepublishOnly guardrails",
|
|
64
|
+
options: [
|
|
65
|
+
...checkAutomationOutput.options,
|
|
66
|
+
...checkAutomationCwd.options
|
|
67
|
+
],
|
|
68
|
+
mapInput: mapCheckAutomationInput
|
|
69
|
+
},
|
|
70
|
+
handler: async (input) => {
|
|
71
|
+
const result = await runCheckPublishGuardrails({ cwd: input.cwd });
|
|
72
|
+
if (result.isErr()) {
|
|
73
|
+
return actionInternalErr("check.publish-guardrails", result.error);
|
|
74
|
+
}
|
|
75
|
+
await printCheckPublishGuardrailsResult(result.value, {
|
|
76
|
+
mode: input.outputMode
|
|
77
|
+
});
|
|
78
|
+
if (!result.value.ok) {
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
return Result.ok(result.value);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
var checkPresetVersionsAction = defineAction({
|
|
85
|
+
id: "check.preset-versions",
|
|
86
|
+
description: "Validate preset dependency versions, registry versions, and Bun version consistency",
|
|
87
|
+
surfaces: ["cli"],
|
|
88
|
+
input: checkAutomationInputSchema,
|
|
89
|
+
cli: {
|
|
90
|
+
group: "check",
|
|
91
|
+
command: "preset-versions",
|
|
92
|
+
description: "Validate preset dependency versions, registry versions, and Bun version consistency",
|
|
93
|
+
options: [...checkAutomationOutput.options, ...checkAutomationCwd.options],
|
|
94
|
+
mapInput: mapCheckAutomationInput
|
|
95
|
+
},
|
|
96
|
+
handler: async (input) => {
|
|
97
|
+
const result = await runCheckPresetVersions({ cwd: input.cwd });
|
|
98
|
+
if (result.isErr()) {
|
|
99
|
+
return actionInternalErr("check.preset-versions", result.error);
|
|
100
|
+
}
|
|
101
|
+
await printCheckPresetVersionsResult(result.value, {
|
|
102
|
+
mode: input.outputMode
|
|
103
|
+
});
|
|
104
|
+
if (!result.value.ok) {
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
return Result.ok(result.value);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
var checkSurfaceMapAction = defineAction({
|
|
111
|
+
id: "check.surface-map",
|
|
112
|
+
description: "Validate canonical surface map path usage (.outfitter/surface.json only)",
|
|
113
|
+
surfaces: ["cli"],
|
|
114
|
+
input: checkAutomationInputSchema,
|
|
115
|
+
cli: {
|
|
116
|
+
group: "check",
|
|
117
|
+
command: "surface-map",
|
|
118
|
+
description: "Validate canonical surface map path usage (.outfitter/surface.json only)",
|
|
119
|
+
options: [...checkAutomationOutput.options, ...checkAutomationCwd.options],
|
|
120
|
+
mapInput: mapCheckAutomationInput
|
|
121
|
+
},
|
|
122
|
+
handler: async (input) => {
|
|
123
|
+
const result = await runCheckSurfaceMap({ cwd: input.cwd });
|
|
124
|
+
if (result.isErr()) {
|
|
125
|
+
return actionInternalErr("check.surface-map", result.error);
|
|
126
|
+
}
|
|
127
|
+
await printCheckSurfaceMapResult(result.value, {
|
|
128
|
+
mode: input.outputMode
|
|
129
|
+
});
|
|
130
|
+
if (!result.value.ok) {
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
return Result.ok(result.value);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
var checkSurfaceMapFormatAction = defineAction({
|
|
137
|
+
id: "check.surface-map-format",
|
|
138
|
+
description: "Validate canonical formatting for .outfitter/surface.json",
|
|
139
|
+
surfaces: ["cli"],
|
|
140
|
+
input: checkAutomationInputSchema,
|
|
141
|
+
cli: {
|
|
142
|
+
group: "check",
|
|
143
|
+
command: "surface-map-format",
|
|
144
|
+
description: "Validate canonical formatting for .outfitter/surface.json",
|
|
145
|
+
options: [...checkAutomationOutput.options, ...checkAutomationCwd.options],
|
|
146
|
+
mapInput: mapCheckAutomationInput
|
|
147
|
+
},
|
|
148
|
+
handler: async (input) => {
|
|
149
|
+
const result = await runCheckSurfaceMapFormat({ cwd: input.cwd });
|
|
150
|
+
if (result.isErr()) {
|
|
151
|
+
return actionInternalErr("check.surface-map-format", result.error);
|
|
152
|
+
}
|
|
153
|
+
await printCheckSurfaceMapFormatResult(result.value, {
|
|
154
|
+
mode: input.outputMode
|
|
155
|
+
});
|
|
156
|
+
if (!result.value.ok) {
|
|
157
|
+
process.exit(1);
|
|
158
|
+
}
|
|
159
|
+
return Result.ok(result.value);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
var checkDocsSentinelAction = defineAction({
|
|
163
|
+
id: "check.docs-sentinel",
|
|
164
|
+
description: "Validate docs/README.md PACKAGE_LIST sentinel freshness",
|
|
165
|
+
surfaces: ["cli"],
|
|
166
|
+
input: checkAutomationInputSchema,
|
|
167
|
+
cli: {
|
|
168
|
+
group: "check",
|
|
169
|
+
command: "docs-sentinel",
|
|
170
|
+
description: "Validate docs/README.md PACKAGE_LIST sentinel freshness",
|
|
171
|
+
options: [...checkAutomationOutput.options, ...checkAutomationCwd.options],
|
|
172
|
+
mapInput: mapCheckAutomationInput
|
|
173
|
+
},
|
|
174
|
+
handler: async (input) => {
|
|
175
|
+
const result = await runCheckDocsSentinel({ cwd: input.cwd });
|
|
176
|
+
if (result.isErr()) {
|
|
177
|
+
return actionInternalErr("check.docs-sentinel", result.error);
|
|
178
|
+
}
|
|
179
|
+
await printCheckDocsSentinelResult(result.value, {
|
|
180
|
+
mode: input.outputMode
|
|
181
|
+
});
|
|
182
|
+
if (!result.value.ok) {
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
return Result.ok(result.value);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
var checkActionCeremonyAction = defineAction({
|
|
189
|
+
id: "check.action-ceremony",
|
|
190
|
+
description: "Validate action ceremony guardrails in apps/outfitter/src/actions",
|
|
191
|
+
surfaces: ["cli"],
|
|
192
|
+
input: checkAutomationInputSchema,
|
|
193
|
+
cli: {
|
|
194
|
+
group: "check",
|
|
195
|
+
command: "action-ceremony",
|
|
196
|
+
description: "Validate action ceremony guardrails in apps/outfitter/src/actions",
|
|
197
|
+
options: [...checkAutomationOutput.options, ...checkAutomationCwd.options],
|
|
198
|
+
mapInput: mapCheckAutomationInput
|
|
199
|
+
},
|
|
200
|
+
handler: async (input) => {
|
|
201
|
+
const result = await runCheckActionCeremony({ cwd: input.cwd });
|
|
202
|
+
if (result.isErr()) {
|
|
203
|
+
return actionInternalErr("check.action-ceremony", result.error);
|
|
204
|
+
}
|
|
205
|
+
await printCheckActionCeremonyResult(result.value, {
|
|
206
|
+
mode: input.outputMode
|
|
207
|
+
});
|
|
208
|
+
if (!result.value.ok) {
|
|
209
|
+
process.exit(1);
|
|
210
|
+
}
|
|
211
|
+
return Result.ok(result.value);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
export { checkPublishGuardrailsAction, checkPresetVersionsAction, checkSurfaceMapAction, checkSurfaceMapFormatAction, checkDocsSentinelAction, checkActionCeremonyAction };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
renderOperationPlan
|
|
4
|
+
} from "./outfitter-ttjr95y9.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveStructuredOutputMode
|
|
7
|
+
} from "./outfitter-7r12fj7f.js";
|
|
8
|
+
import {
|
|
9
|
+
OperationCollector
|
|
10
|
+
} from "./outfitter-1h7k8xxt.js";
|
|
11
|
+
|
|
12
|
+
// apps/outfitter/src/commands/init-output.ts
|
|
13
|
+
import { realpath } from "fs/promises";
|
|
14
|
+
import { output } from "@outfitter/cli";
|
|
15
|
+
async function printInitResults(result, options) {
|
|
16
|
+
let rootDir = result.rootDir;
|
|
17
|
+
let projectDir = result.projectDir;
|
|
18
|
+
try {
|
|
19
|
+
rootDir = await realpath(rootDir);
|
|
20
|
+
projectDir = await realpath(projectDir);
|
|
21
|
+
} catch {}
|
|
22
|
+
const structuredMode = resolveStructuredOutputMode(options?.mode);
|
|
23
|
+
if (result.dryRunPlan) {
|
|
24
|
+
if (structuredMode) {
|
|
25
|
+
await output({
|
|
26
|
+
rootDir,
|
|
27
|
+
projectDir,
|
|
28
|
+
structure: result.structure,
|
|
29
|
+
preset: result.preset,
|
|
30
|
+
packageName: result.packageName,
|
|
31
|
+
...result.dryRunPlan
|
|
32
|
+
}, { mode: structuredMode });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const collector = new OperationCollector;
|
|
36
|
+
for (const op of result.dryRunPlan.operations) {
|
|
37
|
+
collector.add(op);
|
|
38
|
+
}
|
|
39
|
+
await renderOperationPlan(collector, { rootDir });
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (structuredMode) {
|
|
43
|
+
await output({
|
|
44
|
+
structure: result.structure,
|
|
45
|
+
rootDir,
|
|
46
|
+
projectDir,
|
|
47
|
+
preset: result.preset,
|
|
48
|
+
packageName: result.packageName,
|
|
49
|
+
blocksAdded: result.blocksAdded ?? null,
|
|
50
|
+
postScaffold: result.postScaffold,
|
|
51
|
+
nextSteps: result.postScaffold.nextSteps
|
|
52
|
+
}, { mode: structuredMode });
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const lines = [
|
|
56
|
+
`Project initialized successfully in ${rootDir}`,
|
|
57
|
+
`Structure: ${result.structure}`,
|
|
58
|
+
`Preset: ${result.preset}`
|
|
59
|
+
];
|
|
60
|
+
if (result.structure === "workspace") {
|
|
61
|
+
lines.push(`Workspace project path: ${projectDir}`);
|
|
62
|
+
}
|
|
63
|
+
if (result.blocksAdded) {
|
|
64
|
+
const { created, skipped, dependencies, devDependencies } = result.blocksAdded;
|
|
65
|
+
if (created.length > 0) {
|
|
66
|
+
lines.push("", `Added ${created.length} tooling file(s):`);
|
|
67
|
+
for (const file of created) {
|
|
68
|
+
lines.push(` \u2713 ${file}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (skipped.length > 0) {
|
|
72
|
+
lines.push("", `Skipped ${skipped.length} existing file(s):`);
|
|
73
|
+
for (const file of skipped) {
|
|
74
|
+
lines.push(` - ${file}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const depCount = Object.keys(dependencies).length + Object.keys(devDependencies).length;
|
|
78
|
+
if (depCount > 0) {
|
|
79
|
+
lines.push("", `Added ${depCount} package(s) to package.json:`);
|
|
80
|
+
for (const [name, version] of Object.entries(dependencies)) {
|
|
81
|
+
lines.push(` + ${name}@${version}`);
|
|
82
|
+
}
|
|
83
|
+
for (const [name, version] of Object.entries(devDependencies)) {
|
|
84
|
+
lines.push(` + ${name}@${version} (dev)`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (result.postScaffold.installResult === "failed") {
|
|
89
|
+
lines.push("", `Warning: bun install failed: ${result.postScaffold.installError ?? "unknown"}`);
|
|
90
|
+
}
|
|
91
|
+
if (result.postScaffold.gitInitResult === "failed") {
|
|
92
|
+
lines.push("", `Warning: git setup failed: ${result.postScaffold.gitError ?? "unknown"}`);
|
|
93
|
+
}
|
|
94
|
+
lines.push("", "Next steps:");
|
|
95
|
+
for (const step of result.postScaffold.nextSteps) {
|
|
96
|
+
lines.push(` ${step}`);
|
|
97
|
+
}
|
|
98
|
+
await output(lines, { mode: "human" });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { printInitResults };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// apps/outfitter/src/commands/upgrade-latest-version.ts
|
|
3
|
+
async function getLatestVersion(name) {
|
|
4
|
+
try {
|
|
5
|
+
const proc = Bun.spawn(["npm", "view", name, "version"], {
|
|
6
|
+
stdout: "pipe",
|
|
7
|
+
stderr: "pipe"
|
|
8
|
+
});
|
|
9
|
+
const stdout = await new Response(proc.stdout).text();
|
|
10
|
+
const exitCode = await proc.exited;
|
|
11
|
+
if (exitCode !== 0)
|
|
12
|
+
return null;
|
|
13
|
+
return stdout.trim() || null;
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { getLatestVersion };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CliOutputMode } from "./outfitter-a79xrm12.js";
|
|
2
|
+
import { InternalError, Result } from "@outfitter/contracts";
|
|
3
|
+
/** Validated input for the docs.search action handler. */
|
|
4
|
+
interface DocsSearchInput {
|
|
5
|
+
readonly cwd: string;
|
|
6
|
+
readonly jq?: string | undefined;
|
|
7
|
+
readonly kind?: string | undefined;
|
|
8
|
+
readonly outputMode: CliOutputMode;
|
|
9
|
+
readonly package?: string | undefined;
|
|
10
|
+
readonly query: string;
|
|
11
|
+
}
|
|
12
|
+
/** A single match found in a documentation file. */
|
|
13
|
+
interface DocsSearchMatch {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly kind: string;
|
|
16
|
+
readonly matchLines: string[];
|
|
17
|
+
readonly outputPath: string;
|
|
18
|
+
readonly package?: string;
|
|
19
|
+
readonly sourcePath: string;
|
|
20
|
+
readonly title: string;
|
|
21
|
+
}
|
|
22
|
+
/** Output shape for the docs.search action. */
|
|
23
|
+
interface DocsSearchOutput {
|
|
24
|
+
readonly matches: DocsSearchMatch[];
|
|
25
|
+
readonly query: string;
|
|
26
|
+
readonly total: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Search documentation content for a query string.
|
|
30
|
+
*
|
|
31
|
+
* Generates the docs map for the workspace, reads each file's content,
|
|
32
|
+
* and performs case-insensitive substring matching to find relevant lines.
|
|
33
|
+
*
|
|
34
|
+
* @param input - Validated action input
|
|
35
|
+
* @returns Result containing the search matches or an error
|
|
36
|
+
*/
|
|
37
|
+
declare function runDocsSearch(input: DocsSearchInput): Promise<Result<DocsSearchOutput, InternalError>>;
|
|
38
|
+
/**
|
|
39
|
+
* Print docs search results in the appropriate output format.
|
|
40
|
+
*
|
|
41
|
+
* @param result - The docs search output
|
|
42
|
+
* @param options - Output formatting options
|
|
43
|
+
*/
|
|
44
|
+
declare function printDocsSearchResults(result: DocsSearchOutput, options?: {
|
|
45
|
+
mode?: CliOutputMode;
|
|
46
|
+
jq?: string | undefined;
|
|
47
|
+
}): Promise<void>;
|
|
48
|
+
export { DocsSearchInput, DocsSearchMatch, DocsSearchOutput, runDocsSearch, printDocsSearchResults };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
resolveStructuredOutputMode
|
|
4
|
+
} from "./outfitter-7r12fj7f.js";
|
|
5
|
+
|
|
6
|
+
// apps/outfitter/src/commands/check-action-ceremony.ts
|
|
7
|
+
import { readdirSync } from "fs";
|
|
8
|
+
import { resolve } from "path";
|
|
9
|
+
import { Result } from "@outfitter/contracts";
|
|
10
|
+
var ACTIONS_RELATIVE_DIR = "apps/outfitter/src/actions";
|
|
11
|
+
var CEREMONY_BUDGETS = [
|
|
12
|
+
{
|
|
13
|
+
id: "direct-defineAction-generics",
|
|
14
|
+
description: "Direct defineAction<T> invocations should stay constrained (prefer export-level typing)",
|
|
15
|
+
maxCount: 1,
|
|
16
|
+
pattern: /(?<!typeof\s)defineAction</g
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "schema-zodtype-casts",
|
|
20
|
+
description: "Action-local schema casts should not expand without justification",
|
|
21
|
+
maxCount: 6,
|
|
22
|
+
pattern: /as z\.ZodType</g
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "direct-internalerror-construction",
|
|
26
|
+
description: "Direct InternalError creation in action handlers should stay minimal (use shared adapter)",
|
|
27
|
+
maxCount: 1,
|
|
28
|
+
pattern: /new InternalError\(/g
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
class CheckActionCeremonyError extends Error {
|
|
33
|
+
_tag = "CheckActionCeremonyError";
|
|
34
|
+
constructor(message) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.name = "CheckActionCeremonyError";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function countMatches(content, pattern) {
|
|
40
|
+
const matches = content.match(pattern);
|
|
41
|
+
return matches ? matches.length : 0;
|
|
42
|
+
}
|
|
43
|
+
function readActionSources(actionsDir) {
|
|
44
|
+
return readdirSync(actionsDir).filter((entry) => entry.endsWith(".ts")).map((entry) => resolve(actionsDir, entry));
|
|
45
|
+
}
|
|
46
|
+
async function runCheckActionCeremony(options) {
|
|
47
|
+
try {
|
|
48
|
+
const cwd = resolve(options.cwd);
|
|
49
|
+
const actionsDir = resolve(cwd, ACTIONS_RELATIVE_DIR);
|
|
50
|
+
const actionFiles = readActionSources(actionsDir);
|
|
51
|
+
const counts = Object.fromEntries(CEREMONY_BUDGETS.map((budget) => [budget.id, 0]));
|
|
52
|
+
for (const filePath of actionFiles) {
|
|
53
|
+
const file = Bun.file(filePath);
|
|
54
|
+
const content = await file.text();
|
|
55
|
+
for (const budget of CEREMONY_BUDGETS) {
|
|
56
|
+
if (budget.id === "direct-internalerror-construction" && filePath.endsWith("shared.ts")) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
counts[budget.id] = (counts[budget.id] ?? 0) + countMatches(content, budget.pattern);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const budgets = CEREMONY_BUDGETS.map((budget) => {
|
|
63
|
+
const count = counts[budget.id] ?? 0;
|
|
64
|
+
return {
|
|
65
|
+
id: budget.id,
|
|
66
|
+
description: budget.description,
|
|
67
|
+
count,
|
|
68
|
+
maxCount: budget.maxCount,
|
|
69
|
+
ok: count <= budget.maxCount
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
return Result.ok({
|
|
73
|
+
actionsDir,
|
|
74
|
+
budgets,
|
|
75
|
+
ok: budgets.every((budget) => budget.ok)
|
|
76
|
+
});
|
|
77
|
+
} catch (error) {
|
|
78
|
+
const message = error instanceof Error ? error.message : "Failed to check action ceremony";
|
|
79
|
+
return Result.err(new CheckActionCeremonyError(message));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async function printCheckActionCeremonyResult(result, options) {
|
|
83
|
+
const structuredMode = resolveStructuredOutputMode(options?.mode);
|
|
84
|
+
if (structuredMode) {
|
|
85
|
+
const serialized = structuredMode === "json" ? JSON.stringify(result, null, 2) : JSON.stringify(result);
|
|
86
|
+
process.stdout.write(`${serialized}
|
|
87
|
+
`);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
process.stdout.write(`[action-ceremony] checked ${result.budgets.length} guardrails in ${result.actionsDir}
|
|
91
|
+
`);
|
|
92
|
+
const failed = result.budgets.filter((budget) => !budget.ok);
|
|
93
|
+
if (failed.length === 0) {
|
|
94
|
+
process.stdout.write(`[action-ceremony] all ceremony guardrails are within budget
|
|
95
|
+
`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
process.stderr.write(`[action-ceremony] ceremony budget exceeded:
|
|
99
|
+
`);
|
|
100
|
+
for (const budget of failed) {
|
|
101
|
+
process.stderr.write(` - ${budget.id}: ${budget.count}/${budget.maxCount} (${budget.description})
|
|
102
|
+
`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function parseCliArgs(argv) {
|
|
106
|
+
let cwd = process.cwd();
|
|
107
|
+
let outputMode = "human";
|
|
108
|
+
for (let index = 0;index < argv.length; index++) {
|
|
109
|
+
const arg = argv[index];
|
|
110
|
+
if (arg === "--cwd") {
|
|
111
|
+
const value = argv[index + 1];
|
|
112
|
+
if (!value) {
|
|
113
|
+
throw new CheckActionCeremonyError("Missing value for --cwd");
|
|
114
|
+
}
|
|
115
|
+
cwd = value;
|
|
116
|
+
index += 1;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (arg === "--json") {
|
|
120
|
+
outputMode = "json";
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (arg === "--jsonl") {
|
|
124
|
+
outputMode = "jsonl";
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
cwd: resolve(cwd),
|
|
130
|
+
outputMode
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
async function runCheckActionCeremonyFromArgv(argv) {
|
|
134
|
+
let parsed;
|
|
135
|
+
try {
|
|
136
|
+
parsed = parseCliArgs(argv);
|
|
137
|
+
} catch (error) {
|
|
138
|
+
const message = error instanceof Error ? error.message : "Invalid command arguments";
|
|
139
|
+
process.stderr.write(`${message}
|
|
140
|
+
`);
|
|
141
|
+
return 1;
|
|
142
|
+
}
|
|
143
|
+
const result = await runCheckActionCeremony({ cwd: parsed.cwd });
|
|
144
|
+
if (result.isErr()) {
|
|
145
|
+
process.stderr.write(`${result.error.message}
|
|
146
|
+
`);
|
|
147
|
+
return 1;
|
|
148
|
+
}
|
|
149
|
+
await printCheckActionCeremonyResult(result.value, {
|
|
150
|
+
mode: parsed.outputMode
|
|
151
|
+
});
|
|
152
|
+
return result.value.ok ? 0 : 1;
|
|
153
|
+
}
|
|
154
|
+
if (import.meta.main) {
|
|
155
|
+
runCheckActionCeremonyFromArgv(process.argv.slice(2)).then((exitCode) => {
|
|
156
|
+
process.exit(exitCode);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export { CheckActionCeremonyError, runCheckActionCeremony, printCheckActionCeremonyResult, runCheckActionCeremonyFromArgv };
|