From bfd65279bc74809b3740959e390e0d8e6a01cc4e Mon Sep 17 00:00:00 2001 From: amirhhashemi <87268103+amirhhashemi@users.noreply.github.com> Date: Sun, 16 Mar 2025 17:12:28 +0330 Subject: [PATCH] Fix build errors --- .github/actions/install/action.yml | 21 +++++++++ .github/workflows/orama_sync.yml | 16 ++----- .github/workflows/static_checks.yml | 71 ++++++++--------------------- package.json | 2 +- src/ui/layout/theme-selector.tsx | 9 +++- src/ui/page-issue-link.tsx | 2 +- 6 files changed, 55 insertions(+), 66 deletions(-) create mode 100644 .github/actions/install/action.yml diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml new file mode 100644 index 000000000..d5f890a02 --- /dev/null +++ b/.github/actions/install/action.yml @@ -0,0 +1,21 @@ +name: Install Tools & Dependencies +description: Installs pnpm, Node.js & package dependencies + +runs: + using: composite + steps: + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install + shell: bash diff --git a/.github/workflows/orama_sync.yml b/.github/workflows/orama_sync.yml index fa75043a0..53e109f42 100644 --- a/.github/workflows/orama_sync.yml +++ b/.github/workflows/orama_sync.yml @@ -12,18 +12,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Check out code uses: actions/checkout@v4 - - uses: pnpm/action-setup@v3 - with: - version: 8 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: pnpm - - name: Install dependencies - run: pnpm i + + - name: Install tools & dependencies + uses: ./.github/actions/install + - name: Sync Orama run: pnpm sync:orama env: diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index ebf813ff7..ed34e8af5 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -2,70 +2,37 @@ name: 🔍 Lint / Type Checks on: push: - branches: [main] + branches: + - main + pull_request: - branches: [main] + branches: + - main jobs: - setup: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "pnpm" - - run: pnpm i - - uses: actions/cache/save@v4 - with: - path: | - node_modules - ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - typecheck: - needs: setup runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "pnpm" - - uses: actions/cache/restore@v4 - with: - path: | - node_modules - ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + - name: Check out code + uses: actions/checkout@v4 + + - name: Install tools & dependencies + uses: ./.github/actions/install + - name: Generate virtual modules run: pnpm sync + - name: TypeScript check run: pnpm check:types lint: - needs: setup runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "pnpm" - - uses: actions/cache/restore@v4 - with: - path: | - node_modules - ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - - name: ESLint check + - name: Check out code + uses: actions/checkout@v4 + + - name: Install tools & dependencies + uses: ./.github/actions/install + + - name: Lint code run: pnpm check:lint diff --git a/package.json b/package.json index 1750c792b..fecc334b6 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,6 @@ }, "engines": { "node": ">=18", - "packageManager": "pnpm@8" + "pnpm": ">=9" } } diff --git a/src/ui/layout/theme-selector.tsx b/src/ui/layout/theme-selector.tsx index 6bdbd304b..38dd7e7e8 100644 --- a/src/ui/layout/theme-selector.tsx +++ b/src/ui/layout/theme-selector.tsx @@ -1,4 +1,11 @@ -import { children, Component, ComponentProps, createSignal, JSX, onMount, Show } from "solid-js"; +import { + Component, + ComponentProps, + createSignal, + JSX, + onMount, + Show, +} from "solid-js"; import { computerDesktop, moon, sun } from "solid-heroicons/solid"; import { Select } from "@kobalte/core/select"; import { diff --git a/src/ui/page-issue-link.tsx b/src/ui/page-issue-link.tsx index 19a998ac5..21bbad7fa 100644 --- a/src/ui/page-issue-link.tsx +++ b/src/ui/page-issue-link.tsx @@ -1,4 +1,4 @@ -import { Component, createMemo, createSignal, onMount } from "solid-js"; +import { Component, createMemo } from "solid-js"; import { Icon } from "solid-heroicons"; import { exclamationTriangle } from "solid-heroicons/outline"; import { useI18n } from "~/i18n/i18n-context";