-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 969891d
Showing
25 changed files
with
11,593 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,4 @@ | ||
{ | ||
"root": true, | ||
"extends": ["fmal", "fmal/babel", "fmal/import", "fmal/typescript"] | ||
} |
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 @@ | ||
* text=auto eol=lf |
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 @@ | ||
# auto-generated stuff | ||
coverage | ||
dist | ||
node_modules | ||
.eslintcache | ||
packages/**/package-lock.json | ||
|
||
# cruft | ||
.DS_Store | ||
npm-debug.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 @@ | ||
save-exact = 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,7 @@ | ||
node_modules | ||
dist | ||
coverage | ||
__fixtures__ | ||
__mocks__ | ||
CHANGELOG.md | ||
package-lock.json |
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,3 @@ | ||
{ | ||
"singleQuote": true | ||
} |
Empty file.
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,20 @@ | ||
# monorepo | ||
|
||
📦 A monorepo for my NPM libraries. | ||
Managed with [repo-cooker](https://github.com/cerebral/repo-cooker) library. | ||
Using [Jest](https://github.com/facebook/jest), [eslint](https://github.com/eslint/eslint), [prettier](https://github.com/prettier/prettier) and TypeScript through [babel](https://github.com/babel/babel) 7. Semantically versioned and automatically released, following [conventional-commits](https://github.com/conventional-commits/conventionalcommits.org)! | ||
|
||
## 🛠 Tasks | ||
|
||
- `npm run commit`: guide you through creating commits with correct commit messages | ||
- `npm run checkdeps`: check if all dependencies are correctly installed and in sync | ||
- `npm run fixdeps`: add missing dependencies to the monorepo when you add or upgrade dependencies for your packages | ||
- `npm test`: run the tests for all packages | ||
- `npm run test:coverage` run tests across packages and output coverage | ||
- `npm run lint`: check for linting errors | ||
- `npm run typecheck`: check if the types of your packages are correct | ||
- `npm run build` compile source for all packages | ||
- `npm run release` build & publish using `repo-cooker --release` | ||
- `npm run link` an alias for `repo-cooker --link` which symlinks dependencies. This is automatically run through the `postinstall` hook when you do `npm install` | ||
|
||
To compile source or run tests for an individual package, `npm run build` or `npm run test` from the package root. |
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,38 @@ | ||
'use strict'; // eslint-disable-line strict | ||
|
||
const MIN_IE_VERSION = 11; | ||
|
||
// eslint-disable-next-line import/no-commonjs | ||
module.exports = api => { | ||
const isTest = api.cache(() => process.env.NODE_ENV === 'test'); | ||
const babelEnv = api.cache(() => process.env.BABEL_ENV); | ||
const isNodeTarget = api.cache(() => process.env.BABEL_TARGET === 'node'); | ||
|
||
const envTargets = | ||
isTest || isNodeTarget ? { node: 'current' } : { ie: MIN_IE_VERSION }; | ||
|
||
const envOpts = { | ||
loose: true, | ||
modules: babelEnv === 'cjs' || isTest ? 'commonjs' : false, | ||
targets: envTargets | ||
}; | ||
|
||
const presets = [['@babel/preset-env', envOpts], '@babel/typescript']; | ||
|
||
const plugins = [ | ||
['@babel/plugin-proposal-class-properties', { loose: true }], | ||
!isNodeTarget && [ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
regenerator: false, | ||
useESModules: babelEnv === 'es' | ||
} | ||
] | ||
].filter(Boolean); | ||
|
||
return { | ||
presets, | ||
plugins, | ||
ignore: babelEnv === 'cjs' || babelEnv === 'es' ? ['**/__tests__/**'] : [] | ||
}; | ||
}; |
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,16 @@ | ||
'use strict'; // eslint-disable-line strict | ||
|
||
const isCI = Boolean(process.env.CI); | ||
|
||
// eslint-disable-next-line import/no-commonjs | ||
module.exports = { | ||
roots: ['<rootDir>/src'], | ||
collectCoverageFrom: ['src/**/*.{js,ts}', '!**/*.d.ts', '!**/__tests__/**'], | ||
coverageDirectory: '<rootDir>/coverage', | ||
collectCoverage: isCI, | ||
coverageReporters: ['text', isCI && 'lcov'].filter(Boolean), | ||
bail: isCI, | ||
transform: { | ||
'^.+\\.(js|tsx?)$': ['babel-jest', { rootMode: 'upward' }] | ||
} | ||
}; |
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,11 @@ | ||
'use strict'; // eslint-disable-line strict | ||
|
||
// eslint-disable-next-line import/no-commonjs | ||
const baseConfig = require('./jest.config.base'); | ||
|
||
// eslint-disable-next-line import/no-commonjs | ||
module.exports = { | ||
...baseConfig, | ||
roots: ['<rootDir>'], | ||
projects: ['<rootDir>/packages/@fmal/*'] | ||
}; |
Oops, something went wrong.