Skip to content

Commit

Permalink
Merge pull request #1395 from Conflux-Chain/dev
Browse files Browse the repository at this point in the history
release 2.7.2
  • Loading branch information
iosh authored Aug 26, 2024
2 parents dca3195 + c8ff802 commit 3e9143b
Show file tree
Hide file tree
Showing 97 changed files with 7,970 additions and 4,896 deletions.
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# shared basic environment variable
# the build tool will load this file with any NODE_ENV
SNOWPACK_PUBLIC_FLUENT_VERSION=2.6.2

SNOWPACK_PUBLIC_FLUENT_VERSION=2.6.3
1 change: 0 additions & 1 deletion .env.development.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
# the build tool will load this file when NODE_ENV is development
# NOTE: don't commit .env.development.local into git
# NOTE: this file will override .env.development
SNOWPACK_PUBLIC_IS_LOCAL_ENV=true
19 changes: 13 additions & 6 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: "yarn"
cache: 'yarn'
node-version: ${{ matrix.node-version }}
- uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11"
distribution: 'adopt'
java-version: '11'
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@7.0
with:
Expand Down Expand Up @@ -104,11 +104,18 @@ jobs:
- name: build and release
env:
SNOWPACK_PUBLIC_SENTRY_DSN: ${{ secrets.SNOWPACK_PUBLIC_SENTRY_DSN }}
SNOWPACK_PUBLIC_FLUENT_ENV: "debug-release"
SNOWPACK_PUBLIC_FLUENT_ENV: 'debug-release'
SNOWPACK_PUBLIC_FLUENT_VERSION: ${{ fromJSON(steps.get-release-version-and-tag.outputs.result).version }}
run: yarn prod:release
run: yarn build

- name: zip files
run: |
cd ./dist
zip -r ./chrome.zip ./chrome
zip -r ./firefox.zip ./firefox
zip -r ./edge.zip ./edge
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: releases/*
asset_path: dist/*.zip
11 changes: 9 additions & 2 deletions .github/workflows/prod-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,19 @@ jobs:
SNOWPACK_PUBLIC_SENTRY_DSN: ${{ secrets.SNOWPACK_PUBLIC_SENTRY_DSN }}
SNOWPACK_PUBLIC_FLUENT_ENV: "production"
SNOWPACK_PUBLIC_FLUENT_VERSION: ${{ steps.dotenv.outputs.SNOWPACK_PUBLIC_FLUENT_VERSION }}
run: yarn prod:release
run: yarn build

- name: zip files
run: |
cd ./dist
zip -r ./chrome.zip ./chrome
zip -r ./firefox.zip ./firefox
zip -r ./edge.zip ./edge
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: releases/*
asset_path: dist/*.zip

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4.0.4
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"name": "vscode-jest-tests",
"request": "launch",
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": ["--runInBand"],
"args": ["${fileBasenameNoExtension}"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true
"env": {"NODE_OPTIONS": "--experimental-vm-modules", "NODE_ENV": "test"}
},
{
"type": "pwa-node",
Expand Down
4 changes: 3 additions & 1 deletion examples/basic-dapp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// more info about js-conflux-sdk
// https://github.com/Conflux-Chain/js-conflux-sdk#readme
// eslint-disable-next-line import/no-unresolved
import {Conflux, format} from 'https://cdn.skypack.dev/js-conflux-sdk'
import * as SDK from 'https://cdn.skypack.dev/js-conflux-sdk'

const {Conflux, format} = SDK.default

const exampleContract = new Conflux().Contract({
abi: [
Expand Down
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
),
},

testEnvironment: './scripts/jest-test-jsdom-env.js',
testEnvironment: 'jsdom',
// The glob patterns Jest uses to detect test files
testMatch: ['<rootDir>/packages/**/*.test.[jt]s?(x)'],

Expand All @@ -33,6 +33,7 @@ module.exports = {
...[
'@fluent-wallet/jest-helper/setup-after-env.js',
'jest-webextension-mock',
'./scripts/jest-test-jsdom-env.js',
],
],

Expand Down Expand Up @@ -116,6 +117,8 @@ module.exports = {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
tslib: 'tslib/tslib.es6.js',
'react-use': 'react-use/esm/index.js',
uuid: require.resolve('uuid'),
'^uuid$': 'uuid',
},
// globalSetup: path.resolve(__dirname, './scripts/jest-global-setup.js')
}
38 changes: 34 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "helios",
"private": true,
"version": "2.7.2",
"workspaces": [
"websites/*",
"packages/doc-ui/*",
Expand Down Expand Up @@ -56,7 +57,14 @@
"test:unit": "cross-env NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest --no-cache --testPathIgnorePatterns '.*\\.integration\\.test\\.jsx?'",
"test:integration": "cross-env NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test node ./scripts/integration-test.js --no-cache --config='./integration.jest.config.js'",
"contract:compile": "bash ./scripts/solc.sh",
"contract:watch": "watchexec --restart --on-busy-update queue -w ./contracts/ --debounce 500 yarn run contract:compile"
"contract:watch": "watchexec --restart --on-busy-update queue -w ./contracts/ --debounce 500 yarn run contract:compile",
"dev:chrome": "cross-env NODE_ENV=development cross-env TARGET_BROWSER=chrome webpack --config ./scripts/webpack.config.dev.mjs",
"dev:firefox": "cross-env NODE_ENV=development cross-env TARGET_BROWSER=firefox webpack --config ./scripts/webpack.config.dev.mjs",
"dev:edge": "cross-env NODE_ENV=development cross-env TARGET_BROWSER=edge webpack --config ./scripts/webpack.config.dev.mjs",
"build:chrome": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=chrome webpack --config ./scripts/webpack.config.prod.mjs",
"build:firefox": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=firefox webpack --config ./scripts/webpack.config.prod.mjs",
"build:edge": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=edge webpack --config ./scripts/webpack.config.prod.mjs",
"build": "yarn build:chrome && yarn build:firefox && yarn build:edge"
},
"devDependencies": {
"@babel/core": "7.17.9",
Expand All @@ -81,17 +89,24 @@
"@types/finalhandler": "^1",
"@types/js-string-escape": "^1",
"@types/serve-static": "^1",
"@types/webpack-bundle-analyzer": "^4",
"@yarnpkg/esbuild-plugin-pnp": "3.0.0-rc.2",
"@yqrashawn/snowpack": "3.8.6-fix-6",
"autoprefixer": "^10.4.7",
"autoprefixer": "10.4.20",
"babel-loader": "8.2.4",
"browserslist": "^4.20.4",
"buffer": "6.0.3",
"concurrently": "^7.2.1",
"copy-webpack-plugin": "12.0.2",
"cross-env": "^7.0.3",
"cross-fetch": "4.0.0",
"css-loader": "7.1.2",
"cssnano": "5.1.11",
"dot-env": "^0.0.1",
"dotenv-expand": "^8.0.3",
"dotenv-webpack": "8.1.0",
"esbuild": "0.14.43",
"esbuild-loader": "4.2.2",
"esbuild-plugin-alias": "0.2.1",
"esbuild-plugin-browserslist": "0.4.10",
"esbuild-style-plugin": "1.6.0",
Expand All @@ -107,16 +122,20 @@
"finalhandler": "1.2.0",
"fs-extra": "^10.1.0",
"highlight.js": "9.18.5",
"html-webpack-plugin": "5.6.0",
"husky": "^8.0.1",
"identity-obj-proxy": "3.0.0",
"jest": "^27.5.1",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-webextension-mock": "^3.7.22",
"js-string-escape": "1.0.1",
"lint-staged": "^13.0.1",
"mini-css-extract-plugin": "2.9.0",
"mustache": "^4.2.0",
"nock": "13.2.6",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.14",
"postcss-loader": "8.1.1",
"prettier": "^2.6.2",
"prettier-plugin-solidity": "1.0.0-beta.18",
"ramda": "^0.28.0",
Expand All @@ -127,12 +146,20 @@
"rimraf": "^3.0.2",
"serve-static": "1.15.0",
"shadow-cljs": "^2.19.4",
"stream-browserify": "3.0.0",
"style-loader": "4.0.0",
"stylelint": "^14.9.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^26.0.0",
"tailwindcss": "^3.1.1",
"wait-for-expect": "3.0.2",
"web-ext": "7.0.0",
"webpack": "5.93.0",
"webpack-bundle-analyzer": "4.10.2",
"webpack-cli": "5.1.4",
"webpack-merge": "6.0.1",
"wext-manifest-loader": "2.4.2",
"wext-manifest-webpack-plugin": "1.4.1",
"zip-a-folder": "1.1.3"
},
"nohoist": [
Expand Down Expand Up @@ -203,5 +230,8 @@
"no-descending-specificity": null
}
},
"packageManager": "yarn@3.2.0"
"packageManager": "yarn@3.2.0",
"dependencies": {
"@svgr/webpack": "8.1.0"
}
}
3 changes: 1 addition & 2 deletions packages/background/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helios-background",
"version": "0.0.12",
"version": "0.0.14",
"type": "module",
"main": "src/index.js",
"private": true,
Expand Down Expand Up @@ -82,7 +82,6 @@
"@fluent-wallet/net_version": "workspace:packages/rpcs/net_version",
"@fluent-wallet/personal_sign": "workspace:packages/rpcs/personal_sign",
"@fluent-wallet/rpc-engine": "workspace:packages/rpc-engine",
"@fluent-wallet/sentry": "workspace:*",
"@fluent-wallet/transducers": "workspace:packages/transducers",
"@fluent-wallet/txpool_next-nonce": "workspace:*",
"@fluent-wallet/wallet_accounts": "workspace:*",
Expand Down
21 changes: 1 addition & 20 deletions packages/background/src/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
// # imports
import 'regenerator-runtime/runtime'

import {IS_PROD_MODE, IS_TEST_MODE} from '@fluent-wallet/inner-utils'
import {EXT_STORAGE} from '@fluent-wallet/consts'

import {defRpcEngine} from '@fluent-wallet/rpc-engine'
import {persist as persistToExtStorageHandler} from './persist-db-to-ext-storage'
import {
Sentry,
init as initSentry,
capture as sentryCapture,
} from '@fluent-wallet/sentry'
import {getDefaultOptions as getSentryDefaultOptions} from '@fluent-wallet/sentry/computeDefaultOptions'

import browser from 'webextension-polyfill'
import SCHEMA from './db-schema'
import {listen} from '@fluent-wallet/extension-runtime/background.js'
import fillInitialDBData from './init-db.js'
import * as bb from '@fluent-wallet/webextension'
import {updateUserId} from '@fluent-wallet/sentry'
import {rpcEngineOpts} from './rpc-engine-opts'

// # setup
Expand All @@ -34,10 +24,6 @@ bb.commands.onCommand.addListener(commandName => {
else window.open(`${location.origin}/popup.html`)
})

// ## sentry
initSentry(getSentryDefaultOptions())
Sentry.setTag('custom_location', 'background')

// ## init db
async function initDB(initDBFn, skipRestore) {
const {createdb} = await import('@fluent-wallet/db')
Expand Down Expand Up @@ -69,8 +55,6 @@ async function initDB(initDBFn, skipRestore) {

// ## init rpc engine
async function initRPCEngine(dbConnection) {
rpcEngineOpts.sentryCapture = sentryCapture

const {request} = defRpcEngine(dbConnection, rpcEngineOpts)
const protectedRequest = (req = {}) =>
request({
Expand Down Expand Up @@ -134,10 +118,7 @@ export const initBG = async ({
// # initialize
;(async () => {
// ## db
const {request, db} = await initBG()

// ## sentry
updateUserId(db.getAddress()?.[0]?.hex)
const {request} = await initBG()

// ## start long running jobs
if (!IS_TEST_MODE) {
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "browser-extension",
"version": "0.0.9",
"version": "0.0.11",
"main": "index.js",
"author": "yqrashawn <namy.19@gmail.com>",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/confluxscan-api/contract.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'cross-fetch/polyfill'
import {fetch} from './fetcher.js'
import {getURL, isCoreNetworkId} from './utils.js'

Expand Down
Loading

0 comments on commit 3e9143b

Please sign in to comment.