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 installing Waku package from git repo #1344

Merged
merged 2 commits into from
Apr 3, 2025

Conversation

jonathanhefner
Copy link
Contributor

Prior to this commit, when installing Waku from a git repository, the dist directory would not be built, and all waku CLI commands would throw an ERR_MODULE_NOT_FOUND error.

This commit adds a prepare command to packages/waku/package.json, which is just an alias for pnpm run compile. pnpm will automatically run prepare when installing the package from a git repo, thus solving the problem.

Also, documentation about referencing a package inside a monorepo seems to be scarce and inaccurate (many sources specify incorrect syntax). Therefore, this commit adds instructions to the README on how to build an app that uses an experimental version of Waku.

Prior to this commit, when installing Waku from a git repository, the
`dist` directory would not be built, and all `waku` CLI commands would
throw an `ERR_MODULE_NOT_FOUND` error.

This commit adds a `prepare` command to `packages/waku/package.json`,
which is just an alias for `pnpm run compile`.  pnpm will automatically
run `prepare` when installing the package from a git repo, thus solving
the problem.

Also, documentation about referencing a package inside a monorepo seems
to be scarce and inaccurate (many sources specify incorrect syntax).
Therefore, this commit adds instructions to the README on how to build
an app that uses an experimental version of Waku.
Copy link

vercel bot commented Apr 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Apr 3, 2025 0:43am

Copy link

codesandbox-ci bot commented Apr 2, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@dai-shi
Copy link
Member

dai-shi commented Apr 2, 2025

pnpm will automatically run prepare when installing the package from a git repo

TIL
Is it only pnpm capability?

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks for your contribution!

@dai-shi dai-shi merged commit 6058a04 into wakujs:main Apr 3, 2025
21 checks passed
@jonathanhefner
Copy link
Contributor Author

Is it only pnpm capability?

It is also supported by npm, but since the compile script relies on pnpm, I mentioned just pnpm in the README.

Thank you for reviewing!

@dai-shi
Copy link
Member

dai-shi commented Apr 4, 2025

It is also supported by npm,

Runs BEFORE the package is packed, i.e. during npm publish

Ah, I think I knew it.

Runs on local npm install without any arguments

But not that.

Thanks for sharing.

@@ -1080,3 +1080,15 @@ Please join our friendly [GitHub discussions](https://github.com/wakujs/waku/dis
## Roadmap

Waku is in active development and we’re seeking additional contributors. Check out our [roadmap](https://github.com/wakujs/waku/issues/24) for more information.

## Contributing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I misunderstood. This was added to README.md. It should have added to CONTRIBUTING.md.

@jonathanhefner Can you move this section from README.md to CONTRIBUTING.md please? Feel free to improve CONTRIBUTING.md too.

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

Successfully merging this pull request may close these issues.

2 participants