feat: add application productivity foundations
This commit is contained in:
1 parent
46195462c3
commit
64ab20cc95
42 files changed
+1533
-40
No files matched your search
@@ -7,6 +7,7 @@
|
||||
|
||||
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
||||
import { dirname, join, resolve } from "node:path";
|
||||
import { runAdd } from "./add.ts";
|
||||
import { AI_GUIDE, CLAUDE_MD } from "./ai-guide.ts";
|
||||
import { currentCliVersion } from "./update-notifier.ts";
|
||||
|
||||
@@ -672,13 +673,26 @@ export function scaffoldApp(root: string, appName: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
export function createApp(name: string): void {
|
||||
export function createApp(name: string, options: readonly string[] = []): void {
|
||||
if (!name) {
|
||||
console.error("Usage: wrnexus create <app-name>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
scaffoldApp(resolve(process.cwd(), name), name);
|
||||
const root = resolve(process.cwd(), name);
|
||||
scaffoldApp(root, name);
|
||||
const preset = options.find((value) => value.startsWith("--preset="))?.split("=")[1];
|
||||
const requested =
|
||||
options
|
||||
.find((value) => value.startsWith("--features="))
|
||||
?.split("=")[1]
|
||||
?.split(",") ?? [];
|
||||
const features = new Set([
|
||||
...(preset === "saas" ? ["queue", "mail", "seed", "testing"] : []),
|
||||
...(preset === "email" ? ["queue", "mail", "testing"] : []),
|
||||
...requested,
|
||||
]);
|
||||
for (const feature of features) runAdd(root, feature);
|
||||
|
||||
console.log(`✓ Created ${name}`);
|
||||
console.log(`\nNext steps:`);
|
||||
|
||||
Reference in new issue
Block a user