injectkit 1.0.0

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.
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Represents a constructor function that can be instantiated with the `new` operator.
3
+ * @template T The type of instance that this constructor creates.
4
+ */
5
+ export interface Constructor<T> extends Function {
6
+ new (...args: any[]): T;
7
+ }
8
+ /**
9
+ * Represents an abstract class or interface that cannot be directly instantiated.
10
+ * @template T The type of the prototype.
11
+ */
12
+ export interface Abstract<T> extends Function {
13
+ prototype: T;
14
+ }
15
+ /**
16
+ * A type identifier used to resolve dependencies in the container.
17
+ * Can be either a concrete constructor or an abstract class/interface.
18
+ * @template T The type being identified.
19
+ */
20
+ export type Identifier<T> = Constructor<T> | Abstract<T>;
21
+ /**
22
+ * Represents an instance of type T that is also an object.
23
+ * @template T The type of the instance.
24
+ */
25
+ export type Instance<T> = T & object;
26
+ /**
27
+ * Extracts the element type from an array type.
28
+ * @template T The array type to extract the element type from.
29
+ * @example
30
+ * ArrayType<Array<string>> // string
31
+ * ArrayType<string[]> // string
32
+ */
33
+ export type ArrayType<T> = T extends Array<infer I> ? I : never;
34
+ /**
35
+ * Extracts the key and value types from a map type.
36
+ * @template T The map type to extract the key and value types from.
37
+ * @example
38
+ * MapType<Map<string, number>> // [string, number]
39
+ * MapType<Map<symbol, AbstractService>> // [symbol, AbstractService]
40
+ */
41
+ export type MapType<T> = T extends Map<infer I, infer O> ? [I, O] : never;
42
+ /**
43
+ * Dependency injection container that manages the creation and lifetime of registered services.
44
+ */
45
+ export declare abstract class Container {
46
+ /**
47
+ * Retrieves an instance of the specified type from the container.
48
+ * For singleton and scoped lifetimes, returns cached instances when available.
49
+ * For transient lifetimes, creates a new instance each time.
50
+ * @template T The type of instance to retrieve.
51
+ * @param id The identifier (constructor or abstract class) for the type to resolve.
52
+ * @returns An instance of type T.
53
+ */
54
+ abstract get<T>(id: Identifier<T>): T;
55
+ /**
56
+ * Creates a new scoped container that inherits all registrations from this container.
57
+ * Scoped containers allow for per-scope instance management, where scoped services
58
+ * are shared within a scope but isolated between different scopes.
59
+ * @returns A new scoped container instance with this container as its parent.
60
+ */
61
+ abstract createScopedContainer(): ScopedContainer;
62
+ }
63
+ /**
64
+ * Scoped container that extends the base container with the ability to override registrations.
65
+ */
66
+ export type ScopedContainer = Container & {
67
+ /**
68
+ * Overrides the registration for the specified identifier with a new instance.
69
+ * @template T The type of the instance to override.
70
+ * @param id The identifier of the registration to override.
71
+ * @param instance The instance to use for the registration.
72
+ */
73
+ override<T>(id: Identifier<T>, instance: Instance<T>): void;
74
+ };
75
+ /**
76
+ * Factory function that creates an instance of type T using the provided container.
77
+ * @template T The type of instance the factory creates.
78
+ * @param container The container to use for resolving dependencies.
79
+ * @returns An instance of type T.
80
+ */
81
+ export type Factory<T> = (container: Container) => T;
82
+ /**
83
+ * Defines the lifetime management strategy for a registered service.
84
+ * - 'singleton': One instance shared across the entire container
85
+ * - 'transient': A new instance created every time it's requested
86
+ * - 'scoped': One instance per scoped container
87
+ */
88
+ export type Lifetime = 'singleton' | 'transient' | 'scoped';
89
+ /**
90
+ * Fluent interface for configuring registration lifetime.
91
+ * Allows chaining of configuration methods to set the lifetime of a registration.
92
+ * @template T The type being registered.
93
+ */
94
+ export interface RegistrationLifeTime {
95
+ /**
96
+ * Sets the lifetime to singleton (one instance shared across the container).
97
+ */
98
+ asSingleton(): void;
99
+ /**
100
+ * Sets the lifetime to transient (new instance created each time).
101
+ */
102
+ asTransient(): void;
103
+ /**
104
+ * Sets the lifetime to scoped (one instance per scoped container).
105
+ */
106
+ asScoped(): void;
107
+ }
108
+ /**
109
+ * Fluent interface for configuring array-based registrations.
110
+ * Allows chaining of push() calls to add multiple implementations to an array.
111
+ * @template T The element type of the array being registered.
112
+ */
113
+ export interface RegistrationArray<T> {
114
+ /**
115
+ * Adds an implementation identifier to the array collection.
116
+ * The resolved instance will be pushed to the array when the service is created.
117
+ * @param id The identifier of the implementation to add.
118
+ * @returns Registration array options for method chaining.
119
+ */
120
+ push(id: Identifier<T>): RegistrationArray<T>;
121
+ }
122
+ /**
123
+ * Fluent interface for configuring map-based registrations.
124
+ * Allows chaining of set() calls to add multiple implementations to a map.
125
+ * @template K The key type of the map being registered.
126
+ * @template V The value type of the map being registered.
127
+ */
128
+ export interface RegistrationMap<K, V> {
129
+ /**
130
+ * Adds an implementation identifier to the map collection.
131
+ * The resolved instance will be stored in the map with the provided key when the service is created.
132
+ * @param key The key of the implementation to add.
133
+ * @param id The identifier of the implementation to add.
134
+ * @returns Registration map options for method chaining.
135
+ */
136
+ set(key: K, id: Identifier<V>): RegistrationMap<K, V>;
137
+ }
138
+ /**
139
+ * Fluent interface for specifying how a service should be created.
140
+ * Provides methods to register a service using a class, factory, or instance.
141
+ * @template T The type being registered.
142
+ */
143
+ export interface RegistrationType<T> {
144
+ /**
145
+ * Registers a service using a constructor class.
146
+ * @param constructor The constructor function to use for creating instances.
147
+ * @returns Registration options for further configuration.
148
+ */
149
+ useClass(constructor: Constructor<T>): RegistrationLifeTime;
150
+ /**
151
+ * Registers a service using a factory function.
152
+ * @param factory The factory function that creates instances.
153
+ * @returns Registration options for further configuration.
154
+ */
155
+ useFactory(factory: Factory<T>): RegistrationLifeTime;
156
+ /**
157
+ * Registers a service using an existing instance.
158
+ * @param instance The instance to register (will be used as a singleton).
159
+ */
160
+ useInstance(instance: Instance<T>): void;
161
+ /**
162
+ * Registers a service as an array type, allowing multiple implementations to be collected.
163
+ * Use this when you need to register a service that extends Array and collect multiple implementations.
164
+ * The array will be populated with instances resolved from the identifiers added via push().
165
+ * @template U The array element type extracted from T.
166
+ * @param constructor The constructor function for the array type (must extend Array).
167
+ * @returns Registration array options for chaining push() calls to add implementations.
168
+ */
169
+ useArray<U extends ArrayType<T>>(constructor: Constructor<T>): RegistrationArray<U>;
170
+ /**
171
+ * Registers a service as a map type, allowing multiple implementations to be collected.
172
+ * Use this when you need to register a service that extends Map and collect multiple implementations.
173
+ * The map will be populated with instances resolved from the identifiers added via set().
174
+ * @template U The map element type extracted from T.
175
+ * @param constructor The constructor function for the map type (must extend Map).
176
+ * @returns Registration map options for chaining set() calls to add implementations.
177
+ */
178
+ useMap<U extends MapType<T>>(constructor: Constructor<T>): RegistrationMap<U[0], U[1]>;
179
+ }
180
+ /**
181
+ * Service registry that manages service registrations before building a container.
182
+ * Allows registration, removal, and checking of services, and provides a method to build a container
183
+ * with all registered services.
184
+ */
185
+ export interface Registry {
186
+ /**
187
+ * Registers a service with the registry.
188
+ * @template T The type of the service to register.
189
+ * @param id The identifier (constructor or abstract class) for the type to register.
190
+ * @returns The registration type for configuring how the service should be created.
191
+ */
192
+ register<T>(id: Identifier<T>): RegistrationType<T>;
193
+ /**
194
+ * Removes a service registration from the registry.
195
+ * @template T The type of the service to remove.
196
+ * @param id The identifier (constructor or abstract class) for the type to remove.
197
+ */
198
+ remove<T>(id: Identifier<T>): void;
199
+ /**
200
+ * Checks if a service is registered with the registry.
201
+ * @template T The type of the service to check.
202
+ * @param id The identifier (constructor or abstract class) for the type to check.
203
+ * @returns True if the service is registered, false otherwise.
204
+ */
205
+ isRegistered<T>(id: Identifier<T>): boolean;
206
+ /**
207
+ * Builds a container from the registry.
208
+ * @returns A container instance.
209
+ */
210
+ build(): Container;
211
+ }
212
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,CAAE,SAAQ,QAAQ;IAE9C,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC,CAAE,SAAQ,QAAQ;IAC3C,SAAS,EAAE,CAAC,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,WAAW,CAAC,C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CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEnC;;;;;OAKG;IACH,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IAE5C;;;OAGG;IACH,KAAK,IAAI,SAAS,CAAC;CACpB"}
@@ -0,0 +1,31 @@
1
+ import { Constructor, Factory, Identifier, Instance, Lifetime } from './interfaces.js';
2
+ /**
3
+ * Internal representation of a service registration in the container.
4
+ * Contains all the information needed to resolve and create instances of the service.
5
+ * @template T The type being registered.
6
+ * @internal
7
+ */
8
+ export type Registration<T> = {
9
+ /** Optional constructor function for class-based registration. */
10
+ constructor?: Constructor<T>;
11
+ /** Optional factory function for factory-based registration. */
12
+ factory?: Factory<T>;
13
+ /** Optional instance for instance-based registration. */
14
+ instance?: Instance<T>;
15
+ /** The lifetime management strategy for this registration. */
16
+ lifetime: Lifetime;
17
+ /**
18
+ * Array of all dependencies required by this registration.
19
+ * This is the union of ctorDependencies and collectionDependencies.
20
+ */
21
+ dependencies: Identifier<unknown>[];
22
+ /** Array of dependencies required by the constructor (extracted via reflection). */
23
+ ctorDependencies: Identifier<unknown>[];
24
+ /**
25
+ * Optional collection of dependencies for array or map registration.
26
+ * For arrays: Array of identifiers that will be resolved and pushed to the array.
27
+ * For maps: Map of key-value pairs where values are identifiers that will be resolved and stored.
28
+ */
29
+ collectionDependencies?: Array<Identifier<unknown>> | Map<unknown, Identifier<unknown>>;
30
+ };
31
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEvF;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,kEAAkE;IAClE,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7B,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACrB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;OAGG;IACH,YAAY,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;IACpC,oFAAoF;IACpF,gBAAgB,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;IACxC;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;CACzF,CAAC"}
@@ -0,0 +1,56 @@
1
+ import 'reflect-metadata';
2
+ import { Identifier, RegistrationType, Container, Registry } from './interfaces.js';
3
+ /**
4
+ * Registry implementation for managing service registrations.
5
+ * Allows registration of services with various creation strategies (class, factory, instance)
6
+ * and lifetime management (singleton, transient, scoped).
7
+ * Validates registrations for missing dependencies, circular dependencies, and tag conflicts
8
+ * before building the container.
9
+ */
10
+ export declare class InjectKitRegistry implements Registry {
11
+ /** Internal map storing all service registrations by their identifier. */
12
+ private readonly registrations;
13
+ /**
14
+ * Registers a service with the registry.
15
+ * @template T The type of the service to register.
16
+ * @param id The identifier (constructor or abstract class) for the type to register.
17
+ * @returns The registration type for configuring how the service should be created.
18
+ * @throws {Error} If a registration for the given identifier already exists.
19
+ */
20
+ register<T>(id: Identifier<T>): RegistrationType<T>;
21
+ /**
22
+ * Removes a service registration from the registry.
23
+ * @template T The type of the service to remove.
24
+ * @param id The identifier (constructor or abstract class) for the type to remove.
25
+ * @throws {Error} If the registration for the given identifier is not found.
26
+ */
27
+ remove<T>(id: Identifier<T>): void;
28
+ /**
29
+ * Checks if a service is registered with the registry.
30
+ * @template T The type of the service to check.
31
+ * @param id The identifier (constructor or abstract class) for the type to check.
32
+ * @returns True if the service is registered, false otherwise.
33
+ */
34
+ isRegistered<T>(id: Identifier<T>): boolean;
35
+ /**
36
+ * Verifies that all dependencies for registered services are also registered.
37
+ * @param registrations Map of all registrations to verify.
38
+ * @throws {Error} If any service has dependencies that are not registered.
39
+ */
40
+ private static verifyRegistrations;
41
+ /**
42
+ * Verifies that there are no circular dependencies in the registration graph.
43
+ * Uses depth-first search to detect cycles in the dependency graph.
44
+ * @param registrations Map of all registrations to verify.
45
+ * @throws {Error} If a circular dependency is detected.
46
+ */
47
+ private static verifyNoCircularDependencies;
48
+ /**
49
+ * Builds a container from all registered services.
50
+ * Performs validation checks for missing dependencies and circular dependencies.
51
+ * @returns A configured container instance ready to resolve services.
52
+ * @throws {Error} If validation fails (missing dependencies, circular dependencies).
53
+ */
54
+ build(): Container;
55
+ }
56
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAGL,UAAU,EAGV,gBAAgB,EAChB,SAAS,EAGT,QAAQ,EAKT,MAAM,iBAAiB,CAAC;AAIzB;;;;;;GAMG;AACH,qBAAa,iBAAkB,YAAW,QAAQ;IAChD,0EAA0E;IAC1E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAuE;IAErG;;;;;;OAMG;IACI,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC;IAU1D;;;;;OAKG;IACI,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI;IAMzC;;;;;OAKG;IACI,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO;IAIlD;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAgBlC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAyB3C;;;;;OAKG;IACI,KAAK,IAAI,SAAS;CAyB1B"}
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "injectkit",
3
+ "version": "1.0.0",
4
+ "description": "Lightweight, type-safe dependency injection container for TypeScript with constructor injection, factory functions, and lifetime management.",
5
+ "author": {
6
+ "name": "Marooned Software",
7
+ "url": "https://github.com/MaroonedSoftware/injectkit"
8
+ },
9
+ "bugs": {
10
+ "url": "https://github.com/MaroonedSoftware/injectkit/issues"
11
+ },
12
+ "homepage": "https://github.com/MaroonedSoftware/injectkit#readme",
13
+ "keywords": [
14
+ "dependency injection",
15
+ "inversion of control",
16
+ "service locator",
17
+ "dependency",
18
+ "injection",
19
+ "service",
20
+ "container",
21
+ "typescript"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/MaroonedSoftware/injectkit.git"
26
+ },
27
+ "type": "module",
28
+ "main": "./dist/index.js",
29
+ "module": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "license": "MIT",
32
+ "files": [
33
+ "dist/**"
34
+ ],
35
+ "engines": {
36
+ "node": ">=20"
37
+ },
38
+ "dependencies": {
39
+ "reflect-metadata": "^0.2.2"
40
+ },
41
+ "devDependencies": {
42
+ "@changesets/cli": "^2.29.8",
43
+ "@eslint/js": "^9.39.2",
44
+ "@vitest/coverage-v8": "^4.0.15",
45
+ "eslint": "^9.39.2",
46
+ "eslint-config-prettier": "^10.1.8",
47
+ "eslint-plugin-only-warn": "^1.1.0",
48
+ "globals": "^16.5.0",
49
+ "prettier": "^3.7.4",
50
+ "tsup": "^8.5.1",
51
+ "typescript": "^5.9.3",
52
+ "typescript-eslint": "^8.50.0",
53
+ "unplugin-swc": "^1.5.9",
54
+ "vitest": "^4.0.15"
55
+ },
56
+ "scripts": {
57
+ "build": "tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration",
58
+ "build:ci": "eslint --max-warnings=0 && pnpm run build",
59
+ "changeset": "changeset && changeset version",
60
+ "lint": "eslint --fix",
61
+ "format": "prettier --write . ",
62
+ "test": "vitest run",
63
+ "test:ci": "vitest run --coverage "
64
+ }
65
+ }