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

Create monorepo for biketag and include this project #86

Open
KenEucker opened this issue Nov 17, 2021 · 10 comments
Open

Create monorepo for biketag and include this project #86

KenEucker opened this issue Nov 17, 2021 · 10 comments

Comments

@KenEucker
Copy link
Owner

KenEucker commented Nov 17, 2021

I suppose using Lerna?

Does this mean that we will have to store the code elsewhere? How does this all play out with existing repositories and existing npm packages? We currently have:
https://npmjs.com/package/biketag
https://www.npmjs.com/package/biketag-app

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@KenEucker KenEucker assigned KenEucker and unassigned KenEucker Nov 21, 2021
@KenEucker
Copy link
Owner Author

I think I favor npm workspaces, actually:
https://docs.npmjs.com/cli/v7/using-npm/workspaces

@KenEucker
Copy link
Owner Author

KenEucker commented Nov 21, 2021

@KenEucker
Copy link
Owner Author

When moving these projects to a monorepo, we should set all of the licenses to a single license:

GNU AFFERO GENERAL PUBLIC LICENSE
AGPL-3.0 License

@KenEucker
Copy link
Owner Author

It has been suggested to rename projects in order to reduce confusion. I don't know how this impacts existing repos or if it is possible to retain names while renaming in the monorepo, but here's the proposal:

biketag-server (formerly biketag-app)
biketag-client (formerly biketag-api)
biketag-app (formerly biketag-vue)

projects that could be renamed:
biketag-data (formerly biketag-games)
biketag-admin (formerly biketag-editor)

projects which may remain named as such:
biketag-website (remains as the biketag.org website code)
biketag-infra (to be combined with biketag-saas?)

@KenEucker
Copy link
Owner Author

@KenEucker
Copy link
Owner Author

I have started with a new project that isn't using a monorepo package but simply yarn workspaces. I think I prefer that solution at the moment. That project is here:

https://github.com/KenEucker/point-of-vue-globe

@KenEucker
Copy link
Owner Author

Doubling back to this to say that yarn did a weird thing when moving to v2, I don't like it, and I have since ditched yarn in all of my projects.

TurboRepo it is!

Now, to discover if it is possible to have a core monorepo with packages that point to other repos (so that I don't have to have all of the packages and apps under one repo -- how it is structured today)

@KenEucker
Copy link
Owner Author

Use TurboRepo (+ Vercel) with GitHub Actions: https://turbo.build/repo/docs/ci/github-actions

@KenEucker
Copy link
Owner Author

New repo here: https://github.com/keneucker/biketag

Going to go with this template (nuxt): https://github.com/vercel/turbo/tree/main/examples/with-vue-nuxt

@KenEucker
Copy link
Owner Author

I had a chat with GPT4 yesterday about my plan and desire to have this monorepo contain links to other repos for the apps and packages, and this is what it provided:

Setting up a monorepo using TurboRepo while maintaining your existing repositories for the BikeTag ecosystem is a great way to streamline development and manage your projects efficiently. Here's a step-by-step guide to achieve this:

1. Create a New GitHub Repository
Name it biketag as you mentioned.
This repository will act as the central hub for your monorepo.

2. Setting Up TurboRepo
Install TurboRepo in your new biketag repository.
bash
Copy code
npm install turbo -g
Initialize TurboRepo with a basic configuration.
bash
Copy code
turbo init
This creates a turbo.json file, which is the configuration file for your monorepo.

3. Adding Sub-Repositories as Submodules
For each of your existing repositories (biketag, biketag-vue, etc.), you'll add them as submodules.
This keeps them as separate repositories but includes them in your monorepo.
Add a submodule:
bash
Copy code
git submodule add [repository-url] packages/[submodule-name]
Replace [repository-url] with the Git URL of the repository and [submodule-name] with a name you choose for the submodule.

4. Configuring TurboRepo for Submodules
Update the turbo.json file to include the paths to your submodules in the build section.
This tells TurboRepo where to find the code for each submodule.

5. Development Workflow
When developing, make changes within the submodules.
Use TurboRepo commands to build/test across all submodules.
Commit changes in the respective submodules and push them to their individual repositories.

6. Syncing Version Numbers
To synchronize version numbers, you can use a tool like lerna or semantic-release.
These tools can help automate versioning and publishing.
Integrate them into your TurboRepo workflow for version synchronization.

7. Publishing Changes
When you're ready to publish changes, you'll commit and push from the submodule repositories.
Use TurboRepo to orchestrate builds and tests before releases.

8. Continuous Integration/Continuous Deployment (CI/CD)
Consider setting up CI/CD pipelines to automate testing and deployment.
This can be done via GitHub Actions or another CI/CD tool.

Summary
Create a new repository for your monorepo.
Use TurboRepo to manage the monorepo.
Add existing repositories as submodules.
Configure TurboRepo to work with submodules.
Develop within submodules, commit and push changes there.
Sync version numbers using tools like lerna.
Use CI/CD to automate workflows.

Final Note
This setup allows you to keep the separation of your projects while managing them more effectively under a monorepo structure.
Always make sure to regularly pull changes from your submodules to keep the monorepo up to date.

@polar-sh polar-sh bot added the Fund label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant