Skip to content

Commit 5e0467b

Browse files
authored
feat!: drop CJS build, now it's ESM-only (#4581)
1 parent efc19f5 commit 5e0467b

28 files changed

+258
-415
lines changed

.attw.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"profile": "node16",
3+
"ignoreRules": ["cjs-resolves-to-esm"]
4+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.log
66
*.tgz
77
components.d.ts
8+
components.d.[cm]ts
89
dist
910
index.json
1011
indexes.json

attw-esm-only.json

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

meta/packages.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export const packages: PackageManifest[] = [
3636
manualImport: true,
3737
addon: true,
3838
iife: false,
39-
cjs: false,
4039
utils: true,
4140
target: 'node14',
4241
external: [

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vueuse/monorepo",
33
"type": "module",
4-
"version": "12.8.2",
4+
"version": "13.0.0-beta.2",
55
"private": true,
66
"packageManager": "pnpm@10.6.2",
77
"description": "Collection of essential Vue Composition Utilities",
@@ -14,7 +14,7 @@
1414
"clean": "tsx scripts/clean.ts",
1515
"dev": "nr update && nr docs",
1616
"docs": "vitepress dev packages --open",
17-
"docs:build": "nr update:full && vitepress build packages && nr build:redirects",
17+
"docs:build": "nr update:full && nr build && vitepress build packages && nr build:redirects",
1818
"docs:serve": "vitepress serve packages",
1919
"lint": "eslint --cache .",
2020
"lint:fix": "nr lint --fix",

packages/.vitepress/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default defineConfig({
4343
componentPrefix: '',
4444
}),
4545
],
46-
dts: resolve(__dirname, 'components.d.ts'),
46+
dts: resolve(__dirname, 'components.d.mts'),
4747
transformer: 'vue3',
4848
}),
4949
Icons({

packages/components/package.json

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vueuse/components",
33
"type": "module",
4-
"version": "12.8.2",
4+
"version": "13.0.0-beta.2",
55
"description": "Renderless components for VueUse",
66
"author": "Jacob Clevenger<https://github.com/wheatjs>",
77
"license": "MIT",
@@ -21,34 +21,29 @@
2121
],
2222
"sideEffects": false,
2323
"exports": {
24-
".": {
25-
"import": "./index.mjs",
26-
"require": "./index.cjs"
27-
},
24+
".": "./index.mjs",
2825
"./*": "./*"
2926
},
30-
"main": "./index.cjs",
27+
"main": "./index.mjs",
3128
"module": "./index.mjs",
3229
"unpkg": "./index.iife.min.js",
3330
"jsdelivr": "./index.iife.min.js",
34-
"types": "./index.d.ts",
31+
"types": "./index.d.mts",
3532
"files": [
36-
"*.cjs",
37-
"*.d.cts",
3833
"*.d.mts",
39-
"*.d.ts",
4034
"*.js",
4135
"*.mjs"
4236
],
4337
"scripts": {
4438
"build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild",
4539
"prepack": "pnpm run build",
46-
"test:attw": "attw --pack .",
47-
"test:attw-esm-only": "attw --pack --config-path ../../attw-esm-only.json ."
40+
"test:attw": "attw --pack --config-path ../../.attw.json ."
41+
},
42+
"peerDependencies": {
43+
"vue": "^3.5.0"
4844
},
4945
"dependencies": {
5046
"@vueuse/core": "workspace:*",
51-
"@vueuse/shared": "workspace:*",
52-
"vue": "catalog:"
47+
"@vueuse/shared": "workspace:*"
5348
}
5449
}

packages/core/metadata.cjs

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/core/metadata.d.cts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/core/metadata.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/core/package.json

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vueuse/core",
33
"type": "module",
4-
"version": "12.8.2",
4+
"version": "13.0.0-beta.2",
55
"description": "Collection of essential Vue Composition Utilities",
66
"author": "Anthony Fu <https://github.com/antfu>",
77
"license": "MIT",
@@ -22,39 +22,31 @@
2222
],
2323
"sideEffects": false,
2424
"exports": {
25-
".": {
26-
"import": "./index.mjs",
27-
"require": "./index.cjs"
28-
},
25+
".": "./index.mjs",
2926
"./*": "./*",
30-
"./metadata": {
31-
"import": "./metadata.mjs",
32-
"require": "./metadata.cjs"
33-
}
27+
"./metadata": "./metadata.mjs"
3428
},
35-
"main": "./index.cjs",
29+
"main": "./index.mjs",
3630
"module": "./index.mjs",
3731
"unpkg": "./index.iife.min.js",
3832
"jsdelivr": "./index.iife.min.js",
39-
"types": "./index.d.ts",
33+
"types": "./index.d.mts",
4034
"files": [
41-
"*.cjs",
42-
"*.d.cts",
4335
"*.d.mts",
44-
"*.d.ts",
4536
"*.js",
4637
"*.mjs"
4738
],
4839
"scripts": {
4940
"build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild",
5041
"prepack": "pnpm run build",
51-
"test:attw": "attw --pack .",
52-
"test:attw-esm-only": "attw --pack --config-path ../../attw-esm-only.json ."
42+
"test:attw": "attw --pack --config-path ../../.attw.json ."
43+
},
44+
"peerDependencies": {
45+
"vue": "^3.5.0"
5346
},
5447
"dependencies": {
5548
"@types/web-bluetooth": "catalog:",
5649
"@vueuse/metadata": "workspace:*",
57-
"@vueuse/shared": "workspace:*",
58-
"vue": "catalog:"
50+
"@vueuse/shared": "workspace:*"
5951
}
6052
}

packages/electron/package.json

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vueuse/electron",
33
"type": "module",
4-
"version": "12.8.2",
4+
"version": "13.0.0-beta.2",
55
"description": "Electron renderer process modules for VueUse",
66
"author": "Archer Gu<https://github.com/ArcherGu>",
77
"license": "MIT",
@@ -24,35 +24,28 @@
2424
],
2525
"sideEffects": false,
2626
"exports": {
27-
".": {
28-
"import": "./index.mjs",
29-
"require": "./index.cjs"
30-
},
27+
".": "./index.mjs",
3128
"./*": "./*"
3229
},
33-
"main": "./index.cjs",
30+
"main": "./index.mjs",
3431
"module": "./index.mjs",
35-
"types": "./index.d.ts",
32+
"types": "./index.d.mts",
3633
"files": [
37-
"*.cjs",
38-
"*.d.cts",
3934
"*.d.mts",
40-
"*.d.ts",
4135
"*.js",
4236
"*.mjs"
4337
],
4438
"scripts": {
4539
"build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild",
4640
"prepack": "pnpm run build",
47-
"test:attw": "attw --pack .",
48-
"test:attw-esm-only": "attw --pack --config-path ../../attw-esm-only.json ."
41+
"test:attw": "attw --pack --config-path ../../.attw.json ."
4942
},
5043
"peerDependencies": {
51-
"electron": ">=9.0.0"
44+
"electron": ">=9.0.0",
45+
"vue": "^3.5.0"
5246
},
5347
"dependencies": {
54-
"@vueuse/shared": "workspace:*",
55-
"vue": "catalog:"
48+
"@vueuse/shared": "workspace:*"
5649
},
5750
"devDependencies": {
5851
"electron": "catalog:"

packages/firebase/package.json

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vueuse/firebase",
33
"type": "module",
4-
"version": "12.8.2",
4+
"version": "13.0.0-beta.2",
55
"description": "Enables realtime bindings for Firebase",
66
"author": "Anthony Fu <https://github.com/antfu>",
77
"license": "MIT",
@@ -24,48 +24,32 @@
2424
],
2525
"sideEffects": false,
2626
"exports": {
27-
".": {
28-
"import": "./index.mjs",
29-
"require": "./index.cjs"
30-
},
27+
".": "./index.mjs",
3128
"./*": "./*",
32-
"./useAuth": {
33-
"import": "./useAuth.mjs",
34-
"require": "./useAuth.cjs"
35-
},
36-
"./useFirestore": {
37-
"import": "./useFirestore.mjs",
38-
"require": "./useFirestore.cjs"
39-
},
40-
"./useRTDB": {
41-
"import": "./useRTDB.mjs",
42-
"require": "./useRTDB.cjs"
43-
}
29+
"./useAuth": "./useAuth.mjs",
30+
"./useFirestore": "./useFirestore.mjs",
31+
"./useRTDB": "./useRTDB.mjs"
4432
},
45-
"main": "./index.cjs",
33+
"main": "./index.mjs",
4634
"module": "./index.mjs",
4735
"unpkg": "./index.iife.min.js",
4836
"jsdelivr": "./index.iife.min.js",
49-
"types": "./index.d.ts",
37+
"types": "./index.d.mts",
5038
"files": [
51-
"**/*.cjs",
52-
"**/*.d.cts",
5339
"**/*.d.mts",
54-
"**/*.d.ts",
5540
"**/*.js",
5641
"**/*.mjs"
5742
],
5843
"scripts": {
5944
"build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild",
6045
"prepack": "pnpm run build",
61-
"test:attw": "attw --pack .",
62-
"test:attw-esm-only": "attw --pack --config-path ../../attw-esm-only.json ."
46+
"test:attw": "attw --pack --config-path ../../.attw.json ."
6347
},
6448
"peerDependencies": {
65-
"firebase": ">=9.0.0"
49+
"firebase": ">=9.0.0",
50+
"vue": "^3.5.0"
6651
},
6752
"dependencies": {
68-
"@vueuse/shared": "workspace:*",
69-
"vue": "catalog:"
53+
"@vueuse/shared": "workspace:*"
7054
}
7155
}

0 commit comments

Comments
 (0)