Re:Launch HN: Moonrepo (YC W23) – Open-source build system
by bovermyer on Tuesday February 21, 2023 @03:35PM
(#34886771)
Would this be overkill for a personal project that is currently two repos, but I'm having to copy-paste code from one to the other whenever I make a change to a particular section?
[ Parent
| on HN ]
Re:Launch HN: Moonrepo (YC W23) – Open-source build system
by mileswjohnson on Tuesday February 21, 2023 @03:52PM
(#34887080)
Can you talk a bit more about what kind of code is being copied?
Re:Launch HN: Moonrepo (YC W23) – Open-source build system
by bovermyer on Tuesday February 21, 2023 @04:20PM
(#34887541)
The main repository is a single page app that's mostly Typescript compiled via Svelte down to a JavaScript bundle.
Most of that repository is a series of modules in their own directories (e.g., "src/modules/character").
The second repository is a Node.js API. The majority of its functionality comes from one of the modules from the first repository that I copy in its entirety to the other repository whenever I change it.
Re:Launch HN: Moonrepo (YC W23) – Open-source build system
by mileswjohnson on Tuesday February 21, 2023 @04:48PM
(#34887959)
Gotcha. While moon doesn't solve this directly, you do have a few options here:
- Use git submodules. Have the node repo have a submodule on the app repo.
- Publish the shared code to a private registry (like github's package registry), and pull it in as an npm package.
Re:Launch HN: Moonrepo (YC W23) – Open-source build system
by iskela on Tuesday February 21, 2023 @04:57PM
(#34888109)
You should check git submodules out. Basically you could have your api-repo checkout certain commit from the spa-repo to a folder in the project root and reference the module reltive to that path.