create-warlock 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -37
- package/esm/commands/create-new-app/index.mjs +4 -4
- package/esm/commands/create-new-app/index.mjs.map +1 -1
- package/esm/features/features-map.mjs +53 -11
- package/esm/features/features-map.mjs.map +1 -1
- package/package.json +2 -2
- package/templates/warlock/src/config/cache.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
# Changelog — create-warlock
|
|
2
|
-
|
|
3
|
-
All notable changes to `create-warlock` are documented in this file.
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
## 4.2.11
|
|
8
|
-
|
|
9
|
-
### Changed
|
|
10
|
-
|
|
11
|
-
- Bumped `@mongez/reinforcements` to 3.3.0 (package dependency + project template)
|
|
12
|
-
|
|
13
|
-
## 4.2.10
|
|
14
|
-
|
|
15
|
-
### Changed
|
|
16
|
-
|
|
17
|
-
- The project template now pins the latest `@mongez/*` versions
|
|
18
|
-
|
|
19
|
-
## 4.2.7
|
|
20
|
-
|
|
21
|
-
### Fixed
|
|
22
|
-
|
|
23
|
-
- The published package now ships its `templates/` folder, so scaffolding a new project works from the installed package — it was missing from the build, which
|
|
24
|
-
|
|
25
|
-
## 4.2.6
|
|
26
|
-
|
|
27
|
-
### Fixed
|
|
28
|
-
|
|
29
|
-
- The published package now ships its `bin` folder again, so the `create-warlock` CLI works from the installed package — it was omitted from the 4.2.5 build.
|
|
30
|
-
|
|
31
|
-
## 4.2.5
|
|
32
|
-
|
|
33
|
-
- The feature wizard now offers **Notifications** (`@warlock.js/notifications`) under "Jobs & Messaging" — opt-in; selecting it delegates to `warlock add notifications` (ejects config + scaffolds the in-app model/migration).
|
|
34
|
-
|
|
35
|
-
## 4.1.15
|
|
36
|
-
|
|
37
|
-
- Baseline — per-package changelog tracking starts at this version.
|
|
1
|
+
# Changelog — create-warlock
|
|
2
|
+
|
|
3
|
+
All notable changes to `create-warlock` are documented in this file.
|
|
4
|
+
|
|
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
|
+
|
|
7
|
+
## 4.2.11
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Bumped `@mongez/reinforcements` to 3.3.0 (package dependency + project template)
|
|
12
|
+
|
|
13
|
+
## 4.2.10
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- The project template now pins the latest `@mongez/*` versions (`@mongez/reinforcements@^3.2.0`, `@mongez/agent-kit@^1.2.0`) so freshly scaffolded apps start on current dependencies. (`@warlock.js/*` versions are still rewritten to the scaffolder's own version at install time.)
|
|
18
|
+
|
|
19
|
+
## 4.2.7
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- The published package now ships its `templates/` folder, so scaffolding a new project works from the installed package — it was missing from the build, which failed the wizard with "Something went wrong" at the template-copy step.
|
|
24
|
+
|
|
25
|
+
## 4.2.6
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- The published package now ships its `bin` folder again, so the `create-warlock` CLI works from the installed package — it was omitted from the 4.2.5 build.
|
|
30
|
+
|
|
31
|
+
## 4.2.5
|
|
32
|
+
|
|
33
|
+
- The feature wizard now offers **Notifications** (`@warlock.js/notifications`) under "Jobs & Messaging" — opt-in; selecting it delegates to `warlock add notifications` (ejects config + scaffolds the in-app model/migration).
|
|
34
|
+
|
|
35
|
+
## 4.1.15
|
|
36
|
+
|
|
37
|
+
- Baseline — per-package changelog tracking starts at this version.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDatabaseDriver, getDatabaseDriverOptions } from "../../features/database-drivers.mjs";
|
|
2
|
-
import { getAiProviderOptions, getAllFeatureKeys, getDefaultFeatureKeys, getFeatureOptions } from "../../features/features-map.mjs";
|
|
2
|
+
import { getAiPackageOptions, getAiProviderOptions, getAllFeatureKeys, getDefaultFeatureKeys, getFeatureOptions } from "../../features/features-map.mjs";
|
|
3
3
|
import { detectPackageManagers, getPackageManager, getPreferredPackageManager, getSystemPackageManagers, setPackageManager } from "../../helpers/package-manager.mjs";
|
|
4
4
|
import { packageRoot } from "../../helpers/paths.mjs";
|
|
5
5
|
import { App } from "../../helpers/app.mjs";
|
|
@@ -69,8 +69,8 @@ async function createNewApp(cli = {}) {
|
|
|
69
69
|
process.exit(0);
|
|
70
70
|
}
|
|
71
71
|
const selectedAiProviders = await multiselect({
|
|
72
|
-
message: "Add AI
|
|
73
|
-
options: getAiProviderOptions(),
|
|
72
|
+
message: "Add AI packages? Providers + capabilities — the core AI package is included automatically",
|
|
73
|
+
options: [...getAiProviderOptions(), ...getAiPackageOptions()],
|
|
74
74
|
required: false
|
|
75
75
|
});
|
|
76
76
|
if (isCancel(selectedAiProviders)) {
|
|
@@ -120,7 +120,7 @@ async function createNonInteractive(cli) {
|
|
|
120
120
|
const databaseDriver = cli.db ?? "mongodb";
|
|
121
121
|
const driver = getDatabaseDriver(databaseDriver);
|
|
122
122
|
if (!driver) {
|
|
123
|
-
cancel(`Unknown database driver"${databaseDriver}"`);
|
|
123
|
+
cancel(`Unknown database driver "${databaseDriver}"`);
|
|
124
124
|
process.exit(1);
|
|
125
125
|
}
|
|
126
126
|
const features = cli.features ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../@warlock.js/create-warlock/src/commands/create-new-app/index.ts"],"sourcesContent":["import {\r\n cancel,\r\n confirm,\r\n isCancel,\r\n multiselect,\r\n select,\r\n text,\r\n} from \"@clack/prompts\";\r\nimport { colors } from \"@mongez/copper\";\r\nimport { getJsonFile } from \"@warlock.js/fs\";\r\nimport {\r\n getDatabaseDriver,\r\n getDatabaseDriverOptions,\r\n} from \"../../features/database-drivers\";\r\nimport {\r\n getAiProviderOptions,\r\n getAllFeatureKeys,\r\n getDefaultFeatureKeys,\r\n getFeatureOptions,\r\n} from \"../../features/features-map\";\r\nimport { App } from \"../../helpers/app\";\r\nimport {\r\n detectPackageManagers,\r\n getPackageManager,\r\n getPreferredPackageManager,\r\n getSystemPackageManagers,\r\n setPackageManager,\r\n} from \"../../helpers/package-manager\";\r\nimport { packageRoot } from \"../../helpers/paths\";\r\nimport { showIntroBanner } from \"../../ui/banner\";\r\nimport { createWarlockApp } from \"../create-warlock-app\";\r\nimport getAppPath from \"./get-app-path\";\r\nimport { App as AppType, CliFlags } from \"./types\";\r\n\r\nexport default async function createNewApp(cli: CliFlags = {}) {\r\n // Start detecting package managers in the background to avoid delay later\r\n const pmDetectionPromise = detectPackageManagers();\r\n\r\n // Get version from package.json\r\n const packageJson: any = getJsonFile(packageRoot(\"package.json\"));\r\n const createWarlockVersion = packageJson.version;\r\n\r\n // Show the intro banner\r\n showIntroBanner(createWarlockVersion);\r\n\r\n console.log(colors.cyan(\"Let's create something magical! \\n\"));\r\n\r\n // Validate Node.js version (minimum v20)\r\n const [major] = process.versions.node.split(\".\").map(Number);\r\n if (major < 20) {\r\n cancel(\"Node.js version must be at least 20.0.0\");\r\n process.exit(0);\r\n }\r\n\r\n // Non-interactive path: build everything from flags and skip the prompts.\r\n if (cli.yes) {\r\n await createNonInteractive(cli);\r\n return;\r\n }\r\n\r\n // Step 1: Project name\r\n const appName = await text({\r\n message: \"What shall we call your project?\",\r\n placeholder: \"my-warlock-app\",\r\n });\r\n\r\n if (isCancel(appName) || !appName.trim()) {\r\n cancel(\"A project name is required to continue\");\r\n process.exit(0);\r\n }\r\n\r\n const appPath = getAppPath(appName);\r\n if (!appPath) return;\r\n\r\n // Step 2: Package Manager selection\r\n await pmDetectionPromise; // Ensure detection is complete\r\n\r\n const packageManager = await select({\r\n message: \"Which package manager do you want to use?\",\r\n options: getSystemPackageManagers().map(pm => ({\r\n value: pm,\r\n label: pm,\r\n })),\r\n initialValue: getPreferredPackageManager(),\r\n });\r\n\r\n if (isCancel(packageManager)) {\r\n cancel(\"Package manager selection cancelled\");\r\n process.exit(0);\r\n }\r\n\r\n setPackageManager(packageManager as string);\r\n\r\n // Step 3: Database driver selection\r\n const databaseDriver = await select({\r\n message: \"Choose your database driver\",\r\n options: getDatabaseDriverOptions(),\r\n });\r\n\r\n if (isCancel(databaseDriver)) {\r\n cancel(\"Database selection cancelled\");\r\n process.exit(0);\r\n }\r\n\r\n const selectedDriver = getDatabaseDriver(databaseDriver as string);\r\n\r\n // Step 4: Features selection\r\n const selectedFeatures = await multiselect({\r\n message: \"Select optional features to include\",\r\n options: getFeatureOptions(),\r\n initialValues: getDefaultFeatureKeys(),\r\n required: false,\r\n });\r\n\r\n if (isCancel(selectedFeatures)) {\r\n cancel(\"Feature selection cancelled\");\r\n process.exit(0);\r\n }\r\n\r\n // Step 4b: AI providers
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../@warlock.js/create-warlock/src/commands/create-new-app/index.ts"],"sourcesContent":["import {\r\n cancel,\r\n confirm,\r\n isCancel,\r\n multiselect,\r\n select,\r\n text,\r\n} from \"@clack/prompts\";\r\nimport { colors } from \"@mongez/copper\";\r\nimport { getJsonFile } from \"@warlock.js/fs\";\r\nimport {\r\n getDatabaseDriver,\r\n getDatabaseDriverOptions,\r\n} from \"../../features/database-drivers\";\r\nimport {\r\n getAiPackageOptions,\r\n getAiProviderOptions,\r\n getAllFeatureKeys,\r\n getDefaultFeatureKeys,\r\n getFeatureOptions,\r\n} from \"../../features/features-map\";\r\nimport { App } from \"../../helpers/app\";\r\nimport {\r\n detectPackageManagers,\r\n getPackageManager,\r\n getPreferredPackageManager,\r\n getSystemPackageManagers,\r\n setPackageManager,\r\n} from \"../../helpers/package-manager\";\r\nimport { packageRoot } from \"../../helpers/paths\";\r\nimport { showIntroBanner } from \"../../ui/banner\";\r\nimport { createWarlockApp } from \"../create-warlock-app\";\r\nimport getAppPath from \"./get-app-path\";\r\nimport { App as AppType, CliFlags } from \"./types\";\r\n\r\nexport default async function createNewApp(cli: CliFlags = {}) {\r\n // Start detecting package managers in the background to avoid delay later\r\n const pmDetectionPromise = detectPackageManagers();\r\n\r\n // Get version from package.json\r\n const packageJson: any = getJsonFile(packageRoot(\"package.json\"));\r\n const createWarlockVersion = packageJson.version;\r\n\r\n // Show the intro banner\r\n showIntroBanner(createWarlockVersion);\r\n\r\n console.log(colors.cyan(\"Let's create something magical! \\n\"));\r\n\r\n // Validate Node.js version (minimum v20)\r\n const [major] = process.versions.node.split(\".\").map(Number);\r\n if (major < 20) {\r\n cancel(\"Node.js version must be at least 20.0.0\");\r\n process.exit(0);\r\n }\r\n\r\n // Non-interactive path: build everything from flags and skip the prompts.\r\n if (cli.yes) {\r\n await createNonInteractive(cli);\r\n return;\r\n }\r\n\r\n // Step 1: Project name\r\n const appName = await text({\r\n message: \"What shall we call your project?\",\r\n placeholder: \"my-warlock-app\",\r\n });\r\n\r\n if (isCancel(appName) || !appName.trim()) {\r\n cancel(\"A project name is required to continue\");\r\n process.exit(0);\r\n }\r\n\r\n const appPath = getAppPath(appName);\r\n if (!appPath) return;\r\n\r\n // Step 2: Package Manager selection\r\n await pmDetectionPromise; // Ensure detection is complete\r\n\r\n const packageManager = await select({\r\n message: \"Which package manager do you want to use?\",\r\n options: getSystemPackageManagers().map(pm => ({\r\n value: pm,\r\n label: pm,\r\n })),\r\n initialValue: getPreferredPackageManager(),\r\n });\r\n\r\n if (isCancel(packageManager)) {\r\n cancel(\"Package manager selection cancelled\");\r\n process.exit(0);\r\n }\r\n\r\n setPackageManager(packageManager as string);\r\n\r\n // Step 3: Database driver selection\r\n const databaseDriver = await select({\r\n message: \"Choose your database driver\",\r\n options: getDatabaseDriverOptions(),\r\n });\r\n\r\n if (isCancel(databaseDriver)) {\r\n cancel(\"Database selection cancelled\");\r\n process.exit(0);\r\n }\r\n\r\n const selectedDriver = getDatabaseDriver(databaseDriver as string);\r\n\r\n // Step 4: Features selection\r\n const selectedFeatures = await multiselect({\r\n message: \"Select optional features to include\",\r\n options: getFeatureOptions(),\r\n initialValues: getDefaultFeatureKeys(),\r\n required: false,\r\n });\r\n\r\n if (isCancel(selectedFeatures)) {\r\n cancel(\"Feature selection cancelled\");\r\n process.exit(0);\r\n }\r\n\r\n // Step 4b: AI providers + capability packages — selecting any pulls\r\n // @warlock.js/ai automatically. The result still flows through the\r\n // `selectedAiProviders` → `aiProviders` pipeline, which now also carries the\r\n // capability packages (ai-tools / ai-panoptic / ai-workspace).\r\n const selectedAiProviders = await multiselect({\r\n message:\r\n \"Add AI packages? Providers + capabilities — the core AI package is included automatically\",\r\n options: [...getAiProviderOptions(), ...getAiPackageOptions()],\r\n required: false,\r\n });\r\n\r\n if (isCancel(selectedAiProviders)) {\r\n cancel(\"AI provider selection cancelled\");\r\n process.exit(0);\r\n }\r\n\r\n // Step 5: Git initialization\r\n const useGit =\r\n (await confirm({\r\n message: \"Initialize a Git repository?\",\r\n })) === true;\r\n\r\n if (isCancel(useGit)) {\r\n cancel(\"Setup cancelled\");\r\n process.exit(0);\r\n }\r\n\r\n // Step 6: JWT secret generation\r\n const useJWT =\r\n (await confirm({\r\n message: \"Generate JWT secret keys?\",\r\n })) === true;\r\n\r\n if (isCancel(useJWT)) {\r\n cancel(\"Setup cancelled\");\r\n process.exit(0);\r\n }\r\n\r\n // Build app details\r\n const appDetails: Required<AppType> = {\r\n appName: appName,\r\n appType: \"warlock\",\r\n appPath: appPath,\r\n pkgManager: getPackageManager(),\r\n options: {\r\n databaseDriver: databaseDriver as string,\r\n databasePort: selectedDriver?.defaultPort || 27017,\r\n features: selectedFeatures as string[],\r\n aiProviders: selectedAiProviders as string[],\r\n useGit,\r\n useJWT,\r\n },\r\n };\r\n\r\n // Create the app\r\n await createWarlockApp(new App(appDetails));\r\n}\r\n\r\n/**\r\n * Non-interactive scaffold path for`--yes`. Builds the app from flags with\r\n * sensible defaults and skips every prompt. Validates the database driver and\r\n * feature/provider keys up front so a typo fails fast instead of mid-install.\r\n */\r\nasync function createNonInteractive(cli: CliFlags) {\r\n const appName = (cli.name ?? \"\").trim();\r\n\r\n if (!appName) {\r\n cancel(\"--yes requires a project name (first argument or --name=<name>)\");\r\n process.exit(1);\r\n }\r\n\r\n const appPath = getAppPath(appName);\r\n\r\n if (!appPath) return;\r\n\r\n await detectPackageManagers();\r\n\r\n const packageManager = cli.pm ?? getPreferredPackageManager();\r\n setPackageManager(packageManager);\r\n\r\n const databaseDriver = cli.db ?? \"mongodb\";\r\n const driver = getDatabaseDriver(databaseDriver);\r\n\r\n if (!driver) {\r\n cancel(`Unknown database driver \"${databaseDriver}\"`);\r\n process.exit(1);\r\n }\r\n\r\n const features = cli.features ?? [];\r\n const aiProviders = cli.ai ?? [];\r\n\r\n const allowedKeys = getAllFeatureKeys();\r\n const invalidKeys = [...features, ...aiProviders].filter(\r\n key => !allowedKeys.includes(key),\r\n );\r\n\r\n if (invalidKeys.length > 0) {\r\n cancel(`Unknown feature(s): ${invalidKeys.join(\",\")}`);\r\n process.exit(1);\r\n }\r\n\r\n const appDetails: Required<AppType> = {\r\n appName,\r\n appType: \"warlock\",\r\n appPath,\r\n pkgManager: getPackageManager(),\r\n options: {\r\n databaseDriver,\r\n databasePort: driver.defaultPort,\r\n features,\r\n aiProviders,\r\n useGit: cli.git ?? false,\r\n useJWT: cli.jwt ?? false,\r\n },\r\n };\r\n\r\n await createWarlockApp(new App(appDetails));\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAmCA,eAA8B,aAAa,MAAgB,CAAC,GAAG;CAE7D,MAAM,qBAAqB,sBAAsB;CAIjD,MAAM,uBADmB,YAAY,YAAY,cAAc,CACxB,CAAC,CAAC;CAGzC,gBAAgB,oBAAoB;CAEpC,QAAQ,IAAI,OAAO,KA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EAC1B,OAAO,uBAAuB,YAAY,KAAK,GAAG,GAAG;EACrD,QAAQ,KAAK,CAAC;CAChB;CAiBA,MAAM,iBAAiB,IAAI,IAAI;EAd7B;EACA,SAAS;EACT;EACA,YAAY,kBAAkB;EAC9B,SAAS;GACP;GACA,cAAc,OAAO;GACrB;GACA;GACA,QAAQ,IAAI,OAAO;GACnB,QAAQ,IAAI,OAAO;EACrB;CAGsC,CAAC,CAAC;AAC5C"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region ../@warlock.js/create-warlock/src/features/features-map.ts
|
|
2
2
|
/**
|
|
3
3
|
* Optional features offered in the general multiselect step. The database
|
|
4
|
-
* driver (its own select) and AI providers (their own
|
|
5
|
-
* NOT here — they have dedicated prompts.
|
|
4
|
+
* driver (its own select) and AI providers + capability packages (their own
|
|
5
|
+
* step) are intentionally NOT here — they have dedicated prompts.
|
|
6
6
|
*/
|
|
7
7
|
const features = [
|
|
8
8
|
{
|
|
@@ -89,35 +89,61 @@ const features = [
|
|
|
89
89
|
* AI providers offered in the dedicated AI step. Selecting any of these pulls
|
|
90
90
|
* the core `@warlock.js/ai` package automatically via the provider's `requires`
|
|
91
91
|
* in core's feature map — the scaffolder never lists `ai` as a standalone pick.
|
|
92
|
+
*
|
|
93
|
+
* Keys are `ai-`prefixed to mirror core's renamed provider feature keys
|
|
94
|
+
* (`ai-openai` → `@warlock.js/ai-openai`, etc.).
|
|
92
95
|
*/
|
|
93
96
|
const aiProviders = [
|
|
94
97
|
{
|
|
95
|
-
key: "openai",
|
|
98
|
+
key: "ai-openai",
|
|
96
99
|
label: "OpenAI",
|
|
97
100
|
hint: "GPT models via the OpenAI API"
|
|
98
101
|
},
|
|
99
102
|
{
|
|
100
|
-
key: "google",
|
|
103
|
+
key: "ai-google",
|
|
101
104
|
label: "Google (Gemini)",
|
|
102
105
|
hint: "Gemini models via Google AI"
|
|
103
106
|
},
|
|
104
107
|
{
|
|
105
|
-
key: "anthropic",
|
|
108
|
+
key: "ai-anthropic",
|
|
106
109
|
label: "Anthropic (Claude)",
|
|
107
110
|
hint: "Claude models via the Anthropic API"
|
|
108
111
|
},
|
|
109
112
|
{
|
|
110
|
-
key: "bedrock",
|
|
113
|
+
key: "ai-bedrock",
|
|
111
114
|
label: "AWS Bedrock",
|
|
112
115
|
hint: "Foundation models via Amazon Bedrock"
|
|
113
116
|
},
|
|
114
117
|
{
|
|
115
|
-
key: "ollama",
|
|
118
|
+
key: "ai-ollama",
|
|
116
119
|
label: "Ollama",
|
|
117
120
|
hint: "Local models via Ollama"
|
|
118
121
|
}
|
|
119
122
|
];
|
|
120
123
|
/**
|
|
124
|
+
* AI capability packages offered alongside the providers in the dedicated AI
|
|
125
|
+
* step. These are the satellite packages that sit on top of the core
|
|
126
|
+
* `@warlock.js/ai` toolkit (each pulls the core `ai` package via its `requires`
|
|
127
|
+
* in core's feature map, same as the providers).
|
|
128
|
+
*/
|
|
129
|
+
const aiPackages = [
|
|
130
|
+
{
|
|
131
|
+
key: "ai-tools",
|
|
132
|
+
label: "AI Tools",
|
|
133
|
+
hint: "Ready-made agent tools (web search, fetch, HTTP, calculator, date-time) + MCP client/server"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
key: "ai-panoptic",
|
|
137
|
+
label: "AI Observability (Panoptic)",
|
|
138
|
+
hint: "Tracing + exporters + a zero-setup local dashboard"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
key: "ai-workspace",
|
|
142
|
+
label: "AI Workspace",
|
|
143
|
+
hint: "Policy-jailed filesystem + shell for coding agents"
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
/**
|
|
121
147
|
* Feature options for the multiselect prompt, ordered by group with the group
|
|
122
148
|
* surfaced in the hint (keeps a flat list scannable without group widgets).
|
|
123
149
|
*/
|
|
@@ -145,13 +171,29 @@ function getAiProviderOptions() {
|
|
|
145
171
|
}));
|
|
146
172
|
}
|
|
147
173
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
174
|
+
* AI capability package options for the dedicated AI multiselect step. Offered
|
|
175
|
+
* together with the providers (see `getAiProviderOptions`).
|
|
176
|
+
*/
|
|
177
|
+
function getAiPackageOptions() {
|
|
178
|
+
return aiPackages.map((pkg) => ({
|
|
179
|
+
value: pkg.key,
|
|
180
|
+
label: pkg.label,
|
|
181
|
+
hint: pkg.hint
|
|
182
|
+
}));
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Every selectable key the scaffolder knows about (features + AI providers +
|
|
186
|
+
* AI capability packages). Used to validate `--features` / `--ai` flags in
|
|
187
|
+
* non-interactive mode.
|
|
150
188
|
*/
|
|
151
189
|
function getAllFeatureKeys() {
|
|
152
|
-
return [
|
|
190
|
+
return [
|
|
191
|
+
...features.map((feature) => feature.key),
|
|
192
|
+
...aiProviders.map((provider) => provider.key),
|
|
193
|
+
...aiPackages.map((pkg) => pkg.key)
|
|
194
|
+
];
|
|
153
195
|
}
|
|
154
196
|
|
|
155
197
|
//#endregion
|
|
156
|
-
export { getAiProviderOptions, getAllFeatureKeys, getDefaultFeatureKeys, getFeatureOptions };
|
|
198
|
+
export { getAiPackageOptions, getAiProviderOptions, getAllFeatureKeys, getDefaultFeatureKeys, getFeatureOptions };
|
|
157
199
|
//# sourceMappingURL=features-map.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features-map.mjs","names":[],"sources":["../../../../../../@warlock.js/create-warlock/src/features/features-map.ts"],"sourcesContent":["/**\r\n * Presentation manifest for the scaffolder's feature prompts.\r\n *\r\n * This file is **display metadata only** — keys, labels, hints, grouping, and\r\n * default selections. It deliberately holds NO dependency names or versions:\r\n * the single source of truth for what each feature installs is the `add`\r\n * command's feature map in `@warlock.js/core`\r\n * (`src/generations/add-command.action.ts`). The scaffolder collects the\r\n * selections here and delegates the actual install to `warlock add`, so the\r\n * two never drift on versions again.\r\n *\r\n * Every `key` below MUST exist in core's `allowedFeatures`; a CI guard should\r\n * assert that subset relationship so a typo fails the build instead of shipping.\r\n */\r\n\r\nexport type FeatureGroup =\r\n | \"Auth & Access\"\r\n | \"Rendering & Mail\"\r\n | \"Media\"\r\n | \"Storage & Cache\"\r\n | \"Jobs & Messaging\"\r\n | \"Realtime\"\r\n | \"API Docs\"\r\n | \"Tooling\";\r\n\r\nexport type FeatureOption = {\r\n /** Must match a key in core's `add` feature map. */\r\n key: string;\r\n label: string;\r\n hint: string;\r\n group: FeatureGroup;\r\n defaultSelected?: boolean;\r\n};\r\n\r\n/**\r\n * Optional features offered in the general multiselect step. The database\r\n * driver (its own select) and AI providers (their own step) are intentionally
|
|
1
|
+
{"version":3,"file":"features-map.mjs","names":[],"sources":["../../../../../../@warlock.js/create-warlock/src/features/features-map.ts"],"sourcesContent":["/**\r\n * Presentation manifest for the scaffolder's feature prompts.\r\n *\r\n * This file is **display metadata only** — keys, labels, hints, grouping, and\r\n * default selections. It deliberately holds NO dependency names or versions:\r\n * the single source of truth for what each feature installs is the `add`\r\n * command's feature map in `@warlock.js/core`\r\n * (`src/generations/add-command.action.ts`). The scaffolder collects the\r\n * selections here and delegates the actual install to `warlock add`, so the\r\n * two never drift on versions again.\r\n *\r\n * Every `key` below MUST exist in core's `allowedFeatures`; a CI guard should\r\n * assert that subset relationship so a typo fails the build instead of shipping.\r\n */\r\n\r\nexport type FeatureGroup =\r\n | \"Auth & Access\"\r\n | \"Rendering & Mail\"\r\n | \"Media\"\r\n | \"Storage & Cache\"\r\n | \"Jobs & Messaging\"\r\n | \"Realtime\"\r\n | \"API Docs\"\r\n | \"Tooling\";\r\n\r\nexport type FeatureOption = {\r\n /** Must match a key in core's `add` feature map. */\r\n key: string;\r\n label: string;\r\n hint: string;\r\n group: FeatureGroup;\r\n defaultSelected?: boolean;\r\n};\r\n\r\n/**\r\n * Optional features offered in the general multiselect step. The database\r\n * driver (its own select) and AI providers + capability packages (their own\r\n * step) are intentionally NOT here — they have dedicated prompts.\r\n */\r\nexport const features: FeatureOption[] = [\r\n // Auth & Access\r\n {\r\n key: \"access\",\r\n label: \"Access (authorization)\",\r\n hint: \"RBAC permission checks, ABAC policies, and roles — pairs with auth\",\r\n group: \"Auth & Access\",\r\n },\r\n\r\n // Rendering & Mail\r\n {\r\n key: \"react\",\r\n label: \"React (rendering & mails)\",\r\n hint: \"React + ReactDOM for non-interactive rendering and HTML/email generation\",\r\n group: \"Rendering & Mail\",\r\n defaultSelected: true,\r\n },\r\n {\r\n key: \"react-email\",\r\n label: \"React Email\",\r\n hint: \"Build email templates with React + Tailwind (pulls react + mail)\",\r\n group: \"Rendering & Mail\",\r\n },\r\n {\r\n key: \"mail\",\r\n label: \"Mail (Nodemailer)\",\r\n hint: \"Send emails via SMTP\",\r\n group: \"Rendering & Mail\",\r\n },\r\n {\r\n key: \"ses\",\r\n label: \"Amazon SES\",\r\n hint: \"Send emails via the AWS SES API\",\r\n group: \"Rendering & Mail\",\r\n },\r\n\r\n // Media\r\n {\r\n key: \"image\",\r\n label: \"Image processing (Sharp)\",\r\n hint: \"Resize, convert, and optimize images\",\r\n group: \"Media\",\r\n },\r\n\r\n // Storage & Cache\r\n {\r\n key: \"s3\",\r\n label: \"S3 storage\",\r\n hint: \"AWS S3 for cloud file storage\",\r\n group: \"Storage & Cache\",\r\n },\r\n {\r\n key: \"redis\",\r\n label: \"Redis cache\",\r\n hint: \"Redis driver for the cache layer\",\r\n group: \"Storage & Cache\",\r\n },\r\n\r\n // Jobs & Messaging\r\n {\r\n key: \"scheduler\",\r\n label: \"Scheduler\",\r\n hint: \"Background tasks and cron jobs\",\r\n group: \"Jobs & Messaging\",\r\n },\r\n {\r\n key: \"herald\",\r\n label: \"Herald (RabbitMQ)\",\r\n hint: \"Message broker for event-driven architecture\",\r\n group: \"Jobs & Messaging\",\r\n },\r\n {\r\n key: \"notifications\",\r\n label: \"Notifications\",\r\n hint: \"Multi-channel notifications — mail + in-app database, preferences, idempotency\",\r\n group: \"Jobs & Messaging\",\r\n },\r\n\r\n // Realtime\r\n {\r\n key: \"socket\",\r\n label: \"Socket.IO\",\r\n hint: \"Realtime websocket server\",\r\n group: \"Realtime\",\r\n },\r\n\r\n // API Docs (swagger / postman / openapi) — not shipped yet; they will arrive\r\n // together in the unified @warlock.js/api-docs package. Re-add the selection\r\n // once that package exists. (Removed so the wizard can't offer unbuilt features.)\r\n\r\n // Tooling\r\n {\r\n key: \"test\",\r\n label: \"Testing (Vitest)\",\r\n hint: \"Vitest + coverage + per-worker DB/cache test setup\",\r\n group: \"Tooling\",\r\n },\r\n];\r\n\r\nexport type AiProviderOption = {\r\n /** Must match a provider/package key in core's `add` feature map. */\r\n key: string;\r\n label: string;\r\n hint: string;\r\n};\r\n\r\n/**\r\n * AI providers offered in the dedicated AI step. Selecting any of these pulls\r\n * the core `@warlock.js/ai` package automatically via the provider's `requires`\r\n * in core's feature map — the scaffolder never lists `ai` as a standalone pick.\r\n *\r\n * Keys are `ai-`prefixed to mirror core's renamed provider feature keys\r\n * (`ai-openai` → `@warlock.js/ai-openai`, etc.).\r\n */\r\nexport const aiProviders: AiProviderOption[] = [\r\n { key: \"ai-openai\", label: \"OpenAI\", hint: \"GPT models via the OpenAI API\" },\r\n { key: \"ai-google\", label: \"Google (Gemini)\", hint: \"Gemini models via Google AI\" },\r\n { key: \"ai-anthropic\", label: \"Anthropic (Claude)\", hint: \"Claude models via the Anthropic API\" },\r\n { key: \"ai-bedrock\", label: \"AWS Bedrock\", hint: \"Foundation models via Amazon Bedrock\" },\r\n { key: \"ai-ollama\", label: \"Ollama\", hint: \"Local models via Ollama\" },\r\n];\r\n\r\n/**\r\n * AI capability packages offered alongside the providers in the dedicated AI\r\n * step. These are the satellite packages that sit on top of the core\r\n * `@warlock.js/ai` toolkit (each pulls the core `ai` package via its `requires`\r\n * in core's feature map, same as the providers).\r\n */\r\nexport const aiPackages: AiProviderOption[] = [\r\n {\r\n key: \"ai-tools\",\r\n label: \"AI Tools\",\r\n hint: \"Ready-made agent tools (web search, fetch, HTTP, calculator, date-time) + MCP client/server\",\r\n },\r\n {\r\n key: \"ai-panoptic\",\r\n label: \"AI Observability (Panoptic)\",\r\n hint: \"Tracing + exporters + a zero-setup local dashboard\",\r\n },\r\n {\r\n key: \"ai-workspace\",\r\n label: \"AI Workspace\",\r\n hint: \"Policy-jailed filesystem + shell for coding agents\",\r\n },\r\n];\r\n\r\n/**\r\n * Feature options for the multiselect prompt, ordered by group with the group\r\n * surfaced in the hint (keeps a flat list scannable without group widgets).\r\n */\r\nexport function getFeatureOptions() {\r\n return features.map(feature => ({\r\n value: feature.key,\r\n label: feature.label,\r\n hint: `${feature.group} — ${feature.hint}`,\r\n }));\r\n}\r\n\r\n/**\r\n * Keys pre-checked in the feature multiselect.\r\n */\r\nexport function getDefaultFeatureKeys(): string[] {\r\n return features.filter(feature => feature.defaultSelected).map(feature => feature.key);\r\n}\r\n\r\n/**\r\n * AI provider options for the dedicated AI multiselect step.\r\n */\r\nexport function getAiProviderOptions() {\r\n return aiProviders.map(provider => ({\r\n value: provider.key,\r\n label: provider.label,\r\n hint: provider.hint,\r\n }));\r\n}\r\n\r\n/**\r\n * AI capability package options for the dedicated AI multiselect step. Offered\r\n * together with the providers (see `getAiProviderOptions`).\r\n */\r\nexport function getAiPackageOptions() {\r\n return aiPackages.map(pkg => ({\r\n value: pkg.key,\r\n label: pkg.label,\r\n hint: pkg.hint,\r\n }));\r\n}\r\n\r\n/**\r\n * Every selectable key the scaffolder knows about (features + AI providers +\r\n * AI capability packages). Used to validate `--features` / `--ai` flags in\r\n * non-interactive mode.\r\n */\r\nexport function getAllFeatureKeys(): string[] {\r\n return [\r\n ...features.map(feature => feature.key),\r\n ...aiProviders.map(provider => provider.key),\r\n ...aiPackages.map(pkg => pkg.key),\r\n ];\r\n}\r\n"],"mappings":";;;;;;AAuCA,MAAa,WAA4B;CAEvC;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;CACT;CAGA;EACE,KAAK;EACL,OAAO;EACP,MAAM;EACN,OAAO;EACP,iBAAiB;CACnB;CACA;EAC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S,QAAO,YAAW,QAAQ,eAAe,CAAC,CAAC,KAAI,YAAW,QAAQ,GAAG;AACvF;;;;AAKA,SAAgB,uBAAuB;CACrC,OAAO,YAAY,KAAI,cAAa;EAClC,OAAO,SAAS;EAChB,OAAO,SAAS;EAChB,MAAM,SAAS;CACjB,EAAE;AACJ;;;;;AAMA,SAAgB,sBAAsB;CACpC,OAAO,WAAW,KAAI,SAAQ;EAC5B,OAAO,IAAI;EACX,OAAO,IAAI;EACX,MAAM,IAAI;CACZ,EAAE;AACJ;;;;;;AAOA,SAAgB,oBAA8B;CAC5C,OAAO;EACL,GAAG,SAAS,KAAI,YAAW,QAAQ,GAAG;EACtC,GAAG,YAAY,KAAI,aAAY,SAAS,GAAG;EAC3C,GAAG,WAAW,KAAI,QAAO,IAAI,GAAG;CAClC;AACF"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@clack/prompts": "^0.7.0",
|
|
11
11
|
"@mongez/copper": "^2.1.2",
|
|
12
|
-
"@warlock.js/fs": "4.
|
|
12
|
+
"@warlock.js/fs": "4.5.0",
|
|
13
13
|
"@mongez/reinforcements": "^3.3.0",
|
|
14
14
|
"cross-spawn": "^7.0.3",
|
|
15
15
|
"rimraf": "^6.0.1",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"bin": {
|
|
19
19
|
"create-warlock": "bin/create-app.js"
|
|
20
20
|
},
|
|
21
|
-
"version": "4.
|
|
21
|
+
"version": "4.5.0",
|
|
22
22
|
"type": "module",
|
|
23
23
|
"main": "./esm/index.mjs",
|
|
24
24
|
"module": "./esm/index.mjs",
|