-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
monorepo initial configuration with yarn
- Loading branch information
Roy Razon
committed
Jul 15, 2019
1 parent
6ab31d5
commit 339ac11
Showing
55 changed files
with
12,060 additions
and
24,056 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
node_modules | ||
|
||
coverage | ||
/reports | ||
|
||
# Editors | ||
.idea | ||
*.iml | ||
|
||
# OS metadata | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# test results | ||
junit.xml | ||
|
||
# yarn | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
scripts-prepend-node-path=true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# salto | ||
|
||
[](https://circleci.com/gh/salto-io/salto_monorepo) [](https://codecov.io/gh/salto-io/salto_monorepo) | ||
|
||
--- | ||
|
||
### TODO high-level description of the project's goal | ||
|
||
### Build instructions | ||
|
||
#### Install yarn | ||
|
||
``` | ||
brew install yarn | ||
``` | ||
|
||
#### Run yarn install | ||
|
||
``` | ||
yarn | ||
``` | ||
|
||
### Run tests | ||
|
||
``` | ||
yarn run jest | ||
``` | ||
|
||
### Usage instructions | ||
|
||
See READMEs of individual packages under the `packages` directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const _ = require('lodash') | ||
|
||
const customizer = (objValue, srcValue) => { | ||
if (_.isArray(srcValue) && _.isArray(objValue)) { | ||
return objValue.concat(srcValue) | ||
} | ||
} | ||
|
||
module.exports = (object, sources) => _.mergeWith(_.cloneDeep(object), sources, customizer) | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
module.exports = { | ||
env: { | ||
es6: true, | ||
jest: true, | ||
node: true, | ||
}, | ||
|
||
extends: [ | ||
'eslint:recommended', | ||
'airbnb', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'plugin:import/typescript', | ||
'plugin:jest/recommended', | ||
], | ||
|
||
globals: { | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly', | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
useJSXTextNode: true, | ||
project: './tsconfig.json', | ||
tsconfigRootDir: './', | ||
}, | ||
plugins: ['react', 'import', 'jest', '@typescript-eslint'], | ||
rules: { | ||
'linebreak-style': ['error', 'unix'], | ||
quotes: [ | ||
'error', | ||
'single', | ||
{ avoidEscape: true, allowTemplateLiterals: false }, | ||
], | ||
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }], | ||
'lines-between-class-members': [1, 'always', {exceptAfterSingleLine: true}], | ||
'@typescript-eslint/no-parameter-properties': [0], | ||
'@typescript-eslint/explicit-function-return-type': [ | ||
'error', { | ||
'allowTypedFunctionExpressions': true, | ||
'allowExpressions': true, | ||
} | ||
], | ||
'@typescript-eslint/explicit-member-accessibility': [0], | ||
'jsx-a11y/anchor-is-valid': [0], | ||
indent: ['error'], | ||
'@typescript-eslint/indent': 'off', | ||
semi: ['error', 'never'], | ||
'no-param-reassign': [2, { 'props': false }], | ||
'@typescript-eslint/no-unused-vars': [1, { argsIgnorePattern: '^_' }], | ||
'no-constant-condition': ['error', { checkLoops: false }], | ||
'generator-star-spacing': ["error", { "before": true, "after": false }], | ||
'arrow-parens': ['error', 'as-needed'], | ||
'comma-dangle': ['error', { | ||
functions: 'ignore', | ||
arrays: 'always-multiline', | ||
objects: 'always-multiline', | ||
imports: 'always-multiline', | ||
exports: 'always-multiline', | ||
}], | ||
'implicit-arrow-linebreak': ['off'], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
rules: { | ||
'no-useless-constructor': [0], | ||
'no-empty-function': [0], | ||
'@typescript-eslint/array-type': [0], | ||
'@typescript-eslint/member-delimiter-style': ['error', {multiline: {delimiter: 'none'}}] | ||
} | ||
}, | ||
], | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
paths: ['./'], | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module.exports = { | ||
globals: { | ||
'ts-jest': { | ||
tsConfig: 'tsconfig.json', | ||
}, | ||
}, | ||
moduleFileExtensions: ['js', 'ts'], | ||
transform: { | ||
'^.+\\.(ts|tsx)$': 'ts-jest', | ||
}, | ||
transformIgnorePatterns: [ | ||
'[.]d[.]ts', | ||
], | ||
testEnvironment: 'node', | ||
testPathIgnorePatterns: [ | ||
'<rootDir>/dist/' | ||
], | ||
preset: 'ts-jest', | ||
collectCoverage: true, | ||
coverageReporters: ['json', 'lcov', 'text', 'clover', 'json-summary'], | ||
collectCoverageFrom: [ | ||
'**/*.[jt]s', | ||
'**/*.[jt]sx', | ||
'!**/*.d.ts', | ||
'!**/node_modules/**', | ||
'!*.config.js', | ||
'!(test|dist|coverage)/**', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const _ = require('lodash') | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const packageConfigs = (() => { | ||
const packagesDir = `${__dirname}/packages` | ||
const packageDir = package => './' + path.relative(__dirname, `${packagesDir}/${package}`) | ||
const packages = fs.readdirSync(packagesDir) | ||
|
||
return Object.assign.apply( | ||
{}, | ||
packages.map(package => ({ | ||
[package]: require(`${packageDir(package)}/jest.config.js`), | ||
})) | ||
) | ||
})() | ||
|
||
const collectCoverageFrom = _(packageConfigs) | ||
.map(config => config.collectCoverageFrom || []) | ||
.flatten().sort().uniq() | ||
.orderBy(p => p.startsWith('!')) // "include" patterns first, then "exclude" | ||
.value() | ||
|
||
module.exports = Object.assign( | ||
{}, | ||
require('./jest.base.config.js'), | ||
{ | ||
projects: ['packages/*'], | ||
coverageDirectory: "<rootDir>/coverage/", | ||
collectCoverageFrom, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"private": true, | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"name": "salto_monorepo", | ||
"devDependencies": { | ||
"codecov": "^3.5.0" | ||
}, | ||
"scripts": { | ||
"install": "yarn workspaces run build" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
dist/* | ||
/dist | ||
*.d.ts | ||
*.config.js |
Oops, something went wrong.