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

[Bug report] create-vuepress is not working properly #202

Closed
ditoukanyun opened this issue Jun 6, 2024 · 10 comments
Closed

[Bug report] create-vuepress is not working properly #202

ditoukanyun opened this issue Jun 6, 2024 · 10 comments
Assignees
Labels
bug Something isn't working package:create-vuepress

Comments

@ditoukanyun
Copy link

Description

pnpm create vuepress vuepress-starter

"docs:dev": "vuepress dev docs",

image

Reproduction

1

Used Package Manager

pnpm

System Info

"vuepress": "^2.0.0-rc.7",
@Alanyaeer
Copy link

I encountered the same issue when building VuePress today.

Copy link

github-actions bot commented Jun 7, 2024

Hello @ditoukanyun. Please provide a minimal reproduction using a GitHub repository or v2.vuepress.vuejs.org/new. Issues marked with need reproduction will be closed if they have no activity within 7 days.

@meteorlxy
Copy link
Member

meteorlxy commented Jun 7, 2024

I see, the create-vuepress package is still using old version. Please add tests for the package, cuz it's the first recommended setup in our docs @pengzhanbo @Mister-Hope

@meteorlxy meteorlxy transferred this issue from vuepress/core Jun 7, 2024
@meteorlxy meteorlxy changed the title [Bug report] Failed to resolve import "@vuepress/plugin-theme-data/client" from "docs/.vuepress/.cache/deps/chunk-TRDB2MBY.js?v=88d8bd57". Does the file exist? [Bug report] create-vuepress is not working properly Jun 7, 2024
@meteorlxy meteorlxy added bug Something isn't working package:create-vuepress labels Jun 7, 2024
@Mister-Hope
Copy link
Member

Mister-Hope commented Jun 7, 2024

Yes, because lerna won't bump that package unless it's code has been changed.

@meteorlxy @pengzhanbo any ideas to have its version bumped automatically while ensuring core and ecosystem are not misaligned (while core just released a new version)?

My current idea is to add those deps in to devDeps and config graphType in lerna publish config to all

@pengzhanbo
Copy link
Member

pengzhanbo commented Jun 9, 2024

@meteorlxy @Mister-Hope

We can use pacote to check the latest version numbers of vuepress@next and @vuepress/*@next, and then insert them into package.json. This way, create-vuepress will not be strongly coupled with the versions.

Just like this:

const res = await pacote.packument('vuepress')
const distTags = res['dist-tags']
console.log(distTags['next'])

Alternatively,wen can dynamically install vuepress@next, @vuepress/*@next, and other packages using install-pkg after generating the project to ensure that the installed package contents are always up-to-date.

@Mister-Hope
Copy link
Member

Alternatively,wen can dynamically install vuepress@next, @vuepress/*@next, and other packages using install-pkg after generating the project to ensure that the installed package contents are always up-to-date.

We couldn't. Like I said before, there could be times where core release a new version and the ecosystem has not suport it.

The helper should always try to use core version that ecosystem supports.

@Mister-Hope
Copy link
Member

Mister-Hope commented Jun 9, 2024

The simplest hack could be announcing all the needed packages as optional peers and reference them as workspace, So that the package could be automatically bumped and get the correct version in this repo.

The version can be obtained later by importing the package.json

@pengzhanbo
Copy link
Member

The vuepress/core repository uses the combination of bumpp + pnpm publish -r to ensure that all packages within the repository have the same version number. Perhaps vuepress/ecosystem should also consider implementing having all packages within the repository share the same version number.

Subsequently, we can utilize this approach to use pacote to retrieve package information for @vuepress/theme-default, including its version number and the vuepress version number from its peer deps, in order to determine the versions of other packages that should be installed.

@Mister-Hope
Copy link
Member

Perhaps vuepress/ecosystem should also consider implementing having all packages within the repository share the same version number.

Absolutely, no. We use lerna, Because we want to make sure if a single plugin is modified then other unrelated packages won't release any new versions.

You may annoy users if they found the plugins and theme-default are bumped for no reason.

Once vp turned into stable, then we may remove the work space protocol in the package.json, And make it a minor version range.

@Mister-Hope
Copy link
Member

e8da8b8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package:create-vuepress
Projects
None yet
Development

No branches or pull requests

5 participants