mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-02-20 00:33:07 +01:00
initial commit
This commit is contained in:
10
.eslintignore
Normal file
10
.eslintignore
Normal file
@@ -0,0 +1,10 @@
|
||||
.next
|
||||
_old
|
||||
build
|
||||
|
||||
node_modules
|
||||
generated
|
||||
|
||||
next.config.js
|
||||
packages/suite-desktop/src/electron.js
|
||||
packages/suite-desktop/src/preload.js
|
||||
95
.eslintrc.js
Normal file
95
.eslintrc.js
Normal file
@@ -0,0 +1,95 @@
|
||||
// Temp fix for import.
|
||||
// https://github.com/benmosher/eslint-plugin-import/issues/1285#issuecomment-466212438
|
||||
const jsExtensions = ['.js', '.jsx'];
|
||||
const tsExtensions = ['.ts', '.tsx'];
|
||||
const allExtensions = jsExtensions.concat(tsExtensions);
|
||||
|
||||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
modules: true,
|
||||
},
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'react-hooks', 'prettier'],
|
||||
extends: [
|
||||
'airbnb',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier',
|
||||
'prettier/babel',
|
||||
'prettier/@typescript-eslint',
|
||||
'prettier/react',
|
||||
],
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
// linkComponents: [
|
||||
// // Components used as alternatives to <a> for linking, eg. <Link to={ url } />
|
||||
// 'Hyperlink',
|
||||
// { name: 'Link', linkAttribute: 'to' },
|
||||
// ],
|
||||
// Temp fix for import.
|
||||
// https://github.com/benmosher/eslint-plugin-import/issues/1285#issuecomment-466212438
|
||||
'import/extensions': allExtensions,
|
||||
'import/parsers': {
|
||||
'@typescript-eslint/parser': tsExtensions,
|
||||
},
|
||||
'import/resolver': {
|
||||
node: {
|
||||
extensions: allExtensions,
|
||||
},
|
||||
},
|
||||
},
|
||||
// Este rules.
|
||||
rules: {
|
||||
// I believe type is enforced by callers.
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
// Temp fix for import.
|
||||
// https://github.com/benmosher/eslint-plugin-import/issues/1285#issuecomment-466212438
|
||||
'import/named': 'off',
|
||||
// Enforce arrow functions only is afaik not possible. But this helps.
|
||||
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
|
||||
// Fix for TypeScript.
|
||||
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
|
||||
// I believe shadowing is a nice language feature.
|
||||
'no-shadow': 'off',
|
||||
// Does not work with TypeScript export type.
|
||||
'import/prefer-default-export': 'off',
|
||||
// Does not work with Babel react-native to react-native-web
|
||||
'import/no-unresolved': 'off',
|
||||
// We have types.
|
||||
'react/prop-types': 'off',
|
||||
// It's fine.
|
||||
'react/no-multi-comp': 'off',
|
||||
'react/no-unescaped-entities': 'off',
|
||||
// They are fine sometimes.
|
||||
'no-nested-ternary': 'off',
|
||||
// This is fine.
|
||||
'lines-between-class-members': 'off',
|
||||
// We use it for immer. It should be checked by readonly anyway.
|
||||
'no-param-reassign': 'off',
|
||||
// Irrelevant.
|
||||
'no-plusplus': 'off',
|
||||
'no-return-assign': 'off',
|
||||
'consistent-return': 'off',
|
||||
// TSC checks it.
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'no-undef': 'off',
|
||||
'react/jsx-no-undef': 'off',
|
||||
// React Hooks.
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'error',
|
||||
// Reconsider, maybe enable later:
|
||||
'@typescript-eslint/explicit-member-accessibility': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'react/destructuring-assignment': 'off',
|
||||
'import/no-extraneous-dependencies': 'off',
|
||||
'import/no-cycle': 'off',
|
||||
'prettier/prettier': 'error',
|
||||
},
|
||||
};
|
||||
31
.gitignore
vendored
Normal file
31
.gitignore
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
.next
|
||||
_old
|
||||
build
|
||||
|
||||
|
||||
# Dependency directory
|
||||
node_modules
|
||||
|
||||
# OSX
|
||||
.DS_Store
|
||||
|
||||
# Editors
|
||||
.idea
|
||||
.vscode
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
.yarnclean
|
||||
|
||||
coverage
|
||||
test/**/__diff_output__
|
||||
test/screenshots
|
||||
|
||||
translations/extractedMessages
|
||||
translations/*.csv
|
||||
|
||||
.env*
|
||||
!.env.dev
|
||||
4
.prettierignore
Normal file
4
.prettierignore
Normal file
@@ -0,0 +1,4 @@
|
||||
.next
|
||||
**/_old/*
|
||||
build
|
||||
node_modules
|
||||
11
.prettierrc
Normal file
11
.prettierrc
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"printWidth": 100,
|
||||
"arrowParens": "avoid",
|
||||
"bracketSpacing": true,
|
||||
"singleQuote": true,
|
||||
"semi": true,
|
||||
"trailingComma": "all",
|
||||
"tabWidth": 4,
|
||||
"useTabs": false,
|
||||
"jsxBracketSameLine": false
|
||||
}
|
||||
50
LICENSE.md
Normal file
50
LICENSE.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# TREZOR REFERENCE SOURCE LICENSE (T-RSL)
|
||||
|
||||
This license governs use of the accompanying software. If you use the software,
|
||||
you accept this license. If you do not accept the license, do not use the
|
||||
software.
|
||||
|
||||
## 1. Definitions
|
||||
|
||||
The terms "reproduce," "reproduction" and "distribution" have the same meaning
|
||||
here as under U.S. copyright law.
|
||||
|
||||
"You" means the licensee of the software.
|
||||
|
||||
"Your company" means the company you worked for when you downloaded the
|
||||
software.
|
||||
|
||||
"Reference use" means use of the software within your company as a reference,
|
||||
in read only form, for the sole purposes of debugging your products,
|
||||
maintaining your products, or enhancing the interoperability of your products
|
||||
with the software, and specifically excludes the right to distribute the
|
||||
software outside of your company.
|
||||
|
||||
"Licensed patents" means any Licensor patent claims which read directly on the
|
||||
software as distributed by the Licensor under this license.
|
||||
|
||||
## 2. Grant of Rights
|
||||
|
||||
(A) Copyright Grant - Subject to the terms of this license, the Licensor grants
|
||||
you a non-transferable, non-exclusive, worldwide, royalty-free copyright
|
||||
license to reproduce the software for reference use.
|
||||
|
||||
(B) Patent Grant - Subject to the terms of this license, the Licensor grants
|
||||
you a non-transferable, non-exclusive, worldwide, royalty-free patent license
|
||||
under licensed patents for reference use.
|
||||
|
||||
## 3. Limitations
|
||||
|
||||
(A) No Trademark License - This license does not grant you any rights to use
|
||||
the Licensor's name, logo, or trademarks.
|
||||
|
||||
(B) If you begin patent litigation against the Licensor over patents that you
|
||||
think may apply to the software (including a cross-claim or counterclaim in
|
||||
a lawsuit), your license to the software ends automatically.
|
||||
|
||||
(C) The software is licensed "as-is." You bear the risk of using it. The
|
||||
Licensor gives no express warranties, guarantees or conditions. You may have
|
||||
additional consumer rights under your local laws which this license cannot
|
||||
change. To the extent permitted under your local laws, the Licensor excludes
|
||||
the implied warranties of merchantability, fitness for a particular purpose and
|
||||
non-infringement.
|
||||
7
README.md
Normal file
7
README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
## trezor-suite monorepo
|
||||
|
||||
Projects:
|
||||
- @trezor/components
|
||||
- @trezor/suite
|
||||
- @trezor/suite-desktop
|
||||
- @trezor/suite-native
|
||||
52
package.json
Normal file
52
package.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "trezor-suite",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"repository": "https://github.com/trezor/trezor-suite.git",
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"deps": "rimraf 'node_modules' '**/node_modules' && yarn",
|
||||
"deps:update": "rimraf 'yarn.lock' 'node_modules' '**/node_modules' && yarn",
|
||||
"dev": "wsrun --exclude-missing dev",
|
||||
"dev:ios": "yarn workspace @trezor/suite-native dev:ios",
|
||||
"dev:android": "yarn workspace @trezor/suite-native dev:android",
|
||||
"dev:desktop": "yarn workspace @trezor/suite-desktop dev:desktop",
|
||||
"lint": "eslint '**/*.{ts,tsx}'",
|
||||
"lint:fix": "yarn lint --fix",
|
||||
"lint:prettier": "pretty-quick",
|
||||
"prettier:check": "eslint --print-config '**/*.{ts,tsx}' | eslint-config-prettier-check",
|
||||
"tsc": "tsc",
|
||||
"test": "run-s lint tsc",
|
||||
"build": "wsrun --exclude-missing build"
|
||||
},
|
||||
"dependencies": {
|
||||
"wsrun": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^1.4.1",
|
||||
"@typescript-eslint/parser": "^1.4.1",
|
||||
"eslint": "^5.14.1",
|
||||
"eslint-config-airbnb": "^17.1.0",
|
||||
"eslint-config-prettier": "^4.0.0",
|
||||
"eslint-import-resolver-node": "^0.3.2",
|
||||
"eslint-plugin-import": "^2.16.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.1",
|
||||
"eslint-plugin-prettier": "^3.0.1",
|
||||
"eslint-plugin-react": "^7.12.4",
|
||||
"eslint-plugin-react-hooks": "^1.2.0",
|
||||
"babel-plugin-module-resolver": "^3.1.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^1.16.4",
|
||||
"prettier-eslint": "^8.8.2",
|
||||
"pretty-quick": "^1.10.0",
|
||||
"prettylint": "^1.0.0",
|
||||
"rimraf": "^2.6.3",
|
||||
"typescript": "^3.2.2"
|
||||
}
|
||||
}
|
||||
24
tsconfig.json
Normal file
24
tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@suite/*": ["./packages/suite/src/*"],
|
||||
"@native/*": ["./packages/suite-native/src/*"],
|
||||
"@desktop/*": ["./packages/suite-desktop/src/*"],
|
||||
},
|
||||
"jsx": "react-native",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"noEmit": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"target": "esnext",
|
||||
},
|
||||
"exclude": ["node_modules", "**/api/generated/**/*.*", "**/_old/**/*.*"]
|
||||
}
|
||||
Reference in New Issue
Block a user