Skip to content

Commit

Permalink
fix: typescript d.ts generation
Browse files Browse the repository at this point in the history
  • Loading branch information
muke1908 committed Sep 17, 2024
1 parent 54e1ea7 commit 26a7c18
Show file tree
Hide file tree
Showing 7 changed files with 12,115 additions and 295 deletions.
2,255 changes: 1,973 additions & 282 deletions client/package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
"private": true,
"dependencies": {
"@chat-e2ee/service": "file:../service",
"@types/jest": "^29.5.2",
"@types/node": "^20.2.5",
"@types/react": "^18.2.9",
"@types/react-dom": "^18.2.4",
"qrcode.react": "^3.1.0",
"react": "^16.13.1",
"react-bootstrap": "^1.5.2",
"react-dom": "^16.13.1",
"react-icons": "^3.10.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1",
"typescript-plugin-css-modules": "^5.0.1"
"react-router-dom": "^5.2.0"
},
"devDependencies": {
"react-scripts": "^5.0.1",
"typescript-plugin-css-modules": "^5.0.1",
"@types/jest": "^29.5.2",
"@types/node": "^20.2.5",
"@types/react": "^18.2.9",
"@types/react-dom": "^18.2.4",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
Expand Down
10,128 changes: 10,128 additions & 0 deletions client/yarn.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
"main": "dist/bundle.js",
"author": "Mukesh",
"license": "ISC",
"types": "dist/types.d.ts",
"types": "dist/types/sdk.d.ts",
"devDependencies": {
"ts-loader": "^9.4.2",
"webpack": "^5.82.0",
"webpack-cli": "^5.0.2",
"webpack-remove-debug": "^0.1.0"
},
"scripts": {
"build": "webpack --mode production && npm run dts",
"build": "webpack --mode production",
"watch": "concurrently \"webpack --watch\" \"npm run watch-dts\"",
"dts": "../node_modules/typescript/bin/tsc src/public/types.ts --declaration --emitDeclarationOnly --declarationDir ./dist",
"publish-sdk": "npm publish",
"test": "jest",
"watch-dts": "../node_modules/.bin/nodemon --watch src/public/types.ts --exec \"npm run dts\""
Expand Down
2 changes: 1 addition & 1 deletion service/src/getChatLink.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import makeRequest from './makeRequest';

const getChatLink = async (pin) => {
const getChatLink = async (pin: string) => {
return makeRequest(`chat-link/${pin}`, {
method: 'GET'
});
Expand Down
3 changes: 2 additions & 1 deletion service/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { generateUUID } from './utils/uuid';
export const utils = {
decryptMessage: (ciphertext: string, privateKey: string) => _cryptoUtils.decryptMessage(ciphertext, privateKey),
generateUUID

}

const logger = new Logger();
Expand Down Expand Up @@ -179,3 +178,5 @@ class ChatE2EE implements IChatE2EE {
}
}
}

export * from './public/types';
3 changes: 2 additions & 1 deletion service/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"compilerOptions": {
"outDir": "dist/types",
"target": "ES5",
"strict": true,
"esModuleInterop": true,
"sourceMap": true,
"noImplicitAny": false,
"declaration": false, // generating separately, npm run dts
"declaration": true,
"strictNullChecks": false,
"downlevelIteration": true,
"lib": ["es5", "es6", "dom"],
Expand Down

0 comments on commit 26a7c18

Please sign in to comment.