@adonisjs/assembler 5.3.7 → 5.3.8
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/build/templates/command.txt +1 -2
- package/build/templates/controller.txt +1 -2
- package/build/templates/event-listener.txt +1 -2
- package/build/templates/exception.txt +1 -2
- package/build/templates/middleware.txt +1 -1
- package/build/templates/provider.txt +5 -6
- package/build/templates/resource-controller.txt +7 -14
- package/build/templates/self-handle-exception.txt +1 -1
- package/build/templates/validator.txt +32 -34
- package/package.json +12 -12
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '@adonisjs/core/build/standalone'
|
|
2
2
|
|
|
3
3
|
export default class {{ filename }} extends BaseCommand {
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Command name is used to run the command
|
|
7
6
|
*/
|
|
@@ -26,7 +25,7 @@ export default class {{ filename }} extends BaseCommand {
|
|
|
26
25
|
stayAlive: false,
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
public async run
|
|
28
|
+
public async run() {
|
|
30
29
|
this.logger.info('Hello world!')
|
|
31
30
|
}
|
|
32
31
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
2
2
|
|
|
3
3
|
export default class {{ filename }} {
|
|
4
|
-
public async handle
|
|
4
|
+
public async handle({}: HttpContextContract, next: () => Promise<void>) {
|
|
5
5
|
// code for middleware goes here. ABOVE THE NEXT CALL
|
|
6
6
|
await next()
|
|
7
7
|
}
|
|
@@ -20,22 +20,21 @@ import { ApplicationContract } from '@ioc:Adonis/Core/Application'
|
|
|
20
20
|
|
|
|
21
21
|
*/
|
|
22
22
|
export default class {{ filename }} {
|
|
23
|
-
constructor
|
|
24
|
-
}
|
|
23
|
+
constructor(protected app: ApplicationContract) {}
|
|
25
24
|
|
|
26
|
-
public register
|
|
25
|
+
public register() {
|
|
27
26
|
// Register your own bindings
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
public async boot
|
|
29
|
+
public async boot() {
|
|
31
30
|
// All bindings are ready, feel free to use them
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
public async ready
|
|
33
|
+
public async ready() {
|
|
35
34
|
// App is ready
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
public async shutdown
|
|
37
|
+
public async shutdown() {
|
|
39
38
|
// Cleanup, since app is going down
|
|
40
39
|
}
|
|
41
40
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
2
2
|
|
|
3
3
|
export default class {{ filename }} {
|
|
4
|
-
public async index
|
|
5
|
-
}
|
|
4
|
+
public async index({}: HttpContextContract) {}
|
|
6
5
|
|
|
7
|
-
public async create
|
|
8
|
-
}
|
|
6
|
+
public async create({}: HttpContextContract) {}
|
|
9
7
|
|
|
10
|
-
public async store
|
|
11
|
-
}
|
|
8
|
+
public async store({}: HttpContextContract) {}
|
|
12
9
|
|
|
13
|
-
public async show
|
|
14
|
-
}
|
|
10
|
+
public async show({}: HttpContextContract) {}
|
|
15
11
|
|
|
16
|
-
public async edit
|
|
17
|
-
}
|
|
12
|
+
public async edit({}: HttpContextContract) {}
|
|
18
13
|
|
|
19
|
-
public async update
|
|
20
|
-
}
|
|
14
|
+
public async update({}: HttpContextContract) {}
|
|
21
15
|
|
|
22
|
-
public async destroy
|
|
23
|
-
}
|
|
16
|
+
public async destroy({}: HttpContextContract) {}
|
|
24
17
|
}
|
|
@@ -26,7 +26,7 @@ export default class {{ filename }} extends Exception {
|
|
|
26
26
|
* Giving you a chance to convert the exception to response.
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
|
-
public async handle
|
|
29
|
+
public async handle(error: this, ctx: HttpContextContract) {
|
|
30
30
|
ctx.response.status(error.status || 500).send(error.message)
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -2,41 +2,39 @@ import { schema } from '@ioc:Adonis/Core/Validator'
|
|
|
2
2
|
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
3
3
|
|
|
4
4
|
export default class {{ filename }} {
|
|
5
|
-
constructor
|
|
6
|
-
}
|
|
5
|
+
constructor(protected ctx: HttpContextContract) {}
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
public schema = schema.create({
|
|
28
|
-
})
|
|
7
|
+
/*
|
|
8
|
+
* Define schema to validate the "shape", "type", "formatting" and "integrity" of data.
|
|
9
|
+
*
|
|
10
|
+
* For example:
|
|
11
|
+
* 1. The username must be of data type string. But then also, it should
|
|
12
|
+
* not contain special characters or numbers.
|
|
13
|
+
* ```
|
|
14
|
+
* schema.string({}, [ rules.alpha() ])
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* 2. The email must be of data type string, formatted as a valid
|
|
18
|
+
* email. But also, not used by any other user.
|
|
19
|
+
* ```
|
|
20
|
+
* schema.string({}, [
|
|
21
|
+
* rules.email(),
|
|
22
|
+
* rules.unique({ table: 'users', column: 'email' }),
|
|
23
|
+
* ])
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
public schema = schema.create({})
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Custom messages for validation failures. You can make use of dot notation `(.)`
|
|
30
|
+
* for targeting nested fields and array expressions `(*)` for targeting all
|
|
31
|
+
* children of an array. For example:
|
|
32
|
+
*
|
|
33
|
+
* {
|
|
34
|
+
* 'profile.username.required': 'Username is required',
|
|
35
|
+
* 'scores.*.number': 'Define scores as valid numbers'
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
41
39
|
public messages = {}
|
|
42
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/assembler",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.8",
|
|
4
4
|
"description": "Core commands to compiler and build AdonisJs project",
|
|
5
5
|
"main": "build/ace-manifest.json",
|
|
6
6
|
"files": [
|
|
@@ -43,25 +43,25 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/adonisjs/assembler#readme",
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@adonisjs/ace": "^11.0.
|
|
46
|
+
"@adonisjs/ace": "^11.0.5",
|
|
47
47
|
"@adonisjs/core": "^5.3.2",
|
|
48
48
|
"@adonisjs/mrm-preset": "^4.1.2",
|
|
49
49
|
"@poppinss/dev-utils": "^1.1.5",
|
|
50
|
-
"@types/node": "^16.
|
|
50
|
+
"@types/node": "^16.11.6",
|
|
51
51
|
"copyfiles": "^2.4.1",
|
|
52
52
|
"cross-env": "^7.0.3",
|
|
53
53
|
"del-cli": "^4.0.1",
|
|
54
|
-
"eslint": "^
|
|
54
|
+
"eslint": "^8.1.0",
|
|
55
55
|
"eslint-config-prettier": "^8.3.0",
|
|
56
|
-
"eslint-plugin-adonis": "^
|
|
56
|
+
"eslint-plugin-adonis": "^2.0.0",
|
|
57
57
|
"eslint-plugin-prettier": "^4.0.0",
|
|
58
58
|
"github-label-sync": "^2.0.2",
|
|
59
|
-
"husky": "^7.0.
|
|
60
|
-
"japa": "^
|
|
61
|
-
"mrm": "^3.0.
|
|
59
|
+
"husky": "^7.0.4",
|
|
60
|
+
"japa": "^4.0.0",
|
|
61
|
+
"mrm": "^3.0.10",
|
|
62
62
|
"np": "^7.5.0",
|
|
63
|
-
"prettier": "^2.
|
|
64
|
-
"typescript": "^4.4.
|
|
63
|
+
"prettier": "^2.4.1",
|
|
64
|
+
"typescript": "^4.4.4"
|
|
65
65
|
},
|
|
66
66
|
"nyc": {
|
|
67
67
|
"exclude": [
|
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
"@adonisjs/sink": "^5.1.6",
|
|
94
94
|
"@poppinss/chokidar-ts": "^3.3.2",
|
|
95
95
|
"@poppinss/cliui": "^2.2.5",
|
|
96
|
-
"@poppinss/utils": "^3.
|
|
96
|
+
"@poppinss/utils": "^3.3.1",
|
|
97
97
|
"cpy": "^8.1.2",
|
|
98
|
-
"emittery": "^0.
|
|
98
|
+
"emittery": "^0.10.0",
|
|
99
99
|
"execa": "^5.1.1",
|
|
100
100
|
"fs-extra": "^10.0.0",
|
|
101
101
|
"get-port": "^5.1.1",
|