@adonisjs/core 7.0.0-next.8 → 7.0.0-next.9
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/serve.js
CHANGED
|
@@ -12,8 +12,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
+
import { importAssembler } from "../src/utils.js";
|
|
15
16
|
import { BaseCommand, flags } from "../modules/ace/main.js";
|
|
16
|
-
import { importAssembler, importTypeScript } from "../src/utils.js";
|
|
17
17
|
/**
|
|
18
18
|
* Serve command is used to run the AdonisJS HTTP server during development. The
|
|
19
19
|
* command under the hood runs the "bin/server.ts" file and watches for file
|
|
@@ -119,20 +119,14 @@ export default class Serve extends BaseCommand {
|
|
|
119
119
|
this.exitCode = 1;
|
|
120
120
|
this.terminate();
|
|
121
121
|
});
|
|
122
|
-
const ts = await importTypeScript(this.app);
|
|
123
|
-
if (!ts) {
|
|
124
|
-
this.#logMissingDevelopmentDependency('typescript');
|
|
125
|
-
this.exitCode = 1;
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
122
|
/**
|
|
129
123
|
* Start the development server
|
|
130
124
|
*/
|
|
131
125
|
if (this.watch) {
|
|
132
|
-
await this.devServer.startAndWatch(
|
|
126
|
+
await this.devServer.startAndWatch({ poll: this.poll || false });
|
|
133
127
|
}
|
|
134
128
|
else {
|
|
135
|
-
await this.devServer.start(
|
|
129
|
+
await this.devServer.start();
|
|
136
130
|
}
|
|
137
131
|
}
|
|
138
132
|
}
|
package/build/commands/test.js
CHANGED
|
@@ -12,8 +12,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
+
import { importAssembler } from "../src/utils.js";
|
|
15
16
|
import { BaseCommand, flags, args } from "../modules/ace/main.js";
|
|
16
|
-
import { importAssembler, importTypeScript } from "../src/utils.js";
|
|
17
17
|
/**
|
|
18
18
|
* Command to run application tests using the Japa test runner.
|
|
19
19
|
* Supports filtering tests by suites, files, tags, groups, and individual tests.
|
|
@@ -151,13 +151,7 @@ export default class Test extends BaseCommand {
|
|
|
151
151
|
* Start the test runner in watch mode
|
|
152
152
|
*/
|
|
153
153
|
if (this.watch) {
|
|
154
|
-
|
|
155
|
-
if (!ts) {
|
|
156
|
-
this.#logMissingDevelopmentDependency('typescript');
|
|
157
|
-
this.exitCode = 1;
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
await this.testsRunner.runAndWatch(ts, { poll: this.poll || false });
|
|
154
|
+
await this.testsRunner.runAndWatch({ poll: this.poll || false });
|
|
161
155
|
}
|
|
162
156
|
else {
|
|
163
157
|
await this.testsRunner.run();
|
|
@@ -174,19 +174,20 @@ export default class AppServiceProvider {
|
|
|
174
174
|
*/
|
|
175
175
|
protected registerDumper(): void;
|
|
176
176
|
/**
|
|
177
|
-
* Generates
|
|
178
|
-
* them to the ".adonisjs/server/routes.d.ts" file
|
|
177
|
+
* Generates TypeScript type definitions and JSON representation of routes
|
|
179
178
|
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
179
|
+
* Creates route type definitions for better IDE support and a JSON file
|
|
180
|
+
* containing all registered routes. This is used in development mode for
|
|
181
|
+
* tooling integration and type-safety.
|
|
182
182
|
*
|
|
183
|
-
* @param router - The router instance
|
|
183
|
+
* @param router - The router instance containing registered routes
|
|
184
184
|
*
|
|
185
185
|
* @example
|
|
186
|
-
* await
|
|
187
|
-
*
|
|
186
|
+
* const router = await container.make('router')
|
|
187
|
+
* await this.emitRoutes(router)
|
|
188
|
+
* // Generates .adonisjs/server/routes.d.ts and routes.json
|
|
188
189
|
*/
|
|
189
|
-
protected
|
|
190
|
+
protected emitRoutes(router: Router): Promise<void>;
|
|
190
191
|
/**
|
|
191
192
|
* Registers bindings
|
|
192
193
|
*
|
|
@@ -256,36 +256,42 @@ export default class AppServiceProvider {
|
|
|
256
256
|
this.app.container.alias('dumper', Dumper);
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
|
-
* Generates
|
|
260
|
-
* them to the ".adonisjs/server/routes.d.ts" file
|
|
259
|
+
* Generates TypeScript type definitions and JSON representation of routes
|
|
261
260
|
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
261
|
+
* Creates route type definitions for better IDE support and a JSON file
|
|
262
|
+
* containing all registered routes. This is used in development mode for
|
|
263
|
+
* tooling integration and type-safety.
|
|
264
264
|
*
|
|
265
|
-
* @param router - The router instance
|
|
265
|
+
* @param router - The router instance containing registered routes
|
|
266
266
|
*
|
|
267
267
|
* @example
|
|
268
|
-
* await
|
|
269
|
-
*
|
|
268
|
+
* const router = await container.make('router')
|
|
269
|
+
* await this.emitRoutes(router)
|
|
270
|
+
* // Generates .adonisjs/server/routes.d.ts and routes.json
|
|
270
271
|
*/
|
|
271
|
-
async
|
|
272
|
+
async emitRoutes(router) {
|
|
272
273
|
try {
|
|
273
274
|
const { routes, imports, types } = router.generateTypes(2);
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
await
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
275
|
+
const routesTypesPath = this.app.generatedServerPath('routes.d.ts');
|
|
276
|
+
const routesJsonPath = this.app.generatedServerPath('routes.json');
|
|
277
|
+
await mkdir(dirname(routesTypesPath), { recursive: true });
|
|
278
|
+
await Promise.all([
|
|
279
|
+
writeFile(routesTypesPath, [
|
|
280
|
+
`import '@adonisjs/core/types/http'`,
|
|
281
|
+
...imports,
|
|
282
|
+
'',
|
|
283
|
+
...types,
|
|
284
|
+
'',
|
|
285
|
+
'export type ScannedRoutes = {',
|
|
286
|
+
routes,
|
|
287
|
+
'}',
|
|
288
|
+
`declare module '@adonisjs/core/types/http' {`,
|
|
289
|
+
' export interface RoutesList extends ScannedRoutes {}',
|
|
290
|
+
'}',
|
|
291
|
+
].join('\n')),
|
|
292
|
+
writeFile(routesJsonPath, JSON.stringify(router.toJSON())),
|
|
293
|
+
]);
|
|
294
|
+
this.app.notify({ isAdonisJS: true, routesFileLocation: routesJsonPath });
|
|
289
295
|
}
|
|
290
296
|
catch (error) {
|
|
291
297
|
console.error("Unable to generate routes types file due to the following error. This won't impact the dev-server");
|
|
@@ -346,8 +352,7 @@ export default class AppServiceProvider {
|
|
|
346
352
|
if (!this.app.inProduction) {
|
|
347
353
|
const router = await this.app.container.make('router');
|
|
348
354
|
if (router.commited) {
|
|
349
|
-
await this.
|
|
350
|
-
this.app.notify({ isAdonisJS: true, routes: JSON.stringify(router.toJSON()) });
|
|
355
|
+
await this.emitRoutes(router);
|
|
351
356
|
}
|
|
352
357
|
}
|
|
353
358
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/core",
|
|
3
3
|
"description": "Core of AdonisJS",
|
|
4
|
-
"version": "7.0.0-next.
|
|
4
|
+
"version": "7.0.0-next.9",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
7
7
|
},
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@adonisjs/assembler": "^8.0.0-next.
|
|
88
|
+
"@adonisjs/assembler": "^8.0.0-next.16",
|
|
89
89
|
"@adonisjs/eslint-config": "^3.0.0-next.4",
|
|
90
90
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
91
91
|
"@adonisjs/tsconfig": "^2.0.0-next.2",
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
"@japa/snapshot": "^2.0.9",
|
|
97
97
|
"@poppinss/ts-exec": "^1.4.1",
|
|
98
98
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
99
|
-
"@types/node": "^24.
|
|
99
|
+
"@types/node": "^24.10.0",
|
|
100
100
|
"@types/pretty-hrtime": "^1.0.3",
|
|
101
101
|
"@types/sinon": "^17.0.4",
|
|
102
102
|
"@types/supertest": "^6.0.3",
|
|
103
103
|
"@types/test-console": "^2.0.3",
|
|
104
|
-
"@vinejs/vine": "^4.0
|
|
104
|
+
"@vinejs/vine": "^4.1.0",
|
|
105
105
|
"argon2": "^0.44.0",
|
|
106
106
|
"bcrypt": "^6.0.0",
|
|
107
107
|
"c8": "^10.1.3",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"cross-env": "^10.1.0",
|
|
110
110
|
"del-cli": "^7.0.0",
|
|
111
111
|
"edge.js": "^6.3.0",
|
|
112
|
-
"eslint": "^9.
|
|
112
|
+
"eslint": "^9.39.1",
|
|
113
113
|
"execa": "^9.6.0",
|
|
114
114
|
"get-port": "^7.1.0",
|
|
115
115
|
"prettier": "^3.6.2",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"@adonisjs/encryption": "^7.0.0-next.1",
|
|
131
131
|
"@adonisjs/env": "^7.0.0-next.1",
|
|
132
132
|
"@adonisjs/events": "^10.1.0-next.2",
|
|
133
|
-
"@adonisjs/fold": "^11.0.0-next.
|
|
133
|
+
"@adonisjs/fold": "^11.0.0-next.3",
|
|
134
134
|
"@adonisjs/hash": "^10.0.0-next.1",
|
|
135
135
|
"@adonisjs/health": "^3.0.0-next.0",
|
|
136
136
|
"@adonisjs/http-server": "^8.0.0-next.12",
|
|
@@ -138,10 +138,10 @@
|
|
|
138
138
|
"@adonisjs/logger": "^7.1.0-next.2",
|
|
139
139
|
"@adonisjs/repl": "^5.0.0-next.0",
|
|
140
140
|
"@poppinss/colors": "^4.1.5",
|
|
141
|
-
"@poppinss/dumper": "^0.6.
|
|
141
|
+
"@poppinss/dumper": "^0.6.5",
|
|
142
142
|
"@poppinss/macroable": "^1.1.0",
|
|
143
143
|
"@poppinss/utils": "^7.0.0-next.3",
|
|
144
|
-
"@sindresorhus/is": "^7.1.
|
|
144
|
+
"@sindresorhus/is": "^7.1.1",
|
|
145
145
|
"@types/he": "^1.2.3",
|
|
146
146
|
"error-stack-parser-es": "^1.0.5",
|
|
147
147
|
"he": "^1.2.0",
|