KenEucker / biketag-api

The javascript client for interacting with BikeTag games.
https://keneucker.github.io/biketag-api/
GNU Affero General Public License v3.0
10 stars 5 forks source link

Create monorepo for biketag and include this project #86

Open KenEucker opened 2 years ago

KenEucker commented 2 years ago

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

Fund with Polar

KenEucker commented 2 years ago

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

KenEucker commented 2 years ago

Include all of these repos: https://github.com/KenEucker/biketag-api https://github.com/KenEucker/biketag-app https://github.com/KenEucker/biketag-website https://github.com/KenEucker/biketag-games https://github.com/KenEucker/biketag-editor https://github.com/KenEucker/biketag-vue https://github.com/KenEucker/biketag-saas https://github.com/KenEucker/biketag-infra

Which are mirror'd on the org github account: https://github.com/biketagorg

( I am unsure as to how to handle the github org with forks vs monorepo vs personal github repos )

KenEucker commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

TurboRepo + pNpm

https://turborepo.org/

https://www.youtube.com/watch?v=9iU_IE6vnJ8

KenEucker commented 1 year ago

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 commented 8 months ago

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 commented 8 months ago

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

KenEucker commented 8 months ago

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 commented 8 months ago

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.