diff --git a/.changeset/neaps-esm-only.md b/.changeset/neaps-esm-only.md new file mode 100644 index 0000000..419c569 --- /dev/null +++ b/.changeset/neaps-esm-only.md @@ -0,0 +1,10 @@ +--- +"neaps": minor +"@neaps/tide-predictor": minor +"@neaps/react": minor +--- + +Drop the CommonJS builds; all neaps packages are now ESM-only. The CJS entries +can't survive their dependencies going ESM-only, since they load them with +`require()`. CommonJS consumers on Node 20.19+ / 22.12+ can still `require()` +these packages via Node's `require(esm)` support. diff --git a/packages/neaps/package.json b/packages/neaps/package.json index 7bd30e3..508c0c6 100644 --- a/packages/neaps/package.json +++ b/packages/neaps/package.json @@ -18,12 +18,11 @@ "license": "MIT", "author": "Brandon Keepers ", "type": "module", - "main": "dist/index.cjs", + "main": "dist/index.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" + "import": "./dist/index.js" } }, "files": [ diff --git a/packages/react/package.json b/packages/react/package.json index 0a5bc88..f9262ff 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -19,12 +19,11 @@ "license": "MIT", "author": "Brandon Keepers ", "type": "module", - "main": "dist/index.cjs", + "main": "dist/index.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" + "import": "./dist/index.js" }, "./styles.css": "./dist/styles.css" }, diff --git a/packages/react/tsdown.config.ts b/packages/react/tsdown.config.ts index deb3ab8..4b3ef73 100644 --- a/packages/react/tsdown.config.ts +++ b/packages/react/tsdown.config.ts @@ -3,7 +3,7 @@ import { defineConfig } from "tsdown"; export default defineConfig({ entry: ["./src/index.ts"], dts: true, - format: ["cjs", "esm"], + format: ["esm"], sourcemap: true, target: "es2020", platform: "browser", diff --git a/packages/tide-predictor/package.json b/packages/tide-predictor/package.json index 75be49d..a2fbcc7 100644 --- a/packages/tide-predictor/package.json +++ b/packages/tide-predictor/package.json @@ -10,12 +10,11 @@ "author": "Kevin Miller ", "license": "MIT", "type": "module", - "main": "dist/index.cjs", + "main": "dist/index.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" + "import": "./dist/index.js" } }, "files": [ diff --git a/tsdown.config.js b/tsdown.config.js index 5f71df8..2ad13f7 100644 --- a/tsdown.config.js +++ b/tsdown.config.js @@ -3,7 +3,7 @@ import { defineConfig } from "tsdown"; export default defineConfig({ entry: ["./src/index.ts"], dts: true, - format: ["cjs", "esm"], + format: ["esm"], sourcemap: true, declarationMap: true, target: "es2020",