@warlock.js/core 5.24.0 → 5.25.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 +30 -1
- package/bin/warlock.js +0 -0
- package/esm/application/application.d.mts +21 -0
- package/esm/application/application.d.mts.map +1 -1
- package/esm/application/application.mjs +29 -1
- package/esm/application/application.mjs.map +1 -1
- package/esm/application/boot-signal.d.mts +2 -1
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/boot-signal.mjs.map +1 -1
- package/esm/application/index.d.mts +1 -0
- package/esm/application/index.mjs +1 -0
- package/esm/application/roles.d.mts +72 -0
- package/esm/application/roles.d.mts.map +1 -0
- package/esm/application/roles.mjs +124 -0
- package/esm/application/roles.mjs.map +1 -0
- package/esm/cli/commands/add.command.mjs.map +1 -1
- package/esm/cli/commands/create-database.command.mjs.map +1 -1
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs.map +1 -1
- package/esm/cli/commands/drop-tables.command.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs.map +1 -1
- package/esm/cli/commands/migrate.command.mjs.map +1 -1
- package/esm/cli/commands/routes.command.mjs.map +1 -1
- package/esm/cli/commands/seed.command.mjs.map +1 -1
- package/esm/cli/commands/start-production.command.mjs +54 -5
- package/esm/cli/commands/start-production.command.mjs.map +1 -1
- package/esm/cli/commands/storage-put.action.mjs.map +1 -1
- package/esm/cli/commands/storage-put.command.mjs.map +1 -1
- package/esm/cli/commands/typings-generator.command.mjs +17 -1
- package/esm/cli/commands/typings-generator.command.mjs.map +1 -1
- package/esm/cli/commands/update.command.mjs.map +1 -1
- package/esm/cli/commands-loader.mjs.map +1 -1
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +3 -1
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +7 -0
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +8 -0
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/connectors/types.mjs.map +1 -1
- package/esm/database/create-database-action.mjs.map +1 -1
- package/esm/database/drop-tables-action.mjs.map +1 -1
- package/esm/database/migrate-action.mjs +2 -1
- package/esm/database/migrate-action.mjs.map +1 -1
- package/esm/database/models/database-log/database-log.mjs.map +1 -1
- package/esm/database/seed-command-action.mjs +2 -1
- package/esm/database/seed-command-action.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.mjs.map +1 -1
- package/esm/dev-server/development-server.mjs +2 -0
- package/esm/dev-server/development-server.mjs.map +1 -1
- package/esm/dev-server/files-orchestrator.mjs.map +1 -1
- package/esm/dev-server/layer-executor.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +10 -5
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/register-installed-devtools.mjs +47 -0
- package/esm/dev-server/register-installed-devtools.mjs.map +1 -0
- package/esm/dev-server/run-connector-typings.mjs +28 -0
- package/esm/dev-server/run-connector-typings.mjs.map +1 -0
- package/esm/dev-server/special-file-patterns.mjs +3 -1
- package/esm/dev-server/special-file-patterns.mjs.map +1 -1
- package/esm/dev-server/special-files-collector.d.mts +2 -2
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/special-files-collector.mjs +7 -4
- package/esm/dev-server/special-files-collector.mjs.map +1 -1
- package/esm/encryption/password.mjs.map +1 -1
- package/esm/generations/add-command.action.mjs +3 -1
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/access.feature.mjs.map +1 -1
- package/esm/generations/features/ai-anthropic.feature.mjs.map +1 -1
- package/esm/generations/features/ai-bedrock.feature.mjs.map +1 -1
- package/esm/generations/features/ai-google.feature.mjs.map +1 -1
- package/esm/generations/features/ai-ollama.feature.mjs.map +1 -1
- package/esm/generations/features/ai-openai.feature.mjs.map +1 -1
- package/esm/generations/features/ai-panoptic.feature.mjs.map +1 -1
- package/esm/generations/features/ai-tools.feature.mjs.map +1 -1
- package/esm/generations/features/ai-workspace.feature.mjs.map +1 -1
- package/esm/generations/features/ai.feature.mjs.map +1 -1
- package/esm/generations/features/devtools.feature.mjs +23 -0
- package/esm/generations/features/devtools.feature.mjs.map +1 -0
- package/esm/generations/features/herald.feature.mjs.map +1 -1
- package/esm/generations/features/image.feature.mjs.map +1 -1
- package/esm/generations/features/index.mjs +2 -0
- package/esm/generations/features/index.mjs.map +1 -1
- package/esm/generations/features/mail.feature.mjs.map +1 -1
- package/esm/generations/features/mongodb.feature.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/postgres.feature.mjs.map +1 -1
- package/esm/generations/features/react-email.feature.mjs.map +1 -1
- package/esm/generations/features/react.feature.mjs.map +1 -1
- package/esm/generations/features/redis.feature.mjs.map +1 -1
- package/esm/generations/features/s3.feature.mjs.map +1 -1
- package/esm/generations/features/scheduler.feature.mjs.map +1 -1
- package/esm/generations/features/ses.feature.mjs.map +1 -1
- package/esm/generations/features/socket.feature.mjs.map +1 -1
- package/esm/generations/features/test.feature.mjs +6 -2
- package/esm/generations/features/test.feature.mjs.map +1 -1
- package/esm/generations/features/types.mjs.map +1 -1
- package/esm/generations/features/web.feature.mjs.map +1 -1
- package/esm/http/database/RequestLog.mjs.map +1 -1
- package/esm/http/index.d.mts +2 -1
- package/esm/http/index.mjs +2 -1
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +9 -1
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/response.d.mts +5 -5
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/server-rebuilt.d.mts +20 -0
- package/esm/http/server-rebuilt.d.mts.map +1 -0
- package/esm/http/server-rebuilt.mjs +21 -0
- package/esm/http/server-rebuilt.mjs.map +1 -0
- package/esm/http/tracing/index.mjs +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts +13 -6
- package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs +46 -14
- package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
- package/esm/http/tracing/tracing.type.d.mts +2 -1
- package/esm/http/tracing/tracing.type.d.mts.map +1 -1
- package/esm/http/types.d.mts +9 -0
- package/esm/http/types.d.mts.map +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/index.d.mts +4 -2
- package/esm/index.mjs +4 -2
- package/esm/loader/app-module-importer.d.mts +17 -0
- package/esm/loader/app-module-importer.d.mts.map +1 -0
- package/esm/loader/app-module-importer.mjs +20 -0
- package/esm/loader/app-module-importer.mjs.map +1 -0
- package/esm/logger/logger.mjs.map +1 -1
- package/esm/mail/events.d.mts +7 -0
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/events.mjs +7 -0
- package/esm/mail/events.mjs.map +1 -1
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +23 -2
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/types.d.mts +5 -1
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/mail/types.mjs.map +1 -1
- package/esm/manifest/manifest-manager.mjs.map +1 -1
- package/esm/production/build-contributions.mjs +19 -3
- package/esm/production/build-contributions.mjs.map +1 -1
- package/esm/production/production-builder.mjs +28 -8
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/production-supervisor.mjs +6 -0
- package/esm/production/production-supervisor.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +1 -1
- package/esm/production/resolve-build-config.mjs +15 -0
- package/esm/production/resolve-build-config.mjs.map +1 -1
- package/esm/production/route-registration-child.mjs +14 -2
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/route-registration-snapshot.mjs +9 -2
- package/esm/production/route-registration-snapshot.mjs.map +1 -1
- package/esm/resource/resource-field-builder.mjs +1 -1
- package/esm/resource/resource-field-builder.mjs.map +1 -1
- package/esm/resource/resource.d.mts +5 -0
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +17 -6
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +1 -0
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +2 -1
- package/esm/router/types.d.mts.map +1 -1
- package/esm/tests/index.d.mts +3 -2
- package/esm/tests/index.mjs +3 -2
- package/esm/tests/vitest-setup.d.mts +16 -1
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs +20 -2
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/use-cases/use-case-events.mjs.map +1 -1
- package/esm/utils/is-test-file.mjs +15 -0
- package/esm/utils/is-test-file.mjs.map +1 -0
- package/esm/utils/normalized-path.d.mts +3 -1
- package/esm/utils/normalized-path.d.mts.map +1 -1
- package/esm/utils/normalized-path.mjs +4 -2
- package/esm/utils/normalized-path.mjs.map +1 -1
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/validation/plugins/database-plugin.mjs.map +1 -1
- package/esm/validation/validateAll.mjs +9 -3
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/warlock-config/default-configurations.mjs +1 -0
- package/esm/warlock-config/default-configurations.mjs.map +1 -1
- package/esm/warlock-config/types.d.mts +7 -0
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
- package/llms-full.txt +264 -139
- package/package.json +15 -11
- package/skills/configure-app/SKILL.md +2 -0
- package/skills/define-resource/SKILL.md +4 -0
- package/skills/request-tracing/SKILL.md +38 -15
- package/skills/run-app/SKILL.md +71 -34
- package/skills/send-mail/SKILL.md +55 -25
- package/skills/test-http/SKILL.md +19 -8
- package/skills/test-service/SKILL.md +61 -40
- package/skills/warlock-conventions/SKILL.md +26 -18
- package/skills/write-cli-command/SKILL.md +50 -45
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password.mjs","names":[],"sources":["../../../../../../../core/src/encryption/password.ts"],"sourcesContent":["import { config } from \"../config\";\
|
|
1
|
+
{"version":3,"file":"password.mjs","names":[],"sources":["../../../../../../../core/src/encryption/password.ts"],"sourcesContent":["import { config } from \"../config\";\nimport { type EncryptionPasswordConfigurations } from \"./types\";\n\n/**\n * Default bcrypt salt rounds.\n */\nconst DEFAULT_SALT_ROUNDS = 12;\n\n// ============================================================\n// Lazy-loaded bcryptjs SDK Types\n// ============================================================\n\n/**\n * Cached bcryptjs module (loaded once, reused)\n */\nlet Bcryptjs: typeof import(\"bcryptjs\");\n\nlet isModuleExists: boolean | null = null;\n\n/**\n * Installation instructions for bcryptjs package\n */\nconst BCRYPTJS_INSTALL_INSTRUCTIONS = `\nPassword encryption requires the bcryptjs package.\nInstall it with:\n\n yarn add bcryptjs\n\nOr with your preferred package manager:\n\n npm install bcryptjs\n pnpm add bcryptjs\n yarn add bcryptjs\n`.trim();\n\n/**\n * Load bcryptjs module\n */\nasync function loadBcryptjs() {\n try {\n Bcryptjs = await import(\"bcryptjs\");\n isModuleExists = true;\n } catch {\n isModuleExists = false;\n }\n}\n\nconst bcryptjsLoading = loadBcryptjs();\n\n/**\n * Hashes a password using bcrypt (async — does not block the event loop).\n *\n * Salt rounds are read from \\`encryption.password.saltRounds\\` config,\n * defaulting to 12.\n *\n * @example\n * import { hashPassword } from \"@warlock.js/core\";\n *\n * const hashed = await hashPassword(\"user-password-123\");\n * // Store \\`hashed\\` in the database\n */\nexport async function hashPassword(password: string): Promise<string> {\n await bcryptjsLoading;\n\n if (!isModuleExists) {\n throw new Error(BCRYPTJS_INSTALL_INSTRUCTIONS);\n }\n\n const saltRounds = config.key<EncryptionPasswordConfigurations[\"salt\"]>(\n \"encryption.password.salt\",\n DEFAULT_SALT_ROUNDS,\n )!;\n\n return Bcryptjs.hash(String(password), saltRounds);\n}\n\n/**\n * Verifies a plain password against a bcrypt hash (async — does not block the event loop).\n *\n * @example\n * import { verifyPassword } from \"@warlock.js/core\";\n *\n * const isValid = await verifyPassword(\"user-password-123\", storedHash);\n */\nexport async function verifyPassword(\n plainPassword: string,\n hashedPassword: string,\n): Promise<boolean> {\n await bcryptjsLoading;\n\n if (!isModuleExists) {\n throw new Error(BCRYPTJS_INSTALL_INSTRUCTIONS);\n }\n\n return Bcryptjs.compare(String(plainPassword), String(hashedPassword));\n}\n"],"mappings":";;;;;;;AAMA,MAAM,sBAAsB;;;;AAS5B,IAAI;AAEJ,IAAI,iBAAiC;;;;AAKrC,MAAM,gCAAgC;;;;;;;;;;;EAWpC,KAAK;;;;AAKP,eAAe,eAAe;CAC5B,IAAI;EACF,WAAW,MAAM,OAAO;EACxB,iBAAiB;CACnB,QAAQ;EACN,iBAAiB;CACnB;AACF;AAEA,MAAM,kBAAkB,aAAa;;;;;;;;;;;;;AAcrC,eAAsB,aAAa,UAAmC;CACpE,MAAM;CAEN,IAAI,CAAC,gBACH,MAAM,IAAI,MAAM,6BAA6B;CAG/C,MAAM,aAAa,OAAO,IACxB,4BACA,mBACF;CAEA,OAAO,SAAS,KAAK,OAAO,QAAQ,GAAG,UAAU;AACnD;;;;;;;;;AAUA,eAAsB,eACpB,eACA,gBACkB;CAClB,MAAM;CAEN,IAAI,CAAC,gBACH,MAAM,IAAI,MAAM,6BAA6B;CAG/C,OAAO,SAAS,QAAQ,OAAO,aAAa,GAAG,OAAO,cAAc,CAAC;AACvE"}
|
|
@@ -59,7 +59,9 @@ async function addCommandAction(options) {
|
|
|
59
59
|
if (featurePackages.ejectConfig) ejectConfigs[featurePackages.ejectConfig.name] = featurePackages.ejectConfig;
|
|
60
60
|
if (featurePackages.script) Object.assign(scripts, featurePackages.script);
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
const frameworkVersion = await getWarlockVersion();
|
|
63
|
+
resolveWarlockDependencyVersions(dependencies, frameworkVersion);
|
|
64
|
+
resolveWarlockDependencyVersions(devDependencies, frameworkVersion);
|
|
63
65
|
const currentPackageJson = await getJsonFileAsync(rootPath("package.json"));
|
|
64
66
|
currentPackageJson.dependencies = currentPackageJson.dependencies ?? {};
|
|
65
67
|
currentPackageJson.devDependencies = currentPackageJson.devDependencies ?? {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-command.action.mjs","names":[],"sources":["../../../../../../../core/src/generations/add-command.action.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport {\r\n fileExistsAsync,\r\n getFileAsync,\r\n getJsonFileAsync,\r\n putFileAsync,\r\n putJsonFileAsync,\r\n} from \"@warlock.js/fs\";\r\nimport { execSync } from \"node:child_process\";\r\nimport type { CommandActionData } from \"../commands/types\";\r\nimport {\r\n detectPackageManager,\r\n getAddCommand,\r\n getExactAddCommand,\r\n type PackageManager,\r\n} from \"../updater/package-manager\";\r\nimport { rootPath, srcPath } from \"../utils\";\r\nimport { getWarlockVersion } from \"../utils/framework-vesion\";\r\nimport { featuresMap } from \"./features\";\r\nimport { mergePnpmSharpApproval } from \"./pnpm-build-approvals\";\r\n\r\nexport { featuresMap };\r\nexport type { FeatureDefinition } from \"./features\";\r\n\r\n/**\r\n * The parts of a project `package.json` this action reads or writes. Deliberately\r\n * partial — it describes what we touch, not the whole manifest.\r\n */\r\ntype ProjectPackageJson = {\r\n dependencies?: Record<string, string>;\r\n devDependencies?: Record<string, string>;\r\n scripts?: Record<string, string>;\r\n};\r\n\r\nexport const allowedFeatures = Object.keys(featuresMap);\r\n\r\nfunction isWarlockPackage(packageName: string): boolean {\r\n return packageName.startsWith(\"@warlock.js/\");\r\n}\r\n\r\n/**\r\n * Resolve the internal feature-map placeholder to the version of Core that is\r\n * actually executing the command. Every @warlock.js package is lockstep, so\r\n * Core is the single source of truth; non-Warlock dependencies are untouched.\r\n */\r\nexport function resolveWarlockDependencyVersions(\r\n dependencies: Record<string, string>,\r\n frameworkVersion: string,\r\n): void {\r\n for (const dependency of Object.keys(dependencies)) {\r\n if (isWarlockPackage(dependency)) {\r\n dependencies[dependency] = frameworkVersion;\r\n }\r\n }\r\n}\r\n\r\nfunction resolveFeatures(features: string[], visited = new Set<string>()): string[] {\r\n const resolved: string[] = [];\r\n\r\n for (const feature of features) {\r\n if (visited.has(feature)) continue;\r\n visited.add(feature);\r\n\r\n const def = featuresMap[feature];\r\n\r\n // `addCommandAction` runs `validateFeatures()` before calling this, and the\r\n // recursive calls below pass `requires` entries that come out of the map\r\n // itself — so every lookup resolves. Skipping an unresolvable one keeps a\r\n // typo from crashing the command with `Cannot read properties of\r\n // undefined`, which names neither the feature nor the fact that it was the\r\n // ARGUMENT that was wrong.\r\n if (def === undefined) continue;\r\n\r\n if (def.requires?.length) {\r\n resolved.push(...resolveFeatures(def.requires, visited));\r\n }\r\n\r\n resolved.push(feature);\r\n }\r\n\r\n return resolved;\r\n}\r\n\r\nexport async function addCommandAction(options: CommandActionData) {\r\n const features = options.args;\r\n const { packageManager, list, noInstall } = options.options;\r\n\r\n if (list) {\r\n console.log(\"Available Features:\");\r\n\r\n for (const feature of allowedFeatures) {\r\n const definition = featuresMap[feature];\r\n\r\n // `allowedFeatures` is derived from this same map, so this resolves.\r\n if (definition === undefined) continue;\r\n\r\n console.log(`- ${colors.yellowBright(feature)}: ${colors.green(definition.description)}`);\r\n }\r\n\r\n process.exit(0);\r\n }\r\n\r\n validateFeatures(features);\r\n\r\n const resolvedFeatures = resolveFeatures(features);\r\n\r\n const dependencies: Record<string, string> = {};\r\n const devDependencies: Record<string, string> = {};\r\n const ejectConfigs: Record<string, { content: string; name: string }> = {};\r\n const scripts: Record<string, string> = {};\r\n\r\n for (const feature of resolvedFeatures) {\r\n const featurePackages = featuresMap[feature as keyof typeof featuresMap];\r\n\r\n // Validated upstream; see the note in resolveFeatures above.\r\n if (featurePackages === undefined) continue;\r\n\r\n Object.assign(dependencies, featurePackages.dependencies);\r\n if (featurePackages.devDependencies) {\r\n Object.assign(devDependencies, featurePackages.devDependencies);\r\n }\r\n\r\n if (featurePackages.ejectConfig) {\r\n ejectConfigs[featurePackages.ejectConfig.name] = featurePackages.ejectConfig;\r\n }\r\n\r\n if (featurePackages.script) {\r\n Object.assign(scripts, featurePackages.script);\r\n }\r\n }\r\n\r\n // Pin every @warlock.js/* feature package to the INSTALLED framework version so\r\n // a scaffolded project's features match its core version instead of drifting to\r\n // the feature map's static range.\r\n const frameworkVersion = await getWarlockVersion();\r\n resolveWarlockDependencyVersions(dependencies, frameworkVersion);\r\n\r\n const currentPackageJson = await getJsonFileAsync<ProjectPackageJson>(rootPath(\"package.json\"));\r\n\r\n // Fresh templates may omit one of the maps — guard before reading.\r\n currentPackageJson.dependencies = currentPackageJson.dependencies ?? {};\r\n currentPackageJson.devDependencies = currentPackageJson.devDependencies ?? {};\r\n\r\n // Skip anything already present so we never downgrade an existing pin.\r\n for (const dependency of Object.keys(dependencies)) {\r\n if (currentPackageJson.dependencies[dependency]) {\r\n console.log(`${colors.yellowBright(dependency)} is already installed, skipping...`);\r\n delete dependencies[dependency];\r\n }\r\n }\r\n\r\n for (const devDependency of Object.keys(devDependencies)) {\r\n if (currentPackageJson.devDependencies[devDependency]) {\r\n console.log(`${colors.yellowBright(devDependency)} is already installed, skipping...`);\r\n delete devDependencies[devDependency];\r\n }\r\n }\r\n\r\n if (noInstall) {\r\n await recordDependencies(dependencies, devDependencies);\r\n } else {\r\n const resolvedPackageManager =\r\n (packageManager as PackageManager | undefined) ?? (await detectPackageManager());\r\n if (resolvedPackageManager === \"pnpm\" && dependencies.sharp !== undefined) {\r\n const workspacePath = rootPath(\"pnpm-workspace.yaml\");\r\n const current = (await fileExistsAsync(workspacePath))\r\n ? await getFileAsync(workspacePath)\r\n : \"\";\r\n await putFileAsync(workspacePath, mergePnpmSharpApproval(current));\r\n }\r\n await installDependencies(\r\n packageManager as PackageManager | undefined,\r\n dependencies,\r\n devDependencies,\r\n );\r\n }\r\n\r\n for (const [name, config] of Object.entries(ejectConfigs)) {\r\n if (await fileExistsAsync(srcPath(`config/${name}.ts`))) {\r\n console.log(`${colors.yellowBright(name)} config already exists, skipping...`);\r\n continue;\r\n }\r\n\r\n console.log(`Creating ${colors.magenta(name)} config...`);\r\n\r\n await putFileAsync(srcPath(`config/${name}.ts`), config.content);\r\n\r\n console.log(`${colors.green(name)} config created successfully`);\r\n }\r\n\r\n // now loop again over features to execute onExecuting\r\n for (const feature of resolvedFeatures) {\r\n const featurePackages = featuresMap[feature as keyof typeof featuresMap];\r\n\r\n if (featurePackages?.onExecuting) {\r\n await featurePackages.onExecuting(options);\r\n }\r\n }\r\n\r\n if (Object.keys(scripts).length > 0) {\r\n console.log(`Adding scripts ${colors.magenta(Object.keys(scripts).join(\", \"))}`);\r\n const packageJsonPath = rootPath(\"package.json\");\r\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\r\n packageJson.scripts = { ...(packageJson.scripts ?? {}), ...scripts };\r\n await putJsonFileAsync(packageJsonPath, packageJson);\r\n\r\n console.log(`Scripts added successfully ${colors.green(Object.keys(scripts).join(\", \"))}`);\r\n }\r\n}\r\n\r\n/**\r\n * Install the resolved dependency sets through the project's package manager.\r\n * Runs two passes (prod then dev) so each lands in the correct section.\r\n */\r\nexport async function installDependencies(\r\n packageManager: PackageManager | undefined,\r\n dependencies: Record<string, string>,\r\n devDependencies: Record<string, string>,\r\n exec: (command: string, options: { cwd: string; stdio: \"inherit\" }) => unknown = execSync,\r\n) {\r\n // `--package-manager` is optional; without it, fall back to the lockfile.\r\n const resolvedPackageManager = packageManager ?? (await detectPackageManager());\r\n const packageManagerCommand = getAddCommand(resolvedPackageManager);\r\n const exactPackageManagerCommand = getExactAddCommand(resolvedPackageManager);\r\n\r\n const installDependencySet = (dependencySet: Record<string, string>, development: boolean) => {\r\n const regularSpecs: string[] = [];\r\n const exactWarlockSpecs: string[] = [];\r\n\r\n for (const [name, version] of Object.entries(dependencySet)) {\r\n const spec = `${name}@${version}`;\r\n (isWarlockPackage(name) ? exactWarlockSpecs : regularSpecs).push(spec);\r\n }\r\n\r\n const developmentFlag = development ? \" -D\" : \"\";\r\n const runInstall = (command: string, specs: string[]) => {\r\n if (specs.length === 0) return;\r\n\r\n exec(`${command} ${specs.join(\" \")}${developmentFlag}`, {\r\n cwd: process.cwd(),\r\n stdio: \"inherit\",\r\n });\r\n };\r\n\r\n runInstall(packageManagerCommand, regularSpecs);\r\n runInstall(exactPackageManagerCommand, exactWarlockSpecs);\r\n };\r\n\r\n if (Object.keys(dependencies).length > 0) {\r\n console.log(`Installing dependencies ${colors.magenta(Object.keys(dependencies).join(\", \"))}`);\r\n\r\n installDependencySet(dependencies, false);\r\n\r\n console.log(\r\n `Dependencies installed successfully ${colors.green(Object.keys(dependencies).join(\", \"))}`,\r\n );\r\n }\r\n\r\n if (Object.keys(devDependencies).length > 0) {\r\n console.log(\r\n `Installing dev dependencies ${colors.magenta(Object.keys(devDependencies).join(\", \"))}`,\r\n );\r\n\r\n installDependencySet(devDependencies, true);\r\n\r\n console.log(\r\n `Dev dependencies installed successfully ${colors.green(Object.keys(devDependencies).join(\", \"))}`,\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Write the resolved dependency sets into package.json without installing.\r\n * Used by `--no-install` so a scaffolder can batch every feature into one\r\n * install pass after the command returns. Versions come from the feature map.\r\n */\r\nasync function recordDependencies(\r\n dependencies: Record<string, string>,\r\n devDependencies: Record<string, string>,\r\n) {\r\n if (Object.keys(dependencies).length === 0 && Object.keys(devDependencies).length === 0) {\r\n return;\r\n }\r\n\r\n const packageJsonPath = rootPath(\"package.json\");\r\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\r\n\r\n packageJson.dependencies = packageJson.dependencies ?? {};\r\n packageJson.devDependencies = packageJson.devDependencies ?? {};\r\n\r\n Object.assign(packageJson.dependencies, dependencies);\r\n Object.assign(packageJson.devDependencies, devDependencies);\r\n\r\n await putJsonFileAsync(packageJsonPath, packageJson);\r\n\r\n const recorded = [...Object.keys(dependencies), ...Object.keys(devDependencies)];\r\n\r\n console.log(\r\n `Recorded ${colors.green(recorded.join(\", \"))} in package.json (install skipped via --no-install)`,\r\n );\r\n}\r\n\r\nfunction validateFeatures(features: string[]) {\r\n for (const feature of features) {\r\n if (!allowedFeatures.includes(feature)) {\r\n console.log(\r\n `Feature ${colors.redBright(feature)} is not allowed, allowed features are: ${colors.green(allowedFeatures.join(\", \"))}`,\r\n );\r\n process.exit(1);\r\n }\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;AAkCA,MAAa,kBAAkB,OAAO,KAAK,WAAW;AAEtD,SAAS,iBAAiB,aAA8B;CACtD,OAAO,YAAY,WAAW,cAAc;AAC9C;;;;;;AAOA,SAAgB,iCACd,cACA,kBACM;CACN,KAAK,MAAM,cAAc,OAAO,KAAK,YAAY,GAC/C,IAAI,iBAAiB,UAAU,GAC7B,aAAa,cAAc;AAGjC;AAEA,SAAS,gBAAgB,UAAoB,0BAAU,IAAI,IAAY,GAAa;CAClF,MAAM,WAAqB,CAAC;CAE5B,KAAK,MAAM,WAAW,UAAU;EAC9B,IAAI,QAAQ,IAAI,OAAO,GAAG;EAC1B,QAAQ,IAAI,OAAO;EAEnB,MAAM,MAAM,YAAY;EAQxB,IAAI,QAAQ,QAAW;EAEvB,IAAI,IAAI,UAAU,QAChB,SAAS,KAAK,GAAG,gBAAgB,IAAI,UAAU,OAAO,CAAC;EAGzD,SAAS,KAAK,OAAO;CACvB;CAEA,OAAO;AACT;AAEA,eAAsB,iBAAiB,SAA4B;CACjE,MAAM,WAAW,QAAQ;CACzB,MAAM,EAAE,gBAAgB,MAAM,cAAc,QAAQ;CAEpD,IAAI,MAAM;EACR,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,GACjG;CACF;AACF;;;;;;AAOA,eAAe,mBACb,cACA,iBACA;CACA,IAAI,OAAO,KAAK,YAAY,CAAC,CAAC,WAAW,KAAK,OAAO,KAAK,eAAe,CAAC,CAAC,WAAW,GACpF;CAGF,MAAM,kBAAkB,SAAS,cAAc;CAC/C,MAAM,cAAc,MAAM,iBAAqC,eAAe;CAE9E,YAAY,eAAe,YAAY,gBAAgB,CAAC;CACxD,YAAY,kBAAkB,YAAY,mBAAmB,CAAC;CAE9D,OAAO,OAAO,YAAY,cAAc,YAAY;CACpD,OAAO,OAAO,YAAY,iBAAiB,eAAe;CAE1D,MAAM,iBAAiB,iBAAiB,WAAW;CAEnD,MAAM,WAAW,CAAC,GAAG,OAAO,KAAK,YAAY,GAAG,GAAG,OAAO,KAAK,eAAe,CAAC;CAE/E,QAAQ,IACN,YAAY,OAAO,MAAM,SAAS,KAAK,IAAI,CAAC,EAAE,oDAChD;AACF;AAEA,SAAS,iBAAiB,UAAoB;CAC5C,KAAK,MAAM,WAAW,UACpB,IAAI,CAAC,gBAAgB,SAAS,OAAO,GAAG;EACtC,QAAQ,IACN,WAAW,OAAO,UAAU,OAAO,EAAE,yCAAyC,OAAO,MAAM,gBAAgB,KAAK,IAAI,CAAC,GACvH;EACA,QAAQ,KAAK,CAAC;CAChB;AAEJ"}
|
|
1
|
+
{"version":3,"file":"add-command.action.mjs","names":[],"sources":["../../../../../../../core/src/generations/add-command.action.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport {\n fileExistsAsync,\n getFileAsync,\n getJsonFileAsync,\n putFileAsync,\n putJsonFileAsync,\n} from \"@warlock.js/fs\";\nimport { execSync } from \"node:child_process\";\nimport type { CommandActionData } from \"../commands/types\";\nimport {\n detectPackageManager,\n getAddCommand,\n getExactAddCommand,\n type PackageManager,\n} from \"../updater/package-manager\";\nimport { rootPath, srcPath } from \"../utils\";\nimport { getWarlockVersion } from \"../utils/framework-vesion\";\nimport { featuresMap } from \"./features\";\nimport { mergePnpmSharpApproval } from \"./pnpm-build-approvals\";\n\nexport { featuresMap };\nexport type { FeatureDefinition } from \"./features\";\n\n/**\n * The parts of a project `package.json` this action reads or writes. Deliberately\n * partial — it describes what we touch, not the whole manifest.\n */\ntype ProjectPackageJson = {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n scripts?: Record<string, string>;\n};\n\nexport const allowedFeatures = Object.keys(featuresMap);\n\nfunction isWarlockPackage(packageName: string): boolean {\n return packageName.startsWith(\"@warlock.js/\");\n}\n\n/**\n * Resolve the internal feature-map placeholder to the version of Core that is\n * actually executing the command. Every @warlock.js package is lockstep, so\n * Core is the single source of truth; non-Warlock dependencies are untouched.\n */\nexport function resolveWarlockDependencyVersions(\n dependencies: Record<string, string>,\n frameworkVersion: string,\n): void {\n for (const dependency of Object.keys(dependencies)) {\n if (isWarlockPackage(dependency)) {\n dependencies[dependency] = frameworkVersion;\n }\n }\n}\n\nfunction resolveFeatures(features: string[], visited = new Set<string>()): string[] {\n const resolved: string[] = [];\n\n for (const feature of features) {\n if (visited.has(feature)) continue;\n visited.add(feature);\n\n const def = featuresMap[feature];\n\n // `addCommandAction` runs `validateFeatures()` before calling this, and the\n // recursive calls below pass `requires` entries that come out of the map\n // itself — so every lookup resolves. Skipping an unresolvable one keeps a\n // typo from crashing the command with `Cannot read properties of\n // undefined`, which names neither the feature nor the fact that it was the\n // ARGUMENT that was wrong.\n if (def === undefined) continue;\n\n if (def.requires?.length) {\n resolved.push(...resolveFeatures(def.requires, visited));\n }\n\n resolved.push(feature);\n }\n\n return resolved;\n}\n\nexport async function addCommandAction(options: CommandActionData) {\n const features = options.args;\n const { packageManager, list, noInstall } = options.options;\n\n if (list) {\n console.log(\"Available Features:\");\n\n for (const feature of allowedFeatures) {\n const definition = featuresMap[feature];\n\n // `allowedFeatures` is derived from this same map, so this resolves.\n if (definition === undefined) continue;\n\n console.log(`- ${colors.yellowBright(feature)}: ${colors.green(definition.description)}`);\n }\n\n process.exit(0);\n }\n\n validateFeatures(features);\n\n const resolvedFeatures = resolveFeatures(features);\n\n const dependencies: Record<string, string> = {};\n const devDependencies: Record<string, string> = {};\n const ejectConfigs: Record<string, { content: string; name: string }> = {};\n const scripts: Record<string, string> = {};\n\n for (const feature of resolvedFeatures) {\n const featurePackages = featuresMap[feature as keyof typeof featuresMap];\n\n // Validated upstream; see the note in resolveFeatures above.\n if (featurePackages === undefined) continue;\n\n Object.assign(dependencies, featurePackages.dependencies);\n if (featurePackages.devDependencies) {\n Object.assign(devDependencies, featurePackages.devDependencies);\n }\n\n if (featurePackages.ejectConfig) {\n ejectConfigs[featurePackages.ejectConfig.name] = featurePackages.ejectConfig;\n }\n\n if (featurePackages.script) {\n Object.assign(scripts, featurePackages.script);\n }\n }\n\n // Pin every @warlock.js/* feature package to the INSTALLED framework version so\n // a scaffolded project's features match its core version instead of drifting to\n // the feature map's static range.\n const frameworkVersion = await getWarlockVersion();\n resolveWarlockDependencyVersions(dependencies, frameworkVersion);\n resolveWarlockDependencyVersions(devDependencies, frameworkVersion);\n\n const currentPackageJson = await getJsonFileAsync<ProjectPackageJson>(rootPath(\"package.json\"));\n\n // Fresh templates may omit one of the maps — guard before reading.\n currentPackageJson.dependencies = currentPackageJson.dependencies ?? {};\n currentPackageJson.devDependencies = currentPackageJson.devDependencies ?? {};\n\n // Skip anything already present so we never downgrade an existing pin.\n for (const dependency of Object.keys(dependencies)) {\n if (currentPackageJson.dependencies[dependency]) {\n console.log(`${colors.yellowBright(dependency)} is already installed, skipping...`);\n delete dependencies[dependency];\n }\n }\n\n for (const devDependency of Object.keys(devDependencies)) {\n if (currentPackageJson.devDependencies[devDependency]) {\n console.log(`${colors.yellowBright(devDependency)} is already installed, skipping...`);\n delete devDependencies[devDependency];\n }\n }\n\n if (noInstall) {\n await recordDependencies(dependencies, devDependencies);\n } else {\n const resolvedPackageManager =\n (packageManager as PackageManager | undefined) ?? (await detectPackageManager());\n if (resolvedPackageManager === \"pnpm\" && dependencies.sharp !== undefined) {\n const workspacePath = rootPath(\"pnpm-workspace.yaml\");\n const current = (await fileExistsAsync(workspacePath))\n ? await getFileAsync(workspacePath)\n : \"\";\n await putFileAsync(workspacePath, mergePnpmSharpApproval(current));\n }\n await installDependencies(\n packageManager as PackageManager | undefined,\n dependencies,\n devDependencies,\n );\n }\n\n for (const [name, config] of Object.entries(ejectConfigs)) {\n if (await fileExistsAsync(srcPath(`config/${name}.ts`))) {\n console.log(`${colors.yellowBright(name)} config already exists, skipping...`);\n continue;\n }\n\n console.log(`Creating ${colors.magenta(name)} config...`);\n\n await putFileAsync(srcPath(`config/${name}.ts`), config.content);\n\n console.log(`${colors.green(name)} config created successfully`);\n }\n\n // now loop again over features to execute onExecuting\n for (const feature of resolvedFeatures) {\n const featurePackages = featuresMap[feature as keyof typeof featuresMap];\n\n if (featurePackages?.onExecuting) {\n await featurePackages.onExecuting(options);\n }\n }\n\n if (Object.keys(scripts).length > 0) {\n console.log(`Adding scripts ${colors.magenta(Object.keys(scripts).join(\", \"))}`);\n const packageJsonPath = rootPath(\"package.json\");\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\n packageJson.scripts = { ...(packageJson.scripts ?? {}), ...scripts };\n await putJsonFileAsync(packageJsonPath, packageJson);\n\n console.log(`Scripts added successfully ${colors.green(Object.keys(scripts).join(\", \"))}`);\n }\n}\n\n/**\n * Install the resolved dependency sets through the project's package manager.\n * Runs two passes (prod then dev) so each lands in the correct section.\n */\nexport async function installDependencies(\n packageManager: PackageManager | undefined,\n dependencies: Record<string, string>,\n devDependencies: Record<string, string>,\n exec: (command: string, options: { cwd: string; stdio: \"inherit\" }) => unknown = execSync,\n) {\n // `--package-manager` is optional; without it, fall back to the lockfile.\n const resolvedPackageManager = packageManager ?? (await detectPackageManager());\n const packageManagerCommand = getAddCommand(resolvedPackageManager);\n const exactPackageManagerCommand = getExactAddCommand(resolvedPackageManager);\n\n const installDependencySet = (dependencySet: Record<string, string>, development: boolean) => {\n const regularSpecs: string[] = [];\n const exactWarlockSpecs: string[] = [];\n\n for (const [name, version] of Object.entries(dependencySet)) {\n const spec = `${name}@${version}`;\n (isWarlockPackage(name) ? exactWarlockSpecs : regularSpecs).push(spec);\n }\n\n const developmentFlag = development ? \" -D\" : \"\";\n const runInstall = (command: string, specs: string[]) => {\n if (specs.length === 0) return;\n\n exec(`${command} ${specs.join(\" \")}${developmentFlag}`, {\n cwd: process.cwd(),\n stdio: \"inherit\",\n });\n };\n\n runInstall(packageManagerCommand, regularSpecs);\n runInstall(exactPackageManagerCommand, exactWarlockSpecs);\n };\n\n if (Object.keys(dependencies).length > 0) {\n console.log(`Installing dependencies ${colors.magenta(Object.keys(dependencies).join(\", \"))}`);\n\n installDependencySet(dependencies, false);\n\n console.log(\n `Dependencies installed successfully ${colors.green(Object.keys(dependencies).join(\", \"))}`,\n );\n }\n\n if (Object.keys(devDependencies).length > 0) {\n console.log(\n `Installing dev dependencies ${colors.magenta(Object.keys(devDependencies).join(\", \"))}`,\n );\n\n installDependencySet(devDependencies, true);\n\n console.log(\n `Dev dependencies installed successfully ${colors.green(Object.keys(devDependencies).join(\", \"))}`,\n );\n }\n}\n\n/**\n * Write the resolved dependency sets into package.json without installing.\n * Used by `--no-install` so a scaffolder can batch every feature into one\n * install pass after the command returns. Versions come from the feature map.\n */\nasync function recordDependencies(\n dependencies: Record<string, string>,\n devDependencies: Record<string, string>,\n) {\n if (Object.keys(dependencies).length === 0 && Object.keys(devDependencies).length === 0) {\n return;\n }\n\n const packageJsonPath = rootPath(\"package.json\");\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\n\n packageJson.dependencies = packageJson.dependencies ?? {};\n packageJson.devDependencies = packageJson.devDependencies ?? {};\n\n Object.assign(packageJson.dependencies, dependencies);\n Object.assign(packageJson.devDependencies, devDependencies);\n\n await putJsonFileAsync(packageJsonPath, packageJson);\n\n const recorded = [...Object.keys(dependencies), ...Object.keys(devDependencies)];\n\n console.log(\n `Recorded ${colors.green(recorded.join(\", \"))} in package.json (install skipped via --no-install)`,\n );\n}\n\nfunction validateFeatures(features: string[]) {\n for (const feature of features) {\n if (!allowedFeatures.includes(feature)) {\n console.log(\n `Feature ${colors.redBright(feature)} is not allowed, allowed features are: ${colors.green(allowedFeatures.join(\", \"))}`,\n );\n process.exit(1);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AAkCA,MAAa,kBAAkB,OAAO,KAAK,WAAW;AAEtD,SAAS,iBAAiB,aAA8B;CACtD,OAAO,YAAY,WAAW,cAAc;AAC9C;;;;;;AAOA,SAAgB,iCACd,cACA,kBACM;CACN,KAAK,MAAM,cAAc,OAAO,KAAK,YAAY,GAC/C,IAAI,iBAAiB,UAAU,GAC7B,aAAa,cAAc;AAGjC;AAEA,SAAS,gBAAgB,UAAoB,0BAAU,IAAI,IAAY,GAAa;CAClF,MAAM,WAAqB,CAAC;CAE5B,KAAK,MAAM,WAAW,UAAU;EAC9B,IAAI,QAAQ,IAAI,OAAO,GAAG;EAC1B,QAAQ,IAAI,OAAO;EAEnB,MAAM,MAAM,YAAY;EAQxB,IAAI,QAAQ,QAAW;EAEvB,IAAI,IAAI,UAAU,QAChB,SAAS,KAAK,GAAG,gBAAgB,IAAI,UAAU,OAAO,CAAC;EAGzD,SAAS,KAAK,OAAO;CACvB;CAEA,OAAO;AACT;AAEA,eAAsB,iBAAiB,SAA4B;CACjE,MAAM,WAAW,QAAQ;CACzB,MAAM,EAAE,gBAAgB,MAAM,cAAc,QAAQ;CAEpD,IAAI,MAAM;EACR,QAAQ,IAAI,qBAAqB;EAEjC,KAAK,MAAM,WAAW,iBAAiB;GACrC,MAAM,aAAa,YAAY;GAG/B,IAAI,eAAe,QAAW;GAE9B,QAAQ,IAAI,KAAK,OAAO,aAAa,OAAO,EAAE,IAAI,OAAO,MAAM,WAAW,WAAW,GAAG;EAC1F;EAEA,QAAQ,KAAK,CAAC;CAChB;CAEA,iBAAiB,QAAQ;CAEzB,MAAM,mBAAmB,gBAAgB,QAAQ;CAEjD,MAAM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BAAgB,CAAC;CACxD,YAAY,kBAAkB,YAAY,mBAAmB,CAAC;CAE9D,OAAO,OAAO,YAAY,cAAc,YAAY;CACpD,OAAO,OAAO,YAAY,iBAAiB,eAAe;CAE1D,MAAM,iBAAiB,iBAAiB,WAAW;CAEnD,MAAM,WAAW,CAAC,GAAG,OAAO,KAAK,YAAY,GAAG,GAAG,OAAO,KAAK,eAAe,CAAC;CAE/E,QAAQ,IACN,YAAY,OAAO,MAAM,SAAS,KAAK,IAAI,CAAC,EAAE,oDAChD;AACF;AAEA,SAAS,iBAAiB,UAAoB;CAC5C,KAAK,MAAM,WAAW,UACpB,IAAI,CAAC,gBAAgB,SAAS,OAAO,GAAG;EACtC,QAAQ,IACN,WAAW,OAAO,UAAU,OAAO,EAAE,yCAAyC,OAAO,MAAM,gBAAgB,KAAK,IAAI,CAAC,GACvH;EACA,QAAQ,KAAK,CAAC;CAChB;AAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/access.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\
|
|
1
|
+
{"version":3,"file":"access.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/access.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { ensureDirectoryAsync, fileExistsAsync, getFileAsync, putFileAsync } from \"@warlock.js/fs\";\nimport type { CommandActionData } from \"../../commands/types\";\nimport { srcPath } from \"../../utils\";\nimport {\n accessConfigStub,\n accessResolverStub,\n accessRoleMigrationStub,\n accessRoleModelIndexStub,\n accessRoleModelStub,\n accessUserRoleMigrationStub,\n accessUserRoleModelIndexStub,\n accessUserRoleModelStub,\n} from \"../stubs\";\nimport { migrationTimestamp } from \"./shared/migration-timestamp\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nasync function registerAccessLocale() {\n // Register the access locale in the project's shared translations file so a\n // denied check returns a real sentence, not the raw \"access.errors.forbidden\"\n // key. Append when the file exists, create it otherwise; skip if already there.\n const localesPath = srcPath(\"app/shared/utils/locales.ts\");\n\n const accessLocale = `groupedTranslations(\"access\", {\n errors: {\n forbidden: {\n en: \"You do not have permission to perform this action.\",\n ar: \"ليس لديك صلاحية لتنفيذ هذا الإجراء.\",\n },\n },\n});\n`;\n\n if (await fileExistsAsync(localesPath)) {\n const current = await getFileAsync(localesPath);\n\n if (current.includes(`groupedTranslations(\"access\"`)) {\n console.log(`${colors.yellowBright(\"access\")} locale already registered, skipping...`);\n\n return;\n }\n\n // The file uses groupedTranslations already iff it calls it — only inject the\n // import when no call is present yet.\n const importLine = `import { groupedTranslations } from \"@warlock.js/core\";`;\n const prefix = current.includes(\"groupedTranslations(\") ? \"\" : `${importLine}\\n\\n`;\n\n await putFileAsync(localesPath, `${prefix}${current.trimEnd()}\\n\\n${accessLocale}`);\n\n console.log(\n `${colors.green(\"✓\")} Registered the access locale in src/app/shared/utils/locales.ts`,\n );\n\n return;\n }\n\n await ensureDirectoryAsync(srcPath(\"app/shared/utils\"));\n\n await putFileAsync(\n localesPath,\n `import { groupedTranslations } from \"@warlock.js/core\";\\n\\n${accessLocale}`,\n );\n\n console.log(\n `${colors.green(\"✓\")} Created src/app/shared/utils/locales.ts with the access locale`,\n );\n}\n\nasync function scaffoldAccessFiles() {\n // The resolver file is the sentinel for \"access already scaffolded\" — its\n // presence means the role/user-role model folders and their timestamped\n // migrations were created too, so we must not re-emit duplicate migrations on\n // a second run.\n const resolverPath = srcPath(\"app/access/services/access-resolver.ts\");\n\n if (await fileExistsAsync(resolverPath)) {\n console.log(\n `${colors.yellowBright(\"src/app/access\")} already scaffolded, skipping resolver + role tables...`,\n );\n\n return;\n }\n\n // 1. Role catalog model folder (model + barrel + migration). The catalog row\n // is role name → granted permissions; managed at runtime in the DB.\n await ensureDirectoryAsync(srcPath(\"app/access/models/role\"));\n await putFileAsync(srcPath(\"app/access/models/role/role.model.ts\"), accessRoleModelStub);\n await putFileAsync(srcPath(\"app/access/models/role/index.ts\"), accessRoleModelIndexStub);\n console.log(`${colors.green(\"✓\")} Created src/app/access/models/role`);\n\n await ensureDirectoryAsync(srcPath(\"app/access/models/role/migrations\"));\n\n // Migration filenames carry a MM-DD-YYYY_HH-MM-SS prefix so cascade infers\n // their createdAt and orders them deterministically (the migrate action\n // discovers src/app/*/models/*/migrations/*). The two tables are independent\n // (no FK between them), but the user-role migration is stamped a second later\n // so the relative order is stable.\n const roleMigrationFile = `${migrationTimestamp()}-role.migration.ts`;\n await putFileAsync(\n srcPath(\"app/access/models/role/migrations\", roleMigrationFile),\n accessRoleMigrationStub,\n );\n console.log(\n `${colors.green(\"✓\")} Created src/app/access/models/role/migrations/${roleMigrationFile}`,\n );\n\n // 2. UserRole assignment model folder (model + barrel + migration). The model\n // statics scope an unresolved tenant to GLOBAL rows only (security\n // invariant) — see the stub for the reasoning.\n await ensureDirectoryAsync(srcPath(\"app/access/models/user-role\"));\n await putFileAsync(\n srcPath(\"app/access/models/user-role/user-role.model.ts\"),\n accessUserRoleModelStub,\n );\n await putFileAsync(srcPath(\"app/access/models/user-role/index.ts\"), accessUserRoleModelIndexStub);\n console.log(`${colors.green(\"✓\")} Created src/app/access/models/user-role`);\n\n await ensureDirectoryAsync(srcPath(\"app/access/models/user-role/migrations\"));\n\n const userRoleMigrationFile = `${migrationTimestamp(1)}-user-role.migration.ts`;\n await putFileAsync(\n srcPath(\"app/access/models/user-role/migrations\", userRoleMigrationFile),\n accessUserRoleMigrationStub,\n );\n console.log(\n `${colors.green(\"✓\")} Created src/app/access/models/user-role/migrations/${userRoleMigrationFile}`,\n );\n\n // 3. The DatabaseAccessResolver — the one required config seam, wired into\n // config/access.ts by the ejected stub.\n await ensureDirectoryAsync(srcPath(\"app/access/services\"));\n await putFileAsync(resolverPath, accessResolverStub);\n console.log(`${colors.green(\"✓\")} Created src/app/access/services/access-resolver.ts`);\n}\n\nasync function completeAccessInstallation(_options: CommandActionData) {\n await registerAccessLocale();\n await scaffoldAccessFiles();\n}\n\nexport const accessFeature: FeatureDefinition = {\n description:\n \"Installs @warlock.js/access — authorization (RBAC + ABAC): permission checks, ABAC policies, and roles. Ejects config/access.ts, the DatabaseAccessResolver + Role/UserRole models and migrations into src/app/access, and registers the access locale in src/app/shared/utils/locales.ts\",\n dependencies: {\n \"@warlock.js/access\": INSTALLED_WARLOCK_VERSION,\n },\n ejectConfig: {\n content: accessConfigStub,\n name: \"access\",\n },\n onExecuting: completeAccessInstallation,\n};\n"],"mappings":";;;;;;;;;AAiBA,eAAe,uBAAuB;CAIpC,MAAM,cAAc,QAAQ,6BAA6B;CAEzD,MAAM,eAAe;;;;;;;;;CAUrB,IAAI,MAAM,gBAAgB,WAAW,GAAG;EACtC,MAAM,UAAU,MAAM,aAAa,WAAW;EAE9C,IAAI,QAAQ,SAAS,8BAA8B,GAAG;GACpD,QAAQ,IAAI,GAAG,OAAO,aAAa,QAAQ,EAAE,wCAAwC;GAErF;EACF;EAOA,MAAM,aAAa,aAAa,GAFjB,QAAQ,SAAS,sBAAsB,IAAI,KAAK,gEAEnB,QAAQ,QAAQ,EAAE,MAAM,cAAc;EAElF,QAAQ,IACN,GAAG,OAAO,MAAM,GAAG,EAAE,iEACvB;EAEA;CACF;CAEA,MAAM,qBAAqB,QAAQ,kBAAkB,CAAC;CAEtD,MAAM,aACJ,aACA,8DAA8D,cAChE;CAEA,QAAQ,IACN,GAAG,OAAO,MAAM,GAAG,EAAE,gEACvB;AACF;AAEA,eAAe,sBAAsB;CAKnC,MAAM,eAAe,QAAQ,wCAAwC;CAErE,IAAI,MAAM,gBAAgB,YAAY,GAAG;EACvC,QAAQ,IACN,GAAG,OAAO,aAAa,gBAAgB,EAAE,wDAC3C;EAEA;CACF;CAIA,MAAM,qBAAqB,QAAQ,wBAAwB,CAAC;CAC5D,MAAM,aAAa,QAAQ,sCAAsC,GAAG,mBAAmB;CACvF,MAAM,aAAa,QAAQ,iCAAiC,GAAG,wBAAwB;CACvF,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,oCAAoC;CAErE,MAAM,qBAAqB,QAAQ,mCAAmC,CAAC;CAOvE,MAAM,oBAAoB,GAAG,mBAAmB,EAAE;CAClD,MAAM,aACJ,QAAQ,qCAAqC,iBAAiB,GAC9D,uBACF;CACA,QAAQ,IACN,GAAG,OAAO,MAAM,GAAG,EAAE,iDAAiD,mBACxE;CAKA,MAAM,qBAAqB,QAAQ,6BAA6B,CAAC;CACjE,MAAM,aACJ,QAAQ,gDAAgD,GACxD,uBACF;CACA,MAAM,aAAa,QAAQ,sCAAsC,GAAG,4BAA4B;CAChG,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,yCAAyC;CAE1E,MAAM,qBAAqB,QAAQ,wCAAwC,CAAC;CAE5E,MAAM,wBAAwB,GAAG,mBAAmB,CAAC,EAAE;CACvD,MAAM,aACJ,QAAQ,0CAA0C,qBAAqB,GACvE,2BACF;CACA,QAAQ,IACN,GAAG,OAAO,MAAM,GAAG,EAAE,sDAAsD,uBAC7E;CAIA,MAAM,qBAAqB,QAAQ,qBAAqB,CAAC;CACzD,MAAM,aAAa,cAAc,kBAAkB;CACnD,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,oDAAoD;AACvF;AAEA,eAAe,2BAA2B,UAA6B;CACrE,MAAM,qBAAqB;CAC3B,MAAM,oBAAoB;AAC5B;AAEA,MAAa,gBAAmC;CAC9C,aACE;CACF,cAAc,EACZ,sBAAsB,0BACxB;CACA,aAAa;EACX,SAAS;EACT,MAAM;CACR;CACA,aAAa;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-anthropic.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-anthropic.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"ai-anthropic.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-anthropic.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const aiAnthropicFeature: FeatureDefinition = {\n description: \"Anthropic (Claude) provider for @warlock.js/ai (pulls the core ai package)\",\n requires: [\"ai\"],\n dependencies: {\n \"@warlock.js/ai-anthropic\": INSTALLED_WARLOCK_VERSION,\n },\n};\n"],"mappings":";;;AAEA,MAAa,qBAAwC;CACnD,aAAa;CACb,UAAU,CAAC,IAAI;CACf,cAAc,EACZ,4BAA4B,0BAC9B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-bedrock.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-bedrock.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"ai-bedrock.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-bedrock.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const aiBedrockFeature: FeatureDefinition = {\n description: \"AWS Bedrock provider for @warlock.js/ai (pulls the core ai package)\",\n requires: [\"ai\"],\n dependencies: {\n \"@warlock.js/ai-bedrock\": INSTALLED_WARLOCK_VERSION,\n },\n};\n"],"mappings":";;;AAEA,MAAa,mBAAsC;CACjD,aAAa;CACb,UAAU,CAAC,IAAI;CACf,cAAc,EACZ,0BAA0B,0BAC5B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-google.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-google.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"ai-google.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-google.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const aiGoogleFeature: FeatureDefinition = {\n description: \"Google (Gemini) provider for @warlock.js/ai (pulls the core ai package)\",\n requires: [\"ai\"],\n dependencies: {\n \"@warlock.js/ai-google\": INSTALLED_WARLOCK_VERSION,\n },\n};\n"],"mappings":";;;AAEA,MAAa,kBAAqC;CAChD,aAAa;CACb,UAAU,CAAC,IAAI;CACf,cAAc,EACZ,yBAAyB,0BAC3B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-ollama.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-ollama.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"ai-ollama.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-ollama.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const aiOllamaFeature: FeatureDefinition = {\n description: \"Ollama provider for @warlock.js/ai (pulls the core ai package)\",\n requires: [\"ai\"],\n dependencies: {\n \"@warlock.js/ai-ollama\": INSTALLED_WARLOCK_VERSION,\n },\n};\n"],"mappings":";;;AAEA,MAAa,kBAAqC;CAChD,aAAa;CACb,UAAU,CAAC,IAAI;CACf,cAAc,EACZ,yBAAyB,0BAC3B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-openai.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-openai.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"ai-openai.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-openai.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const aiOpenaiFeature: FeatureDefinition = {\n description: \"OpenAI provider for @warlock.js/ai (pulls the core ai package)\",\n requires: [\"ai\"],\n dependencies: {\n \"@warlock.js/ai-openai\": INSTALLED_WARLOCK_VERSION,\n },\n};\n"],"mappings":";;;AAEA,MAAa,kBAAqC;CAChD,aAAa;CACb,UAAU,CAAC,IAAI;CACf,cAAc,EACZ,yBAAyB,0BAC3B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-panoptic.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-panoptic.feature.ts"],"sourcesContent":["import { linkAiPackageImport } from \"./shared/link-ai-package-import\";\
|
|
1
|
+
{"version":3,"file":"ai-panoptic.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-panoptic.feature.ts"],"sourcesContent":["import { linkAiPackageImport } from \"./shared/link-ai-package-import\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const aiPanopticFeature: FeatureDefinition = {\n description:\n \"Installs @warlock.js/ai-panoptic — observability for @warlock.js/ai (collector, exporters, zero-setup local dashboard) via ai.config({ panoptic }) (pulls the core ai package)\",\n requires: [\"ai\"],\n dependencies: {\n \"@warlock.js/ai-panoptic\": INSTALLED_WARLOCK_VERSION,\n },\n onExecuting: () => linkAiPackageImport(\"@warlock.js/ai-panoptic\"),\n};\n"],"mappings":";;;;AAGA,MAAa,oBAAuC;CAClD,aACE;CACF,UAAU,CAAC,IAAI;CACf,cAAc,EACZ,2BAA2B,0BAC7B;CACA,mBAAmB,oBAAoB,yBAAyB;AAClE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tools.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-tools.feature.ts"],"sourcesContent":["import { linkAiPackageImport } from \"./shared/link-ai-package-import\";\
|
|
1
|
+
{"version":3,"file":"ai-tools.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-tools.feature.ts"],"sourcesContent":["import { linkAiPackageImport } from \"./shared/link-ai-package-import\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const aiToolsFeature: FeatureDefinition = {\n description:\n \"Installs @warlock.js/ai-tools — ready-made agent tools (web search, fetch, HTTP, calculator, date-time) + an MCP client/server, under ai.tools.* / ai.mcp (pulls the core ai package)\",\n requires: [\"ai\"],\n dependencies: {\n \"@warlock.js/ai-tools\": INSTALLED_WARLOCK_VERSION,\n },\n onExecuting: () => linkAiPackageImport(\"@warlock.js/ai-tools\"),\n};\n"],"mappings":";;;;AAGA,MAAa,iBAAoC;CAC/C,aACE;CACF,UAAU,CAAC,IAAI;CACf,cAAc,EACZ,wBAAwB,0BAC1B;CACA,mBAAmB,oBAAoB,sBAAsB;AAC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-workspace.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-workspace.feature.ts"],"sourcesContent":["import { linkAiPackageImport } from \"./shared/link-ai-package-import\";\
|
|
1
|
+
{"version":3,"file":"ai-workspace.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai-workspace.feature.ts"],"sourcesContent":["import { linkAiPackageImport } from \"./shared/link-ai-package-import\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const aiWorkspaceFeature: FeatureDefinition = {\n description:\n \"Installs @warlock.js/ai-workspace — a policy-jailed filesystem + shell workspace for coding agents, as ai.workspace (pulls the core ai package)\",\n requires: [\"ai\"],\n dependencies: {\n \"@warlock.js/ai-workspace\": INSTALLED_WARLOCK_VERSION,\n },\n onExecuting: () => linkAiPackageImport(\"@warlock.js/ai-workspace\"),\n};\n"],"mappings":";;;;AAGA,MAAa,qBAAwC;CACnD,aACE;CACF,UAAU,CAAC,IAAI;CACf,cAAc,EACZ,4BAA4B,0BAC9B;CACA,mBAAmB,oBAAoB,0BAA0B;AACnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai.feature.ts"],"sourcesContent":["import { aiConfigStub } from \"../stubs\";\
|
|
1
|
+
{"version":3,"file":"ai.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ai.feature.ts"],"sourcesContent":["import { aiConfigStub } from \"../stubs\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const aiFeature: FeatureDefinition = {\n description: \"Installs @warlock.js/ai — the core AI toolkit (agents, tools, workflows)\",\n dependencies: {\n \"@warlock.js/ai\": INSTALLED_WARLOCK_VERSION,\n },\n ejectConfig: {\n content: aiConfigStub,\n name: \"ai\",\n },\n};\n"],"mappings":";;;;AAGA,MAAa,YAA+B;CAC1C,aAAa;CACb,cAAc,EACZ,kBAAkB,0BACpB;CACA,aAAa;EACX,SAAS;EACT,MAAM;CACR;AACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { INSTALLED_WARLOCK_VERSION } from "./types.mjs";
|
|
2
|
+
import { colors } from "@mongez/copper";
|
|
3
|
+
|
|
4
|
+
//#region ../core/src/generations/features/devtools.feature.ts
|
|
5
|
+
/**
|
|
6
|
+
* `warlock add devtools` — the development dashboard at `/__warlock`.
|
|
7
|
+
*
|
|
8
|
+
* Installed as a DEV dependency and never named in `warlock.config.ts`: core
|
|
9
|
+
* loads it on its own in development when it is installed. A production
|
|
10
|
+
* install omits dev dependencies, so there is nothing to strip and no config
|
|
11
|
+
* import that could fail to resolve.
|
|
12
|
+
*/
|
|
13
|
+
const devtoolsFeature = {
|
|
14
|
+
description: "Installs @warlock.js/devtools as a dev dependency — a development-only dashboard at /__warlock (request timeline, queries, N+1, mailbox, logs, cache, routes). Loaded automatically by `warlock dev`; never runs in production.",
|
|
15
|
+
devDependencies: { "@warlock.js/devtools": INSTALLED_WARLOCK_VERSION },
|
|
16
|
+
async onExecuting() {
|
|
17
|
+
console.log(`${colors.green("✓")} Devtools installed. Run ${colors.cyan("warlock dev")} and open ${colors.cyan("/__warlock")} on your app's URL.`);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { devtoolsFeature };
|
|
23
|
+
//# sourceMappingURL=devtools.feature.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/devtools.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\n/**\n * `warlock add devtools` — the development dashboard at `/__warlock`.\n *\n * Installed as a DEV dependency and never named in `warlock.config.ts`: core\n * loads it on its own in development when it is installed. A production\n * install omits dev dependencies, so there is nothing to strip and no config\n * import that could fail to resolve.\n */\nexport const devtoolsFeature: FeatureDefinition = {\n description:\n \"Installs @warlock.js/devtools as a dev dependency — a development-only dashboard at /__warlock (request timeline, queries, N+1, mailbox, logs, cache, routes). Loaded automatically by `warlock dev`; never runs in production.\",\n devDependencies: {\n \"@warlock.js/devtools\": INSTALLED_WARLOCK_VERSION,\n },\n async onExecuting() {\n console.log(\n `${colors.green(\"✓\")} Devtools installed. Run ${colors.cyan(\"warlock dev\")} and open ${colors.cyan(\"/__warlock\")} on your app's URL.`,\n );\n },\n};\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,kBAAqC;CAChD,aACE;CACF,iBAAiB,EACf,wBAAwB,0BAC1B;CACA,MAAM,cAAc;EAClB,QAAQ,IACN,GAAG,OAAO,MAAM,GAAG,EAAE,2BAA2B,OAAO,KAAK,aAAa,EAAE,YAAY,OAAO,KAAK,YAAY,EAAE,oBACnH;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"herald.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/herald.feature.ts"],"sourcesContent":["import { communicatorsConfigStub } from \"../stubs\";\
|
|
1
|
+
{"version":3,"file":"herald.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/herald.feature.ts"],"sourcesContent":["import { communicatorsConfigStub } from \"../stubs\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const heraldFeature: FeatureDefinition = {\n description: \"Installs herald for message broker (Herald Package)\",\n dependencies: {\n \"@warlock.js/herald\": INSTALLED_WARLOCK_VERSION,\n amqplib: \"^0.10.0\",\n },\n devDependencies: {\n \"@types/amqplib\": \"^0.10.0\",\n },\n ejectConfig: {\n content: communicatorsConfigStub,\n name: \"herald\",\n },\n};\n"],"mappings":";;;;AAGA,MAAa,gBAAmC;CAC9C,aAAa;CACb,cAAc;EACZ,sBAAsB;EACtB,SAAS;CACX;CACA,iBAAiB,EACf,kBAAkB,UACpB;CACA,aAAa;EACX,SAAS;EACT,MAAM;CACR;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/image.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"image.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/image.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\n\nexport const imageFeature: FeatureDefinition = {\n description: \"Installs sharp for image processing\",\n dependencies: {\n sharp: \"^0.34.5\",\n },\n};\n"],"mappings":";AAEA,MAAa,eAAkC;CAC7C,aAAa;CACb,cAAc,EACZ,OAAO,UACT;AACF"}
|
|
@@ -11,6 +11,7 @@ import { aiFeature } from "./ai.feature.mjs";
|
|
|
11
11
|
import { authGoogleFeature } from "./auth-google.feature.mjs";
|
|
12
12
|
import { authPasskeysFeature } from "./auth-passkeys.feature.mjs";
|
|
13
13
|
import { bullBoardFeature } from "./bull-board.feature.mjs";
|
|
14
|
+
import { devtoolsFeature } from "./devtools.feature.mjs";
|
|
14
15
|
import { heraldFeature } from "./herald.feature.mjs";
|
|
15
16
|
import { imageFeature } from "./image.feature.mjs";
|
|
16
17
|
import { mailFeature } from "./mail.feature.mjs";
|
|
@@ -58,6 +59,7 @@ const featuresMap = {
|
|
|
58
59
|
tailwind: tailwindFeature,
|
|
59
60
|
shadcn: shadcnFeature,
|
|
60
61
|
sitemap: sitemapFeature,
|
|
62
|
+
devtools: devtoolsFeature,
|
|
61
63
|
herald: heraldFeature,
|
|
62
64
|
queue: queueFeature,
|
|
63
65
|
"bull-board": bullBoardFeature,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/index.ts"],"sourcesContent":["import { accessFeature } from \"./access.feature\";\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/index.ts"],"sourcesContent":["import { accessFeature } from \"./access.feature\";\nimport { aiAnthropicFeature } from \"./ai-anthropic.feature\";\nimport { aiBedrockFeature } from \"./ai-bedrock.feature\";\nimport { aiGoogleFeature } from \"./ai-google.feature\";\nimport { aiOllamaFeature } from \"./ai-ollama.feature\";\nimport { aiOpenaiFeature } from \"./ai-openai.feature\";\nimport { aiPanopticFeature } from \"./ai-panoptic.feature\";\nimport { aiToolsFeature } from \"./ai-tools.feature\";\nimport { aiWorkspaceFeature } from \"./ai-workspace.feature\";\nimport { aiFeature } from \"./ai.feature\";\nimport { authGoogleFeature } from \"./auth-google.feature\";\nimport { authPasskeysFeature } from \"./auth-passkeys.feature\";\nimport { bullBoardFeature } from \"./bull-board.feature\";\nimport { devtoolsFeature } from \"./devtools.feature\";\nimport { heraldFeature } from \"./herald.feature\";\nimport { imageFeature } from \"./image.feature\";\nimport { mailFeature } from \"./mail.feature\";\nimport { mongodbFeature } from \"./mongodb.feature\";\nimport { mysqlFeature } from \"./mysql.feature\";\nimport { notificationsFeature } from \"./notifications.feature\";\nimport { postgresFeature } from \"./postgres.feature\";\nimport { queueFeature } from \"./queue.feature\";\nimport { reactEmailFeature } from \"./react-email.feature\";\nimport { reactFeature } from \"./react.feature\";\nimport { redisFeature } from \"./redis.feature\";\nimport { s3Feature } from \"./s3.feature\";\nimport { schedulerFeature } from \"./scheduler.feature\";\nimport { sesFeature } from \"./ses.feature\";\nimport { shadcnFeature } from \"./shadcn.feature\";\nimport { sitemapFeature } from \"./sitemap.feature\";\nimport { socketFeature } from \"./socket.feature\";\nimport { tailwindFeature } from \"./tailwind.feature\";\nimport { testFeature } from \"./test.feature\";\nimport type { FeatureDefinition } from \"./types\";\nimport { webFeature } from \"./web.feature\";\n\nexport type { FeatureDefinition } from \"./types\";\n\n/**\n * The feature registry `warlock add` dispatches against.\n *\n * This file is an INDEX, nothing more: every entry lives in its own module\n * alongside the `onExecuting` body it runs. Key order is load-bearing — it is\n * the order `--list` prints and the order the \"not allowed\" error lists — so\n * add new features in the place they should appear, not alphabetically.\n */\nexport const featuresMap: Record<string, FeatureDefinition> = {\n \"react-email\": reactEmailFeature,\n react: reactFeature,\n image: imageFeature,\n mail: mailFeature,\n ses: sesFeature,\n mongodb: mongodbFeature,\n scheduler: schedulerFeature,\n // swagger / postman intentionally omitted — those packages do not exist yet;\n // they will ship together in the unified @warlock.js/api-docs package.\n postgres: postgresFeature,\n mysql: mysqlFeature,\n redis: redisFeature,\n s3: s3Feature,\n test: testFeature,\n web: webFeature,\n // Directly after `web`, and only there: it `requires` it, it is useless\n // without it, and a reader scanning `--list` for the page stack should meet\n // the two together rather than find styling filed between queues and sockets.\n tailwind: tailwindFeature,\n // Immediately after `tailwind`, for the same reason `tailwind` follows `web`:\n // it `requires` it, it appends to the stylesheet that feature creates, and the\n // three of them are one stack a reader should meet in build order.\n shadcn: shadcnFeature,\n // Directly after the web/tailwind/shadcn stack, for the same reason: it\n // `requires` web (it reads the page registry `listRoutablePages()`\n // exposes) and a reader scanning `--list` for the page stack should meet it\n // there rather than filed between queues and sockets.\n sitemap: sitemapFeature,\n devtools: devtoolsFeature,\n herald: heraldFeature,\n queue: queueFeature,\n // Directly after `queue`, for the same reason `tailwind` follows `web`: it\n // needs queue already installed and configured, and a reader scanning\n // `--list` for job-queue features should meet the two together.\n \"bull-board\": bullBoardFeature,\n socket: socketFeature,\n notifications: notificationsFeature,\n access: accessFeature,\n // Login methods for @warlock.js/auth — \"<package>-<vendor>\" like the ai-* entries.\n \"auth-google\": authGoogleFeature,\n \"auth-passkeys\": authPasskeysFeature,\n ai: aiFeature,\n \"ai-openai\": aiOpenaiFeature,\n \"ai-google\": aiGoogleFeature,\n \"ai-anthropic\": aiAnthropicFeature,\n \"ai-bedrock\": aiBedrockFeature,\n \"ai-ollama\": aiOllamaFeature,\n \"ai-tools\": aiToolsFeature,\n \"ai-panoptic\": aiPanopticFeature,\n \"ai-workspace\": aiWorkspaceFeature,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,cAAiD;CAC5D,eAAe;CACf,OAAO;CACP,OAAO;CACP,MAAM;CACN,KAAK;CACL,SAAS;CACT,WAAW;CAGX,UAAU;CACV,OAAO;CACP,OAAO;CACP,IAAI;CACJ,MAAM;CACN,KAAK;CAIL,UAAU;CAIV,QAAQ;CAKR,SAAS;CACT,UAAU;CACV,QAAQ;CACR,OAAO;CAIP,cAAc;CACd,QAAQ;CACR,eAAe;CACf,QAAQ;CAER,eAAe;CACf,iBAAiB;CACjB,IAAI;CACJ,aAAa;CACb,aAAa;CACb,gBAAgB;CAChB,cAAc;CACd,aAAa;CACb,YAAY;CACZ,eAAe;CACf,gBAAgB;AAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mail.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/mail.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"mail.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/mail.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\n\nexport const mailFeature: FeatureDefinition = {\n description: \"Installs nodemailer for sending emails\",\n dependencies: {\n nodemailer: \"^8.0.5\",\n },\n devDependencies: {\n \"@types/nodemailer\": \"^8.0.0\",\n },\n};\n"],"mappings":";AAEA,MAAa,cAAiC;CAC5C,aAAa;CACb,cAAc,EACZ,YAAY,SACd;CACA,iBAAiB,EACf,qBAAqB,SACvB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongodb.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/mongodb.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"mongodb.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/mongodb.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\n\nexport const mongodbFeature: FeatureDefinition = {\n description: \"Installs mongodb driver for database driver (Cascade Package)\",\n dependencies: {\n mongodb: \"^7.0.0\",\n },\n};\n"],"mappings":";AAEA,MAAa,iBAAoC;CAC/C,aAAa;CACb,cAAc,EACZ,SAAS,SACX;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/notifications.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\
|
|
1
|
+
{"version":3,"file":"notifications.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/notifications.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { ensureDirectoryAsync, fileExistsAsync, putFileAsync } from \"@warlock.js/fs\";\nimport type { CommandActionData } from \"../../commands/types\";\nimport { srcPath } from \"../../utils\";\nimport {\n notificationControllersStub,\n notificationMigrationStub,\n notificationModelStub,\n notificationRoutesStub,\n notificationsConfigStub,\n} from \"../stubs\";\nimport { migrationTimestamp } from \"./shared/migration-timestamp\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nasync function completeNotificationsInstallation(_options: CommandActionData) {\n const modelPath = srcPath(\"app/notifications/notification.model.ts\");\n\n // The model file is the sentinel for \"notifications already scaffolded\" —\n // its presence means the migration was created too (timestamped, so we must\n // not re-emit a duplicate on a second run).\n if (await fileExistsAsync(modelPath)) {\n console.log(\n `${colors.yellowBright(\"src/app/notifications\")} already scaffolded, skipping model + migration...`,\n );\n return;\n }\n\n // 1. Notification model — extends the package's DatabaseNotification base.\n await ensureDirectoryAsync(srcPath(\"app/notifications\"));\n await putFileAsync(modelPath, notificationModelStub);\n console.log(`${colors.green(\"✓\")} Created src/app/notifications/notification.model.ts`);\n\n // 2. Migration — timestamped MM-DD-YYYY_HH-MM-SS prefix so cascade infers its\n // createdAt and orders it deterministically (migrate-action discovers\n // src/app/*/migrations/*).\n await ensureDirectoryAsync(srcPath(\"app/notifications/migrations\"));\n\n const migrationFile = `${migrationTimestamp()}-notification.migration.ts`;\n\n await putFileAsync(\n srcPath(\"app/notifications/migrations\", migrationFile),\n notificationMigrationStub,\n );\n console.log(`${colors.green(\"✓\")} Created src/app/notifications/migrations/${migrationFile}`);\n\n // 3. HTTP surface — the in-app read/dismiss endpoints (routes + controllers),\n // gated by authMiddleware. Delete if the app exposes notifications another way.\n await ensureDirectoryAsync(srcPath(\"app/notifications/controllers\"));\n await putFileAsync(\n srcPath(\"app/notifications/controllers/notifications.controller.ts\"),\n notificationControllersStub,\n );\n await putFileAsync(srcPath(\"app/notifications/routes.ts\"), notificationRoutesStub);\n console.log(`${colors.green(\"✓\")} Created src/app/notifications/routes.ts + controllers`);\n}\n\nexport const notificationsFeature: FeatureDefinition = {\n description:\n \"Installs @warlock.js/notifications — multi-channel notifications (mail + in-app database). Pulls the mail feature, ejects config/notifications.ts, and scaffolds the Notification model + migration plus the recipient-scoped read/dismiss routes + controllers into src/app/notifications\",\n // The ejected config wires a `mail` channel by default (needs nodemailer,\n // via the `mail` feature); the scaffolded routes are gated by\n // `authMiddleware`, so `@warlock.js/auth` is pulled in too.\n requires: [\"mail\"],\n dependencies: {\n \"@warlock.js/notifications\": INSTALLED_WARLOCK_VERSION,\n \"@warlock.js/auth\": INSTALLED_WARLOCK_VERSION,\n },\n ejectConfig: {\n content: notificationsConfigStub,\n name: \"notifications\",\n },\n onExecuting: completeNotificationsInstallation,\n};\n"],"mappings":";;;;;;;;;AAcA,eAAe,kCAAkC,UAA6B;CAC5E,MAAM,YAAY,QAAQ,yCAAyC;CAKnE,IAAI,MAAM,gBAAgB,SAAS,GAAG;EACpC,QAAQ,IACN,GAAG,OAAO,aAAa,uBAAuB,EAAE,mDAClD;EACA;CACF;CAGA,MAAM,qBAAqB,QAAQ,mBAAmB,CAAC;CACvD,MAAM,aAAa,WAAW,qBAAqB;CACnD,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,qDAAqD;CAKtF,MAAM,qBAAqB,QAAQ,8BAA8B,CAAC;CAElE,MAAM,gBAAgB,GAAG,mBAAmB,EAAE;CAE9C,MAAM,aACJ,QAAQ,gCAAgC,aAAa,GACrD,yBACF;CACA,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,4CAA4C,eAAe;CAI5F,MAAM,qBAAqB,QAAQ,+BAA+B,CAAC;CACnE,MAAM,aACJ,QAAQ,2DAA2D,GACnE,2BACF;CACA,MAAM,aAAa,QAAQ,6BAA6B,GAAG,sBAAsB;CACjF,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,uDAAuD;AAC1F;AAEA,MAAa,uBAA0C;CACrD,aACE;CAIF,UAAU,CAAC,MAAM;CACjB,cAAc;EACZ,6BAA6B;EAC7B,oBAAoB;CACtB;CACA,aAAa;EACX,SAAS;EACT,MAAM;CACR;CACA,aAAa;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/postgres.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"postgres.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/postgres.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\n\nexport const postgresFeature: FeatureDefinition = {\n description: \"Installs pg for Postgres database (Cascade Package)\",\n dependencies: {\n pg: \"^8.11.0\",\n },\n};\n"],"mappings":";AAEA,MAAa,kBAAqC;CAChD,aAAa;CACb,cAAc,EACZ,IAAI,UACN;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-email.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/react-email.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\
|
|
1
|
+
{"version":3,"file":"react-email.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/react-email.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { ensureDirectoryAsync, fileExistsAsync, putFileAsync } from \"@warlock.js/fs\";\nimport type { CommandActionData } from \"../../commands/types\";\nimport { rootPath } from \"../../utils\";\nimport { patchTsconfigInclude } from \"./shared/patch-tsconfig-include\";\nimport type { FeatureDefinition } from \"./types\";\n\nasync function completeReactEmailInstallation(_options: CommandActionData) {\n // 1. Create emails/ folder with a sample component\n const emailsFolderPath = rootPath(\"emails\");\n const sampleEmailPath = rootPath(\"emails/welcome-email.tsx\");\n\n if (!(await fileExistsAsync(sampleEmailPath))) {\n await ensureDirectoryAsync(emailsFolderPath);\n await putFileAsync(\n sampleEmailPath,\n `import { Body, Container, Head, Html, Text } from \"@react-email/components\";\nimport { Tailwind } from \"@react-email/tailwind\";\n\ninterface WelcomeEmailProps {\n name: string;\n}\n\n/**\n * Sample welcome email component.\n * Preview with: yarn email:preview\n */\nexport default function WelcomeEmail({ name }: WelcomeEmailProps) {\n return (\n <Html>\n <Head />\n <Tailwind>\n <Body className=\"bg-gray-100 font-sans\">\n <Container className=\"mx-auto max-w-xl py-8 px-4\">\n <Text className=\"text-2xl font-bold text-gray-900\">\n Welcome, {name}!\n </Text>\n <Text className=\"text-gray-600 mt-2\">\n You're all set. We're glad to have you on board.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n}\n`,\n );\n console.log(`${colors.green(\"✓\")} Created emails/welcome-email.tsx`);\n }\n\n // 2. Patch tsconfig.json — add \"emails\" to include if missing.\n await patchTsconfigInclude(\n \"emails\",\n \"Without it, the email components under emails/ are outside the project and do not typecheck.\",\n );\n}\n\nexport const reactEmailFeature: FeatureDefinition = {\n description: \"Installs react-email for building email templates with React and Tailwind\",\n requires: [\"mail\", \"react\"],\n dependencies: {\n \"react-email\": \"^5.2.10\",\n \"@react-email/components\": \"^1.0.11\",\n \"@react-email/render\": \"^2.0.5\",\n \"@react-email/tailwind\": \"^2.0.7\",\n },\n devDependencies: {\n \"@react-email/preview-server\": \"5.2.10\",\n },\n script: {\n \"email:preview\": \"npx react-email dev\",\n },\n onExecuting: completeReactEmailInstallation,\n};\n"],"mappings":";;;;;;;AAOA,eAAe,+BAA+B,UAA6B;CAEzE,MAAM,mBAAmB,SAAS,QAAQ;CAC1C,MAAM,kBAAkB,SAAS,0BAA0B;CAE3D,IAAI,CAAE,MAAM,gBAAgB,eAAe,GAAI;EAC7C,MAAM,qBAAqB,gBAAgB;EAC3C,MAAM,aACJ,iBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BF;EACA,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,kCAAkC;CACrE;CAGA,MAAM,qBACJ,UACA,8FACF;AACF;AAEA,MAAa,oBAAuC;CAClD,aAAa;CACb,UAAU,CAAC,QAAQ,OAAO;CAC1B,cAAc;EACZ,eAAe;EACf,2BAA2B;EAC3B,uBAAuB;EACvB,yBAAyB;CAC3B;CACA,iBAAiB,EACf,+BAA+B,SACjC;CACA,QAAQ,EACN,iBAAiB,sBACnB;CACA,aAAa;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/react.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"react.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/react.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\n\nexport const reactFeature: FeatureDefinition = {\n description:\n \"Installs React and React dom for rendering React components (non-interactive), useful for sending mails and generating HTML\",\n dependencies: {\n react: \"^19.2.3\",\n \"react-dom\": \"^19.2.3\",\n },\n devDependencies: {\n \"@types/react\": \"^19.2.7\",\n \"@types/react-dom\": \"^19.2.3\",\n },\n};\n"],"mappings":";AAEA,MAAa,eAAkC;CAC7C,aACE;CACF,cAAc;EACZ,OAAO;EACP,aAAa;CACf;CACA,iBAAiB;EACf,gBAAgB;EAChB,oBAAoB;CACtB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/redis.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"redis.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/redis.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\n\nexport const redisFeature: FeatureDefinition = {\n description: \"Installs redis for Redis cache driver (Cache Package)\",\n dependencies: {\n redis: \"^4.6.13\",\n },\n};\n"],"mappings":";AAEA,MAAa,eAAkC;CAC7C,aAAa;CACb,cAAc,EACZ,OAAO,UACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/s3.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"s3.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/s3.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\n\nexport const s3Feature: FeatureDefinition = {\n description: \"Installs AWS SDK for Cloud storage (Storage Package)\",\n dependencies: {\n \"@aws-sdk/client-s3\": \"^3.955.0\",\n \"@aws-sdk/lib-storage\": \"^3.955.0\",\n \"@aws-sdk/s3-request-presigner\": \"^3.955.0\",\n },\n};\n"],"mappings":";AAEA,MAAa,YAA+B;CAC1C,aAAa;CACb,cAAc;EACZ,sBAAsB;EACtB,wBAAwB;EACxB,iCAAiC;CACnC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/scheduler.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"scheduler.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/scheduler.feature.ts"],"sourcesContent":["import { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nexport const schedulerFeature: FeatureDefinition = {\n description: \"Installs warlock scheduler for scheduling tasks\",\n dependencies: {\n \"@warlock.js/scheduler\": INSTALLED_WARLOCK_VERSION,\n },\n};\n"],"mappings":";;;AAEA,MAAa,mBAAsC;CACjD,aAAa;CACb,cAAc,EACZ,yBAAyB,0BAC3B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ses.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ses.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\
|
|
1
|
+
{"version":3,"file":"ses.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/ses.feature.ts"],"sourcesContent":["import type { FeatureDefinition } from \"./types\";\n\nexport const sesFeature: FeatureDefinition = {\n description: \"Installs AWS SES SDK for sending emails via Amazon SES\",\n dependencies: {\n \"@aws-sdk/client-sesv2\": \"^3.1025.0\",\n },\n};\n"],"mappings":";AAEA,MAAa,aAAgC;CAC3C,aAAa;CACb,cAAc,EACZ,yBAAyB,YAC3B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/socket.feature.ts"],"sourcesContent":["import { socketConfigStub } from \"../stubs\";\
|
|
1
|
+
{"version":3,"file":"socket.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/socket.feature.ts"],"sourcesContent":["import { socketConfigStub } from \"../stubs\";\nimport type { FeatureDefinition } from \"./types\";\n\nexport const socketFeature: FeatureDefinition = {\n description: \"Installs socket.io for the realtime socket server (Socket Connector)\",\n dependencies: {\n \"socket.io\": \"^4.8.3\",\n },\n ejectConfig: {\n content: socketConfigStub,\n name: \"socket\",\n },\n};\n"],"mappings":";;;AAGA,MAAa,gBAAmC;CAC9C,aAAa;CACb,cAAc,EACZ,aAAa,SACf;CACA,aAAa;EACX,SAAS;EACT,MAAM;CACR;AACF"}
|
|
@@ -35,18 +35,22 @@ export async function teardown() {
|
|
|
35
35
|
* registry with it, so this pair boots and closes the test runtime once per
|
|
36
36
|
* test file.
|
|
37
37
|
*
|
|
38
|
-
* setupTest()
|
|
38
|
+
* setupTest() gets no connectors option on purpose: an explicit connectors
|
|
39
39
|
* value outranks tests.connectors from src/config/tests.ts, so passing one
|
|
40
40
|
* here would erase your project config. Omitting it leaves the config in
|
|
41
41
|
* charge.
|
|
42
42
|
*
|
|
43
|
+
* importModule makes Warlock load your app modules (config, routes, ...)
|
|
44
|
+
* through THIS file's import(), which Vitest handles. Tests and the framework
|
|
45
|
+
* then share one copy of every class, so "owner instanceof User" works.
|
|
46
|
+
*
|
|
43
47
|
* afterAll(teardownTest) is the other half of the pair: whoever calls
|
|
44
48
|
* setupTest() owns closing it in the same runtime context.
|
|
45
49
|
*/
|
|
46
50
|
import { setupTest, teardownTest } from "@warlock.js/core/tests";
|
|
47
51
|
import { afterAll } from "vitest";
|
|
48
52
|
|
|
49
|
-
await setupTest();
|
|
53
|
+
await setupTest({ importModule: (file) => import(file) });
|
|
50
54
|
|
|
51
55
|
afterAll(teardownTest);
|
|
52
56
|
`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/test.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\
|
|
1
|
+
{"version":3,"file":"test.feature.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/test.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { fileExistsAsync, putFileAsync } from \"@warlock.js/fs\";\nimport type { CommandActionData } from \"../../commands/types\";\nimport { rootPath, srcPath } from \"../../utils\";\nimport type { FeatureDefinition } from \"./types\";\nimport { VITE_RANGE } from \"./web.feature\";\n\nasync function completeTestInstallation(options: CommandActionData) {\n // Create test-global-setup.ts (runs once before all tests)\n const testGlobalSetupPath = srcPath(\"test-global-setup.ts\");\n const testGlobalSetupExists = await fileExistsAsync(testGlobalSetupPath);\n\n if (!testGlobalSetupExists) {\n await putFileAsync(\n testGlobalSetupPath,\n `/**\n * Global Test Setup\n *\n * Runs ONCE before all test workers.\n * Starts the HTTP server for integration tests.\n */\nimport { startHttpTestServer, stopHttpTestServer } from \"@warlock.js/core/tests\";\n\nexport async function setup() {\n await startHttpTestServer();\n}\n\nexport async function teardown() {\n await stopHttpTestServer();\n}\n`,\n );\n console.log(`${colors.green(\"✓\")} Created src/test-global-setup.ts`);\n }\n\n // Create test-setup.ts (runs before EVERY test file)\n const testSetupPath = srcPath(\"test-setup.ts\");\n const testSetupExists = await fileExistsAsync(testSetupPath);\n\n if (!testSetupExists) {\n await putFileAsync(\n testSetupPath,\n `/**\n * Test Setup - runs before EVERY test file\n *\n * Vitest runs setupFiles before each test file and rebuilds the module\n * registry with it, so this pair boots and closes the test runtime once per\n * test file.\n *\n * setupTest() gets no connectors option on purpose: an explicit connectors\n * value outranks tests.connectors from src/config/tests.ts, so passing one\n * here would erase your project config. Omitting it leaves the config in\n * charge.\n *\n * importModule makes Warlock load your app modules (config, routes, ...)\n * through THIS file's import(), which Vitest handles. Tests and the framework\n * then share one copy of every class, so \"owner instanceof User\" works.\n *\n * afterAll(teardownTest) is the other half of the pair: whoever calls\n * setupTest() owns closing it in the same runtime context.\n */\nimport { setupTest, teardownTest } from \"@warlock.js/core/tests\";\nimport { afterAll } from \"vitest\";\n\nawait setupTest({ importModule: (file) => import(file) });\n\nafterAll(teardownTest);\n`,\n );\n console.log(`${colors.green(\"✓\")} Created src/test-setup.ts`);\n }\n\n // Create vite.config.ts\n const viteConfigPath = rootPath(\"vite.config.ts\");\n const viteConfigExists = await fileExistsAsync(viteConfigPath);\n\n if (!viteConfigExists) {\n await putFileAsync(\n viteConfigPath,\n `import { lowerStage3Decorators } from \"@warlock.js/core/vite\";\nimport mongezVite from \"@mongez/vite\";\nimport { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n // lowerStage3Decorators MUST come first: it lowers native (@RegisterModel, …)\n // decorators with esbuild before oxc / the SSR rewrite can mangle them, so\n // decorated Cascade models load under Vitest.\n plugins: [lowerStage3Decorators(), mongezVite()],\n test: {\n globalSetup: \"./src/test-global-setup.ts\", // HTTP server - runs once\n setupFiles: [\"./src/test-setup.ts\"], // DB/cache - runs per test file\n environment: \"node\",\n globals: false,\n include: [\"src/app/**/*.test.ts\"],\n },\n});\n`,\n );\n console.log(`${colors.green(\"✓\")} Created vite.config.ts`);\n }\n}\n\nexport const testFeature: FeatureDefinition = {\n description: \"Installs warlock test for testing\",\n onExecuting: completeTestInstallation,\n script: {\n test: \"vitest run\",\n \"test:coverage\": \"vitest run --coverage\",\n \"test:ui\": \"vitest --ui\",\n \"test:watch\": \"vitest --watch\",\n },\n devDependencies: {\n \"@mongez/vite\": \"^2.0.4\",\n vite: VITE_RANGE,\n vitest: \"^4.1.8\",\n \"@vitest/coverage-v8\": \"^4.1.8\",\n },\n};\n"],"mappings":";;;;;;;AAOA,eAAe,yBAAyB,SAA4B;CAElE,MAAM,sBAAsB,QAAQ,sBAAsB;CAG1D,IAAI,CAAC,MAF+B,gBAAgB,mBAAmB,GAE3C;EAC1B,MAAM,aACJ,qBACA;;;;;;;;;;;;;;;CAgBF;EACA,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,kCAAkC;CACrE;CAGA,MAAM,gBAAgB,QAAQ,eAAe;CAG7C,IAAI,CAAC,MAFyB,gBAAgB,aAAa,GAErC;EACpB,MAAM,aACJ,eACA;;;;;;;;;;;;;;;;;;;;;;;;;CA0BF;EACA,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,2BAA2B;CAC9D;CAGA,MAAM,iBAAiB,SAAS,gBAAgB;CAGhD,IAAI,CAAC,MAF0B,gBAAgB,cAAc,GAEtC;EACrB,MAAM,aACJ,gBACA;;;;;;;;;;;;;;;;;CAkBF;EACA,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,wBAAwB;CAC3D;AACF;AAEA,MAAa,cAAiC;CAC5C,aAAa;CACb,aAAa;CACb,QAAQ;EACN,MAAM;EACN,iBAAiB;EACjB,WAAW;EACX,cAAc;CAChB;CACA,iBAAiB;EACf,gBAAgB;EAChB,MAAM;EACN,QAAQ;EACR,uBAAuB;CACzB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/types.ts"],"sourcesContent":["import type { CommandActionData } from \"../../commands/types\";\
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../../../../../../../../core/src/generations/features/types.ts"],"sourcesContent":["import type { CommandActionData } from \"../../commands/types\";\n\n/**\n * Internal placeholder for an @warlock.js dependency whose concrete version\n * comes from the installed Core package at command execution time.\n *\n * This is deliberately not a valid package-manager range. If a future code\n * path forgets to resolve it, installation fails loudly instead of silently\n * falling back to a stale framework major copied into a feature definition.\n */\nexport const INSTALLED_WARLOCK_VERSION = \"__INSTALLED_WARLOCK_VERSION__\";\n\n/**\n * One entry in the feature registry.\n *\n * Every feature owns a module of its own that exports a single value of this\n * shape, with its `onExecuting` body beside it; `features/index.ts` is only the\n * ordered index that collects them.\n */\nexport type FeatureDefinition = {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n description: string;\n requires?: string[];\n script?: Record<string, string>;\n onExecuting?: (options: CommandActionData) => Promise<any>;\n ejectConfig?: {\n content: string;\n name: string;\n };\n};\n"],"mappings":";;;;;;;;;AAUA,MAAa,4BAA4B"}
|