-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: middleware logger better logger scopes (#7281)
* fix: moved global logger error to non overwritable part of code * chore: snapshot of done work * refactor: MethodDecoratorManager * refactor: reduced usage of singleton to support parallel calls of fns * fix: infinite loop constraint on types * Revert "fix: infinite loop constraint on types" This reverts commit 01904e3. * chore: bumped ts jest, and jest * fix: test
- Loading branch information
Showing
33 changed files
with
1,348 additions
and
1,302 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@vue-storefront/middleware": patch | ||
--- | ||
|
||
Fix scoping |
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
1 change: 1 addition & 0 deletions
1
packages/middleware/__tests__/integration/bootstrap/api/index.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
6 changes: 5 additions & 1 deletion
6
packages/middleware/__tests__/integration/bootstrap/api/success/index.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
11 changes: 11 additions & 0 deletions
11
packages/middleware/__tests__/integration/bootstrap/api/successParalell/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { getLogger } from "../../../../../src"; | ||
|
||
export const successParalell = (context) => { | ||
const logger = getLogger(context); | ||
logger.info("successParalell"); | ||
return Promise.resolve({ | ||
status: 200, | ||
message: "ok", | ||
error: false, | ||
}); | ||
}; |
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
32 changes: 32 additions & 0 deletions
32
packages/middleware/__tests__/integration/bootstrap/serverWithInitFn.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { apiClientFactory } from "../../../src/apiClientFactory"; | ||
import * as api from "./api"; | ||
import { AlokaiContainer, getLogger } from "../../../src"; | ||
|
||
const init = (settings: any, alokai: AlokaiContainer) => { | ||
const logger = getLogger(alokai); | ||
logger.info("Init fn!"); | ||
return { | ||
config: settings, | ||
client: null, | ||
}; | ||
}; | ||
|
||
const onCreate = async ( | ||
config: Record<string, unknown> = {}, | ||
alokai: AlokaiContainer | ||
) => { | ||
const logger = getLogger(alokai); | ||
logger.info("oncreate"); | ||
|
||
return { | ||
config, | ||
client: null, | ||
}; | ||
}; | ||
|
||
const { createApiClient } = apiClientFactory({ | ||
onCreate, | ||
api, | ||
}); | ||
|
||
export { createApiClient, init }; |
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.