Skip to content

Commit cda55bf

Browse files
Deep modernisation. TypeScript added, another improvements (#1)
* initial release * test data fixes
1 parent be32c2a commit cda55bf

29 files changed

Lines changed: 4402 additions & 682 deletions

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
tab_width = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
max_line_length = 120

.eslintrc

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"airbnb-typescript/base"
5+
],
6+
"parserOptions": {
7+
"ecmaVersion": 2018,
8+
"sourceType": "module",
9+
"project": "./tsconfig.lint.json"
10+
},
11+
"plugins": [
12+
"import"
13+
],
14+
"env": {
15+
"node": true,
16+
"browser": true
17+
},
18+
"rules": {
19+
"arrow-parens": ["error", "as-needed"],
20+
"@typescript-eslint/lines-between-class-members": "off",
21+
"max-len": "off",
22+
"class-methods-use-this": "off",
23+
"import/prefer-default-export": "off",
24+
"import/no-cycle": "off",
25+
"no-underscore-dangle": "off",
26+
"lines-between-class-members": "off",
27+
"no-trailing-spaces": "error",
28+
"linebreak-style": ["error", "unix"],
29+
"eol-last": "error",
30+
"sort-imports": [
31+
"error",
32+
{
33+
"ignoreCase": true,
34+
"ignoreDeclarationSort": false,
35+
"ignoreMemberSort": false,
36+
"memberSyntaxSortOrder": [
37+
"all",
38+
"single",
39+
"multiple",
40+
"none"
41+
],
42+
"allowSeparatedGroups": false
43+
}
44+
],
45+
"padding-line-between-statements": [
46+
"error",
47+
{
48+
"blankLine": "always",
49+
"prev": "*",
50+
"next": [
51+
"block",
52+
"block-like",
53+
"cjs-export",
54+
"class",
55+
"const",
56+
"export",
57+
"import",
58+
"let",
59+
"var"
60+
]
61+
},
62+
{
63+
"blankLine": "always",
64+
"prev": [
65+
"block",
66+
"block-like",
67+
"cjs-export",
68+
"class",
69+
"const",
70+
"export",
71+
"import",
72+
"let",
73+
"var"
74+
],
75+
"next": "*"
76+
},
77+
{
78+
"blankLine": "any",
79+
"prev": [
80+
"const",
81+
"let",
82+
"var"
83+
],
84+
"next": [
85+
"const",
86+
"let",
87+
"var"
88+
]
89+
},
90+
{
91+
"blankLine": "never",
92+
"prev": [
93+
"import"
94+
],
95+
"next": [
96+
"import"
97+
]
98+
},
99+
{
100+
"blankLine": "always",
101+
"prev": [
102+
"import"
103+
],
104+
"next": [
105+
"export"
106+
]
107+
},
108+
{
109+
"blankLine": "any",
110+
"prev": [
111+
"export"
112+
],
113+
"next": [
114+
"export"
115+
]
116+
}
117+
]
118+
},
119+
"settings": {
120+
"import/parsers": {
121+
"@typescript-eslint/parser": [
122+
".ts"
123+
]
124+
}
125+
}
126+
}

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [14.x, 16.x, 18.x]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- run: npm ci
21+
- run: npm run build
22+
- run: npm run test:unit
23+
- run: npm run lint
24+
env:
25+
CI: true

.github/workflows/publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: NPM publish
2+
on: workflow_dispatch
3+
4+
jobs:
5+
publish:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout sources
9+
uses: actions/checkout@v2
10+
- name: Use Node.js 16
11+
uses: actions/setup-node@v2
12+
with:
13+
node-version: 16
14+
registry-url: https://registry.npmjs.org/
15+
- name: Install dependencies
16+
run: npm ci
17+
- name: Publishing
18+
run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,6 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
51
.idea/
2+
node_modules/
3+
out/
4+
coverage/
65

7-
# Runtime data
8-
pids
9-
*.pid
10-
*.seed
11-
12-
# Directory for instrumented libs generated by jscoverage/JSCover
13-
lib-cov
14-
15-
# Coverage directory used by tools like istanbul
16-
coverage
17-
18-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
19-
.grunt
20-
21-
# node-waf configuration
22-
.lock-wscript
23-
24-
# Compiled binary addons (http://nodejs.org/api/addons.html)
25-
build/Release
26-
27-
# Dependency directories
28-
node_modules
29-
jspm_packages
30-
31-
# Optional npm cache directory
32-
.npm
33-
34-
# Optional REPL history
35-
.node_repl_history
6+
.DS_Store

.jscsrc

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)