@kaokei/di 2.0.9 → 3.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.
Files changed (80) hide show
  1. package/README.md +27 -56
  2. package/dist/binding.d.cts +36 -0
  3. package/dist/binding.d.ts +36 -0
  4. package/dist/cachemap.d.cts +21 -0
  5. package/dist/cachemap.d.ts +21 -0
  6. package/dist/constants.d.cts +28 -0
  7. package/dist/constants.d.ts +28 -0
  8. package/dist/container.d.cts +29 -0
  9. package/dist/container.d.ts +29 -0
  10. package/dist/decorator.d.cts +18 -0
  11. package/dist/decorator.d.ts +18 -0
  12. package/dist/errors/BaseError.d.cts +4 -0
  13. package/dist/errors/BaseError.d.ts +4 -0
  14. package/dist/errors/BindingNotFoundError.d.cts +5 -0
  15. package/dist/errors/BindingNotFoundError.d.ts +5 -0
  16. package/dist/errors/BindingNotValidError.d.cts +5 -0
  17. package/dist/errors/BindingNotValidError.d.ts +5 -0
  18. package/dist/errors/CircularDependencyError.d.cts +5 -0
  19. package/dist/errors/CircularDependencyError.d.ts +5 -0
  20. package/dist/errors/DuplicateBindingError.d.cts +5 -0
  21. package/dist/errors/DuplicateBindingError.d.ts +5 -0
  22. package/dist/errors/PostConstructError.d.cts +5 -0
  23. package/dist/errors/PostConstructError.d.ts +5 -0
  24. package/dist/index.cjs +1 -0
  25. package/dist/index.d.cts +4 -0
  26. package/dist/index.d.ts +4 -0
  27. package/dist/index.js +402 -0
  28. package/dist/interfaces.d.cts +47 -0
  29. package/dist/interfaces.d.ts +47 -0
  30. package/dist/lazyinject.d.cts +4 -0
  31. package/dist/lazyinject.d.ts +4 -0
  32. package/dist/token.d.cts +12 -0
  33. package/dist/token.d.ts +12 -0
  34. package/package.json +38 -94
  35. package/dist/index.cjs.js +0 -746
  36. package/dist/index.cjs.js.map +0 -1
  37. package/dist/index.cjs.min.js +0 -11
  38. package/dist/index.cjs.min.js.map +0 -1
  39. package/dist/index.cjs.runtime.js +0 -735
  40. package/dist/index.cjs.runtime.js.map +0 -1
  41. package/dist/index.cjs.runtime.min.js +0 -11
  42. package/dist/index.cjs.runtime.min.js.map +0 -1
  43. package/dist/index.esm.js +0 -724
  44. package/dist/index.esm.js.map +0 -1
  45. package/dist/index.esm.min.js +0 -11
  46. package/dist/index.esm.min.js.map +0 -1
  47. package/dist/index.esm.runtime.js +0 -713
  48. package/dist/index.esm.runtime.js.map +0 -1
  49. package/dist/index.esm.runtime.min.js +0 -11
  50. package/dist/index.esm.runtime.min.js.map +0 -1
  51. package/dist/index.iife.js +0 -749
  52. package/dist/index.iife.js.map +0 -1
  53. package/dist/index.iife.min.js +0 -11
  54. package/dist/index.iife.min.js.map +0 -1
  55. package/dist/src/Injector.d.ts +0 -143
  56. package/dist/src/Injector.d.ts.map +0 -1
  57. package/dist/src/constants.d.ts +0 -17
  58. package/dist/src/constants.d.ts.map +0 -1
  59. package/dist/src/decorator.d.ts +0 -42
  60. package/dist/src/decorator.d.ts.map +0 -1
  61. package/dist/src/errors/CircularDependencyError.d.ts +0 -6
  62. package/dist/src/errors/CircularDependencyError.d.ts.map +0 -1
  63. package/dist/src/errors/ConstructorInjectMissTokenError.d.ts +0 -6
  64. package/dist/src/errors/ConstructorInjectMissTokenError.d.ts.map +0 -1
  65. package/dist/src/errors/InjectFailedError.d.ts +0 -6
  66. package/dist/src/errors/InjectFailedError.d.ts.map +0 -1
  67. package/dist/src/errors/PropertyInjectMissTokenError.d.ts +0 -6
  68. package/dist/src/errors/PropertyInjectMissTokenError.d.ts.map +0 -1
  69. package/dist/src/errors/ProviderNotValidError.d.ts +0 -6
  70. package/dist/src/errors/ProviderNotValidError.d.ts.map +0 -1
  71. package/dist/src/errors/TokenNotFoundError.d.ts +0 -6
  72. package/dist/src/errors/TokenNotFoundError.d.ts.map +0 -1
  73. package/dist/src/errors/index.d.ts +0 -7
  74. package/dist/src/errors/index.d.ts.map +0 -1
  75. package/dist/src/forwardRef.d.ts +0 -7
  76. package/dist/src/forwardRef.d.ts.map +0 -1
  77. package/dist/src/index.d.ts +0 -7
  78. package/dist/src/index.d.ts.map +0 -1
  79. package/dist/src/utils.d.ts +0 -4
  80. package/dist/src/utils.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,38 +1,24 @@
1
1
  {
2
2
  "name": "@kaokei/di",
3
- "version": "2.0.9",
4
- "description": "Tiny di library depends on typescript and reflect-metadata",
3
+ "version": "3.0.0",
5
4
  "type": "module",
6
- "main": "./dist/index.cjs.runtime.min.js",
7
- "module": "./dist/index.esm.runtime.min.js",
8
- "types": "./dist/src/index.d.ts",
9
- "unpkg": "dist/index.iife.min.js",
10
- "jsdelivr": "dist/index.iife.min.js",
5
+ "description": "Tiny di library depends on typescript decorator.",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "unpkg": "./dist/index.cjs",
10
+ "jsdelivr": "./dist/index.cjs",
11
11
  "files": [
12
12
  "dist/**/*"
13
13
  ],
14
14
  "exports": {
15
15
  ".": {
16
- "types": "./dist/src/index.d.ts",
17
- "import": "./dist/index.esm.js",
18
- "browser": "./dist/index.iife.js",
19
- "node": {
20
- "import": {
21
- "production": "./dist/index.esm.runtime.min.js",
22
- "development": "./dist/index.esm.js",
23
- "default": "./dist/index.esm.js"
24
- },
25
- "require": {
26
- "production": "./dist/index.cjs.runtime.min.js",
27
- "development": "./dist/index.cjs.js",
28
- "default": "./dist/index.cjs.js"
29
- }
30
- }
16
+ "import": "./dist/index.js",
17
+ "require": "./dist/index.cjs"
31
18
  },
32
19
  "./dist/*": "./dist/*",
33
20
  "./package.json": "./package.json"
34
21
  },
35
- "browserVariableName": "DI",
36
22
  "sideEffects": false,
37
23
  "homepage": "https://github.com/kaokei/di",
38
24
  "author": "kaokei",
@@ -44,80 +30,38 @@
44
30
  "type": "git",
45
31
  "url": "git+https://github.com/kaokei/di.git"
46
32
  },
47
- "keywords": [],
48
- "scripts": {
49
- "check": "tsc -p tsconfig.app.json --noEmit",
50
- "rp": "rollup -c rollup.config.cjs",
51
- "unit": "jest --silent",
52
- "test": "echo \"Error: no test specified\" && exit 1",
53
- "lint": "eslint --fix --ext js,ts,jsx,tsx src tests playground",
54
- "build": "npm run check && npm run rp",
55
- "clean": "rm -rf dist/*",
56
- "postpublish": "git push origin --follow-tags",
57
- "prepublishOnly": "npm run clean && npm run build",
58
- "release": "standard-version -r",
59
- "release:first": "standard-version --first-release",
60
- "coverage": "open ./coverage/lcov-report/index.html",
61
- "commit": "git-cz"
62
- },
33
+ "keywords": [
34
+ "IoC",
35
+ "DI",
36
+ "Dependency injection"
37
+ ],
63
38
  "devDependencies": {
64
- "@babel/core": "^7.23.3",
65
- "@babel/plugin-transform-runtime": "^7.23.4",
66
- "@babel/preset-env": "^7.23.3",
67
- "@babel/types": "^7.23.4",
68
- "@commitlint/cli": "^18.4.3",
69
- "@commitlint/config-conventional": "^18.4.3",
70
- "@rollup/plugin-babel": "^6.0.4",
71
- "@rollup/plugin-commonjs": "^25.0.7",
72
- "@rollup/plugin-json": "^6.0.1",
73
- "@rollup/plugin-node-resolve": "^15.2.3",
74
- "@rollup/plugin-replace": "^5.0.5",
75
- "@types/jest": "^29.5.10",
76
- "@types/node": "^20.10.0",
77
- "@typescript-eslint/eslint-plugin": "^6.12.0",
78
- "@typescript-eslint/parser": "^6.12.0",
79
- "babel-jest": "^29.7.0",
80
- "commitizen": "^4.3.0",
81
- "cz-conventional-changelog": "^3.3.0",
82
- "eslint": "^8.54.0",
83
- "eslint-config-prettier": "^9.0.0",
84
- "eslint-plugin-prettier": "^5.0.1",
85
- "fs-extra": "^11.1.1",
86
- "git-cz": "^4.9.0",
87
- "jest": "^29.7.0",
88
- "jest-environment-jsdom": "^29.7.0",
89
- "lint-staged": "^15.1.0",
90
- "prettier": "^3.1.0",
39
+ "@types/fs-extra": "^11.0.4",
40
+ "@types/node": "^22.13.4",
41
+ "@vitejs/plugin-vue": "^5.2.1",
42
+ "@vitest/coverage-v8": "^3.0.5",
43
+ "@vue/test-utils": "^2.4.6",
44
+ "fs-extra": "^11.3.0",
45
+ "jsdom": "^25.0.1",
91
46
  "reflect-metadata": "^0.2.2",
92
- "rollup": "^4.5.2",
93
- "rollup-plugin-node-builtins": "^2.1.2",
94
- "rollup-plugin-node-globals": "^1.4.0",
95
- "rollup-plugin-polyfill-node": "^0.13.0",
96
- "@rollup/plugin-terser": "^0.4.4",
97
- "rollup-plugin-typescript2": "^0.36.0",
98
47
  "standard-version": "^9.5.0",
99
- "ts-jest": "^29.1.1",
100
- "tslib": "^2.6.2",
101
- "typescript": "^5.3.2",
102
- "yorkie": "^2.0.0"
48
+ "typescript": "~5.6.3",
49
+ "vite": "^5.4.14",
50
+ "vite-plugin-dts": "^4.5.0",
51
+ "vitest": "^3.0.5",
52
+ "vue": "^3.5.13",
53
+ "vue-router": "^4.5.0",
54
+ "vue-tsc": "^2.2.2"
103
55
  },
104
- "gitHooks": {
105
- "pre-commit": "lint-staged",
106
- "commit-msg": "commitlint -e $GIT_PARAMS"
56
+ "dependencies": {
57
+ "inversify": "6"
107
58
  },
108
- "lint-staged": {
109
- "*.{ts,js,tsx,jsx}": [
110
- "eslint --fix"
111
- ]
112
- },
113
- "config": {
114
- "commitizen": {
115
- "path": "node_modules/cz-conventional-changelog"
116
- }
117
- },
118
- "commitlint": {
119
- "extends": [
120
- "@commitlint/config-conventional"
121
- ]
59
+ "scripts": {
60
+ "test": "vitest",
61
+ "coverage": "vitest run --coverage",
62
+ "build": "tsc && vite build",
63
+ "clean": "rm -rf dist/*",
64
+ "release": "standard-version -r",
65
+ "release:first": "standard-version --first-release"
122
66
  }
123
- }
67
+ }