-
Notifications
You must be signed in to change notification settings - Fork 393
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]: 3.0 版本后使用 npm 安装失败,提示 Unsupported URL Type "workspace:": workspace:1.0.0-alpha.5 #2328
Comments
@Mister-Hope 是不是这些依赖应该都放在 devDep 里面?https://github.com/walinejs/waline/blob/main/packages/client/package.json#L84-L92 @Mister-Hope Should all these dependencies be placed in devDep? https://github.com/walinejs/waline/blob/main/packages/client/package.json#L84-L92 |
Nope,.the slim bundle is the default entry on node, so perhaps your workflow are still problematic. |
@Mister-Hope 有两种解决办法,一种是将 @Mister-Hope There are two solutions. One is to package |
原则上使用workspace:* 对于pnpm发布是没问题的。只是ci有问题而已 In principle, there is no problem using workspace:* for pnpm publishing. It’s just a problem with ci |
@Mister-Hope CI和发布都没有问题,现在是package.json中依赖写的还是workspace,所以导致了在其他项目里安装出错了。这种monorepo项目的依赖内部引用一般对外的产物都是bundle后文件,所以前端引用bundle后的产物是没有问题的,所以我才提了第一个问题是否是放在devDep的。如果要提供未bundle的版本给node使用的话,要么就是把workspace的依赖bundle进去,要么就是workspace的依赖发包改成非workspace依赖,对应着我说的两个方案。 @Mister-Hope There are no problems with CI and release. Now the dependencies in package.json are written in workspace, which causes installation errors in other projects. This kind of monorepo project relies on internal references. Generally, the external products are bundled files, so there is no problem in the front end referencing the bundled products, so I asked the first question whether it is placed in devDep. If you want to provide an unbundled version for node to use, you must either add the workspace dependency into the bundle, or change the workspace dependency outsourcing to a non-workspace dependency, which corresponds to the two solutions I mentioned. |
大哥别犟,我之前特意开了issue。如果你使用 pnpm publish命令发布任何含有workspace 协议的任何包,那么他们会在发布时基于workspace相关依赖的版本自动转换到对应的版本号范围。本质上就是你 CI 发布有问题。 换言之,无论是 dep peerDep 还是 devDep 的依赖,workspace protocal都是没问题,对于本地是 1.0.0 的版本,workspace:* workspace:~ workspace:^ 会自动通过 pnpm 发布的时候转换为 "1.0.0" "~1.0.0" 和 "^1.0.0"。 我不是很了解 npm 对于只能在特定 CI/CD 环境的限制具体有什么,但是一个最起码的解决办法是改一下workflow 自己手动检测当前版本是否已发布并手动 pnpm publish(如需要) Brother, don't be stubborn, I specially opened an issue before. If you use the pnpm publish command to publish any package containing the workspace protocol, they will automatically be converted to the corresponding version number range based on the version of the workspace-related dependencies when publishing. Essentially, there is a problem with your CI release. In other words, whether it is a dependency on dep peerDep or devDep, the workspace protocol is no problem. For the local version 1.0.0, workspace:* workspace:~ workspace:^ will automatically be converted to "1.0.0" when published through pnpm "~1.0.0" and "^1.0.0". I don't know much about npm's specific restrictions on specific CI/CD environments, but a minimum solution is to change the workflow to manually detect whether the current version has been published and manually pnpm publish (if necessary) |
@Mister-Hope 我觉得你可能没听明白我说的话的意思。那就按照你的理解来吧,CI 发布有问题,有两个解决方案,你选择一种,我来修改。 @Mister-Hope I think you may not understand what I mean. Then follow your understanding. There is a problem with CI release. There are two solutions. You choose one and I will modify it. |
我觉得我充分理解了你要表达的意思,但我不觉得你的观点是对的。 握有大量包含monorepo的项目都在用 pnpm,比如 vuepress/core vuepress/ecosystem vuepress-theme-hope/vuepress-theme-hope mdit-plugins/mdit-plugins 之类的。
(仅技术性讨论) I think I fully understand what you're trying to say, but I don't think your point is correct. A large number of projects containing monorepo are using pnpm, such as vuepress/core vuepress/ecosystem vuepress-theme-hope/vuepress-theme-hope mdit-plugins/mdit-plugins and the like.
(Technical discussion only) |
按照你说的 pnpm 的行为,我认为你会选择提到的方案二,那我就不多说了按照二来处理吧。
According to the behavior of pnpm you mentioned, I think you will choose the second option mentioned, so I won’t go into details and just handle it according to the second option. |
fixed with #2333 please update to |
问题描述 | Describe the bug
尝试在一个vue项目中引入waline时
如果使用yarn,会让我选择:
好像是新的 @waline/api 引入的问题?
在本机、docker容器中和GitHub Actions中尝试安装,都失败了,应该不是我环境的问题。
问题网站 | Website URL
null
服务部署在哪里? | Where your waline deploy?
Self Host
数据存储在哪里?| Where your comment data store?
PostgreSQL
The text was updated successfully, but these errors were encountered: