From c12e31019c297134f00d0e85aa1794da536078f7 Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Tue, 5 Dec 2023 13:06:00 +0800 Subject: [PATCH] feat: remove vuepress-vite and vuepress-webpack package and support --bundler option --- .eslintrc.cjs | 20 ++++++ CONTRIBUTING.md | 4 +- CONTRIBUTING_zh.md | 6 +- packages/cli/package.json | 12 ++++ packages/cli/src/cli.ts | 1 + .../cli/src/commands/build/createBuild.ts | 2 +- packages/cli/src/commands/build/types.ts | 1 + packages/cli/src/commands/dev/createDev.ts | 2 +- packages/cli/src/commands/dev/types.ts | 1 + packages/cli/src/commands/info.ts | 2 - packages/cli/src/config/resolveAppConfig.ts | 2 +- packages/cli/src/config/resolveBundler.ts | 60 ++++++++++++++++ .../cli/src/config/resolveCliAppConfig.ts | 12 +++- packages/vuepress-vite/bin/vuepress.js | 7 -- packages/vuepress-vite/package.json | 71 ------------------ packages/vuepress-vite/src/index.ts | 3 - packages/vuepress-webpack/bin/vuepress.js | 7 -- packages/vuepress-webpack/package.json | 68 ------------------ packages/vuepress-webpack/src/index.ts | 3 - packages/vuepress/package.json | 38 +++++++++- packages/vuepress/src/cli.ts | 1 + packages/vuepress/src/client.ts | 1 + packages/vuepress/src/core.ts | 1 + packages/vuepress/src/index.ts | 3 +- packages/vuepress/src/markdown.ts | 1 + packages/vuepress/src/shared.ts | 1 + packages/vuepress/src/utils.ts | 1 + pnpm-lock.yaml | 72 ++++++------------- tsconfig.json | 4 +- vitest.config.ts | 2 +- 30 files changed, 177 insertions(+), 232 deletions(-) create mode 100644 packages/cli/src/config/resolveBundler.ts delete mode 100755 packages/vuepress-vite/bin/vuepress.js delete mode 100644 packages/vuepress-vite/package.json delete mode 100644 packages/vuepress-vite/src/index.ts delete mode 100755 packages/vuepress-webpack/bin/vuepress.js delete mode 100644 packages/vuepress-webpack/package.json delete mode 100644 packages/vuepress-webpack/src/index.ts create mode 100644 packages/vuepress/src/cli.ts create mode 100644 packages/vuepress/src/client.ts create mode 100644 packages/vuepress/src/core.ts create mode 100644 packages/vuepress/src/markdown.ts create mode 100644 packages/vuepress/src/shared.ts create mode 100644 packages/vuepress/src/utils.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index baf37994565..cb9903336b2 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -11,6 +11,26 @@ module.exports = { rules: { '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-non-null-assertion': 'off', + // FIXME: Need to update eslint-config-vuepress + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: [ + '**/tests/**', + '**/test/**', + '**/__tests__/**', + '**/__mocks__/**', + '**/.vuepress/**', + '**/*.{test,spec}.{js.ts}', + '**/.commitlintrc.{js,cjs}', + '**/.eslintrc.{js,cjs}', + '**/tsup.config.{js.ts}', + '**/vitest.config.{js.ts}', + '**/vuepress.config.{js.ts}', + ], + optionalDependencies: false, + }, + ], 'vue/multi-word-component-names': 'off', }, }, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 381eac5cb8a..51c5f9db6e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,9 +17,7 @@ In the `packages` directory: Here are some wrapper packages that use the above packages: -- `vuepress`: A wrapper of `vuepress-vite`. -- `vuepress-vite`: A wrapper of `@vuepress/cli` + `@vuepress/bundler-vite`. If users want to use vite, they can simply install this package. -- `vuepress-webpack`: A wrapper of `@vuepress/cli` + `@vuepress/bundler-webpack`. If users want to use webpack, they can simply install this package. +- `vuepress`: A wrapper the above packages, and provides `vuepress` command line tool. Users can choose bundler by themselves. ## Development Setup diff --git a/CONTRIBUTING_zh.md b/CONTRIBUTING_zh.md index 407e8f7b43d..138c1c01ffe 100644 --- a/CONTRIBUTING_zh.md +++ b/CONTRIBUTING_zh.md @@ -15,11 +15,7 @@ - `shared`: 既可以在 Node 端使用、也可以在客户端使用的工具函数模块。 - `utils`: 仅可以在 Node 端使用的工具函数模块。 -还有一些对上述 Package 进行封装后的 Package : - -- `vuepress`: 是 `vuepress-vite` 的封装。 -- `vuepress-vite`: 是 `@vuepress/cli` + `@vuepress/bundler-vite` 的封装。如果用户想使用 Vite ,仅安装这个 Package 就可以了。 -- `vuepress-webpack`: 是 `@vuepress/cli` + `@vuepress/bundler-webpack` 的封装。如果用户想使用 Webpack ,仅安装这个 Package 就可以了。 +- `vuepress`: 上述包的封装,提供了 `vuepress` 命令行工具并允许用户自选 Bundler。 ## 开发配置 diff --git a/packages/cli/package.json b/packages/cli/package.json index dfc26d0d154..3765b09d884 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -47,6 +47,18 @@ "devDependencies": { "@types/envinfo": "^7.8.3" }, + "peerDependencies": { + "@vuepress/bundler-vite": "workspace:*", + "@vuepress/bundler-webpack": "workspace:*" + }, + "peerDependenciesMeta": { + "@vuepress/bundler-vite": { + "optional": true + }, + "@vuepress/bundler-webpack": { + "optional": true + } + }, "publishConfig": { "access": "public" }, diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 4561cd04e24..380c4cd6091 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -25,6 +25,7 @@ export const cli = (defaultAppConfig: Partial = {}): void => { // register `dev` command program .command('dev [sourceDir]', 'Start development server') + .option('-b, --bundler ', 'Set bundler to use') .option('-c, --config ', 'Set path to config file') .option('-p, --port ', 'Use specified port (default: 8080)') .option('-t, --temp ', 'Set the directory of the temporary files') diff --git a/packages/cli/src/commands/build/createBuild.ts b/packages/cli/src/commands/build/createBuild.ts index 5828bdc5c8b..65670ea06be 100644 --- a/packages/cli/src/commands/build/createBuild.ts +++ b/packages/cli/src/commands/build/createBuild.ts @@ -26,7 +26,7 @@ export const createBuild = } // resolve app config from cli options - const cliAppConfig = resolveCliAppConfig(sourceDir, commandOptions) + const cliAppConfig = await resolveCliAppConfig(sourceDir, commandOptions) // resolve user config file const userConfigPath = commandOptions.config diff --git a/packages/cli/src/commands/build/types.ts b/packages/cli/src/commands/build/types.ts index 66126601ae7..f9e01c96cd0 100644 --- a/packages/cli/src/commands/build/types.ts +++ b/packages/cli/src/commands/build/types.ts @@ -20,4 +20,5 @@ export interface BuildCommandOptions { config?: string cleanTemp?: boolean cleanCache?: boolean + bundler?: 'vite' | 'webpack' } diff --git a/packages/cli/src/commands/dev/createDev.ts b/packages/cli/src/commands/dev/createDev.ts index d34a7b7f825..ed68ca8d4a0 100644 --- a/packages/cli/src/commands/dev/createDev.ts +++ b/packages/cli/src/commands/dev/createDev.ts @@ -29,7 +29,7 @@ export const createDev = (defaultAppConfig: Partial): DevCommand => { } // resolve app config from cli options - const cliAppConfig = resolveCliAppConfig(sourceDir, commandOptions) + const cliAppConfig = await resolveCliAppConfig(sourceDir, commandOptions) // resolve user config file const userConfigPath = commandOptions.config diff --git a/packages/cli/src/commands/dev/types.ts b/packages/cli/src/commands/dev/types.ts index ae16d3e7b5b..d3680d21df9 100644 --- a/packages/cli/src/commands/dev/types.ts +++ b/packages/cli/src/commands/dev/types.ts @@ -23,4 +23,5 @@ export interface DevCommandOptions { cleanTemp?: boolean cleanCache?: boolean watch?: boolean + bundler?: 'vite' | 'webpack' } diff --git a/packages/cli/src/commands/info.ts b/packages/cli/src/commands/info.ts index b0e9066b5c7..edc9f110171 100644 --- a/packages/cli/src/commands/info.ts +++ b/packages/cli/src/commands/info.ts @@ -40,8 +40,6 @@ export const info = async (): Promise => { '@vuepress/theme-default', '@vuepress/utils', 'vuepress', - 'vuepress-vite', - 'vuepress-webpack', 'vue', 'vue-router', 'vue-loader', diff --git a/packages/cli/src/config/resolveAppConfig.ts b/packages/cli/src/config/resolveAppConfig.ts index 2d1089d382e..e8a225a241a 100644 --- a/packages/cli/src/config/resolveAppConfig.ts +++ b/packages/cli/src/config/resolveAppConfig.ts @@ -20,7 +20,7 @@ export const resolveAppConfig = ({ }): AppConfig | null => { const appConfig = { // allow setting default app config via `cli()` - // for example, set different default bundler in `vuepress` and `vuepress-vite` package + // for example, set different default bundler in wrapper bins ...defaultAppConfig, // use cli options to override config file ...userConfig, diff --git a/packages/cli/src/config/resolveBundler.ts b/packages/cli/src/config/resolveBundler.ts new file mode 100644 index 00000000000..6703fb34234 --- /dev/null +++ b/packages/cli/src/config/resolveBundler.ts @@ -0,0 +1,60 @@ +import type { Bundler } from '@vuepress/core' +import { colors, logger } from '@vuepress/utils' + +export const resolveBundler = async ( + bundler: 'vite' | 'webpack' | undefined, +): Promise => { + if (bundler === 'vite') { + try { + const { viteBundler } = await import('@vuepress/bundler-vite') + + return viteBundler() + } catch (e) { + logger.error( + `You need to install dependency ${colors.magenta( + '@vuepress/bundler-vite', + )} to use vite bundler.`, + ) + + throw e + } + } + + if (bundler === 'webpack') { + try { + const { webpackBundler } = await import('@vuepress/bundler-webpack') + + return webpackBundler() + } catch (e) { + logger.error( + `You need to install dependency ${colors.magenta( + '@vuepress/bundler-webpack', + )} to use webpack bundler.`, + ) + + throw e + } + } + + if (bundler) throw new Error(`Unsupported bundler: ${bundler}`) + + try { + const { viteBundler } = await import('@vuepress/bundler-vite') + + return viteBundler() + } catch (e) { + try { + const { webpackBundler } = await import('@vuepress/bundler-webpack') + + return webpackBundler() + } catch (e) { + logger.error( + `You need to install a bundler, choose from ${colors.magenta( + '@vuepress/bundler-vite', + )} and ${colors.magenta('@vuepress/bundler-webpack')}.`, + ) + + throw e + } + } +} diff --git a/packages/cli/src/config/resolveCliAppConfig.ts b/packages/cli/src/config/resolveCliAppConfig.ts index ffd784de140..5eefaf7f14c 100644 --- a/packages/cli/src/config/resolveCliAppConfig.ts +++ b/packages/cli/src/config/resolveCliAppConfig.ts @@ -1,6 +1,7 @@ import process from 'node:process' import type { AppConfig } from '@vuepress/core' import { path } from '@vuepress/utils' +import { resolveBundler } from './resolveBundler' const OPTIONS_COMMON = ['debug', 'open', 'port', 'host'] as const const OPTIONS_DIRECTORY = ['cache', 'dest', 'temp'] as const @@ -8,11 +9,13 @@ const OPTIONS_DIRECTORY = ['cache', 'dest', 'temp'] as const /** * Resolve app config according to command options of cli */ -export const resolveCliAppConfig = ( +export const resolveCliAppConfig = async ( sourceDir: string, - commandOptions: Partial, + commandOptions: Omit, 'bundler'> & { + bundler?: 'vite' | 'webpack' + }, cwd = process.cwd(), -): Partial & Pick => { +): Promise & Pick> => { // resolve the source directory const source = path.resolve(cwd, sourceDir) @@ -34,5 +37,8 @@ export const resolveCliAppConfig = ( } }) + // set bundler + appConfig.bundler = await resolveBundler(commandOptions.bundler) + return appConfig } diff --git a/packages/vuepress-vite/bin/vuepress.js b/packages/vuepress-vite/bin/vuepress.js deleted file mode 100755 index 1753e3f4a19..00000000000 --- a/packages/vuepress-vite/bin/vuepress.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node - -import { viteBundler } from '@vuepress/bundler-vite' -import { cli } from '@vuepress/cli' - -// set default bundler -cli({ bundler: viteBundler() }) diff --git a/packages/vuepress-vite/package.json b/packages/vuepress-vite/package.json deleted file mode 100644 index b57e3dba71b..00000000000 --- a/packages/vuepress-vite/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "vuepress-vite", - "version": "2.0.0-rc.0", - "description": "Vue-powered Static Site Generator", - "keywords": [ - "documentation", - "generator", - "vue", - "vuepress" - ], - "homepage": "https://github.com/vuepress", - "bugs": { - "url": "https://github.com/vuepress/vuepress-next/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/vuepress/vuepress-next.git" - }, - "license": "MIT", - "author": "meteorlxy", - "type": "module", - "exports": { - ".": "./dist/index.js", - "./bin": "./bin/vuepress.js", - "./package.json": "./package.json" - }, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "bin": { - "vuepress": "./bin/vuepress.js", - "vuepress-vite": "./bin/vuepress.js" - }, - "files": [ - "bin", - "dist" - ], - "scripts": { - "build": "tsup", - "clean": "rimraf dist" - }, - "dependencies": { - "@vuepress/bundler-vite": "workspace:*", - "@vuepress/cli": "workspace:*", - "@vuepress/core": "workspace:*", - "vue": "^3.3.9" - }, - "devDependencies": { - "@vuepress/client": "workspace:*" - }, - "peerDependencies": { - "@vuepress/client": "workspace:*", - "vue": "^3.3.4" - }, - "engines": { - "node": ">=18.16.0" - }, - "tsup": { - "clean": true, - "dts": "./src/index.ts", - "entry": [ - "./src/index.ts" - ], - "format": [ - "esm" - ], - "outDir": "./dist", - "sourcemap": false, - "target": "es2022", - "tsconfig": "../../tsconfig.dts.json" - } -} diff --git a/packages/vuepress-vite/src/index.ts b/packages/vuepress-vite/src/index.ts deleted file mode 100644 index b69b7b0a550..00000000000 --- a/packages/vuepress-vite/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from '@vuepress/bundler-vite' -export * from '@vuepress/cli' -export * from '@vuepress/core' diff --git a/packages/vuepress-webpack/bin/vuepress.js b/packages/vuepress-webpack/bin/vuepress.js deleted file mode 100755 index 2d0030e132a..00000000000 --- a/packages/vuepress-webpack/bin/vuepress.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node - -import { webpackBundler } from '@vuepress/bundler-webpack' -import { cli } from '@vuepress/cli' - -// set default bundler -cli({ bundler: webpackBundler() }) diff --git a/packages/vuepress-webpack/package.json b/packages/vuepress-webpack/package.json deleted file mode 100644 index d8b64662be4..00000000000 --- a/packages/vuepress-webpack/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "vuepress-webpack", - "version": "2.0.0-rc.0", - "description": "Vue-powered Static Site Generator", - "keywords": [ - "documentation", - "generator", - "vue", - "vuepress" - ], - "homepage": "https://github.com/vuepress", - "bugs": { - "url": "https://github.com/vuepress/vuepress-next/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/vuepress/vuepress-next.git" - }, - "license": "MIT", - "author": "meteorlxy", - "type": "module", - "exports": { - ".": "./dist/index.js", - "./bin": "./bin/vuepress.js", - "./package.json": "./package.json" - }, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "bin": { - "vuepress": "./bin/vuepress.js", - "vuepress-webpack": "./bin/vuepress.js" - }, - "files": [ - "bin", - "dist" - ], - "scripts": { - "build": "tsup", - "clean": "rimraf dist" - }, - "dependencies": { - "@vuepress/bundler-webpack": "workspace:*", - "@vuepress/cli": "workspace:*", - "@vuepress/core": "workspace:*", - "sass-loader": "^13.3.2", - "vue": "^3.3.9" - }, - "peerDependencies": { - "vue": "^3.3.4" - }, - "engines": { - "node": ">=18.16.0" - }, - "tsup": { - "clean": true, - "dts": "./src/index.ts", - "entry": [ - "./src/index.ts" - ], - "format": [ - "esm" - ], - "outDir": "./dist", - "sourcemap": false, - "target": "es2022", - "tsconfig": "../../tsconfig.dts.json" - } -} diff --git a/packages/vuepress-webpack/src/index.ts b/packages/vuepress-webpack/src/index.ts deleted file mode 100644 index 51c63b1523f..00000000000 --- a/packages/vuepress-webpack/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from '@vuepress/bundler-webpack' -export * from '@vuepress/cli' -export * from '@vuepress/core' diff --git a/packages/vuepress/package.json b/packages/vuepress/package.json index f983c841902..16a399e9e7d 100644 --- a/packages/vuepress/package.json +++ b/packages/vuepress/package.json @@ -22,6 +22,11 @@ "exports": { ".": "./dist/index.js", "./bin": "./bin/vuepress.js", + "./core": "./dist/core.js", + "./client": "./dist/client.js", + "./markdown": "./dist/markdown.js", + "./shared": "./dist/shared.js", + "./utils": "./dist/utils.js", "./package.json": "./package.json" }, "main": "./dist/index.js", @@ -38,15 +43,42 @@ "clean": "rimraf dist" }, "dependencies": { - "vuepress-vite": "workspace:*" + "@vuepress/cli": "workspace:*", + "@vuepress/client": "workspace:*", + "@vuepress/core": "workspace:*", + "@vuepress/markdown": "workspace:*", + "@vuepress/shared": "workspace:*", + "@vuepress/utils": "workspace:*" }, - "engines": { - "node": ">=18.16.0" + "devDependencies": { + "@types/envinfo": "^7.8.3" + }, + "peerDependencies": { + "@vuepress/bundler-vite": "workspace:*", + "@vuepress/bundler-webpack": "workspace:*", + "vue": "^3.3.4" + }, + "peerDependenciesMeta": { + "@vuepress/bundler-vite": { + "optional": true + }, + "@vuepress/bundler-webpack": { + "optional": true + } + }, + "publishConfig": { + "access": "public" }, "tsup": { "clean": true, "dts": "./src/index.ts", "entry": [ + "./src/core.ts", + "./src/cli.ts", + "./src/client.ts", + "./src/markdown.ts", + "./src/shared.ts", + "./src/utils.ts", "./src/index.ts" ], "format": [ diff --git a/packages/vuepress/src/cli.ts b/packages/vuepress/src/cli.ts new file mode 100644 index 00000000000..fd1e8bdbc77 --- /dev/null +++ b/packages/vuepress/src/cli.ts @@ -0,0 +1 @@ +export * from '@vuepress/cli' diff --git a/packages/vuepress/src/client.ts b/packages/vuepress/src/client.ts new file mode 100644 index 00000000000..57c6b046c48 --- /dev/null +++ b/packages/vuepress/src/client.ts @@ -0,0 +1 @@ +export * from '@vuepress/client' diff --git a/packages/vuepress/src/core.ts b/packages/vuepress/src/core.ts new file mode 100644 index 00000000000..e79b01dffde --- /dev/null +++ b/packages/vuepress/src/core.ts @@ -0,0 +1 @@ +export * from '@vuepress/core' diff --git a/packages/vuepress/src/index.ts b/packages/vuepress/src/index.ts index 99b96bf30a6..ea1aa3cbd7a 100644 --- a/packages/vuepress/src/index.ts +++ b/packages/vuepress/src/index.ts @@ -1 +1,2 @@ -export * from 'vuepress-vite' +export * from './cli.js' +export * from './core.js' diff --git a/packages/vuepress/src/markdown.ts b/packages/vuepress/src/markdown.ts new file mode 100644 index 00000000000..690b8c35f46 --- /dev/null +++ b/packages/vuepress/src/markdown.ts @@ -0,0 +1 @@ +export * from '@vuepress/markdown' diff --git a/packages/vuepress/src/shared.ts b/packages/vuepress/src/shared.ts new file mode 100644 index 00000000000..89bac4b7632 --- /dev/null +++ b/packages/vuepress/src/shared.ts @@ -0,0 +1 @@ +export * from '@vuepress/shared' diff --git a/packages/vuepress/src/utils.ts b/packages/vuepress/src/utils.ts new file mode 100644 index 00000000000..c7187011393 --- /dev/null +++ b/packages/vuepress/src/utils.ts @@ -0,0 +1 @@ +export * from '@vuepress/utils' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 601ac25994d..1402c375a77 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -197,6 +197,12 @@ importers: packages/cli: dependencies: + '@vuepress/bundler-vite': + specifier: workspace:* + version: link:../bundler-vite + '@vuepress/bundler-webpack': + specifier: workspace:* + version: link:../bundler-webpack '@vuepress/core': specifier: workspace:* version: link:../core @@ -360,47 +366,38 @@ importers: version: 2.0.1 packages/vuepress: - dependencies: - vuepress-vite: - specifier: workspace:* - version: link:../vuepress-vite - - packages/vuepress-vite: dependencies: '@vuepress/bundler-vite': specifier: workspace:* version: link:../bundler-vite - '@vuepress/cli': - specifier: workspace:* - version: link:../cli - '@vuepress/core': - specifier: workspace:* - version: link:../core - vue: - specifier: ^3.3.9 - version: 3.3.9(typescript@5.3.2) - devDependencies: - '@vuepress/client': - specifier: workspace:* - version: link:../client - - packages/vuepress-webpack: - dependencies: '@vuepress/bundler-webpack': specifier: workspace:* version: link:../bundler-webpack '@vuepress/cli': specifier: workspace:* version: link:../cli + '@vuepress/client': + specifier: workspace:* + version: link:../client '@vuepress/core': specifier: workspace:* version: link:../core - sass-loader: - specifier: ^13.3.2 - version: 13.3.2(webpack@5.89.0) + '@vuepress/markdown': + specifier: workspace:* + version: link:../markdown + '@vuepress/shared': + specifier: workspace:* + version: link:../shared + '@vuepress/utils': + specifier: workspace:* + version: link:../utils vue: - specifier: ^3.3.9 + specifier: ^3.3.4 version: 3.3.9(typescript@5.3.2) + devDependencies: + '@types/envinfo': + specifier: ^7.8.3 + version: 7.8.3 packages: @@ -6139,29 +6136,6 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: false - /sass-loader@13.3.2(webpack@5.89.0): - resolution: {integrity: sha512-CQbKl57kdEv+KDLquhC+gE3pXt74LEAzm+tzywcA0/aHZuub8wTErbjAoNI57rPUWRYRNC5WUnNl8eGJNbDdwg==} - engines: {node: '>= 14.15.0'} - peerDependencies: - fibers: '>= 3.1.0' - node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 - sass: ^1.3.0 - sass-embedded: '*' - webpack: ^5.0.0 - peerDependenciesMeta: - fibers: - optional: true - node-sass: - optional: true - sass: - optional: true - sass-embedded: - optional: true - dependencies: - neo-async: 2.6.2 - webpack: 5.89.0(esbuild@0.19.8) - dev: false - /schema-utils@3.3.0: resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} engines: {node: '>= 10.13.0'} diff --git a/tsconfig.json b/tsconfig.json index 139eabb236d..cd3e4537f8b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,9 +6,7 @@ "paths": { "@internal/*": ["./packages/client/src/types/internal/*.d.ts"], "@vuepress/*": ["./packages/*/src"], - "vuepress": ["./packages/vuepress/src"], - "vuepress-vite": ["./packages/vuepress-vite/src"], - "vuepress-webpack": ["./packages/vuepress-webpack/src"] + "vuepress": ["./packages/vuepress/src"] }, "types": ["webpack-env", "vite/client"] }, diff --git a/vitest.config.ts b/vitest.config.ts index a5925acf9f0..47fd2b886d1 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -8,7 +8,7 @@ const getSubDirectories = (dir: string): string[] => .readdirSync(dir) .filter((item) => fs.statSync(path.join(dir, item)).isDirectory()) const root = path.dirname(fileURLToPath(import.meta.url)) -const nonScopedPackages = ['vuepress', 'vuepress-vite', 'vuepress-webpack'] +const nonScopedPackages = ['vuepress'] const packages = getSubDirectories(path.resolve(root, 'packages')).filter( (item) => !nonScopedPackages.includes(item), )