Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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