Skip to content

Commit 605331b

Browse files
chore: use rolldown for building and testing (#360)
1. Replace `tsup` with `tsdown`. - The tsdown config needs `fixedExtensions` off so that `.js` files are generated instead of `.mjs`. 2. Replace `vite` with `rolldown-vite`. - Override so `vitest` uses it too. 3. Use import attributes when importing `package.json` in `index.ts`, since tsdown seems to correctly inline only the desired values instead of the entire file contents.
1 parent c0d992d commit 605331b

File tree

7 files changed

+641
-937
lines changed

7 files changed

+641
-937
lines changed

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The plugin provides 40+ rules that help developers avoid common pitfalls, memory
2020
- **TypeScript**: Full TypeScript support with strict type checking
2121
- **RxJS**: Target library for reactive programming patterns
2222
- **Vitest**: Modern testing framework for unit tests
23-
- **tsup**: Build tool for dual ESM/CommonJS output
23+
- **tsdown**: Build tool using modern Rolldown
2424

2525
## Historical Context
2626

@@ -60,7 +60,7 @@ eslint-plugin-rxjs-x/
6060
├── LICENSE
6161
├── package.json
6262
├── README.md
63-
├── tsup.config.ts # Build configuration
63+
├── tsdown.config.ts # Build configuration
6464
├── vitest.config.mts # Test configuration
6565
└── yarn.lock # Packages lockfile
6666
```

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"dist"
4141
],
4242
"scripts": {
43-
"build": "tsup",
43+
"build": "tsdown",
4444
"lint": "yarn lint-js && yarn lint-docs && yarn lint-eslint-docs",
4545
"lint-js": "eslint",
4646
"lint-docs": "markdownlint-cli2 \"**/*.md\" \"#node_modules\"",
@@ -88,12 +88,15 @@
8888
"eslint-plugin-n": "^17.23.2",
8989
"markdownlint-cli2": "~0.19.0",
9090
"rxjs": "^7.8.2",
91-
"tsup": "8.5.1",
91+
"tsdown": "^0.20.3",
9292
"typescript": "~5.9.3",
9393
"typescript-eslint": "^8.56.0",
94-
"vite": "^7.3.1",
94+
"vite": "npm:rolldown-vite@~7.3.1",
9595
"vitest": "^4.0.18"
9696
},
97+
"resolutions": {
98+
"vite": "npm:rolldown-vite@~7.3.1"
99+
},
97100
"engines": {
98101
"node": "^20.19.0 || ^22.13.0 || >=24"
99102
}

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { TSESLint } from '@typescript-eslint/utils';
22
import type { ESLint, Rule } from 'eslint';
3-
import { name, version } from '../package.json';
3+
import packageJson from '../package.json' with { type: 'json' };
44
import { createRecommendedConfig } from './configs/recommended';
55
import { createStrictConfig } from './configs/strict';
66

@@ -98,8 +98,8 @@ const allRules = {
9898

9999
const plugin = {
100100
meta: {
101-
name,
102-
version,
101+
name: packageJson.name,
102+
version: packageJson.version,
103103
namespace: 'rxjs-x',
104104
},
105105
/** Compatibility with `defineConfig` until https://github.com/typescript-eslint/typescript-eslint/issues/11543 is addressed. */

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
/* Output */
1717
"noEmit": true,
1818
"declaration": true,
19-
"declarationMap": true,
20-
"sourceMap": true,
19+
"declarationMap": false,
20+
"sourceMap": false,
2121
"importHelpers": true,
2222

2323
/* Rules */

tsdown.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from 'tsdown';
2+
3+
export default defineConfig({
4+
fixedExtension: false,
5+
});

tsup.config.ts

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

0 commit comments

Comments
 (0)