Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(create-vuepress): sync output folder with docs #29

Merged
merged 3 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions tools/create-vuepress/src/flow/createPackageJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@ export const createPackageJson = async ({
bundler,
}: CreatePackageJsonOptions): Promise<void> => {
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',
'vuepress': '^2.0.0-rc.2',
}

if (preset === 'blog') {
devDependencies['@vuepress/core'] = '^2.0.0-rc.2'
devDependencies['vue-router'] = '^4.2.5'
}

Expand Down Expand Up @@ -87,11 +84,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`
Expand Down
8 changes: 4 additions & 4 deletions tools/create-vuepress/src/flow/generateTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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' })

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPage } from '@vuepress/core'
import { createPage } from 'vuepress/core'

const slugify = (name) =>
name
Expand Down
Loading