Comparing version 2.2.0 to 3.0.0
{ | ||
"name": "tsyringe", | ||
"version": "2.2.0", | ||
"version": "3.0.0", | ||
"description": "Lightweight dependency injection container for JavaScript/TypeScript", | ||
"main": "dist/index.js", | ||
"main": "dist/cjs/index.js", | ||
"module": "./dist/esm5/index.js", | ||
"es2015": "./dist/esm2015/index.js", | ||
"typings": "./dist/typings/index.d.ts", | ||
"scripts": { | ||
"build": "rimraf ./dist && tsc", | ||
"build": "rimraf ./dist && tsc && tsc -p tsconfig.esm5.json && tsc -p tsconfig.esm2015.json && tsc -p tsconfig.types.json", | ||
"test": "npm run lint && jest", | ||
@@ -34,3 +37,3 @@ "test:coverage": "jest --coverage", | ||
"dependencies": { | ||
"reflect-metadata": "^0.1.12" | ||
"tslib": "^1.9.3" | ||
}, | ||
@@ -42,2 +45,3 @@ "devDependencies": { | ||
"jest": "^23.6.0", | ||
"reflect-metadata": "^0.1.12", | ||
"rimraf": "^2.6.2", | ||
@@ -44,0 +48,0 @@ "ts-jest": "^23.10.5", |
@@ -27,3 +27,3 @@ [![Travis](https://img.shields.io/travis/Microsoft/tsyringe.svg)](https://travis-ci.org/Microsoft/tsyringe/) | ||
```sh | ||
yarn install --save tsyringe | ||
yarn add tsyringe | ||
``` | ||
@@ -41,2 +41,10 @@ | ||
Add a polyfill for the Reflect API (examples below use reflect-metadata). You can use: | ||
* [reflect-metadata](https://www.npmjs.com/package/reflect-metadata) | ||
* [core-js (core-js/es7/reflect)](https://www.npmjs.com/package/core-js) | ||
* [reflection](https://www.npmjs.com/package/@abraham/reflection) | ||
The Reflect polyfill import should only be added once before DI is used. | ||
## API | ||
@@ -49,4 +57,3 @@ ### injectable() | ||
```typescript | ||
import {decorators} from "tsyringe"; | ||
const {injectable} = decorators; | ||
import {injectable} from "tsyringe"; | ||
@@ -59,2 +66,3 @@ @injectable() | ||
// some other file | ||
import "reflect-metadata"; | ||
import {container} from "tsyringe"; | ||
@@ -72,4 +80,3 @@ import {Foo} from "./foo"; | ||
```typescript | ||
import {decorators} from "tsyringe"; | ||
const {singleton} = decorators; | ||
import {singleton} from "tsyringe"; | ||
@@ -82,2 +89,3 @@ @singleton() | ||
// some other file | ||
import "reflect-metadata"; | ||
import {container} from "tsyringe"; | ||
@@ -97,4 +105,3 @@ import {Foo} from "./foo"; | ||
```typescript | ||
import {decorators} from "tsyringe"; | ||
const {autoInjectable} = decorators; | ||
import {autoInjectable} from "tsyringe"; | ||
@@ -121,4 +128,3 @@ @autoInjectable() | ||
```typescript | ||
import {decorators} from "tsyringe"; | ||
const {injectable, inject} = decorators; | ||
import {injectable, inject} from "tsyringe"; | ||
@@ -147,4 +153,3 @@ interface Database { | ||
import {Foo} from "./Foo"; | ||
import {decorators} from "tsyringe"; | ||
const {injectable} = decorators; | ||
import {injectable} from "tsyringe"; | ||
@@ -158,2 +163,3 @@ @injectable() | ||
// main.ts | ||
import "reflect-metadata"; | ||
import {container} from "tsyringe"; | ||
@@ -185,4 +191,3 @@ import {Bar} from "./Bar"; | ||
// Client.ts | ||
import {decorators} from "tsyringe"; | ||
const {injectable, inject} = decorators; | ||
import {injectable, inject} from "tsyringe"; | ||
@@ -196,2 +201,3 @@ @injectable() | ||
// main.ts | ||
import "reflect-metadata"; | ||
import {Client} from "./Client"; | ||
@@ -198,0 +204,0 @@ import {TestService} from "./TestService"; |
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
31
801
217
40058
10
1
+ Addedtslib@^1.9.3
+ Addedtslib@1.14.1(transitive)
- Removedreflect-metadata@^0.1.12
- Removedreflect-metadata@0.1.14(transitive)