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

Chore/undo monorepo setup #2099

Merged
merged 4 commits into from Oct 10, 2023
Merged

Conversation

coolsoftwaretyler
Copy link
Collaborator

@coolsoftwaretyler coolsoftwaretyler commented Oct 7, 2023

What does this PR do and why?

This PR resolves #2092, which completes https://github.com/mobxjs/mobx-state-tree/milestone/4. It removes all of the Lerna configuration we needed when MobX-State-Tree was a monorepo. It also moves some configuration files around, and changes some formatting options since this is going to be a huge diff anyways.

Here is a list of all the things contained in this commit/PR:

  1. Uninstalled Lerna
  2. Moved the contents of packages/mobx-state-tree to the root. So there's now __tests__/, scripts/, and src/ at the root. We combined some more config files as well (discussed below).
  3. Combined the Rollup config. Before, there was a base config at the root, and a separate config in the sub-package. Now we just have one config file at the root.
  4. Combined tsconfig.json and updated file paths. Did not move this into package.json because __tests__/tsconfig.json wants to inherit from it.
  5. Deleted the separate test-results/ sub-folders, since we only have one package to test now.
  6. Deleted the tslint.json in the __tests__/ folder - it was only extending the base tslint.json file.
  7. There are some existing TSLint errors in __tests__/core/type-system.test.js, but those exist in packages/mobx-state-tree/__tests__/core/type-system.test.ts in master as is, so this is not a regression.
  8. Deleted yarn test:cyclic script. It didn't seem to be testing much, so removed it and references to it.
  9. Updated path in size-limit configuration, and moved that config to package.json
  10. Updated TypeScript to 3.8.3 to resolve peer dependency warning in yarn install
  11. Updated CircleCI config for new commands and file paths.
  12. Moved Prettier config to package.json, changed tabWidth to 2, added Prettier scripts to check, list, and write to files.
  13. Moved size-limit configuration into package.json.
  14. Deleted empty watchman configuration
  15. Removed the release script - since we don't have a monorepo any more, I think doing this through yarn tag-new-version and a separate step to publish to npm is sufficient. Would be happy to take a future PR to automate this further.
  16. Deleted config for an external tool called Wallaby - doesn't seem to have been installed as a devDependency or anything. If anyone wants to use it, we can open a separate PR to bring it back.

Steps to validate locally

  1. Pull this branch
  2. For a clean slate, rm -rf node_modules/ && yarn

Run through the package.json scripts. They should mostly work in any order, but here's an order that makes the most sense to me. Some scripts run each other, but should be pretty robust and not rely too heavily on order-of-operations.

  1. yarn prepare
  2. yarn prettier:list (consider making a prettier error in a file to see it fail)
  3. yarn prettier:check (consider making a prettier error in a file to see it fail)
  4. yarn prettier:write (consider making a prettier error in a file to see it write the fix)
  5. yarn clean
  6. yarn build (runs yarn clean as well)
  7. yarn build (run it again to check that cleaning works as expected)
  8. yarn jest (you may get an open handle warning, this happens on master as well)
  9. yarn test (you may get an open handle warning, this happens on master as well)
  10. yarn jest:perf
  11. yarn test:perf
  12. yarn test:dev (again, open handle warnings are not regressions)
  13. yarn test:prod (open handle warnings are not regressions)
  14. yarn coverage (check the coverage folder, not version controlled)
  15. yarn test:all (open handle warnings are not regressions - also generates coverage report)
  16. yarn size
  17. yarn tag-new-version (please use an alpha version, this will push to GitHub)
  18. yarn deduplicate (this probably won't actually do anything)
  19. yarn fix-typedoc
  20. yarn build-docs (also runs fix-typedoc)
  21. Please skip publishing docs for now - we can run and troubleshoot this when we actually release v5.3.0
  22. yarn start (will open a local tab of the docs site)

We have a command for yarn lint, which fails, but it fails the same on master, so this is not a regression.

After you've checked things working in the repo, you can check that the build output works. I released a 5.3.0-alpha.1 version to npm, which includes some of the recent fixes and additions to the library, and was built off this branch to make sure the new setup works as expected. You can see that here: https://www.npmjs.com/package/mobx-state-tree/v/5.3.0-alpha.1

@coolsoftwaretyler
Copy link
Collaborator Author

Hey @jamonholmgren and @chakrihacker - just sent you a message in Discord about this, but figured I'd ping you here in case you're checking GitHub notifications. Would love to merge this quickly so we don't leave any contributors open to gnarly merge conflicts this weekend.

Would love a review, but I'm feeling good about these changes, so if I don't hear back from y'all by end of my day on Monday, I will probably go ahead and merge and handle any fixes in separate PRs.

@coolsoftwaretyler coolsoftwaretyler merged commit 73343f6 into master Oct 10, 2023
1 check passed
@coolsoftwaretyler coolsoftwaretyler deleted the chore/undo-monorepo-setup branch October 10, 2023 03:35
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.

Remove Lerna config and lift MST sub-package up
1 participant