@adonisjs/core 7.0.0-next.13 → 7.0.0-next.14
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.
|
@@ -9,23 +9,27 @@ function indexEntities(entities = {}) {
|
|
|
9
9
|
const events = Object.assign({
|
|
10
10
|
enabled: true,
|
|
11
11
|
source: "app/events",
|
|
12
|
-
importAlias: "#events"
|
|
12
|
+
importAlias: "#events",
|
|
13
|
+
skipSegments: ["events"]
|
|
13
14
|
}, entities.events);
|
|
14
15
|
const listeners = Object.assign({
|
|
15
16
|
enabled: true,
|
|
16
17
|
source: "app/listeners",
|
|
17
|
-
importAlias: "#listeners"
|
|
18
|
+
importAlias: "#listeners",
|
|
19
|
+
skipSegments: ["listeners"]
|
|
18
20
|
}, entities.listeners);
|
|
19
21
|
const controllers = Object.assign({
|
|
20
22
|
enabled: true,
|
|
21
23
|
source: "app/controllers",
|
|
22
|
-
importAlias: "#controllers"
|
|
24
|
+
importAlias: "#controllers",
|
|
25
|
+
skipSegments: ["controllers"]
|
|
23
26
|
}, entities.controllers);
|
|
24
27
|
const transformers = Object.assign({
|
|
25
28
|
enabled: false,
|
|
26
29
|
source: "app/transformers",
|
|
27
30
|
importAlias: "#transformers",
|
|
28
|
-
withSharedProps: false
|
|
31
|
+
withSharedProps: false,
|
|
32
|
+
skipSegments: ["transformers"]
|
|
29
33
|
}, entities.transformers);
|
|
30
34
|
return { run(_, indexGenerator) {
|
|
31
35
|
if (events.enabled) indexGenerator.add("events", {
|
|
@@ -35,6 +39,7 @@ function indexEntities(entities = {}) {
|
|
|
35
39
|
as: "barrelFile",
|
|
36
40
|
exportName: "events",
|
|
37
41
|
importAlias: events.importAlias,
|
|
42
|
+
skipSegments: events.skipSegments,
|
|
38
43
|
output: ".adonisjs/server/events.ts"
|
|
39
44
|
});
|
|
40
45
|
if (listeners.enabled) indexGenerator.add("listeners", {
|
|
@@ -43,6 +48,7 @@ function indexEntities(entities = {}) {
|
|
|
43
48
|
as: "barrelFile",
|
|
44
49
|
exportName: "listeners",
|
|
45
50
|
importAlias: listeners.importAlias,
|
|
51
|
+
skipSegments: listeners.skipSegments,
|
|
46
52
|
output: ".adonisjs/server/listeners.ts"
|
|
47
53
|
});
|
|
48
54
|
if (controllers.enabled) indexGenerator.add("controllers", {
|
|
@@ -51,6 +57,7 @@ function indexEntities(entities = {}) {
|
|
|
51
57
|
as: "barrelFile",
|
|
52
58
|
exportName: "controllers",
|
|
53
59
|
importAlias: controllers.importAlias,
|
|
60
|
+
skipSegments: controllers.skipSegments,
|
|
54
61
|
removeSuffix: "controller",
|
|
55
62
|
output: ".adonisjs/server/controllers.ts"
|
|
56
63
|
});
|
|
@@ -60,8 +67,9 @@ function indexEntities(entities = {}) {
|
|
|
60
67
|
as(vfs, buffer, __, helpers) {
|
|
61
68
|
outputTransformerDataObjects(vfs.asTree({
|
|
62
69
|
transformKey(key) {
|
|
63
|
-
|
|
70
|
+
let segments = key.split("/");
|
|
64
71
|
const baseName = segments.pop();
|
|
72
|
+
if (transformers.skipSegments?.length) segments = segments.filter((s) => !transformers.skipSegments.includes(s));
|
|
65
73
|
return [...segments.map((segment) => string_default.pascalCase(segment)), string_default.create(baseName).removeSuffix("transformer").pascalCase()].join("/");
|
|
66
74
|
},
|
|
67
75
|
transformValue: helpers.toImportPath
|
|
@@ -8,7 +8,7 @@ import "../../app-BK0PN3li.js";
|
|
|
8
8
|
import "../../config_provider-CY-xuo2R.js";
|
|
9
9
|
import "../../string-CJ7ewUFq.js";
|
|
10
10
|
import "../../utils-Dpa3iJz-.js";
|
|
11
|
-
import "../../core-
|
|
11
|
+
import "../../core-CffBtWJW.js";
|
|
12
12
|
import "../../main-BWftwyAK.js";
|
|
13
13
|
import "../../logger-Dha-0hp1.js";
|
|
14
14
|
import "../../main-CFmDHDls.js";
|
|
@@ -8,7 +8,7 @@ import "../../app-BK0PN3li.js";
|
|
|
8
8
|
import "../../config_provider-CY-xuo2R.js";
|
|
9
9
|
import "../../string-CJ7ewUFq.js";
|
|
10
10
|
import "../../utils-Dpa3iJz-.js";
|
|
11
|
-
import "../../core-
|
|
11
|
+
import "../../core-CffBtWJW.js";
|
|
12
12
|
import "../../logger-Dha-0hp1.js";
|
|
13
13
|
import "../../main-CFmDHDls.js";
|
|
14
14
|
import "../../main-BrJQ1VAM.js";
|
package/build/factories/stubs.js
CHANGED
|
@@ -8,7 +8,7 @@ import "../app-BK0PN3li.js";
|
|
|
8
8
|
import "../config_provider-CY-xuo2R.js";
|
|
9
9
|
import "../string-CJ7ewUFq.js";
|
|
10
10
|
import "../utils-Dpa3iJz-.js";
|
|
11
|
-
import "../core-
|
|
11
|
+
import "../core-CffBtWJW.js";
|
|
12
12
|
import { AppFactory } from "@adonisjs/application/factories";
|
|
13
13
|
var StubsFactory = class {
|
|
14
14
|
#parameters = {};
|
package/build/index.js
CHANGED
|
@@ -8,6 +8,6 @@ import "./app-BK0PN3li.js";
|
|
|
8
8
|
import { t as configProvider } from "./config_provider-CY-xuo2R.js";
|
|
9
9
|
import "./string-CJ7ewUFq.js";
|
|
10
10
|
import "./utils-Dpa3iJz-.js";
|
|
11
|
-
import { n as prettyPrintError, r as indexEntities, t as errors } from "./core-
|
|
11
|
+
import { n as prettyPrintError, r as indexEntities, t as errors } from "./core-CffBtWJW.js";
|
|
12
12
|
var inject = container_exports.inject;
|
|
13
13
|
export { Ignitor, configProvider, errors, indexEntities, inject, prettyPrintError, stubsRoot };
|
package/build/src/types.d.ts
CHANGED
|
@@ -349,6 +349,8 @@ export type IndexEntitiesConfig = {
|
|
|
349
349
|
importAlias?: string;
|
|
350
350
|
/** Glob patterns for matching controller files */
|
|
351
351
|
glob?: string[];
|
|
352
|
+
/** Path segments to skip from generated keys. Defaults to ['controllers'] */
|
|
353
|
+
skipSegments?: string[];
|
|
352
354
|
};
|
|
353
355
|
/** Configuration for listeners indexing */
|
|
354
356
|
listeners?: {
|
|
@@ -360,6 +362,8 @@ export type IndexEntitiesConfig = {
|
|
|
360
362
|
importAlias?: string;
|
|
361
363
|
/** Glob patterns for matching listener files */
|
|
362
364
|
glob?: string[];
|
|
365
|
+
/** Path segments to skip from generated keys. Defaults to ['listeners'] */
|
|
366
|
+
skipSegments?: string[];
|
|
363
367
|
};
|
|
364
368
|
/** Configuration for events indexing */
|
|
365
369
|
events?: {
|
|
@@ -371,6 +375,8 @@ export type IndexEntitiesConfig = {
|
|
|
371
375
|
importAlias?: string;
|
|
372
376
|
/** Glob patterns for matching event files */
|
|
373
377
|
glob?: string[];
|
|
378
|
+
/** Path segments to skip from generated keys. Defaults to ['events'] */
|
|
379
|
+
skipSegments?: string[];
|
|
374
380
|
};
|
|
375
381
|
transformers?: {
|
|
376
382
|
enabled?: boolean;
|
|
@@ -378,5 +384,7 @@ export type IndexEntitiesConfig = {
|
|
|
378
384
|
source?: string;
|
|
379
385
|
importAlias?: string;
|
|
380
386
|
glob?: string[];
|
|
387
|
+
/** Path segments to skip from generated keys. Defaults to ['transformers'] */
|
|
388
|
+
skipSegments?: string[];
|
|
381
389
|
};
|
|
382
390
|
};
|
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.14",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
7
7
|
},
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@adonisjs/assembler": "^8.0.0-next.
|
|
80
|
+
"@adonisjs/assembler": "^8.0.0-next.21",
|
|
81
81
|
"@adonisjs/eslint-config": "^3.0.0-next.4",
|
|
82
82
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
83
83
|
"@adonisjs/tsconfig": "^2.0.0-next.3",
|