Skip to content

Commit

Permalink
Drop dependency on @proc7ts/context-values
Browse files Browse the repository at this point in the history
  • Loading branch information
surol committed Sep 16, 2023
1 parent ea4a3dc commit 39886b9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 96 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
"default": "./dist/logger.js"
},
"sideEffects": false,
"dependencies": {
"@proc7ts/context-values": "7.1.1"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@proc7ts/context-builder": "^7.0.2",
Expand Down
67 changes: 0 additions & 67 deletions src/logger.spec.ts

This file was deleted.

24 changes: 0 additions & 24 deletions src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { CxEntry, CxGlobals, cxRecent, cxScoped } from '@proc7ts/context-values';
import { consoleLogger, proxyLogger } from './loggers/mod.js';

/**
* Basic logger interface.
*/
Expand Down Expand Up @@ -42,24 +39,3 @@ export interface Logger {
*/
trace(...args: unknown[]): void;
}

/**
* Global context entry containing logger to use.
*
* Logs to {@link consoleLogger console} by default.
*/
export const Logger: CxEntry<Logger> = {
perContext: /*#__PURE__*/ cxScoped(
CxGlobals,
/*#__PURE__*/ cxRecent({
create: (recent, _) => recent,
byDefault: _ => consoleLogger,
assign({ get, to }) {
const logger = proxyLogger(get);

return receiver => to((_, by) => receiver(logger, by));
},
}),
),
toString: () => '[Logger]',
};
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"extends": "@run-z/project-config/tsconfig.lib.json",
"compilerOptions": {
"lib": ["DOM", "ES2022"],
"module": "ES2022",
"moduleResolution": "Node",
"outDir": "target/js"
},
"include": ["src/**/*"]
Expand Down

0 comments on commit 39886b9

Please sign in to comment.