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

npx @dcloudio/uvm@latest会更新成alpha版本,easycome模式有问题 #4895

Open
Sharang-heng opened this issue May 10, 2024 · 6 comments

Comments

@Sharang-heng
Copy link

我执行完之后package.json会变成
image
导致我想利用easycome模式引入components下的组件会失效
image
在小程序上的效果是
image
发现会没有components

@zhouyu1993
Copy link

+1。npx @dcloudio/uvm@latest会更新成alpha版本

@Xiphin
Copy link

Xiphin commented May 18, 2024

+1

@zhouyu1993
Copy link

zhouyu1993 commented May 18, 2024 via email

@Ttou
Copy link

Ttou commented May 21, 2024

+1

1 similar comment
@zebraoo
Copy link

zebraoo commented May 24, 2024

+1

@zhouyu1993
Copy link

zhouyu1993 commented May 24, 2024

@dcloudio/uvm

/@dcloudio/uvm/lib/version.js

function compare (version, oAlpha, ov1, ov2, ov3, ov4, ov5, strict) {
    const dataDiff = approximateDate(tv4 || ov4, ov4)
    const fix = dataDiff + Number(ov5)
    if (
         approximateCode(tv1, ov1) &&
         approximateCode(tv2, ov2, strict) &&
         approximateCode(tv3, ov3, strict) &&
         dataDiff &&
         fix > nextVersionFix
    ) {
      if (vue3 || tAlpha === oAlpha) {
        nextVersion = version
        nextVersionFix = fix
      }
    }
}

@dcloudio/vue-cli-plugin-uni 里面包含了正式版和 alpha 版,比如:

[
"3.0.0-alpha-4010520240507001",
"3.0.0-4010520240507001"
]

这两个版本,一个 alpha 版,一个正式版,后面的 4010520240507001 是一样的,导致执行 npx @dcloudio/uvm@latest4.15.2024050802,安装成了前面的 3.0.0-alpha-4010520240507001 alpha 版本。

解决思路

if (vue3 || tAlpha === oAlpha) {

这一行判断似乎有问题?为啥 vue3 时就直接匹配了?

去掉 vue3,改成 if (tAlpha === oAlpha) {

或者改成 if (tAlpha === oAlpha || vue3) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants