From 496aca4d3fec394e432d61525b1fb4e4d7d5607f Mon Sep 17 00:00:00 2001 From: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com> Date: Mon, 29 Jul 2024 19:47:55 +1200 Subject: [PATCH] ci: move the type-checking out of the build process (#393) ci: move the type-checking out of the build process --- .github/workflows/pr.yml | 4 ++++ package.json | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a6f36cbb..73d22f37 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,6 +32,10 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + # This step runs the ci script for type-level errors. + - name: Run the tsc compiler to check for type-level errors + run: pnpm ci:typecheck + # This step runs the ci script for linting to check for linting errors. - name: Run the linter to check for linting errors run: pnpm ci:lint diff --git a/package.json b/package.json index d2b5845b..cfcef895 100644 --- a/package.json +++ b/package.json @@ -4,19 +4,21 @@ "private": true, "type": "module", "scripts": { - "start": "vite preview --host localhost --port 3000", + "build": "pnpm run clean && pnpm run build:code", + "build:code": "vite build", + "ci:format": "pnpm run format", + "ci:lint": "pnpm run lint", + "ci:typecheck": "pnpm run typecheck", + "clean": "rimraf ./dist && rimraf ./coverage", "dev": "vite", - "lint": "eslint --max-warnings 0 .", - "lint:fix": "eslint --fix --max-warnings 0 .", "format": "prettier --check './src/**/*.{js,jsx,ts,tsx,css,md,json}' --config './prettier.config.cjs'", "format:fix": "prettier --write './src/**/*.{js,jsx,ts,tsx,css,md,json}' --config './prettier.config.cjs'", - "clean": "rimraf ./dist && rimraf ./coverage", - "build:code": "tsc && vite build", - "build": "pnpm run clean && pnpm run lint && pnpm run build:code", + "lint": "eslint --max-warnings 0 .", + "lint:fix": "eslint --fix --max-warnings 0 .", "postbuild": "node ./postbuild.cjs", "preview": "vite preview --port 3000", - "ci:lint": "pnpm run lint", - "ci:format": "pnpm run format" + "start": "vite preview --host localhost --port 3000", + "typecheck": "tsc --noEmit" }, "dependencies": { "@dnd-kit/core": "^6.1.0",