Skip to content

Commit

Permalink
Merge pull request #424 from enkryptcom/develop
Browse files Browse the repository at this point in the history
Release: v1.37.0
  • Loading branch information
kvhnuke authored Apr 1, 2024
2 parents 8aa162d + 2ca1b43 commit 642d27f
Show file tree
Hide file tree
Showing 89 changed files with 4,653 additions and 3,364 deletions.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit $1
4 changes: 0 additions & 4 deletions .husky/prepare-commit-msg

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.3.cjs

This file was deleted.

875 changes: 875 additions & 0 deletions .yarn/releases/yarn-3.8.1.cjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
checksumBehavior: update

nodeLinker: node-modules

plugins:
Expand All @@ -8,4 +10,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.6.3.cjs
yarnPath: .yarn/releases/yarn-3.8.1.cjs
24 changes: 24 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
2,
"always",
[
"devop",
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"button",
],
],
},
};
40 changes: 0 additions & 40 deletions devmoji.config.js

This file was deleted.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "enkrypt",
"packageManager": "yarn@3.6.3",
"packageManager": "yarn@3.8.1",
"version": "0.0.2",
"private": true,
"workspaces": [
Expand All @@ -26,15 +26,15 @@
"upgrade": "yarn upgrade-interactive",
"version:bump:patch": "yarn workspaces foreach -pv --exclude @enkryptcom/extension exec 'yarn version --immediate patch'",
"publish": "yarn workspaces foreach -pv --exclude @enkryptcom/extension exec 'yarn npm publish --access public --otp 474911'",
"version:apply": "yarn version apply --all"
"version:apply": "yarn version apply --all",
"prepare": "husky"
},
"devDependencies": {
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@swc/core": "^1.4.4",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@swc/core": "^1.4.8",
"concurrently": "^8.2.2",
"devmoji": "^2.3.0",
"husky": "^8.0.3",
"husky": "^9.0.11",
"node-notifier": "^10.0.1",
"nodemon": "^3.1.0",
"ultra-runner": "^3.10.5"
Expand Down
10 changes: 5 additions & 5 deletions packages/extension-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
"dist"
],
"dependencies": {
"nanoevents": "^7.0.1",
"nanoevents": "^9.0.0",
"serialize-error": "11.0.3",
"tiny-uid": "^1.1.2",
"webextension-polyfill": "^0.10.0"
},
"devDependencies": {
"@types/chai": "^4.3.12",
"@types/chai": "^4.3.14",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.24",
"@types/node": "^20.11.30",
"@types/webextension-polyfill": "^0.10.7",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
Expand All @@ -55,8 +55,8 @@
"prettier": "^2.8.8",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsup": "^6.7.0",
"type-fest": "^2.19.0",
"tsup": "^8.0.2",
"type-fest": "^4.13.1",
"typescript": "^4.9.5",
"typescript-eslint": "0.0.1-alpha.0"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/configs/browser-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const BROWSER = process.env.BROWSER;
const browserNames = {
chrome: "chrome",
firefox: "firefox",
operaedge: "opera-edge",
};

const browserConfigs = {
Expand All @@ -18,6 +19,10 @@ const browserConfigs = {
manifest: "./src/manifest/manifest-firefox.json",
background: "./src/scripts/firefox/background.ts",
},
[browserNames.operaedge]: {
manifest: "./src/manifest/manifest-edge-opera.json",
background: "./src/scripts/chrome/background.ts",
},
};

function modifyManifest(buffer) {
Expand Down Expand Up @@ -67,6 +72,7 @@ const setConfig = (config) => {
BUILD_TIME: new Date().toLocaleString().replace(/\D/g, ""),
IS_DEV: process.env.NODE_ENV === "development",
IS_FIREFOX: BROWSER === browserNames.firefox,
IS_OPERA_EDGE: BROWSER === browserNames.operaedge,
PREFILL_PASSWORD:
process.env.NODE_ENV === "development"
? JSON.stringify("test pass")
Expand Down
47 changes: 25 additions & 22 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@enkryptcom/extension",
"version": "1.36.0",
"version": "1.37.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
"build:chrome": "cross-env BROWSER='chrome' vue-cli-service build && yarn build:rollup",
"build:operaedge": "cross-env BROWSER='opera-edge' vue-cli-service build && yarn build:rollup",
"build:firefox": "cross-env BROWSER='firefox' vue-cli-service build && yarn build:rollup && node configs/get-system-info.js",
"lint": "vue-cli-service lint --fix",
"build:rollup": "cross-env minify=on rollup --config configs/rollup.config.contentscript.mjs && cross-env minify=on rollup --config configs/rollup.config.inject.mjs",
Expand All @@ -18,7 +19,8 @@
"watch-vue-firefox": "cross-env BROWSER='firefox' vue-cli-service build --watch --no-clean"
},
"dependencies": {
"@babel/runtime": "^7.23.8",
"@amplitude/analytics-browser": "^2.5.3",
"@babel/runtime": "^7.24.1",
"@enkryptcom/extension-bridge": "workspace:^",
"@enkryptcom/hw-wallets": "workspace:^",
"@enkryptcom/keyring": "workspace:^",
Expand All @@ -27,33 +29,34 @@
"@enkryptcom/swap": "workspace:^",
"@enkryptcom/types": "workspace:^",
"@enkryptcom/utils": "workspace:^",
"@ethereumjs/common": "^3.2.0",
"@ethereumjs/tx": "^4.2.0",
"@ledgerhq/hw-transport-webusb": "^6.28.4",
"@ethereumjs/common": "^4.3.0",
"@ethereumjs/tx": "^5.3.0",
"@ethereumjs/util": "^9.0.3",
"@ledgerhq/hw-transport-webusb": "^6.28.5",
"@metamask/eth-sig-util": "^7.0.1",
"@rollup/plugin-replace": "^5.0.5",
"@types/chrome": "^0.0.262",
"@types/chrome": "^0.0.263",
"@types/events": "^3.0.3",
"@types/less": "^3.0.6",
"@types/lodash": "^4.14.202",
"@types/lodash": "^4.17.0",
"@types/utf-8-validate": "^5.0.2",
"@vueuse/core": "^9.13.0",
"@vueuse/core": "^10.9.0",
"add": "^2.0.6",
"bignumber.js": "^9.1.2",
"bip39": "^3.1.0",
"bitcoinjs-lib": "^6.1.5",
"chai": "^4.4.1",
"concurrently": "^8.2.2",
"core-js": "^3.36.0",
"core-js": "^3.36.1",
"echarts": "^5.5.0",
"ethereum-cryptography": "^2.1.3",
"ethereumjs-abi": "^0.6.8",
"ethereumjs-util": "^7.1.5",
"ethereumjs-wallet": "^1.0.2",
"eventemitter3": "^5.0.1",
"lodash": "^4.17.21",
"memoize-one": "^6.0.0",
"moment": "^2.30.1",
"nanoevents": "^7.0.1",
"nanoevents": "^9.0.0",
"pinia": "^2.1.7",
"qrcode.vue": "^3.4.1",
"switch-ts": "^1.1.1",
Expand All @@ -62,21 +65,21 @@
"vue": "^3.4.21",
"vue-echarts": "6.6.9",
"vue-router": "4.3.0",
"vue3-lottie": "^2.7.4",
"vue3-lottie": "^3.3.0",
"vuedraggable": "^4.1.0",
"web3-eth": "^1.10.4",
"web3-utils": "^1.10.4",
"yarn": "^1.22.21",
"yarn": "^1.22.22",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@babel/plugin-transform-class-static-block": "^7.23.4",
"@polkadot/api": "^10.12.1",
"@polkadot/extension-inject": "^0.46.7",
"@babel/plugin-transform-class-static-block": "^7.24.1",
"@polkadot/api": "^10.12.4",
"@polkadot/extension-inject": "^0.46.9",
"@polkadot/keyring": "^12.6.2",
"@polkadot/rpc-provider": "^10.12.1",
"@polkadot/types": "^10.12.1",
"@polkadot/types-known": "^10.12.1",
"@polkadot/rpc-provider": "^10.12.4",
"@polkadot/types": "^10.12.4",
"@polkadot/types-known": "^10.12.4",
"@polkadot/ui-shared": "^3.6.5",
"@polkadot/util": "^12.6.2",
"@polkadot/wasm-crypto": "^7.3.2",
Expand Down Expand Up @@ -106,17 +109,17 @@
"eslint-plugin-vue": "^8.7.1",
"https-browserify": "^1.0.0",
"less": "^4.2.0",
"less-loader": "^11.1.4",
"less-loader": "^12.2.0",
"mocha": "^10.3.0",
"path-browserify": "^1.0.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.5",
"rollup": "^3.29.4",
"rollup": "^4.13.0",
"rollup-plugin-uglify": "^6.0.4",
"semver": "^7.6.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"systeminformation": "^5.22.0",
"systeminformation": "^5.22.6",
"ts-mocha": "^10.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "^4.9.5",
Expand Down
21 changes: 19 additions & 2 deletions packages/extension/src/libs/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Message,
} from "@/types/messenger";
import { RPCRequestType } from "@enkryptcom/types";
import { v4 as randomUUID } from "uuid";
import { getCustomError } from "../error";
import KeyRingBase from "../keyring/keyring";
import { sendToWindow } from "@/libs/messenger/extension";
Expand Down Expand Up @@ -35,11 +36,13 @@ class BackgroundHandler {
#providers: ProviderType;
#persistentEvents: PersistentEvents;
#domainState: DomainState;
#settingsState: SettingsState;

constructor() {
this.#keyring = new KeyRingBase();
this.#persistentEvents = new PersistentEvents();
this.#domainState = new DomainState();
this.#settingsState = new SettingsState();
this.#tabProviders = {
[ProviderName.ethereum]: {},
[ProviderName.polkadot]: {},
Expand All @@ -49,6 +52,21 @@ class BackgroundHandler {
}
async init(): Promise<void> {
await handlePersistentEvents.bind(this)();
const enkryptSettings = await this.#settingsState.getEnkryptSettings();
if (!enkryptSettings.installedTimestamp) {
await this.#settingsState.setEnkryptSettings({
...enkryptSettings,
...{
installedTimestamp: new Date().getTime(),
randomUserID: randomUUID(),
},
});
} else {
await this.#settingsState.setEnkryptSettings({
...enkryptSettings,
randomUserID: randomUUID(),
});
}
}
async externalHandler(
msg: Message,
Expand All @@ -67,8 +85,7 @@ class BackgroundHandler {
result: JSON.stringify(true),
};
} else if (method === InternalMethods.getSettings) {
const settingsState = new SettingsState();
return settingsState.getAllSettings().then((settings) => {
return this.#settingsState.getAllSettings().then((settings) => {
return {
result: JSON.stringify(settings),
};
Expand Down
Loading

2 comments on commit 642d27f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.