diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 701f3773e7..3cb095a771 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: node: - - 16.4.0 + - 16.10.0 os: - macos-latest - ubuntu-20.04 @@ -23,6 +23,11 @@ jobs: name: ${{ matrix.os }}(Node.js ${{ matrix.node }}) steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/package_for_test.yml b/.github/workflows/package_for_test.yml index f01ab472db..917e613440 100644 --- a/.github/workflows/package_for_test.yml +++ b/.github/workflows/package_for_test.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: node: - - 16.4.0 + - 16.10.0 os: - macos-latest - ubuntu-20.04 @@ -18,6 +18,11 @@ jobs: name: ${{ matrix.os }}(Node.js ${{ matrix.node }}) steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 68f174ba3f..803d2f2cd2 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: node: - - 16.4.0 + - 16.10.0 os: - macos-latest - ubuntu-20.04 @@ -20,6 +20,11 @@ jobs: name: ${{ matrix.os }}(Node.js ${{ matrix.node }}) steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index beb844a13b..f372c6687d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +# 0.103.1 (2022-06-11) + +### New features +* #2375: Adapt new testnet URL(@yanguoyu) +* #2400: Support send acp/sudt to any address.(@yanguoyu) +* #2406: Refine export tx(@yanguoyu) +* #2408: add address format toggle in receive tabs(@Keith-CY) + + +### Bug fixes +* #2344: Delete unnecessary conditions. Retry should await.(@yanguoyu) +* #2390: Fix unmatched cheque lockHash(@yanguoyu) +* #2405: Remove covering above `update` button(@yanguoyu) +* #2409: Remove scroll(@yanguoyu) +* #2410: style of release note(@Keith-CY) + + +### Refactor +* #2368: Use blake160 replace addresse. Rename 'multi-sign' to 'multisig'(@yanguoyu) +* #2373, #2412: improve neuron-ui typescript, tests, deps and bundle(@qiweiii) + + +**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.103.0...v0.103.1 + + + # 0.103.0 (2022-05-10) ### Hardfork diff --git a/lerna.json b/lerna.json index 40ae796c61..5e03949c2d 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "0.103.0", + "version": "0.103.1", "npmClient": "yarn", "useWorkspaces": true } diff --git a/package.json b/package.json index 773f2374af..9d8b788387 100644 --- a/package.json +++ b/package.json @@ -44,19 +44,22 @@ } }, "devDependencies": { - "@types/jest": "24.0.18", + "@babel/core": "7.17.10", + "@types/jest": "27.5.0", "@types/node": "16.11.7", - "@typescript-eslint/eslint-plugin": "2.19.0", - "@typescript-eslint/parser": "2.19.0", + "@typescript-eslint/eslint-plugin": "5.23.0", + "@typescript-eslint/parser": "5.23.0", "concurrently": "7.0.0", "cross-env": "7.0.3", - "eslint": "6.7.2", "husky": "3.0.5", "lerna": "4.0.0", "ncp": "2.0.0", - "ts-jest": "24.0.2", + "ts-jest": "27.1.4", "typescript": "3.8.2", "wait-on": "6.0.0" }, - "dependencies": {} + "dependencies": {}, + "resolutions": { + "@types/react": "16.9.15" + } } diff --git a/packages/neuron-ui/.eslintrc.js b/packages/neuron-ui/.eslintrc.js index bfb9d8ef29..e82516a083 100644 --- a/packages/neuron-ui/.eslintrc.js +++ b/packages/neuron-ui/.eslintrc.js @@ -1,86 +1,159 @@ module.exports = { - "extends": ["airbnb", "plugin:prettier/recommended"], - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint"], - "settings": { - "import/resolver": { - "node": { - "paths": ["src"], - "extensions": [".js", ".ts", ".jsx", ".tsx"] - } + extends: ['airbnb', 'plugin:prettier/recommended'], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + settings: { + 'import/resolver': { + node: { + paths: ['src'], + extensions: ['.js', '.ts', '.jsx', '.tsx'], + }, + }, + react: { + version: 'detect', }, - "react": { - "version": "detect" - } }, - "rules": { - "prettier/prettier": [2, { - "printWidth": 120 - }], - "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", - "@typescript-eslint/no-unused-vars": ["error", { - "vars": "local", - "args": "after-used", - "ignoreRestSiblings": false - }], - "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": ["error", { - "ObjectExpression": { - "consistent": true + 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', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + vars: 'local', + args: 'after-used', + ignoreRestSiblings: false, + }, + ], + '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': [ + 'error', + { + ObjectExpression: { + consistent: true, + }, + ObjectPattern: { + consistent: true, + }, + ImportDeclaration: { + consistent: true, + }, + ExportDeclaration: { + multiline: true, + minProperties: 3, + }, }, - "ObjectPattern": { - "consistent": true + ], + 'no-plusplus': [0], + 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], + 'max-classes-per-file': [0], + 'react/jsx-filename-extension': [ + 1, + { + extensions: ['.ts', '.tsx'], }, - "ImportDeclaration": { - "consistent": true, + ], + 'react/jsx-props-no-spreading': [0], + 'typescript-eslint/no-angle-bracket-type-assertion': [0], + 'no-alert': [0], + 'no-console': [ + 2, + { + allow: ['info', 'warn', 'error', 'group', 'groupEnd'], }, - "ExportDeclaration": { - "multiline": true, - "minProperties": 3 - } - }], - "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, { - "allow": ["info", "warn", "error", "group", "groupEnd"] - }], - "no-bitwise": [0] + ], + 'no-bitwise': [0], + 'import/extensions': [ + 'error', + 'ignorePackages', + { + ts: 'never', + tsx: 'never', + }, + ], + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': ['error'], + '@typescript-eslint/no-var-requires': 'off', + 'react/prop-types': 'off', + 'react/function-component-definition': [ + 2, + { + namedComponents: 'arrow-function', + unnamedComponents: 'arrow-function', + }, + ], + 'react/require-default-props': 'off', + '@typescript-eslint/ban-types': [ + 'error', + { + extendDefaults: true, + types: { + '{}': false, + Function: false, + }, + }, + ], + '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', }, - "env": { - "jest": true, - "node": true, - "browser": true + 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" + globals: { + BigInt: 'readonly', }, } diff --git a/packages/neuron-ui/package.json b/packages/neuron-ui/package.json index 4e56fc0306..b4c3f4909e 100644 --- a/packages/neuron-ui/package.json +++ b/packages/neuron-ui/package.json @@ -1,6 +1,6 @@ { "name": "neuron-ui", - "version": "0.103.0", + "version": "0.103.1", "private": true, "author": { "name": "Nervos Core Dev", @@ -15,10 +15,10 @@ "main": "./build", "license": "MIT", "scripts": { - "start": "react-app-rewired start", + "start": "cross-env DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=false react-app-rewired start", "lint": "eslint --fix --ext .tsx,.ts,.js src", "test": "react-app-rewired test --env=jsdom --watchAll=false", - "build": "react-app-rewired build", + "build": "cross-env DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=false react-app-rewired build", "clean": "rimraf build/*", "precommit": "lint-staged", "storybook": "start-storybook -p 9009 -s public", @@ -27,9 +27,6 @@ "publishConfig": { "registry": "https://registry.npmjs.org/" }, - "eslintConfig": { - "extends": "react-app" - }, "lint-staged": { "src/**/*.{ts,tsx}": [ "eslint --fix", @@ -43,9 +40,8 @@ "last 2 chrome versions" ], "dependencies": { - "primereact": "7.1.0", - "@nervosnetwork/ckb-sdk-core": "0.102.2", - "@nervosnetwork/ckb-sdk-utils": "0.102.2", + "@nervosnetwork/ckb-sdk-core": "0.103.1", + "@nervosnetwork/ckb-sdk-utils": "0.103.1", "@uifabric/experiments": "7.42.4", "@uifabric/styling": "7.20.0", "canvg": "2.0.0", @@ -53,6 +49,7 @@ "immer": "9.0.12", "jsqr": "1.4.0", "office-ui-fabric-react": "7.180.3", + "primereact": "7.1.0", "qr.js": "0.0.0", "react": "16.12.0", "react-dom": "16.12.0", @@ -61,6 +58,7 @@ "sass": "1.47.0" }, "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "7.17.12", "@storybook/addon-actions": "5.3.18", "@storybook/addon-knobs": "5.3.18", "@storybook/addon-links": "5.3.18", @@ -82,17 +80,17 @@ "electron": "16.0.6", "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.2", - "eslint-config-airbnb": "18.0.1", - "eslint-config-prettier": "6.7.0", - "eslint-plugin-import": "2.18.2", - "eslint-plugin-jsx-a11y": "6.2.3", - "eslint-plugin-prettier": "3.1.1", - "eslint-plugin-react": "7.17.0", + "eslint-config-airbnb": "19.0.4", + "eslint-config-prettier": "8.5.0", + "eslint-plugin-import": "2.25.2", + "eslint-plugin-jsx-a11y": "6.5.1", + "eslint-plugin-prettier": "4.0.0", + "eslint-plugin-react": "7.29.4", "jest-styled-components": "7.0.0-beta.1", "lint-staged": "9.5.0", "prettier": "1.19.1", - "react-app-rewired": "2.1.5", - "react-scripts": "3.4.1", + "react-app-rewired": "2.2.1", + "react-scripts": "5.0.1", "react-test-renderer": "16.12.0", "rimraf": "3.0.0", "storybook-react-router": "1.0.8" diff --git a/packages/neuron-ui/src/components/ApproveMultisigTx/index.tsx b/packages/neuron-ui/src/components/ApproveMultisigTx/index.tsx index 9d11f4f44c..3bc19fa7c1 100644 --- a/packages/neuron-ui/src/components/ApproveMultisigTx/index.tsx +++ b/packages/neuron-ui/src/components/ApproveMultisigTx/index.tsx @@ -125,11 +125,11 @@ const ApproveMultisigTx = ({ ) : ( <>
{t('multisig-address.create-dialog.title')}
- {step === Step.setMN &&{t('multisig-address.create-dialog.multi-address-info.title', { m, n })}
@@ -126,7 +125,7 @@ const MultisigAddressCreateDialog = ({{t(`multisig-address.create-dialog.${field}`)} | - ))} -|||
---|---|---|---|
{`#${idx + 1}`} | -
-
+
+ {t(`multisig-address.create-dialog.${field}`)} |
+ ))}
+ | |
{`#${idx + 1}`} | ++ r || disabled} + /> + | +
+ {disabled ? (
+ |
-
- {disabled ? (
- |
-
{t('receive.prompt')}
} {isSingleAddress ? null : ( diff --git a/packages/neuron-ui/src/components/Receive/receive.module.scss b/packages/neuron-ui/src/components/Receive/receive.module.scss index 39cd5443fd..d6708e814b 100644 --- a/packages/neuron-ui/src/components/Receive/receive.module.scss +++ b/packages/neuron-ui/src/components/Receive/receive.module.scss @@ -13,6 +13,24 @@ justify-content: center; } +.addressToggle{ + display: flex; + align-items: center; + appearance: none; + border: none; + background: none; + svg { + pointer-events: none; + } + &:hover { + g, + path { + stroke: var(--nervos-green); + fill: var(--nervos-green); + } + } +} + .copyBtn { appearance: none; border: none; diff --git a/packages/neuron-ui/src/components/SUDTAccountPile/index.tsx b/packages/neuron-ui/src/components/SUDTAccountPile/index.tsx index 75317dd735..36d03f7b83 100644 --- a/packages/neuron-ui/src/components/SUDTAccountPile/index.tsx +++ b/packages/neuron-ui/src/components/SUDTAccountPile/index.tsx @@ -14,7 +14,6 @@ export interface SUDTAccountPileProps { symbol?: string balance: string tokenId: string - address: string decimal: string onClick: React.EventHandler