@adonisjs/core 6.1.5-33 → 6.1.5-35
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/commands/build.d.ts +3 -5
- package/build/commands/build.js +5 -9
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.d.ts +18 -23
- package/build/commands/configure.js +35 -108
- package/build/commands/generate_key.js +1 -1
- package/build/commands/make/controller.js +5 -5
- package/build/commands/make/exception.js +1 -1
- package/build/commands/make/listener.js +1 -1
- package/build/commands/make/middleware.js +16 -9
- package/build/commands/make/preload.d.ts +2 -1
- package/build/commands/make/preload.js +27 -33
- package/build/commands/make/provider.d.ts +6 -0
- package/build/commands/make/provider.js +51 -6
- package/build/commands/make/test.js +1 -1
- package/build/commands/make/validator.d.ts +5 -0
- package/build/commands/make/validator.js +19 -3
- package/build/commands/serve.js +7 -4
- package/build/commands/test.js +2 -2
- package/build/modules/ace/codemods.d.ts +44 -4
- package/build/modules/ace/codemods.js +122 -2
- package/build/modules/ace/commands.js +5 -1
- package/build/providers/app_provider.js +6 -4
- package/build/providers/repl_provider.js +11 -2
- package/build/src/helpers/main.d.ts +1 -1
- package/build/src/helpers/main.js +1 -1
- package/build/src/types.d.ts +3 -4
- package/build/stubs/make/validator/resource.stub +26 -0
- package/package.json +32 -32
- /package/build/stubs/make/{preload_file → preload}/main.stub +0 -0
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { join } from 'node:path';
|
|
10
10
|
import { homedir } from 'node:os';
|
|
11
|
+
import { Repl } from '../modules/repl.js';
|
|
12
|
+
import { fsImportAll } from '@poppinss/utils';
|
|
11
13
|
/**
|
|
12
14
|
* Resolves a container binding and sets it on the REPL
|
|
13
15
|
* context
|
|
@@ -25,12 +27,12 @@ export default class ReplServiceProvider {
|
|
|
25
27
|
* Registers the REPL binding
|
|
26
28
|
*/
|
|
27
29
|
register() {
|
|
28
|
-
this.app.container.singleton(
|
|
29
|
-
const { Repl } = await import('../modules/repl.js');
|
|
30
|
+
this.app.container.singleton(Repl, async () => {
|
|
30
31
|
return new Repl({
|
|
31
32
|
historyFilePath: join(homedir(), '.adonisjs_v6_repl_history'),
|
|
32
33
|
});
|
|
33
34
|
});
|
|
35
|
+
this.app.container.alias('repl', Repl);
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Registering REPL bindings during provider boot
|
|
@@ -42,6 +44,13 @@ export default class ReplServiceProvider {
|
|
|
42
44
|
}, {
|
|
43
45
|
description: 'Returns the default export for a module',
|
|
44
46
|
});
|
|
47
|
+
repl.addMethod('importAll', (_, dirPath) => {
|
|
48
|
+
return fsImportAll(this.app.makeURL(dirPath), {
|
|
49
|
+
ignoreMissingRoot: false,
|
|
50
|
+
});
|
|
51
|
+
}, {
|
|
52
|
+
description: 'Import all files from a directory and assign them to a variable',
|
|
53
|
+
});
|
|
45
54
|
repl.addMethod('make', (_, service, runtimeValues) => {
|
|
46
55
|
return this.app.container.make(service, runtimeValues);
|
|
47
56
|
}, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as parseImports } from 'parse-imports';
|
|
2
|
-
export { createId as cuid } from '@paralleldrive/cuid2';
|
|
2
|
+
export { createId as cuid, isCuid } from '@paralleldrive/cuid2';
|
|
3
3
|
export { slash, base64, compose, fsReadAll, safeEqual, fsImportAll, MessageBuilder, } from '@poppinss/utils';
|
|
4
4
|
export { parseBindingReference } from './parse_binding_reference.js';
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
export { default as parseImports } from 'parse-imports';
|
|
10
|
-
export { createId as cuid } from '@paralleldrive/cuid2';
|
|
10
|
+
export { createId as cuid, isCuid } from '@paralleldrive/cuid2';
|
|
11
11
|
export { slash, base64, compose, fsReadAll, safeEqual, fsImportAll, MessageBuilder, } from '@poppinss/utils';
|
|
12
12
|
export { parseBindingReference } from './parse_binding_reference.js';
|
package/build/src/types.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import type { Emitter } from '../modules/events.js';
|
|
|
4
4
|
import type { Kernel } from '../modules/ace/main.js';
|
|
5
5
|
import type { Application } from '../modules/app.js';
|
|
6
6
|
import type { TestUtils } from './test_utils/main.js';
|
|
7
|
+
import type { HttpServerEvents } from '../types/http.js';
|
|
7
8
|
import type { LoggerManager } from '../modules/logger.js';
|
|
8
9
|
import type { HashManager } from '../modules/hash/main.js';
|
|
9
10
|
import type { Encryption } from '../modules/encryption.js';
|
|
10
11
|
import type { ManagerDriverFactory } from '../types/hash.js';
|
|
11
12
|
import type { Router, Server } from '../modules/http/main.js';
|
|
12
|
-
import type { HttpRequestFinishedPayload } from '../types/http.js';
|
|
13
13
|
import type { ContainerResolveEventData } from '../types/container.js';
|
|
14
14
|
import type { LoggerConfig, LoggerManagerConfig } from '../types/logger.js';
|
|
15
15
|
/**
|
|
@@ -32,9 +32,8 @@ export type IgnitorOptions = {
|
|
|
32
32
|
* user land code or packages to register events and their
|
|
33
33
|
* types.
|
|
34
34
|
*/
|
|
35
|
-
export interface EventsList {
|
|
36
|
-
'
|
|
37
|
-
'http:request_finished': HttpRequestFinishedPayload;
|
|
35
|
+
export interface EventsList extends HttpServerEvents {
|
|
36
|
+
'container_binding:resolved': ContainerResolveEventData<ContainerBindings>;
|
|
38
37
|
'http:server_ready': {
|
|
39
38
|
port: number;
|
|
40
39
|
host: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{{#var validatorName = string(generators.validatorName(entity.name)).noCase()}}
|
|
2
|
+
{{#var validatorFileName = generators.validatorFileName(entity.name)}}
|
|
3
|
+
{{#var createAction = generators.validatorActionName(entity.name, 'create')}}
|
|
4
|
+
{{#var updateAction = generators.validatorActionName(entity.name, 'update')}}
|
|
5
|
+
{{{
|
|
6
|
+
exports({
|
|
7
|
+
to: app.validatorsPath(entity.path, validatorFileName)
|
|
8
|
+
})
|
|
9
|
+
}}}
|
|
10
|
+
import vine from '@vinejs/vine'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Validator to validate the payload when creating
|
|
14
|
+
* a new {{ validatorName }}.
|
|
15
|
+
*/
|
|
16
|
+
export const {{ createAction }} = vine.compile(
|
|
17
|
+
vine.object({})
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Validator to validate the payload when updating
|
|
22
|
+
* an existing {{ validatorName }}.
|
|
23
|
+
*/
|
|
24
|
+
export const {{ updateAction }} = vine.compile(
|
|
25
|
+
vine.object({})
|
|
26
|
+
)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/core",
|
|
3
3
|
"description": "Core of AdonisJS",
|
|
4
|
-
"version": "6.1.5-
|
|
4
|
+
"version": "6.1.5-35",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.16.0"
|
|
7
7
|
},
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"./helpers/*": "./build/src/helpers/*.js",
|
|
38
38
|
"./ace": "./build/modules/ace/main.js",
|
|
39
39
|
"./ace/shell": "./build/modules/ace/shell.js",
|
|
40
|
+
"./ace/codemods": "./build/modules/ace/codemods.js",
|
|
40
41
|
"./bodyparser": "./build/modules/bodyparser/main.js",
|
|
41
42
|
"./bodyparser_middleware": "./build/modules/bodyparser/bodyparser_middleware.js",
|
|
42
43
|
"./hash": "./build/modules/hash/main.js",
|
|
@@ -77,18 +78,18 @@
|
|
|
77
78
|
"index:commands": "node --loader=ts-node/esm toolkit/main.js index build/commands"
|
|
78
79
|
},
|
|
79
80
|
"devDependencies": {
|
|
80
|
-
"@adonisjs/assembler": "^
|
|
81
|
-
"@adonisjs/eslint-config": "^1.
|
|
82
|
-
"@adonisjs/prettier-config": "^1.
|
|
83
|
-
"@adonisjs/tsconfig": "^1.
|
|
81
|
+
"@adonisjs/assembler": "^7.0.0-0",
|
|
82
|
+
"@adonisjs/eslint-config": "^1.2.0",
|
|
83
|
+
"@adonisjs/prettier-config": "^1.2.0",
|
|
84
|
+
"@adonisjs/tsconfig": "^1.2.0",
|
|
84
85
|
"@commitlint/cli": "^18.4.3",
|
|
85
86
|
"@commitlint/config-conventional": "^18.4.3",
|
|
86
|
-
"@japa/assert": "^2.0
|
|
87
|
-
"@japa/expect-type": "^2.0.
|
|
88
|
-
"@japa/file-system": "^2.0
|
|
89
|
-
"@japa/runner": "^3.1.
|
|
90
|
-
"@swc/core": "^1.3.
|
|
91
|
-
"@types/node": "^20.
|
|
87
|
+
"@japa/assert": "^2.1.0",
|
|
88
|
+
"@japa/expect-type": "^2.0.1",
|
|
89
|
+
"@japa/file-system": "^2.1.0",
|
|
90
|
+
"@japa/runner": "^3.1.1",
|
|
91
|
+
"@swc/core": "^1.3.101",
|
|
92
|
+
"@types/node": "^20.10.5",
|
|
92
93
|
"@types/pretty-hrtime": "^1.0.3",
|
|
93
94
|
"@types/sinon": "^17.0.2",
|
|
94
95
|
"@types/supertest": "^2.0.16",
|
|
@@ -101,35 +102,34 @@
|
|
|
101
102
|
"cross-env": "^7.0.3",
|
|
102
103
|
"del-cli": "^5.1.0",
|
|
103
104
|
"edge.js": "^6.0.0",
|
|
104
|
-
"eslint": "^8.
|
|
105
|
+
"eslint": "^8.56.0",
|
|
105
106
|
"get-port": "^7.0.0",
|
|
106
107
|
"github-label-sync": "^2.3.1",
|
|
107
108
|
"husky": "^8.0.3",
|
|
108
|
-
"np": "^
|
|
109
|
-
"prettier": "^3.1.
|
|
109
|
+
"np": "^9.2.0",
|
|
110
|
+
"prettier": "^3.1.1",
|
|
110
111
|
"sinon": "^17.0.1",
|
|
111
112
|
"supertest": "^6.3.3",
|
|
112
113
|
"test-console": "^2.0.0",
|
|
113
|
-
"ts-node": "^10.9.
|
|
114
|
-
"typescript": "5.
|
|
114
|
+
"ts-node": "^10.9.2",
|
|
115
|
+
"typescript": "^5.3.3"
|
|
115
116
|
},
|
|
116
117
|
"dependencies": {
|
|
117
|
-
"@adonisjs/ace": "^12.3.2-
|
|
118
|
-
"@adonisjs/application": "^8.0.0-
|
|
119
|
-
"@adonisjs/bodyparser": "^10.0.0-
|
|
120
|
-
"@adonisjs/config": "^4.2.1-
|
|
121
|
-
"@adonisjs/encryption": "^5.1.2-
|
|
122
|
-
"@adonisjs/env": "^4.2.0-
|
|
123
|
-
"@adonisjs/events": "^9.0.0-
|
|
124
|
-
"@adonisjs/fold": "^9.9.3-
|
|
125
|
-
"@adonisjs/hash": "^8.3.1-
|
|
126
|
-
"@adonisjs/http-server": "^7.0.0-
|
|
127
|
-
"@adonisjs/logger": "^5.4.2-
|
|
128
|
-
"@adonisjs/repl": "^4.0.0-
|
|
129
|
-
"@antfu/install-pkg": "^0.2.0",
|
|
118
|
+
"@adonisjs/ace": "^12.3.2-5",
|
|
119
|
+
"@adonisjs/application": "^8.0.0-5",
|
|
120
|
+
"@adonisjs/bodyparser": "^10.0.0-3",
|
|
121
|
+
"@adonisjs/config": "^4.2.1-7",
|
|
122
|
+
"@adonisjs/encryption": "^5.1.2-5",
|
|
123
|
+
"@adonisjs/env": "^4.2.0-8",
|
|
124
|
+
"@adonisjs/events": "^9.0.0-2",
|
|
125
|
+
"@adonisjs/fold": "^9.9.3-14",
|
|
126
|
+
"@adonisjs/hash": "^8.3.1-9",
|
|
127
|
+
"@adonisjs/http-server": "^7.0.0-4",
|
|
128
|
+
"@adonisjs/logger": "^5.4.2-8",
|
|
129
|
+
"@adonisjs/repl": "^4.0.0-10",
|
|
130
130
|
"@paralleldrive/cuid2": "^2.2.2",
|
|
131
|
-
"@poppinss/macroable": "^1.0.
|
|
132
|
-
"@poppinss/utils": "^6.
|
|
131
|
+
"@poppinss/macroable": "^1.0.1",
|
|
132
|
+
"@poppinss/utils": "^6.7.0",
|
|
133
133
|
"@sindresorhus/is": "^6.0.1",
|
|
134
134
|
"@types/he": "^1.2.3",
|
|
135
135
|
"execa": "^8.0.1",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"youch-terminal": "^2.2.3"
|
|
142
142
|
},
|
|
143
143
|
"peerDependencies": {
|
|
144
|
-
"@adonisjs/assembler": "^
|
|
144
|
+
"@adonisjs/assembler": "^7.0.0-0",
|
|
145
145
|
"@vinejs/vine": "^1.7.0",
|
|
146
146
|
"argon2": "^0.31.1",
|
|
147
147
|
"bcrypt": "^5.1.1",
|
|
File without changes
|