create-blixis 0.1.2 → 0.2.1
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 +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +120 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,9 @@ curl http://localhost:3000/hello/world # {"message":"Hello, world!"}
|
|
|
20
20
|
|
|
21
21
|
| Option | |
|
|
22
22
|
|---|---|
|
|
23
|
-
| `--
|
|
23
|
+
| `--deploy <target>` | also set up deployment: `docker`, `vercel`, `netlify` or `cloudflare`. Installs `@blixis-io/cli` and `@blixis-io/deploy` and runs `blix deploy init` |
|
|
24
|
+
| `--ci <provider>` | with `--deploy`: also write the pipeline (`github`, `gitlab` or `bitbucket`) |
|
|
25
|
+
| `--no-install` | write the files only and print the install commands (with `--deploy`, including the deploy ones) |
|
|
24
26
|
|
|
25
27
|
The target directory must not exist or must be empty. Nested paths work (`apps/api`); the package is named after the last segment. No `@blixis-io/*` runtime dependency.
|
|
26
28
|
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";YAoBY;iBAEK;EACf;EACA;EACA;;;YAIU,iBAAiB,iBAAiB,yBAAyB,gBAAgB;iBAEtE;EACf;;EAEA;EACA,UAAU;;wBAGI,qBAAqB,gCAAgC;;wBAMrD,kBAAkB;;wBAwFZ,UAAU,yBAAyB,SAAS,gBAAgB,QAAQ"}
|
package/dist/index.js
CHANGED
|
@@ -103,8 +103,11 @@ process.on("SIGTERM", () => {
|
|
|
103
103
|
const RUNTIME_DEPENDENCIES = [
|
|
104
104
|
"@blixis-io/core",
|
|
105
105
|
"@blixis-io/di",
|
|
106
|
-
"@blixis-io/http"
|
|
106
|
+
"@blixis-io/http",
|
|
107
|
+
"zod"
|
|
107
108
|
];
|
|
109
|
+
/** Added only with --deploy: the CLI and its deploy plugin. */
|
|
110
|
+
const DEPLOY_DEPENDENCIES = ["@blixis-io/cli", "@blixis-io/deploy"];
|
|
108
111
|
const DEV_DEPENDENCIES = [
|
|
109
112
|
"typescript",
|
|
110
113
|
"@types/node",
|
|
@@ -139,12 +142,16 @@ function scaffold(cwd, target, packageManagerPin) {
|
|
|
139
142
|
}
|
|
140
143
|
//#endregion
|
|
141
144
|
//#region src/index.ts
|
|
142
|
-
const USAGE = `create-blixis <directory> [--no-install]
|
|
145
|
+
const USAGE = `create-blixis <directory> [--deploy <target>] [--ci <provider>] [--no-install]
|
|
143
146
|
|
|
144
147
|
pnpm create blixis my-app
|
|
145
148
|
npm create blixis@latest my-app
|
|
149
|
+
pnpm create blixis my-app --deploy docker --ci github
|
|
146
150
|
|
|
147
|
-
--
|
|
151
|
+
--deploy <target> also set up deployment (docker, vercel, netlify or cloudflare): installs
|
|
152
|
+
@blixis-io/cli and @blixis-io/deploy and runs \`blix deploy init\`
|
|
153
|
+
--ci <provider> with --deploy: also write the CI pipeline (github, gitlab or bitbucket)
|
|
154
|
+
--no-install write the files only; print the install commands instead
|
|
148
155
|
`;
|
|
149
156
|
function detectPackageManager(userAgent) {
|
|
150
157
|
const name = userAgent?.split("/")[0];
|
|
@@ -162,6 +169,63 @@ function addArgs(pm, dev, packages) {
|
|
|
162
169
|
...packages
|
|
163
170
|
];
|
|
164
171
|
}
|
|
172
|
+
/** The command that runs a locally installed binary (`blix`), per package manager. */
|
|
173
|
+
function execBlix(pm, args) {
|
|
174
|
+
switch (pm) {
|
|
175
|
+
case "pnpm": return {
|
|
176
|
+
command: "pnpm",
|
|
177
|
+
args: [
|
|
178
|
+
"exec",
|
|
179
|
+
"blix",
|
|
180
|
+
...args
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
case "npm": return {
|
|
184
|
+
command: "npx",
|
|
185
|
+
args: ["blix", ...args]
|
|
186
|
+
};
|
|
187
|
+
case "yarn": return {
|
|
188
|
+
command: "yarn",
|
|
189
|
+
args: ["blix", ...args]
|
|
190
|
+
};
|
|
191
|
+
case "bun": return {
|
|
192
|
+
command: "bunx",
|
|
193
|
+
args: ["blix", ...args]
|
|
194
|
+
};
|
|
195
|
+
/* v8 ignore start -- @preserve: exhaustiveness guard, unreachable while every package manager has a case */
|
|
196
|
+
default: throw new Error(`Unknown package manager ${String(pm)}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const VALUE_FLAGS = /* @__PURE__ */ new Set(["deploy", "ci"]);
|
|
200
|
+
function parseArgs(argv) {
|
|
201
|
+
const parsed = {
|
|
202
|
+
positionals: [],
|
|
203
|
+
noInstall: false,
|
|
204
|
+
help: false
|
|
205
|
+
};
|
|
206
|
+
for (let index = 0; index < argv.length; index++) {
|
|
207
|
+
const arg = argv[index];
|
|
208
|
+
if (arg === void 0) continue;
|
|
209
|
+
if (arg === "--help" || arg === "-h") parsed.help = true;
|
|
210
|
+
else if (arg === "--no-install") parsed.noInstall = true;
|
|
211
|
+
else if (arg.startsWith("--")) {
|
|
212
|
+
const [name = "", inline] = arg.slice(2).split(/=(.*)/s);
|
|
213
|
+
if (!VALUE_FLAGS.has(name)) {
|
|
214
|
+
parsed.error ??= `Unknown option "${arg}"`;
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
const value = inline ?? argv[++index];
|
|
218
|
+
if (value === void 0 || value.startsWith("-")) {
|
|
219
|
+
parsed.error ??= `--${name} needs a value`;
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
if (name === "deploy") parsed.deploy = value;
|
|
223
|
+
else parsed.ci = value;
|
|
224
|
+
} else if (arg.startsWith("-")) parsed.error ??= `Unknown option "${arg}"`;
|
|
225
|
+
else parsed.positionals.push(arg);
|
|
226
|
+
}
|
|
227
|
+
return parsed;
|
|
228
|
+
}
|
|
165
229
|
const runWithInheritedStdio = (command, args, cwd) => new Promise((resolve, reject) => {
|
|
166
230
|
const child = spawn(command, args, {
|
|
167
231
|
cwd,
|
|
@@ -175,24 +239,28 @@ const runWithInheritedStdio = (command, args, cwd) => new Promise((resolve, reje
|
|
|
175
239
|
});
|
|
176
240
|
/** The whole CLI as a function of argv + environment — no process.exit()/console.log(), so it is directly testable. */
|
|
177
241
|
async function runCreate(argv, options) {
|
|
178
|
-
const
|
|
179
|
-
const [target, ...extra] =
|
|
180
|
-
if (
|
|
242
|
+
const parsed = parseArgs(argv);
|
|
243
|
+
const [target, ...extra] = parsed.positionals;
|
|
244
|
+
if (parsed.help) return {
|
|
181
245
|
exitCode: 0,
|
|
182
246
|
stdout: USAGE,
|
|
183
247
|
stderr: ""
|
|
184
248
|
};
|
|
185
|
-
|
|
186
|
-
if (unknown) return {
|
|
249
|
+
if (parsed.error) return {
|
|
187
250
|
exitCode: 1,
|
|
188
251
|
stdout: "",
|
|
189
|
-
stderr:
|
|
252
|
+
stderr: `${parsed.error}\n\n${USAGE}`
|
|
190
253
|
};
|
|
191
254
|
if (!target || extra.length > 0) return {
|
|
192
255
|
exitCode: 1,
|
|
193
256
|
stdout: "",
|
|
194
257
|
stderr: `Usage: ${USAGE}`
|
|
195
258
|
};
|
|
259
|
+
if (parsed.ci && !parsed.deploy) return {
|
|
260
|
+
exitCode: 1,
|
|
261
|
+
stdout: "",
|
|
262
|
+
stderr: `--ci only makes sense with --deploy <target>.\n\n${USAGE}`
|
|
263
|
+
};
|
|
196
264
|
let result;
|
|
197
265
|
try {
|
|
198
266
|
result = scaffold(options.cwd, target, packageManagerPin(options.userAgent));
|
|
@@ -207,20 +275,55 @@ async function runCreate(argv, options) {
|
|
|
207
275
|
const pm = detectPackageManager(options.userAgent);
|
|
208
276
|
const runtime = addArgs(pm, false, RUNTIME_DEPENDENCIES);
|
|
209
277
|
const dev = addArgs(pm, true, DEV_DEPENDENCIES);
|
|
278
|
+
const deployDev = addArgs(pm, true, DEPLOY_DEPENDENCIES);
|
|
279
|
+
const blixInit = execBlix(pm, parsed.deploy ? [
|
|
280
|
+
"deploy",
|
|
281
|
+
"init",
|
|
282
|
+
"--target",
|
|
283
|
+
parsed.deploy,
|
|
284
|
+
...parsed.ci ? ["--ci", parsed.ci] : []
|
|
285
|
+
] : []);
|
|
210
286
|
const dir = relative(options.cwd, result.directory) || ".";
|
|
211
287
|
let stdout = `Created ${result.packageName} in ${dir}\n`;
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
288
|
+
if (parsed.noInstall) {
|
|
289
|
+
stdout += `\nNext:\n cd ${dir}\n ${pm} ${runtime.join(" ")}\n ${pm} ${dev.join(" ")}\n`;
|
|
290
|
+
if (parsed.deploy) stdout += ` ${pm} ${deployDev.join(" ")}\n ${blixInit.command} ${blixInit.args.join(" ")}\n`;
|
|
291
|
+
return {
|
|
292
|
+
exitCode: 0,
|
|
293
|
+
stdout,
|
|
294
|
+
stderr: ""
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
const install = options.install ?? runWithInheritedStdio;
|
|
298
|
+
const steps = [
|
|
299
|
+
{
|
|
300
|
+
command: pm,
|
|
301
|
+
args: runtime
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
command: pm,
|
|
305
|
+
args: dev
|
|
306
|
+
},
|
|
307
|
+
...parsed.deploy ? [{
|
|
308
|
+
command: pm,
|
|
309
|
+
args: deployDev
|
|
310
|
+
}, blixInit] : []
|
|
311
|
+
];
|
|
312
|
+
for (const step of steps) {
|
|
313
|
+
const code = await install(step.command, step.args, result.directory);
|
|
314
|
+
if (code !== 0) {
|
|
315
|
+
const isInit = parsed.deploy !== void 0 && step === steps.at(-1);
|
|
316
|
+
return {
|
|
218
317
|
exitCode: code,
|
|
219
318
|
stdout,
|
|
220
|
-
stderr: `\n"${
|
|
319
|
+
stderr: `\n"${step.command} ${step.args.join(" ")}" failed (exit ${code}). The files are in ${dir}; ${isInit ? "run `blix deploy init` yourself (the app itself is ready)." : "run the install yourself."}\n`
|
|
221
320
|
};
|
|
222
321
|
}
|
|
223
|
-
|
|
322
|
+
}
|
|
323
|
+
stdout += `\nNext:\n cd ${dir}\n ${pm === "npm" ? "npm run" : pm} dev\n curl http://localhost:3000/hello/world\n`;
|
|
324
|
+
if (parsed.deploy) {
|
|
325
|
+
const dryRun = execBlix(pm, ["deploy", "--dry-run"]);
|
|
326
|
+
stdout += `\nDeploy (${parsed.deploy}${parsed.ci ? `, ${parsed.ci}` : ""}):\n review blix.config.ts, then\n ${dryRun.command} ${dryRun.args.join(" ")}\n`;
|
|
224
327
|
}
|
|
225
328
|
return {
|
|
226
329
|
exitCode: 0,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/template.ts","../src/scaffold.ts","../src/index.ts"],"sourcesContent":["/** Every file of the generated app, keyed by path relative to the project root. */\nexport function templateFiles(packageName: string, packageManagerPin?: string): Record<string, string> {\n return {\n \"package.json\": `${JSON.stringify(\n {\n name: packageName,\n version: \"0.0.0\",\n private: true,\n type: \"module\",\n // Pins the package manager (corepack honours it), so a Docker image or CI job installs with the same\n // major version the project was created with instead of whatever is newest.\n ...(packageManagerPin ? { packageManager: packageManagerPin } : {}),\n engines: { node: \">=24\" },\n scripts: {\n // Decorators need tsc (esbuild/tsx drop the metadata), so dev is \"compile once, then\n // recompile on change while node restarts on the new output\".\n dev: 'tsc -p tsconfig.json && concurrently -k -n tsc,app \"tsc -p tsconfig.json --watch --preserveWatchOutput\" \"node --watch dist/main.js\"',\n build: \"tsc -p tsconfig.json\",\n start: \"node dist/main.js\",\n typecheck: \"tsc --noEmit -p tsconfig.json\",\n },\n },\n null,\n 2,\n )}\\n`,\n\n \"tsconfig.json\": `${JSON.stringify(\n {\n compilerOptions: {\n target: \"es2023\",\n lib: [\"es2023\"],\n types: [\"node\"],\n module: \"nodenext\",\n moduleResolution: \"nodenext\",\n strict: true,\n experimentalDecorators: true,\n emitDecoratorMetadata: true,\n useDefineForClassFields: false,\n esModuleInterop: true,\n skipLibCheck: true,\n outDir: \"dist\",\n rootDir: \"src\",\n },\n include: [\"src\"],\n },\n null,\n 2,\n )}\\n`,\n\n \".gitignore\": \"node_modules\\ndist\\n\",\n\n \"README.md\": `# ${packageName}\n\nA [Blixis](https://blixis-io.github.io/framework/) app.\n\n\\`\\`\\`bash\nnpm run dev # rebuilds and restarts on every change\n# or: npm run build && npm start\ncurl http://localhost:3000/hello/world\n\\`\\`\\`\n\nDecorators need \\`tsc\\` (not tsx/esbuild) — see the\n[installation notes](https://blixis-io.github.io/framework/start-here/installation/).\n`,\n\n \"src/hello.service.ts\": `import { Injectable } from \"@blixis-io/di\";\n\n@Injectable()\nexport class HelloService {\n greet(name: string): string {\n return \\`Hello, \\${name}!\\`;\n }\n}\n`,\n\n \"src/hello.controller.ts\": `import { Controller, Get, Param } from \"@blixis-io/http\";\nimport { HelloService } from \"./hello.service.js\";\n\n@Controller(\"hello\")\nexport class HelloController {\n constructor(private readonly hello: HelloService) {}\n\n @Get(\":name\")\n greet(@Param(\"name\") name: string) {\n return { message: this.hello.greet(name) };\n }\n}\n`,\n\n \"src/app.module.ts\": `import { Module } from \"@blixis-io/core\";\nimport { HelloController } from \"./hello.controller.js\";\nimport { HelloService } from \"./hello.service.js\";\n\n@Module({\n providers: [HelloService],\n controllers: [HelloController],\n})\nexport class AppModule {}\n`,\n\n \"src/main.ts\": `import { createHttpApplication } from \"@blixis-io/http\";\nimport { AppModule } from \"./app.module.js\";\n\nconst app = await createHttpApplication(AppModule);\nconst port = Number(process.env[\"PORT\"] ?? 3000);\nawait app.listen(port);\n\nconsole.log(\\`Listening on http://localhost:\\${port}\\`);\n\nprocess.on(\"SIGTERM\", () => {\n void app.close(\"SIGTERM\").then(() => process.exit(0));\n});\n`,\n };\n}\n\nexport const RUNTIME_DEPENDENCIES = [\"@blixis-io/core\", \"@blixis-io/di\", \"@blixis-io/http\"] as const;\nexport const DEV_DEPENDENCIES = [\"typescript\", \"@types/node\", \"concurrently\"] as const;\n","import { existsSync, mkdirSync, readdirSync, writeFileSync } from \"node:fs\";\nimport { basename, dirname, join, resolve } from \"node:path\";\nimport { templateFiles } from \"./template.js\";\n\nconst PACKAGE_NAME = /^[a-z0-9-~][a-z0-9-._~]*$/;\n\nexport class ScaffoldError extends Error {\n override readonly name = \"ScaffoldError\";\n}\n\nexport interface ScaffoldResult {\n directory: string;\n packageName: string;\n files: string[];\n}\n\n/** Writes the starter app into `cwd/<target>`. The directory may not exist yet, or must be empty. */\nexport function scaffold(cwd: string, target: string, packageManagerPin?: string): ScaffoldResult {\n const directory = resolve(cwd, target);\n const packageName = basename(directory);\n\n if (!PACKAGE_NAME.test(packageName)) {\n throw new ScaffoldError(\n `\"${packageName}\" is not a valid package name — use lowercase letters, digits, \"-\", \".\" or \"_\", starting with a letter or digit.`,\n );\n }\n if (existsSync(directory) && readdirSync(directory).length > 0) {\n throw new ScaffoldError(`${target} already exists and is not empty.`);\n }\n\n const files = Object.entries(templateFiles(packageName, packageManagerPin));\n for (const [path, content] of files) {\n const absolute = join(directory, path);\n mkdirSync(dirname(absolute), { recursive: true });\n writeFileSync(absolute, content);\n }\n\n return { directory, packageName, files: files.map(([path]) => path) };\n}\n","#!/usr/bin/env node\nimport { spawn } from \"node:child_process\";\nimport { realpathSync } from \"node:fs\";\nimport { relative } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { ScaffoldError, scaffold } from \"./scaffold.js\";\nimport { DEV_DEPENDENCIES, RUNTIME_DEPENDENCIES } from \"./template.js\";\n\nconst USAGE = `create-blixis <directory> [--no-install]\n\n pnpm create blixis my-app\n npm create blixis@latest my-app\n\n --no-install write the files only; print the install commands instead\n`;\n\nexport type PackageManager = \"pnpm\" | \"npm\" | \"yarn\" | \"bun\";\n\nexport interface CreateResult {\n exitCode: number;\n stdout: string;\n stderr: string;\n}\n\n/** Runs one package-manager command; resolves with its exit code. Injected so tests never touch the network. */\nexport type InstallRunner = (command: string, args: readonly string[], cwd: string) => Promise<number>;\n\nexport interface CreateOptions {\n cwd: string;\n /** `npm_config_user_agent` — tells us which package manager invoked `create`. */\n userAgent?: string | undefined;\n install?: InstallRunner;\n}\n\nexport function detectPackageManager(userAgent: string | undefined): PackageManager {\n const name = userAgent?.split(\"/\")[0];\n return name === \"pnpm\" || name === \"yarn\" || name === \"bun\" ? name : \"npm\";\n}\n\n/** `\"pnpm@11.25.0\"` from an `npm_config_user_agent` like `pnpm/11.25.0 npm/? node/v24.0.0`, for the `packageManager` field. Bun isn't managed by corepack, so it gets none. */\nexport function packageManagerPin(userAgent: string | undefined): string | undefined {\n const match = /^(pnpm|npm|yarn)\\/(\\d+\\.\\d+\\.\\d+)/.exec(userAgent ?? \"\");\n return match ? `${match[1]}@${match[2]}` : undefined;\n}\n\nfunction addArgs(pm: PackageManager, dev: boolean, packages: readonly string[]): string[] {\n const verb = pm === \"npm\" ? \"install\" : \"add\";\n const devFlag = pm === \"bun\" ? \"-d\" : \"-D\";\n return [verb, ...(dev ? [devFlag] : []), ...packages];\n}\n\nconst runWithInheritedStdio: InstallRunner = (command, args, cwd) =>\n new Promise((resolve, reject) => {\n const child = spawn(command, args, { cwd, stdio: \"inherit\", shell: process.platform === \"win32\" });\n child.once(\"error\", reject);\n child.once(\"close\", (code) => {\n resolve(code ?? 1);\n });\n });\n\n/** The whole CLI as a function of argv + environment — no process.exit()/console.log(), so it is directly testable. */\nexport async function runCreate(argv: readonly string[], options: CreateOptions): Promise<CreateResult> {\n const flags = argv.filter((arg) => arg.startsWith(\"-\"));\n const [target, ...extra] = argv.filter((arg) => !arg.startsWith(\"-\"));\n\n if (flags.includes(\"--help\") || flags.includes(\"-h\")) {\n return { exitCode: 0, stdout: USAGE, stderr: \"\" };\n }\n const unknown = flags.find((flag) => flag !== \"--no-install\");\n if (unknown) {\n return { exitCode: 1, stdout: \"\", stderr: `Unknown option \"${unknown}\"\\n\\n${USAGE}` };\n }\n if (!target || extra.length > 0) {\n return { exitCode: 1, stdout: \"\", stderr: `Usage: ${USAGE}` };\n }\n\n let result;\n try {\n result = scaffold(options.cwd, target, packageManagerPin(options.userAgent));\n } catch (error) {\n if (error instanceof ScaffoldError) {\n return { exitCode: 1, stdout: \"\", stderr: `${error.message}\\n` };\n }\n throw error;\n }\n\n const pm = detectPackageManager(options.userAgent);\n const runtime = addArgs(pm, false, RUNTIME_DEPENDENCIES);\n const dev = addArgs(pm, true, DEV_DEPENDENCIES);\n const dir = relative(options.cwd, result.directory) || \".\";\n let stdout = `Created ${result.packageName} in ${dir}\\n`;\n\n if (flags.includes(\"--no-install\")) {\n stdout += `\\nNext:\\n cd ${dir}\\n ${pm} ${runtime.join(\" \")}\\n ${pm} ${dev.join(\" \")}\\n`;\n } else {\n const install = options.install ?? runWithInheritedStdio;\n for (const args of [runtime, dev]) {\n const code = await install(pm, args, result.directory);\n if (code !== 0) {\n return {\n exitCode: code,\n stdout,\n stderr: `\\n\"${pm} ${args.join(\" \")}\" failed (exit ${code}). The files are in ${dir}; run the install yourself.\\n`,\n };\n }\n }\n const run = pm === \"npm\" ? \"npm run\" : pm;\n stdout += `\\nNext:\\n cd ${dir}\\n ${run} dev\\n curl http://localhost:3000/hello/world\\n`;\n }\n\n return { exitCode: 0, stdout, stderr: \"\" };\n}\n\n// Same entry-point check as @blixis-io/cli: pathToFileURL(realpathSync(...)) so a\n// bin shim's symlink and a path with spaces both still match import.meta.url.\n/* v8 ignore start -- @preserve: process wiring, exercised by index.test.ts spawning the real built binary */\nif (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {\n const result = await runCreate(process.argv.slice(2), {\n cwd: process.cwd(),\n userAgent: process.env[\"npm_config_user_agent\"],\n });\n if (result.stdout) {\n process.stdout.write(result.stdout);\n }\n if (result.stderr) {\n process.stderr.write(result.stderr);\n }\n process.exitCode = result.exitCode;\n}\n/* v8 ignore stop */\n"],"mappings":";;;;;;;AACA,SAAgB,c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AU,iBAAiB,IAAI,MADnB,OAAO,QAAQ,YAAY,GACE;CAC3C;CAEA,OAAO;EAAE,UAAU;EAAG;EAAQ,QAAQ;CAAG;AAC3C;;AAKA,IAAI,QAAQ,KAAK,MAAM,YAAY,QAAQ,cAAc,aAAa,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM;CAC5F,MAAM,SAAS,MAAM,UAAU,QAAQ,KAAK,MAAM,CAAC,GAAG;EACpD,KAAK,QAAQ,IAAI;EACjB,WAAW,QAAQ,IAAI;CACzB,CAAC;CACD,IAAI,OAAO,QACT,QAAQ,OAAO,MAAM,OAAO,MAAM;CAEpC,IAAI,OAAO,QACT,QAAQ,OAAO,MAAM,OAAO,MAAM;CAEpC,QAAQ,WAAW,OAAO;AAC5B"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["unreachable"],"sources":["../src/template.ts","../src/scaffold.ts","../src/index.ts"],"sourcesContent":["/** Every file of the generated app, keyed by path relative to the project root. */\nexport function templateFiles(packageName: string, packageManagerPin?: string): Record<string, string> {\n return {\n \"package.json\": `${JSON.stringify(\n {\n name: packageName,\n version: \"0.0.0\",\n private: true,\n type: \"module\",\n // Pins the package manager (corepack honours it), so a Docker image or CI job installs with the same\n // major version the project was created with instead of whatever is newest.\n ...(packageManagerPin ? { packageManager: packageManagerPin } : {}),\n engines: { node: \">=24\" },\n scripts: {\n // Decorators need tsc (esbuild/tsx drop the metadata), so dev is \"compile once, then\n // recompile on change while node restarts on the new output\".\n dev: 'tsc -p tsconfig.json && concurrently -k -n tsc,app \"tsc -p tsconfig.json --watch --preserveWatchOutput\" \"node --watch dist/main.js\"',\n build: \"tsc -p tsconfig.json\",\n start: \"node dist/main.js\",\n typecheck: \"tsc --noEmit -p tsconfig.json\",\n },\n },\n null,\n 2,\n )}\\n`,\n\n \"tsconfig.json\": `${JSON.stringify(\n {\n compilerOptions: {\n target: \"es2023\",\n lib: [\"es2023\"],\n types: [\"node\"],\n module: \"nodenext\",\n moduleResolution: \"nodenext\",\n strict: true,\n experimentalDecorators: true,\n emitDecoratorMetadata: true,\n useDefineForClassFields: false,\n esModuleInterop: true,\n skipLibCheck: true,\n outDir: \"dist\",\n rootDir: \"src\",\n },\n include: [\"src\"],\n },\n null,\n 2,\n )}\\n`,\n\n \".gitignore\": \"node_modules\\ndist\\n\",\n\n \"README.md\": `# ${packageName}\n\nA [Blixis](https://blixis-io.github.io/framework/) app.\n\n\\`\\`\\`bash\nnpm run dev # rebuilds and restarts on every change\n# or: npm run build && npm start\ncurl http://localhost:3000/hello/world\n\\`\\`\\`\n\nDecorators need \\`tsc\\` (not tsx/esbuild) — see the\n[installation notes](https://blixis-io.github.io/framework/start-here/installation/).\n`,\n\n \"src/hello.service.ts\": `import { Injectable } from \"@blixis-io/di\";\n\n@Injectable()\nexport class HelloService {\n greet(name: string): string {\n return \\`Hello, \\${name}!\\`;\n }\n}\n`,\n\n \"src/hello.controller.ts\": `import { Controller, Get, Param } from \"@blixis-io/http\";\nimport { HelloService } from \"./hello.service.js\";\n\n@Controller(\"hello\")\nexport class HelloController {\n constructor(private readonly hello: HelloService) {}\n\n @Get(\":name\")\n greet(@Param(\"name\") name: string) {\n return { message: this.hello.greet(name) };\n }\n}\n`,\n\n \"src/app.module.ts\": `import { Module } from \"@blixis-io/core\";\nimport { HelloController } from \"./hello.controller.js\";\nimport { HelloService } from \"./hello.service.js\";\n\n@Module({\n providers: [HelloService],\n controllers: [HelloController],\n})\nexport class AppModule {}\n`,\n\n \"src/main.ts\": `import { createHttpApplication } from \"@blixis-io/http\";\nimport { AppModule } from \"./app.module.js\";\n\nconst app = await createHttpApplication(AppModule);\nconst port = Number(process.env[\"PORT\"] ?? 3000);\nawait app.listen(port);\n\nconsole.log(\\`Listening on http://localhost:\\${port}\\`);\n\nprocess.on(\"SIGTERM\", () => {\n void app.close(\"SIGTERM\").then(() => process.exit(0));\n});\n`,\n };\n}\n\nexport const RUNTIME_DEPENDENCIES = [\"@blixis-io/core\", \"@blixis-io/di\", \"@blixis-io/http\", \"zod\"] as const;\n/** Added only with --deploy: the CLI and its deploy plugin. */\nexport const DEPLOY_DEPENDENCIES = [\"@blixis-io/cli\", \"@blixis-io/deploy\"] as const;\nexport const DEV_DEPENDENCIES = [\"typescript\", \"@types/node\", \"concurrently\"] as const;\n","import { existsSync, mkdirSync, readdirSync, writeFileSync } from \"node:fs\";\nimport { basename, dirname, join, resolve } from \"node:path\";\nimport { templateFiles } from \"./template.js\";\n\nconst PACKAGE_NAME = /^[a-z0-9-~][a-z0-9-._~]*$/;\n\nexport class ScaffoldError extends Error {\n override readonly name = \"ScaffoldError\";\n}\n\nexport interface ScaffoldResult {\n directory: string;\n packageName: string;\n files: string[];\n}\n\n/** Writes the starter app into `cwd/<target>`. The directory may not exist yet, or must be empty. */\nexport function scaffold(cwd: string, target: string, packageManagerPin?: string): ScaffoldResult {\n const directory = resolve(cwd, target);\n const packageName = basename(directory);\n\n if (!PACKAGE_NAME.test(packageName)) {\n throw new ScaffoldError(\n `\"${packageName}\" is not a valid package name — use lowercase letters, digits, \"-\", \".\" or \"_\", starting with a letter or digit.`,\n );\n }\n if (existsSync(directory) && readdirSync(directory).length > 0) {\n throw new ScaffoldError(`${target} already exists and is not empty.`);\n }\n\n const files = Object.entries(templateFiles(packageName, packageManagerPin));\n for (const [path, content] of files) {\n const absolute = join(directory, path);\n mkdirSync(dirname(absolute), { recursive: true });\n writeFileSync(absolute, content);\n }\n\n return { directory, packageName, files: files.map(([path]) => path) };\n}\n","#!/usr/bin/env node\nimport { spawn } from \"node:child_process\";\nimport { realpathSync } from \"node:fs\";\nimport { relative } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { ScaffoldError, scaffold } from \"./scaffold.js\";\nimport { DEPLOY_DEPENDENCIES, DEV_DEPENDENCIES, RUNTIME_DEPENDENCIES } from \"./template.js\";\n\nconst USAGE = `create-blixis <directory> [--deploy <target>] [--ci <provider>] [--no-install]\n\n pnpm create blixis my-app\n npm create blixis@latest my-app\n pnpm create blixis my-app --deploy docker --ci github\n\n --deploy <target> also set up deployment (docker, vercel, netlify or cloudflare): installs\n @blixis-io/cli and @blixis-io/deploy and runs \\`blix deploy init\\`\n --ci <provider> with --deploy: also write the CI pipeline (github, gitlab or bitbucket)\n --no-install write the files only; print the install commands instead\n`;\n\nexport type PackageManager = \"pnpm\" | \"npm\" | \"yarn\" | \"bun\";\n\nexport interface CreateResult {\n exitCode: number;\n stdout: string;\n stderr: string;\n}\n\n/** Runs one package-manager command; resolves with its exit code. Injected so tests never touch the network. */\nexport type InstallRunner = (command: string, args: readonly string[], cwd: string) => Promise<number>;\n\nexport interface CreateOptions {\n cwd: string;\n /** `npm_config_user_agent` — tells us which package manager invoked `create`. */\n userAgent?: string | undefined;\n install?: InstallRunner;\n}\n\nexport function detectPackageManager(userAgent: string | undefined): PackageManager {\n const name = userAgent?.split(\"/\")[0];\n return name === \"pnpm\" || name === \"yarn\" || name === \"bun\" ? name : \"npm\";\n}\n\n/** `\"pnpm@11.25.0\"` from an `npm_config_user_agent` like `pnpm/11.25.0 npm/? node/v24.0.0`, for the `packageManager` field. Bun isn't managed by corepack, so it gets none. */\nexport function packageManagerPin(userAgent: string | undefined): string | undefined {\n const match = /^(pnpm|npm|yarn)\\/(\\d+\\.\\d+\\.\\d+)/.exec(userAgent ?? \"\");\n return match ? `${match[1]}@${match[2]}` : undefined;\n}\n\nfunction addArgs(pm: PackageManager, dev: boolean, packages: readonly string[]): string[] {\n const verb = pm === \"npm\" ? \"install\" : \"add\";\n const devFlag = pm === \"bun\" ? \"-d\" : \"-D\";\n return [verb, ...(dev ? [devFlag] : []), ...packages];\n}\n\n/** The command that runs a locally installed binary (`blix`), per package manager. */\nfunction execBlix(pm: PackageManager, args: readonly string[]): { command: string; args: string[] } {\n switch (pm) {\n case \"pnpm\":\n return { command: \"pnpm\", args: [\"exec\", \"blix\", ...args] };\n case \"npm\":\n return { command: \"npx\", args: [\"blix\", ...args] };\n case \"yarn\":\n return { command: \"yarn\", args: [\"blix\", ...args] };\n case \"bun\":\n return { command: \"bunx\", args: [\"blix\", ...args] };\n /* v8 ignore start -- @preserve: exhaustiveness guard, unreachable while every package manager has a case */\n default: {\n const unreachable: never = pm;\n throw new Error(`Unknown package manager ${String(unreachable)}`);\n }\n /* v8 ignore stop */\n }\n}\n\ninterface ParsedArgs {\n positionals: string[];\n noInstall: boolean;\n help: boolean;\n deploy?: string | undefined;\n ci?: string | undefined;\n error?: string | undefined;\n}\n\nconst VALUE_FLAGS = new Set([\"deploy\", \"ci\"]);\n\nfunction parseArgs(argv: readonly string[]): ParsedArgs {\n const parsed: ParsedArgs = { positionals: [], noInstall: false, help: false };\n for (let index = 0; index < argv.length; index++) {\n const arg = argv[index];\n if (arg === undefined) {\n continue;\n }\n if (arg === \"--help\" || arg === \"-h\") {\n parsed.help = true;\n } else if (arg === \"--no-install\") {\n parsed.noInstall = true;\n } else if (arg.startsWith(\"--\")) {\n const [name = \"\", inline] = arg.slice(2).split(/=(.*)/s);\n if (!VALUE_FLAGS.has(name)) {\n parsed.error ??= `Unknown option \"${arg}\"`;\n continue;\n }\n const value = inline ?? argv[++index];\n if (value === undefined || value.startsWith(\"-\")) {\n parsed.error ??= `--${name} needs a value`;\n continue;\n }\n if (name === \"deploy\") {\n parsed.deploy = value;\n } else {\n parsed.ci = value;\n }\n } else if (arg.startsWith(\"-\")) {\n parsed.error ??= `Unknown option \"${arg}\"`;\n } else {\n parsed.positionals.push(arg);\n }\n }\n return parsed;\n}\n\nconst runWithInheritedStdio: InstallRunner = (command, args, cwd) =>\n new Promise((resolve, reject) => {\n const child = spawn(command, args, { cwd, stdio: \"inherit\", shell: process.platform === \"win32\" });\n child.once(\"error\", reject);\n child.once(\"close\", (code) => {\n resolve(code ?? 1);\n });\n });\n\n/** The whole CLI as a function of argv + environment — no process.exit()/console.log(), so it is directly testable. */\nexport async function runCreate(argv: readonly string[], options: CreateOptions): Promise<CreateResult> {\n const parsed = parseArgs(argv);\n const [target, ...extra] = parsed.positionals;\n\n if (parsed.help) {\n return { exitCode: 0, stdout: USAGE, stderr: \"\" };\n }\n if (parsed.error) {\n return { exitCode: 1, stdout: \"\", stderr: `${parsed.error}\\n\\n${USAGE}` };\n }\n if (!target || extra.length > 0) {\n return { exitCode: 1, stdout: \"\", stderr: `Usage: ${USAGE}` };\n }\n if (parsed.ci && !parsed.deploy) {\n return { exitCode: 1, stdout: \"\", stderr: `--ci only makes sense with --deploy <target>.\\n\\n${USAGE}` };\n }\n\n let result;\n try {\n result = scaffold(options.cwd, target, packageManagerPin(options.userAgent));\n } catch (error) {\n if (error instanceof ScaffoldError) {\n return { exitCode: 1, stdout: \"\", stderr: `${error.message}\\n` };\n }\n throw error;\n }\n\n const pm = detectPackageManager(options.userAgent);\n const runtime = addArgs(pm, false, RUNTIME_DEPENDENCIES);\n const dev = addArgs(pm, true, DEV_DEPENDENCIES);\n const deployDev = addArgs(pm, true, DEPLOY_DEPENDENCIES);\n const initArgs = parsed.deploy ? [\"deploy\", \"init\", \"--target\", parsed.deploy, ...(parsed.ci ? [\"--ci\", parsed.ci] : [])] : [];\n const blixInit = execBlix(pm, initArgs);\n const dir = relative(options.cwd, result.directory) || \".\";\n let stdout = `Created ${result.packageName} in ${dir}\\n`;\n\n if (parsed.noInstall) {\n stdout += `\\nNext:\\n cd ${dir}\\n ${pm} ${runtime.join(\" \")}\\n ${pm} ${dev.join(\" \")}\\n`;\n if (parsed.deploy) {\n stdout += ` ${pm} ${deployDev.join(\" \")}\\n ${blixInit.command} ${blixInit.args.join(\" \")}\\n`;\n }\n return { exitCode: 0, stdout, stderr: \"\" };\n }\n\n const install = options.install ?? runWithInheritedStdio;\n const steps: { command: string; args: readonly string[] }[] = [\n { command: pm, args: runtime },\n { command: pm, args: dev },\n ...(parsed.deploy ? [{ command: pm, args: deployDev }, blixInit] : []),\n ];\n for (const step of steps) {\n const code = await install(step.command, step.args, result.directory);\n if (code !== 0) {\n const isInit = parsed.deploy !== undefined && step === steps.at(-1);\n return {\n exitCode: code,\n stdout,\n stderr: `\\n\"${step.command} ${step.args.join(\" \")}\" failed (exit ${code}). The files are in ${dir}; ${\n isInit ? \"run `blix deploy init` yourself (the app itself is ready).\" : \"run the install yourself.\"\n }\\n`,\n };\n }\n }\n\n const run = pm === \"npm\" ? \"npm run\" : pm;\n stdout += `\\nNext:\\n cd ${dir}\\n ${run} dev\\n curl http://localhost:3000/hello/world\\n`;\n if (parsed.deploy) {\n const dryRun = execBlix(pm, [\"deploy\", \"--dry-run\"]);\n stdout += `\\nDeploy (${parsed.deploy}${parsed.ci ? `, ${parsed.ci}` : \"\"}):\\n review blix.config.ts, then\\n ${dryRun.command} ${dryRun.args.join(\" \")}\\n`;\n }\n return { exitCode: 0, stdout, stderr: \"\" };\n}\n\n// Same entry-point check as @blixis-io/cli: pathToFileURL(realpathSync(...)) so a\n// bin shim's symlink and a path with spaces both still match import.meta.url.\n/* v8 ignore start -- @preserve: process wiring, exercised by index.test.ts spawning the real built binary */\nif (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {\n const result = await runCreate(process.argv.slice(2), {\n cwd: process.cwd(),\n userAgent: process.env[\"npm_config_user_agent\"],\n });\n if (result.stdout) {\n process.stdout.write(result.stdout);\n }\n if (result.stderr) {\n process.stderr.write(result.stderr);\n }\n process.exitCode = result.exitCode;\n}\n/* v8 ignore stop */\n"],"mappings":";;;;;;;AACA,SAAgB,cAAc,aAAqB,mBAAoD;CACrG,OAAO;EACL,gBAAgB,GAAG,KAAK,UACtB;GACE,MAAM;GACN,SAAS;GACT,SAAS;GACT,MAAM;GAGN,GAAI,oBAAoB,EAAE,gBAAgB,kBAAkB,IAAI,CAAC;GACjE,SAAS,EAAE,MAAM,OAAO;GACxB,SAAS;IAGP,KAAK;IACL,OAAO;IACP,OAAO;IACP,WAAW;GACb;EACF,GACA,MACA,CACF,EAAE;EAEF,iBAAiB,GAAG,KAAK,UACvB;GACE,iBAAiB;IACf,QAAQ;IACR,KAAK,CAAC,QAAQ;IAC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