@venizia/ignis-boot 0.5.0-1 → 0.5.0-3
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TConstValue } from '@venizia/ignis-helpers';
|
|
2
|
+
import { ConstClass } from '@venizia/ignis-helpers/common';
|
|
2
3
|
/** Mirrors the kernel's `ArtifactTypes` values; boot must not depend on kernel (`{boot, kernel} -> core` in the build chain). */
|
|
3
|
-
export declare class ArtifactTypes {
|
|
4
|
+
export declare class ArtifactTypes extends ConstClass {
|
|
4
5
|
static readonly CONFIGURATION = "configuration";
|
|
5
6
|
static readonly COMPONENT = "component";
|
|
6
7
|
static readonly CONTROLLER = "controller";
|
|
@@ -8,21 +9,17 @@ export declare class ArtifactTypes {
|
|
|
8
9
|
static readonly REPOSITORY = "repository";
|
|
9
10
|
static readonly DATASOURCE = "datasource";
|
|
10
11
|
static readonly MODEL = "model";
|
|
11
|
-
static readonly SCHEME_SET: Set<string>;
|
|
12
|
-
static isValid(value: string): boolean;
|
|
13
12
|
}
|
|
14
13
|
/** One of the `ArtifactTypes` values. */
|
|
15
14
|
export type TArtifactType = TConstValue<typeof ArtifactTypes>;
|
|
16
15
|
/** Mirrors the kernel's `ArtifactIndexFields` - the keys of the object the emitter writes and `registerArtifacts` reads. */
|
|
17
|
-
export declare class ArtifactIndexFields {
|
|
16
|
+
export declare class ArtifactIndexFields extends ConstClass {
|
|
18
17
|
static readonly CONFIGURATIONS = "configurations";
|
|
19
18
|
static readonly DATA_SOURCES = "dataSources";
|
|
20
19
|
static readonly COMPONENTS = "components";
|
|
21
20
|
static readonly REPOSITORIES = "repositories";
|
|
22
21
|
static readonly SERVICES = "services";
|
|
23
22
|
static readonly CONTROLLERS = "controllers";
|
|
24
|
-
static readonly SCHEME_SET: Set<string>;
|
|
25
|
-
static isValid(value: string): boolean;
|
|
26
23
|
}
|
|
27
24
|
/** One of the `ArtifactIndexFields` values. */
|
|
28
25
|
export type TArtifactIndexField = TConstValue<typeof ArtifactIndexFields>;
|
|
@@ -51,12 +48,10 @@ export declare class ArtifactStereotypes {
|
|
|
51
48
|
}>;
|
|
52
49
|
}
|
|
53
50
|
/** Why a decorated class was left out of the index - reported, never silent. */
|
|
54
|
-
export declare class ScanSkipReasons {
|
|
51
|
+
export declare class ScanSkipReasons extends ConstClass {
|
|
55
52
|
static readonly ABSTRACT = "abstract";
|
|
56
53
|
static readonly NOT_EXPORTED = "not-exported";
|
|
57
54
|
static readonly IGNORED = "ignored";
|
|
58
|
-
static readonly SCHEME_SET: Set<string>;
|
|
59
|
-
static isValid(value: string): boolean;
|
|
60
55
|
}
|
|
61
56
|
/** One of the `ScanSkipReasons` values. */
|
|
62
57
|
export type TScanSkipReason = TConstValue<typeof ScanSkipReasons>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ConstClass } from '@venizia/ignis-helpers/common';
|
|
1
2
|
/** Mirrors the kernel's `ArtifactTypes` values; boot must not depend on kernel (`{boot, kernel} -> core` in the build chain). */
|
|
2
|
-
export class ArtifactTypes {
|
|
3
|
+
export class ArtifactTypes extends ConstClass {
|
|
3
4
|
static { this.CONFIGURATION = 'configuration'; }
|
|
4
5
|
static { this.COMPONENT = 'component'; }
|
|
5
6
|
static { this.CONTROLLER = 'controller'; }
|
|
@@ -7,38 +8,15 @@ export class ArtifactTypes {
|
|
|
7
8
|
static { this.REPOSITORY = 'repository'; }
|
|
8
9
|
static { this.DATASOURCE = 'datasource'; }
|
|
9
10
|
static { this.MODEL = 'model'; }
|
|
10
|
-
static { this.SCHEME_SET = new Set([
|
|
11
|
-
this.CONFIGURATION,
|
|
12
|
-
this.COMPONENT,
|
|
13
|
-
this.CONTROLLER,
|
|
14
|
-
this.SERVICE,
|
|
15
|
-
this.REPOSITORY,
|
|
16
|
-
this.DATASOURCE,
|
|
17
|
-
this.MODEL,
|
|
18
|
-
]); }
|
|
19
|
-
static isValid(value) {
|
|
20
|
-
return this.SCHEME_SET.has(value);
|
|
21
|
-
}
|
|
22
11
|
}
|
|
23
12
|
/** Mirrors the kernel's `ArtifactIndexFields` - the keys of the object the emitter writes and `registerArtifacts` reads. */
|
|
24
|
-
export class ArtifactIndexFields {
|
|
13
|
+
export class ArtifactIndexFields extends ConstClass {
|
|
25
14
|
static { this.CONFIGURATIONS = 'configurations'; }
|
|
26
15
|
static { this.DATA_SOURCES = 'dataSources'; }
|
|
27
16
|
static { this.COMPONENTS = 'components'; }
|
|
28
17
|
static { this.REPOSITORIES = 'repositories'; }
|
|
29
18
|
static { this.SERVICES = 'services'; }
|
|
30
19
|
static { this.CONTROLLERS = 'controllers'; }
|
|
31
|
-
static { this.SCHEME_SET = new Set([
|
|
32
|
-
this.CONFIGURATIONS,
|
|
33
|
-
this.DATA_SOURCES,
|
|
34
|
-
this.COMPONENTS,
|
|
35
|
-
this.REPOSITORIES,
|
|
36
|
-
this.SERVICES,
|
|
37
|
-
this.CONTROLLERS,
|
|
38
|
-
]); }
|
|
39
|
-
static isValid(value) {
|
|
40
|
-
return this.SCHEME_SET.has(value);
|
|
41
|
-
}
|
|
42
20
|
}
|
|
43
21
|
/** How the scanner recognises a decorated class: the source glob, decorator-to-type map, default ignore patterns and the emit order. */
|
|
44
22
|
export class ArtifactStereotypes {
|
|
@@ -84,13 +62,9 @@ export class ArtifactStereotypes {
|
|
|
84
62
|
]; }
|
|
85
63
|
}
|
|
86
64
|
/** Why a decorated class was left out of the index - reported, never silent. */
|
|
87
|
-
export class ScanSkipReasons {
|
|
65
|
+
export class ScanSkipReasons extends ConstClass {
|
|
88
66
|
static { this.ABSTRACT = 'abstract'; }
|
|
89
67
|
static { this.NOT_EXPORTED = 'not-exported'; }
|
|
90
68
|
static { this.IGNORED = 'ignored'; }
|
|
91
|
-
static { this.SCHEME_SET = new Set([this.ABSTRACT, this.NOT_EXPORTED, this.IGNORED]); }
|
|
92
|
-
static isValid(value) {
|
|
93
|
-
return this.SCHEME_SET.has(value);
|
|
94
|
-
}
|
|
95
69
|
}
|
|
96
70
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/generator/common/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/generator/common/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,iIAAiI;AACjI,MAAM,OAAO,aAAc,SAAQ,UAAU;aAC3B,kBAAa,GAAG,eAAe,CAAC;aAChC,cAAS,GAAG,WAAW,CAAC;aACxB,eAAU,GAAG,YAAY,CAAC;aAC1B,YAAO,GAAG,SAAS,CAAC;aACpB,eAAU,GAAG,YAAY,CAAC;aAC1B,eAAU,GAAG,YAAY,CAAC;aAC1B,UAAK,GAAG,OAAO,CAAC;;AAMlC,4HAA4H;AAC5H,MAAM,OAAO,mBAAoB,SAAQ,UAAU;aACjC,mBAAc,GAAG,gBAAgB,CAAC;aAClC,iBAAY,GAAG,aAAa,CAAC;aAC7B,eAAU,GAAG,YAAY,CAAC;aAC1B,iBAAY,GAAG,cAAc,CAAC;aAC9B,aAAQ,GAAG,UAAU,CAAC;aACtB,gBAAW,GAAG,aAAa,CAAC;;AAM9C,wIAAwI;AACxI,MAAM,OAAO,mBAAmB;IAC9B,2EAA2E;aAC3D,gBAAW,GAAG,eAAe,CAAC;IAC9C,kHAAkH;aAClG,qBAAgB,GAAG,SAAS,CAAC;IAC7C,oGAAoG;aACpF,iBAAY,GAA4C;QACtE,aAAa,EAAE,aAAa,CAAC,aAAa;QAC1C,SAAS,EAAE,aAAa,CAAC,SAAS;QAClC,UAAU,EAAE,aAAa,CAAC,UAAU;QACpC,OAAO,EAAE,aAAa,CAAC,OAAO;QAC9B,UAAU,EAAE,aAAa,CAAC,UAAU;QACpC,UAAU,EAAE,aAAa,CAAC,UAAU;QACpC,KAAK,EAAE,aAAa,CAAC,KAAK;KAC3B,CAAC;aAEc,mBAAc,GAAG,YAAY,CAAC;aAE9B,eAAU,GAAG,IAAI,GAAG,CAAS,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;IAE9F,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;aAEe,mBAAc,GAAG,wCAAwC,CAAC;aAE1D,mBAAc,GAAG;QAC/B,iBAAiB;QACjB,oBAAoB;QACpB,oBAAoB;QACpB,iBAAiB;KAClB,CAAC;IAEF;;;;;OAKG;aACa,eAAU,GAAuE;QAC/F,EAAE,IAAI,EAAE,aAAa,CAAC,aAAa,EAAE,KAAK,EAAE,mBAAmB,CAAC,cAAc,EAAE;QAChF,EAAE,IAAI,EAAE,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,mBAAmB,CAAC,YAAY,EAAE;QAC3E,EAAE,IAAI,EAAE,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,mBAAmB,CAAC,UAAU,EAAE;QACxE,EAAE,IAAI,EAAE,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,mBAAmB,CAAC,YAAY,EAAE;QAC3E,EAAE,IAAI,EAAE,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE;QACpE,EAAE,IAAI,EAAE,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,mBAAmB,CAAC,WAAW,EAAE;KAC3E,CAAC;;AAGJ,gFAAgF;AAChF,MAAM,OAAO,eAAgB,SAAQ,UAAU;aAC7B,aAAQ,GAAG,UAAU,CAAC;aACtB,iBAAY,GAAG,cAAc,CAAC;aAC9B,YAAO,GAAG,SAAS,CAAC","sourcesContent":["import type { TConstValue } from '@venizia/ignis-helpers';\nimport { ConstClass } from '@venizia/ignis-helpers/common';\n\n/** Mirrors the kernel's `ArtifactTypes` values; boot must not depend on kernel (`{boot, kernel} -> core` in the build chain). */\nexport class ArtifactTypes extends ConstClass {\n static readonly CONFIGURATION = 'configuration';\n static readonly COMPONENT = 'component';\n static readonly CONTROLLER = 'controller';\n static readonly SERVICE = 'service';\n static readonly REPOSITORY = 'repository';\n static readonly DATASOURCE = 'datasource';\n static readonly MODEL = 'model';\n}\n\n/** One of the `ArtifactTypes` values. */\nexport type TArtifactType = TConstValue<typeof ArtifactTypes>;\n\n/** Mirrors the kernel's `ArtifactIndexFields` - the keys of the object the emitter writes and `registerArtifacts` reads. */\nexport class ArtifactIndexFields extends ConstClass {\n static readonly CONFIGURATIONS = 'configurations';\n static readonly DATA_SOURCES = 'dataSources';\n static readonly COMPONENTS = 'components';\n static readonly REPOSITORIES = 'repositories';\n static readonly SERVICES = 'services';\n static readonly CONTROLLERS = 'controllers';\n}\n\n/** One of the `ArtifactIndexFields` values. */\nexport type TArtifactIndexField = TConstValue<typeof ArtifactIndexFields>;\n\n/** How the scanner recognises a decorated class: the source glob, decorator-to-type map, default ignore patterns and the emit order. */\nexport class ArtifactStereotypes {\n /** The source files the scanner reads: TypeScript, with or without JSX. */\n static readonly SOURCE_GLOB = '**/*.{ts,tsx}';\n /** The extension of a source file - stripped for an import specifier, replaced by `.js` for its compiled copy. */\n static readonly SOURCE_EXTENSION = /\\.tsx?$/;\n /** Decorator name as imported from `@venizia/ignis` or `@venizia/ignis-kernel` -> artifact type. */\n static readonly BY_DECORATOR: Readonly<Record<string, TArtifactType>> = {\n configuration: ArtifactTypes.CONFIGURATION,\n component: ArtifactTypes.COMPONENT,\n controller: ArtifactTypes.CONTROLLER,\n service: ArtifactTypes.SERVICE,\n repository: ArtifactTypes.REPOSITORY,\n datasource: ArtifactTypes.DATASOURCE,\n model: ArtifactTypes.MODEL,\n };\n\n static readonly ROOT_DECORATOR = 'injectable';\n\n static readonly SCHEME_SET = new Set<string>(Object.values(ArtifactStereotypes.BY_DECORATOR));\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n\n static readonly SOURCE_MODULES = /^@venizia\\/ignis(?:-kernel)?(?:\\/.+)?$/;\n\n static readonly DEFAULT_IGNORE = [\n '**/__tests__/**',\n '**/*.test.{ts,tsx}',\n '**/*.spec.{ts,tsx}',\n '**/generated/**',\n ];\n\n /**\n * The kernel's `registerArtifacts` order; `model` is never emitted. Configurations come first:\n * `registerConfigurations` runs before the datasource and component sweeps, so a `@configuration`\n * can shape what they read. The kernel sorts them among themselves by their `after` declarations\n * at boot, so the order within the field does not matter here.\n */\n static readonly EMIT_ORDER: ReadonlyArray<{ type: TArtifactType; field: TArtifactIndexField }> = [\n { type: ArtifactTypes.CONFIGURATION, field: ArtifactIndexFields.CONFIGURATIONS },\n { type: ArtifactTypes.DATASOURCE, field: ArtifactIndexFields.DATA_SOURCES },\n { type: ArtifactTypes.COMPONENT, field: ArtifactIndexFields.COMPONENTS },\n { type: ArtifactTypes.REPOSITORY, field: ArtifactIndexFields.REPOSITORIES },\n { type: ArtifactTypes.SERVICE, field: ArtifactIndexFields.SERVICES },\n { type: ArtifactTypes.CONTROLLER, field: ArtifactIndexFields.CONTROLLERS },\n ];\n}\n\n/** Why a decorated class was left out of the index - reported, never silent. */\nexport class ScanSkipReasons extends ConstClass {\n static readonly ABSTRACT = 'abstract';\n static readonly NOT_EXPORTED = 'not-exported';\n static readonly IGNORED = 'ignored';\n}\n\n/** One of the `ScanSkipReasons` values. */\nexport type TScanSkipReason = TConstValue<typeof ScanSkipReasons>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-boot",
|
|
3
|
-
"version": "0.5.0-
|
|
3
|
+
"version": "0.5.0-3",
|
|
4
4
|
"description": "Build-time artifact index generator for IGNIS applications: scans decorated classes with the TypeScript AST and emits one static registration file per package, so bun build --compile sees plain imports.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"artifact-index",
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
"test": "bun test ./src"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@venizia/ignis-helpers": "0.5.0-
|
|
84
|
-
"@venizia/ignis-inversion": "0.5.0-
|
|
83
|
+
"@venizia/ignis-helpers": "0.5.0-3",
|
|
84
|
+
"@venizia/ignis-inversion": "0.5.0-1"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/bun": "^1.4.5",
|
|
88
|
-
"@venizia/dev-configs": "0.5.0-
|
|
88
|
+
"@venizia/dev-configs": "0.5.0-6",
|
|
89
89
|
"eslint": "^10.13.0",
|
|
90
90
|
"oxlint": "1.89.0",
|
|
91
91
|
"oxlint-tsgolint": "7.0.2004",
|