react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

@internationalization/date has two identical (?) module exports (also publint complains)

Open sparecycles opened this issue 10 months ago • 1 comments

Provide your feedback here.

these two exports appear to be identical in content?

  "name": "@internationalized/date",
  "version": "3.5.2",
  "description": "Internationalized calendar, date, and time manipulation utilities",
  "license": "Apache-2.0",
  "main": "dist/main.js",
  "module": "dist/module.js", // <
  "exports": {
    "types": "./dist/types.d.ts",
    "import": "./dist/import.mjs", // <
    "require": "./dist/main.js"
  },

Also publint has some complaints... https://publint.dev/@internationalized/[email protected]

🔦 Context

I was seeing errors in a esm-target vite/electron/svelte build (via meltui importing @internationalized/date) but the errors cleared up after I "fixed" it and then cleared caches to reconfirm (only happened on windows, to boot).

Something bad must have gotten into the node_modules/.vite cache, possibly due to confusion between package.json having both main/module as well as exports.{require,import} while lacking a clarifying type declaration?

(I can discuss more freely internally).

💻 Code Sample

No response

Version

No response

What browsers are you seeing the problem on?

No response

If other, please specify

No response

What operating system are you using?

No response

sparecycles avatar Apr 24 '24 05:04 sparecycles

Those two module exports are there to deal with other bundlers (webpack 4) and their interpretations of esmodules, see https://github.com/adobe/react-spectrum/pull/4038

LFDanLu avatar May 02 '24 21:05 LFDanLu