mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-15 03:33:19 +08:00
feat!: remove vue 2
This commit is contained in:
@ -7,19 +7,13 @@ const { name, version } = getPackageMeta();
|
||||
const CDN_PREFIX = "https://cdn.jsdelivr.net/npm/";
|
||||
|
||||
const DEP_VERSIONS = {
|
||||
"vue@3": "3.4.33",
|
||||
"vue@2": "2.7.16",
|
||||
"vue@3": "3.5.13",
|
||||
echarts: "5.5.1",
|
||||
[name]: version
|
||||
};
|
||||
|
||||
const markConfig = {
|
||||
vue3Scripts: ["vue@3", "echarts", name],
|
||||
vue2Scripts: ["vue@2", "echarts", name]
|
||||
};
|
||||
|
||||
function getScripts(version) {
|
||||
const deps = markConfig[`vue${version}Scripts`];
|
||||
function getScripts() {
|
||||
const deps = ["vue@3", "echarts", name];
|
||||
return deps
|
||||
.map(dep => {
|
||||
const [, name] = dep.match(/^(.+?)(?:@.+)?$/) || [];
|
||||
@ -32,11 +26,6 @@ function getCodeBlock(code) {
|
||||
return "```html\n" + code + "\n```";
|
||||
}
|
||||
|
||||
const scripts = {
|
||||
2: getScripts(2),
|
||||
3: getScripts(3)
|
||||
};
|
||||
|
||||
const README_FILES = ["README.md", "README.zh-Hans.md"].map(name =>
|
||||
resolvePath(import.meta.url, "..", name)
|
||||
);
|
||||
@ -47,8 +36,7 @@ README_FILES.forEach(file => {
|
||||
writeFileSync(
|
||||
file,
|
||||
commentMark(content, {
|
||||
vue2Scripts: getCodeBlock(scripts[2]),
|
||||
vue3Scripts: getCodeBlock(scripts[3])
|
||||
vue3Scripts: getCodeBlock(getScripts())
|
||||
}),
|
||||
"utf8"
|
||||
);
|
||||
|
Reference in New Issue
Block a user