Skip to content

Commit 478f5f0

Browse files
committed
initial commit
0 parents  commit 478f5f0

13 files changed

+429
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#root = true
2+
3+
[*]
4+
indent_style = space
5+
end_of_line = lf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
max_line_length = 100
10+
indent_size = 2
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jest.*.js

.eslintrc.yaml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
env:
2+
browser: true
3+
node: true
4+
parser: "@typescript-eslint/parser"
5+
parserOptions:
6+
project: ["tsconfig.json"]
7+
sourceType: module
8+
plugins:
9+
- "@typescript-eslint"
10+
extends:
11+
- eslint:recommended
12+
- plugin:@typescript-eslint/eslint-recommended
13+
- plugin:@typescript-eslint/recommended
14+
rules:
15+
camelcase: error
16+
comma-dangle: [error, always-multiline]
17+
curly: [error, multi-or-nest]
18+
eol-last: error
19+
id-blacklist:
20+
- error
21+
- any
22+
- Number
23+
- number
24+
- String
25+
- string
26+
- Boolean
27+
- boolean
28+
- Undefined
29+
- undefined
30+
id-match: error
31+
new-parens: error
32+
no-caller: error
33+
no-cond-assign: error
34+
no-constant-condition: error
35+
no-control-regex: error
36+
no-duplicate-imports: error
37+
no-empty: error
38+
no-eval: error
39+
no-fallthrough: error
40+
no-invalid-regexp: error
41+
no-multiple-empty-lines: error
42+
no-redeclare: error
43+
no-regex-spaces: error
44+
no-return-await: error
45+
no-trailing-spaces: error
46+
no-unused-expressions:
47+
- error
48+
- allowTaggedTemplates: true
49+
allowShortCircuit: true
50+
no-unused-labels: error
51+
no-var: error
52+
one-var:
53+
- error
54+
- never
55+
space-in-parens:
56+
- error
57+
- never
58+
spaced-comment:
59+
- error
60+
- always
61+
- exceptions: ["-", "+"]
62+
use-isnan: error
63+
64+
# @typescript-eslint related
65+
space-before-function-paren: "off"
66+
"@typescript-eslint/consistent-type-assertions": error
67+
"@typescript-eslint/no-floating-promises": error
68+
"@typescript-eslint/no-misused-new": error
69+
"@typescript-eslint/no-unnecessary-qualifier": error
70+
"@typescript-eslint/no-unnecessary-type-assertion": error
71+
"@typescript-eslint/prefer-namespace-keyword": error
72+
"@typescript-eslint/no-explicit-any": off
73+
"@typescript-eslint/type-annotation-spacing": error
74+
"@typescript-eslint/unified-signatures": error
75+
"@typescript-eslint/quotes": [error, single, { avoidEscape: true }]
76+
"@typescript-eslint/space-before-function-paren":
77+
- error
78+
- named: never
79+
anonymous: always
80+
asyncArrow: always
81+

.gitignore

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Mac/OSX system file that holds attributes/meta-data about the folder
2+
.DS_Store
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
lerna-debug.log*
11+
12+
# Diagnostic reports (https://nodejs.org/api/report.html)
13+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
14+
15+
# Runtime data
16+
pids
17+
*.pid
18+
*.seed
19+
*.pid.lock
20+
21+
# Directory for instrumented libs generated by jscoverage/JSCover
22+
lib-cov
23+
24+
# Coverage directory used by tools like istanbul
25+
coverage
26+
*.lcov
27+
28+
# nyc test coverage
29+
.nyc_output
30+
31+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
32+
.grunt
33+
34+
# Bower dependency directory (https://bower.io/)
35+
bower_components
36+
37+
# node-waf configuration
38+
.lock-wscript
39+
40+
# Compiled binary addons (https://nodejs.org/api/addons.html)
41+
build/Release
42+
43+
# Dependency directories
44+
node_modules/
45+
jspm_packages/
46+
47+
# Snowpack dependency directory (https://snowpack.dev/)
48+
web_modules/
49+
50+
# TypeScript cache
51+
*.tsbuildinfo
52+
53+
# npm
54+
.npm
55+
.npmrc
56+
57+
# Optional eslint cache
58+
.eslintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variables file
76+
.env
77+
.env.test
78+
79+
# parcel-bundler cache (https://parceljs.org/)
80+
.cache
81+
.parcel-cache
82+
83+
# Next.js build output
84+
.next
85+
86+
# Nuxt.js build / generate output
87+
.nuxt
88+
dist
89+
90+
# Gatsby files
91+
.cache/
92+
# Comment in the public line in if your project uses Gatsby and not Next.js
93+
# https://nextjs.org/blog/next-9-1#public-directory-support
94+
# public
95+
96+
# vuepress build output
97+
.vuepress/dist
98+
99+
# Serverless directories
100+
.serverless/
101+
102+
# FuseBox cache
103+
.fusebox/
104+
105+
# DynamoDB Local files
106+
.dynamodb/
107+
108+
# TernJS port file
109+
.tern-port
110+
111+
# Stores VSCode versions used for testing VSCode extensions
112+
.vscode-test
113+
114+
# yarn v2
115+
.yarn/cache
116+
.yarn/unplugged
117+
.yarn/build-state.yml
118+
.pnp.*

.travis.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
language: node_js
2+
node_js:
3+
- "10"
4+
- "12"
5+
- "stable"
6+
env:
7+
global:
8+
- PATH=$HOME/.yarn/bin:$PATH
9+
cache:
10+
yarn: true
11+
directories:
12+
- "node_modules"
13+
before_install:
14+
- curl -o- -L https://yarnpkg.com/install.sh | bash
15+
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install make; fi
16+
- yarn run lerna run prepublish
17+
script:
18+
- yarn lint
19+
- yarn test
20+
before_deploy:
21+
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
22+
deploy:
23+
provider: script
24+
script: "yarn run publish"
25+
skip_cleanup: true
26+
on:
27+
branch: master
28+
tags: true

.yarnrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
workspaces-experimental true

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Zurab Benashvili (binier) <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

jest.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const base = require('./jest.project')({ dirname: __dirname });
2+
3+
module.exports = {
4+
...base,
5+
projects:
6+
[
7+
"<rootDir>/packages/*/jest.config.js"
8+
],
9+
coverageDirectory: "<rootDir>/coverage/"
10+
};

jest.project.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const path = require('path');
2+
const { pathsToModuleNameMapper } = require('ts-jest/utils');
3+
4+
const ROOT_DIR = __dirname;
5+
const TSCONFIG = path.resolve(ROOT_DIR, 'tsconfig.json');
6+
const tsconfig = require(TSCONFIG);
7+
8+
module.exports = ({ dirname }) => {
9+
const pkg = require(path.resolve(dirname, 'package.json'));
10+
const isRoot = ROOT_DIR === dirname;
11+
const nameKeys = !isRoot ? {} : {
12+
name: pkg.name,
13+
displayName: pkg.name
14+
};
15+
16+
return {
17+
...nameKeys,
18+
rootDir: dirname,
19+
cacheDirectory: path.resolve(ROOT_DIR, 'node_modules/.cache/jest'),
20+
transform: { '^.+\\.tsx?$': 'ts-jest' },
21+
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { prefix: `${ROOT_DIR}/` }),
22+
modulePathIgnorePatterns: ['dist'],
23+
collectCoverage: true,
24+
restoreMocks: true,
25+
};
26+
};

lerna.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"version": "independent",
3+
"npmClient": "yarn",
4+
"useWorkspaces": true,
5+
"packages": [
6+
"packages/*"
7+
],
8+
"command": {
9+
"publish": {
10+
"message": "chore(release): publish %s",
11+
"registry": "https://npm.pkg.github.com",
12+
"conventionalCommits": true,
13+
"allowBranch": "master",
14+
"ignoreChanges": [
15+
"*.txt",
16+
"*.md",
17+
"yarn.lock"
18+
]
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)