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

Implement Initial Monorepo #1551

Closed
wants to merge 11 commits into from
Closed

Conversation

Lord-Valen
Copy link

@Lord-Valen Lord-Valen commented Jan 4, 2024

Description

Since it takes a lot of work to adapt the tools/scripts and match dependencies between projects, I think it may be best to migrate just this project and set up the infrastructure in this PR and migrate the other projects in subsequent PRs. Moving the git history alone has proven to be the easy part (I have done it, but didn't want to go through with the full migration right away). Essentially, we move all files in the repo to /apps/<repo-name>, commit, add it as a remote in this repo, and git merge <repo-name>/<branch> --allow-unrelated-histories. The hard (tedious?) part is to rework the package.json and resolve dependency conflicts.

I took the liberty of trying out turborepo here, since it only adds to the workspace experience. A free and painless addition, it turns out.

What is done here:

  • Added workspaces apps/* (for public stuff) and packages/* (for internal stuff)
  • Added turborepo tooling
  • Simplified tsconfigs
  • Used tsup to bundle cjs and esm
  • Adapted CI
  • Moved InversifyJS to apps/inversify
  • Removed publish-please (should probably re-add but want to also consider changesets)
  • Added README.md
  • Rewrote CONTRIBUTING.md
  • Added LICENSE

Related Issue

#1550

Motivation and Context

Monorepos are easier to maintain, as has been discussed in #1550 and on the Inversify Discord server. Turborepo allows for faster CI and developer experience without forcing us into a system other than workspaces. tsup allowed for a simplification of the build and the tsconfig setup (tsup doesn't support amd so I left build:amd intact). I hope this simplification makes things more approachable.

How Has This Been Tested?

  • Verified that all tests passed using both turbo and the inversify test script.
  • Verified that the coverage scripts worked correctly and emitted the coverage report.
  • Verified that the build succeed using both turbo and the inversify build script.

Types of changes

  • Updated docs / Refactor code / Added a tests case (non-breaking change)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the changelog.

@Lord-Valen Lord-Valen marked this pull request as ready for review January 5, 2024 07:39
turbo.json Outdated Show resolved Hide resolved
@notaphplover
Copy link
Member

At the end we never merged this. Too many changes in a single PR, let's go step by step in the new monorepo instead!

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