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

Remove workspace from package.json #228

Closed

Conversation

s-a-tanjim
Copy link

@s-a-tanjim s-a-tanjim commented Feb 28, 2024

The problem is, when we try to build using Yarn, it gives an error Workspaces can only be enabled in private projects. Yarn intentionally does this. You can find the issue here: yarnpkg/yarn#8580.
And in this doc, they said,
Note that the private: true is required! Workspaces are not meant to be published, so we’ve added this safety measure to make sure that nothing can accidentally expose them.

@lenkan lenkan self-requested a review February 28, 2024 09:28
@lenkan
Copy link
Collaborator

lenkan commented Feb 28, 2024

I would advise to use npm instead. As you can see there is no yarn.lock file used in this repo.

Also, npm themselves use this exact set up for integration tests in a workspace repo: https://github.com/npm/cli/blob/7a858277171813b37d46a032e49db44c8624f78f/package.json#L5-L9.

Edit: the implication of this change is that you have to move the dependencies from the integration test package up to the root package.

@s-a-tanjim
Copy link
Author

s-a-tanjim commented Feb 28, 2024

The problem is not with this project. We have another project that has the signify-ts dependency. We use Yarn there. If we use npmjs (ie: "signify-ts": "0.2.1") in package.json it doesn't create the problem. But when we use github url (ie: "signify-ts": "https://github.com/WebOfTrust/signify-ts.git"), then Yarn doesn't let us build the project. We have to use github url because npmjs doesn't get updates frequently. So if we can't solve this issue here, maybe we need to migrate our project into npm.

@lenkan
Copy link
Collaborator

lenkan commented Feb 29, 2024

I haven't used yarn recently I don't have any other suggestions. But perhaps another solution is to start publishing this package on every commit. There is an issue for it #127.

Meanwhile you could publish a scoped version of the package from your own fork.

@lenkan
Copy link
Collaborator

lenkan commented Feb 29, 2024

@s-a-tanjim I noted that the issue you linked is for yarn v1. Have you tried https://github.com/yarnpkg/berry ?

@s-a-tanjim
Copy link
Author

@lenkan Yeah I tried with Yarn V4 berry. It works! But I don't know why they still make the Yarn V1 the default version. And this #127 issue will make our life a lot easier! The main idea behind this PR was Workspaces are not meant to be published. But I understand the need for this in signify-ts project. So I'm closing this PR.

@s-a-tanjim s-a-tanjim closed this Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants