Skip to content

Commit c9191f3

Browse files
bartvenemanclaude
andauthored
Migrate build tooling from Vite to tsdown (#46)
## Summary This PR replaces the Vite build system with tsdown, a more lightweight and specialized tool for building TypeScript/JavaScript libraries. The migration simplifies the build configuration and removes unnecessary build-related CI steps. ## Key Changes - **Removed Vite configuration**: Deleted `vite.config.js` which defined library build settings, entry points, and external dependencies - **Added tsdown configuration**: Created `tsdown.config.js` with equivalent build settings including ESM format, TypeScript definitions generation, and publint validation - **Updated build script**: Changed `package.json` build command from `vite build` to `tsdown` - **Removed lint-package CI job**: Eliminated the separate GitHub Actions workflow step that ran `npm run build` followed by `publint`, as tsdown now handles publint validation internally - **Updated dependencies**: Removed `vite` and `vite-plugin-dts` dev dependencies, added `tsdown` and `publint` as direct dev dependencies ## Notable Details - The build output configuration remains functionally equivalent (ESM format, same entry points) - External dependency handling (`@projectwallace/css-analyzer`) is preserved in the new configuration - TypeScript definitions generation is maintained via tsdown's built-in `dts` option - Package linting is now integrated into the build process rather than being a separate CI step https://claude.ai/code/session_01VzmRVmcLD7znsBCH2V5Hg7 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent d076be7 commit c9191f3

32 files changed

Lines changed: 6613 additions & 4965 deletions

.github/dependabot.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
version: 2
55
updates:
6-
- package-ecosystem: "npm"
7-
directory: "/"
6+
- package-ecosystem: 'npm'
7+
directory: '/'
88
schedule:
9-
interval: "weekly"
10-
- package-ecosystem: "github-actions"
11-
directory: "/"
9+
interval: 'weekly'
10+
- package-ecosystem: 'github-actions'
11+
directory: '/'
1212
schedule:
13-
interval: "weekly"
13+
interval: 'weekly'

.github/workflows/test.yml

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Test
4+
name: Tests
55

66
on:
77
push:
@@ -10,53 +10,68 @@ on:
1010
branches: [main]
1111

1212
jobs:
13-
lint-js:
14-
name: Lint JS
13+
test:
14+
name: Unit tests
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v6
19-
- name: Lint JS
20-
run: npx --yes oxlint@latest -D perf
17+
- uses: actions/checkout@v6
18+
- name: Use Node.js
19+
uses: actions/setup-node@v6
20+
with:
21+
node-version: 22
22+
- run: npm ci --ignore-scripts --no-audit --no-fund
23+
- run: npm test
24+
- name: Upload coverage reports to Codecov
25+
uses: codecov/codecov-action@v5.5.2
26+
with:
27+
token: ${{ secrets.CODECOV_TOKEN }}
28+
slug: projectwallace/css-code-quality
2129

22-
lint-package:
23-
name: Lint package
30+
check:
31+
name: Check types
2432
runs-on: ubuntu-latest
2533
steps:
26-
- name: Checkout code
27-
uses: actions/checkout@v6
34+
- uses: actions/checkout@v6
2835
- name: Use Node.js
2936
uses: actions/setup-node@v6
3037
with:
31-
cache: npm
32-
- run: npm install --no-fund --no-audit --ignore-scripts
38+
node-version: 22
39+
- run: npm ci --ignore-scripts --no-audit --no-fund
40+
- run: npm run check
41+
42+
build:
43+
name: Build
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v6
47+
- name: Use Node.js
48+
uses: actions/setup-node@v6
49+
with:
50+
node-version: 22
51+
- run: npm ci --ignore-scripts --no-audit --no-fund
3352
- run: npm run build
34-
- name: Run publint
35-
run: npx --yes publint
3653

37-
check-types:
38-
name: Check types
54+
lint:
55+
name: Lint
3956
runs-on: ubuntu-latest
4057
steps:
4158
- name: Checkout code
4259
uses: actions/checkout@v6
4360
- name: Use Node.js
4461
uses: actions/setup-node@v6
4562
with:
46-
cache: npm
47-
- run: npm install --no-fund --no-audit --ignore-scripts
48-
- name: Check types
49-
run: npm run check
63+
node-version: 22
64+
- run: npm ci --ignore-scripts --no-audit --no-fund
65+
- run: npm run lint
5066

51-
test:
52-
name: Unit tests
67+
npm-audit:
68+
name: Audit packages
5369
runs-on: ubuntu-latest
5470
steps:
55-
- uses: actions/checkout@v6
71+
- name: Checkout code
72+
uses: actions/checkout@v6
5673
- name: Use Node.js
5774
uses: actions/setup-node@v6
5875
with:
59-
cache: npm
60-
- run: npm install --no-fund --no-audit --ignore-scripts
61-
- run: npm run build
62-
- run: npm test
76+
node-version: 22
77+
- run: npm audit --audit-level=high

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
coverage
12
dist
23
node_modules
34
.DS_Store

.oxfmtrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"ignorePatterns": [],
4+
"useTabs": true,
5+
"semi": false,
6+
"singleQuote": true
7+
}

0 commit comments

Comments
 (0)