-
-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(di): make @tsed/di compatible with browser env
- Loading branch information
Showing
195 changed files
with
347 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,4 @@ | |
"eslint": "^8.12.0" | ||
}, | ||
"peerDependencies": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"directory": ["./src/common", "./src/node"], | ||
"exclude": ["__mock__", "__mocks__", ".spec.ts"], | ||
"delete": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/di/src/decorators/configuration.ts → ...di/src/common/decorators/configuration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ages/di/src/decorators/injectable.spec.ts → .../src/common/decorators/injectable.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/di/src/decorators/useOpts.spec.ts → .../di/src/common/decorators/useOpts.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* @file Automatically generated by barrelsby. | ||
*/ | ||
|
||
export * from "./constants/constants"; | ||
export * from "./decorators/configuration"; | ||
export * from "./decorators/constant"; | ||
export * from "./decorators/controller"; | ||
export * from "./decorators/inject"; | ||
export * from "./decorators/injectable"; | ||
export * from "./decorators/intercept"; | ||
export * from "./decorators/interceptor"; | ||
export * from "./decorators/lazyInject"; | ||
export * from "./decorators/module"; | ||
export * from "./decorators/opts"; | ||
export * from "./decorators/overrideProvider"; | ||
export * from "./decorators/scope"; | ||
export * from "./decorators/service"; | ||
export * from "./decorators/useOpts"; | ||
export * from "./decorators/value"; | ||
export * from "./domain/Container"; | ||
export * from "./domain/ControllerProvider"; | ||
export * from "./domain/InjectablePropertyType"; | ||
export * from "./domain/LocalsContainer"; | ||
export * from "./domain/Provider"; | ||
export * from "./domain/ProviderScope"; | ||
export * from "./domain/ProviderType"; | ||
export * from "./errors/InjectionError"; | ||
export * from "./errors/InvalidPropertyTokenError"; | ||
export * from "./errors/UndefinedTokenError"; | ||
export * from "./interfaces/DIConfigurationOptions"; | ||
export * from "./interfaces/DILogger"; | ||
export * from "./interfaces/DILoggerOptions"; | ||
export * from "./interfaces/DIResolver"; | ||
export * from "./interfaces/InjectableProperties"; | ||
export * from "./interfaces/InterceptorContext"; | ||
export * from "./interfaces/InterceptorMethods"; | ||
export * from "./interfaces/InvokeOptions"; | ||
export * from "./interfaces/OnDestroy"; | ||
export * from "./interfaces/OnInit"; | ||
export * from "./interfaces/ProviderOpts"; | ||
export * from "./interfaces/RegistrySettings"; | ||
export * from "./interfaces/ResolvedInvokeOptions"; | ||
export * from "./interfaces/TokenProvider"; | ||
export * from "./interfaces/TokenRoute"; | ||
export * from "./registries/GlobalProviders"; | ||
export * from "./registries/ProviderRegistry"; | ||
export * from "./services/DIConfiguration"; | ||
export * from "./services/DILogger"; | ||
export * from "./services/InjectorService"; | ||
export * from "./utils/colors"; | ||
export * from "./utils/createContainer"; | ||
export * from "./utils/getConfiguration"; | ||
export * from "./utils/resolveControllers"; |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/di/src/integration/imports.spec.ts → ...di/src/common/integration/imports.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {Container, Inject, Injectable, InjectorService, LOGGER} from "../../common/index"; | ||
|
||
describe("DILogger", () => { | ||
it("should inject logger in another service", async () => { | ||
@Injectable() | ||
class MyService { | ||
@Inject(LOGGER) | ||
logger: LOGGER; | ||
} | ||
|
||
const injector = new InjectorService(); | ||
injector.logger = console; | ||
|
||
const container = new Container(); | ||
container.add(MyService); | ||
|
||
await injector.load(container); | ||
const logger = injector.get(MyService).logger; | ||
|
||
expect(logger).toEqual(injector.logger); | ||
}); | ||
}); |
7 changes: 5 additions & 2 deletions
7
packages/di/src/services/DILogger.ts → packages/di/src/common/services/DILogger.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.