@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.
Files changed (107) hide show
  1. package/esm/_virtual/_rolldown/runtime.mjs +7 -0
  2. package/esm/cli/cli-commands.manager.mjs +290 -0
  3. package/esm/cli/cli-commands.manager.mjs.map +1 -0
  4. package/esm/cli/cli-commands.utils.mjs +217 -0
  5. package/esm/cli/cli-commands.utils.mjs.map +1 -0
  6. package/esm/cli/commands/add.command.mjs +27 -0
  7. package/esm/cli/commands/add.command.mjs.map +1 -0
  8. package/esm/cli/commands/build.command.mjs +14 -0
  9. package/esm/cli/commands/build.command.mjs.map +1 -0
  10. package/esm/cli/commands/create-database.command.mjs +24 -0
  11. package/esm/cli/commands/create-database.command.mjs.map +1 -0
  12. package/esm/cli/commands/dev-server.command.mjs +48 -0
  13. package/esm/cli/commands/dev-server.command.mjs.map +1 -0
  14. package/esm/cli/commands/drop-tables.command.mjs +23 -0
  15. package/esm/cli/commands/drop-tables.command.mjs.map +1 -0
  16. package/esm/cli/commands/generate/generate.command.mjs +201 -0
  17. package/esm/cli/commands/generate/generate.command.mjs.map +1 -0
  18. package/esm/cli/commands/generate/generators/column-dsl-parser.mjs +49 -0
  19. package/esm/cli/commands/generate/generators/column-dsl-parser.mjs.map +1 -0
  20. package/esm/cli/commands/generate/generators/controller.generator.mjs +48 -0
  21. package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -0
  22. package/esm/cli/commands/generate/generators/migration.generator.mjs +81 -0
  23. package/esm/cli/commands/generate/generators/migration.generator.mjs.map +1 -0
  24. package/esm/cli/commands/generate/generators/model.generator.mjs +60 -0
  25. package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -0
  26. package/esm/cli/commands/generate/generators/module.generator.mjs +113 -0
  27. package/esm/cli/commands/generate/generators/module.generator.mjs.map +1 -0
  28. package/esm/cli/commands/generate/generators/repository.generator.mjs +42 -0
  29. package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -0
  30. package/esm/cli/commands/generate/generators/resource.generator.mjs +42 -0
  31. package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -0
  32. package/esm/cli/commands/generate/generators/service.generator.mjs +42 -0
  33. package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -0
  34. package/esm/cli/commands/generate/templates/stubs.mjs +514 -0
  35. package/esm/cli/commands/generate/templates/stubs.mjs.map +1 -0
  36. package/esm/cli/commands/generate/utils/name-parser.mjs +69 -0
  37. package/esm/cli/commands/generate/utils/name-parser.mjs.map +1 -0
  38. package/esm/cli/commands/generate/utils/path-resolver.mjs +56 -0
  39. package/esm/cli/commands/generate/utils/path-resolver.mjs.map +1 -0
  40. package/esm/cli/commands/generate/utils/prompt.mjs +28 -0
  41. package/esm/cli/commands/generate/utils/prompt.mjs.map +1 -0
  42. package/esm/cli/commands/generate/utils/writer.mjs +60 -0
  43. package/esm/cli/commands/generate/utils/writer.mjs.map +1 -0
  44. package/esm/cli/commands/migrate.command.mjs +60 -0
  45. package/esm/cli/commands/migrate.command.mjs.map +1 -0
  46. package/esm/cli/commands/seed.command.mjs +41 -0
  47. package/esm/cli/commands/seed.command.mjs.map +1 -0
  48. package/esm/cli/commands/start-production.command.mjs +50 -0
  49. package/esm/cli/commands/start-production.command.mjs.map +1 -0
  50. package/esm/cli/commands/storage-put.action.mjs +75 -0
  51. package/esm/cli/commands/storage-put.action.mjs.map +1 -0
  52. package/esm/cli/commands/storage-put.command.mjs +46 -0
  53. package/esm/cli/commands/storage-put.command.mjs.map +1 -0
  54. package/esm/cli/commands/typings-generator.command.mjs +38 -0
  55. package/esm/cli/commands/typings-generator.command.mjs.map +1 -0
  56. package/esm/cli/commands-loader.mjs +50 -0
  57. package/esm/cli/commands-loader.mjs.map +1 -0
  58. package/esm/cli/framework-cli-commands.mjs +37 -0
  59. package/esm/cli/framework-cli-commands.mjs.map +1 -0
  60. package/esm/cli/parse-cli-args.mjs +62 -0
  61. package/esm/cli/parse-cli-args.mjs.map +1 -0
  62. package/esm/cli/start.d.mts +1 -0
  63. package/esm/cli/start.mjs +8 -0
  64. package/esm/cli/start.mjs.map +1 -0
  65. package/esm/cli/string-similarity.mjs +56 -0
  66. package/esm/cli/string-similarity.mjs.map +1 -0
  67. package/esm/database/create-database-action.mjs +32 -0
  68. package/esm/database/create-database-action.mjs.map +1 -0
  69. package/esm/database/drop-tables-action.mjs +35 -0
  70. package/esm/database/drop-tables-action.mjs.map +1 -0
  71. package/esm/database/migrate-action.mjs +99 -0
  72. package/esm/database/migrate-action.mjs.map +1 -0
  73. package/esm/database/seed-command-action.mjs +74 -0
  74. package/esm/database/seed-command-action.mjs.map +1 -0
  75. package/esm/database/seeds/seeders.manager.mjs +129 -0
  76. package/esm/database/seeds/seeders.manager.mjs.map +1 -0
  77. package/esm/database/seeds/seeds-table-migration.mjs +31 -0
  78. package/esm/database/seeds/seeds-table-migration.mjs.map +1 -0
  79. package/esm/database/seeds/utils.mjs +6 -0
  80. package/esm/database/seeds/utils.mjs.map +1 -0
  81. package/esm/dev-server/dev-logger.mjs +12 -1
  82. package/esm/dev-server/dev-logger.mjs.map +1 -1
  83. package/esm/dev-server/development-server.mjs +115 -0
  84. package/esm/dev-server/development-server.mjs.map +1 -0
  85. package/esm/dev-server/layer-executor.mjs +114 -0
  86. package/esm/dev-server/layer-executor.mjs.map +1 -0
  87. package/esm/dev-server/start-development-server.mjs +63 -0
  88. package/esm/dev-server/start-development-server.mjs.map +1 -0
  89. package/esm/dev-server/type-generator.mjs +453 -0
  90. package/esm/dev-server/type-generator.mjs.map +1 -0
  91. package/esm/generations/add-command.action.mjs +480 -0
  92. package/esm/generations/add-command.action.mjs.map +1 -0
  93. package/esm/generations/stubs.mjs +436 -0
  94. package/esm/generations/stubs.mjs.map +1 -0
  95. package/esm/manifest/manifest-manager.mjs +79 -0
  96. package/esm/manifest/manifest-manager.mjs.map +1 -0
  97. package/esm/production/build-app-production.mjs +14 -0
  98. package/esm/production/build-app-production.mjs.map +1 -0
  99. package/esm/production/esbuild-plugins.mjs +37 -0
  100. package/esm/production/esbuild-plugins.mjs.map +1 -0
  101. package/esm/production/production-builder.mjs +264 -0
  102. package/esm/production/production-builder.mjs.map +1 -0
  103. package/esm/production/resolve-build-config.mjs +28 -0
  104. package/esm/production/resolve-build-config.mjs.map +1 -0
  105. package/esm/utils/framework-vesion.mjs +10 -1
  106. package/esm/utils/framework-vesion.mjs.map +1 -1
  107. package/package.json +15 -9
@@ -0,0 +1,24 @@
1
+ import { command } from "../cli-command.mjs";
2
+ import { createDatabaseAction } from "../../database/create-database-action.mjs";
3
+
4
+ //#region ../@warlock.js/core/src/cli/commands/create-database.command.ts
5
+ const createDatabaseCommand = command({
6
+ name: "create-database <name>",
7
+ alias: "cdb",
8
+ description: "Create a new database",
9
+ action: createDatabaseAction,
10
+ preload: {
11
+ config: ["database", "log"],
12
+ env: true,
13
+ connectors: ["database"]
14
+ },
15
+ options: [{
16
+ text: "--connection, -c",
17
+ description: "Database connection name",
18
+ defaultValue: "default"
19
+ }]
20
+ });
21
+
22
+ //#endregion
23
+ export { createDatabaseCommand };
24
+ //# sourceMappingURL=create-database.command.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-database.command.mjs","names":[],"sources":["../../../../../../../../@warlock.js/core/src/cli/commands/create-database.command.ts"],"sourcesContent":["import { createDatabaseAction } from \"../../database/create-database-action\";\nimport { command } from \"../cli-command\";\n\nexport const createDatabaseCommand = command({\n name: \"create-database <name>\",\n alias: \"cdb\",\n description: \"Create a new database\",\n action: createDatabaseAction,\n preload: {\n config: [\"database\", \"log\"],\n env: true,\n connectors: [\"database\"],\n },\n options: [\n {\n text: \"--connection, -c\",\n description: \"Database connection name\",\n defaultValue: \"default\",\n },\n ],\n});\n"],"mappings":";;;;AAGA,MAAa,wBAAwB,QAAQ;CAC3C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS;EACP,QAAQ,CAAC,YAAY,KAAK;EAC1B,KAAK;EACL,YAAY,CAAC,UAAU;CACzB;CACA,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,cAAc;CAChB,CACF;AACF,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { command } from "../cli-command.mjs";
2
+ import { displayStartupBanner } from "../cli-commands.utils.mjs";
3
+ import { startDevelopmentServer } from "../../dev-server/start-development-server.mjs";
4
+
5
+ //#region ../@warlock.js/core/src/cli/commands/dev-server.command.ts
6
+ const devServerCommand = command({
7
+ name: "dev",
8
+ description: "Start development server (HMR, type-gen, health checks)",
9
+ persistent: true,
10
+ preload: {
11
+ runtimeStrategy: "development",
12
+ config: true,
13
+ bootstrap: true,
14
+ prestart: true,
15
+ connectors: true
16
+ },
17
+ preAction: async () => {
18
+ await displayStartupBanner({ environment: "development" });
19
+ },
20
+ action: async (data) => {
21
+ await startDevelopmentServer({
22
+ fresh: Boolean(data.options.fresh),
23
+ generateTypings: data.options["skip-typings"] ? false : void 0,
24
+ healthCheckers: data.options["skip-health"] ? false : void 0
25
+ });
26
+ },
27
+ options: [
28
+ {
29
+ text: "--fresh, -f",
30
+ description: "Delete .warlock/manifest.json before start (force full re-parse from disk)",
31
+ type: "boolean"
32
+ },
33
+ {
34
+ text: "--skip-typings, -st",
35
+ description: "Skip background type generation for this run",
36
+ type: "boolean"
37
+ },
38
+ {
39
+ text: "--skip-health, -sh",
40
+ description: "Skip file health checkers for this run",
41
+ type: "boolean"
42
+ }
43
+ ]
44
+ });
45
+
46
+ //#endregion
47
+ export { devServerCommand };
48
+ //# sourceMappingURL=dev-server.command.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-server.command.mjs","names":[],"sources":["../../../../../../../../@warlock.js/core/src/cli/commands/dev-server.command.ts"],"sourcesContent":["import { startDevelopmentServer } from \"../../dev-server/start-development-server\";\r\nimport { command } from \"../cli-command\";\r\nimport { displayStartupBanner } from \"../cli-commands.utils\";\r\n\r\nexport const devServerCommand = command({\r\n name: \"dev\",\r\n description: \"Start development server (HMR, type-gen, health checks)\",\r\n persistent: true,\r\n preload: {\r\n runtimeStrategy: \"development\",\r\n config: true, // load all config\r\n bootstrap: true,\r\n prestart: true, // load prestart file (if exists)\r\n // Only the Early lifecycle phase starts here; the Late phase\r\n // (http, socket) starts after app modules load — see\r\n // development-server.ts STEP 8.5.\r\n connectors: true,\r\n },\r\n preAction: async () => {\r\n await displayStartupBanner({ environment: \"development\" });\r\n },\r\n action: async (data) => {\r\n await startDevelopmentServer({\r\n fresh: Boolean(data.options.fresh),\r\n // Pass `false` only when the CLI flag is explicitly set; `undefined`\r\n // lets `warlock.config.ts > devServer.*` defaults apply.\r\n generateTypings: data.options[\"skip-typings\"] ? false : undefined,\r\n healthCheckers: data.options[\"skip-health\"] ? false : undefined,\r\n });\r\n },\r\n options: [\r\n {\r\n text: \"--fresh, -f\",\r\n description: \"Delete .warlock/manifest.json before start (force full re-parse from disk)\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--skip-typings, -st\",\r\n description: \"Skip background type generation for this run\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--skip-health, -sh\",\r\n description: \"Skip file health checkers for this run\",\r\n type: \"boolean\",\r\n },\r\n ],\r\n});\r\n"],"mappings":";;;;;AAIA,MAAa,mBAAmB,QAAQ;CACtC,MAAM;CACN,aAAa;CACb,YAAY;CACZ,SAAS;EACP,iBAAiB;EACjB,QAAQ;EACR,WAAW;EACX,UAAU;EAIV,YAAY;CACd;CACA,WAAW,YAAY;EACrB,MAAM,qBAAqB,EAAE,aAAa,cAAc,CAAC;CAC3D;CACA,QAAQ,OAAO,SAAS;EACtB,MAAM,uBAAuB;GAC3B,OAAO,QAAQ,KAAK,QAAQ,KAAK;GAGjC,iBAAiB,KAAK,QAAQ,kBAAkB,QAAQ;GACxD,gBAAgB,KAAK,QAAQ,iBAAiB,QAAQ;EACxD,CAAC;CACH;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;CACF;AACF,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { command } from "../cli-command.mjs";
2
+ import { dropTablesAction } from "../../database/drop-tables-action.mjs";
3
+
4
+ //#region ../@warlock.js/core/src/cli/commands/drop-tables.command.ts
5
+ const dropTablesCommand = command({
6
+ name: "drop.tables",
7
+ description: "Drop all tables in the database",
8
+ action: dropTablesAction,
9
+ preload: {
10
+ config: ["database", "log"],
11
+ env: true,
12
+ connectors: ["database", "logger"]
13
+ },
14
+ options: [{
15
+ text: "--force, -f",
16
+ description: "Drop tables without confirmation",
17
+ type: "boolean"
18
+ }]
19
+ });
20
+
21
+ //#endregion
22
+ export { dropTablesCommand };
23
+ //# sourceMappingURL=drop-tables.command.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-tables.command.mjs","names":[],"sources":["../../../../../../../../@warlock.js/core/src/cli/commands/drop-tables.command.ts"],"sourcesContent":["import { dropTablesAction } from \"../../database/drop-tables-action\";\nimport { command } from \"../cli-command\";\n\nexport const dropTablesCommand = command({\n name: \"drop.tables\",\n description: \"Drop all tables in the database\",\n action: dropTablesAction,\n preload: {\n config: [\"database\", \"log\"],\n env: true,\n connectors: [\"database\", \"logger\"],\n },\n options: [\n {\n text: \"--force, -f\",\n description: \"Drop tables without confirmation\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;AAGA,MAAa,oBAAoB,QAAQ;CACvC,MAAM;CACN,aAAa;CACb,QAAQ;CACR,SAAS;EACP,QAAQ,CAAC,YAAY,KAAK;EAC1B,KAAK;EACL,YAAY,CAAC,YAAY,QAAQ;CACnC;CACA,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,CACF;AACF,CAAC"}
@@ -0,0 +1,201 @@
1
+ import { command } from "../../cli-command.mjs";
2
+ import { generateController } from "./generators/controller.generator.mjs";
3
+ import { generateMigration } from "./generators/migration.generator.mjs";
4
+ import { generateModel } from "./generators/model.generator.mjs";
5
+ import { generateModule } from "./generators/module.generator.mjs";
6
+ import { generateRepository } from "./generators/repository.generator.mjs";
7
+ import { generateResource } from "./generators/resource.generator.mjs";
8
+ import { generateService } from "./generators/service.generator.mjs";
9
+ import { colors } from "@mongez/copper";
10
+
11
+ //#region ../@warlock.js/core/src/cli/commands/generate/generate.command.ts
12
+ const generators = {
13
+ module: generateModule,
14
+ controller: generateController,
15
+ service: generateService,
16
+ model: generateModel,
17
+ migration: generateMigration,
18
+ repository: generateRepository,
19
+ resource: generateResource
20
+ };
21
+ async function generateCommandAction(data) {
22
+ const commandName = data.args[0];
23
+ if (!commandName) {
24
+ console.log(colors.red("Error: Generator name is required"));
25
+ console.log(colors.yellow("\nAvailable generators:"));
26
+ Object.keys(generators).forEach((cmd) => {
27
+ console.log(colors.cyan(` - ${cmd}`));
28
+ });
29
+ console.log(colors.yellow("\nUsage: warlock generate <generator> <name> [options]"));
30
+ process.exit(1);
31
+ }
32
+ const generator = generators[commandName];
33
+ if (!generator) {
34
+ console.log(colors.red(`Error: Unknown generator "${commandName}"`));
35
+ console.log(colors.yellow("\nAvailable generators:"));
36
+ Object.keys(generators).forEach((cmd) => {
37
+ console.log(colors.cyan(` - ${cmd}`));
38
+ });
39
+ process.exit(1);
40
+ }
41
+ await generator({
42
+ ...data,
43
+ args: data.args.slice(1)
44
+ });
45
+ }
46
+ const generateCommand = command({
47
+ name: "generate <generator> [args...]",
48
+ alias: "g",
49
+ description: "Scaffold a new component",
50
+ action: generateCommandAction,
51
+ options: [{
52
+ text: "--force, -f",
53
+ description: "Overwrite existing files"
54
+ }, {
55
+ text: "--dry-run",
56
+ description: "Preview the files that would be generated without writing anything"
57
+ }]
58
+ });
59
+ const generateModuleCommand = command({
60
+ name: "generate.module <name>",
61
+ alias: "gen.m",
62
+ description: "Generate a new module",
63
+ action: generateModule,
64
+ options: [
65
+ {
66
+ text: "--minimal, -m",
67
+ description: "Generate a minimal skeleton (routes, main, locales, empty subfolders) instead of the full CRUD scaffold"
68
+ },
69
+ {
70
+ text: "--force, -f",
71
+ description: "Overwrite existing files"
72
+ },
73
+ {
74
+ text: "--dry-run",
75
+ description: "Preview the files that would be generated without writing anything"
76
+ }
77
+ ]
78
+ });
79
+ const generateControllerCommand = command({
80
+ name: "generate.controller <module>/<name>",
81
+ alias: "gen.c",
82
+ description: "Generate a new controller",
83
+ action: generateController,
84
+ options: [
85
+ {
86
+ text: "--with-validation, -v",
87
+ description: "Generate a validation schema and bind it to the controller"
88
+ },
89
+ {
90
+ text: "--force, -f",
91
+ description: "Overwrite existing files"
92
+ },
93
+ {
94
+ text: "--dry-run",
95
+ description: "Preview the files that would be generated without writing anything"
96
+ }
97
+ ]
98
+ });
99
+ const generateServiceCommand = command({
100
+ name: "generate.service <module>/<name>",
101
+ alias: "gen.s",
102
+ description: "Generate a new service",
103
+ action: generateService,
104
+ options: [{
105
+ text: "--force, -f",
106
+ description: "Overwrite existing files"
107
+ }, {
108
+ text: "--dry-run",
109
+ description: "Preview the files that would be generated without writing anything"
110
+ }]
111
+ });
112
+ const generateModelCommand = command({
113
+ name: "generate.model <module>/<name>",
114
+ alias: "gen.md",
115
+ description: "Generate a new model with migration",
116
+ action: generateModel,
117
+ options: [
118
+ {
119
+ text: "--with-resource, -rs",
120
+ description: "Generate resource"
121
+ },
122
+ {
123
+ text: "--table <name>",
124
+ description: "Specify table name"
125
+ },
126
+ {
127
+ text: "--force, -f",
128
+ description: "Overwrite existing files"
129
+ },
130
+ {
131
+ text: "--dry-run",
132
+ description: "Preview the files that would be generated without writing anything"
133
+ },
134
+ {
135
+ text: "--timestamps [bool]",
136
+ description: "Include timestamps in migration (default: true)"
137
+ }
138
+ ]
139
+ });
140
+ const generateRepositoryCommand = command({
141
+ name: "generate.repository <module>/<name>",
142
+ alias: "gen.r",
143
+ description: "Generate a new repository",
144
+ action: generateRepository,
145
+ options: [{
146
+ text: "--force, -f",
147
+ description: "Overwrite existing files"
148
+ }, {
149
+ text: "--dry-run",
150
+ description: "Preview the files that would be generated without writing anything"
151
+ }]
152
+ });
153
+ const generateResourceCommand = command({
154
+ name: "generate.resource <module>/<name>",
155
+ alias: "gen.rs",
156
+ description: "Generate a new resource",
157
+ action: generateResource,
158
+ options: [{
159
+ text: "--force, -f",
160
+ description: "Overwrite existing files"
161
+ }, {
162
+ text: "--dry-run",
163
+ description: "Preview the files that would be generated without writing anything"
164
+ }]
165
+ });
166
+ const generateMigrationCommand = command({
167
+ name: "generate.migration <model-path>",
168
+ alias: "gen.mig",
169
+ description: "Generate a new migration for a model",
170
+ action: generateMigration,
171
+ options: [
172
+ {
173
+ text: "--force, -f",
174
+ description: "Overwrite existing files"
175
+ },
176
+ {
177
+ text: "--dry-run",
178
+ description: "Preview the files that would be generated without writing anything"
179
+ },
180
+ {
181
+ text: "--add <columns>",
182
+ description: "Columns to add (DSL: name:type:modifier,...)"
183
+ },
184
+ {
185
+ text: "--drop <columns>",
186
+ description: "Columns to drop (comma-separated names)"
187
+ },
188
+ {
189
+ text: "--rename <columns>",
190
+ description: "Columns to rename (DSL: old:new,...)"
191
+ },
192
+ {
193
+ text: "--timestamps [bool]",
194
+ description: "Include timestamps (default: true)"
195
+ }
196
+ ]
197
+ });
198
+
199
+ //#endregion
200
+ export { generateCommand, generateControllerCommand, generateMigrationCommand, generateModelCommand, generateModuleCommand, generateRepositoryCommand, generateResourceCommand, generateServiceCommand };
201
+ //# sourceMappingURL=generate.command.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.command.mjs","names":[],"sources":["../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generate.command.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport { command } from \"../../cli-command\";\r\nimport type { CommandActionData } from \"../../types\";\r\nimport { generateController } from \"./generators/controller.generator\";\r\nimport { generateMigration } from \"./generators/migration.generator\";\r\nimport { generateModel } from \"./generators/model.generator\";\r\nimport { generateModule } from \"./generators/module.generator\";\r\nimport { generateRepository } from \"./generators/repository.generator\";\r\nimport { generateResource } from \"./generators/resource.generator\";\r\nimport { generateService } from \"./generators/service.generator\";\r\n\r\nconst generators: Record<string, (data: CommandActionData) => Promise<void>> = {\r\n module: generateModule,\r\n controller: generateController,\r\n service: generateService,\r\n model: generateModel,\r\n migration: generateMigration,\r\n repository: generateRepository,\r\n resource: generateResource,\r\n};\r\n\r\nasync function generateCommandAction(data: CommandActionData) {\r\n const commandName = data.args[0];\r\n\r\n if (!commandName) {\r\n console.log(colors.red(\"Error: Generator name is required\"));\r\n console.log(colors.yellow(\"\\nAvailable generators:\"));\r\n Object.keys(generators).forEach((cmd) => {\r\n console.log(colors.cyan(` - ${cmd}`));\r\n });\r\n console.log(colors.yellow(\"\\nUsage: warlock generate <generator> <name> [options]\"));\r\n process.exit(1);\r\n }\r\n\r\n const generator = generators[commandName];\r\n\r\n if (!generator) {\r\n console.log(colors.red(`Error: Unknown generator \"${commandName}\"`));\r\n console.log(colors.yellow(\"\\nAvailable generators:\"));\r\n Object.keys(generators).forEach((cmd) => {\r\n console.log(colors.cyan(` - ${cmd}`));\r\n });\r\n process.exit(1);\r\n }\r\n\r\n // Remove the command name from args for the generator\r\n const generatorData: CommandActionData = {\r\n ...data,\r\n args: data.args.slice(1),\r\n };\r\n\r\n await generator(generatorData);\r\n}\r\n\r\n// Master generate command\r\nexport const generateCommand = command({\r\n name: \"generate <generator> [args...]\",\r\n alias: \"g\", // Allows 'warlock g module ...'\r\n description: \"Scaffold a new component\",\r\n action: generateCommandAction,\r\n options: [\r\n {\r\n text: \"--force, -f\",\r\n description: \"Overwrite existing files\",\r\n },\r\n {\r\n text: \"--dry-run\",\r\n description: \"Preview the files that would be generated without writing anything\",\r\n },\r\n ],\r\n});\r\n\r\n// Individual commands\r\nexport const generateModuleCommand = command({\r\n name: \"generate.module <name>\",\r\n alias: \"gen.m\",\r\n description: \"Generate a new module\",\r\n action: generateModule,\r\n options: [\r\n {\r\n text: \"--minimal, -m\",\r\n description:\r\n \"Generate a minimal skeleton (routes, main, locales, empty subfolders) instead of the full CRUD scaffold\",\r\n },\r\n {\r\n text: \"--force, -f\",\r\n description: \"Overwrite existing files\",\r\n },\r\n {\r\n text: \"--dry-run\",\r\n description: \"Preview the files that would be generated without writing anything\",\r\n },\r\n ],\r\n});\r\n\r\nexport const generateControllerCommand = command({\r\n name: \"generate.controller <module>/<name>\",\r\n alias: \"gen.c\",\r\n description: \"Generate a new controller\",\r\n action: generateController,\r\n options: [\r\n {\r\n text: \"--with-validation, -v\",\r\n description: \"Generate a validation schema and bind it to the controller\",\r\n },\r\n {\r\n text: \"--force, -f\",\r\n description: \"Overwrite existing files\",\r\n },\r\n {\r\n text: \"--dry-run\",\r\n description: \"Preview the files that would be generated without writing anything\",\r\n },\r\n ],\r\n});\r\n\r\nexport const generateServiceCommand = command({\r\n name: \"generate.service <module>/<name>\",\r\n alias: \"gen.s\",\r\n description: \"Generate a new service\",\r\n action: generateService,\r\n options: [\r\n {\r\n text: \"--force, -f\",\r\n description: \"Overwrite existing files\",\r\n },\r\n {\r\n text: \"--dry-run\",\r\n description: \"Preview the files that would be generated without writing anything\",\r\n },\r\n ],\r\n});\r\n\r\nexport const generateModelCommand = command({\r\n name: \"generate.model <module>/<name>\",\r\n alias: \"gen.md\",\r\n description: \"Generate a new model with migration\",\r\n action: generateModel,\r\n options: [\r\n {\r\n text: \"--with-resource, -rs\",\r\n description: \"Generate resource\",\r\n },\r\n {\r\n text: \"--table <name>\",\r\n description: \"Specify table name\",\r\n },\r\n {\r\n text: \"--force, -f\",\r\n description: \"Overwrite existing files\",\r\n },\r\n {\r\n text: \"--dry-run\",\r\n description: \"Preview the files that would be generated without writing anything\",\r\n },\r\n {\r\n text: \"--timestamps [bool]\",\r\n description: \"Include timestamps in migration (default: true)\",\r\n },\r\n ],\r\n});\r\n\r\nexport const generateRepositoryCommand = command({\r\n name: \"generate.repository <module>/<name>\",\r\n alias: \"gen.r\",\r\n description: \"Generate a new repository\",\r\n action: generateRepository,\r\n options: [\r\n {\r\n text: \"--force, -f\",\r\n description: \"Overwrite existing files\",\r\n },\r\n {\r\n text: \"--dry-run\",\r\n description: \"Preview the files that would be generated without writing anything\",\r\n },\r\n ],\r\n});\r\n\r\nexport const generateResourceCommand = command({\r\n name: \"generate.resource <module>/<name>\",\r\n alias: \"gen.rs\",\r\n description: \"Generate a new resource\",\r\n action: generateResource,\r\n options: [\r\n {\r\n text: \"--force, -f\",\r\n description: \"Overwrite existing files\",\r\n },\r\n {\r\n text: \"--dry-run\",\r\n description: \"Preview the files that would be generated without writing anything\",\r\n },\r\n ],\r\n});\r\n\r\nexport const generateMigrationCommand = command({\r\n name: \"generate.migration <model-path>\",\r\n alias: \"gen.mig\",\r\n description: \"Generate a new migration for a model\",\r\n action: generateMigration,\r\n options: [\r\n {\r\n text: \"--force, -f\",\r\n description: \"Overwrite existing files\",\r\n },\r\n {\r\n text: \"--dry-run\",\r\n description: \"Preview the files that would be generated without writing anything\",\r\n },\r\n {\r\n text: \"--add <columns>\",\r\n description: \"Columns to add (DSL: name:type:modifier,...)\",\r\n },\r\n {\r\n text: \"--drop <columns>\",\r\n description: \"Columns to drop (comma-separated names)\",\r\n },\r\n {\r\n text: \"--rename <columns>\",\r\n description: \"Columns to rename (DSL: old:new,...)\",\r\n },\r\n {\r\n text: \"--timestamps [bool]\",\r\n description: \"Include timestamps (default: true)\",\r\n },\r\n ],\r\n});\r\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,aAAyE;CAC7E,QAAQ;CACR,YAAY;CACZ,SAAS;CACT,OAAO;CACP,WAAW;CACX,YAAY;CACZ,UAAU;AACZ;AAEA,eAAe,sBAAsB,MAAyB;CAC5D,MAAM,cAAc,KAAK,KAAK;CAE9B,IAAI,CAAC,aAAa;EAChB,QAAQ,IAAI,OAAO,IAAI,mCAAmC,CAAC;EAC3D,QAAQ,IAAI,OAAO,OAAO,yBAAyB,CAAC;EACpD,OAAO,KAAK,UAAU,CAAC,CAAC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ACF,CAAC;AAED,MAAa,uBAAuB,QAAQ;CAC1C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS;EACP;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;CACF;AACF,CAAC;AAED,MAAa,4BAA4B,QAAQ;CAC/C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;CACf,GACA;EACE,MAAM;EACN,aAAa;CACf,CACF;AACF,CAAC;AAED,MAAa,0BAA0B,QAAQ;CAC7C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;CACf,GACA;EACE,MAAM;EACN,aAAa;CACf,CACF;AACF,CAAC;AAED,MAAa,2BAA2B,QAAQ;CAC9C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS;EACP;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;CACF;AACF,CAAC"}
@@ -0,0 +1,49 @@
1
+ //#region ../@warlock.js/core/src/cli/commands/generate/generators/column-dsl-parser.ts
2
+ const typeMapping = {
3
+ text: "text",
4
+ string: "string",
5
+ integer: "integer",
6
+ int: "integer",
7
+ bigInteger: "bigInteger",
8
+ bigInt: "bigInteger",
9
+ boolean: "boolCol",
10
+ bool: "boolCol",
11
+ uuid: "uuid",
12
+ timestamp: "timestamp",
13
+ date: "date",
14
+ json: "json",
15
+ object: "objectCol",
16
+ decimal: "decimal",
17
+ float: "float",
18
+ enum: "enumCol",
19
+ set: "setCol",
20
+ blob: "blobCol",
21
+ binary: "blobCol"
22
+ };
23
+ /**
24
+ * Parses a subset DSL for column schemas:
25
+ * "phone:text:nullable,price:decimal:notNullable:unsigned"
26
+ */
27
+ function parseColumnDsl(input) {
28
+ if (!input) return [];
29
+ return input.split(",").map((c) => c.trim()).filter(Boolean).map((colStr) => {
30
+ const parts = colStr.split(":").map((p) => p.trim());
31
+ const name = parts[0];
32
+ const rawType = parts[1] || "string";
33
+ const helper = typeMapping[rawType] || rawType;
34
+ const modifiers = [];
35
+ for (let i = 2; i < parts.length; i++) {
36
+ let modifier = parts[i];
37
+ modifiers.push(`.${modifier}()`);
38
+ }
39
+ return {
40
+ name,
41
+ helper,
42
+ modifiers
43
+ };
44
+ });
45
+ }
46
+
47
+ //#endregion
48
+ export { parseColumnDsl };
49
+ //# sourceMappingURL=column-dsl-parser.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-dsl-parser.mjs","names":[],"sources":["../../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/column-dsl-parser.ts"],"sourcesContent":["export type ParsedColumn = {\n name: string;\n helper: string; // e.g. \"text\", \"boolCol\", \"decimal\"\n modifiers: string[]; // e.g. [\".nullable()\", \".unsigned()\"]\n};\n\nconst typeMapping: Record<string, string> = {\n text: \"text\",\n string: \"string\",\n integer: \"integer\",\n int: \"integer\",\n bigInteger: \"bigInteger\",\n bigInt: \"bigInteger\",\n boolean: \"boolCol\",\n bool: \"boolCol\",\n uuid: \"uuid\",\n timestamp: \"timestamp\",\n date: \"date\",\n json: \"json\",\n object: \"objectCol\",\n decimal: \"decimal\",\n float: \"float\",\n enum: \"enumCol\",\n set: \"setCol\",\n blob: \"blobCol\",\n binary: \"blobCol\",\n};\n\n/**\n * Parses a subset DSL for column schemas:\n * \"phone:text:nullable,price:decimal:notNullable:unsigned\"\n */\nexport function parseColumnDsl(input: string): ParsedColumn[] {\n if (!input) return [];\n\n const columns = input.split(\",\").map((c) => c.trim()).filter(Boolean);\n \n return columns.map((colStr) => {\n const parts = colStr.split(\":\").map((p) => p.trim());\n const name = parts[0];\n const rawType = parts[1] || \"string\";\n const helper = typeMapping[rawType] || rawType; // fallback to raw string if not mapped\n\n const modifiers: string[] = [];\n for (let i = 2; i < parts.length; i++) {\n let modifier = parts[i];\n // Basic modifiers that translates to builder calls\n modifiers.push(`.${modifier}()`);\n }\n\n return {\n name,\n helper,\n modifiers,\n };\n });\n}\n"],"mappings":";AAMA,MAAM,cAAsC;CAC1C,MAAM;CACN,QAAQ;CACR,SAAS;CACT,KAAK;CACL,YAAY;CACZ,QAAQ;CACR,SAAS;CACT,MAAM;CACN,MAAM;CACN,WAAW;CACX,MAAM;CACN,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CACN,QAAQ;AACV;;;;;AAMA,SAAgB,eAAe,OAA+B;CAC5D,IAAI,CAAC,OAAO,OAAO,CAAC;CAIpB,OAFgB,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,OAEhD,CAAC,CAAC,KAAK,WAAW;EAC7B,MAAM,QAAQ,OAAO,MAAM,GAAG,CAAC,CAAC,KAAK,MAAM,EAAE,KAAK,CAAC;EACnD,MAAM,OAAO,MAAM;EACnB,MAAM,UAAU,MAAM,MAAM;EAC5B,MAAM,SAAS,YAAY,YAAY;EAEvC,MAAM,YAAsB,CAAC;EAC7B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;GACrC,IAAI,WAAW,MAAM;GAErB,UAAU,KAAK,IAAI,SAAS,GAAG;EACjC;EAEA,OAAO;GACL;GACA;GACA;EACF;CACF,CAAC;AACH"}
@@ -0,0 +1,48 @@
1
+ import { controllerStub, schemaStub } from "../templates/stubs.mjs";
2
+ import { parseModulePath, parseName } from "../utils/name-parser.mjs";
3
+ import { putFileAsync, setDryRun } from "../utils/writer.mjs";
4
+ import { componentExists, ensureComponentDirectory, moduleExists, resolveComponentPath } from "../utils/path-resolver.mjs";
5
+ import { colors } from "@mongez/copper";
6
+
7
+ //#region ../@warlock.js/core/src/cli/commands/generate/generators/controller.generator.ts
8
+ async function generateController(data) {
9
+ const input = data.args[0];
10
+ if (!input) {
11
+ console.log(colors.red("Error: Controller name is required"));
12
+ console.log(colors.yellow("Usage: warlock create.controller <module>/<name>"));
13
+ console.log(colors.yellow("Example: warlock create.controller users/create-user"));
14
+ process.exit(1);
15
+ }
16
+ const { module, name: componentName } = parseModulePath(input);
17
+ if (!module) {
18
+ console.log(colors.red("Error: Module name is required"));
19
+ console.log(colors.yellow("Usage: warlock create.controller <module>/<name>"));
20
+ process.exit(1);
21
+ }
22
+ if (!await moduleExists(module)) {
23
+ console.log(colors.red(`Error: Module "${module}" does not exist`));
24
+ console.log(colors.yellow(`Run: warlock create.module ${module}`));
25
+ process.exit(1);
26
+ }
27
+ const name = parseName(componentName);
28
+ const withValidation = data.options.withValidation || data.options.v;
29
+ const force = data.options.force || data.options.f;
30
+ setDryRun(Boolean(data.options.dryRun));
31
+ const controllerPath = resolveComponentPath(module, "controllers", `${name.kebab}.controller`);
32
+ if (await componentExists(module, "controllers", `${name.kebab}.controller`) && !force) {
33
+ console.log(colors.red(`Error: Controller "${name.kebab}.controller.ts" already exists`));
34
+ console.log(colors.yellow("Use --force to overwrite"));
35
+ process.exit(1);
36
+ }
37
+ await ensureComponentDirectory(module, "controllers");
38
+ await putFileAsync(controllerPath, controllerStub(name, { withValidation: !!withValidation }));
39
+ if (withValidation) {
40
+ await ensureComponentDirectory(module, "schema");
41
+ await putFileAsync(resolveComponentPath(module, "schema", `${name.kebab}.schema`), schemaStub(name));
42
+ }
43
+ console.log(colors.cyan(`\n✨ Controller "${name.camel}" generated successfully!`));
44
+ }
45
+
46
+ //#endregion
47
+ export { generateController };
48
+ //# sourceMappingURL=controller.generator.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.generator.mjs","names":[],"sources":["../../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/controller.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { controllerStub, schemaStub } from \"../templates/stubs\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\nexport async function generateController(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Controller name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.controller <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.controller users/create-user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.controller <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const withValidation = data.options.withValidation || data.options.v;\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if controller already exists\r\n const controllerPath = resolveComponentPath(module, \"controllers\", `${name.kebab}.controller`);\r\n if ((await componentExists(module, \"controllers\", `${name.kebab}.controller`)) && !force) {\r\n console.log(colors.red(`Error: Controller \"${name.kebab}.controller.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"controllers\");\r\n\r\n // Generate controller\r\n const controllerContent = controllerStub(name, { withValidation: !!withValidation });\r\n await putFileAsync(controllerPath, controllerContent);\r\n\r\n // Generate the validation schema alongside the controller if requested.\r\n // The controller imports the schema's exported type + value directly —\r\n // there is no separate `requests/` alias file.\r\n if (withValidation) {\r\n await ensureComponentDirectory(module, \"schema\");\r\n\r\n const schemaPath = resolveComponentPath(module, \"schema\", `${name.kebab}.schema`);\r\n const schemaContent = schemaStub(name);\r\n\r\n await putFileAsync(schemaPath, schemaContent);\r\n }\r\n\r\n console.log(colors.cyan(`\\n✨ Controller \"${name.camel}\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,mBAAmB,MAAwC;CAC/E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,oCAAoC,CAAC;EAC5D,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,IAAI,OAAO,OAAO,sDAAsD,CAAC;EACjF,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,iBAAiB,KAAK,QAAQ,kBAAkB,KAAK,QAAQ;CACnE,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,MAAM,iBAAiB,qBAAqB,QAAQ,eAAe,GAAG,KAAK,MAAM,YAAY;CAC7F,IAAK,MAAM,gBAAgB,QAAQ,eAAe,GAAG,KAAK,MAAM,YAAY,KAAM,CAAC,OAAO;EACxF,QAAQ,IAAI,OAAO,IAAI,sBAAsB,KAAK,MAAM,+BAA+B,CAAC;EACxF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,aAAa;CAIpD,MAAM,aAAa,gBADO,eAAe,MAAM,EAAE,gBAAgB,CAAC,CAAC,eAAe,CAC/B,CAAC;CAKpD,IAAI,gBAAgB;EAClB,MAAM,yBAAyB,QAAQ,QAAQ;EAK/C,MAAM,aAHa,qBAAqB,QAAQ,UAAU,GAAG,KAAK,MAAM,QAG5C,GAFN,WAAW,IAEU,CAAC;CAC9C;CAEA,QAAQ,IAAI,OAAO,KAAK,qBAAqB,KAAK,MAAM,0BAA0B,CAAC;AACrF"}
@@ -0,0 +1,81 @@
1
+ import { appPath } from "../../../../utils/paths.mjs";
2
+ import "../../../../utils/index.mjs";
3
+ import { migrationAlterStub, migrationStub } from "../templates/stubs.mjs";
4
+ import { parseName } from "../utils/name-parser.mjs";
5
+ import { ensureDirectoryAsync, putFileAsync, setDryRun } from "../utils/writer.mjs";
6
+ import { parseColumnDsl } from "./column-dsl-parser.mjs";
7
+ import { colors } from "@mongez/copper";
8
+ import path from "node:path";
9
+
10
+ //#region ../@warlock.js/core/src/cli/commands/generate/generators/migration.generator.ts
11
+ /**
12
+ * Generate a migration file for a model
13
+ */
14
+ /**
15
+ * Create a migration file for a model
16
+ */
17
+ async function createMigrationFile(moduleName, entityName, options = {}) {
18
+ const entity = parseName(entityName);
19
+ const now = /* @__PURE__ */ new Date();
20
+ const migrationFileName = `${`${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}-${now.getFullYear()}_${String(now.getHours()).padStart(2, "0")}-${String(now.getMinutes()).padStart(2, "0")}-${String(now.getSeconds()).padStart(2, "0")}`}-${entity.kebab}.migration.ts`;
21
+ const migrationsPath = path.join(appPath(), moduleName, "models", entity.kebab, "migrations");
22
+ await ensureDirectoryAsync(migrationsPath);
23
+ const addParams = options.add;
24
+ const dropParams = options.drop;
25
+ const renameParams = options.rename;
26
+ const timestamps = options.timestamps !== "false" && options.timestamps !== false;
27
+ let migrationContent = "";
28
+ if (addParams || dropParams || renameParams) {
29
+ const parsedAdd = parseColumnDsl(addParams || "");
30
+ const helpersSet = /* @__PURE__ */ new Set();
31
+ const addLines = parsedAdd.map((col) => {
32
+ helpersSet.add(col.helper);
33
+ return ` ${col.name}: ${col.helper}()${col.modifiers.join("")},`;
34
+ });
35
+ let formattedDrop = void 0;
36
+ if (dropParams) formattedDrop = JSON.stringify(dropParams.split(",").map((s) => s.trim()));
37
+ let formattedRename = void 0;
38
+ if (renameParams) {
39
+ const obj = {};
40
+ renameParams.split(",").map((s) => s.trim()).forEach((p) => {
41
+ const [oldN, newN] = p.split(":").map((s) => s.trim());
42
+ if (oldN && newN) obj[oldN] = newN;
43
+ });
44
+ formattedRename = JSON.stringify(obj, null, 2).replace(/\n/g, "\n ");
45
+ }
46
+ migrationContent = migrationAlterStub(entity, {
47
+ add: addLines.length > 0 ? addLines.join("\n") : void 0,
48
+ drop: formattedDrop,
49
+ rename: formattedRename,
50
+ imports: Array.from(helpersSet)
51
+ });
52
+ } else migrationContent = migrationStub(entity, { timestamps });
53
+ const migrationFilePath = path.join(migrationsPath, migrationFileName);
54
+ await putFileAsync(migrationFilePath, migrationContent);
55
+ return migrationFilePath;
56
+ }
57
+ /**
58
+ * Generate a migration file for a model
59
+ */
60
+ async function generateMigration(data) {
61
+ const modelPath = data.args[0];
62
+ if (!modelPath) {
63
+ console.log(colors.red("Error: Model path is required"));
64
+ console.log(colors.gray("Usage: warlock gen.migration <model-path>"));
65
+ console.log(colors.gray("Example: warlock gen.migration products/product"));
66
+ return;
67
+ }
68
+ const [moduleName, entityName] = modelPath.split("/");
69
+ if (!moduleName || !entityName) {
70
+ console.log(colors.red("Error: Invalid model path format. Expected: <module>/<entity>"));
71
+ console.log(colors.gray("Example: warlock gen.migration products/product"));
72
+ return;
73
+ }
74
+ setDryRun(Boolean(data.options.dryRun));
75
+ const migrationFilePath = await createMigrationFile(moduleName, entityName, data.options);
76
+ console.log(colors.cyan(`\n✨ Migration file created at: ${path.relative(appPath(), migrationFilePath)}`));
77
+ }
78
+
79
+ //#endregion
80
+ export { createMigrationFile, generateMigration };
81
+ //# sourceMappingURL=migration.generator.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.generator.mjs","names":[],"sources":["../../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/migration.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport { appPath } from \"../../../../utils\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { migrationAlterStub, migrationStub } from \"../templates/stubs\";\r\nimport { parseColumnDsl } from \"./column-dsl-parser\";\r\nimport { parseName } from \"../utils/name-parser\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\n/**\r\n * Generate a migration file for a model\r\n */\r\n/**\r\n * Create a migration file for a model\r\n */\r\nexport async function createMigrationFile(moduleName: string, entityName: string, options: any = {}) {\r\n const entity = parseName(entityName);\r\n\r\n // Generate timestamp: MM-DD-YYYY_HH-MM-SS\r\n const now = new Date();\r\n const timestamp = `${String(now.getMonth() + 1).padStart(2, \"0\")}-${String(now.getDate()).padStart(2, \"0\")}-${now.getFullYear()}_${String(now.getHours()).padStart(2, \"0\")}-${String(now.getMinutes()).padStart(2, \"0\")}-${String(now.getSeconds()).padStart(2, \"0\")}`;\r\n\r\n const migrationFileName = `${timestamp}-${entity.kebab}.migration.ts`;\r\n const migrationsPath = path.join(appPath(), moduleName, \"models\", entity.kebab, \"migrations\");\r\n\r\n // Ensure migrations directory exists\r\n await ensureDirectoryAsync(migrationsPath);\r\n\r\n const addParams = options.add as string;\r\n const dropParams = options.drop as string;\r\n const renameParams = options.rename as string;\r\n const timestamps = options.timestamps !== \"false\" && options.timestamps !== false;\r\n\r\n let migrationContent = \"\";\r\n\r\n if (addParams || dropParams || renameParams) {\r\n // Generate alter stub\r\n const parsedAdd = parseColumnDsl(addParams || \"\");\r\n const helpersSet = new Set<string>();\r\n \r\n const addLines = parsedAdd.map((col) => {\r\n helpersSet.add(col.helper);\r\n return ` ${col.name}: ${col.helper}()${col.modifiers.join(\"\")},`;\r\n });\r\n\r\n let formattedDrop: string | undefined = undefined;\r\n if (dropParams) {\r\n formattedDrop = JSON.stringify(dropParams.split(\",\").map((s) => s.trim()));\r\n }\r\n\r\n let formattedRename: string | undefined = undefined;\r\n if (renameParams) {\r\n const obj: Record<string, string> = {};\r\n renameParams.split(\",\").map((s) => s.trim()).forEach((p) => {\r\n const [oldN, newN] = p.split(\":\").map((s) => s.trim());\r\n if (oldN && newN) obj[oldN] = newN;\r\n });\r\n formattedRename = JSON.stringify(obj, null, 2).replace(/\\n/g, '\\n ');\r\n }\r\n\r\n migrationContent = migrationAlterStub(entity, {\r\n add: addLines.length > 0 ? addLines.join(\"\\n\") : undefined,\r\n drop: formattedDrop,\r\n rename: formattedRename,\r\n imports: Array.from(helpersSet),\r\n });\r\n } else {\r\n // Generate create stub\r\n migrationContent = migrationStub(entity, {\r\n timestamps,\r\n });\r\n }\r\n\r\n // Create migration file\r\n const migrationFilePath = path.join(migrationsPath, migrationFileName);\r\n await putFileAsync(migrationFilePath, migrationContent);\r\n\r\n return migrationFilePath;\r\n}\r\n\r\n/**\r\n * Generate a migration file for a model\r\n */\r\nexport async function generateMigration(data: CommandActionData) {\r\n const modelPath = data.args[0] as string;\r\n\r\n if (!modelPath) {\r\n console.log(colors.red(\"Error: Model path is required\"));\r\n console.log(colors.gray(\"Usage: warlock gen.migration <model-path>\"));\r\n console.log(colors.gray(\"Example: warlock gen.migration products/product\"));\r\n return;\r\n }\r\n\r\n // Parse model path (e.g., \"products/product\")\r\n const [moduleName, entityName] = modelPath.split(\"/\");\r\n\r\n if (!moduleName || !entityName) {\r\n console.log(colors.red(\"Error: Invalid model path format. Expected: <module>/<entity>\"));\r\n console.log(colors.gray(\"Example: warlock gen.migration products/product\"));\r\n return;\r\n }\r\n\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n const migrationFilePath = await createMigrationFile(moduleName, entityName, data.options);\r\n\r\n console.log(\r\n colors.cyan(`\\n✨ Migration file created at: ${path.relative(appPath(), migrationFilePath)}`),\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,eAAsB,oBAAoB,YAAoB,YAAoB,UAAe,CAAC,GAAG;CACnG,MAAM,SAAS,UAAU,UAAU;CAGnC,MAAM,sBAAM,IAAI,KAAK;CAGrB,MAAM,oBAAoB,GAAG,GAFR,OAAO,IAAI,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,IAAI,YAAY,EAAE,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,IAE5N,GAAG,OAAO,MAAM;CACvD,MAAM,iBAAiB,KAAK,KAAK,QAAQ,GAAG,YAAY,UAAU,OAAO,OAAO,YAAY;CAG5F,MAAM,qBAAqB,cAAc;CAEzC,MAAM,YAAY,QAAQ;CAC1B,MAAM,aAAa,QAAQ;CAC3B,MAAM,eAAe,QAAQ;CAC7B,MAAM,aAAa,QAAQ,eAAe,WAAW,QAAQ,eAAe;CAE5E,IAAI,mBAAmB;CAEvB,IAAI,aAAa,cAAc,cAAc;EAE3C,MAAM,YAAY,eAAe,aAAa,EAAE;EAChD,MA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GA,MAAM,CAAC,YAAY,cAAc,UAAU,MAAM,GAAG;CAEpD,IAAI,CAAC,cAAc,CAAC,YAAY;EAC9B,QAAQ,IAAI,OAAO,IAAI,+DAA+D,CAAC;EACvF,QAAQ,IAAI,OAAO,KAAK,iDAAiD,CAAC;EAC1E;CACF;CAEA,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAEtC,MAAM,oBAAoB,MAAM,oBAAoB,YAAY,YAAY,KAAK,OAAO;CAExF,QAAQ,IACN,OAAO,KAAK,oCAAoC,KAAK,SAAS,QAAQ,GAAG,iBAAiB,GAAG,CAC/F;AACF"}
@@ -0,0 +1,60 @@
1
+ import { migrationStub, modelStub } from "../templates/stubs.mjs";
2
+ import { parseModulePath, singularName } from "../utils/name-parser.mjs";
3
+ import { ensureDirectoryAsync, putFileAsync, setDryRun } from "../utils/writer.mjs";
4
+ import { componentExists, moduleExists, resolveModulePath } from "../utils/path-resolver.mjs";
5
+ import { colors } from "@mongez/copper";
6
+ import path from "node:path";
7
+
8
+ //#region ../@warlock.js/core/src/cli/commands/generate/generators/model.generator.ts
9
+ async function generateModel(data) {
10
+ const input = data.args[0];
11
+ if (!input) {
12
+ console.log(colors.red("Error: Model name is required"));
13
+ console.log(colors.yellow("Usage: warlock create.model <module>/<name>"));
14
+ console.log(colors.yellow("Example: warlock create.model users/user"));
15
+ process.exit(1);
16
+ }
17
+ const { module, name: componentName } = parseModulePath(input);
18
+ if (!module) {
19
+ console.log(colors.red("Error: Module name is required"));
20
+ console.log(colors.yellow("Usage: warlock create.model <module>/<name>"));
21
+ process.exit(1);
22
+ }
23
+ if (!await moduleExists(module)) {
24
+ console.log(colors.red(`Error: Module "${module}" does not exist`));
25
+ console.log(colors.yellow(`Run: warlock create.module ${module}`));
26
+ process.exit(1);
27
+ }
28
+ const name = singularName(componentName);
29
+ const force = data.options.force || data.options.f;
30
+ setDryRun(Boolean(data.options.dryRun));
31
+ const withResource = data.options.withResource || data.options.rs;
32
+ const tableName = data.options.table || name.plural.snake;
33
+ const modelDir = path.join(resolveModulePath(module), "models", name.kebab);
34
+ const modelPath = path.join(modelDir, `${name.kebab}.model.ts`);
35
+ if (await componentExists(module, `models/${name.kebab}`, `${name.kebab}.model`) && !force) {
36
+ console.log(colors.red(`Error: Model "${name.kebab}" already exists`));
37
+ console.log(colors.yellow("Use --force to overwrite"));
38
+ process.exit(1);
39
+ }
40
+ await ensureDirectoryAsync(modelDir);
41
+ await ensureDirectoryAsync(path.join(modelDir, "migrations"));
42
+ await putFileAsync(modelPath, modelStub(name, {
43
+ tableName,
44
+ withResource: !!withResource
45
+ }));
46
+ const indexContent = `export * from "./${name.kebab}.model";
47
+ `;
48
+ await putFileAsync(path.join(modelDir, "index.ts"), indexContent);
49
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:T]/g, "_").split(".")[0];
50
+ await putFileAsync(path.join(modelDir, "migrations", `${timestamp}_${name.kebab}.migration.ts`), migrationStub(name, { timestamps: data.options.timestamps !== "false" && data.options.timestamps !== false }));
51
+ console.log(colors.cyan(`\n✨ Model "${name.pascal}" generated successfully!`));
52
+ console.log(colors.gray(`\nNext steps:`));
53
+ console.log(colors.gray(` 1. Update model schema in ${name.kebab}.model.ts`));
54
+ console.log(colors.gray(` 2. Update migration in migrations/${timestamp}_${name.kebab}.migration.ts`));
55
+ console.log(colors.gray(` 3. Run migration: warlock migrate`));
56
+ }
57
+
58
+ //#endregion
59
+ export { generateModel };
60
+ //# sourceMappingURL=model.generator.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.generator.mjs","names":[],"sources":["../../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/model.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { migrationStub, modelStub } from \"../templates/stubs\";\r\nimport { parseModulePath, singularName } from \"../utils/name-parser\";\r\nimport { componentExists, moduleExists, resolveModulePath } from \"../utils/path-resolver\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\nexport async function generateModel(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Model name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.model <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.model users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.model <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = singularName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n const withResource = data.options.withResource || data.options.rs;\r\n const tableName = (data.options.table as string) || name.plural.snake;\r\n\r\n // Check if model already exists\r\n const modelDir = path.join(resolveModulePath(module), \"models\", name.kebab);\r\n const modelPath = path.join(modelDir, `${name.kebab}.model.ts`);\r\n\r\n if ((await componentExists(module, `models/${name.kebab}`, `${name.kebab}.model`)) && !force) {\r\n console.log(colors.red(`Error: Model \"${name.kebab}\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureDirectoryAsync(modelDir);\r\n await ensureDirectoryAsync(path.join(modelDir, \"migrations\"));\r\n\r\n // Generate model\r\n const modelContent = modelStub(name, { tableName, withResource: !!withResource });\r\n await putFileAsync(modelPath, modelContent);\r\n\r\n // Generate index.ts\r\n const indexContent = `export * from \"./${name.kebab}.model\";\r\n`;\r\n await putFileAsync(path.join(modelDir, \"index.ts\"), indexContent);\r\n\r\n // Generate migration\r\n const timestamp = new Date().toISOString().replace(/[-:T]/g, \"_\").split(\".\")[0];\r\n const migrationPath = path.join(\r\n modelDir,\r\n \"migrations\",\r\n `${timestamp}_${name.kebab}.migration.ts`,\r\n );\r\n\r\n const migrationContent = migrationStub(name, {\r\n timestamps: data.options.timestamps !== \"false\" && data.options.timestamps !== false,\r\n });\r\n\r\n await putFileAsync(migrationPath, migrationContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Model \"${name.pascal}\" generated successfully!`));\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(colors.gray(` 1. Update model schema in ${name.kebab}.model.ts`));\r\n console.log(\r\n colors.gray(` 2. Update migration in migrations/${timestamp}_${name.kebab}.migration.ts`),\r\n );\r\n console.log(colors.gray(` 3. Run migration: warlock migrate`));\r\n}\r\n"],"mappings":";;;;;;;;AAQA,eAAsB,cAAc,MAAwC;CAC1E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,+BAA+B,CAAC;EACvD,QAAQ,IAAI,OAAO,OAAO,6CAA6C,CAAC;EACxE,QAAQ,IAAI,OAAO,OAAO,0CAA0C,CAAC;EACrE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,6CAA6C,CAAC;EACxE,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,aAAa,aAAa;CACvC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;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