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.
Files changed (170) hide show
  1. package/README.md +53 -28
  2. package/dist/cli.js +3 -2
  3. package/dist/index.d.ts +95 -135
  4. package/dist/index.js +8 -15
  5. package/dist/shared/{chunk-k59f60cp.js → chunk-3pwh8ys4.js} +3092 -2625
  6. package/package.json +36 -22
  7. package/dist/actions.d.ts +0 -2
  8. package/dist/actions.js +0 -34
  9. package/dist/commands/add.d.ts +0 -54
  10. package/dist/commands/add.js +0 -16
  11. package/dist/commands/check.d.ts +0 -91
  12. package/dist/commands/check.js +0 -14
  13. package/dist/commands/demo.d.ts +0 -21
  14. package/dist/commands/demo.js +0 -8
  15. package/dist/commands/docs-module-loader.d.ts +0 -2
  16. package/dist/commands/docs-module-loader.js +0 -8
  17. package/dist/commands/doctor.d.ts +0 -2
  18. package/dist/commands/doctor.js +0 -13
  19. package/dist/commands/init.d.ts +0 -7
  20. package/dist/commands/init.js +0 -31
  21. package/dist/commands/migrate-kit.d.ts +0 -2
  22. package/dist/commands/migrate-kit.js +0 -15
  23. package/dist/commands/repo.d.ts +0 -3
  24. package/dist/commands/repo.js +0 -9
  25. package/dist/commands/scaffold.d.ts +0 -4
  26. package/dist/commands/scaffold.js +0 -31
  27. package/dist/commands/shared-deps.d.ts +0 -36
  28. package/dist/commands/shared-deps.js +0 -10
  29. package/dist/commands/upgrade-codemods.d.ts +0 -42
  30. package/dist/commands/upgrade-codemods.js +0 -15
  31. package/dist/commands/upgrade-planner.d.ts +0 -58
  32. package/dist/commands/upgrade-planner.js +0 -8
  33. package/dist/commands/upgrade-workspace.d.ts +0 -76
  34. package/dist/commands/upgrade-workspace.js +0 -16
  35. package/dist/commands/upgrade.d.ts +0 -214
  36. package/dist/commands/upgrade.js +0 -25
  37. package/dist/create/index.d.ts +0 -5
  38. package/dist/create/index.js +0 -29
  39. package/dist/create/planner.d.ts +0 -3
  40. package/dist/create/planner.js +0 -21
  41. package/dist/create/presets.d.ts +0 -3
  42. package/dist/create/presets.js +0 -12
  43. package/dist/create/types.d.ts +0 -2
  44. package/dist/create/types.js +0 -1
  45. package/dist/engine/blocks.d.ts +0 -3
  46. package/dist/engine/blocks.js +0 -12
  47. package/dist/engine/collector.d.ts +0 -2
  48. package/dist/engine/collector.js +0 -8
  49. package/dist/engine/config.d.ts +0 -3
  50. package/dist/engine/config.js +0 -12
  51. package/dist/engine/executor.d.ts +0 -3
  52. package/dist/engine/executor.js +0 -16
  53. package/dist/engine/index.d.ts +0 -8
  54. package/dist/engine/index.js +0 -59
  55. package/dist/engine/names.d.ts +0 -2
  56. package/dist/engine/names.js +0 -16
  57. package/dist/engine/post-scaffold.d.ts +0 -3
  58. package/dist/engine/post-scaffold.js +0 -8
  59. package/dist/engine/render-plan.d.ts +0 -7
  60. package/dist/engine/render-plan.js +0 -9
  61. package/dist/engine/template.d.ts +0 -3
  62. package/dist/engine/template.js +0 -17
  63. package/dist/engine/types.d.ts +0 -2
  64. package/dist/engine/types.js +0 -8
  65. package/dist/engine/workspace.d.ts +0 -3
  66. package/dist/engine/workspace.js +0 -13
  67. package/dist/manifest.d.ts +0 -71
  68. package/dist/manifest.js +0 -16
  69. package/dist/output-mode.d.ts +0 -2
  70. package/dist/output-mode.js +0 -10
  71. package/dist/shared/outfitter-193jvzg4.d.ts +0 -5
  72. package/dist/shared/outfitter-1dd0k853.js +0 -194
  73. package/dist/shared/outfitter-1dvma85c.js +0 -322
  74. package/dist/shared/outfitter-1h7k8xxt.js +0 -29
  75. package/dist/shared/outfitter-2ngep1h2.d.ts +0 -5
  76. package/dist/shared/outfitter-2np85etz.js +0 -95
  77. package/dist/shared/outfitter-33w361tc.d.ts +0 -18
  78. package/dist/shared/outfitter-344t1r38.js +0 -1
  79. package/dist/shared/outfitter-3weh61w7.d.ts +0 -25
  80. package/dist/shared/outfitter-4s9meh3j.js +0 -221
  81. package/dist/shared/outfitter-66b25bj8.js +0 -125
  82. package/dist/shared/outfitter-6bkqjk86.d.ts +0 -3
  83. package/dist/shared/outfitter-79vfxt6y.js +0 -269
  84. package/dist/shared/outfitter-7ha7p61k.d.ts +0 -6
  85. package/dist/shared/outfitter-7r12fj7f.js +0 -30
  86. package/dist/shared/outfitter-8y2dfx6n.js +0 -11
  87. package/dist/shared/outfitter-9x1brcmq.js +0 -184
  88. package/dist/shared/outfitter-9zqc2njf.js +0 -859
  89. package/dist/shared/outfitter-a79xrm12.d.ts +0 -17
  90. package/dist/shared/outfitter-amc4jbs1.d.ts +0 -50
  91. package/dist/shared/outfitter-ara3djt0.js +0 -73
  92. package/dist/shared/outfitter-avhm5z6w.js +0 -82
  93. package/dist/shared/outfitter-bkwpbkr9.d.ts +0 -63
  94. package/dist/shared/outfitter-bn9c8p2e.js +0 -204
  95. package/dist/shared/outfitter-bpr28y54.js +0 -70
  96. package/dist/shared/outfitter-cwq39bv4.d.ts +0 -48
  97. package/dist/shared/outfitter-d7pq7d0k.js +0 -196
  98. package/dist/shared/outfitter-dd0btgec.d.ts +0 -40
  99. package/dist/shared/outfitter-e2zz5wv7.d.ts +0 -51
  100. package/dist/shared/outfitter-ehp18x1n.js +0 -1
  101. package/dist/shared/outfitter-gdvm5c0b.d.ts +0 -4
  102. package/dist/shared/outfitter-h1mnzzd1.d.ts +0 -14
  103. package/dist/shared/outfitter-hvsaxgcp.js +0 -1
  104. package/dist/shared/outfitter-hws10ze7.js +0 -532
  105. package/dist/shared/outfitter-j833sxws.js +0 -61
  106. package/dist/shared/outfitter-j8yc7294.d.ts +0 -22
  107. package/dist/shared/outfitter-k112c427.js +0 -21
  108. package/dist/shared/outfitter-k56rmt24.d.ts +0 -30
  109. package/dist/shared/outfitter-ksa1pp4t.d.ts +0 -4
  110. package/dist/shared/outfitter-ksyvwmb5.js +0 -191
  111. package/dist/shared/outfitter-mdt37hqm.js +0 -4
  112. package/dist/shared/outfitter-mtbpabf3.js +0 -91
  113. package/dist/shared/outfitter-mxz69pgy.js +0 -713
  114. package/dist/shared/outfitter-npemy7ta.d.ts +0 -53
  115. package/dist/shared/outfitter-npyfbdmc.d.ts +0 -6
  116. package/dist/shared/outfitter-pyy1zkfh.d.ts +0 -133
  117. package/dist/shared/outfitter-q9agarmb.js +0 -42
  118. package/dist/shared/outfitter-qfh36ddg.d.ts +0 -66
  119. package/dist/shared/outfitter-qn864k6h.js +0 -581
  120. package/dist/shared/outfitter-rdc5v5ms.js +0 -746
  121. package/dist/shared/outfitter-sgtq57qr.d.ts +0 -5
  122. package/dist/shared/outfitter-ttjr95y9.js +0 -98
  123. package/dist/shared/outfitter-vh4xgb93.js +0 -35
  124. package/dist/shared/outfitter-yvksv5qb.js +0 -322
  125. package/dist/shared/outfitter-zwyvewr1.js +0 -36
  126. package/dist/targets/index.d.ts +0 -4
  127. package/dist/targets/index.js +0 -29
  128. package/dist/targets/registry.d.ts +0 -3
  129. package/dist/targets/registry.js +0 -28
  130. package/dist/targets/types.d.ts +0 -2
  131. package/dist/targets/types.js +0 -1
  132. package/templates/.gitkeep +0 -0
  133. package/templates/basic/.gitignore.template +0 -30
  134. package/templates/basic/.lefthook.yml.template +0 -26
  135. package/templates/basic/package.json.template +0 -46
  136. package/templates/basic/src/index.ts.template +0 -26
  137. package/templates/basic/tsconfig.json.template +0 -34
  138. package/templates/cli/.gitignore.template +0 -4
  139. package/templates/cli/.lefthook.yml.template +0 -26
  140. package/templates/cli/README.md.template +0 -35
  141. package/templates/cli/biome.json.template +0 -4
  142. package/templates/cli/package.json.template +0 -45
  143. package/templates/cli/src/cli.ts.template +0 -8
  144. package/templates/cli/src/index.ts.template +0 -7
  145. package/templates/cli/src/program.ts.template +0 -31
  146. package/templates/cli/tsconfig.json.template +0 -34
  147. package/templates/daemon/.gitignore.template +0 -4
  148. package/templates/daemon/.lefthook.yml.template +0 -26
  149. package/templates/daemon/README.md.template +0 -67
  150. package/templates/daemon/biome.json.template +0 -4
  151. package/templates/daemon/package.json.template +0 -48
  152. package/templates/daemon/src/cli.ts.template +0 -96
  153. package/templates/daemon/src/daemon-main.ts.template +0 -79
  154. package/templates/daemon/src/daemon.ts.template +0 -11
  155. package/templates/daemon/src/index.ts.template +0 -7
  156. package/templates/daemon/tsconfig.json.template +0 -23
  157. package/templates/mcp/.gitignore.template +0 -4
  158. package/templates/mcp/.lefthook.yml.template +0 -26
  159. package/templates/mcp/README.md.template +0 -54
  160. package/templates/mcp/biome.json.template +0 -4
  161. package/templates/mcp/package.json.template +0 -45
  162. package/templates/mcp/src/index.ts.template +0 -7
  163. package/templates/mcp/src/mcp.ts.template +0 -79
  164. package/templates/mcp/src/server.ts.template +0 -15
  165. package/templates/mcp/tsconfig.json.template +0 -23
  166. package/templates/minimal/.gitignore.template +0 -30
  167. package/templates/minimal/.lefthook.yml.template +0 -26
  168. package/templates/minimal/package.json.template +0 -46
  169. package/templates/minimal/src/index.ts.template +0 -26
  170. package/templates/minimal/tsconfig.json.template +0 -34
@@ -1,53 +0,0 @@
1
- import { OutputMode } from "@outfitter/cli/types";
2
- import { Result } from "@outfitter/contracts";
3
- import { Command } from "commander";
4
- interface DiffPreview {
5
- readonly path: string;
6
- readonly preview: string;
7
- }
8
- /**
9
- * Options for the migrate-kit command.
10
- */
11
- interface MigrateKitOptions {
12
- /** Target directory to migrate (defaults to cwd). */
13
- readonly targetDir?: string | undefined;
14
- /** Run codemod without writing changes to disk. */
15
- readonly dryRun?: boolean | undefined;
16
- }
17
- /**
18
- * Result from migrate-kit execution.
19
- */
20
- interface MigrateKitResult {
21
- readonly targetDir: string;
22
- readonly dryRun: boolean;
23
- readonly packageJsonFiles: number;
24
- readonly sourceFiles: number;
25
- readonly manifestUpdates: number;
26
- readonly importRewrites: number;
27
- readonly changedFiles: readonly string[];
28
- readonly diffs: readonly DiffPreview[];
29
- }
30
- /**
31
- * Error returned when migration fails.
32
- */
33
- declare class MigrateKitError extends Error {
34
- readonly _tag: "MigrateKitError";
35
- constructor(message: string);
36
- }
37
- /**
38
- * Runs the migrate-kit codemod programmatically.
39
- */
40
- declare function runMigrateKit(options: MigrateKitOptions): Promise<Result<MigrateKitResult, MigrateKitError>>;
41
- /**
42
- * Print migrate-kit results.
43
- */
44
- declare function printMigrateKitResults(result: MigrateKitResult, options?: {
45
- mode?: OutputMode;
46
- }): Promise<void>;
47
- /**
48
- * Register `migrate kit` command directly on Commander.
49
- *
50
- * @deprecated Use action-registry CLI wiring via `buildCliCommands(outfitterActions, ...)`.
51
- */
52
- declare function migrateKitCommand(program: Command): void;
53
- export { MigrateKitOptions, MigrateKitResult, MigrateKitError, runMigrateKit, printMigrateKitResults, migrateKitCommand };
@@ -1,6 +0,0 @@
1
- declare function deriveProjectName(packageName: string): string;
2
- declare function deriveBinName(projectName: string): string;
3
- declare function resolveAuthor(): string;
4
- declare function resolveYear(): string;
5
- declare function resolvePackageName(targetDir: string, name?: string): string;
6
- export { deriveProjectName, deriveBinName, resolveAuthor, resolveYear, resolvePackageName };
@@ -1,133 +0,0 @@
1
- import { OutputMode } from "@outfitter/cli/types";
2
- import { Command } from "commander";
3
- /**
4
- * Options for the doctor command.
5
- */
6
- interface DoctorOptions {
7
- /** Working directory to check (defaults to cwd) */
8
- readonly cwd: string;
9
- }
10
- /**
11
- * Result of a single health check.
12
- */
13
- interface CheckResult {
14
- /** Whether the check passed */
15
- readonly passed: boolean;
16
- /** Error message if check failed */
17
- readonly error?: string;
18
- }
19
- /**
20
- * Bun version check result.
21
- */
22
- interface BunVersionCheck extends CheckResult {
23
- /** Current Bun version */
24
- readonly version: string;
25
- /** Required minimum version */
26
- readonly required: string;
27
- }
28
- /**
29
- * Package.json validation result.
30
- */
31
- interface PackageJsonCheck extends CheckResult {
32
- /** Package name if found */
33
- readonly name?: string;
34
- /** Package version if found */
35
- readonly version?: string;
36
- }
37
- /**
38
- * Dependencies check result.
39
- */
40
- interface DependenciesCheck extends CheckResult {
41
- /** Number of dependencies found */
42
- readonly count?: number;
43
- /** Missing dependencies if any */
44
- readonly missing?: readonly string[];
45
- }
46
- /**
47
- * Config files check result.
48
- */
49
- interface ConfigFilesCheck {
50
- /** Whether tsconfig.json exists */
51
- readonly tsconfig: boolean;
52
- /** Whether biome.json exists */
53
- readonly biome?: boolean;
54
- }
55
- /**
56
- * Directories check result.
57
- */
58
- interface DirectoriesCheck {
59
- /** Whether src directory exists */
60
- readonly src: boolean;
61
- /** Whether tests directory exists */
62
- readonly tests?: boolean;
63
- }
64
- /**
65
- * Summary of all checks.
66
- */
67
- interface DoctorSummary {
68
- /** Number of passed checks */
69
- readonly passed: number;
70
- /** Number of failed checks */
71
- readonly failed: number;
72
- /** Total number of checks */
73
- readonly total: number;
74
- }
75
- /**
76
- * Complete doctor result.
77
- */
78
- interface DoctorResult {
79
- /** Individual check results */
80
- readonly checks: {
81
- readonly bunVersion: BunVersionCheck;
82
- readonly packageJson: PackageJsonCheck;
83
- readonly dependencies: DependenciesCheck;
84
- readonly configFiles: ConfigFilesCheck;
85
- readonly directories: DirectoriesCheck;
86
- };
87
- /** Summary of all checks */
88
- readonly summary: DoctorSummary;
89
- /** Exit code (0 = all passed, 1 = some failed) */
90
- readonly exitCode: number;
91
- }
92
- /**
93
- * Runs the doctor command programmatically.
94
- *
95
- * @param options - Doctor options
96
- * @returns Doctor result with all check results
97
- *
98
- * @example
99
- * ```typescript
100
- * const result = await runDoctor({ cwd: process.cwd() });
101
- *
102
- * if (result.exitCode === 0) {
103
- * console.log("All checks passed!");
104
- * } else {
105
- * console.log(`${result.summary.failed} checks failed`);
106
- * }
107
- * ```
108
- */
109
- declare function runDoctor(options: DoctorOptions): DoctorResult;
110
- /**
111
- * Formats and outputs doctor results.
112
- */
113
- declare function printDoctorResults(result: DoctorResult, options?: {
114
- mode?: OutputMode;
115
- }): Promise<void>;
116
- /**
117
- * Registers the doctor command with the CLI program.
118
- *
119
- * @deprecated Use action-registry CLI wiring via `buildCliCommands(outfitterActions, ...)`.
120
- *
121
- * @param program - Commander program instance
122
- *
123
- * @example
124
- * ```typescript
125
- * import { Command } from "commander";
126
- * import { doctorCommand } from "./commands/doctor.js";
127
- *
128
- * const program = new Command();
129
- * doctorCommand(program);
130
- * ```
131
- */
132
- declare function doctorCommand(program: Command): void;
133
- export { DoctorOptions, CheckResult, BunVersionCheck, PackageJsonCheck, DependenciesCheck, ConfigFilesCheck, DirectoriesCheck, DoctorSummary, DoctorResult, runDoctor, printDoctorResults, doctorCommand };
@@ -1,42 +0,0 @@
1
- // @bun
2
- // apps/outfitter/src/engine/names.ts
3
- import { basename } from "path";
4
- function deriveProjectName(packageName) {
5
- const trimmed = packageName.trim();
6
- if (!trimmed.startsWith("@")) {
7
- return trimmed;
8
- }
9
- const scopeSeparator = trimmed.indexOf("/");
10
- if (scopeSeparator < 0) {
11
- return trimmed;
12
- }
13
- return trimmed.slice(scopeSeparator + 1).trim();
14
- }
15
- function deriveBinName(projectName) {
16
- return projectName.toLowerCase().replace(/\s+/g, "-");
17
- }
18
- function resolveAuthor() {
19
- const fromEnv = process.env["GIT_AUTHOR_NAME"] ?? process.env["GIT_COMMITTER_NAME"] ?? process.env["AUTHOR"] ?? process.env["USER"] ?? process.env["USERNAME"];
20
- if (fromEnv) {
21
- return fromEnv;
22
- }
23
- try {
24
- const result = Bun.spawnSync(["git", "config", "--get", "user.name"], {
25
- stdout: "pipe",
26
- stderr: "ignore"
27
- });
28
- if (result.exitCode === 0) {
29
- const value = result.stdout.toString().trim();
30
- return value.length > 0 ? value : "";
31
- }
32
- } catch {}
33
- return "";
34
- }
35
- function resolveYear() {
36
- return String(new Date().getFullYear());
37
- }
38
- function resolvePackageName(targetDir, name) {
39
- return name ?? basename(targetDir);
40
- }
41
-
42
- export { deriveProjectName, deriveBinName, resolveAuthor, resolveYear, resolvePackageName };
@@ -1,66 +0,0 @@
1
- import { AddBlockResult } from "@outfitter/tooling";
2
- /**
3
- * Unified placeholder values for template substitution.
4
- */
5
- interface PlaceholderValues {
6
- readonly name: string;
7
- readonly projectName: string;
8
- readonly packageName: string;
9
- readonly binName: string;
10
- readonly version: string;
11
- readonly description: string;
12
- readonly author: string;
13
- readonly year: string;
14
- }
15
- /**
16
- * A single change operation in a scaffold plan.
17
- */
18
- type ScaffoldChange = {
19
- readonly type: "copy-template";
20
- readonly template: string;
21
- readonly targetDir: string;
22
- readonly overlayBaseTemplate: boolean;
23
- } | {
24
- readonly type: "inject-shared-config";
25
- } | {
26
- readonly type: "rewrite-local-dependencies";
27
- readonly mode: "workspace";
28
- } | {
29
- readonly type: "add-blocks";
30
- readonly blocks: readonly string[];
31
- };
32
- /**
33
- * A complete scaffold plan.
34
- */
35
- interface ScaffoldPlan {
36
- readonly values: PlaceholderValues;
37
- readonly changes: readonly ScaffoldChange[];
38
- }
39
- /**
40
- * Result of executing a scaffold plan.
41
- */
42
- interface ScaffoldResult {
43
- readonly projectDir: string;
44
- readonly blocksAdded?: AddBlockResult | undefined;
45
- }
46
- /**
47
- * Dry-run collector support.
48
- */
49
- interface EngineCollector {
50
- add(op: unknown): void;
51
- }
52
- /**
53
- * Shared options used by engine functions.
54
- */
55
- interface EngineOptions {
56
- readonly force: boolean;
57
- readonly collector?: EngineCollector | undefined;
58
- }
59
- /**
60
- * Unified error type for engine operations.
61
- */
62
- declare class ScaffoldError extends Error {
63
- readonly _tag: "ScaffoldError";
64
- constructor(message: string);
65
- }
66
- export { PlaceholderValues, ScaffoldChange, ScaffoldPlan, ScaffoldResult, EngineCollector, EngineOptions, ScaffoldError };