diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml new file mode 100644 index 0000000..41829b2 --- /dev/null +++ b/.github/workflows/type-check.yml @@ -0,0 +1,20 @@ +name: Type Check + +on: + pull_request: + types: [opened, synchronize] + push: + branches: + - main + - 'renovate/**' + +jobs: + type-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/pnpm + + - name: Type Check + run: npx tsc --noEmit diff --git a/package.json b/package.json index b0ff09c..a91a280 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "build": "vite build", "lint": "npx oxlint --tsconfig=tsconfig.json && npx eslint --flag unstable_ts_config", "format": "npx prettier --write .", + "type-check": "tsc --noEmit", "test": "vitest --reporter=verbose" }, "keywords": [ @@ -54,6 +55,7 @@ "devDependencies": { "@eslint/js": "^9.13.0", "@oxc-node/core": "^0.0.15", + "@types/eslint-config-prettier": "^6.11.3", "@types/node": "^22.7.7", "@types/shelljs": "^0.8.15", "@vitest/coverage-v8": "^2.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b086fbd..2ae6c8a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,9 @@ importers: '@oxc-node/core': specifier: ^0.0.15 version: 0.0.15 + '@types/eslint-config-prettier': + specifier: ^6.11.3 + version: 6.11.3 '@types/node': specifier: ^22.7.7 version: 22.9.3 @@ -633,6 +636,9 @@ packages: '@types/argparse@1.0.38': resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} + '@types/eslint-config-prettier@6.11.3': + resolution: {integrity: sha512-3wXCiM8croUnhg9LdtZUJQwNcQYGWxxdOWDjPe1ykCqJFPVpzAKfs/2dgSoCtAvdPeaponcWPI7mPcGGp9dkKQ==} + '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} @@ -2467,6 +2473,8 @@ snapshots: '@types/argparse@1.0.38': {} + '@types/eslint-config-prettier@6.11.3': {} + '@types/estree@1.0.6': {} '@types/glob@7.2.0': diff --git a/scripts/sparse-clone.ts b/scripts/sparse-clone.ts index 569b4e7..03c7201 100644 --- a/scripts/sparse-clone.ts +++ b/scripts/sparse-clone.ts @@ -5,7 +5,7 @@ import { SPARSE_CLONE_DIRECTORY, VERSION_PREFIX, } from './constants.js'; -import { version } from '../package.json'; +import packageJson from '../package.json' with { type: 'json' }; /** * Run this file in CLI like `pnpm run clone` @@ -16,7 +16,7 @@ import { version } from '../package.json'; * */ -const checkoutVersion = process.argv[2] ?? version; +const checkoutVersion = process.argv[2] ?? packageJson.version; // Function to initialize or reconfigure sparse-checkout function configureSparseCheckout(cloneDirectory: string) {