@venizia/ignis-boot 0.4.8-9 → 0.4.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.
@@ -1,16 +1,16 @@
1
- import type { TGeneratedArtifactIndex } from '../generator/index.js';
2
- /** The application's own artifacts as the kernel's group protocol (`isArtifactGroup`), built without depending on the kernel: inlined `content` in a binary, `resolve()` from source. Reading a kind throws, so a function that walks `configs.artifacts` cannot drop it as an empty index. */
3
- export declare class AutoArtifactGroup {
1
+ import type { TGeneratedArtifactIndex, TGeneratedArtifactIndexInput } from '../generator/index.js';
2
+ /** The application's own artifacts as the kernel's group protocol (`isArtifactGroup`), built without depending on the kernel: inlined `content` in a binary, `resolve()` from source. Reading a kind throws, so a function that walks `configs.artifacts` cannot drop it as an empty index. `TIndex` is the index type the content carries: it is inferred from what the application passes, and defaults to the bottom `TGeneratedArtifactIndex` when boot builds the group itself. */
3
+ export declare class AutoArtifactGroup<TIndex extends TGeneratedArtifactIndexInput = TGeneratedArtifactIndex> {
4
4
  readonly isArtifactGroup: true;
5
5
  readonly folder: undefined;
6
6
  readonly site: undefined;
7
- readonly content: TGeneratedArtifactIndex | undefined;
7
+ readonly content: TIndex | undefined;
8
8
  private readonly resolver;
9
9
  constructor(opts: {
10
- content?: TGeneratedArtifactIndex;
11
- resolve?: () => Promise<TGeneratedArtifactIndex>;
10
+ content?: TIndex;
11
+ resolve?: () => Promise<TIndex>;
12
12
  });
13
- resolve(): Promise<TGeneratedArtifactIndex>;
13
+ resolve(): Promise<TIndex>;
14
14
  private static unreadKind;
15
15
  get configurations(): never;
16
16
  get dataSources(): never;
@@ -1,6 +1,6 @@
1
1
  // The inversion package, not the helpers barrel: a browser bundle reaches this module, and the barrel loads node builtins.
2
2
  import { getError } from '@venizia/ignis-inversion';
3
- /** The application's own artifacts as the kernel's group protocol (`isArtifactGroup`), built without depending on the kernel: inlined `content` in a binary, `resolve()` from source. Reading a kind throws, so a function that walks `configs.artifacts` cannot drop it as an empty index. */
3
+ /** The application's own artifacts as the kernel's group protocol (`isArtifactGroup`), built without depending on the kernel: inlined `content` in a binary, `resolve()` from source. Reading a kind throws, so a function that walks `configs.artifacts` cannot drop it as an empty index. `TIndex` is the index type the content carries: it is inferred from what the application passes, and defaults to the bottom `TGeneratedArtifactIndex` when boot builds the group itself. */
4
4
  export class AutoArtifactGroup {
5
5
  constructor(opts) {
6
6
  this.isArtifactGroup = true;
@@ -1 +1 @@
1
- {"version":3,"file":"auto-group.js","sourceRoot":"","sources":["../../../src/bun/auto-group.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAC3H,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,+RAA+R;AAC/R,MAAM,OAAO,iBAAiB;IAO5B,YAAY,IAGX;QATQ,oBAAe,GAAG,IAAa,CAAC;QAChC,WAAM,GAAG,SAAS,CAAC;QACnB,SAAI,GAAG,SAAS,CAAC;QAQxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,QAAQ,CAAC;gBACb,OAAO,EAAE,8EAA8E;aACxF,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAEO,MAAM,CAAC,UAAU;QACvB,MAAM,QAAQ,CAAC;YACb,OAAO,EACL,sOAAsO;SACzO,CAAC,CAAC;IACL,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,WAAW;QACb,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,YAAY;QACd,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,WAAW;QACb,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;CACF","sourcesContent":["// The inversion package, not the helpers barrel: a browser bundle reaches this module, and the barrel loads node builtins.\nimport { getError } from '@venizia/ignis-inversion';\nimport type { TGeneratedArtifactIndex } from '../generator';\n\n/** The application's own artifacts as the kernel's group protocol (`isArtifactGroup`), built without depending on the kernel: inlined `content` in a binary, `resolve()` from source. Reading a kind throws, so a function that walks `configs.artifacts` cannot drop it as an empty index. */\nexport class AutoArtifactGroup {\n readonly isArtifactGroup = true as const;\n readonly folder = undefined;\n readonly site = undefined;\n readonly content: TGeneratedArtifactIndex | undefined;\n private readonly resolver: (() => Promise<TGeneratedArtifactIndex>) | undefined;\n\n constructor(opts: {\n content?: TGeneratedArtifactIndex;\n resolve?: () => Promise<TGeneratedArtifactIndex>;\n }) {\n this.content = opts.content;\n this.resolver = opts.resolve;\n }\n\n async resolve(): Promise<TGeneratedArtifactIndex> {\n if (this.content) {\n return this.content;\n }\n\n if (!this.resolver) {\n throw getError({\n message: '[@venizia/ignis-boot/auto] The auto group has neither content nor a resolver',\n });\n }\n\n return this.resolver();\n }\n\n private static unreadKind(): never {\n throw getError({\n message:\n '[@venizia/ignis-boot/auto] The application artifacts are resolved when artifacts are registered | A function that walks configs.artifacts must pass a group through untouched (check `isArtifactGroup`) instead of reading its kinds',\n });\n }\n\n get configurations(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get dataSources(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get components(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get repositories(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get services(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get controllers(): never {\n return AutoArtifactGroup.unreadKind();\n }\n}\n"]}
1
+ {"version":3,"file":"auto-group.js","sourceRoot":"","sources":["../../../src/bun/auto-group.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAC3H,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,wdAAwd;AACxd,MAAM,OAAO,iBAAiB;IAS5B,YAAY,IAA2D;QAN9D,oBAAe,GAAG,IAAa,CAAC;QAChC,WAAM,GAAG,SAAS,CAAC;QACnB,SAAI,GAAG,SAAS,CAAC;QAKxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,QAAQ,CAAC;gBACb,OAAO,EAAE,8EAA8E;aACxF,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAEO,MAAM,CAAC,UAAU;QACvB,MAAM,QAAQ,CAAC;YACb,OAAO,EACL,sOAAsO;SACzO,CAAC,CAAC;IACL,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,WAAW;QACb,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,YAAY;QACd,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,WAAW;QACb,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;CACF","sourcesContent":["// The inversion package, not the helpers barrel: a browser bundle reaches this module, and the barrel loads node builtins.\nimport { getError } from '@venizia/ignis-inversion';\nimport type { TGeneratedArtifactIndex, TGeneratedArtifactIndexInput } from '../generator';\n\n/** The application's own artifacts as the kernel's group protocol (`isArtifactGroup`), built without depending on the kernel: inlined `content` in a binary, `resolve()` from source. Reading a kind throws, so a function that walks `configs.artifacts` cannot drop it as an empty index. `TIndex` is the index type the content carries: it is inferred from what the application passes, and defaults to the bottom `TGeneratedArtifactIndex` when boot builds the group itself. */\nexport class AutoArtifactGroup<\n TIndex extends TGeneratedArtifactIndexInput = TGeneratedArtifactIndex,\n> {\n readonly isArtifactGroup = true as const;\n readonly folder = undefined;\n readonly site = undefined;\n readonly content: TIndex | undefined;\n private readonly resolver: (() => Promise<TIndex>) | undefined;\n\n constructor(opts: { content?: TIndex; resolve?: () => Promise<TIndex> }) {\n this.content = opts.content;\n this.resolver = opts.resolve;\n }\n\n async resolve(): Promise<TIndex> {\n if (this.content) {\n return this.content;\n }\n\n if (!this.resolver) {\n throw getError({\n message: '[@venizia/ignis-boot/auto] The auto group has neither content nor a resolver',\n });\n }\n\n return this.resolver();\n }\n\n private static unreadKind(): never {\n throw getError({\n message:\n '[@venizia/ignis-boot/auto] The application artifacts are resolved when artifacts are registered | A function that walks configs.artifacts must pass a group through untouched (check `isArtifactGroup`) instead of reading its kinds',\n });\n }\n\n get configurations(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get dataSources(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get components(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get repositories(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get services(): never {\n return AutoArtifactGroup.unreadKind();\n }\n\n get controllers(): never {\n return AutoArtifactGroup.unreadKind();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"auto-loader.js","sourceRoot":"","sources":["../../../src/bun/auto-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,aAAa,GAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,0MAA0M;AAC1M,MAAM,OAAO,mBAAmB;IAC9B,MAAM,CAAC,aAAa,CAAC,IAAyB;QAC5C,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,QAAQ,CAAC;gBACb,OAAO,EACL,sNAAsN;aACzN,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAI;QACf,mBAAmB,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,WAAW,EAAE,CAAC,CAAC;QAE1E,iGAAiG;QACjG,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,eAAe,CAAC,aAAa,CAAC;YAClD,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;SAC7C,CAAC,CAAC;QAEH,IAAI,eAAe,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC;YAE1D,OAAO,mBAAmB,CAAC,WAAW,CAAC;gBACrC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,gBAAgB,CAAC,EAAE,SAAS,EAAE,IAAI,EA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AAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC;iBAC5C,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;iBACpE,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;YAErD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvB,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;YACzB,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["import { getError } from '@venizia/ignis-helpers';\nimport type { AnyType, TClass } from '@venizia/ignis-helpers';\nimport { dirname } from 'node:path';\nimport {\n ArtifactStereotypes,\n ArtifactTypes,\n type IScannedArtifact,\n type TGeneratedArtifactIndex,\n} from '../generator/common';\nimport { ArtifactSources } from './sources';\n\n/** Loads the application's index for `@venizia/ignis-boot/auto` from source: registers the run-time plugin, then imports the virtual module. A binary never runs this - the build replaces the module. */\nexport class AutoArtifactsLoader {\n static assertRuntime(opts: { hasBun: boolean }): void {\n if (!opts.hasBun) {\n throw getError({\n message:\n '[@venizia/ignis-boot/auto] Auto artifacts need Bun (a Bun plugin builds the index) | On Node, generate the index with `ignis-artifacts generate --root src --out src/_artifacts.ts` and pass it to configs.artifacts',\n });\n }\n }\n\n static async load(): Promise<TGeneratedArtifactIndex> {\n AutoArtifactsLoader.assertRuntime({ hasBun: typeof Bun !== 'undefined' });\n\n // A warm scan cache needs neither the plugin nor TypeScript: import the listed classes directly.\n const entry = ArtifactSources.entry();\n const packageSource = ArtifactSources.packageSource({\n from: entry ? dirname(entry) : process.cwd(),\n });\n\n if (ArtifactSources.isCached({ packageSource })) {\n const artifacts = ArtifactSources.scan({ packageSource });\n\n return AutoArtifactsLoader.importIndex({\n artifacts: entry ? ArtifactSources.runningArtifacts({ artifacts, from: entry }) : artifacts,\n });\n }\n\n // A non-static specifier: a bundler must not pull the scanner (and TypeScript) into a binary.\n const pluginModule = './plugin';\n const { IgnisArtifactsPlugin } = await import(pluginModule);\n await IgnisArtifactsPlugin.registerRuntime();\n\n // A static specifier on purpose: a build without IgnisArtifactsPlugin then fails to resolve it, instead of shipping a binary with no classes.\n const { GeneratedArtifacts } = await import('ignis:artifacts');\n\n return GeneratedArtifacts;\n }\n\n /** The index the emitter would render for `artifacts`: modules imported in path order, each field sorted by class name. */\n static async importIndex(opts: {\n artifacts: IScannedArtifact[];\n }): Promise<TGeneratedArtifactIndex> {\n const emitted = opts.artifacts\n .filter((artifact) => artifact.type !== ArtifactTypes.MODEL)\n .sort(\n (left, right) =>\n left.filePath.localeCompare(right.filePath) ||\n left.className.localeCompare(right.className),\n );\n\n const loaded = new Map<IScannedArtifact, TClass<AnyType>>();\n\n for (const artifact of emitted) {\n const module = await import(artifact.filePath);\n loaded.set(artifact, module[artifact.className]);\n }\n\n const index: Record<string, Array<TClass<AnyType>>> = {};\n\n for (const { type, field } of ArtifactStereotypes.EMIT_ORDER) {\n const classes = emitted\n .filter((artifact) => artifact.type === type)\n .sort((left, right) => left.className.localeCompare(right.className))\n .flatMap((artifact) => loaded.get(artifact) ?? []);\n\n if (classes.length > 0) {\n index[field] = classes;\n }\n }\n\n return index;\n }\n}\n"]}
1
+ {"version":3,"file":"auto-loader.js","sourceRoot":"","sources":["../../../src/bun/auto-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,aAAa,GAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,0MAA0M;AAC1M,MAAM,O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KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;YACzB,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["import { getError } from '@venizia/ignis-helpers';\nimport type { TClass } from '@venizia/ignis-helpers';\nimport { dirname } from 'node:path';\nimport {\n ArtifactStereotypes,\n ArtifactTypes,\n type IScannedArtifact,\n type TGeneratedArtifactIndex,\n} from '../generator/common';\nimport { ArtifactSources } from './sources';\n\n/** Loads the application's index for `@venizia/ignis-boot/auto` from source: registers the run-time plugin, then imports the virtual module. A binary never runs this - the build replaces the module. */\nexport class AutoArtifactsLoader {\n static assertRuntime(opts: { hasBun: boolean }): void {\n if (!opts.hasBun) {\n throw getError({\n message:\n '[@venizia/ignis-boot/auto] Auto artifacts need Bun (a Bun plugin builds the index) | On Node, generate the index with `ignis-artifacts generate --root src --out src/_artifacts.ts` and pass it to configs.artifacts',\n });\n }\n }\n\n static async load(): Promise<TGeneratedArtifactIndex> {\n AutoArtifactsLoader.assertRuntime({ hasBun: typeof Bun !== 'undefined' });\n\n // A warm scan cache needs neither the plugin nor TypeScript: import the listed classes directly.\n const entry = ArtifactSources.entry();\n const packageSource = ArtifactSources.packageSource({\n from: entry ? dirname(entry) : process.cwd(),\n });\n\n if (ArtifactSources.isCached({ packageSource })) {\n const artifacts = ArtifactSources.scan({ packageSource });\n\n return AutoArtifactsLoader.importIndex({\n artifacts: entry ? ArtifactSources.runningArtifacts({ artifacts, from: entry }) : artifacts,\n });\n }\n\n // A non-static specifier: a bundler must not pull the scanner (and TypeScript) into a binary.\n const pluginModule = './plugin';\n const { IgnisArtifactsPlugin } = await import(pluginModule);\n await IgnisArtifactsPlugin.registerRuntime();\n\n // A static specifier on purpose: a build without IgnisArtifactsPlugin then fails to resolve it, instead of shipping a binary with no classes.\n const { GeneratedArtifacts } = await import('ignis:artifacts');\n\n return GeneratedArtifacts;\n }\n\n /** The index the emitter would render for `artifacts`: modules imported in path order, each field sorted by class name. */\n static async importIndex(opts: {\n artifacts: IScannedArtifact[];\n }): Promise<TGeneratedArtifactIndex> {\n const emitted = opts.artifacts\n .filter((artifact) => artifact.type !== ArtifactTypes.MODEL)\n .sort(\n (left, right) =>\n left.filePath.localeCompare(right.filePath) ||\n left.className.localeCompare(right.className),\n );\n\n const loaded = new Map<IScannedArtifact, TClass<unknown>>();\n\n for (const artifact of emitted) {\n const module = await import(artifact.filePath);\n loaded.set(artifact, module[artifact.className]);\n }\n\n const index: Record<string, Array<TClass<unknown>>> = {};\n\n for (const { type, field } of ArtifactStereotypes.EMIT_ORDER) {\n const classes = emitted\n .filter((artifact) => artifact.type === type)\n .sort((left, right) => left.className.localeCompare(right.className))\n .flatMap((artifact) => loaded.get(artifact) ?? []);\n\n if (classes.length > 0) {\n index[field] = classes;\n }\n }\n\n return index;\n }\n}\n"]}
@@ -4,6 +4,8 @@ import { GroupArtifactsResolver } from './group-resolver.js';
4
4
  // Groups a shared package defined without content resolve from source through this resolver.
5
5
  GroupArtifactsResolver.install();
6
6
  /** The application's own decorated classes, found by the scanner - pass it in `configs.artifacts`. From source the run-time plugin builds the index when artifacts are registered; in a binary built with `IgnisArtifactsPlugin` this module is replaced by one carrying the built index. */
7
- const AutoArtifacts = new AutoArtifactGroup({ resolve: () => AutoArtifactsLoader.load() });
7
+ const AutoArtifacts = new AutoArtifactGroup({
8
+ resolve: () => AutoArtifactsLoader.load(),
9
+ });
8
10
  export default AutoArtifacts;
9
11
  //# sourceMappingURL=auto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auto.js","sourceRoot":"","sources":["../../../src/bun/auto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,6FAA6F;AAC7F,sBAAsB,CAAC,OAAO,EAAE,CAAC;AAEjC,6RAA6R;AAC7R,MAAM,aAAa,GAAG,IAAI,iBAAiB,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAE3F,eAAe,aAAa,CAAC","sourcesContent":["import { AutoArtifactGroup } from './auto-group';\nimport { AutoArtifactsLoader } from './auto-loader';\nimport { GroupArtifactsResolver } from './group-resolver';\n\n// Groups a shared package defined without content resolve from source through this resolver.\nGroupArtifactsResolver.install();\n\n/** The application's own decorated classes, found by the scanner - pass it in `configs.artifacts`. From source the run-time plugin builds the index when artifacts are registered; in a binary built with `IgnisArtifactsPlugin` this module is replaced by one carrying the built index. */\nconst AutoArtifacts = new AutoArtifactGroup({ resolve: () => AutoArtifactsLoader.load() });\n\nexport default AutoArtifacts;\n"]}
1
+ {"version":3,"file":"auto.js","sourceRoot":"","sources":["../../../src/bun/auto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,6FAA6F;AAC7F,sBAAsB,CAAC,OAAO,EAAE,CAAC;AAEjC,6RAA6R;AAC7R,MAAM,aAAa,GAAsB,IAAI,iBAAiB,CAAC;IAC7D,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,IAAI,EAAE;CAC1C,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC","sourcesContent":["import { AutoArtifactGroup } from './auto-group';\nimport { AutoArtifactsLoader } from './auto-loader';\nimport { GroupArtifactsResolver } from './group-resolver';\n\n// Groups a shared package defined without content resolve from source through this resolver.\nGroupArtifactsResolver.install();\n\n/** The application's own decorated classes, found by the scanner - pass it in `configs.artifacts`. From source the run-time plugin builds the index when artifacts are registered; in a binary built with `IgnisArtifactsPlugin` this module is replaced by one carrying the built index. */\nconst AutoArtifacts: AutoArtifactGroup = new AutoArtifactGroup({\n resolve: () => AutoArtifactsLoader.load(),\n});\n\nexport default AutoArtifacts;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"group-resolver.js","sourceRoot":"","sources":["../../../src/bun/group-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAgC,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,2OAA2O;AAC3O,MAAM,OAAO,sBAAsB;IACjC,uGAAuG;aACvF,eAAU,GAAG,MAAM,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;IAEzF,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAMpB;QACC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE5C,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,QAAQ,CAAC;gBACb,OAAO,EAAE,oBAAoB,MAAM,IAAI,eAAe,6GAA6G;aACpK,CAAC,CAAC;QACL,CAAC;QAED,IACE,CAAC,eAAe,CAAC,QAAQ,CAAC;YACxB,aAAa,EAAE,eAAe,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;SACtE,CAAC,EACF,CAAC;YACD,MAAM,eAAe,CAAC,WAAW,EAAE,CAAC;QACtC,CAAC;QAED,MAAM,KAAK,GAA2C,EAAE,CAAC;QAEzD,KAAK,MAAM,QAAQ,IAAI,eAAe,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YACjF,MAAM,KAAK,GAAG,mBAAmB,CAAC,UAAU,CAAC,IAAI,CAC/C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CACxC,EAAE,KAAK,CAAC;YAET,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,SAAS;YACX,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC/C,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;QACvE,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,mIAAmI;IACnI,MAAM,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAY,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;QACrF,MAAM,MAAM,GACV,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,MAAM,CAAC,OAAO,GAAG,CAAC,WAMjB,EAAE,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,sBAAsB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC","sourcesContent":["import { getError } from '@venizia/ignis-helpers';\nimport type { AnyType, TClass } from '@venizia/ignis-helpers';\nimport { ArtifactStereotypes, type TGeneratedArtifactIndex } from '../generator/common';\nimport { dirname } from 'node:path';\nimport { ArtifactSources } from './sources';\n\n/** Fills an `ArtifactGroup` defined without content, from source: the defining package is the nearest `package.json` above the group's call site, and the group is every decorated class under a directory named `folder` in its `src`. */\nexport class GroupArtifactsResolver {\n /** The kernel's `SingletonRealm` slot for the group resolver (`ArtifactGroup.SINGLETON_REALM_KEY`). */\n static readonly REALM_SLOT = Symbol.for('@venizia/ignis-kernel:artifact-group-resolver');\n\n static async resolve(opts: {\n group: {\n folder: string | undefined;\n site: string | undefined;\n ignore?: ReadonlyArray<string>;\n };\n }): Promise<TGeneratedArtifactIndex> {\n const { folder, site, ignore } = opts.group;\n\n if (!site) {\n throw getError({\n message: `[ArtifactGroup] '${folder ?? '<application>'}' has no call site to resolve from | Define it with ArtifactGroup.define in the shared package's own source`,\n });\n }\n\n if (\n !ArtifactSources.isCached({\n packageSource: ArtifactSources.packageSource({ from: dirname(site) }),\n })\n ) {\n await ArtifactSources.loadScanner();\n }\n\n const index: Record<string, Array<TClass<AnyType>>> = {};\n\n for (const artifact of ArtifactSources.folderArtifacts({ folder, site, ignore })) {\n const field = ArtifactStereotypes.EMIT_ORDER.find(\n (entry) => entry.type === artifact.type,\n )?.field;\n\n if (!field) {\n continue;\n }\n\n const loaded = await import(artifact.filePath);\n index[field] = [...(index[field] ?? []), loaded[artifact.className]];\n }\n\n return index;\n }\n\n /** Fills the kernel's realm slot; the holder may already exist (the kernel created it empty), so it is mutated, never replaced. */\n static install(): void {\n const existing: unknown = Reflect.get(globalThis, GroupArtifactsResolver.REALM_SLOT);\n const holder: { resolve?: unknown } =\n typeof existing === 'object' && existing !== null ? existing : {};\n holder.resolve = (resolveOpts: {\n group: {\n folder: string | undefined;\n site: string | undefined;\n ignore?: ReadonlyArray<string>;\n };\n }) => GroupArtifactsResolver.resolve(resolveOpts);\n Reflect.set(globalThis, GroupArtifactsResolver.REALM_SLOT, holder);\n }\n}\n"]}
1
+ {"version":3,"file":"group-resolver.js","sourceRoot":"","sources":["../../../src/bun/group-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAgC,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,2OAA2O;AAC3O,MAAM,OA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mI;IACnI,MAAM,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAY,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;QACrF,MAAM,MAAM,GACV,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,MAAM,CAAC,OAAO,GAAG,CAAC,WAMjB,EAAE,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,sBAAsB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC","sourcesContent":["import { getError } from '@venizia/ignis-helpers';\nimport type { TClass } from '@venizia/ignis-helpers';\nimport { ArtifactStereotypes, type TGeneratedArtifactIndex } from '../generator/common';\nimport { dirname } from 'node:path';\nimport { ArtifactSources } from './sources';\n\n/** Fills an `ArtifactGroup` defined without content, from source: the defining package is the nearest `package.json` above the group's call site, and the group is every decorated class under a directory named `folder` in its `src`. */\nexport class GroupArtifactsResolver {\n /** The kernel's `SingletonRealm` slot for the group resolver (`ArtifactGroup.SINGLETON_REALM_KEY`). */\n static readonly REALM_SLOT = Symbol.for('@venizia/ignis-kernel:artifact-group-resolver');\n\n static async resolve(opts: {\n group: {\n folder: string | undefined;\n site: string | undefined;\n ignore?: ReadonlyArray<string>;\n };\n }): Promise<TGeneratedArtifactIndex> {\n const { folder, site, ignore } = opts.group;\n\n if (!site) {\n throw getError({\n message: `[ArtifactGroup] '${folder ?? '<application>'}' has no call site to resolve from | Define it with ArtifactGroup.define in the shared package's own source`,\n });\n }\n\n if (\n !ArtifactSources.isCached({\n packageSource: ArtifactSources.packageSource({ from: dirname(site) }),\n })\n ) {\n await ArtifactSources.loadScanner();\n }\n\n const index: Record<string, Array<TClass<unknown>>> = {};\n\n for (const artifact of ArtifactSources.folderArtifacts({ folder, site, ignore })) {\n const field = ArtifactStereotypes.EMIT_ORDER.find(\n (entry) => entry.type === artifact.type,\n )?.field;\n\n if (!field) {\n continue;\n }\n\n const loaded = await import(artifact.filePath);\n index[field] = [...(index[field] ?? []), loaded[artifact.className]];\n }\n\n return index;\n }\n\n /** Fills the kernel's realm slot; the holder may already exist (the kernel created it empty), so it is mutated, never replaced. */\n static install(): void {\n const existing: unknown = Reflect.get(globalThis, GroupArtifactsResolver.REALM_SLOT);\n const holder: { resolve?: unknown } =\n typeof existing === 'object' && existing !== null ? existing : {};\n holder.resolve = (resolveOpts: {\n group: {\n folder: string | undefined;\n site: string | undefined;\n ignore?: ReadonlyArray<string>;\n };\n }) => GroupArtifactsResolver.resolve(resolveOpts);\n Reflect.set(globalThis, GroupArtifactsResolver.REALM_SLOT, holder);\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { AnyType, TClass } from '@venizia/ignis-helpers';
1
+ import type { TClass } from '@venizia/ignis-helpers';
2
2
  import type { TArtifactIndexField, TArtifactType, TScanSkipReason } from './constants.js';
3
3
  /** A decorated class the scanner put in the index. */
4
4
  export interface IScannedArtifact {
@@ -35,6 +35,14 @@ export interface IScanReport {
35
35
  /** Every decorated class left out - abstract, not a named export, or under a user ignore pattern. */
36
36
  skipped: IScanSkipped[];
37
37
  }
38
- /** The object a generated index exports - structurally the kernel's `IArtifactIndex` (boot does not depend on the kernel). */
39
- export type TGeneratedArtifactIndex = Partial<Record<TArtifactIndexField, ReadonlyArray<TClass<AnyType>>>>;
38
+ /**
39
+ * What an application may hand to an `AutoArtifactGroup` as its index: a list of classes per kind, with the same kinds as the kernel's `IArtifactIndex` (boot does not depend on the kernel, so it cannot name that type). The classes are `TClass<unknown>` so any real class is accepted; the group keeps the exact type the application passed.
40
+ */
41
+ export type TGeneratedArtifactIndexInput = Partial<Record<TArtifactIndexField, ReadonlyArray<TClass<unknown>>>>;
42
+ /**
43
+ * The index boot builds and moves around without knowing the application's classes: the object a generated index exports, and the default of `AutoArtifactGroup`.
44
+ *
45
+ * Each kind of the kernel's index names its own class type (`TClass<BaseConfiguration>`, `TClass<IService>`, ...), which boot cannot name. `TClass<never>` is the bottom of that family: it is assignable to every one of them, so a group that carries it is still the kernel's `IArtifactGroup`. Its instance type is `never`, so boot only passes the classes along and never constructs one.
46
+ */
47
+ export type TGeneratedArtifactIndex = Partial<Record<TArtifactIndexField, ReadonlyArray<TClass<never>>>>;
40
48
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/generator/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnyType, TClass } from '@venizia/ignis-helpers';\nimport type { TArtifactIndexField, TArtifactType, TScanSkipReason } from './constants';\n\n/** A decorated class the scanner put in the index. */\nexport interface IScannedArtifact {\n className: string;\n /** Absolute path of the declaring file. */\n filePath: string;\n type: TArtifactType;\n}\n\n/** Options for one scan of a source tree. */\nexport interface IScanOptions {\n root: string;\n /**\n * Glob patterns relative to `root`, ignored in addition to `ArtifactStereotypes.DEFAULT_IGNORE`,\n * which always apply.\n *\n * @default []\n */\n ignore?: string[];\n /** Module specifiers, matched exactly, whose stereotype imports also count - a package that re-exports the decorators. Adds to `ArtifactStereotypes.SOURCE_MODULES`. */\n sourceModules?: string[];\n /** Recognise a stereotype imported from any module whose exports lead, through `export *` and renaming re-exports, to a source module - a framework that re-exports the kernel's decorators. */\n followReexports?: boolean;\n}\n\n/** A decorated class the index leaves out, and why. */\nexport interface IScanSkipped {\n className: string;\n filePath: string;\n reason: TScanSkipReason;\n}\n\n/** The index content plus what a caller's `ignore` silently left out: decorated classes under a user pattern, never under a default one. */\nexport interface IScanReport {\n artifacts: IScannedArtifact[];\n ignored: IScannedArtifact[];\n /** Every decorated class left out - abstract, not a named export, or under a user ignore pattern. */\n skipped: IScanSkipped[];\n}\n\n/** The object a generated index exports - structurally the kernel's `IArtifactIndex` (boot does not depend on the kernel). */\nexport type TGeneratedArtifactIndex = Partial<\n Record<TArtifactIndexField, ReadonlyArray<TClass<AnyType>>>\n>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/generator/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TClass } from '@venizia/ignis-helpers';\nimport type { TArtifactIndexField, TArtifactType, TScanSkipReason } from './constants';\n\n/** A decorated class the scanner put in the index. */\nexport interface IScannedArtifact {\n className: string;\n /** Absolute path of the declaring file. */\n filePath: string;\n type: TArtifactType;\n}\n\n/** Options for one scan of a source tree. */\nexport interface IScanOptions {\n root: string;\n /**\n * Glob patterns relative to `root`, ignored in addition to `ArtifactStereotypes.DEFAULT_IGNORE`,\n * which always apply.\n *\n * @default []\n */\n ignore?: string[];\n /** Module specifiers, matched exactly, whose stereotype imports also count - a package that re-exports the decorators. Adds to `ArtifactStereotypes.SOURCE_MODULES`. */\n sourceModules?: string[];\n /** Recognise a stereotype imported from any module whose exports lead, through `export *` and renaming re-exports, to a source module - a framework that re-exports the kernel's decorators. */\n followReexports?: boolean;\n}\n\n/** A decorated class the index leaves out, and why. */\nexport interface IScanSkipped {\n className: string;\n filePath: string;\n reason: TScanSkipReason;\n}\n\n/** The index content plus what a caller's `ignore` silently left out: decorated classes under a user pattern, never under a default one. */\nexport interface IScanReport {\n artifacts: IScannedArtifact[];\n ignored: IScannedArtifact[];\n /** Every decorated class left out - abstract, not a named export, or under a user ignore pattern. */\n skipped: IScanSkipped[];\n}\n\n/**\n * What an application may hand to an `AutoArtifactGroup` as its index: a list of classes per kind, with the same kinds as the kernel's `IArtifactIndex` (boot does not depend on the kernel, so it cannot name that type). The classes are `TClass<unknown>` so any real class is accepted; the group keeps the exact type the application passed.\n */\nexport type TGeneratedArtifactIndexInput = Partial<\n Record<TArtifactIndexField, ReadonlyArray<TClass<unknown>>>\n>;\n\n/**\n * The index boot builds and moves around without knowing the application's classes: the object a generated index exports, and the default of `AutoArtifactGroup`.\n *\n * Each kind of the kernel's index names its own class type (`TClass<BaseConfiguration>`, `TClass<IService>`, ...), which boot cannot name. `TClass<never>` is the bottom of that family: it is assignable to every one of them, so a group that carries it is still the kernel's `IArtifactGroup`. Its instance type is `never`, so boot only passes the classes along and never constructs one.\n */\nexport type TGeneratedArtifactIndex = Partial<\n Record<TArtifactIndexField, ReadonlyArray<TClass<never>>>\n>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-boot",
3
- "version": "0.4.8-9",
3
+ "version": "0.4.8",
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.4.8-9",
84
- "@venizia/ignis-inversion": "0.4.7-3"
83
+ "@venizia/ignis-helpers": "0.4.8",
84
+ "@venizia/ignis-inversion": "0.4.7"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@types/bun": "^1.4.3",
88
- "@venizia/dev-configs": "0.4.8-7",
88
+ "@venizia/dev-configs": "0.4.8",
89
89
  "eslint": "^10.13.0",
90
90
  "oxlint": "1.89.0",
91
91
  "oxlint-tsgolint": "7.0.2004",