Closed coolsoftwaretyler closed 9 months ago
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.
What does this PR do and why?
This PR resolves https://github.com/mobxjs/mobx-state-tree/issues/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:
packages/mobx-state-tree
to the root. So there's now__tests__/
,scripts/
, andsrc/
at the root. We combined some more config files as well (discussed below).tsconfig.json
and updated file paths. Did not move this intopackage.json
because__tests__/tsconfig.json
wants to inherit from it.test-results/
sub-folders, since we only have one package to test now.tslint.json
in the__tests__/
folder - it was only extending the basetslint.json
file.__tests__/core/type-system.test.js
, but those exist inpackages/mobx-state-tree/__tests__/core/type-system.test.ts
inmaster
as is, so this is not a regression.yarn test:cyclic
script. It didn't seem to be testing much, so removed it and references to it.package.json
yarn install
package.json
, changedtabWidth
to 2, added Prettier scripts to check, list, and write to files.package.json
.release
script - since we don't have a monorepo any more, I think doing this throughyarn 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.Steps to validate locally
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.yarn prepare
yarn prettier:list
(consider making a prettier error in a file to see it fail)yarn prettier:check
(consider making a prettier error in a file to see it fail)yarn prettier:write
(consider making a prettier error in a file to see it write the fix)yarn clean
yarn build
(runsyarn clean
as well)yarn build
(run it again to check that cleaning works as expected)yarn jest
(you may get an open handle warning, this happens onmaster
as well)yarn test
(you may get an open handle warning, this happens onmaster
as well)yarn jest:perf
yarn test:perf
yarn test:dev
(again, open handle warnings are not regressions)yarn test:prod
(open handle warnings are not regressions)yarn coverage
(check thecoverage
folder, not version controlled)yarn test:all
(open handle warnings are not regressions - also generates coverage report)yarn size
yarn tag-new-version
(please use analpha
version, this will push to GitHub)yarn deduplicate
(this probably won't actually do anything)yarn fix-typedoc
yarn build-docs
(also runsfix-typedoc
)v5.3.0
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 onmaster
, 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