Skip to content

Commit 27c79b9

Browse files
committed
feat!: move to esm and drop support for vue 2.6
1 parent 8616743 commit 27c79b9

20 files changed

+866
-728
lines changed

.eslintrc.js

-25
This file was deleted.

.eslintrc.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"node": true
5+
},
6+
"extends": ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/prettier"],
7+
"parserOptions": {
8+
"ecmaVersion": 2020,
9+
"parser": "@typescript-eslint/parser"
10+
},
11+
"rules": {
12+
"no-console": "off",
13+
"vue/multi-word-component-names": "off"
14+
},
15+
"overrides": [
16+
{
17+
"files": ["*.ts"],
18+
"extends": [
19+
"@vue/typescript/recommended",
20+
"@vue/prettier/@typescript-eslint"
21+
]
22+
}
23+
]
24+
}

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
---
1515

16-
<h2>💡 Heads up 💡 <a href="./README.zh-Hans.md"><img src="https://img.shields.io/badge/%F0%9F%87%A8%F0%9F%87%B3-%E4%B8%AD%E6%96%87%E7%89%88-white?labelColor=white" alt="前往中文版" align="right" height="24"/></a></h2>
16+
<h2>💡 Heads up 💡 <a href="./README.zh-Hans.md"><img src="https://img.shields.io/badge/%E4%B8%AD%E6%96%87%E7%89%88-20c3aa" alt="前往中文版" align="right" height="24"/></a></h2>
1717

1818
If you are migrating from `vue-echarts` ≤ 5, you should read the _[Migration to v6](#migration-to-v6)_ section before you update to v6.
1919

@@ -236,9 +236,9 @@ Drop `<script>` inside your HTML file and access the component via `window.VueEC
236236

237237
<!-- vue3Scripts:start -->
238238
```html
239-
<script src="https://cdn.jsdelivr.net/npm/[email protected].23"></script>
240-
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
241-
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
239+
<script src="https://cdn.jsdelivr.net/npm/[email protected].30"></script>
240+
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script>
241+
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.0-beta.0"></script>
242242
```
243243
<!-- vue3Scripts:end -->
244244

@@ -257,8 +257,8 @@ app.component('v-chart', VueECharts)
257257
<!-- vue2Scripts:start -->
258258
```html
259259
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
260-
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
261-
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
260+
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script>
261+
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.0-beta.0"></script>
262262
```
263263
<!-- vue2Scripts:end -->
264264

README.zh-Hans.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ import "echarts";
236236

237237
<!-- vue3Scripts:start -->
238238
```html
239-
<script src="https://cdn.jsdelivr.net/npm/[email protected].23"></script>
240-
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
241-
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
239+
<script src="https://cdn.jsdelivr.net/npm/[email protected].30"></script>
240+
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script>
241+
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.0-beta.0"></script>
242242
```
243243
<!-- vue3Scripts:end -->
244244

@@ -257,8 +257,8 @@ app.component('v-chart', VueECharts)
257257
<!-- vue2Scripts:start -->
258258
```html
259259
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
260-
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3"></script>
261-
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.7.3"></script>
260+
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script>
261+
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.0-beta.0"></script>
262262
```
263263
<!-- vue2Scripts:end -->
264264

babel.config.js

-3
This file was deleted.

babel.config.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@vue/cli-plugin-babel/preset"]
3+
}

package.json

+40-28
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,56 @@
11
{
22
"name": "vue-echarts",
3-
"version": "6.7.3",
3+
"version": "7.0.0-beta.0",
44
"description": "Vue.js component for Apache ECharts™.",
5+
"license": "MIT",
6+
"repository": "https://github.com/ecomfe/vue-echarts.git",
57
"author": "GU Yiling <[email protected]>",
68
"scripts": {
79
"serve": "vue-cli-service serve",
810
"build": "pnpm run docs && rimraf dist && pnpm run build:2 && pnpm run build:3 && vue-demi-switch 3",
911
"build:2": "vue-demi-switch 2 vue2 && rollup -c rollup.vue2.config.js",
1012
"build:3": "vue-demi-switch 3 && rollup -c rollup.config.js",
1113
"lint": "vue-cli-service lint",
14+
"publint": "publint",
1215
"build:demo": "vue-cli-service build",
13-
"docs": "node ./scripts/docs.js",
14-
"postinstall": "node ./scripts/postinstall.js",
15-
"prepublishOnly": "pnpm run build"
16+
"docs": "node ./scripts/docs.mjs",
17+
"postinstall": "node ./scripts/postinstall.mjs",
18+
"prepublishOnly": "pnpm run build && publint"
19+
},
20+
"type": "module",
21+
"module": "dist/index.js",
22+
"main": "dist/index.cjs",
23+
"unpkg": "dist/index.min.js",
24+
"jsdelivr": "dist/index.min.js",
25+
"types": "dist/index.d.ts",
26+
"exports": {
27+
".": {
28+
"import": "./dist/index.js",
29+
"require": "./dist/index.cjs"
30+
},
31+
"./csp": {
32+
"import": "./dist/csp/index.js",
33+
"require": "./dist/csp/index.cjs"
34+
},
35+
"./csp/style.css": "./dist/csp/style.css"
1636
},
17-
"main": "dist/index.cjs.min.js",
18-
"module": "dist/index.esm.min.js",
19-
"unpkg": "dist/index.umd.min.js",
2037
"files": [
2138
"dist",
2239
"scripts/postinstall.js"
2340
],
2441
"dependencies": {
2542
"vue-demi": "^0.13.11"
2643
},
44+
"peerDependencies": {
45+
"@vue/runtime-core": "^3.0.0",
46+
"echarts": "^5.5.1",
47+
"vue": "^2.7.0 || ^3.1.1"
48+
},
49+
"peerDependenciesMeta": {
50+
"@vue/runtime-core": {
51+
"optional": true
52+
}
53+
},
2754
"devDependencies": {
2855
"@babel/core": "^7.24.4",
2956
"@highlightjs/vue-plugin": "^2.1.0",
@@ -38,7 +65,6 @@
3865
"@vue/cli-plugin-typescript": "^5.0.8",
3966
"@vue/cli-service": "^5.0.8",
4067
"@vue/compiler-sfc": "^3.4.24",
41-
"@vue/composition-api": "^1.7.2",
4268
"@vue/eslint-config-prettier": "^6.0.0",
4369
"@vue/eslint-config-typescript": "^10.0.0",
4470
"@vueuse/core": "^10.9.0",
@@ -57,32 +83,18 @@
5783
"postcss-loader": "^5.3.0",
5884
"postcss-nested": "^5.0.6",
5985
"prettier": "^2.8.8",
86+
"publint": "^0.2.8",
6087
"raw-loader": "^4.0.2",
6188
"resize-detector": "^0.3.0",
6289
"rimraf": "^3.0.2",
63-
"rollup": "^2.79.1",
64-
"rollup-plugin-dts": "^4.2.3",
65-
"rollup-plugin-styles": "^4.0.0",
66-
"rollup-plugin-ts": "^2.0.7",
90+
"rollup": "^4.12.0",
91+
"rollup-plugin-dts": "^6.1.0",
92+
"rollup-plugin-esbuild": "^6.1.1",
93+
"rollup-plugin-import-css": "^3.5.0",
6794
"tslib": "^2.6.2",
6895
"typescript": "4.6.4",
6996
"vue": "^3.4.24",
7097
"vue2": "npm:vue@^2.7.16",
7198
"webpack": "^5.91.0"
72-
},
73-
"peerDependencies": {
74-
"@vue/composition-api": "^1.0.5",
75-
"@vue/runtime-core": "^3.0.0",
76-
"echarts": "^5.4.1",
77-
"vue": "^2.7.0 || ^3.1.1"
78-
},
79-
"jsdelivr": "dist/index.umd.min.js",
80-
"license": "MIT",
81-
"peerDependenciesMeta": {
82-
"@vue/runtime-core": {
83-
"optional": true
84-
}
85-
},
86-
"repository": "https://github.com/ecomfe/vue-echarts.git",
87-
"types": "dist/index.d.ts"
99+
}
88100
}

0 commit comments

Comments
 (0)