Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5b7f4cd
chore: use macos-latest for package
WhiteMinds May 5, 2023
e0a2fdc
fix: applyLocalhostIPv4Resolve caused additional impact
WhiteMinds May 6, 2023
70c604b
feat: provide loading for the detail button on the history page
WhiteMinds May 6, 2023
3cc5163
Merge pull request #2655 from WhiteMinds/fix/122_AdditionalImpact
Keith-CY May 8, 2023
39725b5
Merge pull request #2656 from WhiteMinds/feat/129_DetailButtonUX
WhiteMinds May 8, 2023
0f3c4c8
chore(deps): update typescript to 5.0.4
yanguoyu May 10, 2023
e96d686
fix: Add min-height avoid dialog truncation
yanguoyu May 10, 2023
b314dfc
Merge pull request #2661 from yanguoyu/fix-claim-dialog
Keith-CY May 11, 2023
f4f1073
Merge pull request #2660 from yanguoyu/chore-typescript
Keith-CY May 12, 2023
1578965
Merge pull request #2664 from nervosnetwork/workflow-macos-latest
Keith-CY May 15, 2023
df6bf91
docs: proxy when install (#2657)
homura May 15, 2023
240cadf
Merge branch 'develop' into support-light-client
Keith-CY May 15, 2023
1b3d647
Merge branch 'merge-develop-into-support-light-client' into support-l…
Keith-CY May 15, 2023
5950982
fix: Fix deposit dao (#2663)
yanguoyu May 15, 2023
f527c0f
Merge branch 'develop' of https://github.com/nervosnetwork/neuron int…
Keith-CY May 15, 2023
0367857
Fix the current problematic ESLint and Prettier workflow (#2662)
WhiteMinds May 16, 2023
6bdd7e4
refactor: resolve some eslint warnings
WhiteMinds May 16, 2023
ac9afe2
Merge pull request #2671 from WhiteMinds/fix/ESLintWarnnings
Keith-CY May 16, 2023
68c92d1
Merge branch 'develop' into merge-develop-into-support-light-client
Keith-CY May 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
node:
- 18.12.0
os:
- macos-11
- macos-latest
- ubuntu-20.04
- windows-2019

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
CI: false

- name: Package for MacOS
if: matrix.os == 'macos-11'
if: matrix.os == 'macos-latest'
run: |
./scripts/download-ckb.sh mac
yarn release mac
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Neuron App Zip
if: matrix.os == 'macos-11'
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: Neuron-Mac
Expand All @@ -113,7 +113,7 @@ jobs:
path: release/Neuron-*-mac-arm64.zip

- name: Upload Neuron Dmg
if: matrix.os == 'macos-11'
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: Neuron-Dmg
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/package_for_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
node:
- 18.12.0
os:
- macos-11
- macos-latest
- ubuntu-20.04
- windows-2019

Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
CI: false

- name: Package for MacOS
if: matrix.os == 'macos-11'
if: matrix.os == 'macos-latest'
run: |
./scripts/download-ckb.sh mac
yarn package:test mac
Expand Down Expand Up @@ -94,28 +94,28 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Neuron App Zip
if: matrix.os == 'macos-11'
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: Neuron-Mac-x64
path: release/Neuron-*-mac-x64.zip

- name: Upload Neuron App Zip(arm64)
if: matrix.os == 'macos-11'
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: Neuron-Mac-arm64
path: release/Neuron-*-mac-arm64.zip

- name: Upload Neuron Dmg
if: matrix.os == 'macos-11'
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: Neuron-Dmg-x64
path: release/Neuron-*-x64.dmg

- name: Upload Neuron Dmg(arm64)
if: matrix.os == 'macos-11'
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: Neuron-Dmg-arm64
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

lerna run --no-bail --stream precommit
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These files are generated by tools and may be edited again by the tools, so we are temporarily not formatting them.
**/packages/neuron-wallet/src/database/chain/migrations/**/*.ts
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"editor.rulers": [120],
"eslint.workingDirectories": [
{
"directory": "packages/neuron-wallet",
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ $ yarn global add lerna # install lerna globally

#### Install Dependencies

> Notes:
> 1. Please set [proxy](https://www.electronjs.org/docs/latest/tutorial/installation#proxies) if you are using a proxy locally and find the downloading is halted
> 2. Please set [CDN](https://www.electronjs.org/docs/latest/tutorial/installation#mirror) if the downloading is slow

After lerna has been installed, run this to install and link dependencies:

```shell
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,9 @@
"test": "cross-env NODE_OPTIONS=--openssl-legacy-provider lerna run --parallel test",
"test:ci": "yarn build:main && yarn test",
"lint": "lerna run --stream lint",
"postinstall": "lerna run build --scope=@nervina-labs/ckb-indexer",
"postinstall": "husky install && lerna run build --scope=@nervina-labs/ckb-indexer",
"db:chain": "node ./node_modules/.bin/typeorm"
},
"husky": {
"hooks": {
"pre-commit": "lerna run --no-bail --stream precommit"
}
},
"devDependencies": {
"@babel/core": "7.21.4",
"@types/jest": "27.5.2",
Expand All @@ -52,11 +47,15 @@
"@typescript-eslint/parser": "5.58.0",
"concurrently": "8.0.1",
"cross-env": "7.0.3",
"eslint": "8.38.0",
"eslint-config-prettier": "8.8.0",
"husky": "8.0.3",
"lerna": "5.6.2",
"lint-staged": "13.2.1",
"ncp": "2.0.0",
"prettier": "2.8.7",
"ts-jest": "27.1.5",
"typescript": "4.8.3",
"typescript": "5.0.4",
"wait-on": "6.0.1"
},
"dependencies": {},
Expand Down
167 changes: 54 additions & 113 deletions packages/neuron-ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
extends: ['airbnb', 'plugin:prettier/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['airbnb', 'plugin:@typescript-eslint/recommended', 'prettier'],
settings: {
// https://github.com/SimulatedGREG/electron-vue/issues/423#issuecomment-464807973
'import/core-modules': ['electron'],
'import/resolver': {
node: {
paths: ['src'],
Expand All @@ -13,92 +13,61 @@ module.exports = {
version: 'detect',
},
},
env: {
jest: true,
node: true,
browser: true,
},
globals: {
BigInt: 'readonly',
},
rules: {
'prettier/prettier': [
2,
{
printWidth: 120,
endOfLine: 'auto',
},
],
semi: [2, 'never'],
curly: [2, 'all'],
'comma-dangle': [
2,
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
},
],
'import/no-extraneous-dependencies': [
2,
{
devDependencies: true,
},
],
'no-unused-vars': 'off',
'implicit-arrow-linebreak': 'off',
// TODO: Some temporarily disabled rules will be re-enabled later, considering that many files are affected and will be addressed in the future.
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',

// This is the configuration that was set when using eslint-plugin-prettier
// https://github.com/prettier/eslint-plugin-prettier#arrow-body-style-and-prefer-arrow-callback-issue
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',

// https://github.com/jsx-eslint/eslint-plugin-react/issues/498
'react/prop-types': 'off',

// TypeScript support
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'local',
args: 'after-used',
ignoreRestSiblings: false,
argsIgnorePattern: '^_',
},
],
'arrow-parens': [2, 'as-needed'],
'max-len': [
2,
{
code: 120,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'object-curly-newline': [
// Avoid duplicating @typescript-eslint/no-shadow
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',

// Unnecessary rules
'no-plusplus': 'off',
'max-classes-per-file': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'warn',
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',

// Adjusted rules
'no-console': [
'error',
{
ObjectExpression: {
consistent: true,
},
ObjectPattern: {
consistent: true,
},
ImportDeclaration: {
consistent: true,
},
ExportDeclaration: {
multiline: true,
minProperties: 3,
},
allow: ['info', 'warn', 'error', 'group', 'groupEnd'],
},
],
'no-plusplus': [0],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'max-classes-per-file': [0],
'react/jsx-filename-extension': [
1,
{
extensions: ['.ts', '.tsx'],
},
],
'react/jsx-props-no-spreading': [0],
'typescript-eslint/no-angle-bracket-type-assertion': [0],
'no-alert': [0],
'no-console': [
2,
'import/no-extraneous-dependencies': [
'error',
{
allow: ['info', 'warn', 'error', 'group', 'groupEnd'],
devDependencies: ['**/*.stories.*', 'src/setupTests.ts'],
},
],
'no-bitwise': [0],
'import/extensions': [
'error',
'ignorePackages',
Expand All @@ -107,53 +76,25 @@ module.exports = {
tsx: 'never',
},
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-var-requires': 'off',
'react/prop-types': 'off',
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
'react/jsx-filename-extension': [
'warn',
{
extensions: ['.jsx', '.tsx'],
},
],
'react/function-component-definition': [
2,
'error',
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react/require-default-props': 'off',
'@typescript-eslint/ban-types': [
'react/jsx-no-useless-fragment': [
'error',
{
extendDefaults: true,
types: {
'{}': false,
Function: false,
},
allowExpressions: true,
},
],
'no-unsafe-optional-chaining': ['warn', { disallowArithmeticOperators: false }],
'react/no-unstable-nested-components': ['warn', { allowAsProps: true }],
'default-param-last': 'off',
'react/jsx-no-useless-fragment': 'off',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'no-undef': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
rules: {
'react/jsx-no-constructed-context-values': 0,
},
},
],
env: {
jest: true,
node: true,
browser: true,
},
globals: {
BigInt: 'readonly',
},
}
5 changes: 0 additions & 5 deletions packages/neuron-ui/.prettierrc

This file was deleted.

11 changes: 11 additions & 0 deletions packages/neuron-ui/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
tabWidth: 2,
useTabs: false,
printWidth: 120,
trailingComma: 'es5',
semi: false,
singleQuote: true,
// TODO: This is the previous legacy configuration, should use the default settings, considering that more files are affected, and will be dealt with later.
// https://prettier.io/blog/2020/03/21/2.0.0.html#change-default-value-for-arrowparens-to-always-7430httpsgithubcomprettierprettierpull7430-by-kachkaevhttpsgithubcomkachkaev
arrowParens: 'avoid',
}
1 change: 1 addition & 0 deletions packages/neuron-ui/config-overrides.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path')

module.exports = function override(config) {
Expand Down
4 changes: 0 additions & 4 deletions packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,10 @@
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.7",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.32.2",
"jest-styled-components": "7.1.1",
"lint-staged": "13.2.1",
"prettier": "2.8.7",
"react-app-rewired": "2.2.1",
"react-scripts": "5.0.1",
"react-test-renderer": "16.14.0",
Expand Down
Loading