Skip to content

Commit

Permalink
fix: Add stub CJS exports for old ESLint plugins (#701)
Browse files Browse the repository at this point in the history
Closes #691.
  • Loading branch information
franky47 authored Oct 23, 2024
1 parent 56c223f commit 464506b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
9 changes: 9 additions & 0 deletions packages/nuqs/esm-only.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// ESM only manifesto: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

// This stub file was added to let some old ESLint plugins resolve
// the import paths correctly, as setting exports.*.require: null in package.json didn't work.

throw new Error(
`This package is ESM only.
See https://github.com/47ng/nuqs/issues/691 for more details.`
)
33 changes: 22 additions & 11 deletions packages/nuqs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"adapters/remix.d.ts",
"adapters/react-router.d.ts",
"adapters/custom.d.ts",
"adapters/testing.d.ts"
"adapters/testing.d.ts",
"esm-only.cjs"
],
"type": "module",
"sideEffects": false,
Expand All @@ -49,43 +50,53 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"import": "./dist/index.js",
"require": "./esm-only.cjs"
},
"./server": {
"types": "./dist/server.d.ts",
"import": "./dist/server.js"
"import": "./dist/server.js",
"require": "./esm-only.cjs"
},
"./adapters/react": {
"types": "./dist/adapters/react.d.ts",
"import": "./dist/adapters/react.js"
"import": "./dist/adapters/react.js",
"require": "./esm-only.cjs"
},
"./adapters/next": {
"types": "./dist/adapters/next.d.ts",
"import": "./dist/adapters/next.js"
"import": "./dist/adapters/next.js",
"require": "./esm-only.cjs"
},
"./adapters/next/app": {
"types": "./dist/adapters/next/app.d.ts",
"import": "./dist/adapters/next/app.js"
"import": "./dist/adapters/next/app.js",
"require": "./esm-only.cjs"
},
"./adapters/next/pages": {
"types": "./dist/adapters/next/pages.d.ts",
"import": "./dist/adapters/next/pages.js"
"import": "./dist/adapters/next/pages.js",
"require": "./esm-only.cjs"
},
"./adapters/remix": {
"types": "./dist/adapters/remix.d.ts",
"import": "./dist/adapters/remix.js"
"import": "./dist/adapters/remix.js",
"require": "./esm-only.cjs"
},
"./adapters/react-router": {
"types": "./dist/adapters/react-router.d.ts",
"import": "./dist/adapters/react-router.js"
"import": "./dist/adapters/react-router.js",
"require": "./esm-only.cjs"
},
"./adapters/custom": {
"types": "./dist/adapters/custom.d.ts",
"import": "./dist/adapters/custom.js"
"import": "./dist/adapters/custom.js",
"require": "./esm-only.cjs"
},
"./adapters/testing": {
"types": "./dist/adapters/testing.d.ts",
"import": "./dist/adapters/testing.js"
"import": "./dist/adapters/testing.js",
"require": "./esm-only.cjs"
}
},
"scripts": {
Expand Down

0 comments on commit 464506b

Please sign in to comment.