di-craft 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Egor Bezmen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # di-craft
2
+
3
+ A tiny TypeScript dependency injection container.
4
+
5
+ ## Features
6
+
7
+ - Zero runtime dependencies
8
+ - No decorators
9
+ - No reflect-metadata
10
+ - Type-safe tokens
11
+ - Explicit factories
12
+ - Singleton and transient scopes
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ bun add di-craft
18
+ ```
package/dist/index.cjs ADDED
@@ -0,0 +1,13 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/token/token.ts
3
+ var TokenClass = class {
4
+ name;
5
+ id;
6
+ constructor(name) {
7
+ this.name = name;
8
+ this.id = Symbol(name);
9
+ }
10
+ };
11
+ const createToken = (name) => new TokenClass(name);
12
+ //#endregion
13
+ exports.createToken = createToken;
@@ -0,0 +1,11 @@
1
+ //#region src/token/types.d.ts
2
+ type Token<T> = {
3
+ readonly id: symbol;
4
+ readonly name: string;
5
+ readonly __type?: T;
6
+ };
7
+ //#endregion
8
+ //#region src/token/token.d.ts
9
+ declare const createToken: <T>(name: string) => Token<T>;
10
+ //#endregion
11
+ export { type Token, createToken };
@@ -0,0 +1,11 @@
1
+ //#region src/token/types.d.ts
2
+ type Token<T> = {
3
+ readonly id: symbol;
4
+ readonly name: string;
5
+ readonly __type?: T;
6
+ };
7
+ //#endregion
8
+ //#region src/token/token.d.ts
9
+ declare const createToken: <T>(name: string) => Token<T>;
10
+ //#endregion
11
+ export { type Token, createToken };
package/dist/index.mjs ADDED
@@ -0,0 +1,12 @@
1
+ //#region src/token/token.ts
2
+ var TokenClass = class {
3
+ name;
4
+ id;
5
+ constructor(name) {
6
+ this.name = name;
7
+ this.id = Symbol(name);
8
+ }
9
+ };
10
+ const createToken = (name) => new TokenClass(name);
11
+ //#endregion
12
+ export { createToken };
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "di-craft",
3
+ "version": "0.0.1",
4
+ "description": "A tiny TypeScript dependency injection container",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Egor Bezmen",
8
+ "email": "egor1911@gmail.com"
9
+ },
10
+ "type": "module",
11
+ "sideEffects": false,
12
+ "engines": {
13
+ "node": ">=20"
14
+ },
15
+ "main": "./dist/index.cjs",
16
+ "module": "./dist/index.mjs",
17
+ "types": "./dist/index.d.mts",
18
+ "exports": {
19
+ ".": {
20
+ "import": {
21
+ "types": "./dist/index.d.mts",
22
+ "default": "./dist/index.mjs"
23
+ },
24
+ "require": {
25
+ "types": "./dist/index.d.cts",
26
+ "default": "./dist/index.cjs"
27
+ }
28
+ },
29
+ "./package.json": "./package.json"
30
+ },
31
+ "publishConfig": {
32
+ "registry": "https://registry.npmjs.org/"
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "README.md",
37
+ "LICENSE"
38
+ ],
39
+ "scripts": {
40
+ "build": "tsdown",
41
+ "test": "bun test",
42
+ "typecheck": "tsc --noEmit",
43
+ "lint": "biome check .",
44
+ "format": "biome check --write .",
45
+ "publint": "publint",
46
+ "checks": "bun run lint && bun run typecheck && bun run test && bun run build && bun run publint",
47
+ "prepack": "bun run build"
48
+ },
49
+ "keywords": [
50
+ "dependency-injection",
51
+ "di",
52
+ "ioc",
53
+ "typescript",
54
+ "container"
55
+ ],
56
+ "homepage": "https://github.com/bezmen-e/di-craft",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/bezmen-e/di-craft.git"
60
+ },
61
+ "bugs": {
62
+ "url": "https://github.com/bezmen-e/di-craft/issues"
63
+ },
64
+ "devDependencies": {
65
+ "@biomejs/biome": "2.4.16",
66
+ "@types/bun": "1.3.14",
67
+ "publint": "0.3.21",
68
+ "tsdown": "0.22.0",
69
+ "typescript": "6.0.3"
70
+ }
71
+ }