Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jleni committed Sep 1, 2024
1 parent 97dfbb8 commit 9f4c9a6
Show file tree
Hide file tree
Showing 18 changed files with 5,310 additions and 162 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Main"
name: 'Main'
on:
- push

Expand All @@ -10,27 +10,36 @@ jobs:
datetime: ${{ steps.get-datetime.outputs.datetime }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"
run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT
- id: get-datetime
run: echo "::set-output name=datetime::$(date +'%Y%m%d%H%M%S')"
run: echo "datetime=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT

build:
needs: [configure]
runs-on: ubuntu-latest
container:
image: node:20-bookworm
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
HEAD_BRANCH_NAME: ${{ github.head_ref }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

- name: Install node
uses: actions/setup-node@v2
- name: Install dependencies
run: yarn install
- name: Run linter
run: yarn lint
- name: Run formatter
run: yarn format
- name: Build
run: yarn build
- name: Unit tests
run: yarn test
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
scope: '@zondax'

- uses: oven-sh/setup-bun@v1

- run: bun install

- run: bun run format:check

- run: bun lint

- run: bun test
36 changes: 27 additions & 9 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,50 @@ jobs:
datetime: ${{ steps.get-datetime.outputs.datetime }}
steps:
- id: get-datetime
run: echo "::set-output name=datetime::$(date +'%Y%m%d%H%M%S')"
run: echo "datetime=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT

publish_npm_package:
runs-on: ubuntu-latest
runs-on: zondax-runners
container:
image: node:20-bookworm
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
HEAD_BRANCH_NAME: ${{ github.head_ref }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

- name: Install node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
scope: '@zondax'

- uses: oven-sh/setup-bun@v1

- run: bun install

- run: mv README-npm.md README.md
- name: Install yarn
run: npm install -g yarn
- run: yarn install
- run: yarn build
- run: bun run build

- name: Get latest release version number
id: get_version
uses: battila7/get-version-action@v2

- name: Show version
run: echo ${{ steps.get_version.outputs.version }}

- name: Update tag
run: |
echo Publishing as ${{ steps.get_version.outputs.version }}
npm --allow-same-version --no-git-tag-version version ${{ steps.get_version.outputs.version }}
- name: Publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH_AUTO }}
NODE_REPO_SERVER: 'https://registry.npmjs.org'
run: |
npm config set registry $NODE_REPO_SERVER
npm config set //registry.npmjs.org/:_authToken $NODE_AUTH_TOKEN
npm publish
78 changes: 4 additions & 74 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,79 +1,9 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

\.idea/

.vscode

TODO\.md

\dist
/certs/cert.pem
/certs/server.cert
/certs/server.key

/.idea
/node_modules/
/output/
/dist/

/yarn.lock
node_modules
.yarn/*
!.yarn/releases
!.yarn/plugins
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.yarn
node_modules
dist
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"singleQuote": true,
"arrowParens": "avoid",
"semi": false,
"useTabs": false,
"printWidth": 140,
"tabWidth": 2,
"importOrder": ["^@(.*)/(.*)$", "^[./]"],
"trailingComma": "es5",
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
4 changes: 0 additions & 4 deletions .prettierrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018 - 2023 Zondax AG
Copyright Zondax AG

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Empty file removed certs/.gitkeep
Empty file.
12 changes: 0 additions & 12 deletions certs/openssl.cnf

This file was deleted.

9 changes: 6 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
preset: 'ts-jest',
testEnvironment: 'node',
transformIgnorePatterns: ['^.+\\.js$'],
modulePaths: ['<rootDir>/src', '<rootDir>/tests'],
runner: 'jest-serial-runner',
}
41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,44 @@
"@ledgerhq/hw-transport-node-hid-noevents": "6.27.1"
},
"dependencies": {
"@ledgerhq/hw-transport": "6.30.6",
"@zondax/ledger-js": "^0.10.0",
"@ledgerhq/hw-transport": "6.31.2",
"@zondax/ledger-js": "^1.0.1",
"bech32": "^2.0.0",
"buffer": "^6.0.3",
"crypto": "^1.0.1",
"crypto-browserify": "^3.12.0",
"ripemd160": "^2.0.2",
"stream-browserify": "^3.0.0"
},
"devDependencies": {
"@ledgerhq/hw-transport-node-hid": "6.28.6",
"@ledgerhq/hw-transport-webusb": "6.28.6",
"@ledgerhq/hw-transport-mocker": "^6.28.6",
"@swc/core": "^1.6.1",
"@ledgerhq/hw-transport-node-hid": "6.29.3",
"@ledgerhq/hw-transport-webusb": "6.29.2",
"@ledgerhq/hw-transport-mocker": "^6.29.2",
"@swc/core": "^1.7.22",
"@types/jest": "^29.5.12",
"@types/ledgerhq__hw-transport": "4.21.8",
"@types/node": "^20.14.2",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@types/node": "^22.5.2",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"bip32": "4.0.0",
"bip39": "3.1.0",
"copyfiles": "^2.4.1",
"core-js": "^3.37.1",
"core-js": "^3.38.1",
"crypto-js": "4.2.0",
"eslint": "^9.5.0",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unused-imports": "^3.2.0",
"eslint-plugin-tsdoc": "^0.2.17",
"eslint-plugin-jest": "^28.8.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-unused-imports": "^4.1.3",
"eslint-plugin-tsdoc": "^0.3.0",
"jest": "^29.7.0",
"jest-serial-runner": "^1.2.0",
"prettier": "^3.3.2",
"jest-serial-runner": "^1.2.1",
"prettier": "^3.3.3",
"secp256k1": "^5.0.0",
"ts-jest": "29.1.5",
"ts-jest": "29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"webpack": "^5.92.0"
"typescript": "^5.5.4",
"webpack": "^5.94.0"
},
"moduleDirectories": [
"node_modules",
Expand Down
Binary file removed public/favicon.ico
Binary file not shown.
20 changes: 0 additions & 20 deletions public/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** ******************************************************************************
* (c) 2018 - 2023 Zondax AG
* (c) Zondax AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** ******************************************************************************
* (c) 2018 - 2023 Zondax AG
* (c) Zondax AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
* (c) 2018 - 2024 Zondax AG
* (c) Zondax AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"strict": true,
"esModuleInterop": true,
"declaration": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"outDir": "./dist",
"sourceMap": true,
Expand Down
Loading

0 comments on commit 9f4c9a6

Please sign in to comment.