diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..15d4574 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + pull_request: + +env: + node_version: 20 + pnpm_version: 9 + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + with: + version: ${{ env.pnpm_version }} + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.node_version }} + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Run check + run: pnpm ci:check + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + with: + version: ${{ env.pnpm_version }} + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.node_version }} + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Build + run: pnpm build diff --git a/package.json b/package.json index 4af7d3a..df4485a 100644 --- a/package.json +++ b/package.json @@ -11,17 +11,11 @@ "type": "git", "url": "https://github.com/Hugos68/vite-plugin-pagefind" }, - "keywords": [ - "vite", - "vite-plugin", - "pagefind" - ], + "keywords": ["vite", "vite-plugin", "pagefind"], "publishConfig": { "access": "public" }, - "files": [ - "dist" - ], + "files": ["dist"], "exports": { ".": { "types": "./dist/plugins/pagefind.d.ts", @@ -35,8 +29,8 @@ "scripts": { "dev": "tsc -w", "build": "tsc", - "format": "biome format . --write", - "lint": "biome lint .", + "check": "biome check . --apply", + "ci:check": "biome check .", "release": "pnpm build && changeset publish" }, "dependencies": { diff --git a/src/internal/config.js b/src/internal/config.js index 11006ef..5865ac6 100644 --- a/src/internal/config.js +++ b/src/internal/config.js @@ -1,5 +1,5 @@ -import { resolve } from "node:path"; import { promises } from "node:fs"; +import { resolve } from "node:path"; import * as v from "valibot"; const PagefindConfigSchema = v.object({ diff --git a/src/internal/log.js b/src/internal/log.js index aeb3a4b..22d336f 100644 --- a/src/internal/log.js +++ b/src/internal/log.js @@ -1,4 +1,4 @@ -import { blue, yellow, red, bold } from "colorette"; +import { blue, bold, red, yellow } from "colorette"; import { PACKAGE_NAME } from "./constants.js"; /** diff --git a/src/plugins/pagefind-dev.js b/src/plugins/pagefind-dev.js index b731931..4701d18 100644 --- a/src/plugins/pagefind-dev.js +++ b/src/plugins/pagefind-dev.js @@ -1,10 +1,10 @@ -import { resolve } from "node:path"; -import { existsSync, promises } from "node:fs"; import { exec as exec_callback } from "node:child_process"; +import { existsSync, promises } from "node:fs"; +import { resolve } from "node:path"; import { promisify } from "node:util"; import { get_pagefind_config } from "../internal/config.js"; -import { log_info } from "../internal/log.js"; import { PACKAGE_NAME } from "../internal/constants.js"; +import { log_info } from "../internal/log.js"; const exec = promisify(exec_callback); diff --git a/src/plugins/pagefind.js b/src/plugins/pagefind.js index 4b27363..7d3775c 100644 --- a/src/plugins/pagefind.js +++ b/src/plugins/pagefind.js @@ -1,5 +1,5 @@ -import pagefind_dev from "./pagefind-dev.js"; import pagefind_build from "./pagefind-build.js"; +import pagefind_dev from "./pagefind-dev.js"; /** * Vite plugin to allow developing and building websites with Pagefind.