Skip to content

Commit

Permalink
Merge pull request #168 from AthennaIO/develop
Browse files Browse the repository at this point in the history
feat(command): add make:crud command
  • Loading branch information
jlenon7 authored May 24, 2024
2 parents 05b1f7e + 461e793 commit 6d501b3
Show file tree
Hide file tree
Showing 14 changed files with 902 additions and 4 deletions.
24 changes: 24 additions & 0 deletions configurer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export default class DatabaseConfigurer extends BaseConfigurer {
'make:migration',
'@athenna/database/commands/MakeMigrationCommand'
)
.setTo('commands', 'make:crud', {
path: '@athenna/database/commands/MakeCrudCommand',
fileCase: Config.is('rc.isSlim', true) ? 'toDotCase' : 'toPascalCase'
})
.setTo('commands', 'db:fresh', {
path: '@athenna/database/commands/DbFreshCommand',
loadApp: true,
Expand Down Expand Up @@ -83,6 +87,26 @@ export default class DatabaseConfigurer extends BaseConfigurer {
'migration',
'node_modules/@athenna/database/templates/migration.edge'
)
.setTo(
'templates',
'crud-model',
'node_modules/@athenna/database/templates/crud-model.edge'
)
.setTo(
'templates',
'crud-migration',
'node_modules/@athenna/database/templates/crud-migration.edge'
)
.setTo(
'templates',
'crud-service',
'node_modules/@athenna/database/templates/crud-service.edge'
)
.setTo(
'templates',
'crud-controller',
'node_modules/@athenna/database/templates/crud-controller.edge'
)
.save()
})

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/database",
"version": "4.56.0",
"version": "4.57.0",
"description": "The Athenna database handler for SQL/NoSQL.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down Expand Up @@ -53,6 +53,7 @@
"./commands/DbFreshCommand": "./src/commands/DbFreshCommand.js",
"./commands/DbSeedCommand": "./src/commands/DbSeedCommand.js",
"./commands/DbWipeCommand": "./src/commands/DbWipeCommand.js",
"./commands/MakeCrudCommand": "./src/commands/MakeCrudCommand.js",
"./commands/MakeMigrationCommand": "./src/commands/MakeMigrationCommand.js",
"./commands/MakeModelCommand": "./src/commands/MakeModelCommand.js",
"./commands/MakeSeederCommand": "./src/commands/MakeSeederCommand.js",
Expand Down Expand Up @@ -223,12 +224,19 @@
},
"make:migration": {
"path": "#src/commands/MakeMigrationCommand"
},
"make:crud": {
"path": "#src/commands/MakeCrudCommand"
}
},
"templates": {
"migration": "./templates/migration.edge",
"model": "./templates/model.edge",
"seeder": "./templates/seeder.edge"
"seeder": "./templates/seeder.edge",
"crud-model": "./templates/crud-model.edge",
"crud-migration": "./templates/crud-migration.edge",
"crud-service": "./templates/crud-service.edge",
"crud-controller": "./templates/crud-controller.edge"
}
}
}
Loading

0 comments on commit 6d501b3

Please sign in to comment.