-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
149 additions
and
125 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
Every local module inside `config` must only import from `config` using relative paths. | ||
|
||
TODO ... |
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 |
---|---|---|
@@ -1,19 +1,14 @@ | ||
export * from "./singleton/Bottle"; | ||
export * from "./singleton/Environment"; | ||
export * from "./singleton/Logger"; | ||
export * from "./singleton/MongoClient"; | ||
export * from "./singleton/InjectableManager"; | ||
export * from "./singleton/ContractManager"; | ||
export * from "./singleton/JwtManager" | ||
/* @org/backend/config/managers */ | ||
export * from "./managers/InjectorMetadataManager"; | ||
export * from "./managers/JwtManager" | ||
|
||
import "./init"; | ||
/* @org/backend/config/singletons */ | ||
export * from "./singletons/ServiceRegistry"; | ||
export * from "./singletons/Environment"; | ||
export * from "./singletons/Logger"; | ||
export * from "./singletons/MongoClient"; | ||
export * from "./singletons/RouterCollection"; | ||
|
||
/* @org/backend/config/setup */ | ||
import "./setup"; | ||
|
||
process.on("uncaughtException", err => { | ||
console.error("There was an uncaught error", err); | ||
process.exit(1); | ||
}); | ||
|
||
process.on("unhandledRejection", (reason, promise) => { | ||
console.error("Unhandled Rejection at:", promise, "reason:", reason); | ||
process.exit(1); | ||
}); |
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
import z from "zod"; | ||
import { extendZodWithOpenApi } from "@anatine/zod-openapi"; | ||
import { Environment } from "@org/backend/config/singletons/Environment"; | ||
|
||
extendZodWithOpenApi(z); | ||
Environment.getInstance(); | ||
|
||
process.on("uncaughtException", err => { | ||
console.error("There was an uncaught error", err); | ||
process.exit(1); | ||
}); | ||
|
||
process.on("unhandledRejection", (reason, promise) => { | ||
console.error("Unhandled Rejection at:", promise, "reason:", reason); | ||
process.exit(1); | ||
}); |
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
...ckend/src/config/singleton/MongoClient.ts → ...kend/src/config/singletons/MongoClient.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
10 changes: 5 additions & 5 deletions
10
...d/src/config/singleton/ContractManager.ts → ...src/config/singletons/RouterCollection.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
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { createFieldDecorator } from "@tsvdec/decorators"; | ||
import { Bottle, InjectableManager } from "@org/backend/config"; | ||
import { ServiceRegistry, InjectorMetadataManager } from "@org/backend/config"; | ||
|
||
export function Autowired<This, Value>() { | ||
return createFieldDecorator<This, Value>(({ meta }) => { | ||
const context = meta.context; | ||
const fieldName = String(context.name); | ||
InjectableManager.from(context).addDependency(fieldName); | ||
InjectorMetadataManager.getBy(context).addDependency(fieldName); | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
return function (_value: Value) { | ||
return Bottle.getInstance().inject<Value>(fieldName); | ||
return ServiceRegistry.getInstance().inject<Value>(fieldName); | ||
}; | ||
}); | ||
} |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import type { Class } from "@org/shared"; | ||
import type z from "zod"; | ||
|
||
import { InjectableManager } from "@org/backend/config"; | ||
import { InjectorMetadataManager } from "@org/backend/config"; | ||
import { Injectable } from "@org/backend/decorators/@Injectable"; | ||
|
||
export function Repository<This extends Class>(zodSchema: z.AnyZodObject) { | ||
const modelName = zodSchema.description; | ||
return Injectable<This>(data => { | ||
const context = data.meta.context; | ||
InjectableManager.from(context).setConstructorParams([modelName]); | ||
InjectorMetadataManager.getBy(context).setConstructorParams([modelName]); | ||
}); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export * from "./@Autowired"; | ||
export * from "./@Injectable"; | ||
export * from "./@Repository"; | ||
export * from "./@Transactional"; | ||
export * from "./@Contract"; | ||
/* @org/backend/decorators */ | ||
export * from "@org/backend/decorators/@Autowired"; | ||
export * from "@org/backend/decorators/@Injectable"; | ||
export * from "@org/backend/decorators/@Repository"; | ||
export * from "@org/backend/decorators/@Transactional"; | ||
export * from "@org/backend/decorators/@Contract"; |
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
Oops, something went wrong.