From 46aa315787eb56aaa78996574f1f2cb1c00d6d35 Mon Sep 17 00:00:00 2001 From: cedoor Date: Sun, 23 Jan 2022 14:10:03 +0100 Subject: [PATCH] chore: set tsconfig paths for all zk-kit packages Former-commit-id: 92f063bf3794f022233565633299610938e62e09 [formerly 9fb0532beafe80f1591bd9aa3b083dfd55469611] [formerly 3b14775151319fe357ebbe82a4931f85c15a3bbd [formerly 87dbdfb166eda92f30b1bd882035a87986ab33af]] Former-commit-id: 28a49fe4119f800a610d6a1c0315baf31f598fe0 [formerly 346fea95b7b9f2d17c928a5019cbcfb664b0fdfc] Former-commit-id: 65d03434f0522b0ef27ef74ef456099e4db9309a --- jest.config.ts | 5 ++--- packages/identity/build.tsconfig.json | 3 ++- packages/incremental-merkle-tree/build.tsconfig.json | 3 ++- packages/protocols/build.tsconfig.json | 4 +++- packages/sparse-merkle-tree/build.tsconfig.json | 3 ++- tsconfig.json | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/jest.config.ts b/jest.config.ts index 2579c2b..d10bd26 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,7 +1,7 @@ import fs from "fs" import type { Config } from "@jest/types" -const projects = fs +const projects: any = fs .readdirSync("./packages", { withFileTypes: true }) .filter((directory) => directory.isDirectory()) .map(({ name }) => ({ @@ -9,8 +9,7 @@ const projects = fs displayName: name, moduleNameMapper: { "@zk-kit/types": "/../../types/zk-kit/index.d.ts", - // Interdependency packages: - "@zk-kit/identity": "/../identity/src/index.ts" + "@zk-kit/(.*)": "/../$1/src/index.ts" // Interdependency packages. } })) diff --git a/packages/identity/build.tsconfig.json b/packages/identity/build.tsconfig.json index 7e15a6a..439c34c 100644 --- a/packages/identity/build.tsconfig.json +++ b/packages/identity/build.tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "declarationDir": "types" + "declarationDir": "types", + "paths": {} }, "include": ["src"] } diff --git a/packages/incremental-merkle-tree/build.tsconfig.json b/packages/incremental-merkle-tree/build.tsconfig.json index 7e15a6a..439c34c 100644 --- a/packages/incremental-merkle-tree/build.tsconfig.json +++ b/packages/incremental-merkle-tree/build.tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "declarationDir": "types" + "declarationDir": "types", + "paths": {} }, "include": ["src"] } diff --git a/packages/protocols/build.tsconfig.json b/packages/protocols/build.tsconfig.json index 7e15a6a..4043527 100644 --- a/packages/protocols/build.tsconfig.json +++ b/packages/protocols/build.tsconfig.json @@ -1,7 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "declarationDir": "types" + "allowJs": true, + "declarationDir": "types", + "paths": {} }, "include": ["src"] } diff --git a/packages/sparse-merkle-tree/build.tsconfig.json b/packages/sparse-merkle-tree/build.tsconfig.json index 7e15a6a..439c34c 100644 --- a/packages/sparse-merkle-tree/build.tsconfig.json +++ b/packages/sparse-merkle-tree/build.tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "declarationDir": "types" + "declarationDir": "types", + "paths": {} }, "include": ["src"] } diff --git a/tsconfig.json b/tsconfig.json index 5085964..42b7752 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,7 @@ "typeRoots": ["node_modules/@types", "types"], "paths": { "@zk-kit/types": ["types/zk-kit"], - "@zk-kit/identity": ["packages/identity/src"] + "@zk-kit/*": ["packages/*/src"] } }, "ts-node": {