Skip to content

Commit

Permalink
Release/1.43 (#1588)
Browse files Browse the repository at this point in the history
* Feature/refactoring (#1574)

* Update caniuse-lite

* Discard duplicate CSS rules (mostly element-ui)

* Add lazy loading for AppHeader heavy low priority components

* Fix styles warnings during build

* Fix bridge connected wallet icon

* Remove not used languages

* Update lang list

* Update Translation.spec.ts

* Feature/point system v2 (#1562)

* updated_with_consts_and_calculations

* updated_with_some_part_of_points

* updated_with_xor_fiat_balance

* added_calculate_for_all_categories

* updated_with_bridge_volume_from_indexer

* moves_to_service

* updated_with_types

* updated_with_new_data_in_consts

* point_card_created

* updated_component

* updated

* updated_with_first_trx

* added_scrollbar_added_currently_to_cards

* updated_loader_styles_other_css_title

* updated_tabs

* fixed_font

* updated_with_card_task_progress

* updated_for_mobile_devices

* updated_colors_paddings

* updated_with_dialog

* styles_updated

* updated_with_images_refactoring

* small_refactor

* updated_with_using_vxor_and_some_fixes

* lang_fixed

* updated_with_sora_card_banner

* fixed_some_sonar_problems

* getting_data_from_current_if_no_account_meta

* moved_requests

* removed_unnecessary_computed_properties

* fixed_pr_comments

* fixed_comments_added_feature_flag

* updated_env_json

* fixed_comments_updated_some_part_of_lang

* languages_updated

---------

Co-authored-by: NaghmeMohammadifar <45916098+Naghme98@users.noreply.github.com>
Co-authored-by: Nikita Polyakov <53777036+Nikita-Polyakov@users.noreply.github.com>

* feature/auto-switching-theme (#1573)

* updated_with_theme_checking_and_switching

* console_logs_added

* updated_with_logs_moved_function

* updated_for_telegram

* changed_logic_for_tg_detected

* updated_for_tg_version

* removed_timeout_updated_theme_tg

* fixing-problem_with_initial_light_theme

* reverted_last_commit_back

* updated

* added_logs_to_listener

* simplified_theme_detect

* removed_tg_check

* logic_updated

* used_another_approach

* reversed_previous_version

* deleted_async_added_more_logs

* added_additional_check

* updated_new_version_check_event_tg

* updated_with_received_event

* logic_changed

* updated_with_setting_by_bckcolor

* updated_with_switching_theme_on_phone

* fixed_apply_theme_condition_if_tg

* updated_with_checking_is_tma

* deleted_useless_info

* removed_logs

* update_with_switcher

* logic_update_theme_changed

* updated_changed_day_night_mode_from_chat_settings

* updated_with_method

* console_info_removed

* updated_wallet_version

* last_version_wallet_updated

* moved_from_app_functions_language_updated

* removed_unused_code

* logs_added

* updated_boolean

* logs_removed

* removed_useless_import

* [Tech] Vite migration (#1570)

* create basic migration

* fix icons

* dayjs import fix

* fix redirect & element font path

* add husky

* check lint-staged

* remove devtools plugin

* update dev deps

* add vite-electron-plugin

* upgrade eslint to v9

* update test commands

* remove jest

* add vitest

* remove jest files

* fix SelectIndexer import

* change electron package

* fix dialog import

* fix tsconfig

* update eslint config

* update dev deps

* try to skip index ci step

* return noIndex step

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* refactor redirect.ts

* update vitest config

* skip coverage

---------

Co-authored-by: f33r0 <95526886+f33r0@users.noreply.github.com>

* Remove dirty hack for dialog re-center

* Fix chart axis number format (#1578)

* chart & dayjs fixes

* update packages

* remove console.log

* fix dayjs en locale (#1581)

* commented_route (#1582)

* Replace blockNumber by blockNumber from wallet

* Remove blockNumber types

* Remove not used types import

* Translate vested transfer keys

* yarn lang:generate

* fixed_route_with_wrapper (#1585)

* Change vite vue plugin & fix App load (#1583)

* use @vitejs/plugin-vue2

* refactoring App.vue

* Update wallet

* Update en.json

* fixed_theme_switch (#1587)

* added_logs

* updated_with_theme_change_listener

* logs_removed

---------

Co-authored-by: Stefan Popov <popov@soramitsu.co.jp>
Co-authored-by: Kron1749 <70746258+Kron1749@users.noreply.github.com>
Co-authored-by: NaghmeMohammadifar <45916098+Naghme98@users.noreply.github.com>
Co-authored-by: f33r0 <95526886+f33r0@users.noreply.github.com>
  • Loading branch information
5 people authored Oct 30, 2024
1 parent 6a50927 commit 03845e2
Show file tree
Hide file tree
Showing 222 changed files with 7,219 additions and 21,890 deletions.
64 changes: 0 additions & 64 deletions .eslintrc.js

This file was deleted.

6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.DS_Store
node_modules
# Vite-builder output
/dist
# Electron-builder output
/dist-electron

/tests/e2e/videos/
/tests/e2e/screenshots/
Expand All @@ -25,8 +28,5 @@ pnpm-debug.log*
*.sln
*.sw?

# Electron-builder output
/dist_electron

# Webpack config inspect
.webpack-config.js
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
2 changes: 0 additions & 2 deletions .jest/register-context.js

This file was deleted.

4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Library('jenkins-library') _
@Library('jenkins-library@duty/migrate-pswap-to-vite') _

if (env.BRANCH_NAME == "master" || env.BRANCH_NAME == "develop") {
buildEnvironment = ['VUE_CLI_KEEP_TEST_ATTRS': true]
Expand All @@ -8,7 +8,7 @@ if (env.BRANCH_NAME == "master" || env.BRANCH_NAME == "develop") {

def pipeline = new org.js.AppPipeline(steps: this,
dockerImageName: 'polkaswap/exchange-web',
buildDockerImage: 'build-tools/node:20-alpine',
buildDockerImage: 'build-tools/node:20.18-alpine',
dockerRegistryCred: 'bot-polkaswap-rw',
buildEnvironment: buildEnvironment,
sonarProjectName: 'polkaswap-exchange-web',
Expand Down
1 change: 0 additions & 1 deletion __mocks__/nft.storage.ts

This file was deleted.

8 changes: 0 additions & 8 deletions babel.config.js

This file was deleted.

26 changes: 26 additions & 0 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { fileURLToPath, URL } from 'node:url';

import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
import { createVuePlugin as vue } from 'vite-plugin-vue2';

export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
build: {
lib: {
entry: 'src/main.ts',
},
},
},
preload: {
plugins: [externalizeDepsPlugin()],
},
renderer: {
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
plugins: [vue()],
},
});
87 changes: 87 additions & 0 deletions electron/background.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// import { app, protocol, BrowserWindow, shell } from 'electron';
// import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer';
// import { createProtocol } from 'vue-cli-plugin-electron-builder/lib';

// const isDevelopment = process.env.NODE_ENV !== 'production';

// // Scheme must be registered before the app is ready
// protocol.registerSchemesAsPrivileged([{ scheme: 'app', privileges: { secure: true, standard: true } }]);

// async function createWindow(): Promise<void> {
// const ELECTRON_NODE_INTEGRATION = !!process.env.ELECTRON_NODE_INTEGRATION;
// // Create the browser window.
// const win = new BrowserWindow({
// width: 800,
// height: 600,
// minWidth: 470,
// minHeight: 470,
// webPreferences: {
// // Use pluginOptions.nodeIntegration, leave this alone
// // See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
// nodeIntegration: ELECTRON_NODE_INTEGRATION,
// contextIsolation: !ELECTRON_NODE_INTEGRATION,
// },
// });

// if (process.env.VITE_DEV_SERVER_URL) {
// // Load the url of the dev server if in development mode
// await win.loadURL(process.env.VITE_DEV_SERVER_URL);
// if (!process.env.IS_TEST) win.webContents.openDevTools();
// } else {
// createProtocol('app');
// // Load the index.html when not in development
// win.loadURL('app://./index.html');
// }

// // It's required for external links
// win.webContents.setWindowOpenHandler(({ url }) => {
// // Prevent default behavior
// shell.openExternal(url);
// return { action: 'deny' };
// });
// }

// // Quit when all windows are closed.
// app.on('window-all-closed', () => {
// // On macOS it is common for applications and their menu bar
// // to stay active until the user quits explicitly with Cmd + Q
// if (process.platform !== 'darwin') {
// app.quit();
// }
// });

// app.on('activate', () => {
// // On macOS it's common to re-create a window in the app when the
// // dock icon is clicked and there are no other windows open.
// if (BrowserWindow.getAllWindows().length === 0) createWindow();
// });

// // This method will be called when Electron has finished
// // initialization and is ready to create browser windows.
// // Some APIs can only be used after this event occurs.
// app.on('ready', async () => {
// if (isDevelopment && !process.env.IS_TEST) {
// // Install Vue Devtools
// try {
// await installExtension(VUEJS_DEVTOOLS);
// } catch (e) {
// console.error('Vue Devtools failed to install:', (e as Error).toString());
// }
// }
// createWindow();
// });

// // Exit cleanly on request from parent process in development mode.
// if (isDevelopment) {
// if (process.platform === 'win32') {
// process.on('message', (data) => {
// if (data === 'graceful-exit') {
// app.quit();
// }
// });
// } else {
// process.on('SIGTERM', () => {
// app.quit();
// });
// }
// }
73 changes: 73 additions & 0 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { join } from 'path';

import { electronApp, optimizer, is } from '@electron-toolkit/utils';
import { app, shell, BrowserWindow, ipcMain } from 'electron';

function createWindow(): void {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 900,
height: 670,
show: false,
autoHideMenuBar: true,
webPreferences: {
preload: join(__dirname, '../preload/index.js'),
sandbox: false,
},
});

mainWindow.on('ready-to-show', () => {
mainWindow.show();
});

mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url);
return { action: 'deny' };
});

// HMR for renderer base on electron-vite cli.
// Load the remote URL for development or the local html file for production.
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL']);
} else {
mainWindow.loadFile(join(__dirname, '../../index.html'));
}
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(() => {
// Set app user model id for windows
electronApp.setAppUserModelId('com.electron');

// Default open or close DevTools by F12 in development
// and ignore CommandOrControl + R in production.
// see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
app.on('browser-window-created', (_, window) => {
optimizer.watchWindowShortcuts(window);
});

// IPC test
ipcMain.on('ping', () => console.log('pong'));

createWindow();

app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});

// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
8 changes: 8 additions & 0 deletions electron/preload/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { ElectronAPI } from '@electron-toolkit/preload';

declare global {
interface Window {
electron: ElectronAPI;
api: unknown;
}
}
22 changes: 22 additions & 0 deletions electron/preload/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { electronAPI } from '@electron-toolkit/preload';
import { contextBridge } from 'electron';

// Custom APIs for renderer
const api = {};

// Use `contextBridge` APIs to expose Electron APIs to
// renderer only if context isolation is enabled, otherwise
// just add to the DOM global.
if (process.contextIsolated) {
try {
contextBridge.exposeInMainWorld('electron', electronAPI);
contextBridge.exposeInMainWorld('api', api);
} catch (error) {
console.error(error);
}
} else {
// @ts-expect-error (define in dts)
window.electron = electronAPI;
// @ts-expect-error (define in dts)
window.api = api;
}
10 changes: 7 additions & 3 deletions env.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"kensetsu": true,
"assetOwner": false,
"alt": true,
"debug": false
"debug": false,
"pointSystemV2": false
},
"SUBQUERY_ENDPOINT": "https://api.subquery.network/sq/sora-xor/sora-prod",
"SUBSQUID_ENDPOINT": "",
Expand Down Expand Up @@ -58,7 +59,10 @@
"PolkadotAstar": true,
"Liberland": true
},
"EVM_NETWORKS_IDS": [56, 8217],
"EVM_NETWORKS_IDS": [
56,
8217
],
"ETH_BRIDGE": {
"evmNetwork": 1,
"address": {
Expand All @@ -67,4 +71,4 @@
"OTHER": "0x313416870A4da6F12505a550B67bB73c8E21D5d3"
}
}
}
}
Loading

0 comments on commit 03845e2

Please sign in to comment.