Skip to content

Commit 37a841f

Browse files
authored
Migrate from rolldown to tsdown (#4025)
1 parent b4c2633 commit 37a841f

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ website/ # demo site (Vite + TanStack Router)
4848
- **Light/dark mode** — handled via CSS `light-dark()` + `color-scheme`, not JS.
4949
- **Accessibility first** — ARIA attributes (e.g. `aria-colindex`, `aria-rowindex`, `aria-selected`, roles) are required. Tests query by role.
5050
- **Formatting** — oxfmt (not Prettier). **Linting** — ESLint (must pass with zero warnings).
51-
- **Build**Rolldown bundles library to `lib/`; `ecij` plugin prefixes classes with `rdg-{version}-` (dots→dashes) to avoid cross-version conflicts.
51+
- **Build**tsdown bundles library to `lib/`; `ecij` plugin prefixes classes with `rdg-{version}-` (dots→dashes) to avoid cross-version conflicts.
5252

5353
## Testing
5454

55-
- Browser tests use `vitest/browser` + Playwright. `test/setupBrowser.ts` configures `page.render()` via `vitest-browser-react` and registers custom locators via `locators.extend()` — prefer `page.getGrid()`, `page.getCell({ name })`, `page.getRow()`, `page.getHeaderCell()`, `page.getSelectedCell()`, etc. over raw `page.getByRole()`.
56-
- Test helpers in `test/browser/utils.tsx`: `setup()`, `getRowWithCell()`, `getCellsAtRowIndex()`, `validateCellPosition()`, `scrollGrid()`, `tabIntoGrid()`, `testCount()`, `testRowCount()`.
55+
- Browser tests use `vitest/browser` + Playwright. `test/setupBrowser.ts` configures `page.render()` via `vitest-browser-react` and registers custom locators via `locators.extend()` — prefer `page.getGrid()`, `page.getCell({ name })`, `page.getRow()`, `page.getHeaderCell()`, `page.getActiveCell()`, etc. over raw `page.getByRole()`.
56+
- Test helpers in `test/browser/utils.tsx`: `setup()`, `getRowWithCell()`, `getCellsAtRowIndex()`, `validateCellPosition()`, `scrollGrid()`, `safeTab()`, `testCount()`, `testRowCount()`.
5757
- `test/failOnConsole.ts` fails tests on unexpected console warnings/errors.
5858
- **Never run visual regression tests** — screenshots are environment-dependent so visual regression tests must run in CI only.
5959

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"start": "vite serve --clearScreen false",
3636
"preview": "vite preview",
3737
"build:website": "vite build",
38-
"build": "rolldown -c",
38+
"build": "tsdown",
3939
"test": "vitest run --project browser --project node",
4040
"test:watch": "vitest watch --project browser --project node",
4141
"test:ci": "vitest run",
@@ -52,6 +52,7 @@
5252
"@faker-js/faker": "^10.3.0",
5353
"@tanstack/react-router": "^1.166.7",
5454
"@tanstack/router-plugin": "^1.166.7",
55+
"@tsdown/css": "^0.21.7",
5556
"@types/node": "^25.5.0",
5657
"@types/react": "^19.2.14",
5758
"@types/react-dom": "^19.2.3",
@@ -73,8 +74,7 @@
7374
"postcss": "^8.5.2",
7475
"react": "^19.2.4",
7576
"react-dom": "^19.2.4",
76-
"rolldown": "1.0.0-rc.5",
77-
"rolldown-plugin-dts": "^0.22.5",
77+
"tsdown": "^0.21.7",
7878
"typescript": "~6.0.1-rc",
7979
"typescript-eslint": "^8.57.0",
8080
"vite": "^8.0.0",

tsconfig.vite.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"lib": ["ESNext", "DOM"],
55
"skipLibCheck": true
66
},
7-
"include": ["package.json", "rolldown.config.ts", "vite.config.ts"]
7+
"include": ["package.json", "tsdown.config.ts", "vite.config.ts"]
88
}
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
import { isAbsolute } from 'node:path';
21
import { ecij } from 'ecij/plugin';
3-
import { defineConfig } from 'rolldown';
4-
import { dts } from 'rolldown-plugin-dts';
2+
import { defineConfig } from 'tsdown';
53

64
import pkg from './package.json' with { type: 'json' };
75

86
export default defineConfig({
9-
input: './src/index.ts',
10-
output: {
11-
dir: 'lib',
12-
cssEntryFileNames: 'styles.css',
13-
sourcemap: true,
14-
cleanDir: true
15-
},
7+
outDir: 'lib',
168
platform: 'neutral',
17-
external: (id) => !id.startsWith('.') && !isAbsolute(id),
9+
sourcemap: true,
10+
deps: {
11+
skipNodeModulesBundle: true
12+
},
13+
css: {
14+
fileName: 'styles.css'
15+
},
16+
dts: {
17+
build: true,
18+
tsconfig: './tsconfig.src.json'
19+
},
1820
plugins: [
1921
ecij({
2022
// We add the package version as prefix to avoid style conflicts
2123
// between multiple versions of RDG on the same page
2224
classPrefix: `rdg-${pkg.version.replaceAll('.', '-')}-`
23-
}),
24-
dts({
25-
tsconfig: './tsconfig.src.json'
2625
})
2726
]
2827
});

0 commit comments

Comments
 (0)