create-taserjs 0.1.12 → 0.2.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 +8 -44
- package/dist/cli-9fkoNOJg.js +1237 -0
- package/dist/cli-9fkoNOJg.js.map +1 -0
- package/dist/cli-DkZddFtU.cjs +1398 -0
- package/dist/cli.cjs +4 -0
- package/dist/cli.d.cts +4 -0
- package/dist/cli.d.cts.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +3 -0
- package/dist/index.cjs +25 -0
- package/dist/index.d.cts +119 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +119 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/package.json +39 -9
- package/src/addons/drizzle/index.ts +37 -40
- package/src/addons/kysely/index.ts +19 -22
- package/src/addons/pino/index.ts +2 -2
- package/src/addons/prisma/index.ts +18 -22
- package/src/addons/registry.ts +37 -73
- package/src/addons/types.ts +12 -13
- package/src/addons/validators.ts +22 -23
- package/src/addons/winston/index.ts +3 -3
- package/src/cli.ts +96 -56
- package/src/commands/create.ts +118 -249
- package/src/core/package-manager.ts +36 -55
- package/src/core/scaffold-engine.ts +100 -75
- package/src/core/targets.ts +20 -56
- package/src/core/types.ts +18 -53
- package/src/index.ts +8 -0
- package/src/templates/base.ts +139 -51
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +0 -23
- package/dist/cjs/addons/arktype/index.cjs +0 -6
- package/dist/cjs/addons/arktype/index.cjs.map +0 -1
- package/dist/cjs/addons/arktype/index.d.cts +0 -1
- package/dist/cjs/addons/drizzle/index.cjs +0 -131
- package/dist/cjs/addons/drizzle/index.cjs.map +0 -1
- package/dist/cjs/addons/drizzle/index.d.cts +0 -2
- package/dist/cjs/addons/kysely/index.cjs +0 -103
- package/dist/cjs/addons/kysely/index.cjs.map +0 -1
- package/dist/cjs/addons/kysely/index.d.cts +0 -2
- package/dist/cjs/addons/pino/index.cjs +0 -30
- package/dist/cjs/addons/pino/index.cjs.map +0 -1
- package/dist/cjs/addons/pino/index.d.cts +0 -2
- package/dist/cjs/addons/prisma/index.cjs +0 -133
- package/dist/cjs/addons/prisma/index.cjs.map +0 -1
- package/dist/cjs/addons/prisma/index.d.cts +0 -2
- package/dist/cjs/addons/registry.cjs +0 -65
- package/dist/cjs/addons/registry.cjs.map +0 -1
- package/dist/cjs/addons/registry.d.cts +0 -5
- package/dist/cjs/addons/types.d.cts +0 -16
- package/dist/cjs/addons/valibot/index.cjs +0 -6
- package/dist/cjs/addons/valibot/index.cjs.map +0 -1
- package/dist/cjs/addons/valibot/index.d.cts +0 -1
- package/dist/cjs/addons/validators.cjs +0 -38
- package/dist/cjs/addons/validators.cjs.map +0 -1
- package/dist/cjs/addons/validators.d.cts +0 -5
- package/dist/cjs/addons/winston/index.cjs +0 -34
- package/dist/cjs/addons/winston/index.cjs.map +0 -1
- package/dist/cjs/addons/winston/index.d.cts +0 -2
- package/dist/cjs/addons/zod/index.cjs +0 -6
- package/dist/cjs/addons/zod/index.cjs.map +0 -1
- package/dist/cjs/addons/zod/index.d.cts +0 -1
- package/dist/cjs/cli.cjs +0 -65
- package/dist/cjs/cli.cjs.map +0 -1
- package/dist/cjs/cli.d.cts +0 -2
- package/dist/cjs/commands/create.cjs +0 -332
- package/dist/cjs/commands/create.cjs.map +0 -1
- package/dist/cjs/commands/create.d.cts +0 -14
- package/dist/cjs/core/json-output.cjs +0 -16
- package/dist/cjs/core/json-output.cjs.map +0 -1
- package/dist/cjs/core/json-output.d.cts +0 -4
- package/dist/cjs/core/package-manager.cjs +0 -56
- package/dist/cjs/core/package-manager.cjs.map +0 -1
- package/dist/cjs/core/package-manager.d.cts +0 -8
- package/dist/cjs/core/parse-options.cjs +0 -95
- package/dist/cjs/core/parse-options.cjs.map +0 -1
- package/dist/cjs/core/parse-options.d.cts +0 -35
- package/dist/cjs/core/project-config.cjs +0 -23
- package/dist/cjs/core/project-config.cjs.map +0 -1
- package/dist/cjs/core/project-config.d.cts +0 -2
- package/dist/cjs/core/resolve-packages.cjs +0 -58
- package/dist/cjs/core/resolve-packages.cjs.map +0 -1
- package/dist/cjs/core/resolve-packages.d.cts +0 -2
- package/dist/cjs/core/scaffold-engine.cjs +0 -72
- package/dist/cjs/core/scaffold-engine.cjs.map +0 -1
- package/dist/cjs/core/scaffold-engine.d.cts +0 -2
- package/dist/cjs/core/targets.cjs +0 -171
- package/dist/cjs/core/targets.cjs.map +0 -1
- package/dist/cjs/core/targets.d.cts +0 -49
- package/dist/cjs/core/types.cjs +0 -52
- package/dist/cjs/core/types.cjs.map +0 -1
- package/dist/cjs/core/types.d.cts +0 -57
- package/dist/cjs/core/validate-project-name.cjs +0 -44
- package/dist/cjs/core/validate-project-name.cjs.map +0 -1
- package/dist/cjs/core/validate-project-name.d.cts +0 -1
- package/dist/cjs/frameworks/index.cjs +0 -116
- package/dist/cjs/frameworks/index.cjs.map +0 -1
- package/dist/cjs/frameworks/index.d.cts +0 -18
- package/dist/cjs/scaffold.d.cts +0 -3
- package/dist/cjs/templates/base.cjs +0 -97
- package/dist/cjs/templates/base.cjs.map +0 -1
- package/dist/cjs/templates/base.d.cts +0 -9
- package/dist/cjs/types.d.cts +0 -1
- package/dist/esm/addons/arktype/index.d.ts +0 -1
- package/dist/esm/addons/arktype/index.js +0 -7
- package/dist/esm/addons/arktype/index.js.map +0 -1
- package/dist/esm/addons/drizzle/index.d.ts +0 -2
- package/dist/esm/addons/drizzle/index.js +0 -131
- package/dist/esm/addons/drizzle/index.js.map +0 -1
- package/dist/esm/addons/kysely/index.d.ts +0 -2
- package/dist/esm/addons/kysely/index.js +0 -103
- package/dist/esm/addons/kysely/index.js.map +0 -1
- package/dist/esm/addons/pino/index.d.ts +0 -2
- package/dist/esm/addons/pino/index.js +0 -30
- package/dist/esm/addons/pino/index.js.map +0 -1
- package/dist/esm/addons/prisma/index.d.ts +0 -2
- package/dist/esm/addons/prisma/index.js +0 -133
- package/dist/esm/addons/prisma/index.js.map +0 -1
- package/dist/esm/addons/registry.d.ts +0 -5
- package/dist/esm/addons/registry.js +0 -63
- package/dist/esm/addons/registry.js.map +0 -1
- package/dist/esm/addons/types.d.ts +0 -16
- package/dist/esm/addons/valibot/index.d.ts +0 -1
- package/dist/esm/addons/valibot/index.js +0 -7
- package/dist/esm/addons/valibot/index.js.map +0 -1
- package/dist/esm/addons/validators.d.ts +0 -5
- package/dist/esm/addons/validators.js +0 -36
- package/dist/esm/addons/validators.js.map +0 -1
- package/dist/esm/addons/winston/index.d.ts +0 -2
- package/dist/esm/addons/winston/index.js +0 -34
- package/dist/esm/addons/winston/index.js.map +0 -1
- package/dist/esm/addons/zod/index.d.ts +0 -1
- package/dist/esm/addons/zod/index.js +0 -7
- package/dist/esm/addons/zod/index.js.map +0 -1
- package/dist/esm/cli.d.ts +0 -2
- package/dist/esm/cli.js +0 -62
- package/dist/esm/cli.js.map +0 -1
- package/dist/esm/commands/create.d.ts +0 -14
- package/dist/esm/commands/create.js +0 -327
- package/dist/esm/commands/create.js.map +0 -1
- package/dist/esm/core/json-output.d.ts +0 -4
- package/dist/esm/core/json-output.js +0 -14
- package/dist/esm/core/json-output.js.map +0 -1
- package/dist/esm/core/package-manager.d.ts +0 -8
- package/dist/esm/core/package-manager.js +0 -53
- package/dist/esm/core/package-manager.js.map +0 -1
- package/dist/esm/core/parse-options.d.ts +0 -35
- package/dist/esm/core/parse-options.js +0 -89
- package/dist/esm/core/parse-options.js.map +0 -1
- package/dist/esm/core/project-config.d.ts +0 -2
- package/dist/esm/core/project-config.js +0 -21
- package/dist/esm/core/project-config.js.map +0 -1
- package/dist/esm/core/resolve-packages.d.ts +0 -2
- package/dist/esm/core/resolve-packages.js +0 -58
- package/dist/esm/core/resolve-packages.js.map +0 -1
- package/dist/esm/core/scaffold-engine.d.ts +0 -2
- package/dist/esm/core/scaffold-engine.js +0 -70
- package/dist/esm/core/scaffold-engine.js.map +0 -1
- package/dist/esm/core/targets.d.ts +0 -49
- package/dist/esm/core/targets.js +0 -166
- package/dist/esm/core/targets.js.map +0 -1
- package/dist/esm/core/types.d.ts +0 -57
- package/dist/esm/core/types.js +0 -45
- package/dist/esm/core/types.js.map +0 -1
- package/dist/esm/core/validate-project-name.d.ts +0 -1
- package/dist/esm/core/validate-project-name.js +0 -42
- package/dist/esm/core/validate-project-name.js.map +0 -1
- package/dist/esm/frameworks/index.d.ts +0 -18
- package/dist/esm/frameworks/index.js +0 -112
- package/dist/esm/frameworks/index.js.map +0 -1
- package/dist/esm/scaffold.d.ts +0 -3
- package/dist/esm/templates/base.d.ts +0 -9
- package/dist/esm/templates/base.js +0 -91
- package/dist/esm/templates/base.js.map +0 -1
- package/dist/esm/types.d.ts +0 -1
- package/src/addons/arktype/index.ts +0 -3
- package/src/addons/valibot/index.ts +0 -3
- package/src/addons/zod/index.ts +0 -3
- package/src/core/json-output.ts +0 -13
- package/src/core/parse-options.ts +0 -167
- package/src/core/project-config.ts +0 -32
- package/src/core/resolve-packages.ts +0 -69
- package/src/core/validate-project-name.ts +0 -55
- package/src/frameworks/index.ts +0 -120
- package/src/scaffold.ts +0 -3
- package/src/types.ts +0 -12
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { resolveAddons } from "../addons/registry.js";
|
|
2
|
-
import { resolveDeployEntry } from "./targets.js";
|
|
3
|
-
import { FRAMEWORK_ENTRIES } from "../frameworks/index.js";
|
|
4
|
-
//#region src/core/resolve-packages.ts
|
|
5
|
-
var BASE_DEPENDENCIES = [
|
|
6
|
-
"@taserjs/router",
|
|
7
|
-
"dotenv",
|
|
8
|
-
"srvx"
|
|
9
|
-
];
|
|
10
|
-
/** Runtime-agnostic build/dev tooling every scaffolded project needs. */
|
|
11
|
-
var BASE_DEV_DEPENDENCIES = [
|
|
12
|
-
"@taserjs/router-plugin",
|
|
13
|
-
"@taserjs/router-cli",
|
|
14
|
-
"typescript@^5.9.3",
|
|
15
|
-
"vite@^8.1.5"
|
|
16
|
-
];
|
|
17
|
-
function runtimeDevDeps(ctx) {
|
|
18
|
-
const { entry } = resolveDeployEntry(ctx.preset ?? "node-server");
|
|
19
|
-
switch (ctx.runtime ?? entry.impliedRuntime) {
|
|
20
|
-
case "bun": return ["@types/bun"];
|
|
21
|
-
case "deno": return [];
|
|
22
|
-
case "workerd": return ["@cloudflare/workers-types"];
|
|
23
|
-
default: return ["@types/node"];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function resolvePackages(ctx) {
|
|
27
|
-
const frameworkEntry = FRAMEWORK_ENTRIES[ctx.framework ?? "none"];
|
|
28
|
-
const { entry: deployEntry } = resolveDeployEntry(ctx.preset ?? "node-server");
|
|
29
|
-
const dependencies = [...BASE_DEPENDENCIES, ...frameworkEntry.deps];
|
|
30
|
-
const nitroDevDeps = ctx.preset === "none" ? [] : ["nitro"];
|
|
31
|
-
const devDependencies = [
|
|
32
|
-
...BASE_DEV_DEPENDENCIES,
|
|
33
|
-
...nitroDevDeps,
|
|
34
|
-
...runtimeDevDeps(ctx),
|
|
35
|
-
...deployEntry.devDeps,
|
|
36
|
-
...frameworkEntry.devDeps
|
|
37
|
-
];
|
|
38
|
-
const scripts = {};
|
|
39
|
-
if (deployEntry.startScript) {
|
|
40
|
-
if (ctx.preset === "none" && ctx.runtime === "bun") scripts.start = "bun dist/serve.mjs";
|
|
41
|
-
else scripts.start = deployEntry.startScript;
|
|
42
|
-
}
|
|
43
|
-
const addons = resolveAddons(ctx);
|
|
44
|
-
for (const addon of addons) {
|
|
45
|
-
dependencies.push(...addon.dependencies(ctx));
|
|
46
|
-
devDependencies.push(...addon.devDependencies(ctx));
|
|
47
|
-
if (addon.scripts) Object.assign(scripts, addon.scripts(ctx));
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
dependencies: [...new Set(dependencies)],
|
|
51
|
-
devDependencies: [...new Set(devDependencies)],
|
|
52
|
-
scripts
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
export { resolvePackages };
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=resolve-packages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-packages.js","names":[],"sources":["../../../src/core/resolve-packages.ts"],"sourcesContent":["import { resolveAddons } from \"../addons/registry.js\";\nimport { FRAMEWORK_ENTRIES } from \"../frameworks/index.js\";\nimport type { PackageGroups, ScaffoldContext } from \"../core/types.js\";\nimport { resolveDeployEntry } from \"./targets.js\";\n\nconst BASE_DEPENDENCIES = [\"@taserjs/router\", \"dotenv\", \"srvx\"];\n\n/** Runtime-agnostic build/dev tooling every scaffolded project needs. */\nconst BASE_DEV_DEPENDENCIES = [\n \"@taserjs/router-plugin\",\n \"@taserjs/router-cli\",\n \"typescript@^5.9.3\",\n \"vite@^8.1.5\",\n];\n\nfunction runtimeDevDeps(ctx: ScaffoldContext): string[] {\n const { entry } = resolveDeployEntry(ctx.preset ?? \"node-server\");\n const effective = ctx.runtime ?? entry.impliedRuntime;\n switch (effective) {\n case \"bun\":\n return [\"@types/bun\"];\n case \"deno\":\n return []; // Deno ships its own tooling and types.\n case \"workerd\":\n return [\"@cloudflare/workers-types\"];\n case \"node\":\n default:\n return [\"@types/node\"];\n }\n}\n\nexport function resolvePackages(ctx: ScaffoldContext): PackageGroups {\n const frameworkEntry = FRAMEWORK_ENTRIES[ctx.framework ?? \"none\"];\n const { entry: deployEntry } = resolveDeployEntry(ctx.preset ?? \"node-server\");\n\n const dependencies = [...BASE_DEPENDENCIES, ...frameworkEntry.deps];\n const nitroDevDeps = ctx.preset === \"none\" ? [] : [\"nitro\"];\n const devDependencies = [\n ...BASE_DEV_DEPENDENCIES,\n ...nitroDevDeps,\n ...runtimeDevDeps(ctx),\n ...deployEntry.devDeps,\n ...frameworkEntry.devDeps,\n ];\n\n const scripts: Record<string, string> = {};\n if (deployEntry.startScript) {\n if (ctx.preset === \"none\" && ctx.runtime === \"bun\") {\n scripts.start = \"bun dist/serve.mjs\";\n } else {\n scripts.start = deployEntry.startScript;\n }\n }\n\n const addons = resolveAddons(ctx);\n for (const addon of addons) {\n dependencies.push(...addon.dependencies(ctx));\n devDependencies.push(...addon.devDependencies(ctx));\n if (addon.scripts) {\n Object.assign(scripts, addon.scripts(ctx));\n }\n }\n\n return {\n dependencies: [...new Set(dependencies)],\n devDependencies: [...new Set(devDependencies)],\n scripts,\n };\n}\n"],"mappings":";;;;AAKA,IAAM,oBAAoB;CAAC;CAAmB;CAAU;AAAM;;AAG9D,IAAM,wBAAwB;CAC5B;CACA;CACA;CACA;AACF;AAEA,SAAS,eAAe,KAAgC;CACtD,MAAM,EAAE,UAAU,mBAAmB,IAAI,UAAU,aAAa;CAEhE,QADkB,IAAI,WAAW,MAAM,gBACvC;EACE,KAAK,OACH,OAAO,CAAC,YAAY;EACtB,KAAK,QACH,OAAO,CAAC;EACV,KAAK,WACH,OAAO,CAAC,2BAA2B;EAErC,SACE,OAAO,CAAC,aAAa;CACzB;AACF;AAEA,SAAgB,gBAAgB,KAAqC;CACnE,MAAM,iBAAiB,kBAAkB,IAAI,aAAa;CAC1D,MAAM,EAAE,OAAO,gBAAgB,mBAAmB,IAAI,UAAU,aAAa;CAE7E,MAAM,eAAe,CAAC,GAAG,mBAAmB,GAAG,eAAe,IAAI;CAClE,MAAM,eAAe,IAAI,WAAW,SAAS,CAAC,IAAI,CAAC,OAAO;CAC1D,MAAM,kBAAkB;EACtB,GAAG;EACH,GAAG;EACH,GAAG,eAAe,GAAG;EACrB,GAAG,YAAY;EACf,GAAG,eAAe;CACpB;CAEA,MAAM,UAAkC,CAAC;CACzC,IAAI,YAAY,aAAa;EAC3B,IAAI,IAAI,WAAW,UAAU,IAAI,YAAY,OAC3C,QAAQ,QAAQ;OAEhB,QAAQ,QAAQ,YAAY;CAEhC;CAEA,MAAM,SAAS,cAAc,GAAG;CAChC,KAAK,MAAM,SAAS,QAAQ;EAC1B,aAAa,KAAK,GAAG,MAAM,aAAa,GAAG,CAAC;EAC5C,gBAAgB,KAAK,GAAG,MAAM,gBAAgB,GAAG,CAAC;EAClD,IAAI,MAAM,SACR,OAAO,OAAO,SAAS,MAAM,QAAQ,GAAG,CAAC;CAE7C;CAEA,OAAO;EACL,cAAc,CAAC,GAAG,IAAI,IAAI,YAAY,CAAC;EACvC,iBAAiB,CAAC,GAAG,IAAI,IAAI,eAAe,CAAC;EAC7C;CACF;AACF"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { collectBootBindings, resolveAddons } from "../addons/registry.js";
|
|
2
|
-
import { resolveDeployEntry, validateCombination } from "./targets.js";
|
|
3
|
-
import { FRAMEWORK_ENTRIES, nitroConfigTemplate, taserTsTemplate, viteConfigTemplate } from "../frameworks/index.js";
|
|
4
|
-
import { installPackages, resolveUserAgent } from "./package-manager.js";
|
|
5
|
-
import { writeProjectConfig } from "./project-config.js";
|
|
6
|
-
import { resolvePackages } from "./resolve-packages.js";
|
|
7
|
-
import { contextTemplate, gitignoreTemplate, healthRouteTemplate, indexRouteTemplate, packageJsonTemplate, rootLayoutTemplate, tsconfigTemplate } from "../templates/base.js";
|
|
8
|
-
import path from "node:path";
|
|
9
|
-
import { copyFile, mkdir, writeFile } from "node:fs/promises";
|
|
10
|
-
//#region src/core/scaffold-engine.ts
|
|
11
|
-
async function write(filePath, contents) {
|
|
12
|
-
await mkdir(path.dirname(filePath), { recursive: true });
|
|
13
|
-
await writeFile(filePath, contents, "utf8");
|
|
14
|
-
}
|
|
15
|
-
async function scaffoldProject(options) {
|
|
16
|
-
const root = options.targetDir;
|
|
17
|
-
const preset = options.preset ?? "node-server";
|
|
18
|
-
const framework = options.framework ?? "none";
|
|
19
|
-
const combination = validateCombination(options.runtime, framework, preset);
|
|
20
|
-
if (!combination.ok) throw new Error(combination.reason);
|
|
21
|
-
const ctx = {
|
|
22
|
-
projectName: options.projectName,
|
|
23
|
-
targetDir: root,
|
|
24
|
-
framework,
|
|
25
|
-
preset,
|
|
26
|
-
...options.runtime !== void 0 ? { runtime: options.runtime } : {},
|
|
27
|
-
...options.db ? {
|
|
28
|
-
db: options.db,
|
|
29
|
-
driver: options.driver
|
|
30
|
-
} : {},
|
|
31
|
-
...options.logger ? { logger: options.logger } : {},
|
|
32
|
-
...options.validator ? { validator: options.validator } : {}
|
|
33
|
-
};
|
|
34
|
-
const addons = resolveAddons(ctx);
|
|
35
|
-
const packages = resolvePackages(ctx);
|
|
36
|
-
const bootBindings = collectBootBindings(ctx);
|
|
37
|
-
const frameworkEntry = FRAMEWORK_ENTRIES[framework];
|
|
38
|
-
const { entry: deployEntry } = resolveDeployEntry(ctx.preset ?? "node-server");
|
|
39
|
-
await write(path.join(root, "package.json"), packageJsonTemplate(options.projectName, packages.scripts));
|
|
40
|
-
await write(path.join(root, "tsconfig.json"), tsconfigTemplate());
|
|
41
|
-
await write(path.join(root, "vite.config.ts"), viteConfigTemplate(ctx.preset));
|
|
42
|
-
await write(path.join(root, ".gitignore"), gitignoreTemplate());
|
|
43
|
-
await write(path.join(root, "src/context.ts"), contextTemplate(bootBindings));
|
|
44
|
-
await write(path.join(root, "src/taser.ts"), taserTsTemplate());
|
|
45
|
-
await write(path.join(root, "src/routes/$.ts"), rootLayoutTemplate());
|
|
46
|
-
await write(path.join(root, "src/routes/index.get.ts"), indexRouteTemplate());
|
|
47
|
-
await write(path.join(root, "src/routes/health.get.ts"), healthRouteTemplate(ctx));
|
|
48
|
-
if (ctx.preset !== "node-server" && ctx.preset !== "none") await write(path.join(root, "nitro.config.ts"), nitroConfigTemplate(deployEntry.id));
|
|
49
|
-
await Promise.all(deployEntry.files.map((file) => write(path.join(root, file.name), typeof file.content === "function" ? file.content({ projectName: options.projectName }) : file.content)));
|
|
50
|
-
const serverEntry = frameworkEntry.serverEntry;
|
|
51
|
-
if (serverEntry) await write(path.join(root, serverEntry.fileName), serverEntry.content);
|
|
52
|
-
await Promise.all(addons.map(async (addon) => {
|
|
53
|
-
await addon.apply(ctx, (filePath, contents) => write(path.join(root, filePath), contents));
|
|
54
|
-
}));
|
|
55
|
-
try {
|
|
56
|
-
await copyFile(path.join(root, ".env.example"), path.join(root, ".env"));
|
|
57
|
-
} catch {}
|
|
58
|
-
await writeProjectConfig(root, ctx);
|
|
59
|
-
if (options.skipInstall) return ctx;
|
|
60
|
-
const agent = options.agent ?? resolveUserAgent();
|
|
61
|
-
await installPackages(agent, root, {
|
|
62
|
-
dependencies: packages.dependencies,
|
|
63
|
-
devDependencies: packages.devDependencies
|
|
64
|
-
});
|
|
65
|
-
return ctx;
|
|
66
|
-
}
|
|
67
|
-
//#endregion
|
|
68
|
-
export { scaffoldProject };
|
|
69
|
-
|
|
70
|
-
//# sourceMappingURL=scaffold-engine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold-engine.js","names":[],"sources":["../../../src/core/scaffold-engine.ts"],"sourcesContent":["import { copyFile, mkdir, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport { collectBootBindings, resolveAddons } from \"../addons/registry.js\";\nimport { nitroConfigTemplate, taserTsTemplate, viteConfigTemplate } from \"../frameworks/index.js\";\nimport { installPackages, resolveUserAgent } from \"./package-manager.js\";\nimport { writeProjectConfig } from \"./project-config.js\";\nimport { resolvePackages } from \"./resolve-packages.js\";\nimport { resolveDeployEntry, validateCombination } from \"./targets.js\";\nimport { FRAMEWORK_ENTRIES } from \"../frameworks/index.js\";\nimport type { ScaffoldContext, ScaffoldOptions, ScaffoldResult } from \"./types.js\";\nimport {\n contextTemplate,\n gitignoreTemplate,\n healthRouteTemplate,\n indexRouteTemplate,\n packageJsonTemplate,\n rootLayoutTemplate,\n tsconfigTemplate,\n} from \"../templates/base.js\";\n\nasync function write(filePath: string, contents: string): Promise<void> {\n await mkdir(path.dirname(filePath), { recursive: true });\n await writeFile(filePath, contents, \"utf8\");\n}\n\nexport async function scaffoldProject(options: ScaffoldOptions): Promise<ScaffoldResult> {\n const root = options.targetDir;\n const preset = options.preset ?? \"node-server\";\n const framework = options.framework ?? \"none\";\n\n // Guards direct/library callers; the CLI path is validated earlier in\n // resolveScaffoldDefaults. Throws with a precise reason on impossible\n // runtime × framework × deploy combinations.\n const combination = validateCombination(options.runtime, framework, preset);\n if (!combination.ok) {\n throw new Error(combination.reason);\n }\n\n const ctx: ScaffoldContext = {\n projectName: options.projectName,\n targetDir: root,\n framework,\n preset,\n ...(options.runtime !== undefined ? { runtime: options.runtime } : {}),\n ...(options.db ? { db: options.db, driver: options.driver } : {}),\n ...(options.logger ? { logger: options.logger } : {}),\n ...(options.validator ? { validator: options.validator } : {}),\n };\n\n const addons = resolveAddons(ctx);\n const packages = resolvePackages(ctx);\n const bootBindings = collectBootBindings(ctx);\n const frameworkEntry = FRAMEWORK_ENTRIES[framework];\n const { entry: deployEntry } = resolveDeployEntry(ctx.preset ?? \"node-server\");\n\n await write(\n path.join(root, \"package.json\"),\n packageJsonTemplate(options.projectName, packages.scripts),\n );\n await write(path.join(root, \"tsconfig.json\"), tsconfigTemplate());\n await write(path.join(root, \"vite.config.ts\"), viteConfigTemplate(ctx.preset));\n await write(path.join(root, \".gitignore\"), gitignoreTemplate());\n await write(path.join(root, \"src/context.ts\"), contextTemplate(bootBindings));\n await write(path.join(root, \"src/taser.ts\"), taserTsTemplate());\n await write(path.join(root, \"src/routes/$.ts\"), rootLayoutTemplate());\n await write(path.join(root, \"src/routes/index.get.ts\"), indexRouteTemplate());\n await write(path.join(root, \"src/routes/health.get.ts\"), healthRouteTemplate(ctx));\n\n // Nitro's default preset is node-server — only emit an explicit config when\n // the deployment target differs. Do not emit for preset \"none\".\n if (ctx.preset !== \"node-server\" && ctx.preset !== \"none\") {\n await write(path.join(root, \"nitro.config.ts\"), nitroConfigTemplate(deployEntry.id));\n }\n\n await Promise.all(\n deployEntry.files.map((file) =>\n write(\n path.join(root, file.name),\n typeof file.content === \"function\"\n ? file.content({ projectName: options.projectName })\n : file.content,\n ),\n ),\n );\n\n const serverEntry = frameworkEntry.serverEntry;\n if (serverEntry) {\n await write(path.join(root, serverEntry.fileName), serverEntry.content);\n }\n\n await Promise.all(\n addons.map(async (addon) => {\n await addon.apply(ctx, (filePath, contents) => write(path.join(root, filePath), contents));\n }),\n );\n\n try {\n await copyFile(path.join(root, \".env.example\"), path.join(root, \".env\"));\n } catch {\n // .env.example was not created\n }\n\n await writeProjectConfig(root, ctx);\n\n if (options.skipInstall) {\n return ctx as ScaffoldResult;\n }\n\n const agent = options.agent ?? resolveUserAgent();\n await installPackages(agent, root, {\n dependencies: packages.dependencies,\n devDependencies: packages.devDependencies,\n });\n\n return ctx as ScaffoldResult;\n}\n"],"mappings":"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"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { DeployTarget, Framework, Runtime } from './types.js';
|
|
2
|
-
export type PlatformFile = {
|
|
3
|
-
name: string;
|
|
4
|
-
content: string | ((ctx: {
|
|
5
|
-
projectName: string;
|
|
6
|
-
}) => string);
|
|
7
|
-
};
|
|
8
|
-
export type DeployEntry = {
|
|
9
|
-
id: DeployTarget;
|
|
10
|
-
/** Runtime this target builds for ("workerd" = Cloudflare's V8 runtime). */
|
|
11
|
-
impliedRuntime: Runtime | "workerd";
|
|
12
|
-
/** Whether the built output is a long-running server you start locally. */
|
|
13
|
-
selfHosted: boolean;
|
|
14
|
-
/** `start` script value; null for platform-deployed targets. */
|
|
15
|
-
startScript: string | null;
|
|
16
|
-
/** Runtime/platform tooling devDependencies beyond the base set. */
|
|
17
|
-
devDeps: string[];
|
|
18
|
-
files: PlatformFile[];
|
|
19
|
-
};
|
|
20
|
-
export declare const DEPLOY_ENTRIES: Record<DeployTarget, DeployEntry>;
|
|
21
|
-
export declare const DEFAULT_DEPLOY: DeployTarget;
|
|
22
|
-
export declare const DEFAULT_FRAMEWORK: Framework;
|
|
23
|
-
export declare function isCuratedDeploy(value: string): value is DeployTarget;
|
|
24
|
-
/**
|
|
25
|
-
* Resolves any preset id to its emission entry. Curated ids come from the
|
|
26
|
-
* registry; unknown strings pass through to Nitro verbatim as non-self-hosted
|
|
27
|
-
* node-family targets.
|
|
28
|
-
*/
|
|
29
|
-
export declare function resolveDeployEntry(id: string): {
|
|
30
|
-
entry: DeployEntry;
|
|
31
|
-
curated: boolean;
|
|
32
|
-
};
|
|
33
|
-
/** Runtime overrides permitted for a deploy target; empty = no override. */
|
|
34
|
-
export declare function allowedRuntimeOverrides(id: DeployTarget): readonly Runtime[];
|
|
35
|
-
export type CombinationError = {
|
|
36
|
-
ok: false;
|
|
37
|
-
reason: string;
|
|
38
|
-
};
|
|
39
|
-
export type CombinationOk = {
|
|
40
|
-
ok: true;
|
|
41
|
-
runtime: Runtime | "workerd";
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Validates a runtime × framework × deploy combination.
|
|
45
|
-
*
|
|
46
|
-
* @param runtimeOverride explicit `--runtime` selection, if any
|
|
47
|
-
* @param deploy preset id (curated or passthrough)
|
|
48
|
-
*/
|
|
49
|
-
export declare function validateCombination(runtimeOverride: Runtime | undefined, framework: Framework, deploy: string): CombinationOk | CombinationError;
|
package/dist/esm/core/targets.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { DEPLOY_TARGETS } from "./types.js";
|
|
2
|
-
//#region src/core/targets.ts
|
|
3
|
-
/**
|
|
4
|
-
* Registry for the three scaffold dimensions — runtime, framework, deploy —
|
|
5
|
-
* plus the compatibility rules between them.
|
|
6
|
-
*
|
|
7
|
-
* Dependency direction: deploy implies the runtime family; the effective
|
|
8
|
-
* runtime constrains which frameworks can run. `--runtime` is an override
|
|
9
|
-
* available only where it is meaningful (self-hosted node-family targets).
|
|
10
|
-
*/
|
|
11
|
-
var NODE_START = "node .output/server/index.mjs";
|
|
12
|
-
var DEPLOY_ENTRIES = {
|
|
13
|
-
none: {
|
|
14
|
-
id: "none",
|
|
15
|
-
impliedRuntime: "node",
|
|
16
|
-
selfHosted: true,
|
|
17
|
-
startScript: "node dist/serve.mjs",
|
|
18
|
-
devDeps: [],
|
|
19
|
-
files: []
|
|
20
|
-
},
|
|
21
|
-
"node-server": {
|
|
22
|
-
id: "node-server",
|
|
23
|
-
impliedRuntime: "node",
|
|
24
|
-
selfHosted: true,
|
|
25
|
-
startScript: NODE_START,
|
|
26
|
-
devDeps: [],
|
|
27
|
-
files: []
|
|
28
|
-
},
|
|
29
|
-
"node-cluster": {
|
|
30
|
-
id: "node-cluster",
|
|
31
|
-
impliedRuntime: "node",
|
|
32
|
-
selfHosted: true,
|
|
33
|
-
startScript: NODE_START,
|
|
34
|
-
devDeps: [],
|
|
35
|
-
files: []
|
|
36
|
-
},
|
|
37
|
-
bun: {
|
|
38
|
-
id: "bun",
|
|
39
|
-
impliedRuntime: "bun",
|
|
40
|
-
selfHosted: true,
|
|
41
|
-
startScript: "bun .output/server/index.mjs",
|
|
42
|
-
devDeps: ["@types/bun"],
|
|
43
|
-
files: []
|
|
44
|
-
},
|
|
45
|
-
"deno-server": {
|
|
46
|
-
id: "deno-server",
|
|
47
|
-
impliedRuntime: "deno",
|
|
48
|
-
selfHosted: true,
|
|
49
|
-
startScript: "deno run -A .output/server/index.mjs",
|
|
50
|
-
devDeps: [],
|
|
51
|
-
files: []
|
|
52
|
-
},
|
|
53
|
-
"deno-deploy": {
|
|
54
|
-
id: "deno-deploy",
|
|
55
|
-
impliedRuntime: "deno",
|
|
56
|
-
selfHosted: false,
|
|
57
|
-
startScript: null,
|
|
58
|
-
devDeps: [],
|
|
59
|
-
files: []
|
|
60
|
-
},
|
|
61
|
-
"cloudflare-module": {
|
|
62
|
-
id: "cloudflare-module",
|
|
63
|
-
impliedRuntime: "workerd",
|
|
64
|
-
selfHosted: false,
|
|
65
|
-
startScript: null,
|
|
66
|
-
devDeps: ["wrangler", "@cloudflare/workers-types"],
|
|
67
|
-
files: [{
|
|
68
|
-
name: "wrangler.jsonc",
|
|
69
|
-
content: ({ projectName }) => `${JSON.stringify({
|
|
70
|
-
$schema: "node_modules/wrangler/config-schema.json",
|
|
71
|
-
name: projectName,
|
|
72
|
-
main: ".output/server/index.mjs",
|
|
73
|
-
compatibility_date: "2024-11-01"
|
|
74
|
-
}, null, 2)}\n`
|
|
75
|
-
}]
|
|
76
|
-
},
|
|
77
|
-
vercel: {
|
|
78
|
-
id: "vercel",
|
|
79
|
-
impliedRuntime: "node",
|
|
80
|
-
selfHosted: false,
|
|
81
|
-
startScript: null,
|
|
82
|
-
devDeps: ["@vercel/node"],
|
|
83
|
-
files: []
|
|
84
|
-
},
|
|
85
|
-
"aws-lambda": {
|
|
86
|
-
id: "aws-lambda",
|
|
87
|
-
impliedRuntime: "node",
|
|
88
|
-
selfHosted: false,
|
|
89
|
-
startScript: null,
|
|
90
|
-
devDeps: ["@types/aws-lambda"],
|
|
91
|
-
files: []
|
|
92
|
-
},
|
|
93
|
-
netlify: {
|
|
94
|
-
id: "netlify",
|
|
95
|
-
impliedRuntime: "node",
|
|
96
|
-
selfHosted: false,
|
|
97
|
-
startScript: null,
|
|
98
|
-
devDeps: [],
|
|
99
|
-
files: []
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
/** Runtimes a `--runtime` override may select per self-hosted deploy target. */
|
|
103
|
-
var RUNTIME_OVERRIDES = {
|
|
104
|
-
none: ["node", "bun"],
|
|
105
|
-
"node-server": ["node", "bun"],
|
|
106
|
-
"node-cluster": ["node", "bun"]
|
|
107
|
-
};
|
|
108
|
-
var DEFAULT_DEPLOY = "node-server";
|
|
109
|
-
function isCuratedDeploy(value) {
|
|
110
|
-
return DEPLOY_TARGETS.includes(value);
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Resolves any preset id to its emission entry. Curated ids come from the
|
|
114
|
-
* registry; unknown strings pass through to Nitro verbatim as non-self-hosted
|
|
115
|
-
* node-family targets.
|
|
116
|
-
*/
|
|
117
|
-
function resolveDeployEntry(id) {
|
|
118
|
-
if (isCuratedDeploy(id)) return {
|
|
119
|
-
entry: DEPLOY_ENTRIES[id],
|
|
120
|
-
curated: true
|
|
121
|
-
};
|
|
122
|
-
return {
|
|
123
|
-
entry: {
|
|
124
|
-
id,
|
|
125
|
-
impliedRuntime: "node",
|
|
126
|
-
selfHosted: false,
|
|
127
|
-
startScript: null,
|
|
128
|
-
devDeps: [],
|
|
129
|
-
files: []
|
|
130
|
-
},
|
|
131
|
-
curated: false
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
/** Runtime overrides permitted for a deploy target; empty = no override. */
|
|
135
|
-
function allowedRuntimeOverrides(id) {
|
|
136
|
-
return RUNTIME_OVERRIDES[id] ?? [];
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Validates a runtime × framework × deploy combination.
|
|
140
|
-
*
|
|
141
|
-
* @param runtimeOverride explicit `--runtime` selection, if any
|
|
142
|
-
* @param deploy preset id (curated or passthrough)
|
|
143
|
-
*/
|
|
144
|
-
function validateCombination(runtimeOverride, framework, deploy) {
|
|
145
|
-
const { entry } = resolveDeployEntry(deploy);
|
|
146
|
-
if (runtimeOverride !== void 0) {
|
|
147
|
-
const allowed = entry.selfHosted ? allowedRuntimeOverrides(entry.id) : [];
|
|
148
|
-
if (!allowed.includes(runtimeOverride)) return {
|
|
149
|
-
ok: false,
|
|
150
|
-
reason: `Runtime "${runtimeOverride}" is not valid for deploy target "${entry.id}". ` + (allowed.length > 0 ? `Allowed overrides: ${allowed.join(", ")}.` : `It implies runtime "${String(entry.impliedRuntime)}".`)
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
const effective = runtimeOverride ?? entry.impliedRuntime;
|
|
154
|
-
if ((framework === "express" || framework === "fastify") && effective !== "node") return {
|
|
155
|
-
ok: false,
|
|
156
|
-
reason: `Framework "${framework}" requires the Node runtime, but deploy target "${entry.id}" implies "${String(effective)}".`
|
|
157
|
-
};
|
|
158
|
-
return {
|
|
159
|
-
ok: true,
|
|
160
|
-
runtime: effective
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
//#endregion
|
|
164
|
-
export { DEFAULT_DEPLOY, DEPLOY_ENTRIES, allowedRuntimeOverrides, isCuratedDeploy, resolveDeployEntry, validateCombination };
|
|
165
|
-
|
|
166
|
-
//# sourceMappingURL=targets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"targets.js","names":[],"sources":["../../../src/core/targets.ts"],"sourcesContent":["/**\n * Registry for the three scaffold dimensions — runtime, framework, deploy —\n * plus the compatibility rules between them.\n *\n * Dependency direction: deploy implies the runtime family; the effective\n * runtime constrains which frameworks can run. `--runtime` is an override\n * available only where it is meaningful (self-hosted node-family targets).\n */\nimport { DEPLOY_TARGETS, type DeployTarget, type Framework, type Runtime } from \"./types.js\";\n\nexport type PlatformFile = {\n name: string;\n content: string | ((ctx: { projectName: string }) => string);\n};\n\nexport type DeployEntry = {\n id: DeployTarget;\n /** Runtime this target builds for (\"workerd\" = Cloudflare's V8 runtime). */\n impliedRuntime: Runtime | \"workerd\";\n /** Whether the built output is a long-running server you start locally. */\n selfHosted: boolean;\n /** `start` script value; null for platform-deployed targets. */\n startScript: string | null;\n /** Runtime/platform tooling devDependencies beyond the base set. */\n devDeps: string[];\n files: PlatformFile[];\n};\n\nconst NODE_START = \"node .output/server/index.mjs\";\n\nexport const DEPLOY_ENTRIES: Record<DeployTarget, DeployEntry> = {\n none: {\n id: \"none\",\n impliedRuntime: \"node\",\n selfHosted: true,\n startScript: \"node dist/serve.mjs\",\n devDeps: [],\n files: [],\n },\n \"node-server\": {\n id: \"node-server\",\n impliedRuntime: \"node\",\n selfHosted: true,\n startScript: NODE_START,\n devDeps: [],\n files: [],\n },\n \"node-cluster\": {\n id: \"node-cluster\",\n impliedRuntime: \"node\",\n selfHosted: true,\n startScript: NODE_START,\n devDeps: [],\n files: [],\n },\n bun: {\n id: \"bun\",\n impliedRuntime: \"bun\",\n selfHosted: true,\n startScript: \"bun .output/server/index.mjs\",\n devDeps: [\"@types/bun\"],\n files: [],\n },\n \"deno-server\": {\n id: \"deno-server\",\n impliedRuntime: \"deno\",\n selfHosted: true,\n startScript: \"deno run -A .output/server/index.mjs\",\n devDeps: [],\n files: [],\n },\n \"deno-deploy\": {\n id: \"deno-deploy\",\n impliedRuntime: \"deno\",\n selfHosted: false,\n startScript: null,\n devDeps: [],\n files: [],\n },\n \"cloudflare-module\": {\n id: \"cloudflare-module\",\n impliedRuntime: \"workerd\",\n selfHosted: false,\n startScript: null,\n devDeps: [\"wrangler\", \"@cloudflare/workers-types\"],\n files: [\n {\n name: \"wrangler.jsonc\",\n content: ({ projectName }) =>\n `${JSON.stringify(\n {\n $schema: \"node_modules/wrangler/config-schema.json\",\n name: projectName,\n main: \".output/server/index.mjs\",\n compatibility_date: \"2024-11-01\",\n },\n null,\n 2,\n )}\\n`,\n },\n ],\n },\n vercel: {\n id: \"vercel\",\n impliedRuntime: \"node\",\n selfHosted: false,\n startScript: null,\n devDeps: [\"@vercel/node\"],\n files: [],\n },\n \"aws-lambda\": {\n id: \"aws-lambda\",\n impliedRuntime: \"node\",\n selfHosted: false,\n startScript: null,\n devDeps: [\"@types/aws-lambda\"],\n files: [],\n },\n netlify: {\n id: \"netlify\",\n impliedRuntime: \"node\",\n selfHosted: false,\n startScript: null,\n devDeps: [],\n files: [],\n },\n};\n\n/** Runtimes a `--runtime` override may select per self-hosted deploy target. */\nconst RUNTIME_OVERRIDES: Partial<Record<DeployTarget, readonly Runtime[]>> = {\n none: [\"node\", \"bun\"],\n \"node-server\": [\"node\", \"bun\"],\n \"node-cluster\": [\"node\", \"bun\"],\n};\n\nexport const DEFAULT_DEPLOY: DeployTarget = \"node-server\";\nexport const DEFAULT_FRAMEWORK: Framework = \"none\";\n\nexport function isCuratedDeploy(value: string): value is DeployTarget {\n return (DEPLOY_TARGETS as readonly string[]).includes(value);\n}\n\n/**\n * Resolves any preset id to its emission entry. Curated ids come from the\n * registry; unknown strings pass through to Nitro verbatim as non-self-hosted\n * node-family targets.\n */\nexport function resolveDeployEntry(id: string): { entry: DeployEntry; curated: boolean } {\n if (isCuratedDeploy(id)) {\n return { entry: DEPLOY_ENTRIES[id], curated: true };\n }\n return {\n entry: {\n // Cast: passthrough ids are valid Nitro PresetNameInputs by contract.\n id: id as DeployTarget,\n impliedRuntime: \"node\",\n selfHosted: false,\n startScript: null,\n devDeps: [],\n files: [],\n },\n curated: false,\n };\n}\n\n/** Runtime overrides permitted for a deploy target; empty = no override. */\nexport function allowedRuntimeOverrides(id: DeployTarget): readonly Runtime[] {\n return RUNTIME_OVERRIDES[id] ?? [];\n}\n\nexport type CombinationError = { ok: false; reason: string };\nexport type CombinationOk = { ok: true; runtime: Runtime | \"workerd\" };\n\n/**\n * Validates a runtime × framework × deploy combination.\n *\n * @param runtimeOverride explicit `--runtime` selection, if any\n * @param deploy preset id (curated or passthrough)\n */\nexport function validateCombination(\n runtimeOverride: Runtime | undefined,\n framework: Framework,\n deploy: string,\n): CombinationOk | CombinationError {\n const { entry } = resolveDeployEntry(deploy);\n\n if (runtimeOverride !== undefined) {\n const allowed = entry.selfHosted ? allowedRuntimeOverrides(entry.id) : [];\n if (!allowed.includes(runtimeOverride)) {\n return {\n ok: false,\n reason:\n `Runtime \"${runtimeOverride}\" is not valid for deploy target \"${entry.id}\". ` +\n (allowed.length > 0\n ? `Allowed overrides: ${allowed.join(\", \")}.`\n : `It implies runtime \"${String(entry.impliedRuntime)}\".`),\n };\n }\n }\n\n const effective = runtimeOverride ?? entry.impliedRuntime;\n\n if ((framework === \"express\" || framework === \"fastify\") && effective !== \"node\") {\n return {\n ok: false,\n reason: `Framework \"${framework}\" requires the Node runtime, but deploy target \"${entry.id}\" implies \"${String(effective)}\".`,\n };\n }\n\n return { ok: true, runtime: effective };\n}\n"],"mappings":"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"}
|
package/dist/esm/core/types.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Agent } from 'package-manager-detector';
|
|
2
|
-
/** Host framework layered on top of pure Taser.js pass-through dispatch. */
|
|
3
|
-
export type Framework = "none" | "hono" | "express" | "fastify";
|
|
4
|
-
export declare const FRAMEWORKS: readonly Framework[];
|
|
5
|
-
export type Runtime = "node" | "bun" | "deno";
|
|
6
|
-
export declare const RUNTIMES: readonly Runtime[];
|
|
7
|
-
/**
|
|
8
|
-
* Deployment target. Values are Nitro preset ids (see `nitro/config`
|
|
9
|
-
* PresetNameInput) so `--preset` passes straight through to Nitro.
|
|
10
|
-
*/
|
|
11
|
-
export type DeployTarget = "none" | "node-server" | "node-cluster" | "bun" | "deno-server" | "deno-deploy" | "cloudflare-module" | "vercel" | "aws-lambda" | "netlify";
|
|
12
|
-
export declare const DEPLOY_TARGETS: readonly DeployTarget[];
|
|
13
|
-
export type DbOdm = "drizzle" | "prisma" | "kysely";
|
|
14
|
-
export declare const DB_ODMS: readonly DbOdm[];
|
|
15
|
-
export type DbDriver = "postgres" | "sqlite" | "mysql";
|
|
16
|
-
export declare const DB_DRIVERS: readonly DbDriver[];
|
|
17
|
-
export declare const DEFAULT_DB_DRIVER: DbDriver;
|
|
18
|
-
export type LoggerId = "pino" | "winston";
|
|
19
|
-
export declare const LOGGERS: readonly LoggerId[];
|
|
20
|
-
export type ValidatorId = "zod" | "arktype" | "valibot";
|
|
21
|
-
export declare const VALIDATORS: readonly ValidatorId[];
|
|
22
|
-
export type PackageGroups = {
|
|
23
|
-
dependencies: string[];
|
|
24
|
-
devDependencies: string[];
|
|
25
|
-
scripts: Record<string, string>;
|
|
26
|
-
};
|
|
27
|
-
export type ScaffoldContext = {
|
|
28
|
-
projectName: string;
|
|
29
|
-
targetDir: string;
|
|
30
|
-
/** Host framework; "none" is pure Taser.js pass-through dispatch. Defaults to "none". */
|
|
31
|
-
framework?: Framework;
|
|
32
|
-
/** Deployment target — a Nitro preset id. Defaults to "node-server". */
|
|
33
|
-
preset?: DeployTarget;
|
|
34
|
-
/** Set only when explicitly overriding the runtime implied by the preset. */
|
|
35
|
-
runtime?: Runtime;
|
|
36
|
-
db?: DbOdm;
|
|
37
|
-
driver?: DbDriver;
|
|
38
|
-
logger?: LoggerId;
|
|
39
|
-
validator?: ValidatorId;
|
|
40
|
-
};
|
|
41
|
-
export type ScaffoldOptions = ScaffoldContext & {
|
|
42
|
-
skipInstall?: boolean;
|
|
43
|
-
agent?: Agent;
|
|
44
|
-
};
|
|
45
|
-
export type ScaffoldResult = ScaffoldContext;
|
|
46
|
-
export type CapabilitiesCatalog = {
|
|
47
|
-
frameworks: Framework[];
|
|
48
|
-
deployTargets: DeployTarget[];
|
|
49
|
-
runtimes: Runtime[];
|
|
50
|
-
db: {
|
|
51
|
-
odms: DbOdm[];
|
|
52
|
-
drivers: DbDriver[];
|
|
53
|
-
defaultDriver: DbDriver;
|
|
54
|
-
};
|
|
55
|
-
loggers: LoggerId[];
|
|
56
|
-
validators: ValidatorId[];
|
|
57
|
-
};
|
package/dist/esm/core/types.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//#region src/core/types.ts
|
|
2
|
-
var FRAMEWORKS = [
|
|
3
|
-
"none",
|
|
4
|
-
"hono",
|
|
5
|
-
"express",
|
|
6
|
-
"fastify"
|
|
7
|
-
];
|
|
8
|
-
var RUNTIMES = [
|
|
9
|
-
"node",
|
|
10
|
-
"bun",
|
|
11
|
-
"deno"
|
|
12
|
-
];
|
|
13
|
-
var DEPLOY_TARGETS = [
|
|
14
|
-
"none",
|
|
15
|
-
"node-server",
|
|
16
|
-
"node-cluster",
|
|
17
|
-
"bun",
|
|
18
|
-
"deno-server",
|
|
19
|
-
"deno-deploy",
|
|
20
|
-
"cloudflare-module",
|
|
21
|
-
"vercel",
|
|
22
|
-
"aws-lambda",
|
|
23
|
-
"netlify"
|
|
24
|
-
];
|
|
25
|
-
var DB_ODMS = [
|
|
26
|
-
"drizzle",
|
|
27
|
-
"prisma",
|
|
28
|
-
"kysely"
|
|
29
|
-
];
|
|
30
|
-
var DB_DRIVERS = [
|
|
31
|
-
"postgres",
|
|
32
|
-
"sqlite",
|
|
33
|
-
"mysql"
|
|
34
|
-
];
|
|
35
|
-
var DEFAULT_DB_DRIVER = "sqlite";
|
|
36
|
-
var LOGGERS = ["pino", "winston"];
|
|
37
|
-
var VALIDATORS = [
|
|
38
|
-
"zod",
|
|
39
|
-
"arktype",
|
|
40
|
-
"valibot"
|
|
41
|
-
];
|
|
42
|
-
//#endregion
|
|
43
|
-
export { DB_DRIVERS, DB_ODMS, DEFAULT_DB_DRIVER, DEPLOY_TARGETS, FRAMEWORKS, LOGGERS, RUNTIMES, VALIDATORS };
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/core/types.ts"],"sourcesContent":["import type { Agent } from \"package-manager-detector\";\n\n/** Host framework layered on top of pure Taser.js pass-through dispatch. */\nexport type Framework = \"none\" | \"hono\" | \"express\" | \"fastify\";\n\nexport const FRAMEWORKS: readonly Framework[] = [\"none\", \"hono\", \"express\", \"fastify\"];\n\nexport type Runtime = \"node\" | \"bun\" | \"deno\";\n\nexport const RUNTIMES: readonly Runtime[] = [\"node\", \"bun\", \"deno\"];\n\n/**\n * Deployment target. Values are Nitro preset ids (see `nitro/config`\n * PresetNameInput) so `--preset` passes straight through to Nitro.\n */\nexport type DeployTarget =\n | \"none\"\n | \"node-server\"\n | \"node-cluster\"\n | \"bun\"\n | \"deno-server\"\n | \"deno-deploy\"\n | \"cloudflare-module\"\n | \"vercel\"\n | \"aws-lambda\"\n | \"netlify\";\n\nexport const DEPLOY_TARGETS: readonly DeployTarget[] = [\n \"none\",\n \"node-server\",\n \"node-cluster\",\n \"bun\",\n \"deno-server\",\n \"deno-deploy\",\n \"cloudflare-module\",\n \"vercel\",\n \"aws-lambda\",\n \"netlify\",\n];\n\nexport type DbOdm = \"drizzle\" | \"prisma\" | \"kysely\";\n\nexport const DB_ODMS: readonly DbOdm[] = [\"drizzle\", \"prisma\", \"kysely\"];\n\nexport type DbDriver = \"postgres\" | \"sqlite\" | \"mysql\";\n\nexport const DB_DRIVERS: readonly DbDriver[] = [\"postgres\", \"sqlite\", \"mysql\"];\n\nexport const DEFAULT_DB_DRIVER: DbDriver = \"sqlite\";\n\nexport type LoggerId = \"pino\" | \"winston\";\n\nexport const LOGGERS: readonly LoggerId[] = [\"pino\", \"winston\"];\n\nexport type ValidatorId = \"zod\" | \"arktype\" | \"valibot\";\n\nexport const VALIDATORS: readonly ValidatorId[] = [\"zod\", \"arktype\", \"valibot\"];\n\nexport type PackageGroups = {\n dependencies: string[];\n devDependencies: string[];\n scripts: Record<string, string>;\n};\n\nexport type ScaffoldContext = {\n projectName: string;\n targetDir: string;\n /** Host framework; \"none\" is pure Taser.js pass-through dispatch. Defaults to \"none\". */\n framework?: Framework;\n /** Deployment target — a Nitro preset id. Defaults to \"node-server\". */\n preset?: DeployTarget;\n /** Set only when explicitly overriding the runtime implied by the preset. */\n runtime?: Runtime;\n db?: DbOdm;\n driver?: DbDriver;\n logger?: LoggerId;\n validator?: ValidatorId;\n};\n\nexport type ScaffoldOptions = ScaffoldContext & {\n skipInstall?: boolean;\n agent?: Agent;\n};\n\nexport type ScaffoldResult = ScaffoldContext;\n\nexport type CapabilitiesCatalog = {\n frameworks: Framework[];\n deployTargets: DeployTarget[];\n runtimes: Runtime[];\n db: {\n odms: DbOdm[];\n drivers: DbDriver[];\n defaultDriver: DbDriver;\n };\n loggers: LoggerId[];\n validators: ValidatorId[];\n};\n"],"mappings":";AAKA,IAAa,aAAmC;CAAC;CAAQ;CAAQ;CAAW;AAAS;AAIrF,IAAa,WAA+B;CAAC;CAAQ;CAAO;AAAM;AAkBlE,IAAa,iBAA0C;CACrD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,IAAa,UAA4B;CAAC;CAAW;CAAU;AAAQ;AAIvE,IAAa,aAAkC;CAAC;CAAY;CAAU;AAAO;AAE7E,IAAa,oBAA8B;AAI3C,IAAa,UAA+B,CAAC,QAAQ,SAAS;AAI9D,IAAa,aAAqC;CAAC;CAAO;CAAW;AAAS"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function validateProjectName(name: string, cwd?: string): string | undefined;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
//#region src/core/validate-project-name.ts
|
|
3
|
-
var RESERVED_WINDOWS_NAMES = /* @__PURE__ */ new Set([
|
|
4
|
-
"CON",
|
|
5
|
-
"PRN",
|
|
6
|
-
"AUX",
|
|
7
|
-
"NVR",
|
|
8
|
-
"NULL",
|
|
9
|
-
"COM1",
|
|
10
|
-
"COM2",
|
|
11
|
-
"COM3",
|
|
12
|
-
"COM4",
|
|
13
|
-
"COM5",
|
|
14
|
-
"COM6",
|
|
15
|
-
"COM7",
|
|
16
|
-
"COM8",
|
|
17
|
-
"COM9",
|
|
18
|
-
"LPT1",
|
|
19
|
-
"LPT2",
|
|
20
|
-
"LPT3",
|
|
21
|
-
"LPT4",
|
|
22
|
-
"LPT5",
|
|
23
|
-
"LPT6",
|
|
24
|
-
"LPT7",
|
|
25
|
-
"LPT8",
|
|
26
|
-
"LPT9"
|
|
27
|
-
]);
|
|
28
|
-
function validateProjectName(name, cwd = process.cwd()) {
|
|
29
|
-
const trimmed = name.trim();
|
|
30
|
-
if (!trimmed) return "Project name is required";
|
|
31
|
-
if (trimmed.includes("..")) return "Project name cannot contain \"..\"";
|
|
32
|
-
if (trimmed.startsWith(".") || trimmed.endsWith(".")) return "Project name cannot start or end with a dot";
|
|
33
|
-
const baseName = trimmed.split(".")[0]?.toUpperCase();
|
|
34
|
-
if (baseName && RESERVED_WINDOWS_NAMES.has(baseName)) return `Project name "${trimmed}" is reserved on Windows`;
|
|
35
|
-
const targetDir = path.resolve(cwd, trimmed);
|
|
36
|
-
const relative = path.relative(cwd, targetDir);
|
|
37
|
-
if (relative.startsWith("..") || path.isAbsolute(relative)) return "Project name resolves outside the current directory";
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
export { validateProjectName };
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=validate-project-name.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-project-name.js","names":[],"sources":["../../../src/core/validate-project-name.ts"],"sourcesContent":["import path from \"node:path\";\n\nconst RESERVED_WINDOWS_NAMES = new Set([\n \"CON\",\n \"PRN\",\n \"AUX\",\n \"NVR\",\n \"NULL\",\n \"COM1\",\n \"COM2\",\n \"COM3\",\n \"COM4\",\n \"COM5\",\n \"COM6\",\n \"COM7\",\n \"COM8\",\n \"COM9\",\n \"LPT1\",\n \"LPT2\",\n \"LPT3\",\n \"LPT4\",\n \"LPT5\",\n \"LPT6\",\n \"LPT7\",\n \"LPT8\",\n \"LPT9\",\n]);\n\nexport function validateProjectName(name: string, cwd = process.cwd()): string | undefined {\n const trimmed = name.trim();\n if (!trimmed) {\n return \"Project name is required\";\n }\n\n if (trimmed.includes(\"..\")) {\n return 'Project name cannot contain \"..\"';\n }\n\n if (trimmed.startsWith(\".\") || trimmed.endsWith(\".\")) {\n return \"Project name cannot start or end with a dot\";\n }\n\n const baseName = trimmed.split(\".\")[0]?.toUpperCase();\n if (baseName && RESERVED_WINDOWS_NAMES.has(baseName)) {\n return `Project name \"${trimmed}\" is reserved on Windows`;\n }\n\n const targetDir = path.resolve(cwd, trimmed);\n const relative = path.relative(cwd, targetDir);\n if (relative.startsWith(\"..\") || path.isAbsolute(relative)) {\n return \"Project name resolves outside the current directory\";\n }\n\n return undefined;\n}\n"],"mappings":";;AAEA,IAAM,yCAAyB,IAAI,IAAI;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,oBAAoB,MAAc,MAAM,QAAQ,IAAI,GAAuB;CACzF,MAAM,UAAU,KAAK,KAAK;CAC1B,IAAI,CAAC,SACH,OAAO;CAGT,IAAI,QAAQ,SAAS,IAAI,GACvB,OAAO;CAGT,IAAI,QAAQ,WAAW,GAAG,KAAK,QAAQ,SAAS,GAAG,GACjD,OAAO;CAGT,MAAM,WAAW,QAAQ,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,YAAY;CACpD,IAAI,YAAY,uBAAuB,IAAI,QAAQ,GACjD,OAAO,iBAAiB,QAAQ;CAGlC,MAAM,YAAY,KAAK,QAAQ,KAAK,OAAO;CAC3C,MAAM,WAAW,KAAK,SAAS,KAAK,SAAS;CAC7C,IAAI,SAAS,WAAW,IAAI,KAAK,KAAK,WAAW,QAAQ,GACvD,OAAO;AAIX"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DeployTarget, Framework } from '../core/types.js';
|
|
2
|
-
export declare function serverEntryTemplate(framework: Framework): {
|
|
3
|
-
fileName: string;
|
|
4
|
-
content: string;
|
|
5
|
-
} | null;
|
|
6
|
-
export type FrameworkEntry = {
|
|
7
|
-
id: Framework;
|
|
8
|
-
serverEntry: {
|
|
9
|
-
fileName: string;
|
|
10
|
-
content: string;
|
|
11
|
-
} | null;
|
|
12
|
-
deps: string[];
|
|
13
|
-
devDeps: string[];
|
|
14
|
-
};
|
|
15
|
-
export declare const FRAMEWORK_ENTRIES: Record<Framework, FrameworkEntry>;
|
|
16
|
-
export declare function nitroConfigTemplate(nitroPreset: string): string;
|
|
17
|
-
export declare function viteConfigTemplate(preset?: DeployTarget): string;
|
|
18
|
-
export declare function taserTsTemplate(): string;
|