Skip to content

Commit

Permalink
fix global var for node (#138)
Browse files Browse the repository at this point in the history
Signed-off-by: Kangrui Ye <[email protected]>
  • Loading branch information
strawberry-choco authored Aug 31, 2023
1 parent d21404c commit 1ed8431
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloudflight",
"version": "0.6.0",
"version": "0.6.1",
"scripts": {
"build": "nx run-many --target=build --all --parallel",
"test": "nx run-many --target=test --all --parallel",
Expand Down
4 changes: 2 additions & 2 deletions packages/akita-read/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflight/akita-read",
"version": "0.6.0",
"version": "0.6.1",
"keywords": [
"akita-read",
"akita"
Expand All @@ -18,7 +18,7 @@
"module": "./index.mjs",
"typings": "./index.d.ts",
"peerDependencies": {
"@cloudflight/rxjs-read": "0.6.0",
"@cloudflight/rxjs-read": "0.6.1",
"@datorama/akita": ">=8.0.0 <9.0.0",
"rxjs": ">=7.0.0 <8.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-display/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflight/angular-display",
"version": "0.6.0",
"version": "0.6.1",
"keywords": [
"angular-display",
"breakpoints"
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflight/angular-logger",
"version": "0.6.0",
"version": "0.6.1",
"keywords": [
"angular-logger",
"logger"
Expand Down
2 changes: 1 addition & 1 deletion packages/concurrency-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflight/concurrency-utils",
"version": "0.6.0",
"version": "0.6.1",
"keywords": [
"concurrency-utils",
"concurrency",
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflight/logger",
"version": "0.6.0",
"version": "0.6.1",
"keywords": [
"logger"
],
Expand Down
7 changes: 2 additions & 5 deletions packages/logger/src/lib/global-access.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import {Logger} from './model/logger';
import {LogConsumer} from './model/log-consumer';

declare const global: unknown;

export interface LoggerAccessor {
loggerAccessor: {
loggerByKey(key: string): Logger | undefined;
consumerByKey(key: string): LogConsumer | undefined;
};
}

const globalObject = window ?? global;
const loggers = new Map<string, Logger>();
const consumers = new Map<string, LogConsumer>();

Expand All @@ -23,7 +20,7 @@ export function addConsumer(consumer: LogConsumer): void {
}

(() => {
if (isAccessorAlreadyAttached(globalObject)) {
if (isAccessorAlreadyAttached(globalThis)) {
return;
}

Expand All @@ -36,7 +33,7 @@ export function addConsumer(consumer: LogConsumer): void {
},
};

Object.defineProperty(globalObject, 'loggerAccessor', {
Object.defineProperty(globalThis, 'loggerAccessor', {
configurable: false,
enumerable: false,
writable: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/rxjs-read/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflight/rxjs-read",
"version": "0.6.0",
"version": "0.6.1",
"keywords": [
"rxjs"
],
Expand Down

0 comments on commit 1ed8431

Please sign in to comment.