From da25c58926ac8f449f37352d351224d1b12de591 Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Thu, 14 Mar 2024 20:07:52 +0100 Subject: [PATCH] fix(logger): fix ESM compilation issue --- packages/connect/.npmignore | 3 +++ packages/file/.npmignore | 3 +++ packages/insight/.npmignore | 3 +++ packages/logentries/.npmignore | 3 +++ packages/logger/.npmignore | 3 +++ packages/logger/package.json | 18 +++++++++--------- packages/logger/src/index.ts | 2 ++ packages/logger/src/logger.integration.spec.ts | 2 +- packages/logger/src/node/exports.ts | 2 -- packages/loggly/.npmignore | 3 +++ packages/logstash-http/.npmignore | 3 +++ packages/logstash-udp/.npmignore | 3 +++ packages/rabbitmq/.npmignore | 3 +++ packages/seq/.npmignore | 3 +++ packages/slack/.npmignore | 3 +++ packages/smtp/.npmignore | 3 +++ 16 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 packages/logger/src/index.ts diff --git a/packages/connect/.npmignore b/packages/connect/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/connect/.npmignore +++ b/packages/connect/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/file/.npmignore b/packages/file/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/file/.npmignore +++ b/packages/file/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/insight/.npmignore b/packages/insight/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/insight/.npmignore +++ b/packages/insight/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/logentries/.npmignore b/packages/logentries/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/logentries/.npmignore +++ b/packages/logentries/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/logger/.npmignore b/packages/logger/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/logger/.npmignore +++ b/packages/logger/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/logger/package.json b/packages/logger/package.json index 3dd29c70..6aeb1ff9 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -6,17 +6,17 @@ "name": "Romain Lenzotti" }, "license": "MIT", - "source": "./src/node/index.ts", - "main": "./lib/cjs/node/index.js", - "module": "./lib/esm/node/index.js", + "source": "./src/index.ts", + "main": "./lib/cjs/index.js", + "module": "./lib/esm/index.js", "browser": "./lib/browser/logger.umd.js", - "typings": "./lib/types/node/index.d.ts", + "typings": "./lib/types/index.d.ts", "exports": { - "types": "./lib/types/node/index.d.ts", + "types": "./lib/types/index.d.ts", "browser": "./lib/browser/logger.umd.js", - "import": "./lib/esm/node/index.js", - "require": "./lib/cjs/node/index.js", - "default": "./lib/esm/node/index.js" + "import": "./lib/esm/index.js", + "require": "./lib/cjs/index.js", + "default": "./lib/esm/index.js" }, "scripts": { "build": "yarn barrels && yarn run build:esm && yarn run build:cjs && yarn run build:browser", @@ -52,4 +52,4 @@ "vite": "5.1.6" }, "peerDependencies": {} -} \ No newline at end of file +} diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts new file mode 100644 index 00000000..4e2b5f55 --- /dev/null +++ b/packages/logger/src/index.ts @@ -0,0 +1,2 @@ +export * from "./common/index"; +export * from "./node/index"; diff --git a/packages/logger/src/logger.integration.spec.ts b/packages/logger/src/logger.integration.spec.ts index 3581f123..09df4d22 100644 --- a/packages/logger/src/logger.integration.spec.ts +++ b/packages/logger/src/logger.integration.spec.ts @@ -1,4 +1,4 @@ -import {Logger} from "./node"; +import {Logger} from "./index"; describe("Logger integration", () => { it("should log only on trace", () => { diff --git a/packages/logger/src/node/exports.ts b/packages/logger/src/node/exports.ts index af160ce7..aee29180 100644 --- a/packages/logger/src/node/exports.ts +++ b/packages/logger/src/node/exports.ts @@ -4,8 +4,6 @@ import {LayoutReplacer, Logger} from "../common/index"; import "./appenders/StdoutAppender"; import "./appenders/StderrAppender"; -export * from "../common/index"; - export const $log: Logger = new Logger("default"); $log.appenders diff --git a/packages/loggly/.npmignore b/packages/loggly/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/loggly/.npmignore +++ b/packages/loggly/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/logstash-http/.npmignore b/packages/logstash-http/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/logstash-http/.npmignore +++ b/packages/logstash-http/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/logstash-udp/.npmignore b/packages/logstash-udp/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/logstash-udp/.npmignore +++ b/packages/logstash-udp/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/rabbitmq/.npmignore b/packages/rabbitmq/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/rabbitmq/.npmignore +++ b/packages/rabbitmq/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/seq/.npmignore b/packages/seq/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/seq/.npmignore +++ b/packages/seq/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/slack/.npmignore b/packages/slack/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/slack/.npmignore +++ b/packages/slack/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo diff --git a/packages/smtp/.npmignore b/packages/smtp/.npmignore index 3fbb508a..07167b69 100644 --- a/packages/smtp/.npmignore +++ b/packages/smtp/.npmignore @@ -4,3 +4,6 @@ tsconfig.compile.json tsconfig.esm.json tsconfig.json *.spec.js +*.spec.js.map +*.spec.d.ts +*.tsbuildinfo