Skip to content

Commit

Permalink
chore: ease work with monorepo with jest packages and global Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Jan 11, 2019
1 parent a88c78f commit abc00a3
Show file tree
Hide file tree
Showing 9 changed files with 493 additions and 520 deletions.
2 changes: 1 addition & 1 deletion packages/local-cli/.flowconfig → .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
.*/node_modules/metro.*/.*

[include]
../../node_modules
flow-typed

[options]
emoji=true
Expand Down
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
babelrcRoots: ['packages/*'],
};
File renamed without changes.
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
"packages/*"
],
"scripts": {
"test": "cd packages/local-cli && yarn jest",
"test": "jest",
"lint": "eslint packages",
"flow-check": "cd packages/local-cli && yarn flow check"
"flow-check": "flow check"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@callstack/eslint-config": "^3.0.2",
"@commitlint/cli": "^7.2.1",
"@commitlint/config-conventional": "^7.1.2",
"eslint": "^5.10.0",
"husky": "^1.3.1"
"husky": "^1.3.1",
"jest": "^24.0.0-alpha.12"
},
"eslintConfig": {
"extends": "@callstack",
Expand All @@ -26,5 +28,10 @@
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"jest": {
"projects": [
"packages/*"
]
}
}
3 changes: 3 additions & 0 deletions packages/global-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
"minimist": "^1.2.0",
"prompt": "^0.2.14",
"semver": "^5.0.3"
},
"jest": {
"displayName": "global"
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/local-cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
require('graceful-fs').gracefulify(require('fs'));

// Transpile the source code
const babelConfig = require('./babel.config');
const babelConfig = require('./.babelrc');

require('@babel/register')(babelConfig);

Expand Down
4 changes: 1 addition & 3 deletions packages/local-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"url": "https://github.com/react-native-community/react-native-cli.git"
},
"jest": {
"displayName": "local",
"testPathIgnorePatterns": [
"/node_modules/",
"/templates/"
Expand Down Expand Up @@ -66,10 +67,7 @@
"xmldoc": "^0.4.0"
},
"devDependencies": {
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.0.0-alpha.6",
"flow-bin": "0.87.0",
"jest": "24.0.0-alpha.6",
"react-native": "^0.57.0"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit abc00a3

Please sign in to comment.