@geekyants/think-before 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -3
- package/dist/cli.js +159 -12
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +47 -0
- package/dist/config.js.map +1 -0
- package/dist/detect.d.ts +12 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +371 -0
- package/dist/detect.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/prompt.d.ts +6 -0
- package/dist/prompt.d.ts.map +1 -1
- package/dist/prompt.js +47 -0
- package/dist/prompt.js.map +1 -1
- package/dist/stack.d.ts +8 -0
- package/dist/stack.d.ts.map +1 -0
- package/dist/stack.js +119 -0
- package/dist/stack.js.map +1 -0
- package/dist/tui.d.ts +20 -0
- package/dist/tui.d.ts.map +1 -0
- package/dist/tui.js +327 -0
- package/dist/tui.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/detect.js
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
// Dependency → human label maps. Matched against package.json deps. These cover
|
|
4
|
+
// the common frameworks on the market; add more as needed — it degrades to
|
|
5
|
+
// "unknown" gracefully when nothing matches.
|
|
6
|
+
const FRONTEND_DEPS = {
|
|
7
|
+
react: "React",
|
|
8
|
+
"react-dom": "React",
|
|
9
|
+
vue: "Vue",
|
|
10
|
+
"@angular/core": "Angular",
|
|
11
|
+
svelte: "Svelte",
|
|
12
|
+
"solid-js": "SolidJS",
|
|
13
|
+
preact: "Preact",
|
|
14
|
+
"@stencil/core": "Stencil",
|
|
15
|
+
gatsby: "Gatsby",
|
|
16
|
+
"react-native": "React Native",
|
|
17
|
+
expo: "Expo",
|
|
18
|
+
"@ionic/react": "Ionic",
|
|
19
|
+
"@ionic/angular": "Ionic",
|
|
20
|
+
};
|
|
21
|
+
// Meta-frameworks that ship a server as well as a client → count as both.
|
|
22
|
+
const FULLSTACK_DEPS = {
|
|
23
|
+
next: "Next.js",
|
|
24
|
+
nuxt: "Nuxt",
|
|
25
|
+
"@remix-run/react": "Remix",
|
|
26
|
+
"@remix-run/node": "Remix",
|
|
27
|
+
"@sveltejs/kit": "SvelteKit",
|
|
28
|
+
astro: "Astro",
|
|
29
|
+
};
|
|
30
|
+
const BACKEND_DEPS = {
|
|
31
|
+
express: "Express",
|
|
32
|
+
koa: "Koa",
|
|
33
|
+
fastify: "Fastify",
|
|
34
|
+
"@nestjs/core": "NestJS",
|
|
35
|
+
"@hapi/hapi": "hapi",
|
|
36
|
+
hapi: "hapi",
|
|
37
|
+
restify: "Restify",
|
|
38
|
+
"@apollo/server": "Apollo Server",
|
|
39
|
+
"apollo-server": "Apollo Server",
|
|
40
|
+
"@trpc/server": "tRPC",
|
|
41
|
+
"socket.io": "Socket.IO",
|
|
42
|
+
};
|
|
43
|
+
const DB_DEPS = new Set([
|
|
44
|
+
"prisma", "@prisma/client", "typeorm", "sequelize", "mongoose", "knex",
|
|
45
|
+
"drizzle-orm", "@mikro-orm/core", "pg", "mysql", "mysql2", "mongodb",
|
|
46
|
+
"redis", "ioredis", "better-sqlite3",
|
|
47
|
+
]);
|
|
48
|
+
const TEST_DEPS = new Set([
|
|
49
|
+
"jest", "vitest", "mocha", "@playwright/test", "cypress", "ava", "jasmine",
|
|
50
|
+
"supertest", "@testing-library/react", "@testing-library/vue",
|
|
51
|
+
]);
|
|
52
|
+
function readJson(p) {
|
|
53
|
+
try {
|
|
54
|
+
return JSON.parse(fs.readFileSync(p, "utf8"));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function readText(p) {
|
|
61
|
+
try {
|
|
62
|
+
return fs.readFileSync(p, "utf8");
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function exists(p) {
|
|
69
|
+
try {
|
|
70
|
+
fs.accessSync(p);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** A friendly label for a project kind. */
|
|
78
|
+
export function kindLabel(kind) {
|
|
79
|
+
switch (kind) {
|
|
80
|
+
case "fullstack":
|
|
81
|
+
return "full-stack";
|
|
82
|
+
case "frontend":
|
|
83
|
+
return "frontend";
|
|
84
|
+
case "backend":
|
|
85
|
+
return "backend";
|
|
86
|
+
default:
|
|
87
|
+
return "unknown";
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Scan a directory for common framework/tooling signals and classify it as
|
|
92
|
+
* frontend, backend, full-stack, or unknown. Read-only and quick: it reads a
|
|
93
|
+
* handful of manifest files and checks for a few marker folders. Never throws.
|
|
94
|
+
*/
|
|
95
|
+
export function detectProject(root = process.cwd()) {
|
|
96
|
+
const signals = new Set();
|
|
97
|
+
const frameworks = new Set();
|
|
98
|
+
let hasFrontend = false;
|
|
99
|
+
let hasBackend = false;
|
|
100
|
+
let hasDatabase = false;
|
|
101
|
+
let hasTests = false;
|
|
102
|
+
let hasDocker = false;
|
|
103
|
+
let isMonorepo = false;
|
|
104
|
+
const collectDeps = (pkg) => {
|
|
105
|
+
if (!pkg)
|
|
106
|
+
return;
|
|
107
|
+
const deps = {
|
|
108
|
+
...pkg["dependencies"],
|
|
109
|
+
...pkg["devDependencies"],
|
|
110
|
+
...pkg["peerDependencies"],
|
|
111
|
+
...pkg["optionalDependencies"],
|
|
112
|
+
};
|
|
113
|
+
for (const name of Object.keys(deps)) {
|
|
114
|
+
const fe = FRONTEND_DEPS[name];
|
|
115
|
+
if (fe) {
|
|
116
|
+
hasFrontend = true;
|
|
117
|
+
frameworks.add(fe);
|
|
118
|
+
}
|
|
119
|
+
const fs2 = FULLSTACK_DEPS[name];
|
|
120
|
+
if (fs2) {
|
|
121
|
+
hasFrontend = true;
|
|
122
|
+
hasBackend = true;
|
|
123
|
+
frameworks.add(fs2);
|
|
124
|
+
}
|
|
125
|
+
const be = BACKEND_DEPS[name];
|
|
126
|
+
if (be) {
|
|
127
|
+
hasBackend = true;
|
|
128
|
+
frameworks.add(be);
|
|
129
|
+
}
|
|
130
|
+
if (DB_DEPS.has(name))
|
|
131
|
+
hasDatabase = true;
|
|
132
|
+
if (TEST_DEPS.has(name))
|
|
133
|
+
hasTests = true;
|
|
134
|
+
}
|
|
135
|
+
if (pkg["workspaces"])
|
|
136
|
+
isMonorepo = true;
|
|
137
|
+
};
|
|
138
|
+
// --- Node / JS ecosystem ---
|
|
139
|
+
const rootPkg = readJson(path.join(root, "package.json"));
|
|
140
|
+
if (rootPkg) {
|
|
141
|
+
signals.add("package.json");
|
|
142
|
+
collectDeps(rootPkg);
|
|
143
|
+
}
|
|
144
|
+
for (const m of ["pnpm-workspace.yaml", "lerna.json", "turbo.json", "nx.json"]) {
|
|
145
|
+
if (exists(path.join(root, m))) {
|
|
146
|
+
isMonorepo = true;
|
|
147
|
+
signals.add(m);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// In a monorepo, peek one level into the usual group folders.
|
|
151
|
+
if (isMonorepo || exists(path.join(root, "apps")) || exists(path.join(root, "packages"))) {
|
|
152
|
+
for (const group of ["apps", "packages", "services"]) {
|
|
153
|
+
const gp = path.join(root, group);
|
|
154
|
+
if (!exists(gp))
|
|
155
|
+
continue;
|
|
156
|
+
let entries = [];
|
|
157
|
+
try {
|
|
158
|
+
entries = fs.readdirSync(gp);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
entries = [];
|
|
162
|
+
}
|
|
163
|
+
for (const entry of entries.slice(0, 30)) {
|
|
164
|
+
collectDeps(readJson(path.join(gp, entry, "package.json")));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// --- Python ---
|
|
169
|
+
const py = [
|
|
170
|
+
readText(path.join(root, "requirements.txt")),
|
|
171
|
+
readText(path.join(root, "pyproject.toml")),
|
|
172
|
+
readText(path.join(root, "Pipfile")),
|
|
173
|
+
].join("\n").toLowerCase();
|
|
174
|
+
if (py.trim()) {
|
|
175
|
+
signals.add("python deps");
|
|
176
|
+
let matched = false;
|
|
177
|
+
if (py.includes("django")) {
|
|
178
|
+
hasBackend = true;
|
|
179
|
+
frameworks.add("Django");
|
|
180
|
+
matched = true;
|
|
181
|
+
}
|
|
182
|
+
if (py.includes("flask")) {
|
|
183
|
+
hasBackend = true;
|
|
184
|
+
frameworks.add("Flask");
|
|
185
|
+
matched = true;
|
|
186
|
+
}
|
|
187
|
+
if (py.includes("fastapi")) {
|
|
188
|
+
hasBackend = true;
|
|
189
|
+
frameworks.add("FastAPI");
|
|
190
|
+
matched = true;
|
|
191
|
+
}
|
|
192
|
+
if (!matched) {
|
|
193
|
+
hasBackend = true;
|
|
194
|
+
frameworks.add("Python");
|
|
195
|
+
}
|
|
196
|
+
if (py.includes("pytest"))
|
|
197
|
+
hasTests = true;
|
|
198
|
+
}
|
|
199
|
+
if (exists(path.join(root, "manage.py"))) {
|
|
200
|
+
hasBackend = true;
|
|
201
|
+
frameworks.add("Django");
|
|
202
|
+
signals.add("manage.py");
|
|
203
|
+
}
|
|
204
|
+
// --- PHP ---
|
|
205
|
+
const composer = readJson(path.join(root, "composer.json"));
|
|
206
|
+
if (composer) {
|
|
207
|
+
signals.add("composer.json");
|
|
208
|
+
hasBackend = true;
|
|
209
|
+
const req = {
|
|
210
|
+
...composer["require"],
|
|
211
|
+
...composer["require-dev"],
|
|
212
|
+
};
|
|
213
|
+
const keys = Object.keys(req).join(" ").toLowerCase();
|
|
214
|
+
if (keys.includes("laravel/framework"))
|
|
215
|
+
frameworks.add("Laravel");
|
|
216
|
+
else if (keys.includes("symfony/"))
|
|
217
|
+
frameworks.add("Symfony");
|
|
218
|
+
else
|
|
219
|
+
frameworks.add("PHP");
|
|
220
|
+
if (keys.includes("phpunit"))
|
|
221
|
+
hasTests = true;
|
|
222
|
+
}
|
|
223
|
+
// --- Ruby ---
|
|
224
|
+
const gemfile = readText(path.join(root, "Gemfile")).toLowerCase();
|
|
225
|
+
if (gemfile.trim()) {
|
|
226
|
+
signals.add("Gemfile");
|
|
227
|
+
hasBackend = true;
|
|
228
|
+
if (gemfile.includes("rails"))
|
|
229
|
+
frameworks.add("Rails");
|
|
230
|
+
else
|
|
231
|
+
frameworks.add("Ruby");
|
|
232
|
+
if (gemfile.includes("rspec") || gemfile.includes("minitest"))
|
|
233
|
+
hasTests = true;
|
|
234
|
+
}
|
|
235
|
+
// --- Go ---
|
|
236
|
+
const gomod = readText(path.join(root, "go.mod")).toLowerCase();
|
|
237
|
+
if (gomod.trim()) {
|
|
238
|
+
signals.add("go.mod");
|
|
239
|
+
hasBackend = true;
|
|
240
|
+
if (gomod.includes("gin-gonic"))
|
|
241
|
+
frameworks.add("Gin");
|
|
242
|
+
else if (gomod.includes("labstack/echo"))
|
|
243
|
+
frameworks.add("Echo");
|
|
244
|
+
else if (gomod.includes("gofiber/fiber"))
|
|
245
|
+
frameworks.add("Fiber");
|
|
246
|
+
else if (gomod.includes("go-chi/chi"))
|
|
247
|
+
frameworks.add("chi");
|
|
248
|
+
else
|
|
249
|
+
frameworks.add("Go");
|
|
250
|
+
}
|
|
251
|
+
// --- Java / Kotlin ---
|
|
252
|
+
const jvm = (readText(path.join(root, "pom.xml")) +
|
|
253
|
+
readText(path.join(root, "build.gradle")) +
|
|
254
|
+
readText(path.join(root, "build.gradle.kts"))).toLowerCase();
|
|
255
|
+
if (jvm.trim()) {
|
|
256
|
+
signals.add(jvm.includes("<project") ? "pom.xml" : "build.gradle");
|
|
257
|
+
hasBackend = true;
|
|
258
|
+
if (jvm.includes("spring-boot") || jvm.includes("springframework"))
|
|
259
|
+
frameworks.add("Spring Boot");
|
|
260
|
+
else if (jvm.includes("ktor"))
|
|
261
|
+
frameworks.add("Ktor");
|
|
262
|
+
else
|
|
263
|
+
frameworks.add("JVM");
|
|
264
|
+
}
|
|
265
|
+
// --- Rust ---
|
|
266
|
+
const cargo = readText(path.join(root, "Cargo.toml")).toLowerCase();
|
|
267
|
+
if (cargo.trim()) {
|
|
268
|
+
signals.add("Cargo.toml");
|
|
269
|
+
hasBackend = true;
|
|
270
|
+
if (cargo.includes("actix-web"))
|
|
271
|
+
frameworks.add("Actix");
|
|
272
|
+
else if (cargo.includes("axum"))
|
|
273
|
+
frameworks.add("Axum");
|
|
274
|
+
else if (cargo.includes("rocket"))
|
|
275
|
+
frameworks.add("Rocket");
|
|
276
|
+
else
|
|
277
|
+
frameworks.add("Rust");
|
|
278
|
+
}
|
|
279
|
+
// --- .NET ---
|
|
280
|
+
try {
|
|
281
|
+
if (fs.readdirSync(root).some((f) => f.endsWith(".csproj") || f.endsWith(".sln"))) {
|
|
282
|
+
hasBackend = true;
|
|
283
|
+
frameworks.add(".NET");
|
|
284
|
+
signals.add(".csproj");
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
catch {
|
|
288
|
+
/* ignore unreadable dir */
|
|
289
|
+
}
|
|
290
|
+
// --- Frontend file/folder heuristics ---
|
|
291
|
+
const feMarkers = [
|
|
292
|
+
["angular.json", "Angular"],
|
|
293
|
+
["next.config.js", "Next.js"],
|
|
294
|
+
["next.config.mjs", "Next.js"],
|
|
295
|
+
["next.config.ts", "Next.js"],
|
|
296
|
+
["nuxt.config.ts", "Nuxt"],
|
|
297
|
+
["svelte.config.js", "Svelte"],
|
|
298
|
+
["vite.config.ts", "Vite"],
|
|
299
|
+
["vite.config.js", "Vite"],
|
|
300
|
+
["tailwind.config.js", "Tailwind"],
|
|
301
|
+
["tailwind.config.ts", "Tailwind"],
|
|
302
|
+
["astro.config.mjs", "Astro"],
|
|
303
|
+
];
|
|
304
|
+
for (const [file, label] of feMarkers) {
|
|
305
|
+
if (exists(path.join(root, file))) {
|
|
306
|
+
hasFrontend = true;
|
|
307
|
+
frameworks.add(label);
|
|
308
|
+
signals.add(file);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (exists(path.join(root, "index.html")) || exists(path.join(root, "public", "index.html"))) {
|
|
312
|
+
hasFrontend = true;
|
|
313
|
+
signals.add("index.html");
|
|
314
|
+
}
|
|
315
|
+
if (exists(path.join(root, "src", "components")) || exists(path.join(root, "src", "pages"))) {
|
|
316
|
+
hasFrontend = true;
|
|
317
|
+
}
|
|
318
|
+
// --- Backend folder heuristics ---
|
|
319
|
+
if (exists(path.join(root, "prisma")) || exists(path.join(root, "migrations"))) {
|
|
320
|
+
hasBackend = true;
|
|
321
|
+
hasDatabase = true;
|
|
322
|
+
signals.add("migrations");
|
|
323
|
+
}
|
|
324
|
+
for (const d of ["controllers", "routes", path.join("src", "controllers"), path.join("src", "routes"), "api"]) {
|
|
325
|
+
if (exists(path.join(root, d)))
|
|
326
|
+
hasBackend = true;
|
|
327
|
+
}
|
|
328
|
+
if (exists(path.join(root, "serverless.yml"))) {
|
|
329
|
+
hasBackend = true;
|
|
330
|
+
signals.add("serverless.yml");
|
|
331
|
+
}
|
|
332
|
+
// --- Cross-cutting ---
|
|
333
|
+
if (exists(path.join(root, "Dockerfile")) ||
|
|
334
|
+
exists(path.join(root, "docker-compose.yml")) ||
|
|
335
|
+
exists(path.join(root, "docker-compose.yaml"))) {
|
|
336
|
+
hasDocker = true;
|
|
337
|
+
signals.add("Docker");
|
|
338
|
+
}
|
|
339
|
+
for (const t of ["test", "tests", "__tests__", "e2e"]) {
|
|
340
|
+
if (exists(path.join(root, t)))
|
|
341
|
+
hasTests = true;
|
|
342
|
+
}
|
|
343
|
+
let kind;
|
|
344
|
+
if (hasFrontend && hasBackend)
|
|
345
|
+
kind = "fullstack";
|
|
346
|
+
else if (hasFrontend)
|
|
347
|
+
kind = "frontend";
|
|
348
|
+
else if (hasBackend)
|
|
349
|
+
kind = "backend";
|
|
350
|
+
else
|
|
351
|
+
kind = "unknown";
|
|
352
|
+
return {
|
|
353
|
+
kind,
|
|
354
|
+
frameworks: [...frameworks],
|
|
355
|
+
hasDatabase,
|
|
356
|
+
hasTests,
|
|
357
|
+
hasDocker,
|
|
358
|
+
isMonorepo,
|
|
359
|
+
signals: [...signals],
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/** detectProject wrapped so detection failures never break a run. */
|
|
363
|
+
export function safeDetect(root = process.cwd()) {
|
|
364
|
+
try {
|
|
365
|
+
return detectProject(root);
|
|
366
|
+
}
|
|
367
|
+
catch {
|
|
368
|
+
return undefined;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
//# sourceMappingURL=detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,gFAAgF;AAChF,2EAA2E;AAC3E,6CAA6C;AAE7C,MAAM,aAAa,GAA2B;IAC5C,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,OAAO;IACpB,GAAG,EAAE,KAAK;IACV,eAAe,EAAE,SAAS;IAC1B,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,SAAS;IACrB,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,SAAS;IAC1B,MAAM,EAAE,QAAQ;IAChB,cAAc,EAAE,cAAc;IAC9B,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,OAAO;IACvB,gBAAgB,EAAE,OAAO;CAC1B,CAAC;AAEF,0EAA0E;AAC1E,MAAM,cAAc,GAA2B;IAC7C,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,MAAM;IACZ,kBAAkB,EAAE,OAAO;IAC3B,iBAAiB,E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AC,QAAQ,CAAC,CAAC;IACxB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;QACtD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAAE,QAAQ,GAAG,IAAI,CAAC;IAClD,CAAC;IAED,IAAI,IAAiB,CAAC;IACtB,IAAI,WAAW,IAAI,UAAU;QAAE,IAAI,GAAG,WAAW,CAAC;SAC7C,IAAI,WAAW;QAAE,IAAI,GAAG,UAAU,CAAC;SACnC,IAAI,UAAU;QAAE,IAAI,GAAG,SAAS,CAAC;;QACjC,IAAI,GAAG,SAAS,CAAC;IAEtB,OAAO;QACL,IAAI;QACJ,UAAU,EAAE,CAAC,GAAG,UAAU,CAAC;QAC3B,WAAW;QACX,QAAQ;QACR,SAAS;QACT,UAAU;QACV,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;KACtB,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,OAAe,OAAO,CAAC,GAAG,EAAE;IACrD,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
2
|
export { quick, full, checklists } from "./checklists.js";
|
|
3
3
|
export { filterSections, runSession } from "./session.js";
|
|
4
|
-
export { askYesNo, closeInput } from "./prompt.js";
|
|
4
|
+
export { askYesNo, askChoice, closeInput } from "./prompt.js";
|
|
5
5
|
export { buildMarkdown, defaultReportName, printSummary, printList, saveReport } from "./report.js";
|
|
6
|
+
export { detectProject, safeDetect, kindLabel } from "./detect.js";
|
|
7
|
+
export { stackSection } from "./stack.js";
|
|
8
|
+
export { runTui, tuiAvailable } from "./tui.js";
|
|
9
|
+
export { loadConfig, saveConfig, configDir, configPath, getProjectRecord, setProjectRecord, } from "./config.js";
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
// Public API — import
|
|
1
|
+
// Public API — import `@geekyants/think-before` programmatically as a library.
|
|
2
2
|
//
|
|
3
|
-
// import { quick, full, runSession,
|
|
3
|
+
// import { quick, full, runSession, detectProject, stackSection } from "@geekyants/think-before";
|
|
4
4
|
export * from "./types.js";
|
|
5
5
|
export { quick, full, checklists } from "./checklists.js";
|
|
6
6
|
export { filterSections, runSession } from "./session.js";
|
|
7
|
-
export { askYesNo, closeInput } from "./prompt.js";
|
|
7
|
+
export { askYesNo, askChoice, closeInput } from "./prompt.js";
|
|
8
8
|
export { buildMarkdown, defaultReportName, printSummary, printList, saveReport } from "./report.js";
|
|
9
|
+
export { detectProject, safeDetect, kindLabel } from "./detect.js";
|
|
10
|
+
export { stackSection } from "./stack.js";
|
|
11
|
+
export { runTui, tuiAvailable } from "./tui.js";
|
|
12
|
+
export { loadConfig, saveConfig, configDir, configPath, getProjectRecord, setProjectRecord, } from "./config.js";
|
|
9
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,oGAAoG;AAEpG,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
|
package/dist/prompt.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ export type AnswerOrQuit = AnswerValue | "quit";
|
|
|
11
11
|
* still works in non-interactive contexts.
|
|
12
12
|
*/
|
|
13
13
|
export declare function askYesNo(why?: string): Promise<AnswerOrQuit>;
|
|
14
|
+
/**
|
|
15
|
+
* Ask the user to pick one of a set of single-character keys (e.g. ["1","2","3"]).
|
|
16
|
+
* Resolves the chosen key, or "quit" on q/Esc/Ctrl-C/EOF. Non-TTY input reads a
|
|
17
|
+
* line and matches its first relevant character.
|
|
18
|
+
*/
|
|
19
|
+
export declare function askChoice(keys: string[]): Promise<string | "quit">;
|
|
14
20
|
/** Release the shared line reader so the process can exit (non-TTY only). */
|
|
15
21
|
export declare function closeInput(): void;
|
|
16
22
|
//# sourceMappingURL=prompt.d.ts.map
|
package/dist/prompt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,CAAC;AAEhD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAyC5D;
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,CAAC;AAEhD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAyC5D;AA+BD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CA2ClE;AAaD,6EAA6E;AAC7E,wBAAgB,UAAU,IAAI,IAAI,CAKjC"}
|
package/dist/prompt.js
CHANGED
|
@@ -83,6 +83,53 @@ function readLineOnce() {
|
|
|
83
83
|
return Promise.resolve(queued);
|
|
84
84
|
return new Promise((resolve) => waiters.push(resolve));
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Ask the user to pick one of a set of single-character keys (e.g. ["1","2","3"]).
|
|
88
|
+
* Resolves the chosen key, or "quit" on q/Esc/Ctrl-C/EOF. Non-TTY input reads a
|
|
89
|
+
* line and matches its first relevant character.
|
|
90
|
+
*/
|
|
91
|
+
export function askChoice(keys) {
|
|
92
|
+
const allowed = keys.map((k) => k.toLowerCase());
|
|
93
|
+
const stdin = process.stdin;
|
|
94
|
+
if (!stdin.isTTY) {
|
|
95
|
+
return readLineOnce().then((line) => {
|
|
96
|
+
if (line === null)
|
|
97
|
+
return "quit";
|
|
98
|
+
const text = line.trim().toLowerCase();
|
|
99
|
+
if (text.startsWith("q"))
|
|
100
|
+
return "quit";
|
|
101
|
+
const hit = [...text].find((ch) => allowed.includes(ch));
|
|
102
|
+
return hit ?? "quit";
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return new Promise((resolve) => {
|
|
106
|
+
readline.emitKeypressEvents(stdin);
|
|
107
|
+
stdin.setRawMode(true);
|
|
108
|
+
stdin.resume();
|
|
109
|
+
const cleanup = () => {
|
|
110
|
+
stdin.removeListener("keypress", onKey);
|
|
111
|
+
stdin.setRawMode(false);
|
|
112
|
+
stdin.pause();
|
|
113
|
+
};
|
|
114
|
+
const onKey = (str, key) => {
|
|
115
|
+
if (key && key.ctrl && key.name === "c") {
|
|
116
|
+
cleanup();
|
|
117
|
+
resolve("quit");
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const k = (str || "").toLowerCase();
|
|
121
|
+
if (k === "q" || (key && key.name === "escape")) {
|
|
122
|
+
cleanup();
|
|
123
|
+
resolve("quit");
|
|
124
|
+
}
|
|
125
|
+
else if (allowed.includes(k)) {
|
|
126
|
+
cleanup();
|
|
127
|
+
resolve(k);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
stdin.on("keypress", onKey);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
86
133
|
function askLine() {
|
|
87
134
|
return readLineOnce().then((line) => {
|
|
88
135
|
if (line === null)
|
package/dist/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAKlC;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAY;IACnC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,IAAI,CAAC,KAAK,CAAC,KAAK;QAAE,OAAO,OAAO,EAAE,CAAC;IAEnC,OAAO,IAAI,OAAO,CAAe,CAAC,OAAO,EAAE,EAAE;QAC3C,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACnC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACvB,KAAK,CAAC,MAAM,EAAE,CAAC;QAEf,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YACxC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACxB,KAAK,CAAC,KAAK,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AG,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,EAAE,CAAC;gBAChD,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC;iBAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC/B,OAAO,EAAE,CAAC;gBACV,OAAO,CAAC,CAAC,CAAC,CAAC;YACb,CAAC;QACH,CAAC,CAAC;QAEF,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,OAAO;IACd,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QAClC,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,MAAM,CAAC,CAAC,MAAM;QACxC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACpC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QACpC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QACnC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,MAAM,CAAC;QACrC,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,UAAU;IACxB,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
package/dist/stack.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Detection, Role, Section } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Build a stack-tailored Section from a detection result, filtered to the
|
|
4
|
+
* user's role when known. Returns null when there's nothing relevant to add
|
|
5
|
+
* (e.g. an unknown stack).
|
|
6
|
+
*/
|
|
7
|
+
export declare function stackSection(detection: Detection, role?: Role): Section | null;
|
|
8
|
+
//# sourceMappingURL=stack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../src/stack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAY,IAAI,EAAe,OAAO,EAAE,MAAM,YAAY,CAAC;AAsIlF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,IAAI,CAgB9E"}
|
package/dist/stack.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { kindLabel } from "./detect.js";
|
|
2
|
+
const ALL_ROLES = ["designer", "engineer", "developer"];
|
|
3
|
+
const TECH_ROLES = ["engineer", "developer"];
|
|
4
|
+
const isFrontend = (d) => d.kind === "frontend" || d.kind === "fullstack";
|
|
5
|
+
const isBackend = (d) => d.kind === "backend" || d.kind === "fullstack";
|
|
6
|
+
const hasDb = (d) => isBackend(d) && d.hasDatabase;
|
|
7
|
+
const isFullstack = (d) => d.kind === "fullstack";
|
|
8
|
+
function q(id, text, risky, why) {
|
|
9
|
+
return { id, text, risky, why };
|
|
10
|
+
}
|
|
11
|
+
const CANDIDATES = [
|
|
12
|
+
// --- Frontend ---
|
|
13
|
+
{
|
|
14
|
+
when: isFrontend,
|
|
15
|
+
roles: ALL_ROLES,
|
|
16
|
+
q: q("fe-breakpoints", "Have you checked this across the breakpoints, devices, and viewports the app supports?", "no", "Layout side-effects love to hide on the screen sizes you didn't open."),
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
when: isFrontend,
|
|
20
|
+
roles: ALL_ROLES,
|
|
21
|
+
q: q("fe-a11y", "Will keyboard navigation, focus order, and screen-reader output still work after this?", "no", "Accessibility regressions are invisible until someone who relies on them hits them."),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
when: isFrontend,
|
|
25
|
+
roles: ALL_ROLES,
|
|
26
|
+
q: q("fe-shared-ui", "Is this a shared component, style, or design token reused across many screens?", "yes", "One tweak to a shared UI primitive re-renders everywhere it's used."),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
when: isFrontend,
|
|
30
|
+
roles: TECH_ROLES,
|
|
31
|
+
q: q("fe-state", "Could this change shared client state, context, or a global store other views read?", "yes", "Global state is a hidden contract between unrelated screens."),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
when: isFrontend,
|
|
35
|
+
roles: TECH_ROLES,
|
|
36
|
+
q: q("fe-bundle", "Could this noticeably grow the bundle or block the main thread (heavy dep, sync work)?", "yes", "A small import can drag a large dependency — and the user's first paint — with it."),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
when: isFrontend,
|
|
40
|
+
roles: TECH_ROLES,
|
|
41
|
+
q: q("fe-cache", "Could cached assets, a service worker, or localStorage from the old version conflict with this?", "yes", "Returning users run a mix of old and new code until caches clear."),
|
|
42
|
+
},
|
|
43
|
+
// --- Backend ---
|
|
44
|
+
{
|
|
45
|
+
when: isBackend,
|
|
46
|
+
roles: TECH_ROLES,
|
|
47
|
+
q: q("be-api-contract", "Does this change a request/response shape, field, or status code a client depends on?", "yes", "Clients you can't see — web, mobile, integrations — break the moment the contract shifts."),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
when: isBackend,
|
|
51
|
+
roles: TECH_ROLES,
|
|
52
|
+
q: q("be-authz", "Does this touch authentication, authorization, or tenant/data isolation?", "yes", "Authz mistakes are high-severity and rarely caught by happy-path testing."),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
when: isBackend,
|
|
56
|
+
roles: TECH_ROLES,
|
|
57
|
+
q: q("be-idempotent", "Are retries and duplicate requests safe (idempotent), with failures handled cleanly?", "no", "Networks retry. Non-idempotent handlers double-charge, double-send, double-write."),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
when: isBackend,
|
|
61
|
+
roles: TECH_ROLES,
|
|
62
|
+
q: q("be-external", "Does this add a call to an external service with rate limits, latency, or per-call cost?", "yes", "Their outage, throttle, or bill becomes your outage, throttle, or bill."),
|
|
63
|
+
},
|
|
64
|
+
// --- Database (backend + a data layer detected) ---
|
|
65
|
+
{
|
|
66
|
+
when: hasDb,
|
|
67
|
+
roles: TECH_ROLES,
|
|
68
|
+
q: q("db-migration", "Is the schema/migration reversible and backward-compatible with the running code?", "no", "Deploys aren't atomic — old code runs against the new schema for a window."),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
when: hasDb,
|
|
72
|
+
roles: TECH_ROLES,
|
|
73
|
+
q: q("db-transaction", "Do multi-step writes run in a transaction so a partial failure can't corrupt data?", "no", "A crash between two writes is the bug you only find in production."),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
when: hasDb,
|
|
77
|
+
roles: TECH_ROLES,
|
|
78
|
+
q: q("db-nplus1", "Could this introduce an N+1 query or an unindexed scan on a hot path?", "yes", "Fine on your seed data; a table scan at production scale."),
|
|
79
|
+
},
|
|
80
|
+
// --- Full-stack boundary ---
|
|
81
|
+
{
|
|
82
|
+
when: isFullstack,
|
|
83
|
+
roles: TECH_ROLES,
|
|
84
|
+
q: q("fs-deploy-order", "If both API and client change, can they deploy independently without breaking each other?", "no", "Front end and back end rarely deploy in the same instant — plan for the gap."),
|
|
85
|
+
},
|
|
86
|
+
// --- Detection-driven ---
|
|
87
|
+
{
|
|
88
|
+
when: (d) => !d.hasTests,
|
|
89
|
+
roles: TECH_ROLES,
|
|
90
|
+
q: q("no-tests", "No test setup was detected here — will you add a test or a written manual check for this change?", "no", "Untested changes to an unfamiliar codebase are how 'small' becomes 'incident'."),
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
when: (d) => d.hasDocker,
|
|
94
|
+
roles: TECH_ROLES,
|
|
95
|
+
q: q("docker-parity", "Will this still work in the container / deploy environment, not just your local machine?", "no", "Env vars, file paths, and timezones differ between your laptop and the container."),
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
/**
|
|
99
|
+
* Build a stack-tailored Section from a detection result, filtered to the
|
|
100
|
+
* user's role when known. Returns null when there's nothing relevant to add
|
|
101
|
+
* (e.g. an unknown stack).
|
|
102
|
+
*/
|
|
103
|
+
export function stackSection(detection, role) {
|
|
104
|
+
if (detection.kind === "unknown")
|
|
105
|
+
return null;
|
|
106
|
+
const questions = CANDIDATES.filter((c) => c.when(detection))
|
|
107
|
+
.filter((c) => !role || c.roles.includes(role))
|
|
108
|
+
.map((c) => c.q);
|
|
109
|
+
if (questions.length === 0)
|
|
110
|
+
return null;
|
|
111
|
+
const fw = detection.frameworks.length ? ` (${detection.frameworks.join(", ")})` : "";
|
|
112
|
+
return {
|
|
113
|
+
id: "stack",
|
|
114
|
+
title: `Stack-specific — ${kindLabel(detection.kind)}${fw}`,
|
|
115
|
+
roles: ["shared"],
|
|
116
|
+
questions,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=stack.js.map
|