From 9663ae3f56772b11188a67a22a1614f6afd9a2be Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Fri, 26 Jan 2024 21:08:57 +0800 Subject: [PATCH 1/3] fix(create-vuepress): sync output folder with docs --- tools/create-vuepress/src/flow/createPackageJson.ts | 6 +++--- tools/create-vuepress/src/flow/generateTemplate.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/create-vuepress/src/flow/createPackageJson.ts b/tools/create-vuepress/src/flow/createPackageJson.ts index 94d3b76901..6a3c1f572d 100644 --- a/tools/create-vuepress/src/flow/createPackageJson.ts +++ b/tools/create-vuepress/src/flow/createPackageJson.ts @@ -87,11 +87,11 @@ export const createPackageJson = async ({ type: 'module', scripts: { // eslint-disable-next-line @typescript-eslint/naming-convention - 'docs:build': `vuepress build src`, + 'docs:build': `vuepress build docs`, // eslint-disable-next-line @typescript-eslint/naming-convention - 'docs:clean-dev': `vuepress dev src --clean-cache`, + 'docs:clean-dev': `vuepress dev docs --clean-cache`, // eslint-disable-next-line @typescript-eslint/naming-convention - 'docs:dev': `vuepress dev src`, + 'docs:dev': `vuepress dev docs`, // eslint-disable-next-line @typescript-eslint/naming-convention 'docs:update-package': `${ packageManager === 'npm' ? 'npx' : `${packageManager} dlx` diff --git a/tools/create-vuepress/src/flow/generateTemplate.ts b/tools/create-vuepress/src/flow/generateTemplate.ts index e2e5e19194..e3dfd97935 100644 --- a/tools/create-vuepress/src/flow/generateTemplate.ts +++ b/tools/create-vuepress/src/flow/generateTemplate.ts @@ -83,7 +83,7 @@ ${ NODE_OPTIONS: --max_old_space_size=8192 run: |- ${packageManager} run docs:build - > src/.vuepress/dist/.nojekyll + > docs/.vuepress/dist/.nojekyll - name: ${lang === '简体中文' ? '部署文档' : 'Deploy Docs'} uses: JamesIves/github-pages-deploy-action@v4 @@ -94,7 +94,7 @@ ${ : 'This is the branch where the docs are deployed to' } branch: gh-pages - folder: src/.vuepress/dist + folder: docs/.vuepress/dist ` interface GenerateTemplateOptions { @@ -128,9 +128,9 @@ export const generateTemplate = async ({ console.log(locale.flow.generateTemplate) // copy template - copy(join(templateFolder, preset), join(targetDirPath, 'src')) + copy(join(templateFolder, preset), join(targetDirPath, 'docs')) - const configFilePath = join(targetDirPath, 'src/.vuepress/config.js') + const configFilePath = join(targetDirPath, 'docs/.vuepress/config.js') const content = readFileSync(configFilePath, { encoding: 'utf-8' }) From fbc51a34442ec8c5212ad63b92f42b86467c318b Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Fri, 26 Jan 2024 22:39:58 +0800 Subject: [PATCH 2/3] chore: update import --- tools/create-vuepress/src/flow/createPackageJson.ts | 1 - tools/create-vuepress/template/blog/.vuepress/blog-plugin.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/create-vuepress/src/flow/createPackageJson.ts b/tools/create-vuepress/src/flow/createPackageJson.ts index 6a3c1f572d..ca9e4834a5 100644 --- a/tools/create-vuepress/src/flow/createPackageJson.ts +++ b/tools/create-vuepress/src/flow/createPackageJson.ts @@ -45,7 +45,6 @@ export const createPackageJson = async ({ } if (preset === 'blog') { - devDependencies['@vuepress/core'] = '^2.0.0-rc.2' devDependencies['vue-router'] = '^4.2.5' } diff --git a/tools/create-vuepress/template/blog/.vuepress/blog-plugin.js b/tools/create-vuepress/template/blog/.vuepress/blog-plugin.js index dccdb0f112..8bb07e36bd 100644 --- a/tools/create-vuepress/template/blog/.vuepress/blog-plugin.js +++ b/tools/create-vuepress/template/blog/.vuepress/blog-plugin.js @@ -1,4 +1,4 @@ -import { createPage } from '@vuepress/core' +import { createPage } from 'vuepress/core' const slugify = (name) => name From 54cb6e3209cc5fd35fe3c6d97809308ff5af08d6 Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Sat, 27 Jan 2024 00:00:01 +0800 Subject: [PATCH 3/3] chore: remove client --- tools/create-vuepress/src/flow/createPackageJson.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/create-vuepress/src/flow/createPackageJson.ts b/tools/create-vuepress/src/flow/createPackageJson.ts index ca9e4834a5..a9c9b356f2 100644 --- a/tools/create-vuepress/src/flow/createPackageJson.ts +++ b/tools/create-vuepress/src/flow/createPackageJson.ts @@ -35,9 +35,7 @@ export const createPackageJson = async ({ bundler, }: CreatePackageJsonOptions): Promise => { const packageJsonPath = join(targetDir, 'package.json') - // TODO: Update it const devDependencies = { - '@vuepress/client': '^2.0.0-rc.2', [`@vuepress/bundler-${bundler}`]: '^2.0.0-rc.2', '@vuepress/theme-default': '^2.0.0-rc.2', 'vue': '^3.4.0',