@launchtray/hatch-util
Advanced tools
Comparing version 0.10.6 to 0.10.7
{ | ||
"files": { | ||
"libraries/hatch-util/CHANGELOG.json": "cb6a964b2c403807c9f93d7d84aebdb5a0fd7fb3", | ||
"libraries/hatch-util/CHANGELOG.md": "6db2b3728d1e4e3762f12209b31862365168f82f", | ||
"libraries/hatch-util/package.json": "a8ffc24903ac9b03d19f3b5b7cbc3c925d5092bf", | ||
"libraries/hatch-util/CHANGELOG.json": "008a6bf3ab58fa9d99436eaef8aa22023a05f0b8", | ||
"libraries/hatch-util/CHANGELOG.md": "0b01a2044c94e0d22b4341ff1c5f426fe04ce725", | ||
"libraries/hatch-util/package.json": "c5a432d1db2c00fe84153a32e56d87bb75c2e002", | ||
"libraries/hatch-util/src/CompletableFuture.ts": "e08e2f763c96c4362f17df0dae9c0897ec550a8e", | ||
"libraries/hatch-util/src/ConsoleLogger.ts": "5539e296824fe8c8b148d17516e9284ce0a87d44", | ||
"libraries/hatch-util/src/ConsoleLogger.ts": "1b79d05daee77e86885589ab8e88c1a1c03865b3", | ||
"libraries/hatch-util/src/ErrorReporter.ts": "f56f81e17250e53d565f23a33d07da254f57aa92", | ||
@@ -14,4 +14,4 @@ "libraries/hatch-util/src/Logger.ts": "885ec9caf099d44d2602e5d5bc04b08a51d53a25", | ||
"libraries/hatch-util/src/delay.ts": "09ebc89d0d62c0f4915aac6b6069eac0e6b43ec4", | ||
"libraries/hatch-util/src/index.ts": "0e14c056b6a1f54e45bdee30bcfc4d402aec9fa9", | ||
"libraries/hatch-util/src/injection.ts": "aac0b4bb7d49c8b8e8a6205297d2317783c56f14", | ||
"libraries/hatch-util/src/index.ts": "70e3e3f7bd9ab997276d72bbfe0e4fbba4ccaf4d", | ||
"libraries/hatch-util/src/injection.ts": "3608be0c165c1e5cc0abf9db0fc6de162c2203f4", | ||
"libraries/hatch-util/tsconfig.json": "d5c9e242ca6fbaf065389da08373f883911ba64d", | ||
@@ -18,0 +18,0 @@ "libraries/hatch-util/.rush/temp/shrinkwrap-deps.json": "fa554b709230cf1e063ecd86a833be0c659ced10" |
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "0.10.7", | ||
"tag": "@launchtray/hatch-util_v0.10.7", | ||
"date": "Sat, 29 Aug 2020 03:52:13 GMT", | ||
"comments": { | ||
"none": [ | ||
{ | ||
"comment": "Logging improvements, DI export fix" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "0.10.6", | ||
@@ -7,0 +19,0 @@ "tag": "@launchtray/hatch-util_v0.10.6", |
# Change Log - @launchtray/hatch-util | ||
This log was last generated on Fri, 28 Aug 2020 06:18:04 GMT and should not be manually modified. | ||
This log was last generated on Sat, 29 Aug 2020 03:52:13 GMT and should not be manually modified. | ||
## 0.10.7 | ||
Sat, 29 Aug 2020 03:52:13 GMT | ||
### Updates | ||
- Logging improvements, DI export fix | ||
## 0.10.6 | ||
@@ -6,0 +13,0 @@ Fri, 28 Aug 2020 06:18:04 GMT |
import { Logger } from './Logger'; | ||
export declare class ConsoleLogger implements Logger { | ||
private readonly label; | ||
debug: (...args: any[]) => void; | ||
info: (...args: any[]) => void; | ||
warn: (...args: any[]) => void; | ||
error: (...args: any[]) => void; | ||
private createPrefix; | ||
constructor(label: string); | ||
debug: { | ||
(...data: any[]): void; | ||
(message?: any, ...optionalParams: any[]): void; | ||
}; | ||
info: { | ||
(...data: any[]): void; | ||
(message?: any, ...optionalParams: any[]): void; | ||
}; | ||
warn: { | ||
(...data: any[]): void; | ||
(message?: any, ...optionalParams: any[]): void; | ||
}; | ||
error: { | ||
(...data: any[]): void; | ||
(message?: any, ...optionalParams: any[]): void; | ||
}; | ||
} |
@@ -5,16 +5,10 @@ "use strict"; | ||
class ConsoleLogger { | ||
constructor(label) { | ||
this.label = label; | ||
this.debug = console.debug.bind(console, this.createPrefix('debug')); | ||
this.info = console.info.bind(console, this.createPrefix('info')); | ||
this.warn = console.warn.bind(console, this.createPrefix('warn')); | ||
this.error = console.error.bind(console, this.createPrefix('error')); | ||
this.label = label; | ||
constructor() { | ||
this.debug = console.debug.bind(console); | ||
this.info = console.info.bind(console); | ||
this.warn = console.warn.bind(console); | ||
this.error = console.error.bind(console); | ||
} | ||
// Note: evaluated at time of construction, not time of logging | ||
createPrefix(level) { | ||
return `[${this.label}] [${level}]:`; | ||
} | ||
} | ||
exports.ConsoleLogger = ConsoleLogger; | ||
//# sourceMappingURL=ConsoleLogger.js.map |
import { ConsoleLogger } from './ConsoleLogger'; | ||
import delay from './delay'; | ||
import { ErrorReporter } from './ErrorReporter'; | ||
import { Class, containerSingleton, DependencyContainer, initializeInjection, initializer, inject, injectAll, injectable, InjectionInitializationContext, resolveParams, ROOT_CONTAINER } from './injection'; | ||
import { DependencyContainer } from '@launchtray/tsyringe-async'; | ||
import { Class, containerSingleton, initializeInjection, initializer, inject, injectAll, injectable, InjectionInitializationContext, resolveParams, ROOT_CONTAINER } from './injection'; | ||
import { Logger } from './Logger'; | ||
@@ -6,0 +7,0 @@ import { NON_LOGGER, NonLogger } from './NonLogger'; |
import 'reflect-metadata'; | ||
import { DependencyContainer as TSyringeDependencyContainer } from '@launchtray/tsyringe-async'; | ||
import { DependencyContainer } from '@launchtray/tsyringe-async'; | ||
export declare type TokenKey = string | symbol; | ||
@@ -13,4 +13,2 @@ export interface TokenMapping { | ||
export declare type Class<T> = new (...args: any[]) => T; | ||
export interface DependencyContainer extends TSyringeDependencyContainer { | ||
} | ||
export declare const inject: (token: TokenKey) => (target: any, propertyKey: string | symbol, paramIndex: number) => any; | ||
@@ -17,0 +15,0 @@ export declare const injectAll: (token: TokenKey) => (target: any, propertyKey: string | symbol, paramIndex: number) => any; |
@@ -41,7 +41,2 @@ "use strict"; | ||
}; | ||
const isTokenDescriptor = (descriptor) => { | ||
return (typeof descriptor === 'object' && | ||
'token' in descriptor && | ||
'multiple' in descriptor); | ||
}; | ||
exports.inject = (token) => { | ||
@@ -48,0 +43,0 @@ return (target, propertyKey, paramIndex) => { |
{ | ||
"name": "@launchtray/hatch-util", | ||
"version": "0.10.6", | ||
"version": "0.10.7", | ||
"description": "Utilities used by several other hatch modules", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
import {Logger} from './Logger'; | ||
export class ConsoleLogger implements Logger { | ||
public debug = console.debug.bind(console, this.createPrefix('debug')); | ||
public info = console.info.bind(console, this.createPrefix('info')); | ||
public warn = console.warn.bind(console, this.createPrefix('warn')); | ||
public error = console.error.bind(console, this.createPrefix('error')); | ||
// Note: evaluated at time of construction, not time of logging | ||
private createPrefix(level: string) { | ||
return `[${this.label}] [${level}]:`; | ||
} | ||
constructor(private readonly label: string) { | ||
this.label = label; | ||
} | ||
} | ||
public debug = console.debug.bind(console); | ||
public info = console.info.bind(console); | ||
public warn = console.warn.bind(console); | ||
public error = console.error.bind(console); | ||
} |
import {ConsoleLogger} from './ConsoleLogger'; | ||
import delay from './delay'; | ||
import {ErrorReporter} from './ErrorReporter'; | ||
import {DependencyContainer} from '@launchtray/tsyringe-async'; | ||
import { | ||
Class, | ||
containerSingleton, | ||
DependencyContainer, | ||
initializeInjection, | ||
@@ -9,0 +9,0 @@ initializer, |
import 'reflect-metadata'; | ||
import { | ||
container as tsyringe_container, | ||
DependencyContainer as TSyringeDependencyContainer, | ||
DependencyContainer, | ||
initializer as tsyringe_initializer, | ||
@@ -9,4 +9,3 @@ inject as tsyringe_inject, | ||
injectable as tsyringe_injectable, | ||
InjectionToken, | ||
Lifecycle as tsyringe_Lifecycle, | ||
Lifecycle, | ||
resolveParams as tsyringe_resolveParams, | ||
@@ -64,19 +63,2 @@ scoped as tsyringe_scoped, | ||
interface TokenDescriptor { | ||
token: InjectionToken<any>; | ||
multiple: boolean; | ||
} | ||
const isTokenDescriptor = ( | ||
descriptor: any | ||
): descriptor is TokenDescriptor => { | ||
return ( | ||
typeof descriptor === 'object' && | ||
'token' in descriptor && | ||
'multiple' in descriptor | ||
); | ||
}; | ||
export interface DependencyContainer extends TSyringeDependencyContainer {} | ||
export const inject = (token: TokenKey): (target: any, propertyKey: string | symbol, paramIndex: number) => any => { | ||
@@ -107,3 +89,3 @@ return (target: any, propertyKey: string | symbol, paramIndex: number) => { | ||
export const containerSingleton = <T>() => (target: Class<T>) => { | ||
return tsyringe_scoped(tsyringe_Lifecycle.ContainerScoped)(target); | ||
return tsyringe_scoped(Lifecycle.ContainerScoped)(target); | ||
}; | ||
@@ -110,0 +92,0 @@ export const resolveParams: ( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46089
927