From 433b3807cc2505c7f30bb34f8a4beb99a8169634 Mon Sep 17 00:00:00 2001 From: chen Date: Wed, 4 Oct 2023 08:34:34 +0800 Subject: [PATCH] build: 2.2.1 --- package-lock.json | 30 ++++++++++---------- package.json | 8 +++--- src/package.json | 4 +-- test/fixture/hello-without-provide-object.ts | 9 ++++++ test/import/hello.spec.ts | 4 +++ 5 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 test/fixture/hello-without-provide-object.ts diff --git a/package-lock.json b/package-lock.json index 068dc8b..5812ee6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,14 +22,14 @@ "prettier": "^2.3.2", "pretty-quick": "^3.1.3", "rimraf": "^5.0.1", - "rollup": "^3.28.1", + "rollup": "^3.29.4", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "tsconfig-paths": "^4.2.0", - "typescript": "5.1.6" + "typescript": "5.2.2" }, "peerDependencies": { - "typescript": "5.1.6" + "typescript": "5.2.2" } }, "node_modules/@ampproject/remapping": { @@ -6946,9 +6946,9 @@ } }, "node_modules/rollup": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", - "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -7806,9 +7806,9 @@ } }, "node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -13158,9 +13158,9 @@ } }, "rollup": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", - "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -13770,9 +13770,9 @@ "dev": true }, "typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true }, "union-value": { diff --git a/package.json b/package.json index 403e1b6..8287397 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "author": "wszgrcy", "license": "MIT", "peerDependencies": { - "typescript": "5.1.6" + "typescript": "5.2.2" }, "devDependencies": { "@commitlint/cli": "^12.1.4", @@ -27,13 +27,13 @@ "prettier": "^2.3.2", "pretty-quick": "^3.1.3", "rimraf": "^5.0.1", - "rollup": "^3.28.1", + "rollup": "^3.29.4", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "tsconfig-paths": "^4.2.0", - "typescript": "5.1.6" + "typescript": "5.2.2" }, "dependencies": { "cross-env": "^7.0.3" } -} +} \ No newline at end of file diff --git a/src/package.json b/src/package.json index 78ade90..4c208a3 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "static-injector", - "version": "2.2.0", + "version": "2.2.1", "description": "Angular的静态注入器独立使用版本", "keywords": [ "angular", @@ -29,7 +29,7 @@ "author": "wszgrcy", "license": "MIT", "peerDependencies": { - "typescript": "~5.1.6" + "typescript": ">=5.0.0" }, "devDependencies": {}, "sideEffects": false diff --git a/test/fixture/hello-without-provide-object.ts b/test/fixture/hello-without-provide-object.ts new file mode 100644 index 0000000..5ec94ab --- /dev/null +++ b/test/fixture/hello-without-provide-object.ts @@ -0,0 +1,9 @@ +import { Injectable, Injector } from 'static-injector'; +@Injectable() +export class MyClass { + hello() { + return 'hello'; + } +} +let injector = Injector.create({ providers: [MyClass] }); +export const instance = injector.get(MyClass); diff --git a/test/import/hello.spec.ts b/test/import/hello.spec.ts index b89aff0..de0178c 100644 --- a/test/import/hello.spec.ts +++ b/test/import/hello.spec.ts @@ -1,6 +1,10 @@ import { instance } from '../fixture/hello'; +import { instance as instance2 } from '../fixture/hello-without-provide-object'; describe('hello', () => { it('hello', () => { expect(instance.hello()).toBe('hello'); }); + it('hello-without-provide-object', () => { + expect(instance2.hello()).toBe('hello'); + }); });