Skip to content

Commit

Permalink
Add CJS type defs for node16 resolution. (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgerigmeyer authored Jan 10, 2024
1 parent c04f61c commit 43b2176
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
26 changes: 18 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,30 @@
"files": [
"dist/",
"src/",
"types/dist/",
"types/src/",
"types/index.d.ts"
"types/index.d.ts",
"types/index.d.cts"
],
"exports": {
".": {
"types": "./types/index.d.ts",
"import": "./dist/color.js",
"require": "./dist/color.cjs"
"import": {
"types": "./types/index.d.ts",
"default": "./dist/color.js"
},
"require": {
"types": "./types/index.d.cts",
"default": "./dist/color.cjs"
}
},
"./fn": {
"types": "./types/src/index-fn.d.ts",
"import": "./src/index-fn.js",
"require": "./dist/color-fn.cjs"
"import": {
"types": "./types/src/index-fn.d.ts",
"default": "./src/index-fn.js"
},
"require": {
"types": "./types/src/index-fn.d.cts",
"default": "./dist/color-fn.cjs"
}
},
"./dist/*": "./dist/*"
},
Expand Down
1 change: 0 additions & 1 deletion types/dist/color.d.ts

This file was deleted.

4 changes: 4 additions & 0 deletions types/index.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Definitions by: Adam Thompson-Sharpe <https://github.com/MysteryBlokHed>
// Minimum TypeScript Version: 4.1
export { default } from "./index.js";
export * from "./index.js";
3 changes: 2 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Definitions by: Adam Thompson-Sharpe <https://github.com/MysteryBlokHed>
// Minimum TypeScript Version: 4.1
export { default } from "./dist/color.js";
export { default } from "./src/index.js";

export type {
ColorConstructor,
ColorObject,
Expand Down
1 change: 1 addition & 0 deletions types/src/index-fn.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./index-fn.js";

0 comments on commit 43b2176

Please sign in to comment.