Skip to content

Commit f160e8f

Browse files
committedFeb 22, 2025
feat!: drop CJS build, now it's ESM-only
1 parent 859b500 commit f160e8f

File tree

8 files changed

+640
-1199
lines changed

8 files changed

+640
-1199
lines changed
 

‎.npmrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
shamefully-hoist=true
22
ignore-workspace-root-check=true
33
strict-peer-dependencies=false
4-
side-effects-cache=false
4+
side-effects-cache=false
5+
shell-emulator=true

‎build.config.ts

+5-12
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ export default defineBuildConfig({
77
'src/dirs',
88
],
99
clean: false,
10-
declaration: true,
10+
declaration: 'node16',
1111
externals: [
1212
'vite',
1313
'@nuxt/kit',
1414
'@nuxt/schema',
1515
],
1616
rollup: {
17-
emitCJS: true,
18-
inlineDependencies: true,
17+
inlineDependencies: [
18+
'@antfu/utils',
19+
],
1920
dts: {
2021
respectExternal: true,
2122
},
@@ -24,24 +25,16 @@ export default defineBuildConfig({
2425
'build:done': async () => {
2526
console.log('\nChecking client directory...')
2627
const [
27-
{ createRequire },
2828
lstat,
2929
esmDirClient,
3030
] = await Promise.all([
31-
import('node:module').then(m => m.default || m),
3231
import('node:fs/promises').then(m => m.lstat),
3332
import('./dist/dirs.mjs').then(m => m.DIR_CLIENT),
3433
])
35-
let stats = await lstat(esmDirClient)
34+
const stats = await lstat(esmDirClient)
3635
if (!stats.isDirectory()) {
3736
throw new Error('ESM: Client directory does not exist, review src/dirs.ts module!')
3837
}
39-
const cjsDirClient = createRequire(import.meta.url)('./dist/dirs.cjs').DIR_CLIENT
40-
stats = await lstat(cjsDirClient)
41-
if (!stats.isDirectory()) {
42-
throw new Error('CJS: Client directory does not exist, review src/dirs.ts module!')
43-
}
44-
console.log('Client directory ok!')
4538
},
4639
},
4740
})

‎package.json

+28-61
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vite-plugin-inspect",
33
"type": "module",
44
"version": "10.3.0",
5-
"packageManager": "pnpm@10.4.0",
5+
"packageManager": "pnpm@10.4.1",
66
"description": "Inspect the intermediate state of Vite plugins",
77
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
88
"license": "MIT",
@@ -19,56 +19,28 @@
1919
"vite-plugin"
2020
],
2121
"exports": {
22-
".": {
23-
"import": {
24-
"types": "./dist/index.d.mts",
25-
"default": "./dist/index.mjs"
26-
},
27-
"require": {
28-
"types": "./dist/index.d.cts",
29-
"default": "./dist/index.cjs"
30-
}
31-
},
32-
"./nuxt": {
33-
"import": {
34-
"types": "./dist/nuxt.d.mts",
35-
"default": "./dist/nuxt.mjs"
36-
},
37-
"require": {
38-
"types": "./dist/nuxt.d.cts",
39-
"default": "./dist/nuxt.cjs"
40-
}
41-
},
22+
".": "./dist/index.mjs",
23+
"./nuxt": "./dist/nuxt.mjs",
4224
"./*": "./*"
4325
},
44-
"main": "dist/index.cjs",
26+
"main": "dist/index.mjs",
4527
"module": "dist/index.mjs",
46-
"types": "dist/index.d.ts",
47-
"typesVersions": {
48-
"*": {
49-
"*": [
50-
"./dist/*",
51-
"./*"
52-
]
53-
}
54-
},
28+
"types": "dist/index.d.mts",
5529
"files": [
56-
"*.d.ts",
5730
"dist"
5831
],
5932
"engines": {
6033
"node": ">=14"
6134
},
6235
"scripts": {
63-
"build": "rimraf dist && pnpm run --sequential /^build:/ && esno ./scripts/postbuild.ts && pnpm run test:attw",
36+
"build": "rimraf dist && pnpm run --sequential /^build:/",
6437
"build:client": "vite build src/client",
6538
"build:js": "unbuild",
66-
"dev": "nr stub && cross-env INSPECT_DEV=true vite src/client",
39+
"dev": "nr stub && INSPECT_DEV=true vite src/client",
6740
"dev:client": "vite build src/client --watch",
6841
"stub": "unbuild --stub",
6942
"lint": "eslint .",
7043
"typecheck": "vue-tsc --noEmit",
71-
"test:attw": "attw --pack",
7244
"prepublishOnly": "pnpm run build",
7345
"release": "bumpp && pnpm publish"
7446
},
@@ -81,68 +53,63 @@
8153
}
8254
},
8355
"dependencies": {
84-
"ansis": "^3.14.0",
56+
"ansis": "^3.16.0",
8557
"debug": "^4.4.0",
8658
"error-stack-parser-es": "^1.0.5",
59+
"ohash": "^2.0.4",
8760
"open": "^10.1.0",
88-
"sirv": "^3.0.0"
61+
"perfect-debounce": "^1.0.0",
62+
"sirv": "^3.0.1",
63+
"unplugin-utils": "^0.2.0",
64+
"vite-dev-rpc": "^1.0.7"
8965
},
9066
"devDependencies": {
91-
"@antfu/eslint-config": "^4.2.0",
67+
"@antfu/eslint-config": "^4.3.0",
9268
"@antfu/ni": "^23.3.1",
93-
"@antfu/utils": "^8.1.0",
94-
"@arethetypeswrong/cli": "^0.17.3",
95-
"@iconify-json/catppuccin": "^1.2.8",
96-
"@iconify/json": "^2.2.306",
69+
"@antfu/utils": "^9.1.0",
70+
"@iconify/json": "^2.2.309",
9771
"@nuxt/kit": "^3.15.4",
98-
"@rollup/pluginutils": "^5.1.4",
9972
"@types/codemirror": "^5.60.15",
10073
"@types/debug": "^4.1.12",
101-
"@types/node": "^22.13.2",
102-
"@unocss/eslint-config": "^65.4.3",
103-
"@unocss/eslint-plugin": "^65.4.3",
74+
"@types/node": "^22.13.5",
75+
"@unocss/eslint-config": "^66.0.0",
76+
"@unocss/eslint-plugin": "^66.0.0",
10477
"@vitejs/plugin-vue": "^5.2.1",
10578
"@vue/compiler-sfc": "^3.5.13",
106-
"@vueuse/core": "^12.5.0",
107-
"@vueuse/router": "^12.5.0",
79+
"@vueuse/core": "^12.7.0",
80+
"@vueuse/router": "^12.7.0",
10881
"bumpp": "^10.0.3",
10982
"codemirror": "^5.65.16",
11083
"codemirror-theme-vars": "^0.1.2",
11184
"comlink": "^4.4.2",
112-
"cross-env": "^7.0.3",
11385
"diff-match-patch-es": "^1.0.1",
11486
"echarts": "^5.6.0",
115-
"eslint": "^9.20.1",
116-
"esno": "^4.8.0",
87+
"eslint": "^9.21.0",
11788
"floating-vue": "^5.2.2",
11889
"fuse.js": "^7.1.0",
11990
"lint-staged": "^15.4.3",
120-
"ohash": "^1.1.4",
12191
"pathe": "^2.0.3",
122-
"perfect-debounce": "^1.0.0",
12392
"pinia": "^3.0.1",
124-
"prism-theme-vars": "^0.2.5",
12593
"rimraf": "^6.0.1",
12694
"simple-git-hooks": "^2.11.1",
12795
"splitpanes": "^3.1.8",
12896
"typescript": "~5.7.3",
12997
"unbuild": "^3.3.1",
130-
"unocss": "^65.4.3",
131-
"unplugin-auto-import": "^19.0.0",
132-
"unplugin-vue-components": "^28.0.0",
98+
"unocss": "^66.0.0",
99+
"unplugin-auto-import": "^19.1.0",
100+
"unplugin-vue-components": "^28.4.0",
133101
"unplugin-vue-router": "^0.11.2",
134102
"vis-data": "7.1.7",
135103
"vis-network": "9.1.6",
136-
"vite": "^6.1.0",
137-
"vite-dev-rpc": "^1.0.7",
104+
"vite": "^6.1.1",
138105
"vite-hot-client": "^2.0.4",
139106
"vue": "^3.5.13",
140107
"vue-echarts": "^7.0.3",
141108
"vue-router": "^4.5.0",
142-
"vue-tsc": "^2.2.0"
109+
"vue-tsc": "^2.2.2"
143110
},
144111
"resolutions": {
145-
"vite": "^6.1.0"
112+
"vite": "^6.1.1"
146113
},
147114
"simple-git-hooks": {
148115
"pre-commit": "npx lint-staged"

‎playground/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@vitejs/plugin-vue": "^5.2.1",
1818
"serve": "^14.2.4",
1919
"typescript": "^5.7.3",
20-
"vite": "^6.1.0",
20+
"vite": "^6.1.1",
2121
"vite-plugin-inspect": "workspace:*"
2222
}
2323
}

‎pnpm-lock.yaml

+602-1,012
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/postbuild.ts

-111
This file was deleted.

‎src/client/components.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// @ts-nocheck
33
// Generated by unplugin-vue-components
44
// Read more: https://github.com/vuejs/core/pull/3399
5+
// biome-ignore lint: disable
56
export {}
67

78
/* prettier-ignore */

‎src/node/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Metadata, ModuleInfo, PluginMetricInfo, QueryEnv, ResolveIdInfo, S
33
import type { ViteInspectOptions } from './options'
44
import { Buffer } from 'node:buffer'
55
import { resolve } from 'node:path'
6-
import { createFilter } from '@rollup/pluginutils'
6+
import { createFilter } from 'unplugin-utils'
77
import { DUMMY_LOAD_PLUGIN_NAME } from './constants'
88
import { removeVersionQuery, serializePlugin } from './utils'
99

0 commit comments

Comments
 (0)
Please sign in to comment.