create-kofi-stack 2.1.33 → 2.1.36

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.
Files changed (2) hide show
  1. package/dist/index.js +48 -2
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -47,7 +47,8 @@ async function runPrompts(projectNameArg, options) {
47
47
  addons: [
48
48
  ...options.rateLimiting ? ["rate-limiting"] : [],
49
49
  ...options.monitoring ? ["monitoring"] : []
50
- ]
50
+ ],
51
+ optionalApps: []
51
52
  };
52
53
  }
53
54
  const name = projectNameArg ? projectName : await p.text({
@@ -97,6 +98,32 @@ async function runPrompts(projectNameArg, options) {
97
98
  });
98
99
  if (p.isCancel(marketingSite)) throw new Error("cancelled");
99
100
  }
101
+ let optionalApps = [];
102
+ if (structure === "monorepo") {
103
+ const optionalAppsOptions = [
104
+ {
105
+ value: "design-system",
106
+ label: "Design System",
107
+ hint: "Color palette, typography, components showcase (port 3002)"
108
+ },
109
+ {
110
+ value: "mobile",
111
+ label: "Mobile App",
112
+ hint: "Expo React Native app scaffold"
113
+ },
114
+ {
115
+ value: "admin",
116
+ label: "Admin Dashboard",
117
+ hint: "User management, analytics, settings (port 3003)"
118
+ }
119
+ ];
120
+ optionalApps = await p.multiselect({
121
+ message: "Optional apps to include?",
122
+ options: optionalAppsOptions,
123
+ required: false
124
+ });
125
+ if (p.isCancel(optionalApps)) throw new Error("cancelled");
126
+ }
100
127
  const componentLibraryOptions = [
101
128
  { value: "base", label: "Base UI", hint: "Recommended - Headless, unstyled primitives" },
102
129
  { value: "radix", label: "Radix UI", hint: "Full-featured accessible primitives" }
@@ -289,6 +316,7 @@ async function runPrompts(projectNameArg, options) {
289
316
  `${pc.cyan("Project:")} ${name}`,
290
317
  `${pc.cyan("Structure:")} ${structure}`,
291
318
  structure === "monorepo" ? `${pc.cyan("Marketing:")} ${marketingSite}` : null,
319
+ optionalApps.length > 0 ? `${pc.cyan("Optional Apps:")} ${optionalApps.join(", ")}` : null,
292
320
  "",
293
321
  pc.dim("\u2500\u2500\u2500 Design System \u2500\u2500\u2500"),
294
322
  `${pc.cyan("Component Library:")} ${componentLibrary}`,
@@ -340,6 +368,7 @@ async function runPrompts(projectNameArg, options) {
340
368
  payloadStorage
341
369
  },
342
370
  addons: addonsSelected,
371
+ optionalApps,
343
372
  packageManager: "pnpm"
344
373
  };
345
374
  }
@@ -394,6 +423,22 @@ function getShadcnBaseColor(config) {
394
423
  const validColors = ["neutral", "gray", "zinc", "stone", "slate"];
395
424
  return validColors.includes(baseColor) ? baseColor : "neutral";
396
425
  }
426
+ function buildShadcnPresetUrl(config) {
427
+ const shadcn = config.shadcn || {};
428
+ const params = new URLSearchParams({
429
+ base: shadcn.componentLibrary || "base",
430
+ style: shadcn.style || "nova",
431
+ baseColor: shadcn.baseColor || "neutral",
432
+ theme: shadcn.themeColor || "neutral",
433
+ iconLibrary: shadcn.iconLibrary || "hugeicons",
434
+ font: shadcn.font || "inter",
435
+ menuAccent: shadcn.menuAccent || "subtle",
436
+ menuColor: shadcn.menuColor || "default",
437
+ radius: shadcn.radius || "default",
438
+ template: "next"
439
+ });
440
+ return `https://ui.shadcn.com/init?${params.toString()}`;
441
+ }
397
442
  async function updateEnvWithSecrets(envPath, secrets) {
398
443
  if (!await fs.pathExists(envPath)) {
399
444
  return;
@@ -417,10 +462,11 @@ async function generateProject(config, options = {}) {
417
462
  console.log();
418
463
  try {
419
464
  const baseColor = getShadcnBaseColor(config);
465
+ const presetUrl = buildShadcnPresetUrl(config);
420
466
  if (config.structure === "standalone") {
421
467
  spinner.start("Creating project with shadcn/ui...");
422
468
  try {
423
- await execa("pnpm", ["dlx", "shadcn@latest", "create", config.projectName, "--template", "next", "--base-color", baseColor, "--src-dir"], {
469
+ await execa("pnpm", ["dlx", "shadcn@latest", "create", config.projectName, "--preset", presetUrl], {
424
470
  cwd: path2.dirname(config.targetDir),
425
471
  stdio: "pipe"
426
472
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kofi-stack",
3
- "version": "2.1.33",
3
+ "version": "2.1.36",
4
4
  "description": "Scaffold opinionated full-stack projects with Next.js, Convex, Better-Auth, and more",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,8 +9,14 @@
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
+ "scripts": {
13
+ "build": "tsup src/index.ts --format esm --dts",
14
+ "dev": "tsup src/index.ts --format esm --watch",
15
+ "start": "node dist/index.js",
16
+ "typecheck": "tsc --noEmit"
17
+ },
12
18
  "dependencies": {
13
- "kofi-stack-template-generator": "^2.1.27",
19
+ "kofi-stack-template-generator": "^2.1.28",
14
20
  "kofi-stack-types": "^2.2.0",
15
21
  "@clack/prompts": "^0.7.0",
16
22
  "commander": "^12.0.0",
@@ -50,11 +56,5 @@
50
56
  "bugs": {
51
57
  "url": "https://github.com/theodenanyoh11/create-kofi-stack/issues"
52
58
  },
53
- "homepage": "https://github.com/theodenanyoh11/create-kofi-stack#readme",
54
- "scripts": {
55
- "build": "tsup src/index.ts --format esm --dts",
56
- "dev": "tsup src/index.ts --format esm --watch",
57
- "start": "node dist/index.js",
58
- "typecheck": "tsc --noEmit"
59
- }
60
- }
59
+ "homepage": "https://github.com/theodenanyoh11/create-kofi-stack#readme"
60
+ }