Marak / colors.js

get colors in your node.js console
https://github.com/Marak/colors.js
Other
5.17k stars 448 forks source link

Doesn't export `/safe` in package.json #350

Open movahhedi opened 6 months ago

movahhedi commented 6 months ago

The package.json file doesn't provide the following props (the values are for example):

{
  "source": "src/index.js",             // input
  "main": "dist/foo.js",                // CommonJS output bundle
  "umd:main": "dist/foo.umd.js",        // UMD output bundle
  "module": "dist/foo.mjs",             // ES Modules output bundle
  "exports": {
    "types": "./dist/foo.d.ts",         // TypeScript typings for NodeNext modules
    "require": "./dist/foo.js",         // CommonJS output bundle
    "default": "./dist/foo.modern.mjs", // Modern ES Modules output bundle
  },
  "types": "dist/foo.d.ts"              // TypeScript typings
}

And more importantly, doesn't do so for /safe. so importing it like import Colors from "colors/safe"; produces an error in some node configured environments. you'd have to import it like import Colors from "colors/safe.js";.

Didn't have the time to make a tested PR, just noted it for it in case, as a technical debt.

Example is from microbundle's README.