Skip to content

Commit 622f704

Browse files
committed
feat!: ship ESM-only, drop cjs build
1 parent 5023a2a commit 622f704

9 files changed

Lines changed: 30 additions & 65 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Vue DevTools v9 ships two hosts over one kit and one client. The Vite plugin is
1212

1313
## Stack & Structure
1414

15-
Monorepo (`pnpm` workspaces). ESM TypeScript. Library packages bundle with tsdown. Node **22.12+**, pnpm **12.5.1** (`packageManager`). Versions live in `pnpm-workspace.yaml` `catalog:` (and matching `overrides`); package entries use `"catalog:"`.
15+
Monorepo (`pnpm` workspaces). ESM TypeScript. Library packages bundle with tsdown and publish ESM only. Published packages require Node **22.12+**. Building this repository requires Node **22.18+ on 22.x, 24.11+ on 24.x, or 26+**, and pnpm **12.6.0** (`packageManager`). Versions live in `pnpm-workspace.yaml` `catalog:` (and matching `overrides`); package entries use `"catalog:"`.
1616

1717
### Packages
1818

‎docs/help/contributing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Development Setup
66

7-
You will need [Node.js](https://nodejs.org) **version 22.12+** and [pnpm](https://pnpm.io) **version 12.5.1**.
7+
Building Vue DevTools requires [Node.js](https://nodejs.org) **22.18+ on 22.x, 24.11+ on 24.x, or 26+**, and [pnpm](https://pnpm.io) **12.6.0**.
88

99
We also recommend [@antfu/ni](https://github.com/antfu/ni) for switching between repositories that use different package managers. Its `nr` command makes it easier to run package scripts.
1010

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"*.{json,jsonc,json5,yaml,yml,md,mdx,html,css,scss,sass,less,graphql,gql,toml}": "vp fmt"
8787
},
8888
"engines": {
89-
"node": ">=22.12.0"
89+
"node": "^22.18.0 || ^24.11.0 || >=26.0.0"
9090
},
9191
"packageManager": "pnpm@12.6.0"
9292
}

‎packages/devtools-api/package.json‎

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,17 @@
1616
],
1717
"type": "module",
1818
"sideEffects": false,
19-
"main": "./dist/index.cjs",
19+
"main": "./dist/index.mjs",
2020
"module": "./dist/index.mjs",
2121
"types": "./dist/index.d.mts",
2222
"exports": {
2323
".": {
2424
"node": {
25-
"import": {
26-
"types": "./dist/index-node.d.mts",
27-
"default": "./dist/index-node.mjs"
28-
},
29-
"require": {
30-
"types": "./dist/index-node.d.cts",
31-
"default": "./dist/index-node.cjs"
32-
}
25+
"types": "./dist/index-node.d.mts",
26+
"default": "./dist/index-node.mjs"
3327
},
34-
"import": {
35-
"types": "./dist/index.d.mts",
36-
"default": "./dist/index.mjs"
37-
},
38-
"require": {
39-
"types": "./dist/index.d.cts",
40-
"default": "./dist/index.cjs"
41-
}
28+
"types": "./dist/index.d.mts",
29+
"default": "./dist/index.mjs"
4230
},
4331
"./package.json": "./package.json"
4432
},
@@ -51,5 +39,8 @@
5139
},
5240
"devDependencies": {
5341
"tsdown": "catalog:"
42+
},
43+
"engines": {
44+
"node": ">=22.12.0"
5445
}
5546
}

‎packages/devtools-api/tsdown.config.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import { defineConfig } from 'tsdown'
33
export default defineConfig({
44
entry: ['src/index.ts', 'src/index-node.ts'],
55
dts: true,
6-
format: ['esm', 'cjs'],
6+
format: 'esm',
77
sourcemap: false,
88
clean: true,
9-
outputOptions(outputOptions, format) {
10-
if (format === 'cjs') outputOptions.exports = 'named'
11-
return outputOptions
12-
},
139
})

‎packages/kit/package.json‎

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,17 @@
1616
],
1717
"type": "module",
1818
"sideEffects": false,
19-
"main": "./dist/index.cjs",
19+
"main": "./dist/index.mjs",
2020
"module": "./dist/index.mjs",
2121
"types": "./dist/index.d.mts",
2222
"exports": {
2323
".": {
24-
"import": {
25-
"types": "./dist/index.d.mts",
26-
"default": "./dist/index.mjs"
27-
},
28-
"require": {
29-
"types": "./dist/index.d.cts",
30-
"default": "./dist/index.cjs"
31-
}
24+
"types": "./dist/index.d.mts",
25+
"default": "./dist/index.mjs"
3226
},
3327
"./client": {
34-
"import": {
35-
"types": "./dist/client.d.mts",
36-
"default": "./dist/client.mjs"
37-
},
38-
"require": {
39-
"types": "./dist/client.d.cts",
40-
"default": "./dist/client.cjs"
41-
}
28+
"types": "./dist/client.d.mts",
29+
"default": "./dist/client.mjs"
4230
},
4331
"./package.json": "./package.json"
4432
},
@@ -51,5 +39,8 @@
5139
},
5240
"devDependencies": {
5341
"tsdown": "catalog:"
42+
},
43+
"engines": {
44+
"node": ">=22.12.0"
5445
}
5546
}

‎packages/kit/tsdown.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from 'tsdown'
33
export default defineConfig({
44
entry: ['src/index.ts', 'src/client.ts'],
55
dts: true,
6-
format: ['esm', 'cjs'],
6+
format: 'esm',
77
minify: true,
88
sourcemap: false,
99
clean: true,

‎packages/vite/package.json‎

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,17 @@
2727
],
2828
"type": "module",
2929
"sideEffects": false,
30-
"main": "./dist/index.cjs",
30+
"main": "./dist/index.mjs",
3131
"module": "./dist/index.mjs",
3232
"types": "./dist/index.d.mts",
3333
"exports": {
3434
".": {
35-
"import": {
36-
"types": "./dist/index.d.mts",
37-
"default": "./dist/index.mjs"
38-
},
39-
"require": {
40-
"types": "./dist/index.d.cts",
41-
"default": "./dist/index.cjs"
42-
}
35+
"types": "./dist/index.d.mts",
36+
"default": "./dist/index.mjs"
4337
},
4438
"./client": {
45-
"import": {
46-
"types": "./dist/client.d.mts",
47-
"default": "./dist/client.mjs"
48-
},
49-
"require": {
50-
"types": "./dist/client.d.cts",
51-
"default": "./dist/client.cjs"
52-
}
39+
"types": "./dist/client.d.mts",
40+
"default": "./dist/client.mjs"
5341
},
5442
"./package.json": "./package.json"
5543
},
@@ -69,5 +57,8 @@
6957
"peerDependencies": {
7058
"@vitejs/devtools": "^0.7.5",
7159
"vite": "^8.3.0"
60+
},
61+
"engines": {
62+
"node": ">=22.12.0"
7263
}
7364
}

‎packages/vite/tsdown.config.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ import { defineConfig } from 'tsdown'
33
export default defineConfig({
44
entry: ['src/index.ts', 'src/client.ts', 'src/dirs.ts'],
55
dts: true,
6-
format: ['esm', 'cjs'],
6+
format: 'esm',
77
minify: true,
88
sourcemap: false,
99
clean: true,
10-
outputOptions(outputOptions, format) {
11-
if (format === 'cjs') outputOptions.exports = 'named'
12-
return outputOptions
13-
},
1410
})

0 commit comments

Comments
 (0)