From 334e5d78855709d4ca56619f16eecb414f88ce2d Mon Sep 17 00:00:00 2001 From: Harri Lehtola <1781172+peruukki@users.noreply.github.com> Date: Sat, 21 Sep 2024 16:55:37 +0300 Subject: [PATCH] feat: Publish TypeScript types in Feast UI package (#4551) --- ui/package.json | 5 +++-- ui/tsconfig.build-lib.json | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 ui/tsconfig.build-lib.json diff --git a/ui/package.json b/ui/package.json index 3a609f3c83..c104c00ae5 100644 --- a/ui/package.json +++ b/ui/package.json @@ -6,6 +6,7 @@ "dist" ], "main": "./dist/feast-ui.cjs", + "types": "./dist/FeastUI.d.ts", "module": "./dist/feast-ui.module.js", "peerDependencies": { "@elastic/datemath": "^5.0.3", @@ -54,8 +55,8 @@ "scripts": { "start": "npm run generate-protos && react-scripts start", "build": "npm run generate-protos && react-scripts build", - "build:lib": "npm run generate-protos && rimraf ./dist && tsc && rollup -c", - "build:lib-dev": "npm run generate-protos && rimraf ./dist && tsc && rollup -c && yalc publish -f", + "build:lib": "npm run generate-protos && rimraf ./dist && tsc --project ./tsconfig.build-lib.json && rollup -c", + "build:lib-dev": "npm run build:lib && yalc publish -f", "test": "npm run generate-protos && react-scripts test", "eject": "react-scripts eject", "generate-protos": "pbjs --no-encode -o src/protos.js -w commonjs -t static-module `find ../protos/feast/ -iname *.proto` && pbts -n protos -o src/protos.d.ts src/protos.js" diff --git a/ui/tsconfig.build-lib.json b/ui/tsconfig.build-lib.json new file mode 100644 index 0000000000..c29bd063f0 --- /dev/null +++ b/ui/tsconfig.build-lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "noEmit": false, + "outDir": "./dist", + "rootDir": "./src" + } +}