From 18bdc9c52dead22dfb764688185b0f4b30792cd6 Mon Sep 17 00:00:00 2001 From: Jorge Luis Calleja Alvarado Date: Tue, 17 Dec 2024 21:58:07 -0600 Subject: [PATCH] refactor(core): Use biomejs and fix next-intl --- .github/workflows/playwright.yml | 19 +++++++------- .github/workflows/pull_request_stats.yml | 32 +++++++++++++----------- .github/workflows/release.yml | 32 +++++++++++++----------- biome.json | 2 +- 4 files changed, 47 insertions(+), 38 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 39aebdf..936b462 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -24,19 +24,20 @@ jobs: timeout-minutes: 60 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 2 + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + + - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version-file: package.json + cache: "pnpm" - - name: 🔥 Setup pnpm - run: | - corepack enable - corepack prepare pnpm@${{ env.PNPM_VERSION}} --activate + - name: 🔥 Setup corepack + run: corepack enable - name: 📦 Install Dependencies run: | diff --git a/.github/workflows/pull_request_stats.yml b/.github/workflows/pull_request_stats.yml index 74d7289..150afd3 100644 --- a/.github/workflows/pull_request_stats.yml +++ b/.github/workflows/pull_request_stats.yml @@ -7,8 +7,6 @@ on: - '**.md' env: - PNPM_VERSION: ${{ vars.PNPM_VERSION }} - NODE_VERSION: ${{ vars.NODE_VERSION }} NEXT_PUBLIC_API_URL_BASE: ${{ vars.NEXT_PUBLIC_API_URL_BASE }} NEXT_PUBLIC_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }} SITE_NAME: ${{ vars.SITE_NAME }} @@ -29,28 +27,34 @@ jobs: - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - uses: actions/checkout@v3 - with: - fetch-depth: 2 + - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version-file: package.json + cache: "pnpm" - - name: 🔥 Setup pnpm - run: | - corepack enable - corepack prepare pnpm@${{ env.PNPM_VERSION}} --activate + - name: 🔥 Setup corepack + run: corepack enable + + - name: 📁 Cache + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- - name: 📦 Install Dependencies run: | - pnpm install --no-frozen-lockfile + pnpm --version && pnpm install --frozen-lockfile env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: 💣 build + - name: 💣 Build Application run: pnpm build - - name: 💅 Lint + - name: 💅 Run Linter run: pnpm lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35b3a18..91e3cbc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,6 @@ on: - main env: - PNPM_VERSION: ${{ vars.PNPM_VERSION }} - NODE_VERSION: ${{ vars.NODE_VERSION }} NEXT_PUBLIC_API_URL_BASE: ${{ vars.NEXT_PUBLIC_API_URL_BASE }} NEXT_PUBLIC_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }} SITE_NAME: ${{ vars.SITE_NAME }} @@ -34,30 +32,36 @@ jobs: - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - uses: actions/checkout@v3 - with: - fetch-depth: 2 + - uses: actions/checkout@v4 - name: Setup Node.js environment - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version-file: package.json + cache: "pnpm" - - name: 🔥 Setup pnpm - run: | - corepack enable - corepack prepare pnpm@${PNPM_VERSION} --activate + - name: 🔥 Setup corepack + run: corepack enable + + - name: 📁 Cache + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- - name: 📦 Install Dependencies run: | - pnpm install --no-frozen-lockfile + pnpm --version && pnpm install --frozen-lockfile env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: 💣 build + - name: 💣 Build Application run: pnpm build - - name: 💅 Lint + - name: 💅 Run Linter run: pnpm lint - name: Create Release Pull Request diff --git a/biome.json b/biome.json index 417e896..5d2b949 100644 --- a/biome.json +++ b/biome.json @@ -7,7 +7,7 @@ }, "files": { "ignoreUnknown": false, - "ignore": [".next/**", "public/**", "node_modules/**", "pnpm-lock.yaml", "playwright-report/**"] + "ignore": [".next/**", "public/**", "node_modules/**", "pnpm-lock.yaml", "playwright-report/**", ".changeset/**"] }, "formatter": { "enabled": true,