Skip to content

Commit

Permalink
fix: d.ts file not copied to distributed package
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Nov 27, 2023
1 parent 4e95670 commit 52fbb8f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 1 addition & 2 deletions kits/connect/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "@usevenice/connect",
"version": "0.1.8",
"version": "0.1.10",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.json",
Expand Down
5 changes: 5 additions & 0 deletions kits/sdk/bin/jsonToJs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ try {
console.error('An error occurred while generating the JavaScript file:', err)
process.exit(1)
}


// TODO: There is additional problem where tsc does not copy .d.ts files to build, and therefore we
// need to do it manully
// https://stackoverflow.com/questions/56018167/typescript-does-not-copy-d-ts-files-to-build
8 changes: 5 additions & 3 deletions kits/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "@usevenice/sdk",
"version": "0.0.8",
"version": "0.0.10",
"private": false,
"sideEffects": false,
"module": "./index.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.json && pnpm build:json",
"build": "tsc -p ./tsconfig.json && run-s build:json build:dts",
"build:dts": "cp ./venice.oas.d.ts ./dist/venice.oas.d.ts",
"build:json": "node --loader tsx ./bin/jsonToJs.ts ./dist/venice.oas.json",
"clean": "rm -rf ./dist",
"generate": "pnpm generate:schema && pnpm generate:types",
Expand Down
2 changes: 1 addition & 1 deletion kits/sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// web module we get package not found issues. (such as `generate` call in the sdk)
"baseUrl": "../../"
},
"include": ["index.ts"]
"include": ["./index.ts"]
}
1 change: 0 additions & 1 deletion utils/openapi-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": false,
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.json",
Expand Down

0 comments on commit 52fbb8f

Please sign in to comment.