illuma-core
Installation
SKILL.md
@illuma/core Guidelines
General
- Define services as classes marked with
@Service(root-scoped singleton, shared across the container tree) or@Scoped(node-scoped, resolved within the container that provides it). Prefer these over the lower-level@NodeInjectable({ singleton: true | false })form. UsemakeService/makeScopedin decorator-free environments. Factory functions work but are uncommon. - Before using decorators, verify they are enabled in the project; otherwise use
makeService/makeScoped. - Inject dependencies with
nodeInjecton class fields. Injection only works inside an injection context (during instantiation). - Constructor injection is not supported. Inject through
nodeInjectin the class body. - All injected fields must be
private readonly. - For transient instances, inject
Injectorand callthis._injector.produce(MyService)orproduce(() => { ... })to run a factory in injection context. - Use
NodeTokenfor injectable tokens andMultiNodeTokenfor multi-providers. Define them intokens.ts. - Circular dependencies are not allowed. Use
injectDeferonly when you cannot refactor the cycle away.
For async/lazy patterns, see async-injection.md. For testing, see testing.md. For error codes, see errors.md.