@warlock.js/core 4.2.1 → 4.2.2
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/esm/_virtual/_rolldown/runtime.mjs +7 -0
- package/esm/cli/cli-commands.manager.mjs +290 -0
- package/esm/cli/cli-commands.manager.mjs.map +1 -0
- package/esm/cli/cli-commands.utils.mjs +217 -0
- package/esm/cli/cli-commands.utils.mjs.map +1 -0
- package/esm/cli/commands/add.command.mjs +27 -0
- package/esm/cli/commands/add.command.mjs.map +1 -0
- package/esm/cli/commands/build.command.mjs +14 -0
- package/esm/cli/commands/build.command.mjs.map +1 -0
- package/esm/cli/commands/create-database.command.mjs +24 -0
- package/esm/cli/commands/create-database.command.mjs.map +1 -0
- package/esm/cli/commands/dev-server.command.mjs +48 -0
- package/esm/cli/commands/dev-server.command.mjs.map +1 -0
- package/esm/cli/commands/drop-tables.command.mjs +23 -0
- package/esm/cli/commands/drop-tables.command.mjs.map +1 -0
- package/esm/cli/commands/generate/generate.command.mjs +201 -0
- package/esm/cli/commands/generate/generate.command.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/column-dsl-parser.mjs +49 -0
- package/esm/cli/commands/generate/generators/column-dsl-parser.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/controller.generator.mjs +48 -0
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/migration.generator.mjs +81 -0
- package/esm/cli/commands/generate/generators/migration.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/model.generator.mjs +60 -0
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/module.generator.mjs +113 -0
- package/esm/cli/commands/generate/generators/module.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/repository.generator.mjs +42 -0
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/resource.generator.mjs +42 -0
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/service.generator.mjs +42 -0
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/templates/stubs.mjs +514 -0
- package/esm/cli/commands/generate/templates/stubs.mjs.map +1 -0
- package/esm/cli/commands/generate/utils/name-parser.mjs +69 -0
- package/esm/cli/commands/generate/utils/name-parser.mjs.map +1 -0
- package/esm/cli/commands/generate/utils/path-resolver.mjs +56 -0
- package/esm/cli/commands/generate/utils/path-resolver.mjs.map +1 -0
- package/esm/cli/commands/generate/utils/prompt.mjs +28 -0
- package/esm/cli/commands/generate/utils/prompt.mjs.map +1 -0
- package/esm/cli/commands/generate/utils/writer.mjs +60 -0
- package/esm/cli/commands/generate/utils/writer.mjs.map +1 -0
- package/esm/cli/commands/migrate.command.mjs +60 -0
- package/esm/cli/commands/migrate.command.mjs.map +1 -0
- package/esm/cli/commands/seed.command.mjs +41 -0
- package/esm/cli/commands/seed.command.mjs.map +1 -0
- package/esm/cli/commands/start-production.command.mjs +50 -0
- package/esm/cli/commands/start-production.command.mjs.map +1 -0
- package/esm/cli/commands/storage-put.action.mjs +75 -0
- package/esm/cli/commands/storage-put.action.mjs.map +1 -0
- package/esm/cli/commands/storage-put.command.mjs +46 -0
- package/esm/cli/commands/storage-put.command.mjs.map +1 -0
- package/esm/cli/commands/typings-generator.command.mjs +38 -0
- package/esm/cli/commands/typings-generator.command.mjs.map +1 -0
- package/esm/cli/commands-loader.mjs +50 -0
- package/esm/cli/commands-loader.mjs.map +1 -0
- package/esm/cli/framework-cli-commands.mjs +37 -0
- package/esm/cli/framework-cli-commands.mjs.map +1 -0
- package/esm/cli/parse-cli-args.mjs +62 -0
- package/esm/cli/parse-cli-args.mjs.map +1 -0
- package/esm/cli/start.d.mts +1 -0
- package/esm/cli/start.mjs +8 -0
- package/esm/cli/start.mjs.map +1 -0
- package/esm/cli/string-similarity.mjs +56 -0
- package/esm/cli/string-similarity.mjs.map +1 -0
- package/esm/database/create-database-action.mjs +32 -0
- package/esm/database/create-database-action.mjs.map +1 -0
- package/esm/database/drop-tables-action.mjs +35 -0
- package/esm/database/drop-tables-action.mjs.map +1 -0
- package/esm/database/migrate-action.mjs +99 -0
- package/esm/database/migrate-action.mjs.map +1 -0
- package/esm/database/seed-command-action.mjs +74 -0
- package/esm/database/seed-command-action.mjs.map +1 -0
- package/esm/database/seeds/seeders.manager.mjs +129 -0
- package/esm/database/seeds/seeders.manager.mjs.map +1 -0
- package/esm/database/seeds/seeds-table-migration.mjs +31 -0
- package/esm/database/seeds/seeds-table-migration.mjs.map +1 -0
- package/esm/database/seeds/utils.mjs +6 -0
- package/esm/database/seeds/utils.mjs.map +1 -0
- package/esm/dev-server/dev-logger.mjs +12 -1
- package/esm/dev-server/dev-logger.mjs.map +1 -1
- package/esm/dev-server/development-server.mjs +115 -0
- package/esm/dev-server/development-server.mjs.map +1 -0
- package/esm/dev-server/layer-executor.mjs +114 -0
- package/esm/dev-server/layer-executor.mjs.map +1 -0
- package/esm/dev-server/start-development-server.mjs +63 -0
- package/esm/dev-server/start-development-server.mjs.map +1 -0
- package/esm/dev-server/type-generator.mjs +453 -0
- package/esm/dev-server/type-generator.mjs.map +1 -0
- package/esm/generations/add-command.action.mjs +480 -0
- package/esm/generations/add-command.action.mjs.map +1 -0
- package/esm/generations/stubs.mjs +436 -0
- package/esm/generations/stubs.mjs.map +1 -0
- package/esm/manifest/manifest-manager.mjs +79 -0
- package/esm/manifest/manifest-manager.mjs.map +1 -0
- package/esm/production/build-app-production.mjs +14 -0
- package/esm/production/build-app-production.mjs.map +1 -0
- package/esm/production/esbuild-plugins.mjs +37 -0
- package/esm/production/esbuild-plugins.mjs.map +1 -0
- package/esm/production/production-builder.mjs +264 -0
- package/esm/production/production-builder.mjs.map +1 -0
- package/esm/production/resolve-build-config.mjs +28 -0
- package/esm/production/resolve-build-config.mjs.map +1 -0
- package/esm/utils/framework-vesion.mjs +10 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/package.json +15 -9
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { appPath } from "../../../../utils/paths.mjs";
|
|
2
|
+
import "../../../../utils/index.mjs";
|
|
3
|
+
import { ensureDirectoryAsync as ensureDirectoryAsync$1 } from "./writer.mjs";
|
|
4
|
+
import { directoryExistsAsync, fileExistsAsync } from "@warlock.js/fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
|
|
7
|
+
//#region ../@warlock.js/core/src/cli/commands/generate/utils/path-resolver.ts
|
|
8
|
+
/**
|
|
9
|
+
* Resolve module path
|
|
10
|
+
* Returns absolute path to module directory
|
|
11
|
+
*/
|
|
12
|
+
function resolveModulePath(module) {
|
|
13
|
+
return appPath(module);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Resolve component path within a module
|
|
17
|
+
* @param module - Module name (e.g., "users")
|
|
18
|
+
* @param type - Component type (e.g., "controllers", "services")
|
|
19
|
+
* @param name - Component name (e.g., "create-user")
|
|
20
|
+
* @param extension - File extension (default: ".ts")
|
|
21
|
+
*/
|
|
22
|
+
function resolveComponentPath(module, type, name, extension = ".ts") {
|
|
23
|
+
return path.join(resolveModulePath(module), type, `${name}${extension}`);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if module exists
|
|
27
|
+
*
|
|
28
|
+
* A module is a DIRECTORY under the app path, so this uses
|
|
29
|
+
* `directoryExistsAsync` — `fileExistsAsync` would resolve `false` for a folder
|
|
30
|
+
* and wrongly gate every module-scoped generator behind "module does not exist".
|
|
31
|
+
*/
|
|
32
|
+
async function moduleExists(module) {
|
|
33
|
+
return await directoryExistsAsync(resolveModulePath(module));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if file exists
|
|
37
|
+
*/
|
|
38
|
+
async function componentExists(module, type, name, extension = ".ts") {
|
|
39
|
+
return await fileExistsAsync(resolveComponentPath(module, type, name, extension));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Ensure directory exists, create if missing
|
|
43
|
+
*/
|
|
44
|
+
async function ensureDirectory(dirPath) {
|
|
45
|
+
await ensureDirectoryAsync$1(dirPath);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Ensure component directory exists
|
|
49
|
+
*/
|
|
50
|
+
async function ensureComponentDirectory(module, type) {
|
|
51
|
+
await ensureDirectory(path.join(resolveModulePath(module), type));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { componentExists, ensureComponentDirectory, moduleExists, resolveComponentPath, resolveModulePath };
|
|
56
|
+
//# sourceMappingURL=path-resolver.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-resolver.mjs","names":["ensureDirectoryAsync"],"sources":["../../../../../../../../../../@warlock.js/core/src/cli/commands/generate/utils/path-resolver.ts"],"sourcesContent":["import { directoryExistsAsync, fileExistsAsync } from \"@warlock.js/fs\";\r\nimport path from \"node:path\";\r\nimport { appPath } from \"../../../../utils\";\r\nimport { ensureDirectoryAsync } from \"./writer\";\r\n\r\n/**\r\n * Resolve module path\r\n * Returns absolute path to module directory\r\n */\r\nexport function resolveModulePath(module: string): string {\r\n return appPath(module);\r\n}\r\n\r\n/**\r\n * Resolve component path within a module\r\n * @param module - Module name (e.g., \"users\")\r\n * @param type - Component type (e.g., \"controllers\", \"services\")\r\n * @param name - Component name (e.g., \"create-user\")\r\n * @param extension - File extension (default: \".ts\")\r\n */\r\nexport function resolveComponentPath(\r\n module: string,\r\n type: string,\r\n name: string,\r\n extension = \".ts\",\r\n): string {\r\n return path.join(resolveModulePath(module), type, `${name}${extension}`);\r\n}\r\n\r\n/**\r\n * Check if module exists\r\n *\r\n * A module is a DIRECTORY under the app path, so this uses\r\n * `directoryExistsAsync` — `fileExistsAsync` would resolve `false` for a folder\r\n * and wrongly gate every module-scoped generator behind \"module does not exist\".\r\n */\r\nexport async function moduleExists(module: string): Promise<boolean> {\r\n return await directoryExistsAsync(resolveModulePath(module));\r\n}\r\n\r\n/**\r\n * Check if file exists\r\n */\r\nexport async function componentExists(\r\n module: string,\r\n type: string,\r\n name: string,\r\n extension = \".ts\",\r\n): Promise<boolean> {\r\n return (await fileExistsAsync(resolveComponentPath(module, type, name, extension))) as boolean;\r\n}\r\n\r\n/**\r\n * Ensure directory exists, create if missing\r\n */\r\nexport async function ensureDirectory(dirPath: string): Promise<void> {\r\n await ensureDirectoryAsync(dirPath);\r\n}\r\n\r\n/**\r\n * Ensure component directory exists\r\n */\r\nexport async function ensureComponentDirectory(module: string, type: string): Promise<void> {\r\n const dirPath = path.join(resolveModulePath(module), type);\r\n await ensureDirectory(dirPath);\r\n}\r\n"],"mappings":";;;;;;;;;;;AASA,SAAgB,kBAAkB,QAAwB;CACxD,OAAO,QAAQ,MAAM;AACvB;;;;;;;;AASA,SAAgB,qBACd,QACA,MACA,MACA,YAAY,OACJ;CACR,OAAO,KAAK,KAAK,kBAAkB,MAAM,GAAG,MAAM,GAAG,OAAO,WAAW;AACzE;;;;;;;;AASA,eAAsB,aAAa,QAAkC;CACnE,OAAO,MAAM,qBAAqB,kBAAkB,MAAM,CAAC;AAC7D;;;;AAKA,eAAsB,gBACpB,QACA,MACA,MACA,YAAY,OACM;CAClB,OAAQ,MAAM,gBAAgB,qBAAqB,QAAQ,MAAM,MAAM,SAAS,CAAC;AACnF;;;;AAKA,eAAsB,gBAAgB,SAAgC;CACpE,MAAMA,uBAAqB,OAAO;AACpC;;;;AAKA,eAAsB,yBAAyB,QAAgB,MAA6B;CAE1F,MAAM,gBADU,KAAK,KAAK,kBAAkB,MAAM,GAAG,IACzB,CAAC;AAC/B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import readline from "node:readline";
|
|
2
|
+
|
|
3
|
+
//#region ../@warlock.js/core/src/cli/commands/generate/utils/prompt.ts
|
|
4
|
+
/**
|
|
5
|
+
* Prompt user for confirmation
|
|
6
|
+
*/
|
|
7
|
+
async function confirm(message, defaultValue = false) {
|
|
8
|
+
const rl = readline.createInterface({
|
|
9
|
+
input: process.stdin,
|
|
10
|
+
output: process.stdout
|
|
11
|
+
});
|
|
12
|
+
return new Promise((resolve) => {
|
|
13
|
+
const defaultText = defaultValue ? "Y/n" : "y/N";
|
|
14
|
+
rl.question(`${message} (${defaultText}): `, (answer) => {
|
|
15
|
+
rl.close();
|
|
16
|
+
if (!answer.trim()) {
|
|
17
|
+
resolve(defaultValue);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const normalized = answer.toLowerCase().trim();
|
|
21
|
+
resolve(normalized === "y" || normalized === "yes");
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { confirm };
|
|
28
|
+
//# sourceMappingURL=prompt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.mjs","names":[],"sources":["../../../../../../../../../../@warlock.js/core/src/cli/commands/generate/utils/prompt.ts"],"sourcesContent":["import readline from \"node:readline\";\n\n/**\n * Prompt user for confirmation\n */\nexport async function confirm(message: string, defaultValue = false): Promise<boolean> {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n return new Promise((resolve) => {\n const defaultText = defaultValue ? \"Y/n\" : \"y/N\";\n rl.question(`${message} (${defaultText}): `, (answer) => {\n rl.close();\n\n if (!answer.trim()) {\n resolve(defaultValue);\n return;\n }\n\n const normalized = answer.toLowerCase().trim();\n resolve(normalized === \"y\" || normalized === \"yes\");\n });\n });\n}\n\n/**\n * Prompt user for text input\n */\nexport async function input(message: string, defaultValue?: string): Promise<string> {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n return new Promise((resolve) => {\n const prompt = defaultValue ? `${message} (${defaultValue}): ` : `${message}: `;\n\n rl.question(prompt, (answer) => {\n rl.close();\n resolve(answer.trim() || defaultValue || \"\");\n });\n });\n}\n\n/**\n * Prompt user to select from choices\n */\nexport async function select(message: string, choices: string[]): Promise<string> {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n return new Promise((resolve) => {\n console.log(message);\n choices.forEach((choice, index) => {\n console.log(` ${index + 1}. ${choice}`);\n });\n\n rl.question(\"Select (1-\" + choices.length + \"): \", (answer) => {\n rl.close();\n\n const index = parseInt(answer.trim(), 10) - 1;\n\n if (index >= 0 && index < choices.length) {\n resolve(choices[index]);\n } else {\n resolve(choices[0]);\n }\n });\n });\n}\n"],"mappings":";;;;;;AAKA,eAAsB,QAAQ,SAAiB,eAAe,OAAyB;CACrF,MAAM,KAAK,SAAS,gBAAgB;EAClC,OAAO,QAAQ;EACf,QAAQ,QAAQ;CAClB,CAAC;CAED,OAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,cAAc,eAAe,QAAQ;EAC3C,GAAG,SAAS,GAAG,QAAQ,IAAI,YAAY,OAAO,WAAW;GACvD,GAAG,MAAM;GAET,IAAI,CAAC,OAAO,KAAK,GAAG;IAClB,QAAQ,YAAY;IACpB;GACF;GAEA,MAAM,aAAa,OAAO,YAAY,CAAC,CAAC,KAAK;GAC7C,QAAQ,eAAe,OAAO,eAAe,KAAK;EACpD,CAAC;CACH,CAAC;AACH"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { colors } from "@mongez/copper";
|
|
2
|
+
import { ensureDirectoryAsync, putFileAsync } from "@warlock.js/fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
//#region ../@warlock.js/core/src/cli/commands/generate/utils/writer.ts
|
|
6
|
+
/**
|
|
7
|
+
* Dry-run state for the `generate.*` command family.
|
|
8
|
+
*
|
|
9
|
+
* When enabled (via `--dry-run`), every generator write becomes a no-op
|
|
10
|
+
* that instead reports the file it *would* have created — letting a
|
|
11
|
+
* developer preview a scaffold (especially `generate.module --crud`,
|
|
12
|
+
* which writes ~25 files) before anything touches disk.
|
|
13
|
+
*
|
|
14
|
+
* The flag is process-wide module state: the CLI runs one command per
|
|
15
|
+
* process, and a top-level generator (e.g. `generateModule`) sets it
|
|
16
|
+
* once, so nested helpers (`createMigrationFile`, `ensureComponentDirectory`)
|
|
17
|
+
* inherit it without threading a parameter through every signature.
|
|
18
|
+
*/
|
|
19
|
+
let dryRun = false;
|
|
20
|
+
/**
|
|
21
|
+
* Toggle dry-run mode. Call once at the start of a generator action,
|
|
22
|
+
* e.g. `setDryRun(Boolean(data.options.dryRun))`.
|
|
23
|
+
*/
|
|
24
|
+
function setDryRun(value) {
|
|
25
|
+
dryRun = value;
|
|
26
|
+
if (value) console.log(colors.yellowBright("\n○ Dry run — previewing planned files. Nothing will be written.\n"));
|
|
27
|
+
}
|
|
28
|
+
/** Render an absolute path relative to the cwd for tidy logs. */
|
|
29
|
+
function relativePath(target) {
|
|
30
|
+
return path.relative(process.cwd(), target) || target;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Write a generated file — or, in dry-run, report what *would* be
|
|
34
|
+
* written. Owns the per-file log so call sites stay a single line.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* await putFileAsync(controllerPath, controllerContent);
|
|
38
|
+
* // normal: ✓ created src/app/users/controllers/create-user.controller.ts
|
|
39
|
+
* // dry-run: ○ would create src/app/users/controllers/create-user.controller.ts
|
|
40
|
+
*/
|
|
41
|
+
async function putFileAsync$1(target, content) {
|
|
42
|
+
if (dryRun) {
|
|
43
|
+
console.log(`${colors.cyan("○")} would create ${colors.gray(relativePath(target))}`);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
await putFileAsync(target, content);
|
|
47
|
+
console.log(`${colors.green("✓")} created ${colors.gray(relativePath(target))}`);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Ensure a directory exists. Silent no-op in dry-run so a preview never
|
|
51
|
+
* leaves empty folders behind.
|
|
52
|
+
*/
|
|
53
|
+
async function ensureDirectoryAsync$1(target) {
|
|
54
|
+
if (dryRun) return;
|
|
55
|
+
await ensureDirectoryAsync(target);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
export { ensureDirectoryAsync$1 as ensureDirectoryAsync, putFileAsync$1 as putFileAsync, setDryRun };
|
|
60
|
+
//# sourceMappingURL=writer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer.mjs","names":["putFileAsync","fsPutFileAsync","ensureDirectoryAsync","fsEnsureDirectoryAsync"],"sources":["../../../../../../../../../../@warlock.js/core/src/cli/commands/generate/utils/writer.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport {\n ensureDirectoryAsync as fsEnsureDirectoryAsync,\n putFileAsync as fsPutFileAsync,\n} from \"@warlock.js/fs\";\nimport path from \"node:path\";\n\n/**\n * Dry-run state for the `generate.*` command family.\n *\n * When enabled (via `--dry-run`), every generator write becomes a no-op\n * that instead reports the file it *would* have created — letting a\n * developer preview a scaffold (especially `generate.module --crud`,\n * which writes ~25 files) before anything touches disk.\n *\n * The flag is process-wide module state: the CLI runs one command per\n * process, and a top-level generator (e.g. `generateModule`) sets it\n * once, so nested helpers (`createMigrationFile`, `ensureComponentDirectory`)\n * inherit it without threading a parameter through every signature.\n */\nlet dryRun = false;\n\n/**\n * Toggle dry-run mode. Call once at the start of a generator action,\n * e.g. `setDryRun(Boolean(data.options.dryRun))`.\n */\nexport function setDryRun(value: boolean): void {\n dryRun = value;\n\n if (value) {\n console.log(\n colors.yellowBright(\"\\n○ Dry run — previewing planned files. Nothing will be written.\\n\"),\n );\n }\n}\n\nexport function isDryRun(): boolean {\n return dryRun;\n}\n\n/** Render an absolute path relative to the cwd for tidy logs. */\nfunction relativePath(target: string): string {\n return path.relative(process.cwd(), target) || target;\n}\n\n/**\n * Write a generated file — or, in dry-run, report what *would* be\n * written. Owns the per-file log so call sites stay a single line.\n *\n * @example\n * await putFileAsync(controllerPath, controllerContent);\n * // normal: ✓ created src/app/users/controllers/create-user.controller.ts\n * // dry-run: ○ would create src/app/users/controllers/create-user.controller.ts\n */\nexport async function putFileAsync(target: string, content: string): Promise<void> {\n if (dryRun) {\n console.log(`${colors.cyan(\"○\")} would create ${colors.gray(relativePath(target))}`);\n return;\n }\n\n await fsPutFileAsync(target, content);\n console.log(`${colors.green(\"✓\")} created ${colors.gray(relativePath(target))}`);\n}\n\n/**\n * Ensure a directory exists. Silent no-op in dry-run so a preview never\n * leaves empty folders behind.\n */\nexport async function ensureDirectoryAsync(target: string): Promise<void> {\n if (dryRun) return;\n\n await fsEnsureDirectoryAsync(target);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,IAAI,SAAS;;;;;AAMb,SAAgB,UAAU,OAAsB;CAC9C,SAAS;CAET,IAAI,OACF,QAAQ,IACN,OAAO,aAAa,oEAAoE,CAC1F;AAEJ;;AAOA,SAAS,aAAa,QAAwB;CAC5C,OAAO,KAAK,SAAS,QAAQ,IAAI,GAAG,MAAM,KAAK;AACjD;;;;;;;;;;AAWA,eAAsBA,eAAa,QAAgB,SAAgC;CACjF,IAAI,QAAQ;EACV,QAAQ,IAAI,GAAG,OAAO,KAAK,GAAG,EAAE,gBAAgB,OAAO,KAAK,aAAa,MAAM,CAAC,GAAG;EACnF;CACF;CAEA,MAAMC,aAAe,QAAQ,OAAO;CACpC,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,WAAW,OAAO,KAAK,aAAa,MAAM,CAAC,GAAG;AACjF;;;;;AAMA,eAAsBC,uBAAqB,QAA+B;CACxE,IAAI,QAAQ;CAEZ,MAAMC,qBAAuB,MAAM;AACrC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { command } from "../cli-command.mjs";
|
|
2
|
+
import { migrateAction } from "../../database/migrate-action.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../@warlock.js/core/src/cli/commands/migrate.command.ts
|
|
5
|
+
const migrateCommand = command({
|
|
6
|
+
action: migrateAction,
|
|
7
|
+
name: "migrate",
|
|
8
|
+
description: "Run database migrations",
|
|
9
|
+
preload: {
|
|
10
|
+
config: ["database", "log"],
|
|
11
|
+
env: true,
|
|
12
|
+
connectors: ["database", "logger"]
|
|
13
|
+
},
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
text: "--fresh, -f",
|
|
17
|
+
description: "Drop all tables and re-run migrations",
|
|
18
|
+
type: "boolean"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
text: "--rollback, -r",
|
|
22
|
+
description: "Rollback migrations, drop all tables",
|
|
23
|
+
type: "boolean"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
text: "--path, -p",
|
|
27
|
+
description: "Migration file path, if not provided, all migrations will be wroking",
|
|
28
|
+
type: "string"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
text: "--list, -l",
|
|
32
|
+
description: "List all executed migrations",
|
|
33
|
+
type: "boolean"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
text: "--all, -a",
|
|
37
|
+
description: "List all migrations files in the app",
|
|
38
|
+
type: "boolean"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
text: "--sql, -s",
|
|
42
|
+
description: "Export all migrations as phase-ordered SQL files instead of executing them",
|
|
43
|
+
type: "boolean"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
text: "--pending-only",
|
|
47
|
+
description: "When used with --sql, exports only pending migrations instead of all",
|
|
48
|
+
type: "boolean"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
text: "--compact, -c",
|
|
52
|
+
description: "When used with --sql, strips out generated comments and blank lines to reduce file size",
|
|
53
|
+
type: "boolean"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
export { migrateCommand };
|
|
60
|
+
//# sourceMappingURL=migrate.command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.command.mjs","names":[],"sources":["../../../../../../../../@warlock.js/core/src/cli/commands/migrate.command.ts"],"sourcesContent":["import { migrateAction } from \"../../database/migrate-action\";\nimport { command } from \"../cli-command\";\n\nexport const migrateCommand = command({\n action: migrateAction,\n name: \"migrate\",\n description: \"Run database migrations\",\n preload: {\n config: [\"database\", \"log\"],\n env: true,\n connectors: [\"database\", \"logger\"],\n },\n options: [\n {\n text: \"--fresh, -f\",\n description: \"Drop all tables and re-run migrations\",\n type: \"boolean\",\n },\n {\n text: \"--rollback, -r\",\n description: \"Rollback migrations, drop all tables\",\n type: \"boolean\",\n },\n {\n text: \"--path, -p\",\n description: \"Migration file path, if not provided, all migrations will be wroking\",\n type: \"string\",\n },\n {\n text: \"--list, -l\",\n description: \"List all executed migrations\",\n type: \"boolean\",\n },\n {\n text: \"--all, -a\",\n description: \"List all migrations files in the app\",\n type: \"boolean\",\n },\n {\n text: \"--sql, -s\",\n description: \"Export all migrations as phase-ordered SQL files instead of executing them\",\n type: \"boolean\",\n },\n {\n text: \"--pending-only\",\n description: \"When used with --sql, exports only pending migrations instead of all\",\n type: \"boolean\",\n },\n {\n text: \"--compact, -c\",\n description:\n \"When used with --sql, strips out generated comments and blank lines to reduce file size\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;AAGA,MAAa,iBAAiB,QAAQ;CACpC,QAAQ;CACR,MAAM;CACN,aAAa;CACb,SAAS;EACP,QAAQ,CAAC,YAAY,KAAK;EAC1B,KAAK;EACL,YAAY,CAAC,YAAY,QAAQ;CACnC;CACA,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { command } from "../cli-command.mjs";
|
|
2
|
+
import { seedCommandAction } from "../../database/seed-command-action.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../@warlock.js/core/src/cli/commands/seed.command.ts
|
|
5
|
+
const seedCommand = command({
|
|
6
|
+
action: seedCommandAction,
|
|
7
|
+
name: "seed",
|
|
8
|
+
description: "Run database seeds",
|
|
9
|
+
preload: {
|
|
10
|
+
config: true,
|
|
11
|
+
env: true,
|
|
12
|
+
bootstrap: true,
|
|
13
|
+
connectors: [
|
|
14
|
+
"database",
|
|
15
|
+
"cache",
|
|
16
|
+
"logger"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
options: [
|
|
20
|
+
{
|
|
21
|
+
text: "--fresh, -f",
|
|
22
|
+
description: "Drop all tables records and run seeds",
|
|
23
|
+
type: "boolean"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
text: "--list, -l",
|
|
27
|
+
description: "Display the seeds list in order without execution",
|
|
28
|
+
type: "boolean"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
text: "--transaction, -t",
|
|
32
|
+
description: "Run seeds in a transaction",
|
|
33
|
+
type: "boolean",
|
|
34
|
+
defaultValue: true
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { seedCommand };
|
|
41
|
+
//# sourceMappingURL=seed.command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.command.mjs","names":[],"sources":["../../../../../../../../@warlock.js/core/src/cli/commands/seed.command.ts"],"sourcesContent":["import { seedCommandAction } from \"../../database/seed-command-action\";\r\nimport { command } from \"../cli-command\";\r\n\r\nexport const seedCommand = command({\r\n action: seedCommandAction,\r\n name: \"seed\",\r\n description: \"Run database seeds\",\r\n preload: {\r\n config: true,\r\n env: true,\r\n bootstrap: true,\r\n connectors: [\"database\", \"cache\", \"logger\"],\r\n },\r\n options: [\r\n {\r\n text: \"--fresh, -f\",\r\n description: \"Drop all tables records and run seeds\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--list, -l\",\r\n description: \"Display the seeds list in order without execution\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--transaction, -t\",\r\n description: \"Run seeds in a transaction\",\r\n type: \"boolean\",\r\n defaultValue: true,\r\n },\r\n ],\r\n});\r\n"],"mappings":";;;;AAGA,MAAa,cAAc,QAAQ;CACjC,QAAQ;CACR,MAAM;CACN,aAAa;CACb,SAAS;EACP,QAAQ;EACR,KAAK;EACL,WAAW;EACX,YAAY;GAAC;GAAY;GAAS;EAAQ;CAC5C;CACA,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;GACN,cAAc;EAChB;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { command } from "../cli-command.mjs";
|
|
2
|
+
import { displayStartupBanner } from "../cli-commands.utils.mjs";
|
|
3
|
+
import { resolveBuildConfig } from "../../production/resolve-build-config.mjs";
|
|
4
|
+
import { spawn } from "child_process";
|
|
5
|
+
|
|
6
|
+
//#region ../@warlock.js/core/src/cli/commands/start-production.command.ts
|
|
7
|
+
const startProductionCommand = command({
|
|
8
|
+
name: "start",
|
|
9
|
+
description: "Start production server",
|
|
10
|
+
persistent: true,
|
|
11
|
+
preload: { warlockConfig: true },
|
|
12
|
+
preAction: async () => {
|
|
13
|
+
displayStartupBanner({ environment: "production" });
|
|
14
|
+
},
|
|
15
|
+
action: async () => {
|
|
16
|
+
const { entryPath, sourcemap } = resolveBuildConfig();
|
|
17
|
+
const nodeArgs = [];
|
|
18
|
+
if (sourcemap !== false) nodeArgs.push("--enable-source-maps");
|
|
19
|
+
nodeArgs.push(entryPath);
|
|
20
|
+
const startIndex = process.argv.findIndex((arg) => arg === "start");
|
|
21
|
+
if (startIndex !== -1 && startIndex < process.argv.length - 1) {
|
|
22
|
+
const extraArgs = process.argv.slice(startIndex + 1);
|
|
23
|
+
nodeArgs.push(...extraArgs);
|
|
24
|
+
}
|
|
25
|
+
console.log(`🚀 Starting production server...\n`);
|
|
26
|
+
const child = spawn("node", nodeArgs, {
|
|
27
|
+
stdio: "inherit",
|
|
28
|
+
cwd: process.cwd(),
|
|
29
|
+
env: process.env,
|
|
30
|
+
detached: false
|
|
31
|
+
});
|
|
32
|
+
let isShuttingDown = false;
|
|
33
|
+
const forwardSignal = (signal) => {
|
|
34
|
+
if (isShuttingDown) return;
|
|
35
|
+
isShuttingDown = true;
|
|
36
|
+
child.kill(signal);
|
|
37
|
+
};
|
|
38
|
+
process.on("SIGTERM", () => forwardSignal("SIGTERM"));
|
|
39
|
+
process.on("SIGINT", () => {
|
|
40
|
+
isShuttingDown = true;
|
|
41
|
+
});
|
|
42
|
+
child.on("exit", (code) => {
|
|
43
|
+
process.exit(code ?? 0);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { startProductionCommand };
|
|
50
|
+
//# sourceMappingURL=start-production.command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start-production.command.mjs","names":[],"sources":["../../../../../../../../@warlock.js/core/src/cli/commands/start-production.command.ts"],"sourcesContent":["import { spawn } from \"child_process\";\r\nimport { resolveBuildConfig } from \"../../production/resolve-build-config\";\r\nimport { command } from \"../cli-command\";\r\nimport { displayStartupBanner } from \"../cli-commands.utils\";\r\n\r\nexport const startProductionCommand = command({\r\n name: \"start\",\r\n description: \"Start production server\",\r\n persistent: true,\r\n preload: {\r\n warlockConfig: true,\r\n },\r\n preAction: async () => {\r\n displayStartupBanner({ environment: \"production\" });\r\n },\r\n action: async () => {\r\n const { entryPath, sourcemap } = resolveBuildConfig();\r\n\r\n // Build node args\r\n const nodeArgs: string[] = [];\r\n\r\n // Enable source maps if configured\r\n if (sourcemap !== false) {\r\n nodeArgs.push(\"--enable-source-maps\");\r\n }\r\n\r\n // Add entry file\r\n nodeArgs.push(entryPath);\r\n\r\n // Pass through any additional flags after \"start\" command\r\n // process.argv = [node, cli.ts, start, ...extra]\r\n const startIndex = process.argv.findIndex((arg) => arg === \"start\");\r\n if (startIndex !== -1 && startIndex < process.argv.length - 1) {\r\n const extraArgs = process.argv.slice(startIndex + 1);\r\n nodeArgs.push(...extraArgs);\r\n }\r\n\r\n console.log(`🚀 Starting production server...\\n`);\r\n\r\n // Spawn child process\r\n // On Windows, we need to be careful with signals - the console sends Ctrl+C\r\n // to all processes in the group, so we just need to not interfere\r\n const child = spawn(\"node\", nodeArgs, {\r\n stdio: \"inherit\",\r\n cwd: process.cwd(),\r\n env: process.env,\r\n // Important: keep child in same process group for proper signal handling\r\n detached: false,\r\n });\r\n\r\n // Track if we're shutting down to prevent double-exit\r\n let isShuttingDown = false;\r\n\r\n // Forward signals to child (needed for SIGTERM, helpful for explicit forwarding)\r\n const forwardSignal = (signal: NodeJS.Signals) => {\r\n if (isShuttingDown) return;\r\n isShuttingDown = true;\r\n\r\n // Send signal to child\r\n child.kill(signal);\r\n };\r\n\r\n // On SIGTERM, forward it (SIGTERM doesn't auto-propagate like SIGINT on Windows)\r\n process.on(\"SIGTERM\", () => forwardSignal(\"SIGTERM\"));\r\n\r\n // On SIGINT (Ctrl+C), mark as shutting down but let child handle it naturally\r\n // On Windows, Ctrl+C is sent to both processes, so child already gets it\r\n process.on(\"SIGINT\", () => {\r\n isShuttingDown = true;\r\n // Give child a chance to exit gracefully before we do anything\r\n });\r\n\r\n // Exit with child's exit code\r\n child.on(\"exit\", (code) => {\r\n process.exit(code ?? 0);\r\n });\r\n },\r\n});\r\n"],"mappings":";;;;;;AAKA,MAAa,yBAAyB,QAAQ;CAC5C,MAAM;CACN,aAAa;CACb,YAAY;CACZ,SAAS,EACP,eAAe,KACjB;CACA,WAAW,YAAY;EACrB,qBAAqB,EAAE,aAAa,aAAa,CAAC;CACpD;CACA,QAAQ,YAAY;EAClB,MAAM,EAAE,WAAW,cAAc,mBAAmB;EAGpD,MAAM,WAAqB,CAAC;EAG5B,IAAI,cAAc,OAChB,SAAS,KAAK,sBAAsB;EAItC,SAAS,KAAK,SAAS;EAIvB,MAAM,aAAa,QAAQ,KAAK,WAAW,QAAQ,QAAQ,OAAO;EAClE,IAAI,eAAe,MAAM,aAAa,QAAQ,KAAK,SAAS,GAAG;GAC7D,MAAM,YAAY,QAAQ,KAAK,MAAM,aAAa,CAAC;GACnD,SAAS,KAAK,GAAG,SAAS;EAC5B;EAEA,QAAQ,IAAI,oCAAoC;EAKhD,MAAM,QAAQ,MAAM,QAAQ,UAAU;GACpC,OAAO;GACP,KAAK,QAAQ,IAAI;GACjB,KAAK,QAAQ;GAEb,UAAU;EACZ,CAAC;EAGD,IAAI,iBAAiB;EAGrB,MAAM,iBAAiB,WAA2B;GAChD,IAAI,gBAAgB;GACpB,iBAAiB;GAGjB,MAAM,KAAK,MAAM;EACnB;EAGA,QAAQ,GAAG,iBAAiB,cAAc,SAAS,CAAC;EAIpD,QAAQ,GAAG,gBAAgB;GACzB,iBAAiB;EAEnB,CAAC;EAGD,MAAM,GAAG,SAAS,SAAS;GACzB,QAAQ,KAAK,QAAQ,CAAC;EACxB,CAAC;CACH;AACF,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { config } from "../../config/config-getter.mjs";
|
|
2
|
+
import "../../config/index.mjs";
|
|
3
|
+
import { storage } from "../../storage/storage.mjs";
|
|
4
|
+
import "../../storage/index.mjs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import fs from "fs/promises";
|
|
7
|
+
|
|
8
|
+
//#region ../@warlock.js/core/src/cli/commands/storage-put.action.ts
|
|
9
|
+
/**
|
|
10
|
+
* Action for `warlock storage.put <localPath> [destination] [--driver <name>] [--concurrency <n>]`
|
|
11
|
+
*
|
|
12
|
+
* Uploads a local file or directory into any configured storage driver.
|
|
13
|
+
* Auto-detects whether <localPath> is a file or directory and calls the
|
|
14
|
+
* appropriate storage method.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* # Upload entire uploads directory to R2 (root of bucket)
|
|
18
|
+
* warlock storage.put ./uploads --driver r2
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* # Upload to a specific destination prefix
|
|
22
|
+
* warlock storage.put ./uploads backups/2026 --driver r2
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* # Single file upload with custom concurrency
|
|
26
|
+
* warlock storage.put ./public/logo.png assets/logo.png --driver s3
|
|
27
|
+
*/
|
|
28
|
+
async function storagePutAction({ args, options }) {
|
|
29
|
+
const [localPath, destination = ""] = args;
|
|
30
|
+
if (!localPath) {
|
|
31
|
+
console.error("✖ Missing required argument: <localPath>");
|
|
32
|
+
console.error(" Usage: warlock storage.put <localPath> [destination] [--driver <name>]");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
const absolutePath = path.resolve(process.cwd(), localPath);
|
|
36
|
+
const driverName = options.driver;
|
|
37
|
+
const concurrency = options.concurrency ? Number(options.concurrency) : 5;
|
|
38
|
+
let stat;
|
|
39
|
+
try {
|
|
40
|
+
stat = await fs.stat(absolutePath);
|
|
41
|
+
} catch {
|
|
42
|
+
console.error(`✖ Path not found: ${absolutePath}`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
const store = driverName ? storage.use(driverName) : storage;
|
|
46
|
+
const driverLabel = driverName ?? config.get("storage.default");
|
|
47
|
+
console.log(`\n Driver : ${driverLabel}`);
|
|
48
|
+
console.log(` Source : ${absolutePath}`);
|
|
49
|
+
console.log(` Dest : ${destination || "(root)"}\n`);
|
|
50
|
+
if (stat.isDirectory()) {
|
|
51
|
+
const result = await store.putDirectory(absolutePath, destination, {
|
|
52
|
+
concurrency,
|
|
53
|
+
filter: (_, rel) => !path.basename(rel).startsWith("."),
|
|
54
|
+
onProgress: (done, total, file) => {
|
|
55
|
+
process.stdout.write(`\r Progress : ${done}/${total} ${file.path}`);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
process.stdout.write("\n");
|
|
59
|
+
console.log(`\n ✔ ${result.uploaded.length} file(s) uploaded`);
|
|
60
|
+
if (result.failed.length > 0) {
|
|
61
|
+
console.warn(`\n ⚠ ${result.failed.length} file(s) failed:`);
|
|
62
|
+
for (const { localPath: fp, error } of result.failed) console.warn(` - ${fp}: ${error.message}`);
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
const storagePath = destination || path.basename(absolutePath);
|
|
66
|
+
console.log(` Uploading : ${path.basename(absolutePath)} → ${storagePath}`);
|
|
67
|
+
const file = await store.put(absolutePath, storagePath);
|
|
68
|
+
console.log(`\n ✔ Uploaded: ${file.url}`);
|
|
69
|
+
}
|
|
70
|
+
console.log();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { storagePutAction };
|
|
75
|
+
//# sourceMappingURL=storage-put.action.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-put.action.mjs","names":[],"sources":["../../../../../../../../@warlock.js/core/src/cli/commands/storage-put.action.ts"],"sourcesContent":["import fs from \"fs/promises\";\nimport path from \"path\";\nimport { config } from \"../../config\";\nimport { storage } from \"../../storage\";\nimport type { CommandActionData } from \"../types\";\n\n/**\n * Action for `warlock storage.put <localPath> [destination] [--driver <name>] [--concurrency <n>]`\n *\n * Uploads a local file or directory into any configured storage driver.\n * Auto-detects whether <localPath> is a file or directory and calls the\n * appropriate storage method.\n *\n * @example\n * # Upload entire uploads directory to R2 (root of bucket)\n * warlock storage.put ./uploads --driver r2\n *\n * @example\n * # Upload to a specific destination prefix\n * warlock storage.put ./uploads backups/2026 --driver r2\n *\n * @example\n * # Single file upload with custom concurrency\n * warlock storage.put ./public/logo.png assets/logo.png --driver s3\n */\nexport async function storagePutAction({ args, options }: CommandActionData): Promise<void> {\n const [localPath, destination = \"\"] = args;\n\n if (!localPath) {\n console.error(\"✖ Missing required argument: <localPath>\");\n console.error(\" Usage: warlock storage.put <localPath> [destination] [--driver <name>]\");\n process.exit(1);\n }\n\n // Resolve to absolute path relative to CWD\n const absolutePath = path.resolve(process.cwd(), localPath);\n const driverName = options.driver as string | undefined;\n const concurrency = options.concurrency ? Number(options.concurrency) : 5;\n\n // Verify the local path exists\n let stat: Awaited<ReturnType<typeof fs.stat>>;\n try {\n stat = await fs.stat(absolutePath);\n } catch {\n console.error(`✖ Path not found: ${absolutePath}`);\n process.exit(1);\n }\n\n // Select the driver — use named driver or fall back to default\n const store = driverName ? storage.use(driverName) : storage;\n const driverLabel = driverName ?? config.get(\"storage.default\");\n\n console.log(`\\n Driver : ${driverLabel}`);\n console.log(` Source : ${absolutePath}`);\n console.log(` Dest : ${destination || \"(root)\"}\\n`);\n\n if (stat.isDirectory()) {\n // ── Directory upload ────────────────────────────────────────────────────\n const result = await store.putDirectory(absolutePath, destination, {\n concurrency,\n // Skip hidden files (e.g. .DS_Store) by default\n filter: (_, rel) => !path.basename(rel).startsWith(\".\"),\n onProgress: (done, total, file) => {\n process.stdout.write(`\\r Progress : ${done}/${total} ${file.path}`);\n },\n });\n\n // Clear the progress line and print summary\n process.stdout.write(\"\\n\");\n console.log(`\\n ✔ ${result.uploaded.length} file(s) uploaded`);\n\n if (result.failed.length > 0) {\n console.warn(`\\n ⚠ ${result.failed.length} file(s) failed:`);\n for (const { localPath: fp, error } of result.failed) {\n console.warn(` - ${fp}: ${error.message}`);\n }\n }\n } else {\n // ── Single file upload ──────────────────────────────────────────────────\n // Destination is used as the storage path; if empty, fall back to filename\n const storagePath = destination || path.basename(absolutePath);\n\n console.log(` Uploading : ${path.basename(absolutePath)} → ${storagePath}`);\n\n const file = await store.put(absolutePath, storagePath);\n\n console.log(`\\n ✔ Uploaded: ${file.url}`);\n }\n\n console.log();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,eAAsB,iBAAiB,EAAE,MAAM,WAA6C;CAC1F,MAAM,CAAC,WAAW,cAAc,MAAM;CAEtC,IAAI,CAAC,WAAW;EACd,QAAQ,MAAM,2CAA2C;EACzD,QAAQ,MAAM,2EAA2E;EACzF,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,eAAe,KAAK,QAAQ,QAAQ,IAAI,GAAG,SAAS;CAC1D,MAAM,aAAa,QAAQ;CAC3B,MAAM,cAAc,QAAQ,cAAc,OAAO,QAAQ,WAAW,IAAI;CAGxE,IAAI;CACJ,IAAI;EACF,OAAO,MAAM,GAAG,KAAK,YAAY;CACnC,QAAQ;EACN,QAAQ,MAAM,sBAAsB,cAAc;EAClD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,QAAQ,aAAa,QAAQ,IAAI,UAAU,IAAI;CACrD,MAAM,cAAc,cAAc,OAAO,IAAI,iBAAiB;CAE9D,QAAQ,IAAI,mBAAmB,aAAa;CAC5C,QAAQ,IAAI,iBAAiB,cAAc;CAC3C,QAAQ,IAAI,iBAAiB,eAAe,SAAS,GAAG;CAExD,IAAI,KAAK,YAAY,GAAG;EAEtB,MAAM,SAAS,MAAM,MAAM,aAAa,cAAc,aAAa;GACjE;GAEA,SAAS,GAAG,QAAQ,CAAC,KAAK,SAAS,GAAG,CAAC,CAAC,WAAW,GAAG;GACtD,aAAa,MAAM,OAAO,SAAS;IACjC,QAAQ,OAAO,MAAM,mBAAmB,KAAK,GAAG,MAAM,IAAI,KAAK,MAAM;GACvE;EACF,CAAC;EAGD,QAAQ,OAAO,MAAM,IAAI;EACzB,QAAQ,IAAI,UAAU,OAAO,SAAS,OAAO,kBAAkB;EAE/D,IAAI,OAAO,OAAO,SAAS,GAAG;GAC5B,QAAQ,KAAK,UAAU,OAAO,OAAO,OAAO,iBAAiB;GAC7D,KAAK,MAAM,EAAE,WAAW,IAAI,WAAW,OAAO,QAC5C,QAAQ,KAAK,UAAU,GAAG,IAAI,MAAM,SAAS;EAEjD;CACF,OAAO;EAGL,MAAM,cAAc,eAAe,KAAK,SAAS,YAAY;EAE7D,QAAQ,IAAI,iBAAiB,KAAK,SAAS,YAAY,EAAE,KAAK,aAAa;EAE3E,MAAM,OAAO,MAAM,MAAM,IAAI,cAAc,WAAW;EAEtD,QAAQ,IAAI,oBAAoB,KAAK,KAAK;CAC5C;CAEA,QAAQ,IAAI;AACd"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { command } from "../cli-command.mjs";
|
|
2
|
+
import { storagePutAction } from "./storage-put.action.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../@warlock.js/core/src/cli/commands/storage-put.command.ts
|
|
5
|
+
/**
|
|
6
|
+
* `storage.put` CLI command
|
|
7
|
+
*
|
|
8
|
+
* Uploads a local file or directory to any configured storage driver.
|
|
9
|
+
* Auto-detects file vs directory and streams each file (no full buffer in memory).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* # Upload full uploads/ directory to R2 (migrating from local to cloud)
|
|
13
|
+
* warlock storage.put ./uploads --driver r2
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* # Upload under a specific prefix
|
|
17
|
+
* warlock storage.put ./uploads backups/2026 --driver r2
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* # Single file upload to default driver
|
|
21
|
+
* warlock storage.put ./public/logo.png assets/logo.png
|
|
22
|
+
*/
|
|
23
|
+
const storagePutCommand = command({
|
|
24
|
+
name: "storage.put <localPath> [destination]",
|
|
25
|
+
alias: "sput",
|
|
26
|
+
action: storagePutAction,
|
|
27
|
+
description: "Upload a local file or directory to storage",
|
|
28
|
+
preload: {
|
|
29
|
+
env: true,
|
|
30
|
+
config: ["storage"],
|
|
31
|
+
connectors: ["storage"]
|
|
32
|
+
},
|
|
33
|
+
options: [{
|
|
34
|
+
text: "--driver, -d",
|
|
35
|
+
description: "Storage driver name (as defined in config). Defaults to the configured default driver."
|
|
36
|
+
}, {
|
|
37
|
+
text: "--concurrency, -c",
|
|
38
|
+
description: "Number of concurrent uploads when uploading a directory",
|
|
39
|
+
type: "number",
|
|
40
|
+
defaultValue: 5
|
|
41
|
+
}]
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { storagePutCommand };
|
|
46
|
+
//# sourceMappingURL=storage-put.command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-put.command.mjs","names":[],"sources":["../../../../../../../../@warlock.js/core/src/cli/commands/storage-put.command.ts"],"sourcesContent":["import { command } from \"../cli-command\";\nimport { storagePutAction } from \"./storage-put.action\";\n\n/**\n * `storage.put` CLI command\n *\n * Uploads a local file or directory to any configured storage driver.\n * Auto-detects file vs directory and streams each file (no full buffer in memory).\n *\n * @example\n * # Upload full uploads/ directory to R2 (migrating from local to cloud)\n * warlock storage.put ./uploads --driver r2\n *\n * @example\n * # Upload under a specific prefix\n * warlock storage.put ./uploads backups/2026 --driver r2\n *\n * @example\n * # Single file upload to default driver\n * warlock storage.put ./public/logo.png assets/logo.png\n */\nexport const storagePutCommand = command({\n name: \"storage.put <localPath> [destination]\",\n alias: \"sput\",\n action: storagePutAction,\n description: \"Upload a local file or directory to storage\",\n preload: {\n env: true,\n config: [\"storage\"],\n connectors: [\"storage\"],\n },\n options: [\n {\n text: \"--driver, -d\",\n description:\n \"Storage driver name (as defined in config). Defaults to the configured default driver.\",\n },\n {\n text: \"--concurrency, -c\",\n description: \"Number of concurrent uploads when uploading a directory\",\n type: \"number\",\n defaultValue: 5,\n },\n ],\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,oBAAoB,QAAQ;CACvC,MAAM;CACN,OAAO;CACP,QAAQ;CACR,aAAa;CACb,SAAS;EACP,KAAK;EACL,QAAQ,CAAC,SAAS;EAClB,YAAY,CAAC,SAAS;CACxB;CACA,SAAS,CACP;EACE,MAAM;EACN,aACE;CACJ,GACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;EACN,cAAc;CAChB,CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { srcPath } from "../../utils/paths.mjs";
|
|
2
|
+
import "../../utils/index.mjs";
|
|
3
|
+
import { command } from "../cli-command.mjs";
|
|
4
|
+
import { Path } from "../../dev-server/path.mjs";
|
|
5
|
+
import { getFilesFromDirectory } from "../../dev-server/utils.mjs";
|
|
6
|
+
import { filesOrchestrator } from "../../dev-server/files-orchestrator.mjs";
|
|
7
|
+
import { typeGenerator } from "../../dev-server/type-generator.mjs";
|
|
8
|
+
|
|
9
|
+
//#region ../@warlock.js/core/src/cli/commands/typings-generator.command.ts
|
|
10
|
+
const typingsGeneratorCommand = command({
|
|
11
|
+
name: "generate.typings",
|
|
12
|
+
description: "Generate type definitions for the project",
|
|
13
|
+
options: [{
|
|
14
|
+
text: "--files, -f",
|
|
15
|
+
description: "Files to generate typings for, if not passed, it will generate typings for all files"
|
|
16
|
+
}],
|
|
17
|
+
action: async ({ options }) => {
|
|
18
|
+
const configFilesPaths = [];
|
|
19
|
+
if (options.files) {
|
|
20
|
+
const files = String(options.files).split(",").map((file) => {
|
|
21
|
+
if (file.startsWith("./")) return Path.toAbsolute(file);
|
|
22
|
+
return file;
|
|
23
|
+
});
|
|
24
|
+
if (files?.length) configFilesPaths.push(...files);
|
|
25
|
+
}
|
|
26
|
+
if (configFilesPaths.length === 0) {
|
|
27
|
+
const configFiles = await getFilesFromDirectory(srcPath("config"));
|
|
28
|
+
configFilesPaths.push(...configFiles);
|
|
29
|
+
}
|
|
30
|
+
const failed = (await Promise.allSettled(configFilesPaths.map((path) => filesOrchestrator.add(Path.toRelative(path))))).filter((r) => r.status === "rejected");
|
|
31
|
+
if (failed.length) console.warn(`Failed to process ${failed.length} files`);
|
|
32
|
+
await typeGenerator.generateAll();
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { typingsGeneratorCommand };
|
|
38
|
+
//# sourceMappingURL=typings-generator.command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typings-generator.command.mjs","names":[],"sources":["../../../../../../../../@warlock.js/core/src/cli/commands/typings-generator.command.ts"],"sourcesContent":["import { filesOrchestrator } from \"../../dev-server/files-orchestrator\";\nimport { Path } from \"../../dev-server/path\";\nimport { typeGenerator } from \"../../dev-server/type-generator\";\nimport { getFilesFromDirectory } from \"../../dev-server/utils\";\nimport { srcPath } from \"../../utils\";\nimport { command } from \"../cli-command\";\n\nexport const typingsGeneratorCommand = command({\n name: \"generate.typings\",\n description: \"Generate type definitions for the project\",\n options: [\n {\n text: \"--files, -f\",\n description:\n \"Files to generate typings for, if not passed, it will generate typings for all files\",\n },\n ],\n action: async ({ options }) => {\n const configFilesPaths: string[] = [];\n if (options.files) {\n const files = String(options.files)\n .split(\",\")\n .map((file) => {\n if (file.startsWith(\"./\")) {\n return Path.toAbsolute(file);\n }\n\n return file;\n });\n\n if (files?.length) {\n configFilesPaths.push(...files);\n }\n }\n\n if (configFilesPaths.length === 0) {\n // grab all config files\n const configFiles = await getFilesFromDirectory(srcPath(\"config\"));\n configFilesPaths.push(...configFiles);\n }\n\n const results = await Promise.allSettled(\n configFilesPaths.map((path) => filesOrchestrator.add(Path.toRelative(path))),\n );\n\n const failed = results.filter((r) => r.status === \"rejected\");\n\n if (failed.length) {\n console.warn(`Failed to process ${failed.length} files`);\n }\n\n await typeGenerator.generateAll();\n },\n});\n"],"mappings":";;;;;;;;;AAOA,MAAa,0BAA0B,QAAQ;CAC7C,MAAM;CACN,aAAa;CACb,SAAS,CACP;EACE,MAAM;EACN,aACE;CACJ,CACF;CACA,QAAQ,OAAO,EAAE,cAAc;EAC7B,MAAM,mBAA6B,CAAC;EACpC,IAAI,QAAQ,OAAO;GACjB,MAAM,QAAQ,OAAO,QAAQ,KAAK,CAAC,CAChC,MAAM,GAAG,CAAC,CACV,KAAK,SAAS;IACb,IAAI,KAAK,WAAW,IAAI,GACtB,OAAO,KAAK,WAAW,IAAI;IAG7B,OAAO;GACT,CAAC;GAEH,IAAI,OAAO,QACT,iBAAiB,KAAK,GAAG,KAAK;EAElC;EAEA,IAAI,iBAAiB,WAAW,GAAG;GAEjC,MAAM,cAAc,MAAM,sBAAsB,QAAQ,QAAQ,CAAC;GACjE,iBAAiB,KAAK,GAAG,WAAW;EACtC;EAMA,MAAM,UAAS,MAJO,QAAQ,WAC5B,iBAAiB,KAAK,SAAS,kBAAkB,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,CAC7E,EAEsB,CAAC,QAAQ,MAAM,EAAE,WAAW,UAAU;EAE5D,IAAI,OAAO,QACT,QAAQ,KAAK,qBAAqB,OAAO,OAAO,OAAO;EAGzD,MAAM,cAAc,YAAY;CAClC;AACF,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { srcPath } from "../utils/paths.mjs";
|
|
2
|
+
import "../utils/index.mjs";
|
|
3
|
+
import { Path } from "../dev-server/path.mjs";
|
|
4
|
+
import { getFilesFromDirectory } from "../dev-server/utils.mjs";
|
|
5
|
+
import { filesOrchestrator } from "../dev-server/files-orchestrator.mjs";
|
|
6
|
+
import { isMatchingCommandName } from "./cli-commands.utils.mjs";
|
|
7
|
+
|
|
8
|
+
//#region ../@warlock.js/core/src/cli/commands-loader.ts
|
|
9
|
+
var CLICommandsLoader = class {
|
|
10
|
+
/**
|
|
11
|
+
* Locate command by name
|
|
12
|
+
*/
|
|
13
|
+
async locate(commandName) {
|
|
14
|
+
const relativeFiles = (await getFilesFromDirectory(srcPath("app"), "**/commands/*.{ts,tsx}")).map((path) => Path.toRelative(path));
|
|
15
|
+
for (const relativeFile of relativeFiles) {
|
|
16
|
+
const command = await this.load(relativeFile);
|
|
17
|
+
if (command) {
|
|
18
|
+
command.$relativePath(relativeFile);
|
|
19
|
+
if (isMatchingCommandName(command.name, commandName)) return command;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Scan all project commands and return them
|
|
25
|
+
* Used for warm cache functionality
|
|
26
|
+
*/
|
|
27
|
+
async scanAll() {
|
|
28
|
+
const relativeFiles = (await getFilesFromDirectory(srcPath("app"), "**/commands/*.{ts,tsx}")).map((path) => Path.toRelative(path));
|
|
29
|
+
const commands = [];
|
|
30
|
+
for (const relativeFile of relativeFiles) {
|
|
31
|
+
const command = await this.load(relativeFile);
|
|
32
|
+
if (command) {
|
|
33
|
+
command.$relativePath(relativeFile);
|
|
34
|
+
commands.push(command);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return commands;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Load command from a relative path
|
|
41
|
+
*/
|
|
42
|
+
async load(relativePath) {
|
|
43
|
+
return (await filesOrchestrator.load(relativePath))?.default;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const cliCommandsLoader = new CLICommandsLoader();
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { cliCommandsLoader };
|
|
50
|
+
//# sourceMappingURL=commands-loader.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands-loader.mjs","names":[],"sources":["../../../../../../../@warlock.js/core/src/cli/commands-loader.ts"],"sourcesContent":["import { filesOrchestrator } from \"../dev-server/files-orchestrator\";\nimport { Path } from \"../dev-server/path\";\nimport { getFilesFromDirectory } from \"../dev-server/utils\";\nimport { srcPath } from \"../utils\";\nimport { CLICommand } from \"./cli-command\";\nimport { isMatchingCommandName } from \"./cli-commands.utils\";\n\nexport class CLICommandsLoader {\n /**\n * Locate command by name\n */\n public async locate(commandName: string): Promise<CLICommand | undefined> {\n const files = await getFilesFromDirectory(srcPath(\"app\"), \"**/commands/*.{ts,tsx}\");\n // now convert them into relative paths\n const relativeFiles = files.map((path) => Path.toRelative(path));\n\n for (const relativeFile of relativeFiles) {\n const command = await this.load(relativeFile);\n if (command) {\n command.$relativePath(relativeFile);\n if (isMatchingCommandName(command.name, commandName)) {\n return command;\n }\n }\n }\n\n return;\n }\n\n /**\n * Scan all project commands and return them\n * Used for warm cache functionality\n */\n public async scanAll(): Promise<CLICommand[]> {\n const files = await getFilesFromDirectory(srcPath(\"app\"), \"**/commands/*.{ts,tsx}\");\n const relativeFiles = files.map((path) => Path.toRelative(path));\n const commands: CLICommand[] = [];\n\n for (const relativeFile of relativeFiles) {\n const command = await this.load(relativeFile);\n if (command) {\n command.$relativePath(relativeFile);\n commands.push(command);\n }\n }\n\n return commands;\n }\n\n /**\n * Load command from a relative path\n */\n public async load(relativePath: string): Promise<CLICommand | undefined> {\n const output = await filesOrchestrator.load<{ default: CLICommand }>(relativePath);\n\n return output?.default;\n }\n}\n\nexport const cliCommandsLoader = new CLICommandsLoader();\n"],"mappings":";;;;;;;;AAOA,IAAa,oBAAb,MAA+B;;;;CAI7B,MAAa,OAAO,aAAsD;EAGxE,MAAM,iBAAgB,MAFF,sBAAsB,QAAQ,KAAK,GAAG,wBAAwB,EAEvD,CAAC,KAAK,SAAS,KAAK,WAAW,IAAI,CAAC;EAE/D,KAAK,MAAM,gBAAgB,eAAe;GACxC,MAAM,UAAU,MAAM,KAAK,KAAK,YAAY;GAC5C,IAAI,SAAS;IACX,QAAQ,cAAc,YAAY;IAClC,IAAI,sBAAsB,QAAQ,MAAM,WAAW,GACjD,OAAO;GAEX;EACF;CAGF;;;;;CAMA,MAAa,UAAiC;EAE5C,MAAM,iBAAgB,MADF,sBAAsB,QAAQ,KAAK,GAAG,wBAAwB,EACvD,CAAC,KAAK,SAAS,KAAK,WAAW,IAAI,CAAC;EAC/D,MAAM,WAAyB,CAAC;EAEhC,KAAK,MAAM,gBAAgB,eAAe;GACxC,MAAM,UAAU,MAAM,KAAK,KAAK,YAAY;GAC5C,IAAI,SAAS;IACX,QAAQ,cAAc,YAAY;IAClC,SAAS,KAAK,OAAO;GACvB;EACF;EAEA,OAAO;CACT;;;;CAKA,MAAa,KAAK,cAAuD;EAGvE,QAAO,MAFc,kBAAkB,KAA8B,YAAY,EAEpE,EAAE;CACjB;AACF;AAEA,MAAa,oBAAoB,IAAI,kBAAkB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { addCommand } from "./commands/add.command.mjs";
|
|
2
|
+
import { buildCommand } from "./commands/build.command.mjs";
|
|
3
|
+
import { createDatabaseCommand } from "./commands/create-database.command.mjs";
|
|
4
|
+
import { devServerCommand } from "./commands/dev-server.command.mjs";
|
|
5
|
+
import { dropTablesCommand } from "./commands/drop-tables.command.mjs";
|
|
6
|
+
import { generateCommand, generateControllerCommand, generateMigrationCommand, generateModelCommand, generateModuleCommand, generateRepositoryCommand, generateResourceCommand, generateServiceCommand } from "./commands/generate/generate.command.mjs";
|
|
7
|
+
import { migrateCommand } from "./commands/migrate.command.mjs";
|
|
8
|
+
import { seedCommand } from "./commands/seed.command.mjs";
|
|
9
|
+
import { startProductionCommand } from "./commands/start-production.command.mjs";
|
|
10
|
+
import { storagePutCommand } from "./commands/storage-put.command.mjs";
|
|
11
|
+
import { typingsGeneratorCommand } from "./commands/typings-generator.command.mjs";
|
|
12
|
+
|
|
13
|
+
//#region ../@warlock.js/core/src/cli/framework-cli-commands.ts
|
|
14
|
+
const frameworkCommands = [
|
|
15
|
+
devServerCommand,
|
|
16
|
+
typingsGeneratorCommand,
|
|
17
|
+
buildCommand,
|
|
18
|
+
startProductionCommand,
|
|
19
|
+
migrateCommand,
|
|
20
|
+
seedCommand,
|
|
21
|
+
createDatabaseCommand,
|
|
22
|
+
dropTablesCommand,
|
|
23
|
+
addCommand,
|
|
24
|
+
generateCommand,
|
|
25
|
+
generateModuleCommand,
|
|
26
|
+
generateControllerCommand,
|
|
27
|
+
generateServiceCommand,
|
|
28
|
+
generateModelCommand,
|
|
29
|
+
generateRepositoryCommand,
|
|
30
|
+
generateResourceCommand,
|
|
31
|
+
generateMigrationCommand,
|
|
32
|
+
storagePutCommand
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { frameworkCommands };
|
|
37
|
+
//# sourceMappingURL=framework-cli-commands.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-cli-commands.mjs","names":[],"sources":["../../../../../../../@warlock.js/core/src/cli/framework-cli-commands.ts"],"sourcesContent":["import { addCommand } from \"./commands/add.command\";\r\nimport { buildCommand } from \"./commands/build.command\";\r\nimport { createDatabaseCommand } from \"./commands/create-database.command\";\r\nimport { devServerCommand } from \"./commands/dev-server.command\";\r\nimport { dropTablesCommand } from \"./commands/drop-tables.command\";\r\nimport {\r\n generateCommand,\r\n generateControllerCommand,\r\n generateMigrationCommand,\r\n generateModelCommand,\r\n generateModuleCommand,\r\n generateRepositoryCommand,\r\n generateResourceCommand,\r\n generateServiceCommand,\r\n} from \"./commands/generate/generate.command\";\r\nimport { migrateCommand } from \"./commands/migrate.command\";\r\nimport { seedCommand } from \"./commands/seed.command\";\r\nimport { startProductionCommand } from \"./commands/start-production.command\";\r\nimport { storagePutCommand } from \"./commands/storage-put.command\";\r\nimport { typingsGeneratorCommand } from \"./commands/typings-generator.command\";\r\n\r\nexport const frameworkCommands = [\r\n // development commands\r\n devServerCommand,\r\n typingsGeneratorCommand,\r\n\r\n // production commands\r\n buildCommand,\r\n startProductionCommand,\r\n\r\n // database commands\r\n migrateCommand,\r\n seedCommand,\r\n createDatabaseCommand,\r\n dropTablesCommand,\r\n\r\n // generation/installation commands\r\n addCommand,\r\n\r\n // scaffolding commands\r\n generateCommand,\r\n generateModuleCommand,\r\n generateControllerCommand,\r\n generateServiceCommand,\r\n generateModelCommand,\r\n generateRepositoryCommand,\r\n generateResourceCommand,\r\n generateMigrationCommand,\r\n\r\n // storage commands\r\n storagePutCommand,\r\n];\r\n"],"mappings":";;;;;;;;;;;;;AAqBA,MAAa,oBAAoB;CAE/B;CACA;CAGA;CACA;CAGA;CACA;CACA;CACA;CAGA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;AACF"}
|