Skip to content

Commit

Permalink
Merge pull request #1226 from remarkablemark/fix/esm
Browse files Browse the repository at this point in the history
fix(esm): fix ESM types by adding .mts declaration files
  • Loading branch information
remarkablemark authored Dec 18, 2023
2 parents dd0b253 + ce09a65 commit f66df14
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 20 deletions.
1 change: 1 addition & 0 deletions esm/attributes-to-props.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '../lib/attributes-to-props';
1 change: 1 addition & 0 deletions esm/dom-to-react.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '../lib/dom-to-react';
2 changes: 2 additions & 0 deletions esm/index.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from '../lib/index';
export { default } from '../lib/index';
10 changes: 1 addition & 9 deletions esm/index.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import HTMLReactParser from '../lib/index.js';

export {
Comment,
Element,
ProcessingInstruction,
Text,
attributesToProps,
domToReact,
htmlToDOM,
} from '../lib/index.js';
export * from '../lib/index.js';

export default HTMLReactParser.default || HTMLReactParser;
1 change: 1 addition & 0 deletions esm/utilities.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../lib/utilities';
9 changes: 1 addition & 8 deletions esm/utilities.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
export {
isCustomComponent,
setStyleProp,
PRESERVE_CUSTOM_ATTRIBUTES,
ELEMENTS_WITH_NO_TEXT_CHILDREN,
canTextBeChildOfNode,
returnFirstArg,
} from '../lib/utilities.js';
export * from '../lib/utilities.js';
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
"author": "Mark <[email protected]>",
"main": "./lib/index.js",
"module": "./esm/index.mjs",
"types": "./lib/index.d.ts",
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./esm/index.mjs",
"require": "./lib/index.js"
},
"./lib/*": {
"types": "./lib/*.d.ts",
"import": "./esm/*.mjs",
"default": "./lib/*.js"
}
Expand Down

0 comments on commit f66df14

Please sign in to comment.