From 8c0ed2133c46f44d2935e634d8c91aa2407be667 Mon Sep 17 00:00:00 2001 From: oleast Date: Thu, 15 Dec 2022 10:20:35 +0100 Subject: [PATCH] fix(package-output): output esmodule --- package.json | 20 +++++++++++++++++--- src/index.ts | 4 ++-- src/parseHtml.ts | 1 - tsconfig.json | 9 +++++---- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 7505d97..89abe8a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,23 @@ { "name": "contentful-rich-text-html-parser", "version": "1.0.0", - "description": "", + "description": "Convert any HTML to the Contentful Rich Text format", + "author": { + "name": "oleast" + }, + "license": "MIT", + "keywords": [ + "Contentful", + "Rich Text", + "Parser", + "Converter" + ], + "homepage": "https://github.com/oleast/contentful-rich-text-html-parser", + "repository": { + "type": "git", + "url": "https://github.com/oleast/contentful-rich-text-html-parser" + }, + "bugs": "https://github.com/oleast/contentful-rich-text-html-parser/issues", "main": "./dist/index.js", "types": "./dist/types/index.d.ts", "sideEffects": false, @@ -14,8 +30,6 @@ "test": "vitest run", "test:watch": "vitest watch" }, - "author": "oleast", - "license": "MIT", "devDependencies": { "@contentful/rich-text-html-renderer": "^16.0.2", "@semantic-release/commit-analyzer": "^9.0.2", diff --git a/src/index.ts b/src/index.ts index f78679b..3c4a8a8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,5 +8,5 @@ export { ConvertMark, ConvertNode, ConvertOptions, -} from "htmlStringToDocument"; -export { HTMLElementNode, HTMLNode, HTMLTextNode, HTMLTagName } from "types"; +} from "./htmlStringToDocument"; +export { HTMLElementNode, HTMLNode, HTMLTextNode, HTMLTagName } from "./types"; diff --git a/src/parseHtml.ts b/src/parseHtml.ts index f2c8028..9daf179 100644 --- a/src/parseHtml.ts +++ b/src/parseHtml.ts @@ -5,7 +5,6 @@ import { DocumentType, TextNode, CommentNode, - Element, } from "parse5/dist/tree-adapters/default"; import { isNotNull } from "./utils"; diff --git a/tsconfig.json b/tsconfig.json index fc467bb..919cb81 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + "module": "es2015" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, "lib": [ "DOM" ] /* Specify library files to be included in the compilation. */, @@ -13,8 +13,9 @@ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ "declaration": true /* Generates corresponding '.d.ts' file. */, + "declarationDir": "./dist/types", // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ + "sourceMap": true /* Generates corresponding '.map' file. */, // "outFile": "./", /* Concatenate and emit output to single file. */ "outDir": "./dist" /* Redirect output structure to the directory. */, "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, @@ -46,13 +47,13 @@ // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, "baseUrl": "./src" /* Base directory to resolve non-absolute module names. */, // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */