Skip to content

Commit 6d501b3

Browse files
authored
Merge pull request #168 from AthennaIO/develop
feat(command): add make:crud command
2 parents 05b1f7e + 461e793 commit 6d501b3

14 files changed

+902
-4
lines changed

configurer/index.ts

+24
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export default class DatabaseConfigurer extends BaseConfigurer {
4242
'make:migration',
4343
'@athenna/database/commands/MakeMigrationCommand'
4444
)
45+
.setTo('commands', 'make:crud', {
46+
path: '@athenna/database/commands/MakeCrudCommand',
47+
fileCase: Config.is('rc.isSlim', true) ? 'toDotCase' : 'toPascalCase'
48+
})
4549
.setTo('commands', 'db:fresh', {
4650
path: '@athenna/database/commands/DbFreshCommand',
4751
loadApp: true,
@@ -83,6 +87,26 @@ export default class DatabaseConfigurer extends BaseConfigurer {
8387
'migration',
8488
'node_modules/@athenna/database/templates/migration.edge'
8589
)
90+
.setTo(
91+
'templates',
92+
'crud-model',
93+
'node_modules/@athenna/database/templates/crud-model.edge'
94+
)
95+
.setTo(
96+
'templates',
97+
'crud-migration',
98+
'node_modules/@athenna/database/templates/crud-migration.edge'
99+
)
100+
.setTo(
101+
'templates',
102+
'crud-service',
103+
'node_modules/@athenna/database/templates/crud-service.edge'
104+
)
105+
.setTo(
106+
'templates',
107+
'crud-controller',
108+
'node_modules/@athenna/database/templates/crud-controller.edge'
109+
)
86110
.save()
87111
})
88112

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/database",
3-
"version": "4.56.0",
3+
"version": "4.57.0",
44
"description": "The Athenna database handler for SQL/NoSQL.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",
@@ -53,6 +53,7 @@
5353
"./commands/DbFreshCommand": "./src/commands/DbFreshCommand.js",
5454
"./commands/DbSeedCommand": "./src/commands/DbSeedCommand.js",
5555
"./commands/DbWipeCommand": "./src/commands/DbWipeCommand.js",
56+
"./commands/MakeCrudCommand": "./src/commands/MakeCrudCommand.js",
5657
"./commands/MakeMigrationCommand": "./src/commands/MakeMigrationCommand.js",
5758
"./commands/MakeModelCommand": "./src/commands/MakeModelCommand.js",
5859
"./commands/MakeSeederCommand": "./src/commands/MakeSeederCommand.js",
@@ -223,12 +224,19 @@
223224
},
224225
"make:migration": {
225226
"path": "#src/commands/MakeMigrationCommand"
227+
},
228+
"make:crud": {
229+
"path": "#src/commands/MakeCrudCommand"
226230
}
227231
},
228232
"templates": {
229233
"migration": "./templates/migration.edge",
230234
"model": "./templates/model.edge",
231-
"seeder": "./templates/seeder.edge"
235+
"seeder": "./templates/seeder.edge",
236+
"crud-model": "./templates/crud-model.edge",
237+
"crud-migration": "./templates/crud-migration.edge",
238+
"crud-service": "./templates/crud-service.edge",
239+
"crud-controller": "./templates/crud-controller.edge"
232240
}
233241
}
234242
}

0 commit comments

Comments
 (0)