@kaokei/di 1.1.0 → 2.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 (47) hide show
  1. package/README.md +29 -4
  2. package/dist/index.cjs.js +230 -329
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.cjs.min.js +2 -2
  5. package/dist/index.cjs.min.js.map +1 -1
  6. package/dist/index.cjs.runtime.js +218 -310
  7. package/dist/index.cjs.runtime.js.map +1 -1
  8. package/dist/index.cjs.runtime.min.js +2 -2
  9. package/dist/index.cjs.runtime.min.js.map +1 -1
  10. package/dist/index.esm.js +230 -327
  11. package/dist/index.esm.js.map +1 -1
  12. package/dist/index.esm.min.js +3 -3
  13. package/dist/index.esm.min.js.map +1 -1
  14. package/dist/index.esm.runtime.js +218 -299
  15. package/dist/index.esm.runtime.js.map +1 -1
  16. package/dist/index.esm.runtime.min.js +3 -3
  17. package/dist/index.esm.runtime.min.js.map +1 -1
  18. package/dist/index.iife.js +230 -329
  19. package/dist/index.iife.js.map +1 -1
  20. package/dist/index.iife.min.js +3 -3
  21. package/dist/index.iife.min.js.map +1 -1
  22. package/dist/src/Injector.d.ts +142 -131
  23. package/dist/src/Injector.d.ts.map +1 -1
  24. package/dist/src/constants.d.ts +16 -17
  25. package/dist/src/constants.d.ts.map +1 -1
  26. package/dist/src/decorator.d.ts +41 -41
  27. package/dist/src/decorator.d.ts.map +1 -1
  28. package/dist/src/errors/CircularDependencyError.d.ts +5 -5
  29. package/dist/src/errors/CircularDependencyError.d.ts.map +1 -1
  30. package/dist/src/errors/InjectFailedError.d.ts +5 -5
  31. package/dist/src/errors/InjectFailedError.d.ts.map +1 -1
  32. package/dist/src/errors/ProviderNotValidError.d.ts +5 -5
  33. package/dist/src/errors/ProviderNotValidError.d.ts.map +1 -1
  34. package/dist/src/errors/TokenNotFoundError.d.ts +5 -5
  35. package/dist/src/errors/TokenNotFoundError.d.ts.map +1 -1
  36. package/dist/src/errors/index.d.ts +4 -4
  37. package/dist/src/errors/index.d.ts.map +1 -1
  38. package/dist/src/forwardRef.d.ts +6 -6
  39. package/dist/src/forwardRef.d.ts.map +1 -1
  40. package/dist/src/index.d.ts +7 -7
  41. package/dist/src/index.d.ts.map +1 -1
  42. package/dist/src/utils.d.ts +3 -2
  43. package/dist/src/utils.d.ts.map +1 -1
  44. package/package.json +38 -37
  45. package/CHANGELOG.md +0 -135
  46. package/dist/src/types/index.d.ts +0 -2
  47. package/dist/src/types/index.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@kaokei/di",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "description": "Tiny di library depend on typescript and reflect-metadata",
5
+ "type": "module",
5
6
  "main": "./dist/index.cjs.runtime.min.js",
6
7
  "module": "./dist/index.esm.runtime.min.js",
7
8
  "types": "./dist/src/index.d.ts",
@@ -25,7 +26,7 @@
25
26
  "keywords": [],
26
27
  "scripts": {
27
28
  "check": "tsc -p tsconfig.app.json --noEmit",
28
- "rp": "rollup -c rollup.config.js",
29
+ "rp": "rollup -c rollup.config.cjs",
29
30
  "unit": "jest --silent",
30
31
  "test": "echo \"Error: no test specified\" && exit 1",
31
32
  "lint": "eslint --fix --ext js,ts,jsx,tsx src tests playground",
@@ -42,44 +43,44 @@
42
43
  "reflect-metadata": "^0.1.13"
43
44
  },
44
45
  "devDependencies": {
45
- "@babel/core": "^7.12.3",
46
- "@babel/plugin-transform-runtime": "^7.14.3",
47
- "@babel/preset-env": "^7.12.1",
48
- "@babel/types": "^7.12.0",
49
- "@commitlint/cli": "^12.1.4",
50
- "@commitlint/config-conventional": "^12.1.4",
51
- "@rollup/plugin-babel": "^5.3.0",
52
- "@rollup/plugin-commonjs": "^15.1.0",
53
- "@rollup/plugin-json": "^4.0.0",
54
- "@rollup/plugin-node-resolve": "^9.0.0",
55
- "@rollup/plugin-replace": "^2.4.2",
56
- "@types/jest": "^26.0.20",
57
- "@types/node": "^14.10.1",
58
- "@typescript-eslint/eslint-plugin": "^5.6.0",
59
- "@typescript-eslint/parser": "^5.6.0",
60
- "babel-jest": "^26.6.3",
61
- "commitizen": "^4.2.4",
62
- "cz-conventional-changelog": "^3.2.0",
63
- "eslint": "^7.11.0",
64
- "eslint-config-prettier": "^6.13.0",
65
- "eslint-plugin-prettier": "^3.1.4",
66
- "fs-extra": "^9.0.1",
67
- "git-cz": "^4.7.6",
68
- "jest": "^26.6.3",
69
- "jest-environment-jsdom": "^26.6.2",
70
- "lint-staged": "^10.4.2",
71
- "prettier": "^2.1.2",
46
+ "@babel/core": "^7.23.3",
47
+ "@babel/plugin-transform-runtime": "^7.23.4",
48
+ "@babel/preset-env": "^7.23.3",
49
+ "@babel/types": "^7.23.4",
50
+ "@commitlint/cli": "^18.4.3",
51
+ "@commitlint/config-conventional": "^18.4.3",
52
+ "@rollup/plugin-babel": "^6.0.4",
53
+ "@rollup/plugin-commonjs": "^25.0.7",
54
+ "@rollup/plugin-json": "^6.0.1",
55
+ "@rollup/plugin-node-resolve": "^15.2.3",
56
+ "@rollup/plugin-replace": "^5.0.5",
57
+ "@types/jest": "^29.5.10",
58
+ "@types/node": "^20.10.0",
59
+ "@typescript-eslint/eslint-plugin": "^6.12.0",
60
+ "@typescript-eslint/parser": "^6.12.0",
61
+ "babel-jest": "^29.7.0",
62
+ "commitizen": "^4.3.0",
63
+ "cz-conventional-changelog": "^3.3.0",
64
+ "eslint": "^8.54.0",
65
+ "eslint-config-prettier": "^9.0.0",
66
+ "eslint-plugin-prettier": "^5.0.1",
67
+ "fs-extra": "^11.1.1",
68
+ "git-cz": "^4.9.0",
69
+ "jest": "^29.7.0",
70
+ "jest-environment-jsdom": "^29.7.0",
71
+ "lint-staged": "^15.1.0",
72
+ "prettier": "^3.1.0",
72
73
  "reflect-metadata": "^0.1.13",
73
- "rollup": "^2.45.2",
74
+ "rollup": "^4.5.2",
74
75
  "rollup-plugin-node-builtins": "^2.1.2",
75
76
  "rollup-plugin-node-globals": "^1.4.0",
76
- "rollup-plugin-polyfill-node": "^0.6.2",
77
- "rollup-plugin-terser": "^7.0.2",
78
- "rollup-plugin-typescript2": "^0.27.2",
79
- "standard-version": "^9.0.0",
80
- "ts-jest": "^26.4.4",
81
- "tslib": "^2.0.2",
82
- "typescript": "^4.2.2",
77
+ "rollup-plugin-polyfill-node": "^0.13.0",
78
+ "@rollup/plugin-terser": "^0.4.4",
79
+ "rollup-plugin-typescript2": "^0.36.0",
80
+ "standard-version": "^9.5.0",
81
+ "ts-jest": "^29.1.1",
82
+ "tslib": "^2.6.2",
83
+ "typescript": "^5.3.2",
83
84
  "yorkie": "^2.0.0"
84
85
  },
85
86
  "gitHooks": {
package/CHANGELOG.md DELETED
@@ -1,135 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ## [1.1.0](https://github.com/kaokei/di/compare/v1.0.25...v1.1.0) (2022-02-11)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * **typo:** 修复文字错误 ([2fdb91f](https://github.com/kaokei/di/commit/2fdb91ff95eab8c1c13153e5c267ce584bcf985b))
11
-
12
- ### [1.0.25](https://github.com/kaokei/di/compare/v1.0.24...v1.0.25) (2021-12-11)
13
-
14
- ### [1.0.24](https://github.com/kaokei/di/compare/v1.0.23...v1.0.24) (2021-12-11)
15
-
16
- ### [1.0.23](https://github.com/kaokei/di/compare/v1.0.22...v1.0.23) (2021-12-10)
17
-
18
-
19
- ### Features
20
-
21
- * **default:** 删除了defaultValue ([7cae1d0](https://github.com/kaokei/di/commit/7cae1d039298b39ec7fccd793a804743ec43ab6c))
22
-
23
-
24
- ### Bug Fixes
25
-
26
- * **fix:** catch dispose error ([2ee9b4a](https://github.com/kaokei/di/commit/2ee9b4a69158e8a5741144170615beb25c2e84a7))
27
- * **fix:** 修复了判断InjectFailed场景的错误 ([c97f092](https://github.com/kaokei/di/commit/c97f092744e178236b1317aab108f92d337eb943))
28
-
29
- ### 1.0.22 (2021-10-07)
30
-
31
-
32
- ### Bug Fixes
33
-
34
- * **bugfix:** 修复dispose的bug ([eb5116d](https://github.com/kaokei/di/commit/eb5116d28139ad7c21738e089ce764e76609b3c6))
35
-
36
- ### [1.0.21](https://github.com/kaokei/di/compare/v1.0.20...v1.0.21) (2021-09-16)
37
-
38
-
39
- ### Features
40
-
41
- * **inject:** 修改Inject的参数是必填项 ([2ec3dbe](https://github.com/kaokei/di/commit/2ec3dbeea8dc02ab0d8b43ce104192626cb8a9dd))
42
-
43
- ### [1.0.20](https://github.com/kaokei/di/compare/v1.0.19...v1.0.20) (2021-08-22)
44
-
45
-
46
- ### Bug Fixes
47
-
48
- * **reflect-metadata:** import reflect-metadata ([5e21184](https://github.com/kaokei/di/commit/5e21184f922f32d97640b42c96982313dc5c9ea4))
49
-
50
- ### [1.0.19](https://github.com/kaokei/di/compare/v1.0.18...v1.0.19) (2021-08-22)
51
-
52
-
53
- ### Bug Fixes
54
-
55
- * **fix export:** 重新导出autobind ([ea721c2](https://github.com/kaokei/di/commit/ea721c28be8c0734e43b95a01bc234843346ca5e))
56
-
57
- ### [1.0.18](https://github.com/kaokei/di/compare/v1.0.17...v1.0.18) (2021-08-21)
58
-
59
- ### [1.0.17](https://github.com/kaokei/di/compare/v1.0.16...v1.0.17) (2021-08-21)
60
-
61
-
62
- ### Bug Fixes
63
-
64
- * **autobind:** export autobind ([4f2f4c8](https://github.com/kaokei/di/commit/4f2f4c83bbdb0bcb87bc44df608bdb6fc4858ec2))
65
-
66
- ### [1.0.16](https://github.com/kaokei/di/compare/v1.0.15...v1.0.16) (2021-08-21)
67
-
68
- ### [1.0.15](https://github.com/kaokei/di/compare/v1.0.14...v1.0.15) (2021-08-21)
69
-
70
-
71
- ### Features
72
-
73
- * **autobind:** add autobind-decorator pacakge ([ff60ead](https://github.com/kaokei/di/commit/ff60ead4eb892a15249d8ef74153451c16e0c696))
74
-
75
- ### [1.0.14](https://github.com/kaokei/di/compare/v1.0.13...v1.0.14) (2021-08-06)
76
-
77
-
78
- ### Features
79
-
80
- * **util:** export utils ([458d75e](https://github.com/kaokei/di/commit/458d75e7583d4ca6bfa3c32755daf9b1e1f17b1a))
81
-
82
- ### [1.0.13](https://github.com/kaokei/di/compare/v1.0.12...v1.0.13) (2021-08-06)
83
-
84
-
85
- ### Features
86
-
87
- * **merge:** 支持mergeHook ([427a1e2](https://github.com/kaokei/di/commit/427a1e2f9681284e579a96a94dce0f4ee96f0414))
88
-
89
- ### [1.0.12](https://github.com/kaokei/di/compare/v1.0.10...v1.0.12) (2021-08-04)
90
-
91
-
92
- ### Features
93
-
94
- * **injector:** injector support dispose ([7b1246d](https://github.com/kaokei/di/commit/7b1246d31ad0a621fe7ee6e0b007d621fb28643b))
95
-
96
- ### [1.0.10](https://github.com/kaokei/di/compare/v1.0.9...v1.0.10) (2021-08-03)
97
-
98
- ### [1.0.9](https://github.com/kaokei/di/compare/v1.0.8...v1.0.9) (2021-07-01)
99
-
100
- ### [1.0.8](https://github.com/kaokei/di/compare/v1.0.7...v1.0.8) (2021-06-29)
101
-
102
-
103
- ### Bug Fixes
104
-
105
- * **package.json:** set reflect-metadata to be peer dependency ([4368411](https://github.com/kaokei/di/commit/4368411ce44d0f0f754c8bf8e3f263e3f27dbed2))
106
-
107
- ### [1.0.7](https://github.com/kaokei/di/compare/v1.0.6...v1.0.7) (2021-06-29)
108
-
109
- ### [1.0.6](https://github.com/kaokei/di/compare/v1.0.5...v1.0.6) (2021-06-29)
110
-
111
-
112
- ### Bug Fixes
113
-
114
- * **index:** change location of reflect-metadata ([b7b8e03](https://github.com/kaokei/di/commit/b7b8e033554a3ea4604d3753947be5762e4b9032))
115
-
116
- ### [1.0.5](https://github.com/kaokei/di/compare/v1.0.4...v1.0.5) (2021-06-29)
117
-
118
-
119
- ### Bug Fixes
120
-
121
- * **injector:** should return postHook service ([6c73a3e](https://github.com/kaokei/di/commit/6c73a3eb43a6d1670d446fcaaadcd1178ab51fda))
122
-
123
- ### [1.0.4](https://github.com/kaokei/di/compare/v1.0.3...v1.0.4) (2021-06-29)
124
-
125
-
126
- ### Features
127
-
128
- * **injector:** add postHook ([db75b02](https://github.com/kaokei/di/commit/db75b02e049017ed959a83e310b3cb96e9514060))
129
-
130
- ### [1.0.3](https://github.com/kaokei/di/compare/v1.0.1...v1.0.3) (2021-06-29)
131
-
132
-
133
- ### Bug Fixes
134
-
135
- * **ci:** modify ci name ([b43f69c](https://github.com/kaokei/di/commit/b43f69cbdfe2069f559045a95efc92a956b04d20))
@@ -1,2 +0,0 @@
1
- export declare type SafeAny = any;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAIA,oBAAY,OAAO,GAAG,GAAG,CAAC"}