diff --git a/AGENTS.md b/AGENTS.md index b64555fe1a..96014fa1f3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -48,12 +48,12 @@ website/ # demo site (Vite + TanStack Router) - **Light/dark mode** — handled via CSS `light-dark()` + `color-scheme`, not JS. - **Accessibility first** — ARIA attributes (e.g. `aria-colindex`, `aria-rowindex`, `aria-selected`, roles) are required. Tests query by role. - **Formatting** — oxfmt (not Prettier). **Linting** — ESLint (must pass with zero warnings). -- **Build** — Rolldown bundles library to `lib/`; `ecij` plugin prefixes classes with `rdg-{version}-` (dots→dashes) to avoid cross-version conflicts. +- **Build** — tsdown bundles library to `lib/`; `ecij` plugin prefixes classes with `rdg-{version}-` (dots→dashes) to avoid cross-version conflicts. ## Testing -- 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()`. -- Test helpers in `test/browser/utils.tsx`: `setup()`, `getRowWithCell()`, `getCellsAtRowIndex()`, `validateCellPosition()`, `scrollGrid()`, `tabIntoGrid()`, `testCount()`, `testRowCount()`. +- 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()`. +- Test helpers in `test/browser/utils.tsx`: `setup()`, `getRowWithCell()`, `getCellsAtRowIndex()`, `validateCellPosition()`, `scrollGrid()`, `safeTab()`, `testCount()`, `testRowCount()`. - `test/failOnConsole.ts` fails tests on unexpected console warnings/errors. - **Never run visual regression tests** — screenshots are environment-dependent so visual regression tests must run in CI only. diff --git a/package.json b/package.json index da1256623f..9e94431d6b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "start": "vite serve --clearScreen false", "preview": "vite preview", "build:website": "vite build", - "build": "rolldown -c", + "build": "tsdown", "test": "vitest run --project browser --project node", "test:watch": "vitest watch --project browser --project node", "test:ci": "vitest run", @@ -52,6 +52,7 @@ "@faker-js/faker": "^10.3.0", "@tanstack/react-router": "^1.166.7", "@tanstack/router-plugin": "^1.166.7", + "@tsdown/css": "^0.21.7", "@types/node": "^25.5.0", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", @@ -73,8 +74,7 @@ "postcss": "^8.5.2", "react": "^19.2.4", "react-dom": "^19.2.4", - "rolldown": "1.0.0-rc.5", - "rolldown-plugin-dts": "^0.22.5", + "tsdown": "^0.21.7", "typescript": "~6.0.1-rc", "typescript-eslint": "^8.57.0", "vite": "^8.0.0", diff --git a/tsconfig.vite.json b/tsconfig.vite.json index 54f86f05d6..57b2050a8e 100644 --- a/tsconfig.vite.json +++ b/tsconfig.vite.json @@ -4,5 +4,5 @@ "lib": ["ESNext", "DOM"], "skipLibCheck": true }, - "include": ["package.json", "rolldown.config.ts", "vite.config.ts"] + "include": ["package.json", "tsdown.config.ts", "vite.config.ts"] } diff --git a/rolldown.config.ts b/tsdown.config.ts similarity index 50% rename from rolldown.config.ts rename to tsdown.config.ts index 23394ef5af..ac943e1849 100644 --- a/rolldown.config.ts +++ b/tsdown.config.ts @@ -1,28 +1,27 @@ -import { isAbsolute } from 'node:path'; import { ecij } from 'ecij/plugin'; -import { defineConfig } from 'rolldown'; -import { dts } from 'rolldown-plugin-dts'; +import { defineConfig } from 'tsdown'; import pkg from './package.json' with { type: 'json' }; export default defineConfig({ - input: './src/index.ts', - output: { - dir: 'lib', - cssEntryFileNames: 'styles.css', - sourcemap: true, - cleanDir: true - }, + outDir: 'lib', platform: 'neutral', - external: (id) => !id.startsWith('.') && !isAbsolute(id), + sourcemap: true, + deps: { + skipNodeModulesBundle: true + }, + css: { + fileName: 'styles.css' + }, + dts: { + build: true, + tsconfig: './tsconfig.src.json' + }, plugins: [ ecij({ // We add the package version as prefix to avoid style conflicts // between multiple versions of RDG on the same page classPrefix: `rdg-${pkg.version.replaceAll('.', '-')}-` - }), - dts({ - tsconfig: './tsconfig.src.json' }) ] });