From e6b43db90b2b44e3584c4d24a4c9d0321e1a0f23 Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 30 Jul 2022 19:55:17 +0800 Subject: [PATCH] refactor(@vant/cli): remove vetur configs (#10866) --- .gitignore | 1 - .../generators/vue3/.gitignore.tpl | 1 - packages/vant-cli/changelog.md | 6 ++ packages/vant-cli/package.json | 1 - packages/vant-cli/src/commands/build.ts | 4 +- packages/vant-cli/src/commands/clean.ts | 2 - packages/vant-cli/src/common/constant.ts | 1 - .../vant-cli/src/compiler/gen-vetur-config.ts | 25 ----- .../src/compiler/web-types}/formatter.ts | 29 +++--- .../vant-cli/src/compiler/web-types/index.ts | 54 ++++++++++ .../src/compiler/web-types}/parser.ts | 14 +-- .../src/compiler/web-types}/type.ts | 20 ---- .../src/compiler/web-types}/utils.ts | 0 .../src/compiler/web-types}/web-types.ts | 2 +- packages/vant-cli/src/module.d.ts | 1 - packages/vant-markdown-vetur/LICENSE | 10 -- packages/vant-markdown-vetur/README.md | 37 ------- packages/vant-markdown-vetur/package.json | 35 ------- packages/vant-markdown-vetur/src/index.ts | 49 --------- packages/vant-markdown-vetur/src/vetur.ts | 36 ------- packages/vant-markdown-vetur/tsconfig.json | 10 -- packages/vant/package.json | 9 +- packages/vant/vant.config.mjs | 3 - pnpm-lock.yaml | 99 +++++-------------- 24 files changed, 112 insertions(+), 337 deletions(-) delete mode 100644 packages/vant-cli/src/compiler/gen-vetur-config.ts rename packages/{vant-markdown-vetur/src => vant-cli/src/compiler/web-types}/formatter.ts (85%) create mode 100644 packages/vant-cli/src/compiler/web-types/index.ts rename packages/{vant-markdown-vetur/src => vant-cli/src/compiler/web-types}/parser.ts (91%) rename packages/{vant-markdown-vetur/src => vant-cli/src/compiler/web-types}/type.ts (66%) rename packages/{vant-markdown-vetur/src => vant-cli/src/compiler/web-types}/utils.ts (100%) rename packages/{vant-markdown-vetur/src => vant-cli/src/compiler/web-types}/web-types.ts (90%) delete mode 100644 packages/vant-markdown-vetur/LICENSE delete mode 100644 packages/vant-markdown-vetur/README.md delete mode 100644 packages/vant-markdown-vetur/package.json delete mode 100644 packages/vant-markdown-vetur/src/index.ts delete mode 100644 packages/vant-markdown-vetur/src/vetur.ts delete mode 100644 packages/vant-markdown-vetur/tsconfig.json diff --git a/.gitignore b/.gitignore index e7fa2a6cb..bbfb1619c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,5 @@ package-lock.json es lib dist -vetur **/site-dist changelog.generated.md diff --git a/packages/create-vant-cli-app/generators/vue3/.gitignore.tpl b/packages/create-vant-cli-app/generators/vue3/.gitignore.tpl index 45c042e07..ab4ed5005 100644 --- a/packages/create-vant-cli-app/generators/vue3/.gitignore.tpl +++ b/packages/create-vant-cli-app/generators/vue3/.gitignore.tpl @@ -15,6 +15,5 @@ test/coverage es lib dist -vetur site changelog.generated.md diff --git a/packages/vant-cli/changelog.md b/packages/vant-cli/changelog.md index 26226fbe6..6239f3c36 100644 --- a/packages/vant-cli/changelog.md +++ b/packages/vant-cli/changelog.md @@ -25,6 +25,12 @@ yarn add stylelint@13 @vant/stylelint-config ``` +### 移除 vetur 相关配置 + +由于 Vue 3 推荐使用 volar 而不是 vetur,因此移除了 vetur 相关的配置文件。 + +现在会默认生成 WebStorm 所需的 web-types.json 文件到 `lib/web-types.json` 目录下。 + ## v4.0.3 `2022-07-02` diff --git a/packages/vant-cli/package.json b/packages/vant-cli/package.json index cd4bef300..7beb04e38 100644 --- a/packages/vant-cli/package.json +++ b/packages/vant-cli/package.json @@ -54,7 +54,6 @@ "@docsearch/js": "^3.0.0", "@types/jest": "^27.0.3", "@vant/eslint-config": "^3.3.2", - "@vant/markdown-vetur": "^2.3.0", "@vant/touch-emulator": "^1.3.2", "@vitejs/plugin-vue": "^3.0.1", "@vitejs/plugin-vue-jsx": "^2.0.0", diff --git a/packages/vant-cli/src/commands/build.ts b/packages/vant-cli/src/commands/build.ts index 80b6743bf..d848cb3ce 100644 --- a/packages/vant-cli/src/commands/build.ts +++ b/packages/vant-cli/src/commands/build.ts @@ -14,7 +14,7 @@ import { genStyleDepsMap } from '../compiler/gen-style-deps-map.js'; import { genComponentStyle } from '../compiler/gen-component-style.js'; import { SRC_DIR, LIB_DIR, ES_DIR } from '../common/constant.js'; import { genPackageStyle } from '../compiler/gen-package-style.js'; -import { genVeturConfig } from '../compiler/gen-vetur-config.js'; +import { genWebStormTypes } from '../compiler/web-types/index.js'; import { isDir, isSfc, @@ -137,7 +137,7 @@ async function buildPackageStyleEntry() { async function buildBundledOutputs() { setModuleEnv('esmodule'); await compileBundles(); - genVeturConfig(); + genWebStormTypes(); } const tasks = [ diff --git a/packages/vant-cli/src/commands/clean.ts b/packages/vant-cli/src/commands/clean.ts index 501fce953..e49e5d9ef 100644 --- a/packages/vant-cli/src/commands/clean.ts +++ b/packages/vant-cli/src/commands/clean.ts @@ -3,7 +3,6 @@ import { ES_DIR, LIB_DIR, DIST_DIR, - VETUR_DIR, SITE_DIST_DIR, } from '../common/constant.js'; @@ -14,7 +13,6 @@ export async function clean() { remove(ES_DIR), remove(LIB_DIR), remove(DIST_DIR), - remove(VETUR_DIR), remove(SITE_DIST_DIR), ]); } diff --git a/packages/vant-cli/src/common/constant.ts b/packages/vant-cli/src/common/constant.ts index 89034bbb3..7ae07fd78 100644 --- a/packages/vant-cli/src/common/constant.ts +++ b/packages/vant-cli/src/common/constant.ts @@ -21,7 +21,6 @@ export const ROOT = findRootDir(CWD); export const ES_DIR = join(ROOT, 'es'); export const LIB_DIR = join(ROOT, 'lib'); export const DOCS_DIR = join(ROOT, 'docs'); -export const VETUR_DIR = join(ROOT, 'vetur'); export const SITE_DIST_DIR = join(ROOT, 'site-dist'); export const VANT_CONFIG_FILE = join(ROOT, 'vant.config.mjs'); export const PACKAGE_JSON_FILE = join(ROOT, 'package.json'); diff --git a/packages/vant-cli/src/compiler/gen-vetur-config.ts b/packages/vant-cli/src/compiler/gen-vetur-config.ts deleted file mode 100644 index be9cf312b..000000000 --- a/packages/vant-cli/src/compiler/gen-vetur-config.ts +++ /dev/null @@ -1,25 +0,0 @@ -import markdownVetur from '@vant/markdown-vetur'; -import { - SRC_DIR, - VETUR_DIR, - getVantConfig, - getPackageJson, -} from '../common/constant.js'; - -// generate vetur tags & attributes -export function genVeturConfig() { - const pkgJson = getPackageJson(); - const vantConfig = getVantConfig(); - const options = vantConfig.build?.vetur; - - if (options) { - markdownVetur.parseAndWrite({ - name: vantConfig.name, - path: SRC_DIR, - test: /README\.md/, - version: pkgJson.version, - outputDir: VETUR_DIR, - ...options, - }); - } -} diff --git a/packages/vant-markdown-vetur/src/formatter.ts b/packages/vant-cli/src/compiler/web-types/formatter.ts similarity index 85% rename from packages/vant-markdown-vetur/src/formatter.ts rename to packages/vant-cli/src/compiler/web-types/formatter.ts index 383282207..bf9f8efae 100644 --- a/packages/vant-markdown-vetur/src/formatter.ts +++ b/packages/vant-cli/src/compiler/web-types/formatter.ts @@ -1,14 +1,19 @@ /* eslint-disable no-continue */ -import { Articals } from './parser'; -import { formatOptions, formatType, removeVersion, toKebabCase } from './utils'; -import { VueEventArgument, VueTag } from './type'; +import { Articles } from './parser.js'; +import { + formatOptions, + formatType, + removeVersion, + toKebabCase, +} from './utils.js'; +import { VueEventArgument, VueTag } from './type.js'; function formatComponentName(name: string, tagPrefix: string) { return tagPrefix + toKebabCase(name); } /** - * format arugments of events + * format arguments of events * input = value: { foo: foo or 1, bar: bar or 2 }, value2: { one: 1 and 1, two: 2 and 2 }, foo: bar * output = [{ name: 'value', type: '{ foo: foo or 1, bar: bar or 2 }' }, { name: 'value2', type: '{ one: 1 and 1, two: 2 and 2 }'}, { name: 'foo', type: 'bar' }] */ @@ -73,29 +78,29 @@ function findTag(vueTags: VueTag[], name: string) { export function formatter( vueTags: VueTag[], - articals: Articals, + articles: Articles, tagPrefix = '' ) { - if (!articals.length) { + if (!articles.length) { return; } - const mainTitle = articals[0].content; + const mainTitle = articles[0].content; const defaultName = mainTitle ? formatComponentName(mainTitle.split(' ')[0], tagPrefix) : ''; - const tables = articals.filter((artical) => artical.type === 'table'); + const tables = articles.filter((article) => article.type === 'table'); tables.forEach((item) => { const { table } = item; - const prevIndex = articals.indexOf(item) - 1; - const prevArtical = articals[prevIndex]; + const prevIndex = articles.indexOf(item) - 1; + const prevArticle = articles[prevIndex]; - if (!prevArtical || !prevArtical.content || !table || !table.body) { + if (!prevArticle || !prevArticle.content || !table || !table.body) { return; } - const tableTitle = prevArtical.content; + const tableTitle = prevArticle.content; if (tableTitle.includes('Props')) { const name = getNameFromTableTitle(tableTitle, tagPrefix) || defaultName; diff --git a/packages/vant-cli/src/compiler/web-types/index.ts b/packages/vant-cli/src/compiler/web-types/index.ts new file mode 100644 index 000000000..74eaf46d8 --- /dev/null +++ b/packages/vant-cli/src/compiler/web-types/index.ts @@ -0,0 +1,54 @@ +import glob from 'fast-glob'; +import { join } from 'path'; +import fse from 'fs-extra'; +import { mdParser } from './parser.js'; +import { formatter } from './formatter.js'; +import { genWebTypes } from './web-types.js'; +import { Options, VueTag } from './type.js'; +import { normalizePath } from './utils.js'; +import { + SRC_DIR, + LIB_DIR, + getVantConfig, + getPackageJson, +} from '../../common/constant.js'; + +async function readMarkdown(options: Options) { + const mds = await glob(normalizePath(`${options.path}/**/*.md`)); + return mds + .filter((md) => options.test.test(md)) + .map((path) => fse.readFileSync(path, 'utf-8')); +} + +export async function parseAndWrite(options: Options) { + if (!options.outputDir) { + throw new Error('outputDir can not be empty.'); + } + + const mds = await readMarkdown(options); + const vueTags: VueTag[] = []; + + mds.forEach((md) => { + const parsedMd = mdParser(md); + formatter(vueTags, parsedMd, options.tagPrefix); + }); + + const webTypes = genWebTypes(vueTags, options); + fse.outputFileSync( + join(options.outputDir, 'web-types.json'), + JSON.stringify(webTypes, null, 2) + ); +} + +export function genWebStormTypes() { + const pkgJson = getPackageJson(); + const vantConfig = getVantConfig(); + + parseAndWrite({ + name: vantConfig.name, + path: SRC_DIR, + test: /README\.md/, + version: pkgJson.version, + outputDir: LIB_DIR, + }); +} diff --git a/packages/vant-markdown-vetur/src/parser.ts b/packages/vant-cli/src/compiler/web-types/parser.ts similarity index 91% rename from packages/vant-markdown-vetur/src/parser.ts rename to packages/vant-cli/src/compiler/web-types/parser.ts index fb3776873..cfd73705c 100644 --- a/packages/vant-markdown-vetur/src/parser.ts +++ b/packages/vant-cli/src/compiler/web-types/parser.ts @@ -9,14 +9,14 @@ type TableContent = { body: string[][]; }; -export type Artical = { +export type Article = { type: string; content?: string; table?: TableContent; level?: number; }; -export type Articals = Artical[]; +export type Articles = Article[]; function readLine(input: string) { const end = input.indexOf('\n'); @@ -75,8 +75,8 @@ function tableParse(input: string) { }; } -export function mdParser(input: string): Articals { - const artical = []; +export function mdParser(input: string): Articles { + const article = []; let start = 0; const end = input.length; @@ -85,7 +85,7 @@ export function mdParser(input: string): Articals { let match; if ((match = TITLE_REG.exec(target))) { - artical.push({ + article.push({ type: 'title', content: match[2], level: match[1].length, @@ -94,7 +94,7 @@ export function mdParser(input: string): Articals { start += match.index + match[0].length; } else if ((match = TABLE_REG.exec(target))) { const { table, usedLength } = tableParse(target.substr(match.index)); - artical.push({ + article.push({ type: 'table', table, }); @@ -105,5 +105,5 @@ export function mdParser(input: string): Articals { } } - return artical; + return article; } diff --git a/packages/vant-markdown-vetur/src/type.ts b/packages/vant-cli/src/compiler/web-types/type.ts similarity index 66% rename from packages/vant-markdown-vetur/src/type.ts rename to packages/vant-cli/src/compiler/web-types/type.ts index 108df7e3c..58648efd9 100644 --- a/packages/vant-markdown-vetur/src/type.ts +++ b/packages/vant-cli/src/compiler/web-types/type.ts @@ -35,26 +35,6 @@ export type VueTag = { description?: string; }; -export type VeturTag = { - description?: string; - attributes: string[]; -}; - -export type VeturTags = Record; - -export type VeturAttribute = { - type: string; - description: string; - options?: string[]; -}; - -export type VeturAttributes = Record; - -export type VeturResult = { - tags: VeturTags; - attributes: VeturAttributes; -}; - export type Options = { name: string; path: PathLike; diff --git a/packages/vant-markdown-vetur/src/utils.ts b/packages/vant-cli/src/compiler/web-types/utils.ts similarity index 100% rename from packages/vant-markdown-vetur/src/utils.ts rename to packages/vant-cli/src/compiler/web-types/utils.ts diff --git a/packages/vant-markdown-vetur/src/web-types.ts b/packages/vant-cli/src/compiler/web-types/web-types.ts similarity index 90% rename from packages/vant-markdown-vetur/src/web-types.ts rename to packages/vant-cli/src/compiler/web-types/web-types.ts index 76b46218d..144f24890 100644 --- a/packages/vant-markdown-vetur/src/web-types.ts +++ b/packages/vant-cli/src/compiler/web-types/web-types.ts @@ -1,4 +1,4 @@ -import { VueTag, Options } from './type'; +import type { VueTag, Options } from './type.js'; // create web-types.json to provide autocomplete in JetBrains IDEs export function genWebTypes(tags: VueTag[], options: Options) { diff --git a/packages/vant-cli/src/module.d.ts b/packages/vant-cli/src/module.d.ts index 9919346f4..a623ae1e7 100644 --- a/packages/vant-cli/src/module.d.ts +++ b/packages/vant-cli/src/module.d.ts @@ -4,4 +4,3 @@ declare module 'hash-sum'; declare module '@babel/core'; declare module 'release-it'; declare module 'conventional-changelog'; -declare module '@vant/markdown-vetur'; diff --git a/packages/vant-markdown-vetur/LICENSE b/packages/vant-markdown-vetur/LICENSE deleted file mode 100644 index 26ef2dcc9..000000000 --- a/packages/vant-markdown-vetur/LICENSE +++ /dev/null @@ -1,10 +0,0 @@ -MIT License - -Copyright (c) Youzan -Copyright (c) Chen Jiahan and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/vant-markdown-vetur/README.md b/packages/vant-markdown-vetur/README.md deleted file mode 100644 index f759d01e3..000000000 --- a/packages/vant-markdown-vetur/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Vant Markdown Vetur - -将 .md 文件转换成能描述 vue 组件的 .json 文件,供 WebStorm 和 vscode 的 `vetur` 插件读取,从而可以在 vue 模版语法中拥有自动补全的功能。 - -## Install - -```shell -# with npm -npm i @vant/markdown-vetur -D - -# with yarn -yarn add @vant/markdown-vetur -D - -# with pnpm -pnpm add @vant/markdown-vetur -D -``` - -## API - -#### parseAndWrite - -解析目录下所有匹配的文件,并输出为 tags.json 和 attributes.json - -```ts -interface Options { - // 需要解析的文件夹路径 - path: PathLike; - // 文件匹配正则 - test: RegExp; - // 输出目录 - outputDir: string; - // 递归的目录最大深度 - maxDeep?: number; - // 解析出来的组件名前缀 - tagPrefix?: string; -} -``` diff --git a/packages/vant-markdown-vetur/package.json b/packages/vant-markdown-vetur/package.json deleted file mode 100644 index 7c8927ca5..000000000 --- a/packages/vant-markdown-vetur/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@vant/markdown-vetur", - "version": "2.3.0", - "description": "simple parse markdown to vue component description for vetur auto-completion", - "main": "lib/index.js", - "files": [ - "lib" - ], - "scripts": { - "dev": "tsc --watch", - "build": "rimraf ./lib && tsc", - "release": "pnpm build && npm publish", - "prepare": "pnpm build" - }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, - "repository": { - "type": "git", - "url": "https://github.com/vant-ui/vant.git", - "directory": "packages/vant-markdown-vetur" - }, - "bugs": "https://github.com/vant-ui/vant/issues", - "author": "zhangshuai", - "license": "MIT", - "dependencies": { - "fast-glob": "^3.2.2", - "fs-extra": "^10.0.0" - }, - "devDependencies": { - "@types/fs-extra": "^9.0.13", - "typescript": "^4.7.4" - } -} diff --git a/packages/vant-markdown-vetur/src/index.ts b/packages/vant-markdown-vetur/src/index.ts deleted file mode 100644 index 3825010d2..000000000 --- a/packages/vant-markdown-vetur/src/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import glob from 'fast-glob'; -import { join } from 'path'; -import { mdParser } from './parser'; -import { formatter } from './formatter'; -import { genWebTypes } from './web-types'; -import { readFileSync, outputFileSync } from 'fs-extra'; -import { Options, VueTag } from './type'; -import { normalizePath } from './utils'; -import { genVeturTags, genVeturAttributes } from './vetur'; - -async function readMarkdown(options: Options) { - const mds = await glob(normalizePath(`${options.path}/**/*.md`)); - return mds - .filter((md) => options.test.test(md)) - .map((path) => readFileSync(path, 'utf-8')); -} - -export async function parseAndWrite(options: Options) { - if (!options.outputDir) { - throw new Error('outputDir can not be empty.'); - } - - const mds = await readMarkdown(options); - const vueTags: VueTag[] = []; - - mds.forEach((md) => { - const parsedMd = mdParser(md); - formatter(vueTags, parsedMd, options.tagPrefix); - }); - - const webTypes = genWebTypes(vueTags, options); - const veturTags = genVeturTags(vueTags); - const veturAttributes = genVeturAttributes(vueTags); - - outputFileSync( - join(options.outputDir, 'tags.json'), - JSON.stringify(veturTags, null, 2) - ); - outputFileSync( - join(options.outputDir, 'attributes.json'), - JSON.stringify(veturAttributes, null, 2) - ); - outputFileSync( - join(options.outputDir, 'web-types.json'), - JSON.stringify(webTypes, null, 2) - ); -} - -export default { parseAndWrite }; diff --git a/packages/vant-markdown-vetur/src/vetur.ts b/packages/vant-markdown-vetur/src/vetur.ts deleted file mode 100644 index 8f6e40392..000000000 --- a/packages/vant-markdown-vetur/src/vetur.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { VueTag, VeturTags, VeturAttributes, VeturAttribute } from './type'; - -export function genVeturTags(tags: VueTag[]) { - const veturTags: VeturTags = {}; - - tags.forEach((tag) => { - veturTags[tag.name] = { - attributes: tag.attributes ? tag.attributes.map((item) => item.name) : [], - }; - }); - - return veturTags; -} - -export function genVeturAttributes(tags: VueTag[]) { - const veturAttributes: VeturAttributes = {}; - - tags.forEach((tag) => { - if (tag.attributes) { - tag.attributes.forEach((attr) => { - const attribute: VeturAttribute = { - type: attr.value.type, - description: `${attr.description}, Default: ${attr.default}`, - }; - - if (attr.options.length > 0) { - attribute.options = attr.options; - } - - veturAttributes[`${tag.name}/${attr.name}`] = attribute; - }); - } - }); - - return veturAttributes; -} diff --git a/packages/vant-markdown-vetur/tsconfig.json b/packages/vant-markdown-vetur/tsconfig.json deleted file mode 100644 index 738ecb181..000000000 --- a/packages/vant-markdown-vetur/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig", - "compilerOptions": { - "target": "ES2019", - "outDir": "./lib", - "module": "commonjs", - "declaration": true - }, - "include": ["src/**/*"] -} diff --git a/packages/vant/package.json b/packages/vant/package.json index a2447ce97..4b573d92a 100644 --- a/packages/vant/package.json +++ b/packages/vant/package.json @@ -10,8 +10,7 @@ "jsdelivr": "lib/vant.min.js", "files": [ "es", - "lib", - "vetur" + "lib" ], "scripts": { "dev": "vant-cli dev", @@ -69,9 +68,5 @@ "*.css", "*.less" ], - "web-types": "vetur/web-types.json", - "vetur": { - "tags": "vetur/tags.json", - "attributes": "vetur/attributes.json" - } + "web-types": "lib/web-types.json" } diff --git a/packages/vant/vant.config.mjs b/packages/vant/vant.config.mjs index 604787335..e19d17078 100644 --- a/packages/vant/vant.config.mjs +++ b/packages/vant/vant.config.mjs @@ -12,9 +12,6 @@ export default { publicPath: (typeof window === 'undefined' && process.env.PUBLIC_PATH) || '/vant/', }, - vetur: { - tagPrefix: 'van-', - }, }, site: { defaultLang: 'en-US', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 191e9f395..09acdc75b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -94,7 +94,6 @@ importers: '@types/less': ^3.0.3 '@types/markdown-it': ^12.2.3 '@vant/eslint-config': ^3.3.2 - '@vant/markdown-vetur': ^2.3.0 '@vant/touch-emulator': ^1.3.2 '@vitejs/plugin-vue': ^3.0.1 '@vitejs/plugin-vue-jsx': ^2.0.0 @@ -140,7 +139,6 @@ importers: '@docsearch/js': 3.1.1_react-dom@18.2.0+react@18.2.0 '@types/jest': 27.5.2 '@vant/eslint-config': link:../vant-eslint-config - '@vant/markdown-vetur': link:../vant-markdown-vetur '@vant/touch-emulator': link:../vant-touch-emulator '@vitejs/plugin-vue': 3.0.1_vite@3.0.2+vue@3.2.37 '@vitejs/plugin-vue-jsx': 2.0.0_vite@3.0.2+vue@3.2.37 @@ -201,7 +199,7 @@ importers: '@typescript-eslint/parser': 5.30.3_eslint@8.19.0+typescript@4.7.4 eslint-config-airbnb-base: 15.0.0_86af6c937a18f7b068a2d4281b478827 eslint-config-prettier: 8.5.0_eslint@8.19.0 - eslint-plugin-import: 2.26.0_b991b8cc37fbaea14375bc1442f912c5 + eslint-plugin-import: 2.26.0_eslint@8.19.0 eslint-plugin-vue: 9.1.1_eslint@8.19.0 devDependencies: enhanced-resolve: 5.10.0 @@ -214,19 +212,6 @@ importers: devDependencies: release-it: 15.1.1 - packages/vant-markdown-vetur: - specifiers: - '@types/fs-extra': ^9.0.13 - fast-glob: ^3.2.2 - fs-extra: ^10.0.0 - typescript: ^4.7.4 - dependencies: - fast-glob: 3.2.11 - fs-extra: 10.1.0 - devDependencies: - '@types/fs-extra': 9.0.13 - typescript: 4.7.4 - packages/vant-popperjs: specifiers: '@popperjs/core': ^2.9.2 @@ -268,9 +253,6 @@ packages: peerDependencies: '@algolia/client-search': ^4.9.1 algoliasearch: ^4.9.1 - peerDependenciesMeta: - '@algolia/client-search': - optional: true dependencies: '@algolia/autocomplete-shared': 1.7.1 algoliasearch: 4.13.1 @@ -818,13 +800,6 @@ packages: '@types/react': '>= 16.8.0 < 19.0.0' react: '>= 16.8.0 < 19.0.0' react-dom: '>= 16.8.0 < 19.0.0' - peerDependenciesMeta: - '@types/react': - optional: true - react: - optional: true - react-dom: - optional: true dependencies: '@algolia/autocomplete-core': 1.7.1 '@algolia/autocomplete-preset-algolia': 1.7.1_algoliasearch@4.13.1 @@ -1626,12 +1601,14 @@ packages: '@vue/shared': 3.2.37 estree-walker: 2.0.2 source-map: 0.6.1 + dev: true /@vue/compiler-dom/3.2.37: resolution: {integrity: sha512-yxJLH167fucHKxaqXpYk7x8z7mMEnXOw3G2q62FTkmsvNxu4FQSu5+3UMb+L7fjKa26DEzhrmCxAgFLLIzVfqQ==} dependencies: '@vue/compiler-core': 3.2.37 '@vue/shared': 3.2.37 + dev: true /@vue/compiler-sfc/3.2.37: resolution: {integrity: sha512-+7i/2+9LYlpqDv+KTtWhOZH+pa8/HnX/905MdVmAcI/mPQOBwkHHIzrsEsucyOIZQYMkXUiTkmZq5am/NyXKkg==} @@ -1646,12 +1623,14 @@ packages: magic-string: 0.25.9 postcss: 8.4.14 source-map: 0.6.1 + dev: true /@vue/compiler-ssr/3.2.37: resolution: {integrity: sha512-7mQJD7HdXxQjktmsWp/J67lThEIcxLemz1Vb5I6rYJHR5vI+lON3nPGOH3ubmbvYGt8xEUaAr1j7/tIFWiEOqw==} dependencies: '@vue/compiler-dom': 3.2.37 '@vue/shared': 3.2.37 + dev: true /@vue/devtools-api/6.2.0: resolution: {integrity: sha512-pF1G4wky+hkifDiZSWn8xfuLOJI1ZXtuambpBEYaf7Xaf6zC/pM29rvAGpd3qaGXnr4BAXU1Pxz/VfvBGwexGA==} @@ -1664,17 +1643,20 @@ packages: '@vue/shared': 3.2.37 estree-walker: 2.0.2 magic-string: 0.25.9 + dev: true /@vue/reactivity/3.2.37: resolution: {integrity: sha512-/7WRafBOshOc6m3F7plwzPeCu/RCVv9uMpOwa/5PiY1Zz+WLVRWiy0MYKwmg19KBdGtFWsmZ4cD+LOdVPcs52A==} dependencies: '@vue/shared': 3.2.37 + dev: true /@vue/runtime-core/3.2.37: resolution: {integrity: sha512-JPcd9kFyEdXLl/i0ClS7lwgcs0QpUAWj+SKX2ZC3ANKi1U4DOtiEr6cRqFXsPwY5u1L9fAjkinIdB8Rz3FoYNQ==} dependencies: '@vue/reactivity': 3.2.37 '@vue/shared': 3.2.37 + dev: true /@vue/runtime-dom/3.2.37: resolution: {integrity: sha512-HimKdh9BepShW6YozwRKAYjYQWg9mQn63RGEiSswMbW+ssIht1MILYlVGkAGGQbkhSh31PCdoUcfiu4apXJoPw==} @@ -1682,6 +1664,7 @@ packages: '@vue/runtime-core': 3.2.37 '@vue/shared': 3.2.37 csstype: 2.6.20 + dev: true /@vue/server-renderer/3.2.37_vue@3.2.37: resolution: {integrity: sha512-kLITEJvaYgZQ2h47hIzPh2K3jG8c1zCVbp/o/bzQOyvzaKiCquKS7AaioPI28GNxIsE/zSx+EwWYsNxDCX95MA==} @@ -1691,9 +1674,11 @@ packages: '@vue/compiler-ssr': 3.2.37 '@vue/shared': 3.2.37 vue: 3.2.37 + dev: true /@vue/shared/3.2.37: resolution: {integrity: sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==} + dev: true /@vue/test-utils/2.0.1_vue@3.2.37: resolution: {integrity: sha512-4kt7Sw1gzXeQOsMqrwrQbmEiG8El4MP8P4hfxkmfXdUHf7yHa3xC5CQc0x2YyuhT41w2d4K4O0ZdRvZhGdZlow==} @@ -2552,6 +2537,7 @@ packages: /csstype/2.6.20: resolution: {integrity: sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==} + dev: true /dargs/7.0.0: resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} @@ -2577,22 +2563,12 @@ packages: /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true dependencies: ms: 2.0.0 dev: false /debug/3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true dependencies: ms: 2.1.3 dev: false @@ -3159,7 +3135,7 @@ packages: dependencies: confusing-browser-globals: 1.0.11 eslint: 8.19.0 - eslint-plugin-import: 2.26.0_b991b8cc37fbaea14375bc1442f912c5 + eslint-plugin-import: 2.26.0_eslint@8.19.0 object.assign: 4.1.2 object.entries: 1.1.5 semver: 6.3.0 @@ -3179,54 +3155,29 @@ packages: dependencies: debug: 3.2.7 resolve: 1.22.1 - transitivePeerDependencies: - - supports-color dev: false - /eslint-module-utils/2.7.3_0e410f8f48e63a2eb2da71474b5e1cf0: + /eslint-module-utils/2.7.3: resolution: {integrity: sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==} engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true dependencies: - '@typescript-eslint/parser': 5.30.3_eslint@8.19.0+typescript@4.7.4 debug: 3.2.7 - eslint-import-resolver-node: 0.3.6 find-up: 2.1.0 - transitivePeerDependencies: - - supports-color dev: false - /eslint-plugin-import/2.26.0_b991b8cc37fbaea14375bc1442f912c5: + /eslint-plugin-import/2.26.0_eslint@8.19.0: resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} engines: {node: '>=4'} peerDependencies: - '@typescript-eslint/parser': '*' eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true dependencies: - '@typescript-eslint/parser': 5.30.3_eslint@8.19.0+typescript@4.7.4 array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 doctrine: 2.1.0 eslint: 8.19.0 eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.3_0e410f8f48e63a2eb2da71474b5e1cf0 + eslint-module-utils: 2.7.3 has: 1.0.3 is-core-module: 2.9.0 is-glob: 4.0.3 @@ -3234,10 +3185,6 @@ packages: object.values: 1.1.5 resolve: 1.22.1 tsconfig-paths: 3.14.1 - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color dev: false /eslint-plugin-vue/9.1.1_eslint@8.19.0: @@ -5026,8 +4973,6 @@ packages: mime: 1.6.0 needle: 3.1.0 source-map: 0.6.1 - transitivePeerDependencies: - - supports-color dev: false /leven/3.1.0: @@ -5118,6 +5063,7 @@ packages: hasBin: true dependencies: js-tokens: 4.0.0 + dev: true /lower-case/2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} @@ -5152,6 +5098,7 @@ packages: resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} dependencies: sourcemap-codec: 1.4.8 + dev: true /make-dir/2.1.0: resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} @@ -5360,8 +5307,6 @@ packages: debug: 3.2.7 iconv-lite: 0.6.3 sax: 1.2.4 - transitivePeerDependencies: - - supports-color dev: false optional: true @@ -5981,13 +5926,11 @@ packages: resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} peerDependencies: react: ^18.2.0 - peerDependenciesMeta: - react: - optional: true dependencies: loose-envify: 1.4.0 react: 18.2.0 scheduler: 0.23.0 + dev: true /react-is/17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} @@ -5998,6 +5941,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: loose-envify: 1.4.0 + dev: true /read-pkg-up/3.0.0: resolution: {integrity: sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==} @@ -6260,6 +6204,7 @@ packages: resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} dependencies: loose-envify: 1.4.0 + dev: true /section-matter/1.0.0: resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} @@ -6380,6 +6325,7 @@ packages: /sourcemap-codec/1.4.8: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} + dev: true /spdx-correct/3.1.1: resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} @@ -6981,6 +6927,7 @@ packages: '@vue/runtime-dom': 3.2.37 '@vue/server-renderer': 3.2.37_vue@3.2.37 '@vue/shared': 3.2.37 + dev: true /w3c-hr-time/1.0.2: resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==}