outfitter 0.2.6 → 0.2.7
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 +52 -26
- package/dist/actions.d.ts +1 -1
- package/dist/actions.js +20 -19
- package/dist/cli.js +3 -2
- package/dist/commands/add.d.ts +4 -4
- package/dist/commands/check-tsdoc.d.ts +22 -0
- package/dist/commands/check-tsdoc.js +8 -0
- package/dist/commands/check.d.ts +12 -12
- package/dist/commands/check.js +1 -1
- package/dist/commands/demo.d.ts +3 -3
- package/dist/commands/docs-module-loader.d.ts +1 -1
- package/dist/commands/doctor.d.ts +2 -2
- package/dist/commands/doctor.js +13 -1
- package/dist/commands/init.d.ts +6 -6
- package/dist/commands/init.js +12 -11
- package/dist/commands/repo.d.ts +2 -2
- package/dist/commands/scaffold.d.ts +3 -3
- package/dist/commands/scaffold.js +12 -11
- package/dist/commands/shared-deps.d.ts +1 -16
- package/dist/commands/shared-deps.js +2 -1
- package/dist/commands/upgrade-codemods.d.ts +4 -4
- package/dist/commands/upgrade-codemods.js +2 -2
- package/dist/commands/upgrade-planner.d.ts +6 -6
- package/dist/commands/upgrade-workspace.d.ts +1 -75
- package/dist/commands/upgrade.d.ts +66 -59
- package/dist/commands/upgrade.js +2 -2
- package/dist/create/index.d.ts +4 -4
- package/dist/create/index.js +13 -12
- package/dist/create/planner.d.ts +2 -2
- package/dist/create/planner.js +9 -8
- package/dist/create/presets.d.ts +2 -2
- package/dist/create/types.d.ts +1 -1
- package/dist/engine/blocks.d.ts +2 -2
- package/dist/engine/blocks.js +1 -1
- package/dist/engine/collector.d.ts +1 -1
- package/dist/engine/config.d.ts +2 -2
- package/dist/engine/config.js +5 -2
- package/dist/engine/dependency-versions.d.ts +12 -0
- package/dist/engine/dependency-versions.js +12 -0
- package/dist/engine/executor.d.ts +2 -2
- package/dist/engine/executor.js +7 -4
- package/dist/engine/index.d.ts +8 -8
- package/dist/engine/index.js +28 -19
- package/dist/engine/names.d.ts +2 -2
- package/dist/engine/names.js +10 -2
- package/dist/engine/post-scaffold.d.ts +2 -2
- package/dist/engine/render-plan.d.ts +1 -1
- package/dist/engine/template.d.ts +2 -2
- package/dist/engine/types.d.ts +1 -1
- package/dist/engine/workspace.d.ts +3 -3
- package/dist/engine/workspace.js +8 -1
- package/dist/index.d.ts +93 -132
- package/dist/index.js +1 -9
- package/dist/manifest.d.ts +4 -4
- package/dist/output-mode.d.ts +1 -1
- package/dist/shared/{chunk-k59f60cp.js → chunk-x6644tk8.js} +3017 -2520
- package/dist/shared/outfitter-109s75x0.d.ts +76 -0
- package/dist/shared/{outfitter-2np85etz.js → outfitter-1fy7byz5.js} +76 -1
- package/dist/shared/outfitter-20f6a2n4.js +35 -0
- package/dist/shared/outfitter-4q1zfmvc.js +154 -0
- package/dist/shared/{outfitter-66b25bj8.js → outfitter-5akzvppx.js} +4 -4
- package/dist/shared/outfitter-5y646xzk.js +301 -0
- package/dist/shared/{outfitter-j8yc7294.d.ts → outfitter-5yjr404v.d.ts} +4 -4
- package/dist/shared/outfitter-63gse8fv.js +316 -0
- package/dist/shared/{outfitter-rdc5v5ms.js → outfitter-7ch26yq8.js} +210 -71
- package/dist/shared/{outfitter-ksa1pp4t.d.ts → outfitter-dpj9erew.d.ts} +1 -1
- package/dist/shared/{outfitter-sgtq57qr.d.ts → outfitter-f9znfhkn.d.ts} +1 -1
- package/dist/shared/outfitter-fhnjpjwc.d.ts +18 -0
- package/dist/shared/{outfitter-193jvzg4.d.ts → outfitter-fn20r49x.d.ts} +1 -1
- package/dist/shared/{outfitter-cwq39bv4.d.ts → outfitter-h3q6ae6d.d.ts} +17 -17
- package/dist/shared/outfitter-ha89qf8q.js +132 -0
- package/dist/shared/{outfitter-pyy1zkfh.d.ts → outfitter-hsp8vy5m.d.ts} +25 -12
- package/dist/shared/outfitter-m3ehh37q.d.ts +22 -0
- package/dist/shared/outfitter-m44n0qzw.js +161 -0
- package/dist/shared/{outfitter-qn864k6h.js → outfitter-mt7d1ek2.js} +152 -35
- package/dist/shared/{outfitter-avhm5z6w.js → outfitter-p71qb0f0.js} +4 -4
- package/dist/shared/{outfitter-9zqc2njf.js → outfitter-pcj9gg2g.js} +90 -40
- package/dist/shared/{outfitter-hws10ze7.js → outfitter-pj9vp00r.js} +87 -18
- package/dist/shared/{outfitter-gdvm5c0b.d.ts → outfitter-qakwgrrh.d.ts} +1 -1
- package/dist/shared/{outfitter-k56rmt24.d.ts → outfitter-r419zfgs.d.ts} +6 -6
- package/dist/shared/{outfitter-33w361tc.d.ts → outfitter-s7jetkge.d.ts} +1 -1
- package/dist/shared/{outfitter-1dvma85c.js → outfitter-w1j80j1r.js} +4 -0
- package/dist/shared/{outfitter-1dd0k853.js → outfitter-xe5mzgdc.js} +21 -7
- package/dist/shared/{outfitter-h1mnzzd1.d.ts → outfitter-ybbazsxq.d.ts} +1 -1
- package/dist/shared/{outfitter-2ngep1h2.d.ts → outfitter-yraebrmw.d.ts} +1 -1
- package/dist/shared/{outfitter-bkwpbkr9.d.ts → outfitter-z0we32cp.d.ts} +21 -21
- package/dist/shared/{outfitter-3weh61w7.d.ts → outfitter-z5sx06qe.d.ts} +12 -12
- package/dist/targets/index.d.ts +3 -3
- package/dist/targets/index.js +1 -1
- package/dist/targets/registry.d.ts +2 -2
- package/dist/targets/registry.js +1 -1
- package/dist/targets/types.d.ts +1 -1
- package/package.json +29 -19
- package/template-versions.json +22 -0
- package/templates/basic/package.json.template +6 -6
- package/templates/cli/biome.json.template +1 -1
- package/templates/cli/package.json.template +17 -9
- package/templates/daemon/biome.json.template +1 -1
- package/templates/daemon/package.json.template +18 -10
- package/templates/full-stack/.gitignore.template +30 -0
- package/templates/full-stack/README.md.template +30 -0
- package/templates/full-stack/apps/cli/package.json.template +39 -0
- package/templates/full-stack/apps/cli/src/cli.ts.template +24 -0
- package/templates/full-stack/apps/cli/src/index.test.ts.template +18 -0
- package/templates/full-stack/apps/cli/src/index.ts.template +5 -0
- package/templates/full-stack/apps/cli/tsconfig.json.template +37 -0
- package/templates/full-stack/apps/mcp/package.json.template +40 -0
- package/templates/full-stack/apps/mcp/src/index.test.ts.template +18 -0
- package/templates/full-stack/apps/mcp/src/index.ts.template +6 -0
- package/templates/full-stack/apps/mcp/src/mcp.ts.template +22 -0
- package/templates/full-stack/apps/mcp/src/server.ts.template +10 -0
- package/templates/full-stack/apps/mcp/tsconfig.json.template +37 -0
- package/templates/full-stack/package.json.template +16 -0
- package/templates/full-stack/packages/core/package.json.template +36 -0
- package/templates/full-stack/packages/core/src/handlers.ts.template +31 -0
- package/templates/full-stack/packages/core/src/index.test.ts.template +30 -0
- package/templates/full-stack/packages/core/src/index.ts.template +8 -0
- package/templates/full-stack/packages/core/src/types.ts.template +13 -0
- package/templates/full-stack/packages/core/tsconfig.json.template +34 -0
- package/templates/library/.gitignore.template +30 -0
- package/templates/library/README.md.template +29 -0
- package/templates/library/bunup.config.ts.template +20 -0
- package/templates/library/package.json.template +55 -0
- package/templates/library/src/handlers.ts.template +31 -0
- package/templates/library/src/index.test.ts.template +35 -0
- package/templates/library/src/index.ts.template +8 -0
- package/templates/library/src/types.ts.template +13 -0
- package/templates/library/tsconfig.json.template +34 -0
- package/templates/mcp/biome.json.template +1 -1
- package/templates/mcp/package.json.template +17 -9
- package/templates/mcp/src/index.ts.template +1 -1
- package/templates/mcp/src/mcp.ts.template +28 -74
- package/templates/mcp/src/server.ts.template +2 -9
- package/templates/minimal/package.json.template +13 -6
- package/dist/commands/migrate-kit.d.ts +0 -2
- package/dist/commands/migrate-kit.js +0 -15
- package/dist/shared/outfitter-7ha7p61k.d.ts +0 -6
- package/dist/shared/outfitter-ara3djt0.js +0 -73
- package/dist/shared/outfitter-d7pq7d0k.js +0 -196
- package/dist/shared/outfitter-k112c427.js +0 -21
- 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-q9agarmb.js +0 -42
- package/dist/shared/{outfitter-dd0btgec.d.ts → outfitter-6fgk6adm.d.ts} +5 -5
- package/dist/shared/{outfitter-e2zz5wv7.d.ts → outfitter-e9rrfekb.d.ts} +8 -8
- package/dist/shared/{outfitter-qfh36ddg.d.ts → outfitter-n9g1zk4x.d.ts} +7 -7
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
resolveStructuredOutputMode
|
|
4
|
-
} from "./outfitter-7r12fj7f.js";
|
|
5
|
-
|
|
6
|
-
// apps/outfitter/src/commands/doctor.ts
|
|
7
|
-
import { existsSync, readFileSync } from "fs";
|
|
8
|
-
import { join, resolve } from "path";
|
|
9
|
-
import { output } from "@outfitter/cli";
|
|
10
|
-
import { createTheme } from "@outfitter/tui/render";
|
|
11
|
-
var MIN_BUN_VERSION = "1.3.6";
|
|
12
|
-
function checkBunVersion() {
|
|
13
|
-
const required = MIN_BUN_VERSION;
|
|
14
|
-
const current = Bun.version;
|
|
15
|
-
const passed = Bun.semver.satisfies(current, `>=${required}`);
|
|
16
|
-
return {
|
|
17
|
-
passed,
|
|
18
|
-
version: current,
|
|
19
|
-
required,
|
|
20
|
-
...passed ? {} : {
|
|
21
|
-
error: `Bun version ${current} is below minimum required ${required}`
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function checkPackageJson(cwd) {
|
|
26
|
-
const packageJsonPath = join(cwd, "package.json");
|
|
27
|
-
if (!existsSync(packageJsonPath)) {
|
|
28
|
-
return {
|
|
29
|
-
passed: false,
|
|
30
|
-
error: "package.json not found in current directory"
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
const content = readFileSync(packageJsonPath, "utf-8");
|
|
35
|
-
const parsed = JSON.parse(content);
|
|
36
|
-
if (typeof parsed["name"] !== "string" || parsed["name"].length === 0) {
|
|
37
|
-
return {
|
|
38
|
-
passed: false,
|
|
39
|
-
error: "package.json is missing required 'name' field"
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
if (typeof parsed["version"] !== "string" || parsed["version"].length === 0) {
|
|
43
|
-
return {
|
|
44
|
-
passed: false,
|
|
45
|
-
error: "package.json is missing required 'version' field"
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
passed: true,
|
|
50
|
-
name: parsed["name"],
|
|
51
|
-
version: parsed["version"]
|
|
52
|
-
};
|
|
53
|
-
} catch (error) {
|
|
54
|
-
const message = error instanceof Error ? error.message : "Unknown error";
|
|
55
|
-
return {
|
|
56
|
-
passed: false,
|
|
57
|
-
error: `package.json is invalid JSON: ${message}`
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function checkDependencies(cwd) {
|
|
62
|
-
const packageJsonPath = join(cwd, "package.json");
|
|
63
|
-
if (!existsSync(packageJsonPath)) {
|
|
64
|
-
return { passed: true, count: 0 };
|
|
65
|
-
}
|
|
66
|
-
try {
|
|
67
|
-
const content = readFileSync(packageJsonPath, "utf-8");
|
|
68
|
-
const parsed = JSON.parse(content);
|
|
69
|
-
const dependencies = parsed["dependencies"];
|
|
70
|
-
const devDependencies = parsed["devDependencies"];
|
|
71
|
-
const allDeps = [
|
|
72
|
-
...Object.keys(dependencies ?? {}),
|
|
73
|
-
...Object.keys(devDependencies ?? {})
|
|
74
|
-
];
|
|
75
|
-
if (allDeps.length === 0) {
|
|
76
|
-
return { passed: true, count: 0 };
|
|
77
|
-
}
|
|
78
|
-
const nodeModulesPath = join(cwd, "node_modules");
|
|
79
|
-
if (!existsSync(nodeModulesPath)) {
|
|
80
|
-
return {
|
|
81
|
-
passed: false,
|
|
82
|
-
count: allDeps.length,
|
|
83
|
-
error: "node_modules not found. Run 'bun install' to install dependencies."
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
const missing = [];
|
|
87
|
-
for (const dep of allDeps) {
|
|
88
|
-
const depPath = join(nodeModulesPath, dep);
|
|
89
|
-
if (!existsSync(depPath)) {
|
|
90
|
-
missing.push(dep);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (missing.length > 0) {
|
|
94
|
-
return {
|
|
95
|
-
passed: false,
|
|
96
|
-
count: allDeps.length,
|
|
97
|
-
missing,
|
|
98
|
-
error: `Missing dependencies: ${missing.join(", ")}. Run 'bun install' to install.`
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
return { passed: true, count: allDeps.length };
|
|
102
|
-
} catch {
|
|
103
|
-
return { passed: true, count: 0 };
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function checkConfigFiles(cwd) {
|
|
107
|
-
return {
|
|
108
|
-
tsconfig: existsSync(join(cwd, "tsconfig.json")),
|
|
109
|
-
biome: existsSync(join(cwd, "biome.json"))
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
function checkDirectories(cwd) {
|
|
113
|
-
return {
|
|
114
|
-
src: existsSync(join(cwd, "src")),
|
|
115
|
-
tests: existsSync(join(cwd, "src", "__tests__")) || existsSync(join(cwd, "tests"))
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
function runDoctor(options) {
|
|
119
|
-
const cwd = resolve(options.cwd);
|
|
120
|
-
const bunVersion = checkBunVersion();
|
|
121
|
-
const packageJson = checkPackageJson(cwd);
|
|
122
|
-
const dependencies = checkDependencies(cwd);
|
|
123
|
-
const configFiles = checkConfigFiles(cwd);
|
|
124
|
-
const directories = checkDirectories(cwd);
|
|
125
|
-
const checkResults = [
|
|
126
|
-
bunVersion.passed,
|
|
127
|
-
packageJson.passed,
|
|
128
|
-
dependencies.passed,
|
|
129
|
-
configFiles.tsconfig,
|
|
130
|
-
directories.src
|
|
131
|
-
];
|
|
132
|
-
const passed = checkResults.filter(Boolean).length;
|
|
133
|
-
const failed = checkResults.length - passed;
|
|
134
|
-
const total = checkResults.length;
|
|
135
|
-
return {
|
|
136
|
-
checks: {
|
|
137
|
-
bunVersion,
|
|
138
|
-
packageJson,
|
|
139
|
-
dependencies,
|
|
140
|
-
configFiles,
|
|
141
|
-
directories
|
|
142
|
-
},
|
|
143
|
-
summary: { passed, failed, total },
|
|
144
|
-
exitCode: failed > 0 ? 1 : 0
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
async function printDoctorResults(result, options) {
|
|
148
|
-
const structuredMode = resolveStructuredOutputMode(options?.mode);
|
|
149
|
-
if (structuredMode) {
|
|
150
|
-
await output(result, { mode: structuredMode });
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
const theme = createTheme();
|
|
154
|
-
const lines = ["", "Outfitter Doctor", "", "=".repeat(50)];
|
|
155
|
-
const bunIcon = result.checks.bunVersion.passed ? theme.success("[PASS]") : theme.error("[FAIL]");
|
|
156
|
-
lines.push(`${bunIcon} Bun Version: ${result.checks.bunVersion.version} (requires ${result.checks.bunVersion.required})`);
|
|
157
|
-
if (result.checks.bunVersion.error) {
|
|
158
|
-
lines.push(` ${theme.muted(result.checks.bunVersion.error)}`);
|
|
159
|
-
}
|
|
160
|
-
const pkgIcon = result.checks.packageJson.passed ? theme.success("[PASS]") : theme.error("[FAIL]");
|
|
161
|
-
lines.push(`${pkgIcon} package.json`);
|
|
162
|
-
if (result.checks.packageJson.error) {
|
|
163
|
-
lines.push(` ${theme.muted(result.checks.packageJson.error)}`);
|
|
164
|
-
} else if (result.checks.packageJson.name) {
|
|
165
|
-
lines.push(` ${theme.muted(`${result.checks.packageJson.name}@${result.checks.packageJson.version}`)}`);
|
|
166
|
-
}
|
|
167
|
-
const depsIcon = result.checks.dependencies.passed ? theme.success("[PASS]") : theme.error("[FAIL]");
|
|
168
|
-
lines.push(`${depsIcon} Dependencies`);
|
|
169
|
-
if (result.checks.dependencies.error) {
|
|
170
|
-
lines.push(` ${theme.muted(result.checks.dependencies.error)}`);
|
|
171
|
-
} else if (result.checks.dependencies.count !== undefined) {
|
|
172
|
-
lines.push(` ${theme.muted(`${result.checks.dependencies.count} dependencies installed`)}`);
|
|
173
|
-
}
|
|
174
|
-
const tsconfigIcon = result.checks.configFiles.tsconfig ? theme.success("[PASS]") : theme.warning("[WARN]");
|
|
175
|
-
lines.push(`${tsconfigIcon} tsconfig.json`);
|
|
176
|
-
const srcIcon = result.checks.directories.src ? theme.success("[PASS]") : theme.warning("[WARN]");
|
|
177
|
-
lines.push(`${srcIcon} src/ directory`);
|
|
178
|
-
lines.push("", "=".repeat(50));
|
|
179
|
-
const summaryColor = result.exitCode === 0 ? theme.success : theme.error;
|
|
180
|
-
lines.push(summaryColor(`${result.summary.passed}/${result.summary.total} checks passed`));
|
|
181
|
-
if (result.exitCode !== 0) {
|
|
182
|
-
lines.push("", theme.muted("Run 'outfitter doctor' after fixing issues to verify."));
|
|
183
|
-
}
|
|
184
|
-
await output(lines, { mode: "human" });
|
|
185
|
-
}
|
|
186
|
-
function doctorCommand(program) {
|
|
187
|
-
program.command("doctor").description("Validate environment and dependencies").action(async (_flags, command) => {
|
|
188
|
-
const resolvedFlags = command.optsWithGlobals();
|
|
189
|
-
const outputOptions = resolvedFlags.json ? { mode: "json" } : undefined;
|
|
190
|
-
const result = await runDoctor({ cwd: process.cwd() });
|
|
191
|
-
await printDoctorResults(result, outputOptions);
|
|
192
|
-
process.exit(result.exitCode);
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export { runDoctor, printDoctorResults, doctorCommand };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// apps/outfitter/src/commands/shared-deps.ts
|
|
3
|
-
var SHARED_DEV_DEPS = {
|
|
4
|
-
"@biomejs/biome": "^2.3.12",
|
|
5
|
-
"@outfitter/tooling": "^0.2.1",
|
|
6
|
-
"@types/bun": "^1.3.7",
|
|
7
|
-
lefthook: "^2.0.16",
|
|
8
|
-
typescript: "^5.9.3",
|
|
9
|
-
ultracite: "^7.1.1"
|
|
10
|
-
};
|
|
11
|
-
var SHARED_SCRIPTS = {
|
|
12
|
-
check: "ultracite check",
|
|
13
|
-
"clean:artifacts": "rm -rf dist .turbo",
|
|
14
|
-
"verify:ci": "bun run typecheck && bun run check && bun run build && bun run test",
|
|
15
|
-
lint: "biome check .",
|
|
16
|
-
"lint:fix": "biome check . --write",
|
|
17
|
-
format: "biome format --write .",
|
|
18
|
-
typecheck: "tsc --noEmit"
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { SHARED_DEV_DEPS, SHARED_SCRIPTS };
|