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

Support Yarn install #629

Closed
mojosoeun opened this issue Aug 21, 2023 · 4 comments
Closed

Support Yarn install #629

mojosoeun opened this issue Aug 21, 2023 · 4 comments
Labels
discussion 💭 Need to be discussed

Comments

@mojosoeun
Copy link
Member

Description:
Nowadays, many JavaScript developers install their packages through npm or yarn. However, currently we do not support yarn install. To improve the developer experience, it would be great if we could also support yarn install

Why:

yarn install v1.22.4
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
error Workspaces can only be enabled in private projects.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
@hackerwins hackerwins added the discussion 💭 Need to be discussed label Aug 22, 2023
@blurfx
Copy link
Member

blurfx commented Sep 5, 2023

Each package manager has a different way of managing dependencies, so it's probably better to use one package manager than to support multiple package managers.

I agree with using other package managers with a better developer experience (personally, I prefer pnpm). but for now, there is any other reasons to use a another package manager than npm?

@mojosoeun
Copy link
Member Author

mojosoeun commented Sep 10, 2023

@blurfx Thank you for your comment!

Each package manager has a different way of managing dependencies

When it comes to this comment, could you elaborate on it?

If I understand it correctly, In my view, we can manage dependencies with yarn.lock file without having package-lock.json. Also, yarn supports installing packages with package-lock.json. https://classic.yarnpkg.com/blog/2018/06/04/yarn-import-package-lock/ But they recommend using yarn.lock instead of package-lock.json. The reason why user can't install packages using yarn when user setup yorkie-js-sdk, because we have workspace config in the package.json. So if we resolve this issue, I think we can support yarn install.

For more reference,
yarnpkg/yarn#8580
TexteaInc/json-viewer#143
yarnpkg/yarn#8580 (comment)

@blurfx
Copy link
Member

blurfx commented Sep 11, 2023

@mojosoeun I did a little more research and while there was a definite difference in the past (before npm@7), there doesn't seem to be much of a difference these days.

I also checked and tried out the yarn import, but I didn't worked well with even simple project and there is unresolved related issues 😕. yeah so.. if we're going to support yarn (if we're going to use yarn), it seems like we should use a yarn workspace instead of npm workspace.

@hackerwins
Copy link
Member

I don't believe it is necessary for a single project to support multiple package managers at the same time. However, if there are benefits to switching to another package manager, I believe it would be a good decision to explore this option.

I will close this issue for now. Please reopen this issue if we can find the benefits of the replacement.

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

No branches or pull requests

3 participants