Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
{
"name": "@hyphen/sdk",
"version": "3.0.1",
"version": "3.1.0",
"description": "Hyphen SDK for Node.js",
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"module": "dist/index.mjs",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"types": "dist/index.d.ts",
"types": "dist/index.d.mts",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point top-level types at CJS-compatible declarations

Changing types to dist/index.d.mts makes CommonJS TypeScript consumers that still use moduleResolution: "node"/"node10" resolve ESM declarations instead of the CJS branch, because those resolvers ignore conditional exports typing and read only the top-level types field. In that setup, import = require('@hyphen/sdk') and similar CJS typing patterns no longer align with the runtime require entry even though exports.require.types is present, so this should point to a CJS-compatible declaration (or a compatibility .d.ts shim) to avoid a regression for legacy CJS TS projects.

Useful? React with 👍 / 👎.

"scripts": {
"lint": "biome check --write --error-on-warnings",
"test": "pnpm lint && vitest run --coverage",
"test:ci": "biome check --error-on-warnings && vitest run --coverage",
"build": "rimraf ./dist && tsup src/index.ts --format esm,cjs --dts --clean",
"build": "tsdown src/index.ts --format esm,cjs --dts",
Comment thread
jaredwray marked this conversation as resolved.
"clean": "rimraf ./dist pnpm-lock.yaml node_modules coverage",
"prepublishOnly": "rimraf ./dist && tsup src/index.ts --format esm,cjs --dts --clean"
"prepublishOnly": "pnpm build"
},
"keywords": [
"hyphen",
Expand All @@ -35,13 +41,12 @@
"devDependencies": {
"@biomejs/biome": "^2.4.11",
"@faker-js/faker": "^10.4.0",
"@swc/core": "^1.15.24",
"@types/node": "^25.6.0",
"@vitest/coverage-v8": "^4.1.4",
"rimraf": "^6.1.3",
"tsd": "^0.33.0",
"tsup": "^8.5.1",
"typescript": "^5.9.3",
"tsdown": "^0.21.7",
"typescript": "^6.0.2",
Comment thread
jaredwray marked this conversation as resolved.
"vitest": "^4.1.4"
},
"files": [
Expand Down
Loading
Loading