Skip to content

Commit 3519102

Browse files
build: upgrade dev tooling (#34)
1 parent 97ef609 commit 3519102

18 files changed

Lines changed: 2771 additions & 6297 deletions

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/cd.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,14 @@ jobs:
1515
name: Release
1616
runs-on: ubuntu-latest
1717
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v4
20-
- name: Setup Node
21-
uses: actions/setup-node@v4
18+
- uses: actions/checkout@v6
19+
- uses: pnpm/action-setup@v4
20+
- uses: actions/setup-node@v6
2221
with:
2322
node-version: 24
24-
cache: npm
25-
- name: Install dependencies
26-
run: npm ci
27-
- name: Verify dependency signatures
28-
run: npm audit signatures
29-
- name: Publish release
30-
run: npx semantic-release@25
23+
cache: pnpm
24+
- run: pnpm install
25+
- run: npm audit signatures
26+
- run: pnpx semantic-release@25
3127
env:
3228
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/ci.yaml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,45 @@ on: [pull_request]
44
jobs:
55
build:
66
name: Build
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v6
10+
- uses: pnpm/action-setup@v4
11+
- uses: actions/setup-node@v6
12+
with:
13+
node-version: 24
14+
cache: pnpm
15+
- run: pnpm install
16+
- run: pnpm build
17+
18+
lint:
19+
name: Lint
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v6
23+
- uses: pnpm/action-setup@v4
24+
- uses: actions/setup-node@v6
25+
with:
26+
node-version: 24
27+
cache: pnpm
28+
- run: pnpm install
29+
- run: pnpm lint
30+
- run: pnpm format:check
31+
32+
test:
33+
name: Test
734
strategy:
835
matrix:
936
node-version: [18, 20, 22, 24]
1037
os: [ubuntu-latest, windows-latest, macos-latest]
38+
fail-fast: false
1139
runs-on: ${{ matrix.os }}
1240
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v4
15-
- name: Setup Node
16-
uses: actions/setup-node@v4
41+
- uses: actions/checkout@v6
42+
- uses: pnpm/action-setup@v4
43+
- uses: actions/setup-node@v6
1744
with:
1845
node-version: ${{ matrix.node-version }}
19-
cache: npm
20-
- name: Install dependencies
21-
run: npm ci
22-
- name: Build and validate
23-
run: npm run prepack
46+
cache: pnpm
47+
- run: pnpm install
48+
- run: pnpm test

.github/workflows/pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- name: Lint PR title
2020
id: lint
21-
uses: amannn/action-semantic-pull-request@v5
21+
uses: amannn/action-semantic-pull-request@v6
2222
env:
2323
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2424

.prettierignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
/dist
2-
.eslintcache
1+
pnpm-lock.yaml

.prettierrc.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
2-
"plugins": ["@trivago/prettier-plugin-sort-imports"],
3-
"importOrder": ["^[./]"],
4-
"importOrderGroupNamespaceSpecifiers": true,
2+
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
3+
"importOrder": ["<BUILTIN_MODULES>", "", "<THIRD_PARTY_MODULES>", "", "^[.]"],
4+
"importOrderTypeScriptVersion": "5.7.3",
55
"printWidth": 100,
6-
"importOrderSeparation": true,
7-
"importOrderSortSpecifiers": true,
86
"trailingComma": "all"
97
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ A simple Vite plugin for serving arbitrary static files that aren't in your `pub
99
```typescript
1010
// vite.config.ts
1111
import path from "path";
12+
1213
import { defineConfig } from "vite";
1314
import serveStatic from "vite-plugin-serve-static";
1415

eslint.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// @ts-check
2+
3+
import path from "path";
4+
import { fileURLToPath } from "url";
5+
6+
import { includeIgnoreFile } from "@eslint/compat";
7+
import js from "@eslint/js";
8+
import prettier from "eslint-config-prettier";
9+
import { defineConfig } from "eslint/config";
10+
import ts from "typescript-eslint";
11+
12+
const __dirname = fileURLToPath(path.dirname(import.meta.url));
13+
14+
export default defineConfig([
15+
includeIgnoreFile(path.join(__dirname, ".gitignore")),
16+
js.configs.recommended,
17+
...ts.configs.recommended,
18+
prettier,
19+
]);

lib/__tests__/middleware.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs, { ReadStream, Stats } from "fs";
22
import { ServerResponse } from "http";
33
import path from "path";
4+
45
import { Connect } from "vite";
56
import { beforeEach, describe, expect, it, vi } from "vitest";
67

0 commit comments

Comments
 (0)