From cedaa68e66ae05fde9a9f61a7a0fd8e7f3414c20 Mon Sep 17 00:00:00 2001 From: Fernando Gonzalez Goncharov Date: Tue, 22 Oct 2024 20:29:21 +0300 Subject: [PATCH] chore: ts references --- packages/issuer-sdk-js/package.json | 10 +++++----- packages/issuer-sdk-js/src/credentials.ts | 2 +- packages/issuer-sdk-js/src/human.ts | 2 +- packages/issuer-sdk-js/src/types.ts | 1 - packages/issuer-sdk-js/tsconfig.json | 3 ++- packages/issuer-sdk-js/tsup.config.ts | 2 +- packages/kwil-nep413-signer/tsconfig.json | 2 +- packages/types/tsconfig.json | 20 ++++++++++++++++++++ 8 files changed, 31 insertions(+), 11 deletions(-) delete mode 100644 packages/issuer-sdk-js/src/types.ts create mode 100644 packages/types/tsconfig.json diff --git a/packages/issuer-sdk-js/package.json b/packages/issuer-sdk-js/package.json index 5e5e1c90c..ea4a028aa 100644 --- a/packages/issuer-sdk-js/package.json +++ b/packages/issuer-sdk-js/package.json @@ -18,19 +18,19 @@ ], "exports": { ".": { - "types": "./src/index.ts", + "types": "./dist/index.d.ts", "import": "./dist/index.js" }, "./create-issuer-config": { - "types": "./src/create-issuer-config.ts", + "types": "./dist/create-issuer-config.d.ts", "import": "./dist/create-issuer-config.js" }, "./human": { - "types": "./src/human.ts", + "types": "./dist/human.d.ts", "import": "./dist/human.js" }, "./credentials": { - "types": "./src/credentials.ts", + "types": "./dist/credentials.d.ts", "import": "./dist/credentials.js" } }, @@ -47,7 +47,6 @@ "test:build": "pnpx publint --strict" }, "devDependencies": { - "@idos-network/kwil-nep413-signer": "workspace:*", "@idos-network/idos-sdk-types": "workspace:*", "@release-it/keep-a-changelog": "^5.0.0", "clean-package": "^2.2.0", @@ -57,6 +56,7 @@ "vitest": "^0.31.4" }, "dependencies": { + "@idos-network/kwil-nep413-signer": "workspace:*", "@kwilteam/kwil-js": "0.7.1", "@stablelib/base64": "^1.0.1", "@stablelib/utf8": "^1.0.1", diff --git a/packages/issuer-sdk-js/src/credentials.ts b/packages/issuer-sdk-js/src/credentials.ts index b807dc42b..581ca318b 100644 --- a/packages/issuer-sdk-js/src/credentials.ts +++ b/packages/issuer-sdk-js/src/credentials.ts @@ -1,8 +1,8 @@ import * as base64 from "@stablelib/base64"; import * as utf8Codec from "@stablelib/utf8"; +import type { idOSCredential } from "../../types"; import type { IssuerConfig } from "./create-issuer-config"; import { createActionInput, encrypt, ensureEntityId } from "./internal"; -import type { idOSCredential } from "./types"; export interface CreateCredentialReqParams extends Omit { id?: string; diff --git a/packages/issuer-sdk-js/src/human.ts b/packages/issuer-sdk-js/src/human.ts index a48cdf88d..be048a679 100644 --- a/packages/issuer-sdk-js/src/human.ts +++ b/packages/issuer-sdk-js/src/human.ts @@ -1,6 +1,6 @@ +import type { idOSHuman, idOSWallet } from "./../../types"; import type { IssuerConfig } from "./create-issuer-config"; import { createActionInput, ensureEntityId } from "./internal"; -import type { idOSHuman, idOSWallet } from "./types"; export interface CreateProfileReqParams extends Omit { id?: string; diff --git a/packages/issuer-sdk-js/src/types.ts b/packages/issuer-sdk-js/src/types.ts deleted file mode 100644 index 92339baee..000000000 --- a/packages/issuer-sdk-js/src/types.ts +++ /dev/null @@ -1 +0,0 @@ -export type { idOSCredential, idOSHuman, idOSWallet } from "../../types"; diff --git a/packages/issuer-sdk-js/tsconfig.json b/packages/issuer-sdk-js/tsconfig.json index 05d579b05..accb88343 100644 --- a/packages/issuer-sdk-js/tsconfig.json +++ b/packages/issuer-sdk-js/tsconfig.json @@ -16,5 +16,6 @@ "noFallthroughCasesInSwitch": true, "baseUrl": "." }, - "include": ["./src/**/*.ts"] + "include": ["./src/**/*.ts"], + "references": [{ "path": "../types" }, { "path": "../kwil-nep413-signer" }] } diff --git a/packages/issuer-sdk-js/tsup.config.ts b/packages/issuer-sdk-js/tsup.config.ts index e1d07b411..56459e097 100644 --- a/packages/issuer-sdk-js/tsup.config.ts +++ b/packages/issuer-sdk-js/tsup.config.ts @@ -6,7 +6,6 @@ export default defineConfig({ "./src/create-issuer-config.ts", "./src/human.ts", "./src/credentials.ts", - "./src/types.ts", ], splitting: false, sourcemap: true, @@ -14,5 +13,6 @@ export default defineConfig({ format: ["esm"], outDir: "./dist", bundle: true, + dts: true, noExternal: ["@idos-network/kwil-nep413-signer", "@idos-network/idos-sdk-types"], }); diff --git a/packages/kwil-nep413-signer/tsconfig.json b/packages/kwil-nep413-signer/tsconfig.json index ba62bc718..8c63b17a8 100644 --- a/packages/kwil-nep413-signer/tsconfig.json +++ b/packages/kwil-nep413-signer/tsconfig.json @@ -2,6 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "outDir": "./dist", + "composite": true, "declaration": true, "declarationMap": true, "declarationDir": "./dist/types", @@ -12,7 +13,6 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "noEmit": true, "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json new file mode 100644 index 000000000..b2612cd29 --- /dev/null +++ b/packages/types/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ESNext", + "composite": true, + "lib": ["ESNext"], + "module": "ESNext", + "skipLibCheck": true, + /* Bundler mode */ + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "baseUrl": "." + }, + "include": ["./src/**/*.ts"] +}