From 06062d3087d21802e4c1213e5a1b45da7b23075d Mon Sep 17 00:00:00 2001 From: Samrith Shankar Date: Thu, 16 Jan 2025 22:59:49 +0530 Subject: [PATCH] chore: add typecheck and repair manifest files --- packages/core/package.json | 3 ++- packages/core/tsconfig.check.json | 4 ++++ packages/react/package.json | 4 +++- packages/react/tsconfig.check.json | 4 ++++ scripts/shell/resolve-root.sh | 7 ------- scripts/shell/typecheck.sh | 6 +----- tsconfig.json | 1 + 7 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 packages/core/tsconfig.check.json create mode 100644 packages/react/tsconfig.check.json delete mode 100644 scripts/shell/resolve-root.sh diff --git a/packages/core/package.json b/packages/core/package.json index d2becfb..9813c9c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -17,7 +17,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/samrith-s/genshi.git", + "url": "git+https://github.com/samrith-s/genshi.git", "directory": "packages/core" }, "bugs": { @@ -34,6 +34,7 @@ "build": "vite build", "lint": "sh ../../scripts/shell/lint.sh .", "format": "sh ../../scripts/shell/format.sh .", + "typecheck": "sh ../../scripts/shell/typecheck.sh .", "test": "vitest --coverage" }, "devDependencies": { diff --git a/packages/core/tsconfig.check.json b/packages/core/tsconfig.check.json new file mode 100644 index 0000000..bdc6320 --- /dev/null +++ b/packages/core/tsconfig.check.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/**/*"] +} diff --git a/packages/react/package.json b/packages/react/package.json index 9791e7a..90b8a9e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -11,12 +11,13 @@ "main": "lib/index.cjs", "types": "lib/types/src/index.d.ts", "exports": { + "types": "./lib/types/src/index.d.ts", "import": "./lib/index.js", "require": "./lib/index.cjs" }, "repository": { "type": "git", - "url": "https://github.com/samrith-s/genshi.git", + "url": "git+https://github.com/samrith-s/genshi.git", "directory": "packages/react" }, "bugs": { @@ -28,6 +29,7 @@ "build": "vite build", "lint": "sh ../../scripts/shell/lint.sh .", "format": "sh ../../scripts/shell/format.sh .", + "typecheck": "sh ../../scripts/shell/typecheck.sh .", "test": "vitest --coverage", "example": "parcel example/index.html" }, diff --git a/packages/react/tsconfig.check.json b/packages/react/tsconfig.check.json new file mode 100644 index 0000000..bdc6320 --- /dev/null +++ b/packages/react/tsconfig.check.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/**/*"] +} diff --git a/scripts/shell/resolve-root.sh b/scripts/shell/resolve-root.sh deleted file mode 100644 index dc48aad..0000000 --- a/scripts/shell/resolve-root.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# This just stores the scripts, doesn't run it -export ROOT=$(readlink -f $PWD/../../) -export NODE_MODULES = $(readlink -f $ROOT/node_modules) -export NODE_MODULES_BIN = $(readlink -f $NODE_MODULES/.bin) - diff --git a/scripts/shell/typecheck.sh b/scripts/shell/typecheck.sh index 782263d..74ccaa9 100644 --- a/scripts/shell/typecheck.sh +++ b/scripts/shell/typecheck.sh @@ -4,8 +4,4 @@ export ROOT=$(readlink -f $PWD/../../); export NODE_MODULES=$(readlink -f $ROOT/node_modules); export NODE_MODULES_BIN=$(readlink -f $NODE_MODULES/.bin); -echo $ROOT -echo $NODE_MODULES -echo $NODE_MODULES_BIN - -$NODE_MODULES_BIN/eslint --ignore-path $ROOT/.eslintignore $@; +$NODE_MODULES_BIN/tsc --checkJs false -p ./tsconfig.check.json; diff --git a/tsconfig.json b/tsconfig.json index 471ffe0..2e7b88b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "include": ["packages/**/*", "**/*.ts", "**/*.tsx", "**/*.json"], "exclude": ["node_modules", ".rollup.cache", ".yarn", "lib", "dist"], "compilerOptions": { + "noEmit": true, "module": "ESNext", "baseUrl": ".", "rootDir": ".",