Changelog - 2026-10-18
Auto artifacts and artifact groups
New Feature Feature Enhancement Performance Bug Fix Bug FixIn one line. configs.artifacts: AutoArtifacts replaces the generated _artifacts.ts, its scripts and its freshness check, on Bun and in Vite builds, and a shared package declares one typed group per domain that applications borrow instead of importing every class.
typescript
import AutoArtifacts from '@venizia/ignis-boot/auto';
import { CategoryRepository, InventoryArtifacts } from '@acme/core';
export const configs: IApplicationConfigs = {
artifacts: [AutoArtifacts, InventoryArtifacts, { repositories: [CategoryRepository] }],
};What changed
@venizia/ignis-boot/auto. Its default export is the application's own index. From source, a Bun plugin scanssrcwhen artifacts are registered. A binary built withIgnisArtifactsPlugin.create()(from@venizia/ignis-boot/bun) carries the list and never scans. ABun.buildwithout the plugin fails withCould not resolve: "ignis:artifacts"instead of shipping a binary with missing classes. Import the auto module in the application that uses it, not in a shared library.ArtifactGroup.define({ folder })(@venizia/ignis-kernel, re-exported by@venizia/ignis). A shared package declares a group per domain, once; its content is every decorated class under that directory. Applications borrow groups by importing them, typed, so a typo is a compile error. A dependency is never scanned wholesale.TArtifactIndexInputaccepts a group; a group's kind fields are typedneverand reading one throws.ArtifactGroup.application()covers every decorated class of the package it is called from, per call site, so several applications loaded into one process each register their own.AutoArtifactsis one module per process.ArtifactGroup.application({ ignore: ['repositories/clickhouse/**'] })leaves out classes under globs relative to the packagesrc, the patternsignis-artifacts generate --ignoretakes. In a build the plugin reads them from the call, so they must be string literals.ArtifactGroup.pick({ group, kinds })returns a group carrying onlykinds, so a run-mode splitter (a worker without controllers, a migration run without services) can sliceAutoArtifactsor a borrowed group.ArtifactGroup.resolveContent({ group })returns a group's classes in the order the kernel uses.--source-module <specifier>onignis-artifacts generateandcheck(repeatable) indexes classes whose stereotype decorators come from a package that re-exports them, such as a frontend framework built on the kernel. A specifier is matched whole.checkneeds the same set asgenerate. The generated header and the stale hint print the fullgeneratecommand (ArtifactIndexEmitter.renderCommand()). Programmatic:sourceModules?: string[]onIGenerateOptionsand the scanner. The scanner also follows re-exports (followReexports), reports every decorated class it leaves out (skipped, with the reason), andSOURCE_MODULESaccepts the kernel's sub-paths (@venizia/ignis-kernel/metadata).- Vite.
IgnisArtifactsVitePlugin.create()invite.config.ts(from@venizia/ignis-boot/vite) makesimport AutoArtifacts from '@venizia/ignis-boot/auto'work in a Vite-built frontend or Worker. Class names survive minification for every class with an IGNIS decorator in the application and its workspace dependencies, because binding keys are built fromClass.name; the rest of the bundle minifies as usual.IgnisArtifactsPluginpins names the same way, so a registered class that subclasses a same-name class keeps its key.ArtifactGroupis exported from@venizia/ignis-kernel/metadata, so a browser kit defines its groups without the root barrel. The scanner runs under Node. Adding a class needs a dev server restart; editing a class keeps hot reload. - An import cycle is named. An index entry that is not a class stops registration with a message naming the cause, instead of a crash on
.name. - The entry module sets the root. The root is the
srcbeside thepackage.jsonofBun.main, not the working directory, so an IDE runner orbun testfrom a repository root no longer fails withENOENT. With no entry file (bun -e) the working directory is used. A missingsrcis a clear error naming the fix. .tsxfiles are scanned. A decorated class in a.tsxfile (a controller rendering JSX) used to be left out with no warning, and its routes answered 404. This coversAutoArtifacts, the groups,ignis-artifacts generateand the plugin. A tsc-built application mapsx.tsxtox.js.- A tsc-built application registers the classes it runs. The scan reads
src, but each class is loaded from the tree the application runs (dist/services/a.service.jsforsrc/services/a.service.ts, CommonJS or ESM), so module state andinstanceofmatch the running code. A class insrcwith no compiled copy stops the start with an error asking for a rebuild. Groups in a compiled shared package resolve the same way, and the plugin inlines them in a binary. - Faster source starts. The scan is cached in
node_modules/.cache/ignis-artifacts/, keyed on the size and modification time of every.tsfile undersrc, the package manifest and the lockfile. The next start skips the scan and TypeScript; any edit makes the next start scan again, and a corrupt cache is ignored. The cache covers.tsxfiles, so a cache from an older release is rescanned once. - The auto module is safe in binaries and small in the browser. In a server binary, importing the auto module no longer evaluates the application's classes at import time (this could crash with
The superclass is not a constructor); the index loads when artifacts are registered. A browser build imports the index eagerly, which Bun can tree-shake.IgnisArtifactsPlugin.create({ lazyIndex })chooses explicitly: the default is lazy for a server target and eager fortarget: 'browser'. - Browser builds work.
@venizia/ignis-boot/autono longer loads the@venizia/ignis-helpersroot (which reachesnode:net) in a browser path; it takesgetErrorfrom@venizia/ignis-inversion, which@venizia/ignis-bootnow declares as a dependency. The build errorBrowser polyfill for module "node:net" doesn't have a matching export named "connect"is gone.
Who is affected
- Applications on Bun that use a generated index. Optional. Replace
GeneratedArtifactswithAutoArtifacts, addIgnisArtifactsPlugin.create()to the binary build, and delete_artifacts.tsand itsgenerateandcheckscripts. An application that generated its index with--ignorecan move toArtifactGroup.application({ ignore }). - Frontends that keep a generated index, a side-effect import list or hand-pinned binding keys. Add
IgnisArtifactsVitePlugin.create(), passAutoArtifactsinartifacts, and delete them. - Monorepos that hand-list classes borrowed from a shared package. Optional. Declare
ArtifactGroup.define({ folder })per domain and borrow the groups. Single classes from another domain stay listed explicitly. - Code that walks
configs.artifactsand reads the kinds of each entry. Pass an entry withisArtifactGroup: truethrough untouched, or slice it withArtifactGroup.pick; reading its kinds throws, and a group passed through untouched registers in every slice. - Harnesses or hosts that load several applications into one process. Use
artifacts: [ArtifactGroup.application(), ...]in each application instead ofAutoArtifacts. - Applications whose decorators come from another package. Pass that package with
--source-moduleto bothgenerateandcheck, and drop any hand-written side-effect imports. - Applications with decorated classes in
.tsxfiles. Remove any hand listing ({ controllers: [ViewController] }) that worked around it. - Node applications. No change:
ignis-artifacts generatestays.
Details
json
{
"scripts": {
"generate:artifacts": "ignis-artifacts generate --root src --out src/_artifacts.ts --source-module @acme/frontend --source-module @acme/frontend-kernel",
"check:artifacts": "ignis-artifacts check --root src --out src/_artifacts.ts --source-module @acme/frontend --source-module @acme/frontend-kernel"
}
}--source-module @acme/frontenddoes not match@acme/frontend-kernel. Without the flag, the default stays@venizia/ignisand@venizia/ignis-kernel.- For a binary,
Bun.buildkeepsNODE_ENVa runtime read withdefine;env: 'disable'alone does not.