projectinator 0.3.0 → 0.4.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 +30 -11
- package/bin/projectinator.mjs +56 -11
- package/dist/bakeoff.js +163 -0
- package/dist/bakeoff.js.map +1 -0
- package/dist/build-state.js +26 -0
- package/dist/build-state.js.map +1 -0
- package/dist/burndown.js +19 -0
- package/dist/burndown.js.map +1 -0
- package/dist/calibration.js +86 -0
- package/dist/calibration.js.map +1 -0
- package/dist/cli.js +289 -0
- package/dist/cli.js.map +1 -0
- package/dist/cost.js +35 -0
- package/dist/cost.js.map +1 -0
- package/dist/council.js +147 -0
- package/dist/council.js.map +1 -0
- package/dist/demo.js +93 -0
- package/dist/demo.js.map +1 -0
- package/dist/estimate.js +98 -0
- package/dist/estimate.js.map +1 -0
- package/dist/executor.js +118 -0
- package/dist/executor.js.map +1 -0
- package/dist/git.js +82 -0
- package/dist/git.js.map +1 -0
- package/dist/intake.js +98 -0
- package/dist/intake.js.map +1 -0
- package/dist/models.js +171 -0
- package/dist/models.js.map +1 -0
- package/dist/narrate.js +76 -0
- package/dist/narrate.js.map +1 -0
- package/dist/openrouter.js +112 -0
- package/dist/openrouter.js.map +1 -0
- package/dist/orchestrator.js +273 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/pm.js +245 -0
- package/dist/pm.js.map +1 -0
- package/dist/preview.js +194 -0
- package/dist/preview.js.map +1 -0
- package/dist/registry-store.js +38 -0
- package/dist/registry-store.js.map +1 -0
- package/dist/registry.js +115 -0
- package/dist/registry.js.map +1 -0
- package/dist/research.js +98 -0
- package/dist/research.js.map +1 -0
- package/dist/retro.js +83 -0
- package/dist/retro.js.map +1 -0
- package/dist/roles.js +357 -0
- package/dist/roles.js.map +1 -0
- package/dist/router.js +95 -0
- package/dist/router.js.map +1 -0
- package/dist/run-bakeoff.js +68 -0
- package/dist/run-bakeoff.js.map +1 -0
- package/dist/run-build.js +193 -0
- package/dist/run-build.js.map +1 -0
- package/{src/run-dev.ts → dist/run-dev.js} +23 -39
- package/dist/run-dev.js.map +1 -0
- package/{src/run-pm.ts → dist/run-pm.js} +34 -46
- package/dist/run-pm.js.map +1 -0
- package/{src/run-research.ts → dist/run-research.js} +19 -30
- package/dist/run-research.js.map +1 -0
- package/{src/run-scout.ts → dist/run-scout.js} +17 -27
- package/dist/run-scout.js.map +1 -0
- package/dist/run-web.js +93 -0
- package/dist/run-web.js.map +1 -0
- package/dist/scout.js +81 -0
- package/dist/scout.js.map +1 -0
- package/dist/session-cost.js +15 -0
- package/dist/session-cost.js.map +1 -0
- package/dist/stack.js +34 -0
- package/dist/stack.js.map +1 -0
- package/dist/stuck.js +21 -0
- package/dist/stuck.js.map +1 -0
- package/dist/tui/App.js +1269 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/BakeOff.js +95 -0
- package/dist/tui/BakeOff.js.map +1 -0
- package/dist/tui/BoardEditor.js +183 -0
- package/dist/tui/BoardEditor.js.map +1 -0
- package/dist/tui/EditableBoard.js +140 -0
- package/dist/tui/EditableBoard.js.map +1 -0
- package/dist/tui/Frame.js +78 -0
- package/dist/tui/Frame.js.map +1 -0
- package/dist/tui/Intake.js +59 -0
- package/dist/tui/Intake.js.map +1 -0
- package/dist/tui/Kanban.js +75 -0
- package/dist/tui/Kanban.js.map +1 -0
- package/dist/tui/Settings.js +299 -0
- package/dist/tui/Settings.js.map +1 -0
- package/dist/tui/StackPick.js +44 -0
- package/dist/tui/StackPick.js.map +1 -0
- package/dist/tui/WebAccounts.js +131 -0
- package/dist/tui/WebAccounts.js.map +1 -0
- package/dist/tui/components.js +178 -0
- package/dist/tui/components.js.map +1 -0
- package/dist/tui/config.js +129 -0
- package/dist/tui/config.js.map +1 -0
- package/dist/tui/deploy.js +114 -0
- package/dist/tui/deploy.js.map +1 -0
- package/dist/tui/engine.js +710 -0
- package/dist/tui/engine.js.map +1 -0
- package/dist/tui/notify.js +47 -0
- package/dist/tui/notify.js.map +1 -0
- package/dist/tui/panels.js +42 -0
- package/dist/tui/panels.js.map +1 -0
- package/dist/tui/templates.js +106 -0
- package/dist/tui/templates.js.map +1 -0
- package/dist/tui/theme.js +42 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/tui/validate.js +51 -0
- package/dist/tui/validate.js.map +1 -0
- package/{src/tui.tsx → dist/tui.js} +23 -33
- package/dist/tui.js.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/dist/web/oauth-anthropic.js +179 -0
- package/dist/web/oauth-anthropic.js.map +1 -0
- package/dist/web/session.js +274 -0
- package/dist/web/session.js.map +1 -0
- package/package.json +5 -4
- package/src/bakeoff.ts +0 -214
- package/src/build-state.ts +0 -47
- package/src/burndown.ts +0 -35
- package/src/calibration.ts +0 -88
- package/src/cost.ts +0 -43
- package/src/council.ts +0 -175
- package/src/demo.ts +0 -106
- package/src/estimate.ts +0 -111
- package/src/executor.ts +0 -169
- package/src/git.ts +0 -72
- package/src/intake.ts +0 -125
- package/src/models.ts +0 -175
- package/src/narrate.ts +0 -87
- package/src/openrouter.ts +0 -119
- package/src/orchestrator.ts +0 -310
- package/src/pm.ts +0 -302
- package/src/preview.ts +0 -206
- package/src/registry-store.ts +0 -41
- package/src/registry.ts +0 -132
- package/src/research.ts +0 -123
- package/src/retro.ts +0 -99
- package/src/roles.ts +0 -401
- package/src/router.ts +0 -120
- package/src/run-bakeoff.ts +0 -77
- package/src/run-build.ts +0 -203
- package/src/run-web.ts +0 -87
- package/src/scout.ts +0 -121
- package/src/session-cost.ts +0 -17
- package/src/stack.ts +0 -46
- package/src/tui/App.tsx +0 -1760
- package/src/tui/BakeOff.tsx +0 -190
- package/src/tui/BoardEditor.tsx +0 -260
- package/src/tui/EditableBoard.tsx +0 -179
- package/src/tui/Frame.tsx +0 -142
- package/src/tui/Intake.tsx +0 -111
- package/src/tui/Kanban.tsx +0 -158
- package/src/tui/Settings.tsx +0 -513
- package/src/tui/StackPick.tsx +0 -79
- package/src/tui/WebAccounts.tsx +0 -197
- package/src/tui/components.tsx +0 -340
- package/src/tui/config.ts +0 -150
- package/src/tui/deploy.ts +0 -137
- package/src/tui/engine.ts +0 -749
- package/src/tui/notify.ts +0 -21
- package/src/tui/panels.tsx +0 -89
- package/src/tui/templates.ts +0 -119
- package/src/tui/theme.ts +0 -44
- package/src/tui/validate.ts +0 -53
- package/src/types.ts +0 -208
- package/src/web/oauth-anthropic.ts +0 -206
- package/src/web/session.ts +0 -299
package/src/tui/deploy.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// One-click deploy — ship a built static site to Cloudflare Pages, Vercel, or
|
|
2
|
-
// Netlify by shelling out to that provider's CLI. No secrets stored here: auth
|
|
3
|
-
// comes from the CLI's own login (browser) or a token env var the user sets.
|
|
4
|
-
|
|
5
|
-
import { spawn } from "node:child_process";
|
|
6
|
-
import { cpSync, mkdirSync, readdirSync, rmSync } from "node:fs";
|
|
7
|
-
import { join } from "node:path";
|
|
8
|
-
|
|
9
|
-
export type DeployTarget = "cloudflare" | "vercel" | "netlify";
|
|
10
|
-
|
|
11
|
-
export interface TargetMeta {
|
|
12
|
-
label: string;
|
|
13
|
-
cli: string;
|
|
14
|
-
install: string;
|
|
15
|
-
auth: string;
|
|
16
|
-
/** Regex to pull the live URL out of the CLI output. */
|
|
17
|
-
urlPattern: RegExp;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const DEPLOY_META: Record<DeployTarget, TargetMeta> = {
|
|
21
|
-
cloudflare: {
|
|
22
|
-
label: "Cloudflare Pages",
|
|
23
|
-
cli: "wrangler",
|
|
24
|
-
install: "npm i -g wrangler",
|
|
25
|
-
auth: "wrangler login (or set CLOUDFLARE_API_TOKEN)",
|
|
26
|
-
urlPattern: /https:\/\/[^\s]+\.pages\.dev/g,
|
|
27
|
-
},
|
|
28
|
-
vercel: {
|
|
29
|
-
label: "Vercel",
|
|
30
|
-
cli: "vercel",
|
|
31
|
-
install: "npm i -g vercel",
|
|
32
|
-
auth: "vercel login (or set VERCEL_TOKEN)",
|
|
33
|
-
urlPattern: /https:\/\/[^\s]+\.vercel\.app/g,
|
|
34
|
-
},
|
|
35
|
-
netlify: {
|
|
36
|
-
label: "Netlify",
|
|
37
|
-
cli: "netlify",
|
|
38
|
-
install: "npm i -g netlify-cli",
|
|
39
|
-
auth: "netlify login (or set NETLIFY_AUTH_TOKEN)",
|
|
40
|
-
urlPattern: /https:\/\/[^\s]+\.netlify\.app/g,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// Project metadata / non-servable files we never want on the public site.
|
|
45
|
-
const INTERNAL = new Set([
|
|
46
|
-
"build-state.json", "DESIGN-SPEC.md", "export.md", "export.csv",
|
|
47
|
-
"jira-import.csv", "trello-import.csv", "node_modules",
|
|
48
|
-
]);
|
|
49
|
-
|
|
50
|
-
/** Sanitise a project name into a deploy-safe slug (Cloudflare/Vercel project id). */
|
|
51
|
-
export function deploySlug(name: string): string {
|
|
52
|
-
return (name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40)) || "projectinator-app";
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** Copy servable web files into <dir>/.deploy, dropping internal metadata. */
|
|
56
|
-
export function stageForDeploy(dir: string): string {
|
|
57
|
-
const staging = join(dir, ".deploy");
|
|
58
|
-
rmSync(staging, { recursive: true, force: true });
|
|
59
|
-
mkdirSync(staging, { recursive: true });
|
|
60
|
-
let copied = 0;
|
|
61
|
-
for (const name of readdirSync(dir)) {
|
|
62
|
-
if (name.startsWith(".")) continue; // .deploy, hidden files
|
|
63
|
-
if (INTERNAL.has(name)) continue;
|
|
64
|
-
cpSync(join(dir, name), join(staging, name), { recursive: true });
|
|
65
|
-
copied++;
|
|
66
|
-
}
|
|
67
|
-
if (copied === 0) throw new Error("No web files to deploy — build the app first.");
|
|
68
|
-
return staging;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function buildArgs(target: DeployTarget, staging: string, slug: string): string[] {
|
|
72
|
-
switch (target) {
|
|
73
|
-
case "cloudflare":
|
|
74
|
-
return ["pages", "deploy", staging, "--project-name", slug, "--branch", "main", "--commit-dirty=true"];
|
|
75
|
-
case "vercel":
|
|
76
|
-
return [staging, "--prod", "--yes"];
|
|
77
|
-
case "netlify":
|
|
78
|
-
return ["deploy", "--dir", staging, "--prod"];
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface DeployResult {
|
|
83
|
-
url?: string;
|
|
84
|
-
output: string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/** Run a deploy. Streams output via onLog; resolves with the live URL (if found).
|
|
88
|
-
* Rejects with a helpful message when the CLI is missing or the deploy fails. */
|
|
89
|
-
export function deploy(
|
|
90
|
-
target: DeployTarget,
|
|
91
|
-
dir: string,
|
|
92
|
-
projectName: string,
|
|
93
|
-
onLog: (line: string) => void,
|
|
94
|
-
): Promise<DeployResult> {
|
|
95
|
-
return new Promise((resolve, reject) => {
|
|
96
|
-
let staging: string;
|
|
97
|
-
try {
|
|
98
|
-
staging = stageForDeploy(dir);
|
|
99
|
-
} catch (e) {
|
|
100
|
-
reject(e);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const meta = DEPLOY_META[target];
|
|
104
|
-
const args = buildArgs(target, staging, deploySlug(projectName));
|
|
105
|
-
const child = spawn(meta.cli, args, { cwd: dir, env: process.env });
|
|
106
|
-
|
|
107
|
-
let output = "";
|
|
108
|
-
const onData = (buf: Buffer) => {
|
|
109
|
-
const text = buf.toString();
|
|
110
|
-
output += text;
|
|
111
|
-
for (const line of text.split("\n")) {
|
|
112
|
-
const t = line.trimEnd();
|
|
113
|
-
if (t) onLog(t);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
child.stdout.on("data", onData);
|
|
117
|
-
child.stderr.on("data", onData);
|
|
118
|
-
|
|
119
|
-
child.on("error", (err: NodeJS.ErrnoException) => {
|
|
120
|
-
if (err.code === "ENOENT") {
|
|
121
|
-
reject(new Error(`${meta.cli} is not installed. Install it:\n ${meta.install}\nthen sign in:\n ${meta.auth}`));
|
|
122
|
-
} else {
|
|
123
|
-
reject(err);
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
child.on("close", (code) => {
|
|
128
|
-
if (code === 0) {
|
|
129
|
-
const matches = output.match(meta.urlPattern);
|
|
130
|
-
resolve({ url: matches ? matches[matches.length - 1] : undefined, output });
|
|
131
|
-
} else {
|
|
132
|
-
const tail = output.trim().split("\n").slice(-8).join("\n");
|
|
133
|
-
reject(new Error(`${meta.label} deploy failed (exit ${code}).\nIf it's an auth error, sign in:\n ${meta.auth}\n\n${tail}`));
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
}
|