Comparing version 3.0.0-alpha.1 to 3.0.0-alpha.2
{ | ||
"name": "rsdi", | ||
"version": "3.0.0-alpha.1", | ||
"version": "3.0.0-alpha.2", | ||
"description": "TypeScript dependency injection container. Strong types without decorators.", | ||
@@ -14,5 +14,2 @@ "keywords": [ | ||
], | ||
"files": [ | ||
"dist/**" | ||
], | ||
"lint-staged": { | ||
@@ -24,4 +21,5 @@ "src/**/*.ts": [ | ||
}, | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"type": "module", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"homepage": "https://github.com/radzserg/rsdi", | ||
@@ -28,0 +26,0 @@ "author": "Sergey Radzishevskii <radzserg@gmail.com>", |
@@ -82,5 +82,5 @@ # RSDI - Dependency Injection Container | ||
.add("bar", () => new Bar()) | ||
.add("foo", (get) => new Foo(get("a"), get("bar"))); | ||
.add("foo", ({ a, bar}) => new Foo(a, bar)); | ||
const foo = container.get("foo"); | ||
const { foo } = container; // or container.get("foo"); | ||
``` | ||
@@ -144,8 +144,8 @@ | ||
.add("dbConnection", buildDbConnection()) | ||
.add("userRepository", (get) => | ||
MyDbProviderUserRepository(get("dbConnection")), | ||
.add("userRepository", ({ dbConnection }) => | ||
MyDbProviderUserRepository(dbConnection), | ||
) | ||
.add("userRegistrator", (get) => new UserRegistrator(get("userRepository"))) | ||
.add("userController", (get) => | ||
UserController(get("userRepository"), get("userRegistrator")), | ||
.add("userRegistrator", ({ userRepository }) => new UserRegistrator(userRepository)) | ||
.add("userController", ({ userRepository, userRegistrator}) => | ||
UserController(userRepository, userRegistrator), | ||
); | ||
@@ -197,2 +197,6 @@ } | ||
![strict type](https://github.com/radzserg/rsdi3/raw/main/docs/RSDI_types.png "RSDI types") | ||
![strict type](https://github.com/radzserg/rsdi3/raw/main/docs/RSDI_types.png "RSDI types") | ||
## Best practices | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
572369
17
363
200
Yes