Effect-TS / effect

An ecosystem of tools to build robust applications in TypeScript

Home Page:https://effect.website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add dual ESM/CJS via package exports field

userquin opened this issue · comments

What is the problem this feature would solve?

The package seems to be only CJS, ESM being masquerading: check https://arethetypeswrong.github.io/?p=effect%403.1.3

What is the feature you are proposing to solve the problem?

Add dual ESM/CJS via package exports if the build pipeline allows generate d.mts and d,cts files, package.json scripts seems to generate esm and cjs "builds".

For node10 types, you will need to add a redirection for all subpackages exports via typesVersions:

"typesVersions": {
    "*": {
      "*": [
        "./dist/*", // <== or ./build/* (I need to review the build folder)
        "./*"
      ]
    }
  },

What alternatives have you considered?

NA

Hi.

The current setup is deliberate and the outcome of weeks of research and trial & error in numerous consumer environments / downstream app & lib setups. It is the best compromise with the closest-to-ideal implications for consumers.

If you are curious, you can learn more about how we arrived here in this issue: #1561

Note that we are likely going to eliminate CJS altogether in 4.x: #2613