@cosmicdrift/kumiko-dev-server 0.76.0 → 0.77.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-dev-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.1",
|
|
4
4
|
"description": "Development server bootstrap for Kumiko apps. Bundles the client, mints dev-JWTs, injects the resolved AppSchema, and seeds an admin. Not for production.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"kumiko-schema-check": "./bin/kumiko-schema-check.ts"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
54
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
53
|
+
"@cosmicdrift/kumiko-bundled-features": "0.77.1",
|
|
54
|
+
"@cosmicdrift/kumiko-framework": "0.77.1",
|
|
55
55
|
"ts-morph": "^28.0.0"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
@@ -71,6 +71,33 @@ describe("scaffoldApp", () => {
|
|
|
71
71
|
expect(env).toContain("KUMIKO_DEV_DB_NAME=my_shop_dev");
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
+
test("README lists the mounted features dynamically", () => {
|
|
75
|
+
const dest = join(tmp, "my-shop");
|
|
76
|
+
scaffoldApp({
|
|
77
|
+
name: "my-shop",
|
|
78
|
+
destination: dest,
|
|
79
|
+
features: [
|
|
80
|
+
{
|
|
81
|
+
name: "tenant",
|
|
82
|
+
importPath: "@cosmicdrift/kumiko-bundled-features/tenant",
|
|
83
|
+
exportName: "createTenantFeature",
|
|
84
|
+
callExpression: "createTenantFeature()",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "delivery",
|
|
88
|
+
importPath: "@cosmicdrift/kumiko-bundled-features/delivery",
|
|
89
|
+
exportName: "createDeliveryFeature",
|
|
90
|
+
callExpression: "createDeliveryFeature()",
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const readme = readFileSync(join(dest, "README.md"), "utf-8");
|
|
96
|
+
expect(readme).toContain("## Mounted features");
|
|
97
|
+
expect(readme).toContain("- `tenant`");
|
|
98
|
+
expect(readme).toContain("- `delivery`");
|
|
99
|
+
});
|
|
100
|
+
|
|
74
101
|
test("bin/main.ts contains runProdApp + auth.admin stub", () => {
|
|
75
102
|
const dest = join(tmp, "my-shop");
|
|
76
103
|
scaffoldApp({ name: "my-shop", destination: dest });
|
package/src/scaffold-app.ts
CHANGED
|
@@ -86,7 +86,7 @@ export function scaffoldApp(options: ScaffoldAppOptions): ScaffoldAppResult {
|
|
|
86
86
|
write(join(destination, ".env.example"), renderEnvExample(options.name));
|
|
87
87
|
files.push(".env.example");
|
|
88
88
|
|
|
89
|
-
write(join(destination, "README.md"), renderReadme(options.name));
|
|
89
|
+
write(join(destination, "README.md"), renderReadme(options.name, options.features));
|
|
90
90
|
files.push("README.md");
|
|
91
91
|
|
|
92
92
|
return { destination, files, appName: options.name };
|
|
@@ -410,13 +410,26 @@ KUMIKO_DEV_DB_NAME=${appName.replace(/-/g, "_")}_dev
|
|
|
410
410
|
`;
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
function renderReadme(
|
|
413
|
+
function renderReadme(
|
|
414
|
+
appName: string,
|
|
415
|
+
features: ReadonlyArray<ScaffoldFeatureEntry> | undefined,
|
|
416
|
+
): string {
|
|
417
|
+
const featureList =
|
|
418
|
+
features && features.length > 0
|
|
419
|
+
? features.map((f) => `- \`${f.name}\``).join("\n")
|
|
420
|
+
: "- `secrets` (foundation)\n- `sessions` (foundation)";
|
|
414
421
|
return `# ${appName}
|
|
415
422
|
|
|
416
423
|
Scaffolded by \`bun create kumiko-app\`. Boots out-of-the-box with the picked
|
|
417
424
|
feature stack mounted. Add features by editing \`src/run-config.ts\` or via
|
|
418
425
|
\`bunx @cosmicdrift/kumiko-cli add feature <name>\`.
|
|
419
426
|
|
|
427
|
+
## Mounted features
|
|
428
|
+
|
|
429
|
+
${featureList}
|
|
430
|
+
|
|
431
|
+
Edit \`src/run-config.ts\` to add or remove.
|
|
432
|
+
|
|
420
433
|
## First run
|
|
421
434
|
|
|
422
435
|
\`\`\`sh
|