Skip to content

Commit

Permalink
fix: use tsup for building client js (#120)
Browse files Browse the repository at this point in the history
* fix: use tsup for building client js

* Update clients/javascript/tsup.config.ts

* fix(js client): warning for types when building
  • Loading branch information
GuillaumeDecMeetsMore authored Oct 16, 2024
1 parent 8120e30 commit f6e9ee2
Show file tree
Hide file tree
Showing 3 changed files with 886 additions and 5 deletions.
16 changes: 13 additions & 3 deletions clients/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
"name": "@meetsmore/nittei-client",
"version": "0.0.1",
"description": "The Nittei Javascript library provides convenient access to the Nittei API from server-side JavaScript applications or web applications",
"main": "dist/index.js",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"packageManager": "[email protected]",
"scripts": {
"build": "tsc --p ./tsconfig.release.json",
"build": "tsup",
"deploy": "pnpm run build && pnpm publish --no-git-checks",
"format": "biome format --write ./lib ./tests",
"lint": "biome lint --write ./lib ./tests",
Expand Down Expand Up @@ -41,7 +50,8 @@
"jest": "29.7.0",
"jsonwebtoken": "9.0.2",
"ts-jest": "29.2.5",
"tsup": "8.3.0",
"typescript": "5.6.3",
"uuid": "10.0.0"
}
}
}
17 changes: 17 additions & 0 deletions clients/javascript/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { Options } from 'tsup'

export const tsup: Options = {
splitting: true,
clean: true, // clean up the dist folder
dts: true, // generate dts files
format: ['cjs', 'esm'], // generate cjs and esm files
minify: true,
bundle: true,
sourcemap: true,
skipNodeModulesBundle: true,
entryPoints: ['lib/index.ts'],
target: 'es2020',
outDir: 'dist',
entry: ['lib/**/*.ts'], //include all files under lib
tsconfig: 'tsconfig.release.json',
}
Loading

0 comments on commit f6e9ee2

Please sign in to comment.