ubiquity-os / ubiquity-os-logger

0 stars 6 forks source link

feat: the package is now compiled for both ESM and CommonJs #20

Closed gentlementlegen closed 4 months ago

gentlementlegen commented 4 months ago

Resolves #19

gentlementlegen commented 4 months ago

How to test

Create a dummy NodeJs project, with the following package.json

{
  "name": "dummy-project",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "run": "tsx index.ts"
  },
  "dependencies": {
    "@ubiquity-dao/ubiquibot-logger": "1.1.2",
    "tsx": "4.16.1"
  }
}

And a index.ts file looking like

import { Logs } from "@ubiquity-dao/ubiquibot-logger";

const logs = new Logs("debug")
logs.info("hola")

Then use yarn build && yarn link to use the local package. Try with "type": "module" and "type":"commonjs", both should run with no error.