diff --git a/package.json b/package.json index ed93e74..e642edc 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,24 @@ { "name": "simple-ascii-chart", - "version": "4.0.0", + "version": "4.0.1", "description": "Simple ascii chart generator", "main": "dist/cjs/index.js", "module": "dist/mjs/index.js", "exports": { ".": { - "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.js" - }, - "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index.js" - } + "import": "./dist/mjs/index.js", + "require": "./dist/cjs/index.js" } }, + "types": "dist/types/index.d.ts", "scripts": { "start": "tsc-watch -p tsconfig.json --preserveWatchOutput -w --onSuccess 'node ./dist/index.js'", "lint": "eslint . --ext .ts,.js", "lint:fix": "eslint . --ext .ts,.js --fix", "test": "jest --coverage", "test:watch": "jest --watch", - "build": "rm -fr dist/* && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json && ./fixup.sh", + "build:types": "tsc --emitDeclarationOnly --declaration --outDir dist/types", + "build": "rm -fr dist/* && tsc -p tsconfig-mjs.json && tsc -p tsconfig-cjs.json && ./fixup.sh && npm run build:types", "prepare": "husky install", "prepublishOnly": "npm test && npm run lint", "preversion": "npm run lint", diff --git a/tsconfig-cjs.json b/tsconfig-cjs.json index 407c338..ccbd8b1 100644 --- a/tsconfig-cjs.json +++ b/tsconfig-cjs.json @@ -1,8 +1,11 @@ { - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "dist/cjs", - "target": "es2015" - } -} + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "Node16", + "moduleResolution": "Node16", + "outDir": "dist/cjs" + }, + "ts-node": { + "transpileOnly": true + } +} \ No newline at end of file diff --git a/tsconfig-esm.json b/tsconfig-esm.json deleted file mode 100644 index 86a81cb..0000000 --- a/tsconfig-esm.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "moduleResolution":"node", - "module": "esnext", - "outDir": "dist/mjs", - "target": "esnext" - } -} diff --git a/tsconfig-mjs.json b/tsconfig-mjs.json new file mode 100644 index 0000000..cbb8174 --- /dev/null +++ b/tsconfig-mjs.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "es2020", + "moduleResolution": "node", + "outDir": "dist/mjs", + "downlevelIteration": true, + + } +} \ No newline at end of file diff --git a/tsconfig.build.json b/tsconfig.build.json deleted file mode 100644 index d191fec..0000000 --- a/tsconfig.build.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "exclude": [ - "node_modules", - "**/__tests__/*" - ] -} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 0d59841..3c1db6f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,15 @@ { + "include": ["src"], + "exclude": ["node_modules", "dist"], "compilerOptions": { - "rootDir": "src", - "outDir": "dist", - "allowJs": true, - "esModuleInterop": true, - "declaration": true, + "alwaysStrict": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "moduleResolution": "node", "strict": true, - "downlevelIteration": true, + "skipLibCheck": true, + "typeRoots": ["./src/types", "node_modules/@types"], + "target": "es2020", + "rootDirs": ["src"], }, - "include": ["./src"], - "target": "esnext", } -