-
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.
feat: add base repository structure (#3)
- Loading branch information
Showing
26 changed files
with
5,234 additions
and
951 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,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*.ts] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.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 @@ | ||
**/coverage/** | ||
**/node_modules/** | ||
packages/*/dist/** | ||
!.eslintrc.js |
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,77 @@ | ||
module.exports = { | ||
extends: ['plugin:import/errors', 'plugin:import/typescript', 'prettier', 'plugin:eslint-comments/recommended'], | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint/eslint-plugin'], | ||
rules: { | ||
'@typescript-eslint/array-type': ['error', { default: 'generic' }], | ||
'@typescript-eslint/ban-types': 'error', | ||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], | ||
'@typescript-eslint/prefer-ts-expect-error': 'error', | ||
'import/default': 'off', | ||
'import/order': 'error', | ||
'no-dupe-class-members': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 2, | ||
'no-unused-vars': 'off' | ||
} | ||
}, | ||
{ | ||
files: ['*.md'], | ||
rules: { | ||
'arrow-body-style': 0, | ||
'consistent-return': 0, | ||
'import/no-extraneous-dependencies': 0, | ||
'import/no-unresolved': 0, | ||
'jest/no-focused-tests': 0, | ||
'jest/no-identical-title': 0, | ||
'jest/valid-expect': 0, | ||
'no-undef': 0, | ||
'no-unused-vars': 0, | ||
'prettier/prettier': 0, | ||
'sort-keys': 0 | ||
} | ||
}, | ||
{ | ||
files: ['**/__tests__/**', '**/__mocks__/**'], | ||
rules: { | ||
'@typescript-eslint/explicit-module-boundary-types': 0 | ||
} | ||
} | ||
], | ||
// parser: 'babel-eslint', | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['markdown', 'import', 'prettier', 'eslint-comments'], | ||
parserOptions: { | ||
ecmaVersion: 6, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true | ||
} | ||
}, | ||
rules: { | ||
'arrow-body-style': 2, | ||
'eslint-comments/no-unused-disable': 2, | ||
'import/no-duplicates': 2, | ||
'import/no-extraneous-dependencies': [ | ||
2, | ||
{ | ||
devDependencies: ['**/__tests__/**'] | ||
} | ||
], | ||
'import/no-unresolved': [2, { ignore: ['fsevents'] }], | ||
'import/order': 2, | ||
'no-console': 2, | ||
'no-restricted-imports': [ | ||
2, | ||
{ | ||
message: 'Please use graceful-fs instead.', | ||
name: 'fs' | ||
} | ||
], | ||
'no-unused-vars': 2, | ||
'prettier/prettier': 2, | ||
'sort-imports': [2, { ignoreDeclarationSort: 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,50 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
create-pr: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 4 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# todo: run with matrix of supported versions | ||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
|
||
- name: get yarn cache | ||
timeout-minutes: 1 | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashfiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: check format | ||
run: yarn prettify | ||
|
||
- name: check lint | ||
run: yarn lint | ||
|
||
- name: build packages | ||
run: yarn build | ||
|
||
- name: test | ||
run: yarn test | ||
env: | ||
CI: 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 |
---|---|---|
@@ -1,2 +1,20 @@ | ||
node_modules | ||
dist | ||
|
||
*.tsbuildinfo | ||
|
||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
coverage/ | ||
|
||
node_modules/ | ||
|
||
.DS_Store | ||
|
||
.idea/ | ||
|
||
.eslintcache |
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 @@ | ||
*.json | ||
*.md | ||
|
||
dist/ |
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
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
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 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
threshold: 95% | ||
patch: | ||
default: | ||
target: 95% | ||
|
||
comment: off |
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,19 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
const { defaults } = require('jest-config') | ||
|
||
module.exports = { | ||
testEnvironment: 'node', | ||
preset: 'ts-jest', | ||
testMatch: null, | ||
testRegex: '/__tests__/.*\\.test\\.ts$', | ||
testPathIgnorePatterns: ['/node_modules/', '/dist/'], | ||
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'], | ||
setupFilesAfterEnv: ['jest-extended'], | ||
moduleNameMapper: {}, | ||
clearMocks: true, | ||
globals: { | ||
'ts-jest': { | ||
tsConfig: '<rootDir>/tsconfig.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,9 @@ | ||
{ | ||
"packages": ["packages/*"], | ||
"version": "independent", | ||
"command": { | ||
"version": { | ||
"includeMergedTags": 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
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,5 +1,3 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
setupFilesAfterEnv: ['jest-extended'] | ||
} | ||
const config = require('../../jest.config.base') | ||
|
||
module.exports = config |
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,16 +1,14 @@ | ||
{ | ||
"name": "@cabiri-io/sls-app", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"version": "0.0.1", | ||
"author": "Cabiri <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "jest" | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/cabiri-io/sls-pipe", | ||
"directory": "packages/sls-app" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^26.0.0", | ||
"jest": "^26.0.1", | ||
"jest-extended": "^0.11.5", | ||
"ts-jest": "^26.1.0", | ||
"typescript": "^3.9.5" | ||
} | ||
"homepage": "https://github.com/cabiri-io/sls-pipe#readme", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts" | ||
} |
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
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
Oops, something went wrong.