create-warlock 5.40.1 → 5.42.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/esm/commands/create-new-app/index.mjs +12 -7
  3. package/esm/commands/create-new-app/index.mjs.map +1 -1
  4. package/esm/commands/create-new-app/types.d.mts +2 -0
  5. package/esm/commands/create-warlock-app/index.mjs +5 -2
  6. package/esm/commands/create-warlock-app/index.mjs.map +1 -1
  7. package/esm/features/features-map.mjs +6 -0
  8. package/esm/features/features-map.mjs.map +1 -1
  9. package/esm/features/ui-kit.mjs +39 -0
  10. package/esm/features/ui-kit.mjs.map +1 -0
  11. package/esm/flags/definitions.mjs +5 -0
  12. package/esm/flags/definitions.mjs.map +1 -1
  13. package/esm/flags/seed-from-flags.mjs +7 -2
  14. package/esm/flags/seed-from-flags.mjs.map +1 -1
  15. package/esm/helpers/app.mjs +7 -2
  16. package/esm/helpers/app.mjs.map +1 -1
  17. package/esm/index.mjs +5 -1
  18. package/esm/index.mjs.map +1 -1
  19. package/esm/prompts/ask-stack.mjs +5 -0
  20. package/esm/prompts/ask-stack.mjs.map +1 -1
  21. package/esm/prompts/ask-ui-kit.mjs +27 -0
  22. package/esm/prompts/ask-ui-kit.mjs.map +1 -0
  23. package/llms-full.txt +6 -1
  24. package/package.json +2 -2
  25. package/skills/SKILL.md +6 -1
  26. package/templates/design-system-mantine/SOURCES.md +23 -0
  27. package/templates/design-system-mantine/package.json +16 -0
  28. package/templates/design-system-mantine/src/web/design-system/components/checkbox-input.tsx +19 -0
  29. package/templates/design-system-mantine/src/web/design-system/components/date-picker-input.tsx +22 -0
  30. package/templates/design-system-mantine/src/web/design-system/components/date-time-picker-input.tsx +32 -0
  31. package/templates/design-system-mantine/src/web/design-system/components/email-input.tsx +21 -0
  32. package/templates/design-system-mantine/src/web/design-system/components/field-frame.tsx +65 -0
  33. package/templates/design-system-mantine/src/web/design-system/components/file-input.tsx +32 -0
  34. package/templates/design-system-mantine/src/web/design-system/components/multi-select-input.tsx +28 -0
  35. package/templates/design-system-mantine/src/web/design-system/components/paginated-table.tsx +94 -0
  36. package/templates/design-system-mantine/src/web/design-system/components/password-input.tsx +20 -0
  37. package/templates/design-system-mantine/src/web/design-system/components/radio-input.tsx +34 -0
  38. package/templates/design-system-mantine/src/web/design-system/components/select-input.tsx +24 -0
  39. package/templates/design-system-mantine/src/web/design-system/components/submit-button.tsx +24 -0
  40. package/templates/design-system-mantine/src/web/design-system/components/switch-input.tsx +19 -0
  41. package/templates/design-system-mantine/src/web/design-system/components/text-input.tsx +21 -0
  42. package/templates/design-system-mantine/src/web/design-system/components/textarea-input.tsx +21 -0
  43. package/templates/design-system-mantine/src/web/design-system/components/time-picker-input.tsx +19 -0
  44. package/templates/design-system-mantine/src/web/design-system/confirm.ts +40 -0
  45. package/templates/design-system-mantine/src/web/design-system/hooks/use-control.ts +30 -0
  46. package/templates/design-system-mantine/src/web/design-system/hooks/use-date-control.ts +51 -0
  47. package/templates/design-system-mantine/src/web/design-system/hooks/use-file-control.ts +26 -0
  48. package/templates/design-system-mantine/src/web/design-system/hooks/use-select-control.ts +85 -0
  49. package/templates/design-system-mantine/src/web/design-system/hooks/use-submit-control.ts +13 -0
  50. package/templates/design-system-mantine/src/web/design-system/mantine-theme.ts +32 -0
  51. package/templates/design-system-mantine/src/web/design-system/notify.ts +72 -0
  52. package/templates/design-system-mantine/src/web/design-system/provider.tsx +28 -0
  53. package/templates/design-system-mantine/src/web/design-system/types/control-props.ts +46 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to `create-warlock` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 5.41.0 - 2026-10-29
8
+
9
+ ### Added
10
+
11
+ - `--ui=<shadcn|mantine|none>` chooses the UI kit of a web app. `--ui=mantine` (or `--features=mantine`) scaffolds the Mantine kit without Tailwind; `shadcn` stays the default for `--stack=web`. The interactive stack menu gains a "Full-stack web with Mantine" entry, and Customize lists Mantine among the rendering features. The two kits exclude each other: `shadcn` with `mantine`, or `--ui` with a conflicting feature, fails before any file is written.
12
+
7
13
  ## 5.40.1 - 2026-10-29
8
14
 
9
15
  ### Fixed
@@ -1,6 +1,7 @@
1
1
  import { resolveAgentTargets } from "../../features/agent-kit-targets.mjs";
2
2
  import { getDatabaseDriver, getDatabaseDriverOptions, isNoDatabase } from "../../features/database-drivers.mjs";
3
3
  import { getAiPackageOptions, getAiProviderOptions, getAllFeatureKeys } from "../../features/features-map.mjs";
4
+ import { applyUiKit } from "../../features/ui-kit.mjs";
4
5
  import { hasInteractiveStdin } from "../../helpers/tty.mjs";
5
6
  import { assertFlagCombinations } from "../../flags/assert-flag-combinations.mjs";
6
7
  import { detectPackageManagers, getPackageManager, getPreferredPackageManager, getSystemPackageManagers, setPackageManager } from "../../helpers/package-manager.mjs";
@@ -13,6 +14,7 @@ import { askAiFeatures } from "../../prompts/ask-ai-features.mjs";
13
14
  import { askFeatures } from "../../prompts/ask-features.mjs";
14
15
  import { askProjectName } from "../../prompts/ask-project-name.mjs";
15
16
  import { askStack } from "../../prompts/ask-stack.mjs";
17
+ import { resolveKitConflict } from "../../prompts/ask-ui-kit.mjs";
16
18
  import { showIntroBanner } from "../../ui/banner.mjs";
17
19
  import { createWarlockApp } from "../create-warlock-app/index.mjs";
18
20
  import getAppPath from "./get-app-path.mjs";
@@ -86,11 +88,12 @@ async function createFullWizard(cli, pmDetectionPromise) {
86
88
  process.exit(0);
87
89
  }
88
90
  const selectedDriver = getDatabaseDriver(databaseDriver);
89
- const selectedFeatures = await askFeatures(seeds.features);
90
- if (isCancel(selectedFeatures)) {
91
+ const pickedFeatures = await askFeatures(seeds.features);
92
+ if (isCancel(pickedFeatures)) {
91
93
  cancel("Feature selection cancelled");
92
94
  process.exit(0);
93
95
  }
96
+ const selectedFeatures = await resolveKitConflict(pickedFeatures);
94
97
  const selectedAiProviders = await askAiFeatures(seeds.aiProviders);
95
98
  if (isCancel(selectedAiProviders)) {
96
99
  cancel("AI provider selection cancelled");
@@ -121,7 +124,7 @@ async function createFullWizard(cli, pmDetectionPromise) {
121
124
  options: {
122
125
  databaseDriver,
123
126
  databasePort: selectedDriver?.defaultPort || 27017,
124
- features: selectedFeatures.includes("shadcn") ? [.../* @__PURE__ */ new Set([...selectedFeatures, "design-system"])] : selectedFeatures,
127
+ features: applyUiKit(selectedFeatures, void 0),
125
128
  aiProviders: selectedAiProviders,
126
129
  useGit,
127
130
  useJWT,
@@ -150,7 +153,8 @@ async function createDefaultInteractive(cli, pmDetectionPromise) {
150
153
  }, pmDetectionPromise);
151
154
  return;
152
155
  }
153
- const stack = choice;
156
+ const stack = choice === "web-mantine" ? "web" : choice;
157
+ const ui = choice === "web-mantine" ? "mantine" : cli.ui;
154
158
  await pmDetectionPromise;
155
159
  const packageManager = cli.pm ?? getPreferredPackageManager();
156
160
  assertPackageManagerAvailable(cli.pm);
@@ -169,7 +173,8 @@ async function createDefaultInteractive(cli, pmDetectionPromise) {
169
173
  options = await resolveAppOptions({
170
174
  ...cli,
171
175
  stack,
172
- db: databaseDriver
176
+ db: databaseDriver,
177
+ ui
173
178
  });
174
179
  } catch (error) {
175
180
  cancel(error.message);
@@ -215,8 +220,8 @@ function resolveNonInteractiveOptions(cli) {
215
220
  const driver = noDatabase ? void 0 : getDatabaseDriver(databaseDriver);
216
221
  if (!noDatabase && !driver) throw new Error(`Unknown database driver "${databaseDriver}"`);
217
222
  const stack = cli.stack ?? "api";
218
- const requestedFeatures = cli.features ?? (stack === "web" ? ["web", "shadcn"] : []);
219
- const features = requestedFeatures.includes("shadcn") ? [.../* @__PURE__ */ new Set([...requestedFeatures, "design-system"])] : requestedFeatures;
223
+ const requestedFeatures = cli.features ?? (stack === "web" ? ["web", ...cli.ui === void 0 ? ["shadcn"] : []] : []);
224
+ const features = applyUiKit(requestedFeatures, cli.ui);
220
225
  const aiProviders = cli.ai ?? [];
221
226
  const allowedKeys = getAllFeatureKeys();
222
227
  const invalidFeatureKeys = features.filter((key) => !allowedKeys.includes(key));
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../packages/create-warlock/src/commands/create-new-app/index.ts"],"sourcesContent":["import { cancel, confirm, isCancel, select } from \"@clack/prompts\";\nimport { colors } from \"@mongez/copper\";\nimport { getJsonFile } from \"@warlock.js/fs\";\nimport { resolveAgentTargets } from \"../../features/agent-kit-targets\";\nimport {\n getDatabaseDriver,\n getDatabaseDriverOptions,\n isNoDatabase,\n} from \"../../features/database-drivers\";\nimport {\n getAiPackageOptions,\n getAiProviderOptions,\n getAllFeatureKeys,\n} from \"../../features/features-map\";\nimport { assertFlagCombinations } from \"../../flags/assert-flag-combinations\";\nimport { assertPackageManagerAvailable } from \"../../flags/assert-package-manager\";\nimport { seedFromFlags } from \"../../flags/seed-from-flags\";\nimport { App } from \"../../helpers/app\";\nimport {\n detectPackageManagers,\n getPackageManager,\n getPreferredPackageManager,\n getSystemPackageManagers,\n setPackageManager,\n} from \"../../helpers/package-manager\";\nimport { packageRoot } from \"../../helpers/paths\";\nimport { hasInteractiveStdin } from \"../../helpers/tty\";\nimport { askAgentTargets } from \"../../prompts/ask-agent-targets\";\nimport { askAiFeatures } from \"../../prompts/ask-ai-features\";\nimport { askFeatures } from \"../../prompts/ask-features\";\nimport { askProjectName } from \"../../prompts/ask-project-name\";\nimport { askStack } from \"../../prompts/ask-stack\";\nimport { showIntroBanner } from \"../../ui/banner\";\nimport { createWarlockApp } from \"../create-warlock-app\";\nimport getAppPath from \"./get-app-path\";\nimport { AppOptions, App as AppType, CliFlags, SetupChoice, Stack } from \"./types\";\n\nexport default async function createNewApp(cli: CliFlags = {}) {\n resolveLintToolchain(cli.lint);\n // Start detecting package managers in the background to avoid delay later\n const pmDetectionPromise = detectPackageManagers();\n\n // Get version from package.json\n const packageJson: any = getJsonFile(packageRoot(\"package.json\"));\n const createWarlockVersion = packageJson.version;\n\n // Show the intro banner\n showIntroBanner(createWarlockVersion);\n\n console.log(colors.cyan(\"Let's create something magical! \\n\"));\n\n // Validate Node.js version (minimum 22.15: the warlock CLI uses module.registerHooks)\n const [major = 0, minor = 0] = process.versions.node.split(\".\").map(Number);\n if (major < 22 || (major === 22 && minor < 15)) {\n cancel(`Node.js 22.15.0 or newer is required (found ${process.versions.node}).`);\n process.exit(0);\n }\n\n // Refuse contradictory flag combinations LOUDLY, before anything else looks\n // at them — `--customize --yes` used to drop `--customize` without a word.\n assertFlagCombinations(cli);\n\n // Non-interactive path: build everything from flags and skip the prompts.\n //\n // Triggered by --yes, OR automatically the moment stdin has no TTY — CI, a\n // script, an agent harness. This check MUST run before the first prompt\n // call: attempting `text()`/`select()` on a non-TTY stdin does not fail\n // cleanly, it crashes with a libuv internal (\"TTY initialization failed:\n // uv_tty_init returned EBADF\") before any app directory exists, no matter\n // how the run was invoked.\n //\n // Prompting is the fallback, not the precondition: a project name is the\n // only answer with no sane default, so when a name is already available\n // (positional arg or --name) the run proceeds exactly as --yes would, TTY\n // or not. When the name is ALSO missing and there is no TTY to ask for one,\n // createNonInteractive fails loudly — naming --yes and every non-interactive\n // flag — instead of ever reaching a prompt. Every other prompt already has a\n // default; see resolveNonInteractiveOptions below for the full table.\n if (cli.yes || !hasInteractiveStdin()) {\n await createNonInteractive(cli);\n return;\n }\n\n // `--interactive` (alias `--customize`) restores the full long-form wizard\n // below. Everyone else with a TTY falls through to the default path, which\n // asks the preset plus database choice — see createDefaultInteractive.\n if (cli.interactive) {\n await createFullWizard(cli, pmDetectionPromise);\n return;\n }\n\n await createDefaultInteractive(cli, pmDetectionPromise);\n}\n\n/**\n * The full long-form wizard (`--interactive` / `--customize`): every prompt,\n * one after another. This is the ORIGINAL default flow, preserved verbatim —\n * only its trigger moved from \"any TTY\" to an explicit opt-in flag, per the\n * rule that a reversible choice never prompts by default.\n */\nasync function createFullWizard(cli: CliFlags, pmDetectionPromise: Promise<void>) {\n // Step 1: Project name — but only when it is not already known. It arrives\n // answered from `--name`/the positional arg, and from the default path when\n // the user picked \"Customize\" AFTER being asked for a name. Re-asking for an\n // answer we already hold is the double-prompt this branch exists to avoid.\n const appName = cli.name ?? (await askProjectName());\n\n const appPath = getAppPath(appName);\n if (!appPath) return;\n\n // A flag passed alongside --customize is an answer given early, not a\n // contradiction: it pre-selects the matching prompt instead of being\n // dropped. Validate the ones that CAN be wrong through the same function\n // the non-interactive path uses, so an unknown driver or feature key fails\n // here rather than showing a prompt that quietly ignores it.\n try {\n resolveNonInteractiveOptions(cli);\n } catch (error) {\n cancel((error as Error).message);\n process.exit(1);\n }\n\n const seeds = seedFromFlags(cli);\n\n // Step 2: Package Manager selection\n await pmDetectionPromise; // Ensure detection is complete\n\n // Only now can availability be judged: detection is what fills\n // getSystemPackageManagers(), and the prompt below is built from it.\n assertPackageManagerAvailable(cli.pm);\n\n const packageManager = await select({\n message: \"Which package manager do you want to use?\",\n options: getSystemPackageManagers().map((pm) => ({\n value: pm,\n label: pm,\n })),\n initialValue: seeds.packageManager,\n });\n\n if (isCancel(packageManager)) {\n cancel(\"Package manager selection cancelled\");\n process.exit(0);\n }\n\n setPackageManager(packageManager as string);\n\n const lint = seeds.lint;\n\n // Step 3: Database driver selection\n const databaseDriver = await select({\n message: \"Choose your database driver\",\n options: getDatabaseDriverOptions(),\n initialValue: seeds.databaseDriver,\n });\n\n if (isCancel(databaseDriver)) {\n cancel(\"Database selection cancelled\");\n process.exit(0);\n }\n\n const selectedDriver = getDatabaseDriver(databaseDriver as string);\n\n // Step 4: Edit optional features in paged groups.\n const selectedFeatures = await askFeatures(seeds.features);\n\n if (isCancel(selectedFeatures)) {\n cancel(\"Feature selection cancelled\");\n process.exit(0);\n }\n\n // Step 4b: AI providers + capability packages — selecting any pulls\n // @warlock.js/ai automatically. The result still flows through the\n // `selectedAiProviders` → `aiProviders` pipeline, which now also carries the\n // capability packages (ai-tools / ai-panoptic / ai-workspace).\n const selectedAiProviders = await askAiFeatures(seeds.aiProviders);\n\n if (isCancel(selectedAiProviders)) {\n cancel(\"AI provider selection cancelled\");\n process.exit(0);\n }\n\n // Step 5: Git initialization\n const useGit =\n (await confirm({\n message: \"Initialize a Git repository?\",\n initialValue: seeds.useGit,\n })) === true;\n\n if (isCancel(useGit)) {\n cancel(\"Setup cancelled\");\n process.exit(0);\n }\n\n // Step 6: JWT secret generation\n const useJWT =\n (await confirm({\n message: \"Generate JWT secret keys?\",\n initialValue: seeds.useJWT,\n })) === true;\n\n if (isCancel(useJWT)) {\n cancel(\"Setup cancelled\");\n process.exit(0);\n }\n\n // Step 7: agent-kit targets. Asked here rather than left to --agents,\n // because Customize means every choice is offered (owner ruling, seq 1028).\n // --agents pre-ticks the selection, like every other flag.\n const agents = await askAgentTargets(cli.agents);\n\n // Build app details\n const appDetails: Required<AppType> = {\n appName: appName,\n appType: \"warlock\",\n appPath: appPath,\n pkgManager: getPackageManager(),\n options: {\n databaseDriver: databaseDriver as string,\n databasePort: selectedDriver?.defaultPort || 27017,\n features: (selectedFeatures as string[]).includes(\"shadcn\")\n ? [...new Set([...(selectedFeatures as string[]), \"design-system\"])]\n : (selectedFeatures as string[]),\n aiProviders: selectedAiProviders as string[],\n useGit,\n useJWT,\n agents,\n lint,\n },\n };\n\n // Create the app\n await scaffold(appDetails);\n}\n\n/**\n * The default TTY path: neither `--yes` nor `--interactive` was given, but a\n * terminal is available. Asks the project name when missing (a required\n * answer with no sane default — same treatment as the non-interactive path)\n * plus the preset's database choice when `--db`/`--no-db` was not supplied.\n * Every other choice is resolved exactly like `createNonInteractive` — flags,\n * with defaults, never a prompt.\n */\nasync function createDefaultInteractive(cli: CliFlags, pmDetectionPromise: Promise<void>) {\n const appName = cli.name ?? (await askProjectName());\n\n const appPath = getAppPath(appName);\n if (!appPath) return;\n\n const choice: SetupChoice = cli.stack ?? (await askStack());\n\n // \"Customize\" is not a third stack — it is the wizard, chosen from the menu\n // instead of from a flag nobody was told about. Hand over the name we just\n // collected so the wizard starts at its SECOND question.\n if (choice === \"customize\") {\n await createFullWizard({ ...cli, name: appName }, pmDetectionPromise);\n return;\n }\n\n const stack: Stack = choice;\n\n await pmDetectionPromise;\n\n const packageManager = cli.pm ?? getPreferredPackageManager();\n\n assertPackageManagerAvailable(cli.pm);\n\n setPackageManager(packageManager);\n\n const databaseDriver =\n cli.db ??\n (await select({\n message: \"Choose your database driver\",\n options: getDatabaseDriverOptions(),\n initialValue: \"mongodb\",\n }));\n\n if (isCancel(databaseDriver)) {\n cancel(\"Database selection cancelled\");\n process.exit(0);\n }\n\n let options: AppOptions;\n\n try {\n options = await resolveAppOptions({ ...cli, stack, db: databaseDriver });\n } catch (error) {\n cancel((error as Error).message);\n process.exit(1);\n }\n\n const appDetails: Required<AppType> = {\n appName,\n appType: \"warlock\",\n appPath,\n pkgManager: getPackageManager(),\n options,\n };\n\n await scaffold(appDetails);\n}\n\n/**\n * Run the scaffold and make the process's exit code tell the truth: anything\n * the user asked for that did not happen leaves the shell with a non-zero\n * status, so scripts and CI cannot mistake a half-built project for a finished\n * one. The problems themselves are printed by the scaffolder.\n */\nasync function scaffold(appDetails: Required<AppType>) {\n const outcome = await createWarlockApp(new App(appDetails));\n\n if (outcome && !outcome.ok) {\n process.exitCode = 1;\n }\n}\n\n/** Everything {@link resolveNonInteractiveOptions} can resolve without the network. */\nexport type SyncAppOptions = Omit<AppOptions, \"agents\">;\n\n/**\n * Resolve every flag-or-default `AppOptions` field EXCEPT `agents` from parsed\n * CLI flags — applying the non-interactive defaults, validating the database\n * driver and feature/provider keys, and handling the `none` (no database)\n * selection. `agents` is resolved separately by {@link resolveAppOptions}\n * because it can require a network fetch; this function stays synchronous so\n * the rest of the flag → app mapping remains trivially unit-testable.\n *\n * `--stack=web` (or the equivalent wizard answer) seeds the Web styling and control features by\n * default — the one structural choice — but an explicit `--features` always\n * wins, so a user who spells out the feature list is never second-guessed.\n *\n * Throws on an unknown driver, feature, or AI key so the caller can fail fast\n * before any file is written.\n */\nexport function resolveNonInteractiveOptions(cli: CliFlags): SyncAppOptions {\n const lint = resolveLintToolchain(cli.lint);\n const databaseDriver = cli.db ?? \"mongodb\";\n const noDatabase = isNoDatabase(databaseDriver);\n const driver = noDatabase ? undefined : getDatabaseDriver(databaseDriver);\n\n if (!noDatabase && !driver) {\n throw new Error(`Unknown database driver \"${databaseDriver}\"`);\n }\n\n const stack: Stack = cli.stack ?? \"api\";\n const requestedFeatures = cli.features ?? (stack === \"web\" ? [\"web\", \"shadcn\"] : []);\n const features = requestedFeatures.includes(\"shadcn\")\n ? [...new Set([...requestedFeatures, \"design-system\"])]\n : requestedFeatures;\n const aiProviders = cli.ai ?? [];\n\n const allowedKeys = getAllFeatureKeys();\n const invalidFeatureKeys = features.filter((key) => !allowedKeys.includes(key));\n const errors: string[] = [];\n\n if (invalidFeatureKeys.length > 0) {\n errors.push(`Unknown feature(s): ${invalidFeatureKeys.join(\",\")}`);\n }\n\n const aiFeatureKeys = [...getAiProviderOptions(), ...getAiPackageOptions()].map(\n (option) => option.value,\n );\n const invalidAiKeys = aiProviders.filter((key) => !aiFeatureKeys.includes(key));\n\n if (invalidAiKeys.length > 0) {\n errors.push(\n `Unknown AI feature(s): ${invalidAiKeys.join(\",\")}. ` +\n `Valid AI choices: ${aiFeatureKeys.join(\", \")}`,\n );\n }\n\n if (errors.length > 0) {\n throw new Error(errors.join(\"\\n\"));\n }\n\n return {\n databaseDriver,\n databasePort: driver?.defaultPort ?? 27017,\n features,\n aiProviders,\n lint,\n useGit: cli.git ?? false,\n useJWT: cli.jwt ?? false,\n };\n}\n\n/**\n * Resolve the FULL `AppOptions` — {@link resolveNonInteractiveOptions} plus\n * the validated `agents` list. Async because a non-default `--agents`\n * selection may need {@link resolveAgentTargets}'s network fetch; the default\n * (`claude`) never does.\n */\nexport async function resolveAppOptions(cli: CliFlags): Promise<AppOptions> {\n const options = resolveNonInteractiveOptions(cli);\n const agents = await resolveAgentTargets(cli.agents);\n\n return { ...options, agents };\n}\n\n/**\n * Non-interactive scaffold path for `--yes`. Builds the app from flags with\n * sensible defaults and skips every prompt — a single command scaffolds the\n * entire app. Validation lives in `resolveNonInteractiveOptions`; a typo fails\n * fast here instead of mid-install.\n */\nasync function createNonInteractive(cli: CliFlags) {\n const appName = (cli.name ?? \"\").trim();\n\n if (!appName) {\n // Reached either because --yes was passed with no name, or because stdin\n // has no TTY to prompt for one — either way, nothing is left to fall back\n // to. Name --yes AND every non-interactive flag so a CI log is enough to\n // fix the invocation without hunting for docs.\n cancel(\n \"A project name is required and no terminal is available to ask for one. \" +\n \"Pass it as the first argument or --name=<name>. Non-interactive flags: \" +\n \"--yes, --pm=<npm|yarn|pnpm|bun>, --db=<driver>|--no-db, --features=<list>, \" +\n \"--ai=<list>, --lint=<oxc>, --git|--no-git, --jwt|--no-jwt.\",\n );\n process.exit(1);\n }\n\n const appPath = getAppPath(appName);\n\n if (!appPath) return;\n\n await detectPackageManagers();\n\n const packageManager = cli.pm ?? getPreferredPackageManager();\n\n assertPackageManagerAvailable(cli.pm);\n\n setPackageManager(packageManager);\n\n let options: AppOptions;\n\n try {\n options = await resolveAppOptions(cli);\n } catch (error) {\n cancel((error as Error).message);\n process.exit(1);\n }\n\n const appDetails: Required<AppType> = {\n appName,\n appType: \"warlock\",\n appPath,\n pkgManager: getPackageManager(),\n options,\n };\n\n await scaffold(appDetails);\n}\n\n/** Reject removed modes before prompts, network discovery or filesystem writes. */\nfunction resolveLintToolchain(lint: string | undefined): \"oxc\" {\n if (lint === \"eslint\") {\n throw new Error(\n \"ESLint + Prettier support was removed in 5.34.0. Oxlint/Oxfmt is the default; use --lint=oxc or omit --lint.\",\n );\n }\n if (lint !== undefined && lint !== \"oxc\") {\n throw new Error(`Unknown lint toolchain \"${lint}\". Use --lint=oxc.`);\n }\n return \"oxc\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqCA,eAA8B,aAAa,MAAgB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SAAS;CAEd,MAAM,sBAAsB;CAE5B,MAAM,iBAAiB,IAAI,MAAM,2BAA2B;CAE5D,8BAA8B,IAAI,EAAE;CAEpC,kBAAkB,cAAc;CAEhC,IAAI;CAEJ,IAAI;EACF,UAAU,MAAM,kBAAkB,GAAG;CACvC,SAAS,OAAO;EACd,OAAQ,MAAgB,OAAO;EAC/B,QAAQ,KAAK,CAAC;CAChB;CAUA,MAAM,SAAS;EAPb;EACA,SAAS;EACT;EACA,YAAY,kBAAkB;EAC9B;CAGsB,CAAC;AAC3B;;AAGA,SAAS,qBAAqB,MAAiC;CAC7D,IAAI,SAAS,UACX,MAAM,IAAI,MACR,8GACF;CAEF,IAAI,SAAS,UAAa,SAAS,OACjC,MAAM,IAAI,MAAM,2BAA2B,KAAK,mBAAmB;CAErE,OAAO;AACT"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../packages/create-warlock/src/commands/create-new-app/index.ts"],"sourcesContent":["import { cancel, confirm, isCancel, select } from \"@clack/prompts\";\nimport { colors } from \"@mongez/copper\";\nimport { getJsonFile } from \"@warlock.js/fs\";\nimport { resolveAgentTargets } from \"../../features/agent-kit-targets\";\nimport {\n getDatabaseDriver,\n getDatabaseDriverOptions,\n isNoDatabase,\n} from \"../../features/database-drivers\";\nimport {\n getAiPackageOptions,\n getAiProviderOptions,\n getAllFeatureKeys,\n} from \"../../features/features-map\";\nimport { applyUiKit } from \"../../features/ui-kit\";\nimport { assertFlagCombinations } from \"../../flags/assert-flag-combinations\";\nimport { assertPackageManagerAvailable } from \"../../flags/assert-package-manager\";\nimport { seedFromFlags } from \"../../flags/seed-from-flags\";\nimport { App } from \"../../helpers/app\";\nimport {\n detectPackageManagers,\n getPackageManager,\n getPreferredPackageManager,\n getSystemPackageManagers,\n setPackageManager,\n} from \"../../helpers/package-manager\";\nimport { packageRoot } from \"../../helpers/paths\";\nimport { hasInteractiveStdin } from \"../../helpers/tty\";\nimport { askAgentTargets } from \"../../prompts/ask-agent-targets\";\nimport { askAiFeatures } from \"../../prompts/ask-ai-features\";\nimport { askFeatures } from \"../../prompts/ask-features\";\nimport { askProjectName } from \"../../prompts/ask-project-name\";\nimport { askStack } from \"../../prompts/ask-stack\";\nimport { resolveKitConflict } from \"../../prompts/ask-ui-kit\";\nimport { showIntroBanner } from \"../../ui/banner\";\nimport { createWarlockApp } from \"../create-warlock-app\";\nimport getAppPath from \"./get-app-path\";\nimport { AppOptions, App as AppType, CliFlags, SetupChoice, Stack } from \"./types\";\n\nexport default async function createNewApp(cli: CliFlags = {}) {\n resolveLintToolchain(cli.lint);\n // Start detecting package managers in the background to avoid delay later\n const pmDetectionPromise = detectPackageManagers();\n\n // Get version from package.json\n const packageJson: any = getJsonFile(packageRoot(\"package.json\"));\n const createWarlockVersion = packageJson.version;\n\n // Show the intro banner\n showIntroBanner(createWarlockVersion);\n\n console.log(colors.cyan(\"Let's create something magical! \\n\"));\n\n // Validate Node.js version (minimum 22.15: the warlock CLI uses module.registerHooks)\n const [major = 0, minor = 0] = process.versions.node.split(\".\").map(Number);\n if (major < 22 || (major === 22 && minor < 15)) {\n cancel(`Node.js 22.15.0 or newer is required (found ${process.versions.node}).`);\n process.exit(0);\n }\n\n // Refuse contradictory flag combinations LOUDLY, before anything else looks\n // at them — `--customize --yes` used to drop `--customize` without a word.\n assertFlagCombinations(cli);\n\n // Non-interactive path: build everything from flags and skip the prompts.\n //\n // Triggered by --yes, OR automatically the moment stdin has no TTY — CI, a\n // script, an agent harness. This check MUST run before the first prompt\n // call: attempting `text()`/`select()` on a non-TTY stdin does not fail\n // cleanly, it crashes with a libuv internal (\"TTY initialization failed:\n // uv_tty_init returned EBADF\") before any app directory exists, no matter\n // how the run was invoked.\n //\n // Prompting is the fallback, not the precondition: a project name is the\n // only answer with no sane default, so when a name is already available\n // (positional arg or --name) the run proceeds exactly as --yes would, TTY\n // or not. When the name is ALSO missing and there is no TTY to ask for one,\n // createNonInteractive fails loudly — naming --yes and every non-interactive\n // flag — instead of ever reaching a prompt. Every other prompt already has a\n // default; see resolveNonInteractiveOptions below for the full table.\n if (cli.yes || !hasInteractiveStdin()) {\n await createNonInteractive(cli);\n return;\n }\n\n // `--interactive` (alias `--customize`) restores the full long-form wizard\n // below. Everyone else with a TTY falls through to the default path, which\n // asks the preset plus database choice — see createDefaultInteractive.\n if (cli.interactive) {\n await createFullWizard(cli, pmDetectionPromise);\n return;\n }\n\n await createDefaultInteractive(cli, pmDetectionPromise);\n}\n\n/**\n * The full long-form wizard (`--interactive` / `--customize`): every prompt,\n * one after another. This is the ORIGINAL default flow, preserved verbatim —\n * only its trigger moved from \"any TTY\" to an explicit opt-in flag, per the\n * rule that a reversible choice never prompts by default.\n */\nasync function createFullWizard(cli: CliFlags, pmDetectionPromise: Promise<void>) {\n // Step 1: Project name — but only when it is not already known. It arrives\n // answered from `--name`/the positional arg, and from the default path when\n // the user picked \"Customize\" AFTER being asked for a name. Re-asking for an\n // answer we already hold is the double-prompt this branch exists to avoid.\n const appName = cli.name ?? (await askProjectName());\n\n const appPath = getAppPath(appName);\n if (!appPath) return;\n\n // A flag passed alongside --customize is an answer given early, not a\n // contradiction: it pre-selects the matching prompt instead of being\n // dropped. Validate the ones that CAN be wrong through the same function\n // the non-interactive path uses, so an unknown driver or feature key fails\n // here rather than showing a prompt that quietly ignores it.\n try {\n resolveNonInteractiveOptions(cli);\n } catch (error) {\n cancel((error as Error).message);\n process.exit(1);\n }\n\n const seeds = seedFromFlags(cli);\n\n // Step 2: Package Manager selection\n await pmDetectionPromise; // Ensure detection is complete\n\n // Only now can availability be judged: detection is what fills\n // getSystemPackageManagers(), and the prompt below is built from it.\n assertPackageManagerAvailable(cli.pm);\n\n const packageManager = await select({\n message: \"Which package manager do you want to use?\",\n options: getSystemPackageManagers().map((pm) => ({\n value: pm,\n label: pm,\n })),\n initialValue: seeds.packageManager,\n });\n\n if (isCancel(packageManager)) {\n cancel(\"Package manager selection cancelled\");\n process.exit(0);\n }\n\n setPackageManager(packageManager as string);\n\n const lint = seeds.lint;\n\n // Step 3: Database driver selection\n const databaseDriver = await select({\n message: \"Choose your database driver\",\n options: getDatabaseDriverOptions(),\n initialValue: seeds.databaseDriver,\n });\n\n if (isCancel(databaseDriver)) {\n cancel(\"Database selection cancelled\");\n process.exit(0);\n }\n\n const selectedDriver = getDatabaseDriver(databaseDriver as string);\n\n // Step 4: Edit optional features in paged groups.\n const pickedFeatures = await askFeatures(seeds.features);\n\n if (isCancel(pickedFeatures)) {\n cancel(\"Feature selection cancelled\");\n process.exit(0);\n }\n\n // The two UI kits exclude each other (\"Select all\" can tick both).\n const selectedFeatures = await resolveKitConflict(pickedFeatures as string[]);\n\n // Step 4b: AI providers + capability packages — selecting any pulls\n // @warlock.js/ai automatically. The result still flows through the\n // `selectedAiProviders` → `aiProviders` pipeline, which now also carries the\n // capability packages (ai-tools / ai-panoptic / ai-workspace).\n const selectedAiProviders = await askAiFeatures(seeds.aiProviders);\n\n if (isCancel(selectedAiProviders)) {\n cancel(\"AI provider selection cancelled\");\n process.exit(0);\n }\n\n // Step 5: Git initialization\n const useGit =\n (await confirm({\n message: \"Initialize a Git repository?\",\n initialValue: seeds.useGit,\n })) === true;\n\n if (isCancel(useGit)) {\n cancel(\"Setup cancelled\");\n process.exit(0);\n }\n\n // Step 6: JWT secret generation\n const useJWT =\n (await confirm({\n message: \"Generate JWT secret keys?\",\n initialValue: seeds.useJWT,\n })) === true;\n\n if (isCancel(useJWT)) {\n cancel(\"Setup cancelled\");\n process.exit(0);\n }\n\n // Step 7: agent-kit targets. Asked here rather than left to --agents,\n // because Customize means every choice is offered (owner ruling, seq 1028).\n // --agents pre-ticks the selection, like every other flag.\n const agents = await askAgentTargets(cli.agents);\n\n // Build app details\n const appDetails: Required<AppType> = {\n appName: appName,\n appType: \"warlock\",\n appPath: appPath,\n pkgManager: getPackageManager(),\n options: {\n databaseDriver: databaseDriver as string,\n databasePort: selectedDriver?.defaultPort || 27017,\n features: applyUiKit(selectedFeatures as string[], undefined),\n aiProviders: selectedAiProviders as string[],\n useGit,\n useJWT,\n agents,\n lint,\n },\n };\n\n // Create the app\n await scaffold(appDetails);\n}\n\n/**\n * The default TTY path: neither `--yes` nor `--interactive` was given, but a\n * terminal is available. Asks the project name when missing (a required\n * answer with no sane default — same treatment as the non-interactive path)\n * plus the preset's database choice when `--db`/`--no-db` was not supplied.\n * Every other choice is resolved exactly like `createNonInteractive` — flags,\n * with defaults, never a prompt.\n */\nasync function createDefaultInteractive(cli: CliFlags, pmDetectionPromise: Promise<void>) {\n const appName = cli.name ?? (await askProjectName());\n\n const appPath = getAppPath(appName);\n if (!appPath) return;\n\n const choice: SetupChoice = cli.stack ?? (await askStack());\n\n // \"Customize\" is not a third stack — it is the wizard, chosen from the menu\n // instead of from a flag nobody was told about. Hand over the name we just\n // collected so the wizard starts at its SECOND question.\n if (choice === \"customize\") {\n await createFullWizard({ ...cli, name: appName }, pmDetectionPromise);\n return;\n }\n\n const stack: Stack = choice === \"web-mantine\" ? \"web\" : choice;\n const ui = choice === \"web-mantine\" ? \"mantine\" : cli.ui;\n\n await pmDetectionPromise;\n\n const packageManager = cli.pm ?? getPreferredPackageManager();\n\n assertPackageManagerAvailable(cli.pm);\n\n setPackageManager(packageManager);\n\n const databaseDriver =\n cli.db ??\n (await select({\n message: \"Choose your database driver\",\n options: getDatabaseDriverOptions(),\n initialValue: \"mongodb\",\n }));\n\n if (isCancel(databaseDriver)) {\n cancel(\"Database selection cancelled\");\n process.exit(0);\n }\n\n let options: AppOptions;\n\n try {\n options = await resolveAppOptions({ ...cli, stack, db: databaseDriver, ui });\n } catch (error) {\n cancel((error as Error).message);\n process.exit(1);\n }\n\n const appDetails: Required<AppType> = {\n appName,\n appType: \"warlock\",\n appPath,\n pkgManager: getPackageManager(),\n options,\n };\n\n await scaffold(appDetails);\n}\n\n/**\n * Run the scaffold and make the process's exit code tell the truth: anything\n * the user asked for that did not happen leaves the shell with a non-zero\n * status, so scripts and CI cannot mistake a half-built project for a finished\n * one. The problems themselves are printed by the scaffolder.\n */\nasync function scaffold(appDetails: Required<AppType>) {\n const outcome = await createWarlockApp(new App(appDetails));\n\n if (outcome && !outcome.ok) {\n process.exitCode = 1;\n }\n}\n\n/** Everything {@link resolveNonInteractiveOptions} can resolve without the network. */\nexport type SyncAppOptions = Omit<AppOptions, \"agents\">;\n\n/**\n * Resolve every flag-or-default `AppOptions` field EXCEPT `agents` from parsed\n * CLI flags — applying the non-interactive defaults, validating the database\n * driver and feature/provider keys, and handling the `none` (no database)\n * selection. `agents` is resolved separately by {@link resolveAppOptions}\n * because it can require a network fetch; this function stays synchronous so\n * the rest of the flag → app mapping remains trivially unit-testable.\n *\n * `--stack=web` (or the equivalent wizard answer) seeds the Web styling and control features by\n * default — the one structural choice — but an explicit `--features` always\n * wins, so a user who spells out the feature list is never second-guessed.\n *\n * Throws on an unknown driver, feature, or AI key so the caller can fail fast\n * before any file is written.\n */\nexport function resolveNonInteractiveOptions(cli: CliFlags): SyncAppOptions {\n const lint = resolveLintToolchain(cli.lint);\n const databaseDriver = cli.db ?? \"mongodb\";\n const noDatabase = isNoDatabase(databaseDriver);\n const driver = noDatabase ? undefined : getDatabaseDriver(databaseDriver);\n\n if (!noDatabase && !driver) {\n throw new Error(`Unknown database driver \"${databaseDriver}\"`);\n }\n\n const stack: Stack = cli.stack ?? \"api\";\n const requestedFeatures =\n cli.features ?? (stack === \"web\" ? [\"web\", ...(cli.ui === undefined ? [\"shadcn\"] : [])] : []);\n const features = applyUiKit(requestedFeatures, cli.ui);\n const aiProviders = cli.ai ?? [];\n\n const allowedKeys = getAllFeatureKeys();\n const invalidFeatureKeys = features.filter((key) => !allowedKeys.includes(key));\n const errors: string[] = [];\n\n if (invalidFeatureKeys.length > 0) {\n errors.push(`Unknown feature(s): ${invalidFeatureKeys.join(\",\")}`);\n }\n\n const aiFeatureKeys = [...getAiProviderOptions(), ...getAiPackageOptions()].map(\n (option) => option.value,\n );\n const invalidAiKeys = aiProviders.filter((key) => !aiFeatureKeys.includes(key));\n\n if (invalidAiKeys.length > 0) {\n errors.push(\n `Unknown AI feature(s): ${invalidAiKeys.join(\",\")}. ` +\n `Valid AI choices: ${aiFeatureKeys.join(\", \")}`,\n );\n }\n\n if (errors.length > 0) {\n throw new Error(errors.join(\"\\n\"));\n }\n\n return {\n databaseDriver,\n databasePort: driver?.defaultPort ?? 27017,\n features,\n aiProviders,\n lint,\n useGit: cli.git ?? false,\n useJWT: cli.jwt ?? false,\n };\n}\n\n/**\n * Resolve the FULL `AppOptions` — {@link resolveNonInteractiveOptions} plus\n * the validated `agents` list. Async because a non-default `--agents`\n * selection may need {@link resolveAgentTargets}'s network fetch; the default\n * (`claude`) never does.\n */\nexport async function resolveAppOptions(cli: CliFlags): Promise<AppOptions> {\n const options = resolveNonInteractiveOptions(cli);\n const agents = await resolveAgentTargets(cli.agents);\n\n return { ...options, agents };\n}\n\n/**\n * Non-interactive scaffold path for `--yes`. Builds the app from flags with\n * sensible defaults and skips every prompt — a single command scaffolds the\n * entire app. Validation lives in `resolveNonInteractiveOptions`; a typo fails\n * fast here instead of mid-install.\n */\nasync function createNonInteractive(cli: CliFlags) {\n const appName = (cli.name ?? \"\").trim();\n\n if (!appName) {\n // Reached either because --yes was passed with no name, or because stdin\n // has no TTY to prompt for one — either way, nothing is left to fall back\n // to. Name --yes AND every non-interactive flag so a CI log is enough to\n // fix the invocation without hunting for docs.\n cancel(\n \"A project name is required and no terminal is available to ask for one. \" +\n \"Pass it as the first argument or --name=<name>. Non-interactive flags: \" +\n \"--yes, --pm=<npm|yarn|pnpm|bun>, --db=<driver>|--no-db, --features=<list>, \" +\n \"--ai=<list>, --lint=<oxc>, --git|--no-git, --jwt|--no-jwt.\",\n );\n process.exit(1);\n }\n\n const appPath = getAppPath(appName);\n\n if (!appPath) return;\n\n await detectPackageManagers();\n\n const packageManager = cli.pm ?? getPreferredPackageManager();\n\n assertPackageManagerAvailable(cli.pm);\n\n setPackageManager(packageManager);\n\n let options: AppOptions;\n\n try {\n options = await resolveAppOptions(cli);\n } catch (error) {\n cancel((error as Error).message);\n process.exit(1);\n }\n\n const appDetails: Required<AppType> = {\n appName,\n appType: \"warlock\",\n appPath,\n pkgManager: getPackageManager(),\n options,\n };\n\n await scaffold(appDetails);\n}\n\n/** Reject removed modes before prompts, network discovery or filesystem writes. */\nfunction resolveLintToolchain(lint: string | undefined): \"oxc\" {\n if (lint === \"eslint\") {\n throw new Error(\n \"ESLint + Prettier support was removed in 5.34.0. Oxlint/Oxfmt is the default; use --lint=oxc or omit --lint.\",\n );\n }\n if (lint !== undefined && lint !== \"oxc\") {\n throw new Error(`Unknown lint toolchain \"${lint}\". Use --lint=oxc.`);\n }\n return \"oxc\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,eAA8B,aAAa,MAAgB,CAAC,GAAG;CAC7D,qBAAqB,IAAI,IAAI;CAE7B,MAAM,qBAAqB,sBAAsB;CAIjD,MAAM,uBADmB,YAAY,YAAY,cAAc,CACxB,CAAC,CAAC;CAGzC,gBAAgB,oBAAoB;CAEpC,QAAQ,IAAI,OAAO,KAAK,oCAAoC,CAAC;CAG7D,MAAM,CAAC,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS,KAAK,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;CAC1E,IAAI,QAAQ,MAAO,UAAU,MAAM,QAAQ,IAAK;EAC9C,OAAO,+CAA+C,QAAQ,SAAS,KAAK,GAAG;EAC/E,QAAQ,KAAK,CAAC;CAChB;CAIA,uBAAuB,GAAG;CAkB1B,IAAI,IAAI,OAAO,CAAC,oBAAoB,GAAG;EACrC,MAAM,qBAAqB,GAAG;EAC9B;CACF;CAKA,IAAI,IAAI,aAAa;EACnB,MAAM,iBAAiB,KAAK,kBAAkB;EAC9C;CACF;CAEA,MAAM,yBAAyB,KAAK,kBAAkB;AACxD;;;;;;;AAQA,eAAe,iBAAiB,KAAe,oBAAmC;CAKhF,MAAM,UAAU,IAAI,QAAS,MAAM,eAAe;CAElD,M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AM,OAAO,KAAK,IAAI,CAAC;CAGnC,OAAO;EACL;EACA,cAAc,QAAQ,eAAe;EACrC;EACA;EACA;EACA,QAAQ,IAAI,OAAO;EACnB,QAAQ,IAAI,OAAO;CACrB;AACF;;;;;;;AAQA,eAAsB,kBAAkB,KAAoC;CAC1E,MAAM,UAAU,6BAA6B,GAAG;CAChD,MAAM,SAAS,MAAM,oBAAoB,IAAI,MAAM;CAEnD,OAAO;EAAE,GAAG;EAAS;CAAO;AAC9B;;;;;;;AAQA,eAAe,qBAAqB,KAAe;CACjD,MAAM,WAAW,IAAI,QAAQ,GAAE,CAAE,KAAK;CAEtC,IAAI,CAAC,SAAS;EAKZ,OACE,sRAIF;EACA,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,UAAU,WAAW,OAAO;CAElC,IAAI,CAAC,SAAS;CAEd,MAAM,sBAAsB;CAE5B,MAAM,iBAAiB,IAAI,MAAM,2BAA2B;CAE5D,8BAA8B,IAAI,EAAE;CAEpC,kBAAkB,cAAc;CAEhC,IAAI;CAEJ,IAAI;EACF,UAAU,MAAM,kBAAkB,GAAG;CACvC,SAAS,OAAO;EACd,OAAQ,MAAgB,OAAO;EAC/B,QAAQ,KAAK,CAAC;CAChB;CAUA,MAAM,SAAS;EAPb;EACA,SAAS;EACT;EACA,YAAY,kBAAkB;EAC9B;CAGsB,CAAC;AAC3B;;AAGA,SAAS,qBAAqB,MAAiC;CAC7D,IAAI,SAAS,UACX,MAAM,IAAI,MACR,8GACF;CAEF,IAAI,SAAS,UAAa,SAAS,OACjC,MAAM,IAAI,MAAM,2BAA2B,KAAK,mBAAmB;CAErE,OAAO;AACT"}
@@ -12,6 +12,8 @@ export type CliFlags = {
12
12
  stack?: Stack;
13
13
  db?: string;
14
14
  features?: string[];
15
+ /** `--ui=<shadcn|mantine|none>` — the design-system kit for web apps. */
16
+ ui?: string;
15
17
  ai?: string[];
16
18
  pm?: string;
17
19
  /** `--lint=oxc`; validated before scaffolding. */
@@ -32,13 +32,16 @@ async function createWarlockApp(application) {
32
32
  application.configureDatabaseEnv(databaseDriver);
33
33
  application.configureDatabaseConfig(databaseDriver);
34
34
  }
35
- application.configureWebStarter(features.some((feature) => [
35
+ const usesWeb = features.some((feature) => [
36
36
  "web",
37
37
  "tailwind",
38
38
  "shadcn",
39
39
  "design-system",
40
+ "mantine",
40
41
  "sitemap"
41
- ].includes(feature)), versions);
42
+ ].includes(feature));
43
+ const withoutTailwind = features.includes("mantine") && !features.includes("tailwind");
44
+ application.configureWebStarter(usesWeb, versions, withoutTailwind);
42
45
  application.configureLintToolchain();
43
46
  application.configureAgentKitTargets(options.agents ?? ["claude"]);
44
47
  } catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../packages/create-warlock/src/commands/create-warlock-app/index.ts"],"sourcesContent":["import { getDatabaseLabel, isNoDatabase } from \"../../features/database-drivers\";\nimport { App } from \"../../helpers/app\";\nimport { CommandResult, takeLastCommandOutput } from \"../../helpers/exec\";\nimport { getPackageManager, runPackageManagerCommand } from \"../../helpers/package-manager\";\nimport { resolveWarlockVersions } from \"../../helpers/warlock-versions\";\nimport { printDecisionsSummary } from \"../../summary\";\nimport { showSuccessScreen } from \"../../ui/banner\";\nimport {\n failFatally,\n installFailureHints,\n Problem,\n showNotes,\n showPartialScreen,\n showProblems,\n} from \"../../ui/report\";\nimport { spinner } from \"../../ui/spinner\";\nimport { spinnerMessages } from \"../../ui/spinners\";\n\n/**\n * What the scaffold actually achieved. `ok` is false when ANY step the user\n * asked for did not happen; the caller turns that into a non-zero exit code so\n * a script never mistakes a half-built project for a finished one.\n */\nexport type ScaffoldOutcome = {\n ok: boolean;\n problems: Problem[];\n};\n\n/** One-line \"why did this fail\" pulled out of a captured command. */\nfunction reasonFrom(result: CommandResult | undefined): string {\n if (!result) return \"the command reported a failure (no output captured)\";\n\n if (result.error) {\n return result.error.message || String(result.error);\n }\n\n const lastLine = `${result.stderr}\\n${result.stdout}`\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter(Boolean)\n .pop();\n\n const status =\n result.code === null\n ? `killed by ${result.signal ?? \"an unknown signal\"}`\n : `exit code ${result.code}`;\n\n return lastLine ? `${status} — ${lastLine}` : status;\n}\n\nexport async function createWarlockApp(application: App): Promise<ScaffoldOutcome> {\n const options = application.options;\n const { useGit, useJWT, features, aiProviders, databaseDriver } = options;\n const noDatabase = isNoDatabase(databaseDriver);\n const problems: Problem[] = [];\n\n // Resolve the versions to pin BEFORE anything is written. The scaffolder's\n // own version is only used when the registry confirms it exists — see\n // helpers/warlock-versions.ts for why an unverified pin broke every install.\n const { versions, notes } = await resolveWarlockVersions();\n\n // Step 1: Initialize and copy template\n const templateSpinner = spinner();\n templateSpinner.start(spinnerMessages.copyingTemplate);\n\n try {\n application.init().use(\"warlock\").updatePackageJson(versions).updateDotEnv();\n\n // Wire the chosen database driver into .env — or, when the user opted out,\n // strip the database config entirely so the app boots with no database.\n if (noDatabase) {\n application.removeDatabaseConfig();\n } else {\n application.configureDatabaseEnv(databaseDriver);\n application.configureDatabaseConfig(databaseDriver);\n }\n\n application.configureWebStarter(\n features.some((feature) =>\n [\"web\", \"tailwind\", \"shadcn\", \"design-system\", \"sitemap\"].includes(feature),\n ),\n versions,\n );\n application.configureLintToolchain();\n application.configureAgentKitTargets(options.agents ?? [\"claude\"]);\n } catch (error) {\n templateSpinner.stop(spinnerMessages.templateFailed);\n\n failFatally({\n step: \"Template copy\",\n detail: `The project files could not be written: ${(error as Error).message}`,\n hints: [\n \"Check that the target directory is writable and that no file is locked by another process.\",\n ],\n });\n }\n\n templateSpinner.stop(spinnerMessages.templateCopied);\n\n showNotes([...notes]);\n\n // Step 2: Install base dependencies (so the `warlock` binary is available).\n // Nothing downstream works without this, so a failure ends the run — loudly,\n // with the command, its exit code and its output.\n const installSpinner = spinner();\n installSpinner.start(spinnerMessages.installingDeps);\n\n const baseInstall = application.install();\n const baseInstalled = await baseInstall.install;\n const baseInstallResult = await baseInstall.result;\n\n if (!baseInstalled) {\n installSpinner.stop(spinnerMessages.depsFailed);\n\n failFatally({\n step: \"Dependency install\",\n detail: \"The project's dependencies were not installed.\",\n result: baseInstallResult,\n hints: installFailureHints(baseInstallResult),\n });\n }\n\n installSpinner.stop(spinnerMessages.depsInstalled);\n\n // Step 3: Add features via `warlock add --no-install`, then one batched install.\n // The DB driver, optional features, and AI providers all go through the single\n // source of truth (core's feature map) so versions never drift. When no\n // database was chosen, the driver is omitted (there is no `none` feature).\n const selectedFeatures = [...(noDatabase ? [] : [databaseDriver]), ...features, ...aiProviders];\n\n // Features the user asked for that are not in the project when we finish.\n const failedFeatures: { feature: string; reason: string }[] = [];\n let featureDependencyInstallFailed = false;\n\n if (selectedFeatures.length > 0) {\n const featuresSpinner = spinner();\n featuresSpinner.start(spinnerMessages.addingFeatures);\n\n let addedFeatures = selectedFeatures;\n\n if (!(await application.installFeatures(selectedFeatures))) {\n // The batch is all-or-nothing, so it cannot say WHICH feature broke it.\n // Retry them one at a time: every feature that can be added still gets\n // added, and every one that cannot gets its own reason.\n const batchFailure = takeLastCommandOutput();\n\n addedFeatures = [];\n\n for (const feature of selectedFeatures) {\n if (await application.installFeatures([feature])) {\n addedFeatures.push(feature);\n } else {\n failedFeatures.push({\n feature,\n reason: reasonFrom(takeLastCommandOutput() ?? batchFailure),\n });\n }\n }\n }\n\n let featureInstall: CommandResult | undefined;\n\n if (addedFeatures.length > 0) {\n // `warlock add` records the feature dependencies but does not reconcile\n // them with each other. The `web` feature brings `vite` while the\n // template always brings `vitest`, whose own vite range resolves to a\n // different major — two copies, and yarn 1 aborts the whole link phase\n // on them. Pin one copy BEFORE the batched install, not after.\n application.pinViteResolution();\n application.approveSelectedFeatureBuilds(addedFeatures);\n\n const install = application.install();\n const installed = await install.install;\n\n featureInstall = await install.result;\n\n if (!installed) {\n // The dependencies were recorded but never fetched — the features are\n // not usable, so they are failures, not successes.\n const reason = `their packages were not installed (${reasonFrom(featureInstall)})`;\n\n for (const feature of addedFeatures) {\n failedFeatures.push({ feature, reason });\n }\n\n addedFeatures = [];\n featureDependencyInstallFailed = true;\n }\n }\n\n if (failedFeatures.length === 0) {\n featuresSpinner.stop(spinnerMessages.featuresAdded);\n } else {\n featuresSpinner.stop(\n addedFeatures.length > 0 ? spinnerMessages.featuresPartial : spinnerMessages.featuresFailed,\n );\n\n problems.push({\n step: \"Features\",\n detail: failedFeatures\n .map(({ feature, reason }) => `${feature}: ${reason}`)\n .join(\"\\n \"),\n result: featureInstall?.ok === false ? featureInstall : undefined,\n hints: [\n `Retry inside the project with: npx warlock add ${failedFeatures\n .map(({ feature }) => feature)\n .join(\" \")}`,\n ],\n });\n }\n }\n\n // Step 4: Initialize Git repository if requested\n if (useGit) {\n const gitSpinner = spinner();\n gitSpinner.start(spinnerMessages.initializingGit);\n\n const initialized = await application.git();\n\n gitSpinner.stop(initialized ? spinnerMessages.gitInitialized : spinnerMessages.gitFailed);\n\n if (!initialized) {\n const failure = takeLastCommandOutput();\n\n problems.push({\n step: \"Git repository\",\n detail: `The repository was not initialized: ${reasonFrom(failure)}`,\n result: failure,\n hints: [\n \"Check that git is installed and that user.name / user.email are configured, then run `git init` yourself.\",\n ],\n });\n }\n }\n\n // Step 5: Generate JWT or warm cache\n if (useJWT && featureDependencyInstallFailed) {\n problems.push({\n step: \"JWT secrets\",\n detail: \"Skipped because the selected feature dependencies did not install.\",\n hints: [\n `Install the failed feature dependencies, then run \\`${runPackageManagerCommand(\"jwt\")}\\` inside the project.`,\n ],\n });\n } else if (useJWT) {\n const jwtSpinner = spinner();\n jwtSpinner.start(spinnerMessages.generatingJwt);\n\n const command = runPackageManagerCommand(\"jwt\");\n const generated = await application.exec(command);\n\n jwtSpinner.stop(generated ? spinnerMessages.jwtGenerated : spinnerMessages.jwtFailed);\n\n if (!generated) {\n const failure = takeLastCommandOutput();\n\n problems.push({\n step: \"JWT secrets\",\n detail: `No JWT secrets were written to .env: ${reasonFrom(failure)}`,\n result: failure,\n hints: [`Run \\`${command}\\` inside the project before starting it.`],\n });\n }\n } else {\n // The warm cache is a start-up optimisation, not something the user asked\n // for: report it, but it does not make the scaffold a failure.\n const warmSpinner = spinner();\n warmSpinner.start(spinnerMessages.warmingCache);\n\n const warmed = await application.exec(\"npx warlock --warm-cache\");\n\n warmSpinner.stop(warmed ? spinnerMessages.cacheWarmed : spinnerMessages.cacheWarmFailed);\n\n if (!warmed) takeLastCommandOutput();\n }\n\n // Step 6: Report what actually happened — the summary may only advertise\n // features that are really in the project.\n const requestedFeatures = [...features, ...aiProviders];\n const missingFeatures = failedFeatures\n .map(({ feature }) => feature)\n .filter((feature) => requestedFeatures.includes(feature));\n const installedFeatures = requestedFeatures.filter(\n (feature) => !missingFeatures.includes(feature),\n );\n\n if (problems.length > 0) {\n showProblems(problems);\n\n showPartialScreen({\n projectName: application.name,\n database: getDatabaseLabel(databaseDriver),\n features: installedFeatures,\n missingFeatures,\n packageManager: getPackageManager(),\n });\n\n printDecisionsSummary({ packageManager: getPackageManager(), options });\n\n return { ok: false, problems };\n }\n\n showSuccessScreen({\n projectName: application.name,\n database: getDatabaseLabel(databaseDriver),\n features: installedFeatures,\n packageManager: getPackageManager(),\n });\n\n printDecisionsSummary({ packageManager: getPackageManager(), options });\n\n return { ok: true, problems };\n}\n"],"mappings":";;;;;;;;;;;;AA6BA,SAAS,WAAW,QAA2C;CAC7D,IAAI,CAAC,QAAQ,OAAO;CAEpB,IAAI,OAAO,OACT,OAAO,OAAO,MAAM,WAAW,OAAO,OAAO,KAAK;CAGpD,MAAM,WAAW,GAAG,OAAO,OAAO,IAAI,OAAO,SAC1C,MAAM,OAAO,CAAC,CACd,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,OAAO,OAAO,CAAC,CACf,IAAI;CAEP,MAAM,SACJ,OAAO,SAAS,OACZ,aAAa,OAAO,UAAU,wBAC9B,aAAa,OAAO;CAE1B,OAAO,WAAW,GAAG,OAAO,KAAK,aAAa;AAChD;AAEA,eAAsB,iBAAiB,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7B,QAAQ,YAAY,kBAAkB,SAAS,OAAO,CAAC;CAC1D,MAAM,oBAAoB,kBAAkB,QACzC,YAAY,CAAC,gBAAgB,SAAS,OAAO,CAChD;CAEA,IAAI,SAAS,SAAS,GAAG;EACvB,aAAa,QAAQ;EAErB,kBAAkB;GAChB,aAAa,YAAY;GACzB,UAAU,iBAAiB,cAAc;GACzC,UAAU;GACV;GACA,gBAAgB,kBAAkB;EACpC,CAAC;EAED,sBAAsB;GAAE,gBAAgB,kBAAkB;GAAG;EAAQ,CAAC;EAEtE,OAAO;GAAE,IAAI;GAAO;EAAS;CAC/B;CAEA,kBAAkB;EAChB,aAAa,YAAY;EACzB,UAAU,iBAAiB,cAAc;EACzC,UAAU;EACV,gBAAgB,kBAAkB;CACpC,CAAC;CAED,sBAAsB;EAAE,gBAAgB,kBAAkB;EAAG;CAAQ,CAAC;CAEtE,OAAO;EAAE,IAAI;EAAM;CAAS;AAC9B"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../packages/create-warlock/src/commands/create-warlock-app/index.ts"],"sourcesContent":["import { getDatabaseLabel, isNoDatabase } from \"../../features/database-drivers\";\nimport { App } from \"../../helpers/app\";\nimport { CommandResult, takeLastCommandOutput } from \"../../helpers/exec\";\nimport { getPackageManager, runPackageManagerCommand } from \"../../helpers/package-manager\";\nimport { resolveWarlockVersions } from \"../../helpers/warlock-versions\";\nimport { printDecisionsSummary } from \"../../summary\";\nimport { showSuccessScreen } from \"../../ui/banner\";\nimport {\n failFatally,\n installFailureHints,\n Problem,\n showNotes,\n showPartialScreen,\n showProblems,\n} from \"../../ui/report\";\nimport { spinner } from \"../../ui/spinner\";\nimport { spinnerMessages } from \"../../ui/spinners\";\n\n/**\n * What the scaffold actually achieved. `ok` is false when ANY step the user\n * asked for did not happen; the caller turns that into a non-zero exit code so\n * a script never mistakes a half-built project for a finished one.\n */\nexport type ScaffoldOutcome = {\n ok: boolean;\n problems: Problem[];\n};\n\n/** One-line \"why did this fail\" pulled out of a captured command. */\nfunction reasonFrom(result: CommandResult | undefined): string {\n if (!result) return \"the command reported a failure (no output captured)\";\n\n if (result.error) {\n return result.error.message || String(result.error);\n }\n\n const lastLine = `${result.stderr}\\n${result.stdout}`\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter(Boolean)\n .pop();\n\n const status =\n result.code === null\n ? `killed by ${result.signal ?? \"an unknown signal\"}`\n : `exit code ${result.code}`;\n\n return lastLine ? `${status} — ${lastLine}` : status;\n}\n\nexport async function createWarlockApp(application: App): Promise<ScaffoldOutcome> {\n const options = application.options;\n const { useGit, useJWT, features, aiProviders, databaseDriver } = options;\n const noDatabase = isNoDatabase(databaseDriver);\n const problems: Problem[] = [];\n\n // Resolve the versions to pin BEFORE anything is written. The scaffolder's\n // own version is only used when the registry confirms it exists — see\n // helpers/warlock-versions.ts for why an unverified pin broke every install.\n const { versions, notes } = await resolveWarlockVersions();\n\n // Step 1: Initialize and copy template\n const templateSpinner = spinner();\n templateSpinner.start(spinnerMessages.copyingTemplate);\n\n try {\n application.init().use(\"warlock\").updatePackageJson(versions).updateDotEnv();\n\n // Wire the chosen database driver into .env — or, when the user opted out,\n // strip the database config entirely so the app boots with no database.\n if (noDatabase) {\n application.removeDatabaseConfig();\n } else {\n application.configureDatabaseEnv(databaseDriver);\n application.configureDatabaseConfig(databaseDriver);\n }\n\n const usesWeb = features.some((feature) =>\n [\"web\", \"tailwind\", \"shadcn\", \"design-system\", \"mantine\", \"sitemap\"].includes(feature),\n );\n\n // The Mantine kit replaces the starter's Tailwind setup, unless Tailwind was asked for.\n const withoutTailwind = features.includes(\"mantine\") && !features.includes(\"tailwind\");\n application.configureWebStarter(usesWeb, versions, withoutTailwind);\n application.configureLintToolchain();\n application.configureAgentKitTargets(options.agents ?? [\"claude\"]);\n } catch (error) {\n templateSpinner.stop(spinnerMessages.templateFailed);\n\n failFatally({\n step: \"Template copy\",\n detail: `The project files could not be written: ${(error as Error).message}`,\n hints: [\n \"Check that the target directory is writable and that no file is locked by another process.\",\n ],\n });\n }\n\n templateSpinner.stop(spinnerMessages.templateCopied);\n\n showNotes([...notes]);\n\n // Step 2: Install base dependencies (so the `warlock` binary is available).\n // Nothing downstream works without this, so a failure ends the run — loudly,\n // with the command, its exit code and its output.\n const installSpinner = spinner();\n installSpinner.start(spinnerMessages.installingDeps);\n\n const baseInstall = application.install();\n const baseInstalled = await baseInstall.install;\n const baseInstallResult = await baseInstall.result;\n\n if (!baseInstalled) {\n installSpinner.stop(spinnerMessages.depsFailed);\n\n failFatally({\n step: \"Dependency install\",\n detail: \"The project's dependencies were not installed.\",\n result: baseInstallResult,\n hints: installFailureHints(baseInstallResult),\n });\n }\n\n installSpinner.stop(spinnerMessages.depsInstalled);\n\n // Step 3: Add features via `warlock add --no-install`, then one batched install.\n // The DB driver, optional features, and AI providers all go through the single\n // source of truth (core's feature map) so versions never drift. When no\n // database was chosen, the driver is omitted (there is no `none` feature).\n const selectedFeatures = [...(noDatabase ? [] : [databaseDriver]), ...features, ...aiProviders];\n\n // Features the user asked for that are not in the project when we finish.\n const failedFeatures: { feature: string; reason: string }[] = [];\n let featureDependencyInstallFailed = false;\n\n if (selectedFeatures.length > 0) {\n const featuresSpinner = spinner();\n featuresSpinner.start(spinnerMessages.addingFeatures);\n\n let addedFeatures = selectedFeatures;\n\n if (!(await application.installFeatures(selectedFeatures))) {\n // The batch is all-or-nothing, so it cannot say WHICH feature broke it.\n // Retry them one at a time: every feature that can be added still gets\n // added, and every one that cannot gets its own reason.\n const batchFailure = takeLastCommandOutput();\n\n addedFeatures = [];\n\n for (const feature of selectedFeatures) {\n if (await application.installFeatures([feature])) {\n addedFeatures.push(feature);\n } else {\n failedFeatures.push({\n feature,\n reason: reasonFrom(takeLastCommandOutput() ?? batchFailure),\n });\n }\n }\n }\n\n let featureInstall: CommandResult | undefined;\n\n if (addedFeatures.length > 0) {\n // `warlock add` records the feature dependencies but does not reconcile\n // them with each other. The `web` feature brings `vite` while the\n // template always brings `vitest`, whose own vite range resolves to a\n // different major — two copies, and yarn 1 aborts the whole link phase\n // on them. Pin one copy BEFORE the batched install, not after.\n application.pinViteResolution();\n application.approveSelectedFeatureBuilds(addedFeatures);\n\n const install = application.install();\n const installed = await install.install;\n\n featureInstall = await install.result;\n\n if (!installed) {\n // The dependencies were recorded but never fetched — the features are\n // not usable, so they are failures, not successes.\n const reason = `their packages were not installed (${reasonFrom(featureInstall)})`;\n\n for (const feature of addedFeatures) {\n failedFeatures.push({ feature, reason });\n }\n\n addedFeatures = [];\n featureDependencyInstallFailed = true;\n }\n }\n\n if (failedFeatures.length === 0) {\n featuresSpinner.stop(spinnerMessages.featuresAdded);\n } else {\n featuresSpinner.stop(\n addedFeatures.length > 0 ? spinnerMessages.featuresPartial : spinnerMessages.featuresFailed,\n );\n\n problems.push({\n step: \"Features\",\n detail: failedFeatures\n .map(({ feature, reason }) => `${feature}: ${reason}`)\n .join(\"\\n \"),\n result: featureInstall?.ok === false ? featureInstall : undefined,\n hints: [\n `Retry inside the project with: npx warlock add ${failedFeatures\n .map(({ feature }) => feature)\n .join(\" \")}`,\n ],\n });\n }\n }\n\n // Step 4: Initialize Git repository if requested\n if (useGit) {\n const gitSpinner = spinner();\n gitSpinner.start(spinnerMessages.initializingGit);\n\n const initialized = await application.git();\n\n gitSpinner.stop(initialized ? spinnerMessages.gitInitialized : spinnerMessages.gitFailed);\n\n if (!initialized) {\n const failure = takeLastCommandOutput();\n\n problems.push({\n step: \"Git repository\",\n detail: `The repository was not initialized: ${reasonFrom(failure)}`,\n result: failure,\n hints: [\n \"Check that git is installed and that user.name / user.email are configured, then run `git init` yourself.\",\n ],\n });\n }\n }\n\n // Step 5: Generate JWT or warm cache\n if (useJWT && featureDependencyInstallFailed) {\n problems.push({\n step: \"JWT secrets\",\n detail: \"Skipped because the selected feature dependencies did not install.\",\n hints: [\n `Install the failed feature dependencies, then run \\`${runPackageManagerCommand(\"jwt\")}\\` inside the project.`,\n ],\n });\n } else if (useJWT) {\n const jwtSpinner = spinner();\n jwtSpinner.start(spinnerMessages.generatingJwt);\n\n const command = runPackageManagerCommand(\"jwt\");\n const generated = await application.exec(command);\n\n jwtSpinner.stop(generated ? spinnerMessages.jwtGenerated : spinnerMessages.jwtFailed);\n\n if (!generated) {\n const failure = takeLastCommandOutput();\n\n problems.push({\n step: \"JWT secrets\",\n detail: `No JWT secrets were written to .env: ${reasonFrom(failure)}`,\n result: failure,\n hints: [`Run \\`${command}\\` inside the project before starting it.`],\n });\n }\n } else {\n // The warm cache is a start-up optimisation, not something the user asked\n // for: report it, but it does not make the scaffold a failure.\n const warmSpinner = spinner();\n warmSpinner.start(spinnerMessages.warmingCache);\n\n const warmed = await application.exec(\"npx warlock --warm-cache\");\n\n warmSpinner.stop(warmed ? spinnerMessages.cacheWarmed : spinnerMessages.cacheWarmFailed);\n\n if (!warmed) takeLastCommandOutput();\n }\n\n // Step 6: Report what actually happened — the summary may only advertise\n // features that are really in the project.\n const requestedFeatures = [...features, ...aiProviders];\n const missingFeatures = failedFeatures\n .map(({ feature }) => feature)\n .filter((feature) => requestedFeatures.includes(feature));\n const installedFeatures = requestedFeatures.filter(\n (feature) => !missingFeatures.includes(feature),\n );\n\n if (problems.length > 0) {\n showProblems(problems);\n\n showPartialScreen({\n projectName: application.name,\n database: getDatabaseLabel(databaseDriver),\n features: installedFeatures,\n missingFeatures,\n packageManager: getPackageManager(),\n });\n\n printDecisionsSummary({ packageManager: getPackageManager(), options });\n\n return { ok: false, problems };\n }\n\n showSuccessScreen({\n projectName: application.name,\n database: getDatabaseLabel(databaseDriver),\n features: installedFeatures,\n packageManager: getPackageManager(),\n });\n\n printDecisionsSummary({ packageManager: getPackageManager(), options });\n\n return { ok: true, problems };\n}\n"],"mappings":";;;;;;;;;;;;AA6BA,SAAS,WAAW,QAA2C;CAC7D,IAAI,CAAC,QAAQ,OAAO;CAEpB,IAAI,OAAO,OACT,OAAO,OAAO,MAAM,WAAW,OAAO,OAAO,KAAK;CAGpD,MAAM,WAAW,GAAG,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;IACR,OAAO,CAAC,SAAS,QAAQ,0CAA0C;GACrE,CAAC;EACH;CACF,OAAO;EAGL,MAAM,cAAc,QAAQ;EAC5B,YAAY,MAAM,gBAAgB,YAAY;EAE9C,MAAM,SAAS,MAAM,YAAY,KAAK,0BAA0B;EAEhE,YAAY,KAAK,SAAS,gBAAgB,cAAc,gBAAgB,eAAe;EAEvF,IAAI,CAAC,QAAQ,sBAAsB;CACrC;CAIA,MAAM,oBAAoB,CAAC,GAAG,UAAU,GAAG,WAAW;CACtD,MAAM,kBAAkB,eACrB,KAAK,EAAE,cAAc,OAAO,CAAC,CAC7B,QAAQ,YAAY,kBAAkB,SAAS,OAAO,CAAC;CAC1D,MAAM,oBAAoB,kBAAkB,QACzC,YAAY,CAAC,gBAAgB,SAAS,OAAO,CAChD;CAEA,IAAI,SAAS,SAAS,GAAG;EACvB,aAAa,QAAQ;EAErB,kBAAkB;GAChB,aAAa,YAAY;GACzB,UAAU,iBAAiB,cAAc;GACzC,UAAU;GACV;GACA,gBAAgB,kBAAkB;EACpC,CAAC;EAED,sBAAsB;GAAE,gBAAgB,kBAAkB;GAAG;EAAQ,CAAC;EAEtE,OAAO;GAAE,IAAI;GAAO;EAAS;CAC/B;CAEA,kBAAkB;EAChB,aAAa,YAAY;EACzB,UAAU,iBAAiB,cAAc;EACzC,UAAU;EACV,gBAAgB,kBAAkB;CACpC,CAAC;CAED,sBAAsB;EAAE,gBAAgB,kBAAkB;EAAG;CAAQ,CAAC;CAEtE,OAAO;EAAE,IAAI;EAAM;CAAS;AAC9B"}
@@ -47,6 +47,12 @@ const features = [
47
47
  hint: "Add the shared accessible Mongez controls; requires Tailwind to be set up",
48
48
  group: "Rendering & Mail"
49
49
  },
50
+ {
51
+ key: "mantine",
52
+ label: "Mantine UI kit",
53
+ hint: "Mantine components wired to Mongez React Form, with notify, confirm and a paginated table; an alternative to shadcn, no Tailwind needed",
54
+ group: "Rendering & Mail"
55
+ },
50
56
  {
51
57
  key: "sitemap",
52
58
  label: "Sitemap",
@@ -1 +1 @@
1
- {"version":3,"file":"features-map.mjs","names":[],"sources":["../../../../../../../packages/create-warlock/src/features/features-map.ts"],"sourcesContent":["/**\n * Presentation manifest for the scaffolder's feature prompts.\n *\n * This file is **display metadata only** — keys, labels, hints, grouping, and\n * default selections. It deliberately holds NO dependency names or versions:\n * the single source of truth for what each feature installs is the `add`\n * command's feature map in `@warlock.js/core`\n * (`src/generations/add-command.action.ts`). The scaffolder collects the\n * selections here and delegates the actual install to `warlock add`, so the\n * two never drift on versions again.\n *\n * Every `key` below MUST exist in core’s `allowedFeatures`. That guard now\n * EXISTS: `builder/scripts/check-feature-parity.ts`, run by every publishing\n * script in `builder/package.json`, so a release aborts before `pkgist` starts.\n * It could not live in this repo: this package deliberately does not depend on\n * `@warlock.js/core`, and our own CI checks out only this repo, so core’s keys\n * are not present here to compare against. `builder` sits above both and\n * imports each by relative path, adding no dependency edge in either direction.\n *\n * A subset assertion ALONE is not enough and has already let a\n * bug ship: `--features=web,tailwind` was rejected with \"Unknown feature(s):\n * tailwind\" because `tailwind` and `shadcn` existed in core and were missing\n * from THIS file — a direction a scaffolder ⊆ core check cannot see. The guard\n * has to run both ways:\n *\n * 1. scaffolder ⊆ core — catches a typo or a key core renamed.\n * 2. core ⊆ scaffolder + an explicit omission list — catches a feature core\n * gained that never became scaffoldable.\n *\n * The two lists are not equal and should not be forced to be. As of this\n * writing core holds 28 keys and this file offers 24; the other four are\n * deliberate and are the entire allow-list direction (2) needs:\n * `mongodb`, `postgres`, `mysql` (the database driver has its own select) and\n * `ai` (pulled automatically by every `ai-*` key's `requires`). Anything beyond\n * those four is a gap, not a decision, and should fail the build.\n */\n\nexport type FeatureGroup =\n | \"Auth & Access\"\n | \"Rendering & Mail\"\n | \"Media\"\n | \"Storage & Cache\"\n | \"Jobs & Messaging\"\n | \"Realtime\"\n | \"API Docs\"\n | \"Tooling\";\n\nexport type FeatureOption = {\n /** Must match a key in core's `add` feature map. */\n key: string;\n label: string;\n hint: string;\n group: FeatureGroup;\n defaultSelected?: boolean;\n};\n\n/**\n * Optional features offered in the general multiselect step. The database\n * driver (its own select) and AI providers + capability packages (their own\n * step) are intentionally NOT here — they have dedicated prompts.\n */\nexport const features: FeatureOption[] = [\n // Auth & Access\n {\n key: \"access\",\n label: \"Access (authorization)\",\n hint: \"RBAC permission checks, ABAC policies, and roles — pairs with auth\",\n group: \"Auth & Access\",\n },\n {\n key: \"auth-google\",\n label: \"Google sign-in\",\n hint: \"Google OAuth sign-in for @warlock.js/auth\",\n group: \"Auth & Access\",\n },\n {\n key: \"auth-passkeys\",\n label: \"Passkey sign-in\",\n hint: \"WebAuthn passkey login for @warlock.js/auth\",\n group: \"Auth & Access\",\n },\n\n // Rendering & Mail\n {\n key: \"web\",\n label: \"Web (SSR React pages)\",\n hint: \"Server-rendered React pages on the same server as your API — scaffolds src/web and registers the connector\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"tailwind\",\n label: \"Tailwind CSS\",\n hint: \"Tailwind v4 for the SSR page layer — creates src/web/app.css (the CSS-first config) and wires it through Vite (pulls web)\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"shadcn\",\n label: \"Tailwind + shadcn/ui design system\",\n hint: \"Accessible Mongez form controls, shadcn primitives, design tokens and Tailwind\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"design-system\",\n label: \"Controls (existing Tailwind)\",\n hint: \"Add the shared accessible Mongez controls; requires Tailwind to be set up\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"sitemap\",\n label: \"Sitemap\",\n hint: \"Runtime sitemap.xml generation from the page registry — requires app.publicUrl or PUBLIC_APP_URL (pulls web)\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"devtools\",\n label: \"Devtools (/__warlock)\",\n hint: \"Development-only dashboard: request timeline, queries + EXPLAIN, N+1 warnings, dev mailbox, logs, cache, routes — installed as a dev dependency, never runs in production\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"react\",\n label: \"React (rendering & mails)\",\n hint: \"React + ReactDOM for non-interactive rendering and HTML/email generation\",\n group: \"Rendering & Mail\",\n defaultSelected: true,\n },\n {\n key: \"react-email\",\n label: \"React Email\",\n hint: \"Build email templates with React + Tailwind (pulls react + mail)\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"mail\",\n label: \"Mail (Nodemailer)\",\n hint: \"Send emails via SMTP\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"ses\",\n label: \"Amazon SES\",\n hint: \"Send emails via the AWS SES API\",\n group: \"Rendering & Mail\",\n },\n\n // Media\n {\n key: \"image\",\n label: \"Image processing (Sharp)\",\n hint: \"Resize, convert, and optimize images\",\n group: \"Media\",\n },\n\n // Storage & Cache\n {\n key: \"s3\",\n label: \"S3 storage\",\n hint: \"AWS S3 for cloud file storage\",\n group: \"Storage & Cache\",\n },\n {\n key: \"redis\",\n label: \"Redis cache\",\n hint: \"Redis driver for the cache layer\",\n group: \"Storage & Cache\",\n },\n\n // Jobs & Messaging\n {\n key: \"scheduler\",\n label: \"Scheduler\",\n hint: \"Background tasks and cron jobs\",\n group: \"Jobs & Messaging\",\n },\n {\n key: \"queue\",\n label: \"Queue (BullMQ)\",\n hint: \"Durable Redis-backed background jobs with retries and workers\",\n group: \"Jobs & Messaging\",\n },\n {\n key: \"bull-board\",\n label: \"Bull Board (queue dashboard)\",\n hint: \"Web dashboard for inspecting queues and jobs — enabled outside production only, and refuses to mount unguarded (pulls queue)\",\n group: \"Jobs & Messaging\",\n },\n {\n key: \"herald\",\n label: \"Herald (RabbitMQ)\",\n hint: \"Message broker for event-driven architecture\",\n group: \"Jobs & Messaging\",\n },\n {\n key: \"notifications\",\n label: \"Notifications\",\n hint: \"Multi-channel notifications — mail + in-app database, preferences, idempotency\",\n group: \"Jobs & Messaging\",\n },\n\n // Realtime\n {\n key: \"socket\",\n label: \"Socket.IO\",\n hint: \"Realtime websocket server\",\n group: \"Realtime\",\n },\n\n // API Docs (swagger / postman / openapi) — not shipped yet; they will arrive\n // together in the unified @warlock.js/api-docs package. Re-add the selection\n // once that package exists. (Removed so the wizard can't offer unbuilt features.)\n\n // Tooling\n {\n key: \"test\",\n label: \"Testing (Vitest)\",\n hint: \"Vitest + coverage + per-worker DB/cache test setup\",\n group: \"Tooling\",\n },\n];\n\nexport type AiProviderOption = {\n /** Must match a provider/package key in core's `add` feature map. */\n key: string;\n label: string;\n hint: string;\n};\n\n/**\n * AI providers offered in the dedicated AI step. Selecting any of these pulls\n * the core `@warlock.js/ai` package automatically via the provider's `requires`\n * in core's feature map — the scaffolder never lists `ai` as a standalone pick.\n *\n * Keys are `ai-`prefixed to mirror core's renamed provider feature keys\n * (`ai-openai` → `@warlock.js/ai-openai`, etc.).\n */\nexport const aiProviders: AiProviderOption[] = [\n { key: \"ai-openai\", label: \"OpenAI\", hint: \"GPT models via the OpenAI API\" },\n {\n key: \"ai-google\",\n label: \"Google (Gemini)\",\n hint: \"Gemini models via Google AI\",\n },\n {\n key: \"ai-anthropic\",\n label: \"Anthropic (Claude)\",\n hint: \"Claude models via the Anthropic API\",\n },\n {\n key: \"ai-bedrock\",\n label: \"AWS Bedrock\",\n hint: \"Foundation models via Amazon Bedrock\",\n },\n { key: \"ai-ollama\", label: \"Ollama\", hint: \"Local models via Ollama\" },\n];\n\n/**\n * AI capability packages offered alongside the providers in the dedicated AI\n * step. These are the satellite packages that sit on top of the core\n * `@warlock.js/ai` toolkit (each pulls the core `ai` package via its `requires`\n * in core's feature map, same as the providers).\n */\nexport const aiPackages: AiProviderOption[] = [\n {\n key: \"ai-tools\",\n label: \"AI Tools\",\n hint: \"Ready-made agent tools (web search, fetch, HTTP, calculator, date-time) + MCP client/server\",\n },\n {\n key: \"ai-panoptic\",\n label: \"AI Observability (Panoptic)\",\n hint: \"Tracing + exporters + a zero-setup local dashboard\",\n },\n {\n key: \"ai-workspace\",\n label: \"AI Workspace\",\n hint: \"Policy-jailed filesystem + shell for coding agents\",\n },\n];\n\n/**\n * Feature options for the multiselect prompt, ordered by group with the group\n * surfaced in the hint (keeps a flat list scannable without group widgets).\n */\nexport function getFeatureOptions() {\n return features.map((feature) => ({\n value: feature.key,\n label: feature.label,\n hint: `${feature.group} — ${feature.hint}`,\n }));\n}\n\n/**\n * Keys pre-checked in the feature multiselect.\n */\nexport function getDefaultFeatureKeys(): string[] {\n return features.filter((feature) => feature.defaultSelected).map((feature) => feature.key);\n}\n\n/**\n * AI provider options for the dedicated AI multiselect step.\n */\nexport function getAiProviderOptions() {\n return aiProviders.map((provider) => ({\n value: provider.key,\n label: provider.label,\n hint: provider.hint,\n }));\n}\n\n/**\n * AI capability package options for the dedicated AI multiselect step. Offered\n * together with the providers (see `getAiProviderOptions`).\n */\nexport function getAiPackageOptions() {\n return aiPackages.map((pkg) => ({\n value: pkg.key,\n label: pkg.label,\n hint: pkg.hint,\n }));\n}\n\n/**\n * Every selectable key the scaffolder knows about (features + AI providers +\n * AI capability packages). Used to validate `--features` / `--ai` flags in\n * non-interactive mode.\n */\nexport function getAllFeatureKeys(): string[] {\n return [\n ...features.map((feature) => feature.key),\n ...aiProviders.map((provider) => provider.key),\n ...aiPackages.map((pkg) => pkg.key),\n ];\n}\n\n/** Feature sections in manifest order, with short lists for the grouped picker. */\nexport function getFeatureGroups() {\n const labels = [...new Set(features.map((feature) => feature.group))];\n return labels.map((label) => ({\n label,\n options: features\n .filter((feature) => feature.group === label)\n .map((feature) => ({\n value: feature.key,\n label: feature.label,\n hint: feature.hint,\n })),\n }));\n}\n"],"mappings":";;;;;;AA6DA,MAAa,WAA4B;CAEvC;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;EACP,iBAAiB;CACnB;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAOA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;AACF;;;;;;;;;AAiBA,MAAa,cAAkC;CAC7C;EAAE,KAAK;EAAa,OAAO;EAAU,MAAM;CAAgC;CAC3E;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EAAE,KAAK;EAAa,OAAO;EAAU,MAAM;CAA0B;AACvE;;;;;;;AAQA,MAAa,aAAiC;CAC5C;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;AACF;;;;AAiBA,SAAgB,wBAAkC;CAChD,OAAO,SAAS,QAAQ,YAAY,QAAQ,eAAe,CAAC,CAAC,KAAK,YAAY,QAAQ,GAAG;AAC3F;;;;AAKA,SAAgB,uBAAuB;CACrC,OAAO,YAAY,KAAK,cAAc;EACpC,OAAO,SAAS;EAChB,OAAO,SAAS;EAChB,MAAM,SAAS;CACjB,EAAE;AACJ;;;;;AAMA,SAAgB,sBAAsB;CACpC,OAAO,WAAW,KAAK,SAAS;EAC9B,OAAO,IAAI;EACX,OAAO,IAAI;EACX,MAAM,IAAI;CACZ,EAAE;AACJ;;;;;;AAOA,SAAgB,oBAA8B;CAC5C,OAAO;EACL,GAAG,SAAS,KAAK,YAAY,QAAQ,GAAG;EACxC,GAAG,YAAY,KAAK,aAAa,SAAS,GAAG;EAC7C,GAAG,WAAW,KAAK,QAAQ,IAAI,GAAG;CACpC;AACF;;AAGA,SAAgB,mBAAmB;CAEjC,OAAO,CADS,GAAG,IAAI,IAAI,SAAS,KAAK,YAAY,QAAQ,KAAK,CAAC,CACvD,CAAC,CAAC,KAAK,WAAW;EAC5B;EACA,SAAS,SACN,QAAQ,YAAY,QAAQ,UAAU,KAAK,CAAC,CAC5C,KAAK,aAAa;GACjB,OAAO,QAAQ;GACf,OAAO,QAAQ;GACf,MAAM,QAAQ;EAChB,EAAE;CACN,EAAE;AACJ"}
1
+ {"version":3,"file":"features-map.mjs","names":[],"sources":["../../../../../../../packages/create-warlock/src/features/features-map.ts"],"sourcesContent":["/**\n * Presentation manifest for the scaffolder's feature prompts.\n *\n * This file is **display metadata only** — keys, labels, hints, grouping, and\n * default selections. It deliberately holds NO dependency names or versions:\n * the single source of truth for what each feature installs is the `add`\n * command's feature map in `@warlock.js/core`\n * (`src/generations/add-command.action.ts`). The scaffolder collects the\n * selections here and delegates the actual install to `warlock add`, so the\n * two never drift on versions again.\n *\n * Every `key` below MUST exist in core’s `allowedFeatures`. That guard now\n * EXISTS: `builder/scripts/check-feature-parity.ts`, run by every publishing\n * script in `builder/package.json`, so a release aborts before `pkgist` starts.\n * It could not live in this repo: this package deliberately does not depend on\n * `@warlock.js/core`, and our own CI checks out only this repo, so core’s keys\n * are not present here to compare against. `builder` sits above both and\n * imports each by relative path, adding no dependency edge in either direction.\n *\n * A subset assertion ALONE is not enough and has already let a\n * bug ship: `--features=web,tailwind` was rejected with \"Unknown feature(s):\n * tailwind\" because `tailwind` and `shadcn` existed in core and were missing\n * from THIS file — a direction a scaffolder ⊆ core check cannot see. The guard\n * has to run both ways:\n *\n * 1. scaffolder ⊆ core — catches a typo or a key core renamed.\n * 2. core ⊆ scaffolder + an explicit omission list — catches a feature core\n * gained that never became scaffoldable.\n *\n * The two lists are not equal and should not be forced to be. As of this\n * writing core holds 28 keys and this file offers 24; the other four are\n * deliberate and are the entire allow-list direction (2) needs:\n * `mongodb`, `postgres`, `mysql` (the database driver has its own select) and\n * `ai` (pulled automatically by every `ai-*` key's `requires`). Anything beyond\n * those four is a gap, not a decision, and should fail the build.\n */\n\nexport type FeatureGroup =\n | \"Auth & Access\"\n | \"Rendering & Mail\"\n | \"Media\"\n | \"Storage & Cache\"\n | \"Jobs & Messaging\"\n | \"Realtime\"\n | \"API Docs\"\n | \"Tooling\";\n\nexport type FeatureOption = {\n /** Must match a key in core's `add` feature map. */\n key: string;\n label: string;\n hint: string;\n group: FeatureGroup;\n defaultSelected?: boolean;\n};\n\n/**\n * Optional features offered in the general multiselect step. The database\n * driver (its own select) and AI providers + capability packages (their own\n * step) are intentionally NOT here — they have dedicated prompts.\n */\nexport const features: FeatureOption[] = [\n // Auth & Access\n {\n key: \"access\",\n label: \"Access (authorization)\",\n hint: \"RBAC permission checks, ABAC policies, and roles — pairs with auth\",\n group: \"Auth & Access\",\n },\n {\n key: \"auth-google\",\n label: \"Google sign-in\",\n hint: \"Google OAuth sign-in for @warlock.js/auth\",\n group: \"Auth & Access\",\n },\n {\n key: \"auth-passkeys\",\n label: \"Passkey sign-in\",\n hint: \"WebAuthn passkey login for @warlock.js/auth\",\n group: \"Auth & Access\",\n },\n\n // Rendering & Mail\n {\n key: \"web\",\n label: \"Web (SSR React pages)\",\n hint: \"Server-rendered React pages on the same server as your API — scaffolds src/web and registers the connector\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"tailwind\",\n label: \"Tailwind CSS\",\n hint: \"Tailwind v4 for the SSR page layer — creates src/web/app.css (the CSS-first config) and wires it through Vite (pulls web)\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"shadcn\",\n label: \"Tailwind + shadcn/ui design system\",\n hint: \"Accessible Mongez form controls, shadcn primitives, design tokens and Tailwind\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"design-system\",\n label: \"Controls (existing Tailwind)\",\n hint: \"Add the shared accessible Mongez controls; requires Tailwind to be set up\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"mantine\",\n label: \"Mantine UI kit\",\n hint: \"Mantine components wired to Mongez React Form, with notify, confirm and a paginated table; an alternative to shadcn, no Tailwind needed\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"sitemap\",\n label: \"Sitemap\",\n hint: \"Runtime sitemap.xml generation from the page registry — requires app.publicUrl or PUBLIC_APP_URL (pulls web)\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"devtools\",\n label: \"Devtools (/__warlock)\",\n hint: \"Development-only dashboard: request timeline, queries + EXPLAIN, N+1 warnings, dev mailbox, logs, cache, routes — installed as a dev dependency, never runs in production\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"react\",\n label: \"React (rendering & mails)\",\n hint: \"React + ReactDOM for non-interactive rendering and HTML/email generation\",\n group: \"Rendering & Mail\",\n defaultSelected: true,\n },\n {\n key: \"react-email\",\n label: \"React Email\",\n hint: \"Build email templates with React + Tailwind (pulls react + mail)\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"mail\",\n label: \"Mail (Nodemailer)\",\n hint: \"Send emails via SMTP\",\n group: \"Rendering & Mail\",\n },\n {\n key: \"ses\",\n label: \"Amazon SES\",\n hint: \"Send emails via the AWS SES API\",\n group: \"Rendering & Mail\",\n },\n\n // Media\n {\n key: \"image\",\n label: \"Image processing (Sharp)\",\n hint: \"Resize, convert, and optimize images\",\n group: \"Media\",\n },\n\n // Storage & Cache\n {\n key: \"s3\",\n label: \"S3 storage\",\n hint: \"AWS S3 for cloud file storage\",\n group: \"Storage & Cache\",\n },\n {\n key: \"redis\",\n label: \"Redis cache\",\n hint: \"Redis driver for the cache layer\",\n group: \"Storage & Cache\",\n },\n\n // Jobs & Messaging\n {\n key: \"scheduler\",\n label: \"Scheduler\",\n hint: \"Background tasks and cron jobs\",\n group: \"Jobs & Messaging\",\n },\n {\n key: \"queue\",\n label: \"Queue (BullMQ)\",\n hint: \"Durable Redis-backed background jobs with retries and workers\",\n group: \"Jobs & Messaging\",\n },\n {\n key: \"bull-board\",\n label: \"Bull Board (queue dashboard)\",\n hint: \"Web dashboard for inspecting queues and jobs — enabled outside production only, and refuses to mount unguarded (pulls queue)\",\n group: \"Jobs & Messaging\",\n },\n {\n key: \"herald\",\n label: \"Herald (RabbitMQ)\",\n hint: \"Message broker for event-driven architecture\",\n group: \"Jobs & Messaging\",\n },\n {\n key: \"notifications\",\n label: \"Notifications\",\n hint: \"Multi-channel notifications — mail + in-app database, preferences, idempotency\",\n group: \"Jobs & Messaging\",\n },\n\n // Realtime\n {\n key: \"socket\",\n label: \"Socket.IO\",\n hint: \"Realtime websocket server\",\n group: \"Realtime\",\n },\n\n // API Docs (swagger / postman / openapi) — not shipped yet; they will arrive\n // together in the unified @warlock.js/api-docs package. Re-add the selection\n // once that package exists. (Removed so the wizard can't offer unbuilt features.)\n\n // Tooling\n {\n key: \"test\",\n label: \"Testing (Vitest)\",\n hint: \"Vitest + coverage + per-worker DB/cache test setup\",\n group: \"Tooling\",\n },\n];\n\nexport type AiProviderOption = {\n /** Must match a provider/package key in core's `add` feature map. */\n key: string;\n label: string;\n hint: string;\n};\n\n/**\n * AI providers offered in the dedicated AI step. Selecting any of these pulls\n * the core `@warlock.js/ai` package automatically via the provider's `requires`\n * in core's feature map — the scaffolder never lists `ai` as a standalone pick.\n *\n * Keys are `ai-`prefixed to mirror core's renamed provider feature keys\n * (`ai-openai` → `@warlock.js/ai-openai`, etc.).\n */\nexport const aiProviders: AiProviderOption[] = [\n { key: \"ai-openai\", label: \"OpenAI\", hint: \"GPT models via the OpenAI API\" },\n {\n key: \"ai-google\",\n label: \"Google (Gemini)\",\n hint: \"Gemini models via Google AI\",\n },\n {\n key: \"ai-anthropic\",\n label: \"Anthropic (Claude)\",\n hint: \"Claude models via the Anthropic API\",\n },\n {\n key: \"ai-bedrock\",\n label: \"AWS Bedrock\",\n hint: \"Foundation models via Amazon Bedrock\",\n },\n { key: \"ai-ollama\", label: \"Ollama\", hint: \"Local models via Ollama\" },\n];\n\n/**\n * AI capability packages offered alongside the providers in the dedicated AI\n * step. These are the satellite packages that sit on top of the core\n * `@warlock.js/ai` toolkit (each pulls the core `ai` package via its `requires`\n * in core's feature map, same as the providers).\n */\nexport const aiPackages: AiProviderOption[] = [\n {\n key: \"ai-tools\",\n label: \"AI Tools\",\n hint: \"Ready-made agent tools (web search, fetch, HTTP, calculator, date-time) + MCP client/server\",\n },\n {\n key: \"ai-panoptic\",\n label: \"AI Observability (Panoptic)\",\n hint: \"Tracing + exporters + a zero-setup local dashboard\",\n },\n {\n key: \"ai-workspace\",\n label: \"AI Workspace\",\n hint: \"Policy-jailed filesystem + shell for coding agents\",\n },\n];\n\n/**\n * Feature options for the multiselect prompt, ordered by group with the group\n * surfaced in the hint (keeps a flat list scannable without group widgets).\n */\nexport function getFeatureOptions() {\n return features.map((feature) => ({\n value: feature.key,\n label: feature.label,\n hint: `${feature.group} — ${feature.hint}`,\n }));\n}\n\n/**\n * Keys pre-checked in the feature multiselect.\n */\nexport function getDefaultFeatureKeys(): string[] {\n return features.filter((feature) => feature.defaultSelected).map((feature) => feature.key);\n}\n\n/**\n * AI provider options for the dedicated AI multiselect step.\n */\nexport function getAiProviderOptions() {\n return aiProviders.map((provider) => ({\n value: provider.key,\n label: provider.label,\n hint: provider.hint,\n }));\n}\n\n/**\n * AI capability package options for the dedicated AI multiselect step. Offered\n * together with the providers (see `getAiProviderOptions`).\n */\nexport function getAiPackageOptions() {\n return aiPackages.map((pkg) => ({\n value: pkg.key,\n label: pkg.label,\n hint: pkg.hint,\n }));\n}\n\n/**\n * Every selectable key the scaffolder knows about (features + AI providers +\n * AI capability packages). Used to validate `--features` / `--ai` flags in\n * non-interactive mode.\n */\nexport function getAllFeatureKeys(): string[] {\n return [\n ...features.map((feature) => feature.key),\n ...aiProviders.map((provider) => provider.key),\n ...aiPackages.map((pkg) => pkg.key),\n ];\n}\n\n/** Feature sections in manifest order, with short lists for the grouped picker. */\nexport function getFeatureGroups() {\n const labels = [...new Set(features.map((feature) => feature.group))];\n return labels.map((label) => ({\n label,\n options: features\n .filter((feature) => feature.group === label)\n .map((feature) => ({\n value: feature.key,\n label: feature.label,\n hint: feature.hint,\n })),\n }));\n}\n"],"mappings":";;;;;;AA6DA,MAAa,WAA4B;CAEvC;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;EACP,iBAAiB;CACnB;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAOA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;AACF;;;;;;;;;AAiBA,MAAa,cAAkC;CAC7C;EAAE,KAAK;EAAa,OAAO;EAAU,MAAM;CAAgC;CAC3E;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EAAE,KAAK;EAAa,OAAO;EAAU,MAAM;CAA0B;AACvE;;;;;;;AAQA,MAAa,aAAiC;CAC5C;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;CACA;EACE,KAAK;EACL,OAAO;EACP,MAAM;CACR;AACF;;;;AAiBA,SAAgB,wBAAkC;CAChD,OAAO,SAAS,QAAQ,YAAY,QAAQ,eAAe,CAAC,CAAC,KAAK,YAAY,QAAQ,GAAG;AAC3F;;;;AAKA,SAAgB,uBAAuB;CACrC,OAAO,YAAY,KAAK,cAAc;EACpC,OAAO,SAAS;EAChB,OAAO,SAAS;EAChB,MAAM,SAAS;CACjB,EAAE;AACJ;;;;;AAMA,SAAgB,sBAAsB;CACpC,OAAO,WAAW,KAAK,SAAS;EAC9B,OAAO,IAAI;EACX,OAAO,IAAI;EACX,MAAM,IAAI;CACZ,EAAE;AACJ;;;;;;AAOA,SAAgB,oBAA8B;CAC5C,OAAO;EACL,GAAG,SAAS,KAAK,YAAY,QAAQ,GAAG;EACxC,GAAG,YAAY,KAAK,aAAa,SAAS,GAAG;EAC7C,GAAG,WAAW,KAAK,QAAQ,IAAI,GAAG;CACpC;AACF;;AAGA,SAAgB,mBAAmB;CAEjC,OAAO,CADS,GAAG,IAAI,IAAI,SAAS,KAAK,YAAY,QAAQ,KAAK,CAAC,CACvD,CAAC,CAAC,KAAK,WAAW;EAC5B;EACA,SAAS,SACN,QAAQ,YAAY,QAAQ,UAAU,KAAK,CAAC,CAC5C,KAAK,aAAa;GACjB,OAAO,QAAQ;GACf,OAAO,QAAQ;GACf,MAAM,QAAQ;EAChB,EAAE;CACN,EAAE;AACJ"}
@@ -0,0 +1,39 @@
1
+ //#region ../../packages/create-warlock/src/features/ui-kit.ts
2
+ const UI_KIT_CHOICES = [
3
+ "shadcn",
4
+ "mantine",
5
+ "none"
6
+ ];
7
+ const KIT_FEATURES = [
8
+ "shadcn",
9
+ "mantine",
10
+ "design-system"
11
+ ];
12
+ /**
13
+ * Merge `--ui` into the feature list.
14
+ *
15
+ * `shadcn` and `mantine` are alternatives: both would write the same
16
+ * `src/web/design-system` contract files, so a list holding both is refused
17
+ * here instead of failing later inside `warlock add`. `--ui=none` means no kit,
18
+ * and refuses a feature list that names one.
19
+ */
20
+ function applyUiKit(features, ui) {
21
+ if (ui !== void 0 && !UI_KIT_CHOICES.includes(ui)) throw new Error(`Unknown --ui value "${ui}". Use one of: ${UI_KIT_CHOICES.join(", ")}.`);
22
+ const withShadcn = features.includes("shadcn");
23
+ const withMantine = features.includes("mantine");
24
+ if (withShadcn && withMantine) throw new Error("The shadcn and Mantine kits exclude each other. Select one of them (--ui=shadcn or --ui=mantine).");
25
+ if (ui === "none") {
26
+ const named = features.filter((feature) => KIT_FEATURES.includes(feature));
27
+ if (named.length > 0) throw new Error(`--ui=none conflicts with --features ${named.join(",")}.`);
28
+ return features;
29
+ }
30
+ if (ui === "mantine" && withShadcn) throw new Error("--ui=mantine conflicts with the shadcn feature. Pick one UI kit.");
31
+ if (ui === "shadcn" && withMantine) throw new Error("--ui=shadcn conflicts with the mantine feature. Pick one UI kit.");
32
+ const kit = ui ?? (withMantine ? "mantine" : withShadcn ? "shadcn" : void 0);
33
+ const withKit = kit === void 0 ? features : [.../* @__PURE__ */ new Set([...features, kit])];
34
+ return withKit.includes("shadcn") ? [.../* @__PURE__ */ new Set([...withKit, "design-system"])] : withKit;
35
+ }
36
+
37
+ //#endregion
38
+ export { UI_KIT_CHOICES, applyUiKit };
39
+ //# sourceMappingURL=ui-kit.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-kit.mjs","names":[],"sources":["../../../../../../../packages/create-warlock/src/features/ui-kit.ts"],"sourcesContent":["import type { UiKit } from \"../commands/create-new-app/types\";\n\nexport const UI_KIT_CHOICES: readonly UiKit[] = [\"shadcn\", \"mantine\", \"none\"];\n\nconst KIT_FEATURES = [\"shadcn\", \"mantine\", \"design-system\"];\n\n/**\n * Merge `--ui` into the feature list.\n *\n * `shadcn` and `mantine` are alternatives: both would write the same\n * `src/web/design-system` contract files, so a list holding both is refused\n * here instead of failing later inside `warlock add`. `--ui=none` means no kit,\n * and refuses a feature list that names one.\n */\nexport function applyUiKit(features: string[], ui: string | undefined): string[] {\n if (ui !== undefined && !UI_KIT_CHOICES.includes(ui as UiKit)) {\n throw new Error(`Unknown --ui value \"${ui}\". Use one of: ${UI_KIT_CHOICES.join(\", \")}.`);\n }\n\n const withShadcn = features.includes(\"shadcn\");\n const withMantine = features.includes(\"mantine\");\n\n if (withShadcn && withMantine) {\n throw new Error(\n \"The shadcn and Mantine kits exclude each other. Select one of them (--ui=shadcn or --ui=mantine).\",\n );\n }\n\n if (ui === \"none\") {\n const named = features.filter((feature) => KIT_FEATURES.includes(feature));\n if (named.length > 0) {\n throw new Error(`--ui=none conflicts with --features ${named.join(\",\")}.`);\n }\n return features;\n }\n\n if (ui === \"mantine\" && withShadcn) {\n throw new Error(\"--ui=mantine conflicts with the shadcn feature. Pick one UI kit.\");\n }\n\n if (ui === \"shadcn\" && withMantine) {\n throw new Error(\"--ui=shadcn conflicts with the mantine feature. Pick one UI kit.\");\n }\n\n const kit = ui ?? (withMantine ? \"mantine\" : withShadcn ? \"shadcn\" : undefined);\n const withKit = kit === undefined ? features : [...new Set([...features, kit])];\n\n // shadcn always brings the shared controls along, as before.\n return withKit.includes(\"shadcn\") ? [...new Set([...withKit, \"design-system\"])] : withKit;\n}\n"],"mappings":";AAEA,MAAa,iBAAmC;CAAC;CAAU;CAAW;AAAM;AAE5E,MAAM,eAAe;CAAC;CAAU;CAAW;AAAe;;;;;;;;;AAU1D,SAAgB,WAAW,UAAoB,IAAkC;CAC/E,IAAI,OAAO,UAAa,CAAC,eAAe,SAAS,EAAW,GAC1D,MAAM,IAAI,MAAM,uBAAuB,GAAG,iBAAiB,eAAe,KAAK,IAAI,EAAE,EAAE;CAGzF,MAAM,aAAa,SAAS,SAAS,QAAQ;CAC7C,MAAM,cAAc,SAAS,SAAS,SAAS;CAE/C,IAAI,cAAc,aAChB,MAAM,IAAI,MACR,mGACF;CAGF,IAAI,OAAO,QAAQ;EACjB,MAAM,QAAQ,SAAS,QAAQ,YAAY,aAAa,SAAS,OAAO,CAAC;EACzE,IAAI,MAAM,SAAS,GACjB,MAAM,IAAI,MAAM,uCAAuC,MAAM,KAAK,GAAG,EAAE,EAAE;EAE3E,OAAO;CACT;CAEA,IAAI,OAAO,aAAa,YACtB,MAAM,IAAI,MAAM,kEAAkE;CAGpF,IAAI,OAAO,YAAY,aACrB,MAAM,IAAI,MAAM,kEAAkE;CAGpF,MAAM,MAAM,OAAO,cAAc,YAAY,aAAa,WAAW;CACrE,MAAM,UAAU,QAAQ,SAAY,WAAW,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;CAG9E,OAAO,QAAQ,SAAS,QAAQ,IAAI,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,SAAS,eAAe,CAAC,CAAC,IAAI;AACpF"}
@@ -23,6 +23,11 @@ const FLAG_DEFINITIONS = [
23
23
  description: "Comma-separated feature keys (e.g. test,herald)",
24
24
  defaultValue: "none (or [\"web\"] when --stack=web and --features is not given)"
25
25
  },
26
+ {
27
+ usage: "--ui=<shadcn|mantine|none>",
28
+ description: "UI kit for web apps: shadcn (Tailwind + shadcn/ui), Mantine (no Tailwind) or none. Both kits expose the same design-system components; they exclude each other",
29
+ defaultValue: "shadcn when --stack=web, otherwise none"
30
+ },
26
31
  {
27
32
  usage: "--ai=<list>",
28
33
  description: `Comma-separated AI provider or capability keys (${AI_FEATURE_KEYS.join(", ")})`,
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.mjs","names":[],"sources":["../../../../../../../packages/create-warlock/src/flags/definitions.ts"],"sourcesContent":["import { getAiPackageOptions, getAiProviderOptions } from \"../features/features-map\";\n\n/**\n * Single source of truth for every CLI flag's help text and default, so\n * `--help` can never drift out of sync with what the parser actually\n * understands (requirement: `--help` lists every flag together with its\n * default value).\n */\nexport type FlagDefinition = {\n /** How the flag reads on the command line, e.g. `--db=<driver>`. */\n usage: string;\n description: string;\n /** Human-readable default, or what happens when it is left unanswered. */\n defaultValue: string;\n};\n\nconst AI_FEATURE_KEYS = [...getAiProviderOptions(), ...getAiPackageOptions()].map(\n ({ value }) => value,\n);\n\nexport const FLAG_DEFINITIONS: FlagDefinition[] = [\n {\n usage: \"--name=<name>\",\n description: \"Project name (or pass it as the first positional arg)\",\n defaultValue: \"required — prompted if a TTY is available, otherwise fails naming this flag\",\n },\n {\n usage: \"--stack=<api|web>\",\n description:\n \"API-only or full-stack web — the one structural choice that changes the app's shape. Customizing everything else is a flow, not a stack: use --customize, where --stack=web arrives as a pre-ticked web feature\",\n defaultValue: \"api\",\n },\n {\n usage: \"--db=<driver> / --no-db\",\n description: \"Database driver (e.g. postgres, mongodb), or skip a database entirely\",\n defaultValue: \"mongodb\",\n },\n {\n usage: \"--features=<list>\",\n description: \"Comma-separated feature keys (e.g. test,herald)\",\n defaultValue: 'none (or [\"web\"] when --stack=web and --features is not given)',\n },\n {\n usage: \"--ai=<list>\",\n description: `Comma-separated AI provider or capability keys (${AI_FEATURE_KEYS.join(\", \")})`,\n defaultValue: \"none\",\n },\n {\n usage: \"--pm=<manager>\",\n description: \"Package manager to use (npm, yarn, pnpm, bun)\",\n defaultValue: \"inferred from the invoking agent (npm_config_user_agent) or the system\",\n },\n {\n usage: \"--lint=<oxc>\",\n description: \"Linter and formatter: Oxlint/Oxfmt\",\n defaultValue: \"oxc\",\n },\n {\n usage: \"--agents=<list>\",\n description: \"Comma-separated agent-kit targets to derive docs/skills for\",\n defaultValue: \"claude\",\n },\n {\n usage: \"--git / --no-git\",\n description: \"Force-enable or force-disable git initialization\",\n defaultValue: \"false\",\n },\n {\n usage: \"--jwt / --no-jwt\",\n description: \"Force-enable or force-disable JWT secret generation\",\n defaultValue: \"false\",\n },\n {\n usage: \"-y, --yes\",\n description: \"Skip every prompt and accept defaults for anything unset\",\n defaultValue: \"false\",\n },\n {\n usage: \"--customize, --interactive\",\n description:\n 'Full long-form wizard — every choice asked one by one. Also selectable as \"Customize\" in the \"What are we building?\" menu. Any other flag you pass pre-selects its prompt; --yes is refused',\n defaultValue: \"false\",\n },\n {\n usage: \"-h, --help\",\n description: \"Show this help message and exit\",\n defaultValue: \"n/a\",\n },\n {\n usage: \"-v, --version\",\n description: \"Show the installed create-warlock version and exit\",\n defaultValue: \"n/a\",\n },\n];\n\n/** Render the full `--help` text, one line per flag with its default. */\nexport function buildHelpText(): string {\n const rows = FLAG_DEFINITIONS.map(({ usage, description, defaultValue }) => {\n const label = usage.padEnd(28);\n return ` ${label}${description} (default: ${defaultValue})`;\n }).join(\"\\n\");\n\n return `\n create-warlock — scaffold a new Warlock.js project\n\n Usage\n $ create-warlock [project-name] [options]\n\n Options\n${rows}\n\n Example\n $ create-warlock my-app --db=postgres --features=test,herald --yes\n`;\n}\n"],"mappings":";;;AAgBA,MAAM,kBAAkB,CAAC,GAAG,qBAAqB,GAAG,GAAG,oBAAoB,CAAC,CAAC,CAAC,KAC3E,EAAE,YAAY,KACjB;AAEA,MAAa,mBAAqC;CAChD;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aACE;EACF,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa,mDAAmD,gBAAgB,KAAK,IAAI,EAAE;EAC3F,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aACE;EACF,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;AACF;;AAGA,SAAgB,gBAAwB;CAMtC,OAAO;;;;;;;EALM,iBAAiB,KAAK,EAAE,OAAO,aAAa,mBAAmB;EAE1E,OAAO,OADO,MAAM,OAAO,EACT,IAAI,YAAY,aAAa,aAAa;CAC9D,CAAC,CAAC,CAAC,KAAK,IASL,EAAE;;;;;AAKP"}
1
+ {"version":3,"file":"definitions.mjs","names":[],"sources":["../../../../../../../packages/create-warlock/src/flags/definitions.ts"],"sourcesContent":["import { getAiPackageOptions, getAiProviderOptions } from \"../features/features-map\";\n\n/**\n * Single source of truth for every CLI flag's help text and default, so\n * `--help` can never drift out of sync with what the parser actually\n * understands (requirement: `--help` lists every flag together with its\n * default value).\n */\nexport type FlagDefinition = {\n /** How the flag reads on the command line, e.g. `--db=<driver>`. */\n usage: string;\n description: string;\n /** Human-readable default, or what happens when it is left unanswered. */\n defaultValue: string;\n};\n\nconst AI_FEATURE_KEYS = [...getAiProviderOptions(), ...getAiPackageOptions()].map(\n ({ value }) => value,\n);\n\nexport const FLAG_DEFINITIONS: FlagDefinition[] = [\n {\n usage: \"--name=<name>\",\n description: \"Project name (or pass it as the first positional arg)\",\n defaultValue: \"required — prompted if a TTY is available, otherwise fails naming this flag\",\n },\n {\n usage: \"--stack=<api|web>\",\n description:\n \"API-only or full-stack web — the one structural choice that changes the app's shape. Customizing everything else is a flow, not a stack: use --customize, where --stack=web arrives as a pre-ticked web feature\",\n defaultValue: \"api\",\n },\n {\n usage: \"--db=<driver> / --no-db\",\n description: \"Database driver (e.g. postgres, mongodb), or skip a database entirely\",\n defaultValue: \"mongodb\",\n },\n {\n usage: \"--features=<list>\",\n description: \"Comma-separated feature keys (e.g. test,herald)\",\n defaultValue: 'none (or [\"web\"] when --stack=web and --features is not given)',\n },\n {\n usage: \"--ui=<shadcn|mantine|none>\",\n description:\n \"UI kit for web apps: shadcn (Tailwind + shadcn/ui), Mantine (no Tailwind) or none. Both kits expose the same design-system components; they exclude each other\",\n defaultValue: \"shadcn when --stack=web, otherwise none\",\n },\n {\n usage: \"--ai=<list>\",\n description: `Comma-separated AI provider or capability keys (${AI_FEATURE_KEYS.join(\", \")})`,\n defaultValue: \"none\",\n },\n {\n usage: \"--pm=<manager>\",\n description: \"Package manager to use (npm, yarn, pnpm, bun)\",\n defaultValue: \"inferred from the invoking agent (npm_config_user_agent) or the system\",\n },\n {\n usage: \"--lint=<oxc>\",\n description: \"Linter and formatter: Oxlint/Oxfmt\",\n defaultValue: \"oxc\",\n },\n {\n usage: \"--agents=<list>\",\n description: \"Comma-separated agent-kit targets to derive docs/skills for\",\n defaultValue: \"claude\",\n },\n {\n usage: \"--git / --no-git\",\n description: \"Force-enable or force-disable git initialization\",\n defaultValue: \"false\",\n },\n {\n usage: \"--jwt / --no-jwt\",\n description: \"Force-enable or force-disable JWT secret generation\",\n defaultValue: \"false\",\n },\n {\n usage: \"-y, --yes\",\n description: \"Skip every prompt and accept defaults for anything unset\",\n defaultValue: \"false\",\n },\n {\n usage: \"--customize, --interactive\",\n description:\n 'Full long-form wizard — every choice asked one by one. Also selectable as \"Customize\" in the \"What are we building?\" menu. Any other flag you pass pre-selects its prompt; --yes is refused',\n defaultValue: \"false\",\n },\n {\n usage: \"-h, --help\",\n description: \"Show this help message and exit\",\n defaultValue: \"n/a\",\n },\n {\n usage: \"-v, --version\",\n description: \"Show the installed create-warlock version and exit\",\n defaultValue: \"n/a\",\n },\n];\n\n/** Render the full `--help` text, one line per flag with its default. */\nexport function buildHelpText(): string {\n const rows = FLAG_DEFINITIONS.map(({ usage, description, defaultValue }) => {\n const label = usage.padEnd(28);\n return ` ${label}${description} (default: ${defaultValue})`;\n }).join(\"\\n\");\n\n return `\n create-warlock — scaffold a new Warlock.js project\n\n Usage\n $ create-warlock [project-name] [options]\n\n Options\n${rows}\n\n Example\n $ create-warlock my-app --db=postgres --features=test,herald --yes\n`;\n}\n"],"mappings":";;;AAgBA,MAAM,kBAAkB,CAAC,GAAG,qBAAqB,GAAG,GAAG,oBAAoB,CAAC,CAAC,CAAC,KAC3E,EAAE,YAAY,KACjB;AAEA,MAAa,mBAAqC;CAChD;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aACE;EACF,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aACE;EACF,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa,mDAAmD,gBAAgB,KAAK,IAAI,EAAE;EAC3F,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aACE;EACF,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA;EACE,OAAO;EACP,aAAa;EACb,cAAc;CAChB;AACF;;AAGA,SAAgB,gBAAwB;CAMtC,OAAO;;;;;;;EALM,iBAAiB,KAAK,EAAE,OAAO,aAAa,mBAAmB;EAE1E,OAAO,OADO,MAAM,OAAO,EACT,IAAI,YAAY,aAAa,aAAa;CAC9D,CAAC,CAAC,CAAC,KAAK,IASL,EAAE;;;;;AAKP"}
@@ -20,8 +20,13 @@ function seedFromFlags(cli) {
20
20
  */
21
21
  function defaultFeatures(cli) {
22
22
  const defaults = getDefaultFeatureKeys();
23
- if (cli.stack !== "web") return defaults;
24
- return [.../* @__PURE__ */ new Set([...defaults, "web"])];
23
+ const kit = cli.ui === "shadcn" || cli.ui === "mantine" ? [cli.ui] : [];
24
+ if (cli.stack !== "web") return [.../* @__PURE__ */ new Set([...defaults, ...kit])];
25
+ return [.../* @__PURE__ */ new Set([
26
+ ...defaults,
27
+ "web",
28
+ ...kit
29
+ ])];
25
30
  }
26
31
 
27
32
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"seed-from-flags.mjs","names":[],"sources":["../../../../../../../packages/create-warlock/src/flags/seed-from-flags.ts"],"sourcesContent":["import type { CliFlags, LintToolchain } from \"../commands/create-new-app/types\";\nimport { getDefaultFeatureKeys } from \"../features/features-map\";\nimport { getPreferredPackageManager } from \"../helpers/package-manager\";\n\n/**\n * The wizard's prompts, pre-selected from whatever the user already spelled\n * out on the command line.\n *\n * Before this existed, `--customize --db=postgres` silently threw the driver\n * away: the wizard asked its own question with its own default and the flag\n * never reached anything. A flag that is accepted and then ignored is the\n * worst of both worlds — the run succeeds, and the answer is wrong.\n *\n * So a flag passed alongside `--customize` is not a contradiction to refuse,\n * it is an answer given early: the prompt opens on that value and the user\n * can still change it.\n */\nexport type WizardSeeds = {\n packageManager: string;\n databaseDriver: string | undefined;\n features: string[];\n aiProviders: string[];\n useGit: boolean;\n useJWT: boolean;\n lint: LintToolchain;\n};\n\nexport function seedFromFlags(cli: CliFlags): WizardSeeds {\n return {\n packageManager: cli.pm ?? getPreferredPackageManager(),\n lint: \"oxc\",\n databaseDriver: cli.db,\n features: cli.features ?? defaultFeatures(cli),\n aiProviders: cli.ai ?? [],\n // clack's confirm opens on `true` when nothing is passed, which is the\n // behaviour these two prompts already had.\n useGit: cli.git ?? true,\n useJWT: cli.jwt ?? true,\n };\n}\n\n/**\n * `--stack=web` is the one structural answer, and the wizard has no stack\n * question of its own — it asks for features instead. So the stack arrives as\n * a pre-ticked `web` feature rather than being dropped on the floor.\n */\nfunction defaultFeatures(cli: CliFlags): string[] {\n const defaults = getDefaultFeatureKeys();\n\n if (cli.stack !== \"web\") return defaults;\n\n return [...new Set([...defaults, \"web\"])];\n}\n"],"mappings":";;;;AA2BA,SAAgB,cAAc,KAA4B;CACxD,OAAO;EACL,gBAAgB,IAAI,MAAM,2BAA2B;EACrD,MAAM;EACN,gBAAgB,IAAI;EACpB,UAAU,IAAI,YAAY,gBAAgB,GAAG;EAC7C,aAAa,IAAI,MAAM,CAAC;EAGxB,QAAQ,IAAI,OAAO;EACnB,QAAQ,IAAI,OAAO;CACrB;AACF;;;;;;AAOA,SAAS,gBAAgB,KAAyB;CAChD,MAAM,WAAW,sBAAsB;CAEvC,IAAI,IAAI,UAAU,OAAO,OAAO;CAEhC,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,KAAK,CAAC,CAAC;AAC1C"}
1
+ {"version":3,"file":"seed-from-flags.mjs","names":[],"sources":["../../../../../../../packages/create-warlock/src/flags/seed-from-flags.ts"],"sourcesContent":["import type { CliFlags, LintToolchain } from \"../commands/create-new-app/types\";\nimport { getDefaultFeatureKeys } from \"../features/features-map\";\nimport { getPreferredPackageManager } from \"../helpers/package-manager\";\n\n/**\n * The wizard's prompts, pre-selected from whatever the user already spelled\n * out on the command line.\n *\n * Before this existed, `--customize --db=postgres` silently threw the driver\n * away: the wizard asked its own question with its own default and the flag\n * never reached anything. A flag that is accepted and then ignored is the\n * worst of both worlds — the run succeeds, and the answer is wrong.\n *\n * So a flag passed alongside `--customize` is not a contradiction to refuse,\n * it is an answer given early: the prompt opens on that value and the user\n * can still change it.\n */\nexport type WizardSeeds = {\n packageManager: string;\n databaseDriver: string | undefined;\n features: string[];\n aiProviders: string[];\n useGit: boolean;\n useJWT: boolean;\n lint: LintToolchain;\n};\n\nexport function seedFromFlags(cli: CliFlags): WizardSeeds {\n return {\n packageManager: cli.pm ?? getPreferredPackageManager(),\n lint: \"oxc\",\n databaseDriver: cli.db,\n features: cli.features ?? defaultFeatures(cli),\n aiProviders: cli.ai ?? [],\n // clack's confirm opens on `true` when nothing is passed, which is the\n // behaviour these two prompts already had.\n useGit: cli.git ?? true,\n useJWT: cli.jwt ?? true,\n };\n}\n\n/**\n * `--stack=web` is the one structural answer, and the wizard has no stack\n * question of its own — it asks for features instead. So the stack arrives as\n * a pre-ticked `web` feature rather than being dropped on the floor.\n */\nfunction defaultFeatures(cli: CliFlags): string[] {\n const defaults = getDefaultFeatureKeys();\n\n const kit = cli.ui === \"shadcn\" || cli.ui === \"mantine\" ? [cli.ui] : [];\n\n if (cli.stack !== \"web\") return [...new Set([...defaults, ...kit])];\n\n return [...new Set([...defaults, \"web\", ...kit])];\n}\n"],"mappings":";;;;AA2BA,SAAgB,cAAc,KAA4B;CACxD,OAAO;EACL,gBAAgB,IAAI,MAAM,2BAA2B;EACrD,MAAM;EACN,gBAAgB,IAAI;EACpB,UAAU,IAAI,YAAY,gBAAgB,GAAG;EAC7C,aAAa,IAAI,MAAM,CAAC;EAGxB,QAAQ,IAAI,OAAO;EACnB,QAAQ,IAAI,OAAO;CACrB;AACF;;;;;;AAOA,SAAS,gBAAgB,KAAyB;CAChD,MAAM,WAAW,sBAAsB;CAEvC,MAAM,MAAM,IAAI,OAAO,YAAY,IAAI,OAAO,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC;CAEtE,IAAI,IAAI,UAAU,OAAO,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC;CAElE,OAAO,CAAC,mBAAG,IAAI,IAAI;EAAC,GAAG;EAAU;EAAO,GAAG;CAAG,CAAC,CAAC;AAClD"}
@@ -255,7 +255,7 @@ var App = class {
255
255
  * Exactly one survives the scaffold: web projects keep the SSR page and API
256
256
  * example; every other project keeps the dependency-free JSON controller.
257
257
  */
258
- configureWebStarter(useWeb, versions = {}) {
258
+ configureWebStarter(useWeb, versions = {}, withoutTailwind = false) {
259
259
  const remove = (relativePath) => {
260
260
  const target = path.resolve(this.path, relativePath);
261
261
  if (existsSync(target)) rmSync(target, {
@@ -294,12 +294,17 @@ var App = class {
294
294
  "@mongez/http": "^3.5.0",
295
295
  "@mongez/react-form": "^4.0.0"
296
296
  };
297
- packageJson.devDependencies = {
297
+ if (!withoutTailwind) packageJson.devDependencies = {
298
298
  ...packageJson.devDependencies,
299
299
  "@tailwindcss/postcss": "^4.1.16",
300
300
  tailwindcss: "^4.1.16"
301
301
  };
302
302
  putJsonFile(packageJsonPath, packageJson);
303
+ if (withoutTailwind) {
304
+ remove("postcss.config.mjs");
305
+ const cssPath = path.resolve(this.path, "src/web/app.css");
306
+ if (existsSync(cssPath)) putFile(cssPath, getFile(cssPath).replace(/^@import "tailwindcss";\r?\n/m, ""));
307
+ }
303
308
  const configPath = path.resolve(this.path, "warlock.config.ts");
304
309
  const config = getFile(configPath);
305
310
  if (!config.includes("\"@warlock.js/web/connector\"")) {