Skip to content

Commit a1b24b4

Browse files
committed
Use 'dts-bundle-generator' to emit rolled up type declaration
1 parent 84b941e commit a1b24b4

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

.github/workflows/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
npm run build:esm
4646
echo '{"type": "commonjs"}' > dist/commonjs/package.json
4747
echo '{"type": "module"}' > dist/module/package.json
48+
npm i --no-save dts-bundle-generator
49+
npx dts-bundle-generator -o dist/index.d.ts src/index.ts
4850
mkdir dest
4951
npm pack --pack-destination=dest
5052
- name: Typedoc

package.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@
1313
"homepage": "https://github.com/malthe/ts-postgres",
1414
"author": "Malthe Borch <[email protected]>",
1515
"main": "./dist/module/index.js",
16-
"types": "./dist/module/index.d.ts",
16+
"types": "./dist/index.d.ts",
1717
"exports": {
18-
"require": "./dist/commonjs/index.js",
19-
"import": "./dist/module/index.js"
18+
".": {
19+
"require": {
20+
"types": "./dist/index.d.ts",
21+
"default": "./dist/commonjs/index.js"
22+
},
23+
"import": {
24+
"types": "./dist/index.d.ts",
25+
"default": "./dist/module/index.js"
26+
}
27+
}
2028
},
2129
"files": [
2230
"/dist"
@@ -58,6 +66,7 @@
5866
"@typescript-eslint/eslint-plugin": "^6",
5967
"@typescript-eslint/parser": "^6",
6068
"colors": "^1",
69+
"dts-bundle-generator": "^9.3.1",
6170
"eslint": "^8",
6271
"eslint-config-standard": "^17",
6372
"eslint-plugin-import": "^2",

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"strict": true,
88
"sourceMap": true,
99
"inlineSourceMap": false,
10-
"declaration": true,
10+
"declaration": false,
1111
"noImplicitAny": true,
1212
"isolatedModules": true,
1313
"noUnusedParameters": true,

0 commit comments

Comments
 (0)