Skip to content

Commit

Permalink
Use lerna to simplify workflow
Browse files Browse the repository at this point in the history
Basically it's useful only to run script across multiple packages.
Used in CI configurations.
  • Loading branch information
danielkcz committed Nov 6, 2020
1 parent 5d5eb89 commit 5379340
Show file tree
Hide file tree
Showing 11 changed files with 2,699 additions and 90 deletions.
4 changes: 2 additions & 2 deletions .changeset/neat-years-exercise.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"mobx-react": patch
"mobx-react-lite": patch
---

ESM bundles without NODE_ENV present are available in dist folder. This useful for consumption in browser environment that supports ESM.
Choose either `mobx-react.esm.production.min.js` or `mobx-react.esm.development.js`.
ESM bundles without NODE_ENV present are available in dist folder. This useful for consumption in browser environment that supports ESM Choose either `esm.production.min.js` or `esm.development.js` from `dist` folder.
10 changes: 2 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ jobs:
pkg-manager: yarn

- run: yarn lint

- run: yarn mobx build --target test
- run: yarn mobx-react build --target test
- run: yarn mobx-react-lite build --target test
- run: yarn lerna run build:test

- persist_to_workspace:
root: .
Expand All @@ -35,10 +32,7 @@ jobs:
at: .

- run: yarn test -i

- run: yarn mobx test:size
- run: yarn mobx-react test:size
- run: yarn mobx-react-lite test:size
- run: yarn lerna run test:size

mobx-test:
executor: node-executor
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ jobs:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js 12.x
- name: Setup Node.js 14.x
uses: actions/setup-node@master
with:
node-version: 12.x
node-version: 14.x

- name: Install Dependencies
run: yarn --frozen-lockfile --ignore-scripts

- name: Build mobx
run: yarn mobx build --target test
- name: Build packages
run: yarn lerna run build:test

- name: Run Coverage
run: yarn coverage
Expand Down
4 changes: 4 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"packages": ["packages/*"],
"version": "independent"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"prepare": "yarn dedup && yarn --cwd website install",
"dedup": "npx yarn-deduplicate --strategy fewer yarn.lock"
},
"dependencies": {},
"devDependencies": {
"@changesets/changelog-github": "^0.2.7",
"@changesets/cli": "^2.11.0",
Expand All @@ -43,6 +42,7 @@
"iterall": "^1.3.0",
"jest": "^26.6.2",
"jest-mock-console": "^1.0.1",
"lerna": "^3.22.1",
"lint-staged": "^10.1.7",
"lodash": "^4.17.4",
"minimist": "^1.2.5",
Expand Down
1 change: 1 addition & 0 deletions packages/mobx-react-lite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"scripts": {
"lint": "eslint src/**/* --ext .js,.ts,.tsx",
"build": "node ../../scripts/build.js mobx-react-lite",
"build:test": "yarn build --target test",
"test": "jest",
"test:size": "yarn import-size --report . observer useLocalObservable",
"prepublish": "yarn build --target publish"
Expand Down
12 changes: 0 additions & 12 deletions packages/mobx-react/__tests__/__snapshots__/observer.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,3 @@ exports[`issue 12 2`] = `
</div>
</div>
`;

exports[`should stop updating if error was thrown in render (#134) 1`] = `
Array [
"Error: Hello",
Object {
"componentStack": "
at X (/home/fredyc/workspace/github/mobxjs/mobx/packages/mobx-react/__tests__/observer.test.tsx:333:13)
at div
at Outer (/home/fredyc/workspace/github/mobxjs/mobx/packages/mobx-react/__tests__/observer.test.tsx:313:13)",
},
]
`;
1 change: 0 additions & 1 deletion packages/mobx-react/__tests__/observer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ test("should stop updating if error was thrown in render (#134)", () => {
data.set(4)
data.set(2)
data.set(5)
expect(errors).toMatchSnapshot()
expect(lastOwnRenderCount).toBe(4)
expect(renderingsCount).toBe(4)
})
Expand Down
1 change: 1 addition & 0 deletions packages/mobx-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"scripts": {
"lint": "eslint src/**/* --ext .js,.ts,.tsx",
"build": "node ../../scripts/build.js mobx-react",
"build:test": "yarn build --target test",
"test": "jest",
"test:size": "yarn import-size --report . observer",
"prepublish": "yarn build --target publish"
Expand Down
1 change: 1 addition & 0 deletions packages/mobx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"test": "jest",
"lint": "eslint src/**/*",
"build": "node ../../scripts/build.js mobx",
"build:test": "yarn build --target test",
"perf": "scripts/perf.sh",
"test:performance": "yarn perf proxy && yarn perf legacy",
"test:mixed-versions": "yarn test --testRegex mixed-versions",
Expand Down
Loading

0 comments on commit 5379340

Please sign in to comment.