Here is a list of all the things contained in this commit/PR:
Uninstalled Lerna
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).
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.
Combined tsconfig.json and updated file paths. Did not move this into package.json because __tests__/tsconfig.json wants to inherit from it.
Deleted the separate test-results/ sub-folders, since we only have one package to test now.
Deleted the tslint.json in the __tests__/ folder - it was only extending the base tslint.json file.
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.
Deleted yarn test:cyclic script. It didn't seem to be testing much, so removed it and references to it.
Updated path in size-limit configuration, and moved that config to package.json
Updated TypeScript to 3.8.3 to resolve peer dependency warning in yarn install
Updated CircleCI config for new commands and file paths.
Moved Prettier config to package.json, changed tabWidth to 2, added Prettier scripts to check, list, and write to files.
Moved size-limit configuration into package.json.
Deleted empty watchman configuration
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.
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
Pull this branch
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.
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 (runs yarn 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 on master as well)
yarn test (you may get an open handle warning, this happens on master 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 the coverage 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 an alpha version, this will push to GitHub)
yarn deduplicate (this probably won't actually do anything)
yarn fix-typedoc
yarn build-docs (also runs fix-typedoc)
Please skip publishing docs for now - we can run and troubleshoot this when we actually release 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 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.
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.