Skip to content

Commit 9ce2b41

Browse files
authored
Merge pull request #59 from Zondax/dev
Migrate to Typescript
2 parents 97a90fe + 7440011 commit 9ce2b41

39 files changed

+1279
-12774
lines changed

.babelrc

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

.circleci/config.yml

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

.editorconfig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ root = true
44
charset = utf-8
55
trim_trailing_whitespace = true
66
insert_final_newline = true
7-
8-
[*.{js,json,vue}]
97
indent_style = space
108
indent_size = 2
9+
end_of_line = lf
1110

12-
[*.sh]
13-
indent_style = space
14-
indent_size = 2
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.cache
2+
.git
3+
node_modules
4+
public
5+
build
6+
dist

.eslintrc.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint', 'jest'],
5+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:jest/recommended', 'prettier'],
6+
env: {
7+
browser: true,
8+
es6: true,
9+
node: true,
10+
},
11+
settings: {},
12+
globals: {
13+
Atomics: 'readonly',
14+
SharedArrayBuffer: 'readonly',
15+
},
16+
parserOptions: {},
17+
rules: {
18+
'@typescript-eslint/explicit-function-return-type': 'off',
19+
'@typescript-eslint/explicit-module-boundary-types': 'off',
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
'@typescript-eslint/no-var-requires': 0,
22+
'@typescript-eslint/ban-ts-comment': 'off',
23+
'no-prototype-builtins': 0,
24+
'@typescript-eslint/no-misused-new': 0,
25+
'no-undef': 0,
26+
},
27+
}

.eslintrc.json

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

.github/workflows/main.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Main'
2+
on:
3+
- push
4+
5+
jobs:
6+
configure:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
10+
datetime: ${{ steps.get-datetime.outputs.datetime }}
11+
steps:
12+
- id: get-user
13+
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"
14+
- id: get-datetime
15+
run: echo "::set-output name=datetime::$(date +'%Y%m%d%H%M%S')"
16+
17+
build:
18+
needs: [configure]
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
with:
24+
submodules: true
25+
- name: Install node
26+
uses: actions/setup-node@v2
27+
- name: Install dependencies
28+
run: yarn install
29+
- name: Run linter
30+
run: yarn linter
31+
- name: Run formatter
32+
run: yarn format
33+
- name: Build
34+
run: yarn build
35+
- name: Unit tests
36+
run: yarn test:unit

.github/workflows/publish.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 'Publish packages'
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
- edited
8+
tags:
9+
- "v[0-9]+(\\.[0-9]+)*"
10+
11+
jobs:
12+
configure:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
datetime: ${{ steps.get-datetime.outputs.datetime }}
16+
steps:
17+
- id: get-datetime
18+
run: echo "::set-output name=datetime::$(date +'%Y%m%d%H%M%S')"
19+
20+
publish_npm_package:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
- name: Install node
26+
uses: actions/setup-node@v2
27+
with:
28+
registry-url: 'https://registry.npmjs.org'
29+
scope: '@zondax'
30+
- run: mv README-npm.md README.md
31+
- name: Install yarn
32+
run: npm install -g yarn
33+
- run: yarn install
34+
- run: yarn build
35+
- name: Get latest release version number
36+
id: get_version
37+
uses: battila7/get-version-action@v2
38+
- name: Update tag
39+
run: |
40+
echo Publishing as ${{ steps.get_version.outputs.version }}
41+
npm --allow-same-version --no-git-tag-version version ${{ steps.get_version.outputs.version }}
42+
- name: Publish package
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH_AUTO }}
45+
run: |
46+
npm publish

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,10 @@ TODO\.md
7070
/certs/cert.pem
7171
/certs/server.cert
7272
/certs/server.key
73+
74+
/.idea
75+
/node_modules/
76+
/output/
77+
/dist/
78+
79+
/yarn.lock

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

0 commit comments

Comments
 (0)