Skip to content

Commit 845abfd

Browse files
committed
refactor: Change build system
1 parent 6cb1fae commit 845abfd

File tree

4 files changed

+890
-21
lines changed

4 files changed

+890
-21
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ yarn add @doczilla/node
1313
## Usage
1414

1515
The package needs to be configured with your account's API key, which is
16-
available your [Doczilla's organisation settings page](https://doczilla.app/login).
16+
available on your [Doczilla's organisation settings page](https://doczilla.app/login).
1717

1818
```ts
19-
import Doczilla from '@doczilla/node';
19+
import Doczilla from '@doczilla/node'
2020

2121
const doczilla = new Doczilla('doczilla-...')
2222

2323
const pdfBuffer = await doczilla.pdf.direct({
24-
url: 'https://doczilla.app'
24+
page: {
25+
html: '<div>Your first Doczilla PDF</div>'
26+
}
2527
})
2628
```
2729

package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,23 @@
2525
"email": "hello@doczilla.app",
2626
"url": "https://doczilla.app"
2727
},
28+
"sideEffects": false,
29+
"exports": {
30+
".": {
31+
"require": "./dist/index.js",
32+
"import": "./dist/index.mjs",
33+
"types": "./dist/types/index.d.ts"
34+
},
35+
"./package.json": "./package.json"
36+
},
2837
"main": "./dist/index.js",
2938
"module": "./dist/esm/index.js",
39+
"types": "./dist/types/index.d.ts",
3040
"scripts": {
31-
"build": "tsc && tsc -p tsconfig.esm.json",
41+
"build": "yarn clean && yarn build:ts && yarn build:types",
42+
"build:ts": "tsup src/index.ts --format cjs,esm --clean",
43+
"build:types": "tsc --emitDeclarationOnly --outDir dist/types",
44+
"clean": "rm -rf dist",
3245
"generate:sdk": "node ./generate-models.js && yarn build",
3346
"lint": "eslint --ext .ts .",
3447
"test": "jest"
@@ -38,6 +51,7 @@
3851
},
3952
"devDependencies": {
4053
"@jest/globals": "^29.7.0",
54+
"@swc/core": "^1.6.13",
4155
"@types/jest": "^29.5.12",
4256
"@types/node": "^20.14.10",
4357
"@typescript-eslint/eslint-plugin": "^7.16.1",
@@ -49,6 +63,7 @@
4963
"jest": "^29.7.0",
5064
"openapi-typescript-codegen": "^0.29.0",
5165
"ts-jest": "^29.2.2",
66+
"tsup": "^8.1.1",
5267
"typescript": "^5.5"
5368
},
5469
"packageManager": "yarn@4.2.2",

tsconfig.esm.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)