@codefast/di 0.3.16-canary.1 → 0.3.16-canary.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @codefast/di
2
2
 
3
+ ## 0.3.16-canary.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1ad2cb7`](https://github.com/codefastlabs/codefast/commit/1ad2cb73a3f6f8bff2b001e9df2f2492efd89aa2) Thanks [@thevuong](https://github.com/thevuong)! - chore: align package config globs
8
+
9
+ - [`4fda78b`](https://github.com/codefastlabs/codefast/commit/4fda78b20f98646d114cfddb09e66af609a625a2) Thanks [@thevuong](https://github.com/thevuong)! - fix: support Node 26 mirror export verification
10
+
11
+ - [`1b0df2e`](https://github.com/codefastlabs/codefast/commit/1b0df2e55140c927b7f3ba39ccdcb4cba87ec7ff) Thanks [@thevuong](https://github.com/thevuong)! - refactor(di): clarify contextual names
12
+
3
13
  ## 0.3.16-canary.1
4
14
 
5
15
  ## 0.3.16-canary.0
package/README.md CHANGED
@@ -181,7 +181,7 @@ Start with `container.bind(key)` and chain a strategy, then optional constraints
181
181
  | `.toDynamicAsync(factory)` | Async factory `(ctx: ResolutionContext) => Promise<Value>`. |
182
182
  | `.toResolved(factory, deps)` | Factory with a typed dependency tuple; dependencies are resolved in order. |
183
183
  | `.toResolvedAsync(factory, deps)` | Like `toResolved`, but the factory returns a `Promise`. |
184
- | `.toAlias(targetToken)` | Redirect resolution to another token; the alias follows the target’s materialization. |
184
+ | `.toAlias(targetToken)` | Redirect resolution to another token; the alias follows the target’s resolution. |
185
185
 
186
186
  ```typescript
187
187
  container.bind(AppConfigToken).toConstantValue({ port: 3000 });
@@ -271,7 +271,7 @@ Built-in predicates (all from `@codefast/di/constraints`):
271
271
  | ----------------------------------- | -------------------------------------------------------------------------- |
272
272
  | `whenParentIs(key)` | The direct parent binding was registered for `key`. |
273
273
  | `whenNoParentIs(key)` | There is no parent, or the parent is not registered for `key`. |
274
- | `whenAnyAncestorIs(key)` | Any ancestor on the materialization stack was registered for `key`. |
274
+ | `whenAnyAncestorIs(key)` | Any ancestor on the resolution stack was registered for `key`. |
275
275
  | `whenNoAncestorIs(key)` | No ancestor was registered for `key`. |
276
276
  | `whenParentNamed(name)` | The immediate parent binding’s slot name is `name`. |
277
277
  | `whenAnyAncestorNamed(name)` | Some ancestor’s slot name is `name`. |
@@ -645,7 +645,7 @@ The root entry re-exports the full façade (`package.json` → `"."`). Subpaths
645
645
  | `@codefast/di/decorators/injectable` | `injectable`, `createAutoRegisterRegistry`, `AutoRegisterRegistry` |
646
646
  | `@codefast/di/decorators/lifecycle-decorators` | `postConstruct`, `preDestroy` |
647
647
  | `@codefast/di/dependency-graph` | `buildDependencyGraph`, `ContainerGraphJson`, `GraphOptions`, … |
648
- | `@codefast/di/environment` | `runWithContainer`, `getActiveContainer`, `DefaultResolutionContext`, `ResolverCallbacks`, `buildMaterializationFrame` |
648
+ | `@codefast/di/environment` | `runWithContainer`, `getActiveContainer`, `DefaultResolutionContext`, `ResolverCallbacks`, `buildResolutionFrame` |
649
649
  | `@codefast/di/errors` | Full `DiError` hierarchy |
650
650
  | `@codefast/di/graph-adapters/cytoscape` | `toCytoscapeGraph` |
651
651
  | `@codefast/di/graph-adapters/dot` | `toDotGraph` |
@@ -659,7 +659,7 @@ The root entry re-exports the full façade (`package.json` → `"."`). Subpaths
659
659
  | `@codefast/di/metadata/symbol-metadata-reader` | `SymbolMetadataReader`, `defaultMetadataReader` |
660
660
  | `@codefast/di/module` | `Module`, `AsyncModule`, `SyncModule`, `isSyncModule`, builders |
661
661
  | `@codefast/di/registry` | `BindingRegistry` |
662
- | `@codefast/di/resolve-options` | `injectableSlotToResolveOptions`, `slotKeyToResolveOptions` |
662
+ | `@codefast/di/resolve-options` | `injectionSlotToResolveOptions`, `bindingSlotToResolveOptions` |
663
663
  | `@codefast/di/resolver` | `DependencyResolver` |
664
664
  | `@codefast/di/scope` | `ScopeManager` |
665
665
  | `@codefast/di/token` | `token`, `Token`, `tokenName`, … |
@@ -8,7 +8,7 @@ import { Binding } from "./binding.mjs";
8
8
  *
9
9
  * @since 0.3.16-canary.0
10
10
  */
11
- declare function selectBinding(bindings: ReadonlyArray<Binding>, hint: ResolveOptions | undefined, ctx: ConstraintContext, tName: string): Binding | undefined;
11
+ declare function selectBinding(bindings: ReadonlyArray<Binding>, hint: ResolveOptions | undefined, ctx: ConstraintContext, tokenDisplayName: string): Binding | undefined;
12
12
  /**
13
13
  * Select all candidates matching hint + predicates.
14
14
  *
@@ -6,11 +6,11 @@ import { AmbiguousBindingError } from "./errors.mjs";
6
6
  *
7
7
  * @since 0.3.16-canary.0
8
8
  */
9
- function selectBinding(bindings, hint, ctx, tName) {
9
+ function selectBinding(bindings, hint, ctx, tokenDisplayName) {
10
10
  const candidates = filterBindings(bindings, hint, ctx);
11
11
  if (candidates.length === 0) return;
12
12
  if (candidates.length === 1) return candidates[0];
13
- throw new AmbiguousBindingError(tName, candidates.map((c) => c.id));
13
+ throw new AmbiguousBindingError(tokenDisplayName, candidates.map((c) => c.id));
14
14
  }
15
15
  /**
16
16
  * Select all candidates matching hint + predicates.
@@ -20,10 +20,10 @@ function selectBinding(bindings, hint, ctx, tName) {
20
20
  function selectAllBindings(bindings, hint, ctx) {
21
21
  return filterBindings(bindings, hint, ctx, "all");
22
22
  }
23
- function filterBindings(bindings, hint, ctx, mode = "single") {
23
+ function filterBindings(bindings, hint, ctx, selectionMode = "single") {
24
24
  if (hint === void 0) {
25
25
  const resultWithoutHint = [];
26
- if (mode === "all") {
26
+ if (selectionMode === "all") {
27
27
  for (const binding of bindings) if (matchesPredicate(binding, ctx)) resultWithoutHint.push(binding);
28
28
  } else for (const binding of bindings) {
29
29
  const slot = binding.slot;
@@ -32,7 +32,7 @@ function filterBindings(bindings, hint, ctx, mode = "single") {
32
32
  return resultWithoutHint;
33
33
  }
34
34
  const result = [];
35
- for (const binding of bindings) if ((mode === "all" ? matchesSlotForResolveAll(binding, hint) : matchesSlot(binding, hint)) && matchesPredicate(binding, ctx)) result.push(binding);
35
+ for (const binding of bindings) if ((selectionMode === "all" ? matchesSlotForResolveAll(binding, hint) : matchesSlot(binding, hint)) && matchesPredicate(binding, ctx)) result.push(binding);
36
36
  return result;
37
37
  }
38
38
  function matchesSlotForResolveAll(binding, hint) {
@@ -7,26 +7,26 @@ import { InjectionDescriptor } from "./decorators/inject.mjs";
7
7
  /**
8
8
  * @since 0.3.16-canary.0
9
9
  */
10
- interface SlotKey {
10
+ interface BindingSlot {
11
11
  readonly name: string | undefined;
12
12
  readonly tags: ReadonlyArray<readonly [tag: string, value: unknown]>;
13
13
  }
14
14
  /**
15
15
  * @since 0.3.16-canary.0
16
16
  */
17
- declare function slotKeyEquals(a: SlotKey, b: SlotKey): boolean;
17
+ declare function bindingSlotEquals(left: BindingSlot, right: BindingSlot): boolean;
18
18
  /**
19
19
  * @since 0.3.16-canary.0
20
20
  */
21
- declare const DEFAULT_SLOT: SlotKey;
21
+ declare const DEFAULT_BINDING_SLOT: BindingSlot;
22
22
  /**
23
23
  * @since 0.3.16-canary.0
24
24
  */
25
- declare function slotKeyToString(slot: SlotKey): string;
25
+ declare function bindingSlotToString(slot: BindingSlot): string;
26
26
  interface BindingBase<Value> {
27
27
  readonly id: BindingIdentifier;
28
28
  readonly token: Token<Value> | Constructor<Value>;
29
- readonly slot: SlotKey;
29
+ readonly slot: BindingSlot;
30
30
  readonly predicate?: (ctx: ConstraintContext) => boolean;
31
31
  }
32
32
  /**
@@ -188,4 +188,4 @@ interface SingletonLifecycleBuilder<Value> {
188
188
  id(): BindingIdentifier;
189
189
  }
190
190
  //#endregion
191
- export { AliasBinding, AliasBindingBuilder, BindToBuilder, Binding, BindingBuilder, ClassBinding, ConstantBinding, ConstantBindingBuilder, DEFAULT_SLOT, DynamicAsyncBinding, DynamicBinding, PartialBinding, ResolvedAsyncBinding, ResolvedBinding, ScopedBindingBuilder, SingletonBindingBuilder, SingletonLifecycleBuilder, SlotKey, TransientBindingBuilder, generateBindingId, slotKeyEquals, slotKeyToString };
191
+ export { AliasBinding, AliasBindingBuilder, BindToBuilder, Binding, BindingBuilder, BindingSlot, ClassBinding, ConstantBinding, ConstantBindingBuilder, DEFAULT_BINDING_SLOT, DynamicAsyncBinding, DynamicBinding, PartialBinding, ResolvedAsyncBinding, ResolvedBinding, ScopedBindingBuilder, SingletonBindingBuilder, SingletonLifecycleBuilder, TransientBindingBuilder, bindingSlotEquals, bindingSlotToString, generateBindingId };
package/dist/binding.mjs CHANGED
@@ -2,27 +2,27 @@
2
2
  /**
3
3
  * @since 0.3.16-canary.0
4
4
  */
5
- function slotKeyEquals(a, b) {
6
- if (a.name !== b.name) return false;
7
- if (a.tags.length !== b.tags.length) return false;
8
- for (const [tagKey, tagValue] of a.tags) if (!b.tags.some(([k, v]) => k === tagKey && Object.is(v, tagValue))) return false;
5
+ function bindingSlotEquals(left, right) {
6
+ if (left.name !== right.name) return false;
7
+ if (left.tags.length !== right.tags.length) return false;
8
+ for (const [tagKey, tagValue] of left.tags) if (!right.tags.some(([otherKey, otherValue]) => otherKey === tagKey && Object.is(otherValue, tagValue))) return false;
9
9
  return true;
10
10
  }
11
11
  /**
12
12
  * @since 0.3.16-canary.0
13
13
  */
14
- const DEFAULT_SLOT = {
14
+ const DEFAULT_BINDING_SLOT = {
15
15
  name: void 0,
16
16
  tags: []
17
17
  };
18
18
  /**
19
19
  * @since 0.3.16-canary.0
20
20
  */
21
- function slotKeyToString(slot) {
21
+ function bindingSlotToString(slot) {
22
22
  if (slot.name === void 0 && slot.tags.length === 0) return "default";
23
23
  const parts = [];
24
24
  if (slot.name !== void 0) parts.push(`name:${slot.name}`);
25
- for (const [k, v] of slot.tags) parts.push(`tag:${k}=${String(v)}`);
25
+ for (const [tagKey, tagValue] of slot.tags) parts.push(`tag:${tagKey}=${String(tagValue)}`);
26
26
  return parts.join(",");
27
27
  }
28
28
  let _idCounter = 0;
@@ -33,4 +33,4 @@ function generateBindingId() {
33
33
  return String(++_idCounter);
34
34
  }
35
35
  //#endregion
36
- export { DEFAULT_SLOT, generateBindingId, slotKeyEquals, slotKeyToString };
36
+ export { DEFAULT_BINDING_SLOT, bindingSlotEquals, bindingSlotToString, generateBindingId };
@@ -67,7 +67,7 @@ function whenParentTaggedAll(tags) {
67
67
  const { parent } = constraintContext;
68
68
  if (parent === void 0) return false;
69
69
  const { tags: parentTags } = parent.slot;
70
- return tags.every(([tagKey, tagValue]) => parentTags.some(([k, v]) => k === tagKey && Object.is(v, tagValue)));
70
+ return tags.every(([tagKey, tagValue]) => parentTags.some(([otherKey, otherValue]) => otherKey === tagKey && Object.is(otherValue, tagValue)));
71
71
  };
72
72
  }
73
73
  /**
@@ -80,7 +80,7 @@ function whenParentTaggedAll(tags) {
80
80
  function whenAnyAncestorTaggedAll(tags) {
81
81
  return (constraintContext) => constraintContext.ancestors.some((frame) => {
82
82
  const { tags: frameTags } = frame.slot;
83
- return tags.every(([tagKey, tagValue]) => frameTags.some(([k, v]) => k === tagKey && Object.is(v, tagValue)));
83
+ return tags.every(([tagKey, tagValue]) => frameTags.some(([otherKey, otherValue]) => otherKey === tagKey && Object.is(otherValue, tagValue)));
84
84
  });
85
85
  }
86
86
  //#endregion
@@ -1,11 +1,11 @@
1
1
  import { effectiveBindingScope } from "./binding-scope.mjs";
2
2
  import { AsyncModuleLoadError, CircularDependencyError, DisposedContainerError, InternalError, RebindUnboundTokenError, ScopeViolationError, SyncDisposalNotSupportedError } from "./errors.mjs";
3
- import { DEFAULT_SLOT, generateBindingId } from "./binding.mjs";
3
+ import { DEFAULT_BINDING_SLOT, generateBindingId } from "./binding.mjs";
4
4
  import { tokenName } from "./token.mjs";
5
5
  import { BindingRegistry } from "./registry.mjs";
6
6
  import { ScopeManager } from "./scope.mjs";
7
7
  import { LifecycleManager } from "./lifecycle.mjs";
8
- import { injectableSlotToResolveOptions, slotKeyToResolveOptions } from "./resolve-options.mjs";
8
+ import { bindingSlotToResolveOptions, injectionSlotToResolveOptions } from "./resolve-options.mjs";
9
9
  import { DependencyResolver } from "./resolver.mjs";
10
10
  import { Inspector } from "./inspector.mjs";
11
11
  import { buildDependencyGraph } from "./dependency-graph.mjs";
@@ -53,7 +53,7 @@ var DefaultContainer = class DefaultContainer {
53
53
  }
54
54
  _createBindToBuilder(token, moduleRef) {
55
55
  const registry = this._registry;
56
- const commitBinding = (b, previousId) => {
56
+ const commitBinding = (binding, previousId) => {
57
57
  if (previousId !== void 0) {
58
58
  registry.removeById(previousId);
59
59
  if (moduleRef !== void 0) {
@@ -64,18 +64,18 @@ var DefaultContainer = class DefaultContainer {
64
64
  }
65
65
  }
66
66
  }
67
- registry.add(b);
67
+ registry.add(binding);
68
68
  if (moduleRef !== void 0) {
69
69
  let ids = this._moduleBindingIds.get(moduleRef);
70
70
  if (ids === void 0) {
71
71
  ids = [];
72
72
  this._moduleBindingIds.set(moduleRef, ids);
73
73
  }
74
- ids.push(b.id);
74
+ ids.push(binding.id);
75
75
  }
76
- return b.id;
76
+ return binding.id;
77
77
  };
78
- return new BindToBuilderImpl(token, commitBinding);
78
+ return new BindingEntry(token, commitBinding);
79
79
  }
80
80
  unbind(tokenOrId) {
81
81
  this._assertNotDisposed();
@@ -130,8 +130,8 @@ var DefaultContainer = class DefaultContainer {
130
130
  }
131
131
  _getBindingsForTokenOrId(tokenOrId) {
132
132
  if (typeof tokenOrId === "string") {
133
- const b = this._registry.getById(tokenOrId);
134
- return b !== void 0 ? [b] : [];
133
+ const binding = this._registry.getById(tokenOrId);
134
+ return binding !== void 0 ? [binding] : [];
135
135
  }
136
136
  return [...this._registry.getAll(tokenOrId)];
137
137
  }
@@ -141,72 +141,72 @@ var DefaultContainer = class DefaultContainer {
141
141
  }
142
142
  _loadSyncModules(modules) {
143
143
  const toLoad = this._collectModuleDeps(modules);
144
- for (const mod of toLoad) {
145
- if (!isSyncModule(mod)) throw new AsyncModuleLoadError(mod.name);
146
- const ref = mod;
147
- const existing = this._moduleRefs.get(ref);
144
+ for (const module of toLoad) {
145
+ if (!isSyncModule(module)) throw new AsyncModuleLoadError(module.name);
146
+ const moduleRef = module;
147
+ const existing = this._moduleRefs.get(moduleRef);
148
148
  if (existing !== void 0) {
149
- this._moduleRefs.set(ref, existing + 1);
149
+ this._moduleRefs.set(moduleRef, existing + 1);
150
150
  continue;
151
151
  }
152
- this._moduleRefs.set(ref, 1);
153
- const builder = this._createModuleBuilder(ref);
154
- mod._setup(builder);
152
+ this._moduleRefs.set(moduleRef, 1);
153
+ const builder = this._createModuleBuilder(moduleRef);
154
+ module._setup(builder);
155
155
  }
156
156
  }
157
157
  _collectModuleDeps(modules) {
158
158
  const seen = /* @__PURE__ */ new Set();
159
159
  const result = [];
160
- const visit = (mod) => {
161
- const ref = mod;
162
- if (seen.has(ref)) return;
163
- seen.add(ref);
164
- result.push(mod);
160
+ const visit = (module) => {
161
+ const moduleRef = module;
162
+ if (seen.has(moduleRef)) return;
163
+ seen.add(moduleRef);
164
+ result.push(module);
165
165
  };
166
- for (const m of modules) visit(m);
166
+ for (const module of modules) visit(module);
167
167
  return result;
168
168
  }
169
169
  async loadAsync(...modules) {
170
170
  this._assertNotDisposed();
171
- for (const mod of modules) await this._loadOneModuleAsync(mod);
171
+ for (const module of modules) await this._loadOneModuleAsync(module);
172
172
  }
173
- async _loadOneModuleAsync(mod) {
174
- const ref = mod;
175
- const existing = this._moduleRefs.get(ref);
173
+ async _loadOneModuleAsync(module) {
174
+ const moduleRef = module;
175
+ const existing = this._moduleRefs.get(moduleRef);
176
176
  if (existing !== void 0) {
177
- this._moduleRefs.set(ref, existing + 1);
177
+ this._moduleRefs.set(moduleRef, existing + 1);
178
178
  return;
179
179
  }
180
- this._moduleRefs.set(ref, 1);
181
- if (isSyncModule(mod)) {
182
- const builder = this._createModuleBuilder(ref);
183
- mod._setup(builder);
180
+ this._moduleRefs.set(moduleRef, 1);
181
+ if (isSyncModule(module)) {
182
+ const builder = this._createModuleBuilder(moduleRef);
183
+ module._setup(builder);
184
184
  } else {
185
185
  const importPromises = [];
186
- const builder = this._createAsyncModuleBuilder(ref, importPromises);
187
- await mod._setup(builder);
186
+ const builder = this._createAsyncModuleBuilder(moduleRef, importPromises);
187
+ await module._setup(builder);
188
188
  if (importPromises.length > 0) await Promise.all(importPromises);
189
189
  }
190
190
  }
191
191
  _createModuleBuilder(moduleRef) {
192
192
  return {
193
- bind: (t) => this._createBindToBuilder(t, moduleRef),
194
- import: (...mods) => {
195
- this._loadSyncModules(mods);
193
+ bind: (token) => this._createBindToBuilder(token, moduleRef),
194
+ import: (...modules) => {
195
+ this._loadSyncModules(modules);
196
196
  }
197
197
  };
198
198
  }
199
199
  _createAsyncModuleBuilder(moduleRef, importPromises) {
200
200
  return {
201
- bind: (t) => this._createBindToBuilder(t, moduleRef),
202
- import: (...mods) => {
203
- for (const mod of mods) importPromises.push(this._loadOneModuleAsync(mod));
201
+ bind: (token) => this._createBindToBuilder(token, moduleRef),
202
+ import: (...modules) => {
203
+ for (const module of modules) importPromises.push(this._loadOneModuleAsync(module));
204
204
  }
205
205
  };
206
206
  }
207
207
  unload(...modules) {
208
208
  this._assertNotDisposed();
209
- for (const mod of modules) this._unloadModuleSync(mod);
209
+ for (const module of modules) this._unloadModuleSync(module);
210
210
  }
211
211
  _unloadModuleSync(ref) {
212
212
  const count = this._moduleRefs.get(ref) ?? 0;
@@ -229,7 +229,7 @@ var DefaultContainer = class DefaultContainer {
229
229
  }
230
230
  async unloadAsync(...modules) {
231
231
  this._assertNotDisposed();
232
- for (const mod of modules) await this._unloadModuleAsync(mod);
232
+ for (const module of modules) await this._unloadModuleAsync(module);
233
233
  }
234
234
  async _unloadModuleAsync(ref) {
235
235
  const count = this._moduleRefs.get(ref) ?? 0;
@@ -254,10 +254,10 @@ var DefaultContainer = class DefaultContainer {
254
254
  this._assertNotDisposed();
255
255
  const entries = registry.entries();
256
256
  for (const { target, scope } of entries) {
257
- const bb = this._createBindToBuilder(target).toSelf();
258
- if (scope === "singleton") bb.singleton();
259
- else if (scope === "scoped") bb.scoped();
260
- else bb.transient();
257
+ const bindingBuilder = this._createBindToBuilder(target).toSelf();
258
+ if (scope === "singleton") bindingBuilder.singleton();
259
+ else if (scope === "scoped") bindingBuilder.scoped();
260
+ else bindingBuilder.transient();
261
261
  }
262
262
  return entries.length;
263
263
  }
@@ -323,7 +323,7 @@ var DefaultContainer = class DefaultContainer {
323
323
  if (effectiveBindingScope(binding) === "singleton" && !this._scope.hasSingleton(binding.id)) {
324
324
  if (binding.predicate !== void 0) continue;
325
325
  if (binding.kind === "constant" && binding.onActivation === void 0) continue;
326
- const slotHint = slotKeyToResolveOptions(binding.slot);
326
+ const slotHint = bindingSlotToResolveOptions(binding.slot);
327
327
  await this.resolveAsync(binding.token, slotHint);
328
328
  }
329
329
  }
@@ -407,7 +407,7 @@ var DefaultContainer = class DefaultContainer {
407
407
  const meta = reader.getConstructorMetadata(binding.target);
408
408
  if (meta === void 0) return edges;
409
409
  for (const param of meta.params) {
410
- const paramHint = injectableSlotToResolveOptions(param);
410
+ const paramHint = injectionSlotToResolveOptions(param);
411
411
  if (param.optional) continue;
412
412
  const tokenRef = param.token;
413
413
  if (param.multi) {
@@ -426,7 +426,7 @@ var DefaultContainer = class DefaultContainer {
426
426
  return edges;
427
427
  }
428
428
  if (binding.kind === "resolved" || binding.kind === "resolved-async") for (const dep of binding.deps) {
429
- const depHint = injectableSlotToResolveOptions(dep);
429
+ const depHint = injectionSlotToResolveOptions(dep);
430
430
  if (dep.optional) continue;
431
431
  const tokenRef = dep.token;
432
432
  if (dep.multi) {
@@ -478,7 +478,7 @@ function updateSlotTag(slot, tag, value) {
478
478
  tags: existing
479
479
  };
480
480
  }
481
- var BindToBuilderImpl = class {
481
+ var BindingEntry = class {
482
482
  _token;
483
483
  _commit;
484
484
  constructor(_token, _commit) {
@@ -486,7 +486,7 @@ var BindToBuilderImpl = class {
486
486
  this._commit = _commit;
487
487
  }
488
488
  to(type) {
489
- return new BindingBuilderImpl(this._token, {
489
+ return new ConstraintBuilder(this._token, {
490
490
  kind: "class",
491
491
  target: type,
492
492
  scope: "transient"
@@ -494,32 +494,32 @@ var BindToBuilderImpl = class {
494
494
  }
495
495
  toSelf() {
496
496
  if (typeof this._token !== "function") throw new Error("toSelf() requires token to be a Constructor");
497
- return new BindingBuilderImpl(this._token, {
497
+ return new ConstraintBuilder(this._token, {
498
498
  kind: "class",
499
499
  target: this._token,
500
500
  scope: "transient"
501
501
  }, this._commit);
502
502
  }
503
503
  toConstantValue(value) {
504
- return new ConstantBindingBuilderImpl(this._token, value, this._commit);
504
+ return new ConstantBuilder(this._token, value, this._commit);
505
505
  }
506
506
  toDynamic(factory) {
507
- return new BindingBuilderImpl(this._token, {
507
+ return new ConstraintBuilder(this._token, {
508
508
  kind: "dynamic",
509
509
  factory,
510
510
  scope: "transient"
511
511
  }, this._commit);
512
512
  }
513
513
  toDynamicAsync(factory) {
514
- return new BindingBuilderImpl(this._token, {
514
+ return new ConstraintBuilder(this._token, {
515
515
  kind: "dynamic-async",
516
516
  factory,
517
517
  scope: "transient"
518
518
  }, this._commit);
519
519
  }
520
520
  toResolved(factory, deps) {
521
- const normalizedDeps = deps.map((d) => normalizeToDescriptor(d));
522
- return new BindingBuilderImpl(this._token, {
521
+ const normalizedDeps = deps.map((dependency) => normalizeToDescriptor(dependency));
522
+ return new ConstraintBuilder(this._token, {
523
523
  kind: "resolved",
524
524
  factory,
525
525
  deps: normalizedDeps,
@@ -527,8 +527,8 @@ var BindToBuilderImpl = class {
527
527
  }, this._commit);
528
528
  }
529
529
  toResolvedAsync(factory, deps) {
530
- const normalizedDeps = deps.map((d) => normalizeToDescriptor(d));
531
- return new BindingBuilderImpl(this._token, {
530
+ const normalizedDeps = deps.map((dependency) => normalizeToDescriptor(dependency));
531
+ return new ConstraintBuilder(this._token, {
532
532
  kind: "resolved-async",
533
533
  factory,
534
534
  deps: normalizedDeps,
@@ -536,10 +536,10 @@ var BindToBuilderImpl = class {
536
536
  }, this._commit);
537
537
  }
538
538
  toAlias(target) {
539
- return new AliasBindingBuilderImpl(this._token, target, this._commit);
539
+ return new AliasBuilder(this._token, target, this._commit);
540
540
  }
541
541
  };
542
- var BindingBuilderImpl = class {
542
+ var ConstraintBuilder = class {
543
543
  _token;
544
544
  _partial;
545
545
  _commit;
@@ -551,7 +551,7 @@ var BindingBuilderImpl = class {
551
551
  this._partial = _partial;
552
552
  this._commit = _commit;
553
553
  this._slot = {
554
- ...DEFAULT_SLOT,
554
+ ...DEFAULT_BINDING_SLOT,
555
555
  tags: []
556
556
  };
557
557
  this._doCommit();
@@ -591,7 +591,7 @@ var BindingBuilderImpl = class {
591
591
  singleton() {
592
592
  const previousId = this._committed;
593
593
  this._committed = void 0;
594
- return new ScopeBuilderImpl(this._token, {
594
+ return new ScopeBuilder(this._token, {
595
595
  ...this._partial,
596
596
  scope: "singleton"
597
597
  }, this._slot, this._predicate, this._commit, "singleton", previousId);
@@ -599,7 +599,7 @@ var BindingBuilderImpl = class {
599
599
  transient() {
600
600
  const previousId = this._committed;
601
601
  this._committed = void 0;
602
- return new ScopeBuilderImpl(this._token, {
602
+ return new ScopeBuilder(this._token, {
603
603
  ...this._partial,
604
604
  scope: "transient"
605
605
  }, this._slot, this._predicate, this._commit, "transient", previousId);
@@ -607,7 +607,7 @@ var BindingBuilderImpl = class {
607
607
  scoped() {
608
608
  const previousId = this._committed;
609
609
  this._committed = void 0;
610
- return new ScopeBuilderImpl(this._token, {
610
+ return new ScopeBuilder(this._token, {
611
611
  ...this._partial,
612
612
  scope: "scoped"
613
613
  }, this._slot, this._predicate, this._commit, "scoped", previousId);
@@ -616,7 +616,7 @@ var BindingBuilderImpl = class {
616
616
  return this._committed;
617
617
  }
618
618
  };
619
- var ScopeBuilderImpl = class {
619
+ var ScopeBuilder = class {
620
620
  _token;
621
621
  _partial;
622
622
  _slot;
@@ -664,7 +664,7 @@ var ScopeBuilderImpl = class {
664
664
  return this._committed;
665
665
  }
666
666
  };
667
- var ConstantBindingBuilderImpl = class {
667
+ var ConstantBuilder = class {
668
668
  _token;
669
669
  _value;
670
670
  _commit;
@@ -678,7 +678,7 @@ var ConstantBindingBuilderImpl = class {
678
678
  this._value = _value;
679
679
  this._commit = _commit;
680
680
  this._slot = {
681
- ...DEFAULT_SLOT,
681
+ ...DEFAULT_BINDING_SLOT,
682
682
  tags: []
683
683
  };
684
684
  this._doCommit();
@@ -733,7 +733,7 @@ var ConstantBindingBuilderImpl = class {
733
733
  return this._committed;
734
734
  }
735
735
  };
736
- var AliasBindingBuilderImpl = class {
736
+ var AliasBuilder = class {
737
737
  _token;
738
738
  _target;
739
739
  _commit;
@@ -745,7 +745,7 @@ var AliasBindingBuilderImpl = class {
745
745
  this._target = _target;
746
746
  this._commit = _commit;
747
747
  this._slot = {
748
- ...DEFAULT_SLOT,
748
+ ...DEFAULT_BINDING_SLOT,
749
749
  tags: []
750
750
  };
751
751
  this._doCommit();
@@ -30,7 +30,7 @@ declare function isInjectionDescriptor(value: unknown): value is InjectionDescri
30
30
  /**
31
31
  * @since 0.3.16-canary.0
32
32
  */
33
- declare function normalizeToDescriptor(dep: InjectableDependency): InjectionDescriptor;
33
+ declare function normalizeToDescriptor(dependency: InjectableDependency): InjectionDescriptor;
34
34
  type ClassAccessorDecorator<This, Value> = (target: ClassAccessorDecoratorTarget<This, Value>, context: ClassAccessorDecoratorContext<This, Value>) => ClassAccessorDecoratorResult<This, Value> | void;
35
35
  /**
36
36
  * @since 0.3.16-canary.0
@@ -1,6 +1,6 @@
1
1
  import { InternalError, MissingContainerContextError } from "../errors.mjs";
2
2
  import { getActiveContainer } from "../environment.mjs";
3
- import { injectableSlotToResolveOptions } from "../resolve-options.mjs";
3
+ import { injectionSlotToResolveOptions } from "../resolve-options.mjs";
4
4
  import { INJECT_ACCESSOR_KEY, accessorMetadataByMetadataObjectMap } from "../metadata/metadata-keys.mjs";
5
5
  //#region src/decorators/inject.ts
6
6
  /**
@@ -15,10 +15,10 @@ function isInjectionDescriptor(value) {
15
15
  /**
16
16
  * @since 0.3.16-canary.0
17
17
  */
18
- function normalizeToDescriptor(dep) {
19
- if (isInjectionDescriptor(dep)) return materializeInjectionDescriptor(dep);
18
+ function normalizeToDescriptor(dependency) {
19
+ if (isInjectionDescriptor(dependency)) return materializeInjectionDescriptor(dependency);
20
20
  return {
21
- token: dep,
21
+ token: dependency,
22
22
  optional: false,
23
23
  multi: false
24
24
  };
@@ -27,9 +27,9 @@ function normalizeToDescriptor(dep) {
27
27
  * Dual-role `inject()` values are functions: [[Function]].name must not be treated as a DI slot name.
28
28
  * Only enumerable own `name` / `tags` from `Object.defineProperties` are real injection options.
29
29
  */
30
- function materializeInjectionDescriptor(dep) {
31
- if (typeof dep !== "function") return dep;
32
- const dualRole = dep;
30
+ function materializeInjectionDescriptor(dependency) {
31
+ if (typeof dependency !== "function") return dependency;
32
+ const dualRole = dependency;
33
33
  const base = {
34
34
  token: dualRole.token,
35
35
  optional: dualRole.optional,
@@ -92,7 +92,7 @@ function inject(token, options) {
92
92
  context.addInitializer(function() {
93
93
  const container = getActiveContainer();
94
94
  if (container === void 0) throw new MissingContainerContextError(String(context.name));
95
- const hint = options === void 0 ? void 0 : injectableSlotToResolveOptions({
95
+ const hint = options === void 0 ? void 0 : injectionSlotToResolveOptions({
96
96
  ...options.name !== void 0 ? { name: options.name } : {},
97
97
  ...options.tags !== void 0 ? { tags: options.tags } : {}
98
98
  });