From cbe51e15239b125d3d54fb80b5682f089d6d765e Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Thu, 30 Jan 2025 13:02:54 -0800 Subject: [PATCH] generate types in gh actions and vite and tsconfig in examples to check the type declarations files --- .github/workflows/ci.yml | 2 ++ examples/tsconfig.json | 7 ++++++- examples/vite.config.ts | 6 ++++++ tsconfig.json | 4 ++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08ff3921..d731cb43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,8 @@ jobs: with: node-version: ${{env.NODE_VERSION}} - run: npm ci + - run: cd examples && npm ci + - run: npm run generateTypes - run: npm run typeCheck --if-present publish-dev: diff --git a/examples/tsconfig.json b/examples/tsconfig.json index 8e39b363..5f3f83b6 100644 --- a/examples/tsconfig.json +++ b/examples/tsconfig.json @@ -3,6 +3,11 @@ "compilerOptions": { "jsx": "preserve", "esModuleInterop": true, - "downlevelIteration": true + "downlevelIteration": true, + "baseUrl": ".", + "paths": { + "@aics/simularium-viewer": ["../type-declarations"], + "@aics/simularium-viewer/*": ["../type-declarations/*"] + } } } \ No newline at end of file diff --git a/examples/vite.config.ts b/examples/vite.config.ts index 33a7e940..ddac9e77 100644 --- a/examples/vite.config.ts +++ b/examples/vite.config.ts @@ -8,6 +8,12 @@ export default { process.env.npm_config_localserver || false ), }, + resolve: { + dedupe: ["react", "react-dom"], + }, + optimizeDeps: { + include: ["@aics/simularium-viewer"], + }, server: { open: "examples/src/index.html", port: 8080, diff --git a/tsconfig.json b/tsconfig.json index 0f773a6a..e9110a15 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "./tsconfig.base", - "include": ["src/**/*", "examples/src/**/*", "vitest.config.ts"], - "exclude": ["src/visGeometry/workers/**/*"], + "include": ["src/**/*", "vitest.config.ts"], + "exclude": ["src/visGeometry/workers/**/*", "examples/src/**/*"], "compilerOptions": {"types": ["vitest/globals"]} }