Skip to content

Commit

Permalink
Fixing review findings
Browse files Browse the repository at this point in the history
  • Loading branch information
juditortiz10 committed Feb 23, 2024
1 parent b4cb4bf commit c93c3aa
Show file tree
Hide file tree
Showing 20 changed files with 165 additions and 839 deletions.
13 changes: 0 additions & 13 deletions .babelrc

This file was deleted.

14 changes: 0 additions & 14 deletions .editorconfig

This file was deleted.

22 changes: 5 additions & 17 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
{
"env": {
"browser": true,
"es6": true,
"node": true,
"jest/globals": true
},
"plugins": ["jest", "prettier"],
"extends": ["airbnb-base", "plugin:prettier/recommended"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
"es2021": true,
"node": true
},
"extends": ["standard-with-typescript","prettier"],
"parserOptions": {
"parser": "babel-eslint",
"ecmaVersion": 2018,
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"import/prefer-default-export": "off",
"vue/html-self-closing": "off",
"vue/max-attributes-per-line": "off",
"import/no-unresolved": [2, { "caseSensitive": false }]
}
"rules": {}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ typings/

TODO\.md

\dist
dist
/certs/cert.pem
/certs/server.cert
/certs/server.key
Expand Down
Empty file removed certs/.gitkeep
Empty file.
12 changes: 0 additions & 12 deletions certs/openssl.cnf

This file was deleted.

9 changes: 0 additions & 9 deletions jest.config.integration.js

This file was deleted.

32 changes: 0 additions & 32 deletions jest.config.js

This file was deleted.

9 changes: 0 additions & 9 deletions jest.config.unit.js

This file was deleted.

46 changes: 10 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,64 +20,38 @@
},
"homepage": "https://github.com/zondax/ledger-filecoin-js",
"dependencies": {
"@babel/runtime": "^7.21.0",
"@ledgerhq/cryptoassets": "6.37.0",
"@ledgerhq/hw-app-eth": "^6.35.5",
"@zondax/ledger-js": "^0.2.2",
"typescript": "^5.3.3",
"varint": "^6.0.0"
},
"devDependencies": {
"@babel/cli": "^7.18.10",
"@babel/core": "^7.18.10",
"@babel/node": "^7.18.10",
"@babel/plugin-transform-runtime": "^7.18.9",
"@babel/preset-env": "^7.18.9",
"@ledgerhq/hw-transport": "^6.30.4",
"@ledgerhq/hw-transport-node-hid": "6.27.12",
"@ledgerhq/hw-transport-webusb": "6.27.12",
"@ledgerhq/logs": "^6.10.1",
"@zondax/filecoin-signing-tools": "^2.4.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^29.5.0",
"bip32": "^2.0.5",
"bip39": "^3.1.0",
"blake2": "^5.0.0",
"core-js": "^3.15.2",
"crypto-js": "^4.2.0",
"@types/node": "^20.11.5",
"@types/varint": "^6.0.3",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"eslint": "^8.22.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard-with-typescript": "^43.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"index.js": "^0.0.3",
"jest": "^29.5.0",
"jest-serial-runner": "^1.2.1",
"prettier": "^2.3.2",
"secp256k1": "^5.0.0"
"secp256k1": "^5.0.0",
"typescript": "5.2.2"
},
"scripts": {
"build": "tsc",
"certificate": "openssl req -nodes -config certs/openssl.cnf -new -x509 -keyout certs/server.key -out certs/server.cert; openssl x509 -in certs/server.cert -out certs/cert.pem -outform PEM",
"test:unit": "jest -c jest.config.unit.js",
"test:integration": "jest -c jest.config.integration.js --runInBand --detectOpenHandles",
"linter": "eslint --ext .ts,.tsx,.js,.jsx --ignore-path .eslintignore . --max-warnings 0",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\""
"linter:fix": "yarn run linter --fix",
"format": "prettier --write ."
},
"moduleDirectories": [
"node_modules",
"dist"
],
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
],
"publishConfig": {
"access": "public"
}
Expand Down
13 changes: 8 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title>App Integration Example</title>
</head>
<body>
<noscript>
<strong>We're sorry but the integration example doesn't work properly when JavaScript is disabled. Please enable it to continue.</strong>
<strong
>We're sorry but the integration example doesn't work properly when JavaScript is disabled. Please
enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
Expand Down
18 changes: 8 additions & 10 deletions src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ export const P2_VALUES = {
};

export const enum INS {
GET_VERSION = 0x00,
GET_ADDR_SECP256K1 = 0x01,
SIGN_SECP256K1 = 0x02,
SIGN_DATA_CAP = 0x05,
SIGN_CLIENT_DEAL = 0x06,
SIGN_RAW_BYTES = 0x07,
};
GET_VERSION = 0x00,
GET_ADDR_SECP256K1 = 0x01,
SIGN_SECP256K1 = 0x02,
SIGN_DATA_CAP = 0x05,
SIGN_CLIENT_DEAL = 0x06,
SIGN_RAW_BYTES = 0x07,
}

export const P1_VALUES = {
ONLY_RETRIEVE: 0x00,
SHOW_ADDRESS_IN_DEVICE: 0x01,
};


Loading

0 comments on commit c93c3aa

Please sign in to comment.