Skip to content

Commit 605893d

Browse files
authored
Migrate to TypeScript/Upgrade API (#19)
1 parent ba1697b commit 605893d

20 files changed

+1261
-1351
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
dist/
3+
lib

.eslintrc.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
parserOptions: {
4+
ecmaVersion: 12,
5+
sourceType: "module",
6+
},
27
env: {
3-
browser: false,
4-
commonjs: true,
8+
browser: true,
59
es2021: true,
610
},
711
extends: ["airbnb-base", "prettier"],
8-
parserOptions: {
9-
ecmaVersion: 12,
10-
},
12+
plugins: ["@typescript-eslint"],
1113
globals: {
1214
describe: true,
1315
it: true,
1416
expect: true,
1517
},
16-
rules: {},
1718
};

.github/dependabot.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ updates:
88
- package-ecosystem: "npm" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
11-
interval: "weekly"
11+
interval: "monthly"
1212
day: "sunday"
1313

14-
1514
- package-ecosystem: "github-actions"
1615
directory: "/"
1716
schedule:
18-
interval: "daily"
17+
interval: "weekly"

.github/workflows/ci.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@master
16+
17+
- name: Use latest version of Node.j
18+
uses: actions/setup-node@master
19+
with:
20+
node-version: "*"
21+
22+
- name: Get yarn cache directory path
23+
id: yarn-cache-dir-path
24+
run: echo "::set-output name=dir::$(yarn cache dir)"
25+
26+
- name: Cache yarn cache
27+
uses: actions/[email protected]
28+
id: yarn-cache #`steps.yarn-cache.outputs.cache-hit != 'true'
29+
with:
30+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
31+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-yarn-
34+
35+
- name: Install Dependencies
36+
run: yarn install
37+
38+
- name: Compile to JS
39+
run: "yarn tsc"
40+
41+
- name: Run lint
42+
run: yarn eslint .
43+
44+
test:
45+
name: Unit Test
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Check out repository
49+
uses: actions/checkout@master
50+
51+
- name: Use latest version of Node.j
52+
uses: actions/setup-node@master
53+
with:
54+
node-version: "*"
55+
56+
- name: Get yarn cache directory path
57+
id: yarn-cache-dir-path
58+
run: echo "::set-output name=dir::$(yarn cache dir)"
59+
60+
- name: Cache yarn cache
61+
uses: actions/[email protected]
62+
id: yarn-cache #`steps.yarn-cache.outputs.cache-hit != 'true'
63+
with:
64+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
65+
key: $s{{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
66+
restore-keys: |
67+
${{ runner.os }}-yarn-
68+
69+
- name: Install Dependencies
70+
run: yarn install
71+
72+
- name: Compile to JS
73+
run: "yarn tsc"
74+
75+
- name: Run Test
76+
run: CI=true yarn mocha

.github/workflows/lint.yml

-32
This file was deleted.

.github/workflows/test.yml

-32
This file was deleted.

.gitignore

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
node_modules
2-
*.log
3-
.changelog
4-
build
5-
dist
6-
draft
7-
scripts
8-
react
2+
/lib

0 commit comments

Comments
 (0)