Skip to content

Commit

Permalink
chore: Update file paths for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Jul 17, 2024
1 parent 3d65d65 commit ba09213
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 92 deletions.
62 changes: 0 additions & 62 deletions .eslintrc.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os from 'os';
import path from 'path';

import { isProd } from './env.js';
import { isProd } from './env.mjs';

// Paths
const dotOperateDirectory = isProd
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion electron/install.js → electron/install.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import os from 'os';
import process from 'process';
import sudo from 'sudo-prompt';

import { paths } from './constants/paths.js';
import { paths } from './constants/paths.mjs';

/**
* current version of the pearl release
Expand Down
27 changes: 13 additions & 14 deletions electron/main.js → electron/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ import next from 'next';
import os from 'os';
import path from 'path';

import { APP_HEIGHT, APP_WIDTH } from './constants/appSizes.js';
import { isDev } from './constants/env.js';
import { isMac, isWindows } from './constants/os.js';
import { paths } from './constants/paths.js';
import { PORT_RANGE } from './constants/ports.js';
import { Env } from './install.js';
import { setupStoreIpc } from './store.js';
import { macUpdater } from './update.js';
import { TRAY_ICONS, TRAY_ICONS_PATHS } from './utils/icons.js';
import { logger } from './utils/logger.js';
import { findAvailablePort, isPortAvailable } from './utils/ports.js';
import { killProcesses } from './utils/processes.js';
import { APP_HEIGHT, APP_WIDTH } from './constants/appSizes.mjs';
import { isDev } from './constants/env.mjs';
import { isMac, isWindows } from './constants/os.mjs';
import { paths } from './constants/paths.mjs';
import { PORT_RANGE } from './constants/ports.mjs';
import { Env } from './install.mjs';
import { setupStoreIpc } from './store.mjs';
import { macUpdater } from './update.mjs';
import { TRAY_ICONS, TRAY_ICONS_PATHS } from './utils/icons.mjs';
import { logger } from './utils/logger.mjs';
import { findAvailablePort, isPortAvailable } from './utils/ports.mjs';
import { killProcesses } from './utils/processes.mjs';

// Attempt to acquire the single instance lock
const singleInstanceLock = app.requestSingleInstanceLock();
Expand Down Expand Up @@ -202,8 +202,7 @@ const createMainWindow = async () => {
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
enableRemoteModule: true,
preload: path.join(import.meta.dirname, 'preload.mjs'),
preload: path.join(import.meta.dirname, 'preload.js'),
},
});

Expand Down
2 changes: 1 addition & 1 deletion electron/preload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is loaded in the renderer process before other scripts
import { contextBridge, ipcRenderer } from 'electron/renderer';
const { contextBridge, ipcRenderer } = require('electron/renderer');

contextBridge.exposeInMainWorld('electronAPI', {
// App controls
Expand Down
2 changes: 1 addition & 1 deletion electron/store.js → electron/store.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger } from './utils/logger.js';
import { logger } from './utils/logger.mjs';

const defaultSchema = {
version: { type: 'string', default: '' },
Expand Down
4 changes: 2 additions & 2 deletions electron/update.js → electron/update.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @ts-check
import { MacUpdater } from 'electron-updater';

import { isDev } from './constants/env.js';
import { logger } from './utils/logger.js';
import { isDev } from './constants/env.mjs';
import { logger } from './utils/logger.mjs';

const macUpdater = new MacUpdater();

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion electron/utils/logger.js → electron/utils/logger.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { format } from 'logform';
import winston from 'winston';

import { paths } from '../constants/paths.js';
import { paths } from '../constants/paths.mjs';

const { combine, timestamp, printf } = format;

Expand Down
2 changes: 1 addition & 1 deletion electron/utils/ports.js → electron/utils/ports.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import net from 'net';

import { ERROR_ADDRESS_IN_USE } from '../constants/errors.js';
import { ERROR_ADDRESS_IN_USE } from '../constants/errors.mjs';

export function findAvailablePort({ startPort, endPort, excludePorts = [] }) {
return new Promise((resolve, reject) => {
Expand Down
4 changes: 2 additions & 2 deletions electron/utils/processes.js → electron/utils/processes.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { exec } from 'child_process';
import psTree from 'ps-tree';

import { isWindows } from '../constants/os.js';
import { logger } from './logger.js';
import { isWindows } from '../constants/os.mjs';
import { logger } from './logger.mjs';

const unixKillCommand = 'kill -9';
const windowsKillCommand = 'taskkill /F /PID';
Expand Down
6 changes: 6 additions & 0 deletions frontend/constants/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ export const provider = new ethers.providers.StaticJsonRpcProvider(
);

export const multicallProvider = new Provider(provider, 100);

try {
multicallProvider.init();
} catch (e) {
console.error('Error initializing multicall provider', e);
}
4 changes: 1 addition & 3 deletions frontend/next.config.mjs → frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
module.exports = {
images: {
remotePatterns: [
{
Expand Down Expand Up @@ -38,5 +38,3 @@ const nextConfig = {
: process.env.DEV_RPC,
},
};

export default nextConfig;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"prettier": "^3.2.5",
"typescript": "~5.4"
},
"main": "electron/main.js",
"main": "electron/main.mjs",
"name": "olas-operate-app",
"productName": "Pearl",
"scripts": {
Expand All @@ -68,4 +68,4 @@
"test:frontend": "cd frontend && yarn test"
},
"version": "0.1.0-rc72"
}
}
23 changes: 22 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
resize-observer-polyfill "^1.5.1"
throttle-debounce "^5.0.0"

"@babel/eslint-parser@^7.24.8":
version "7.24.8"
resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.24.8.tgz#bc655255fa4ded3694cc10ef3dbea6d69639c831"
integrity sha512-nYAikI4XTGokU2QX7Jx+v4rxZKhKivaQaREZjuW3mrJrbdWJ5yUfohnoUULge+zEEaKjPYNxhoRgUKktjXtbwA==
dependencies:
"@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1"
eslint-visitor-keys "^2.1.0"
semver "^6.3.1"

"@babel/runtime@^7.10.1", "@babel/runtime@^7.10.4", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.7", "@babel/runtime@^7.18.0", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.0", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.5", "@babel/runtime@^7.23.2", "@babel/runtime@^7.23.6", "@babel/runtime@^7.23.9", "@babel/runtime@^7.24.4", "@babel/runtime@^7.24.7":
version "7.24.7"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.7.tgz#f4f0d5530e8dbdf59b3451b9b3e594b6ba082e12"
Expand Down Expand Up @@ -666,6 +675,13 @@
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.5.tgz#ed199a920efb510cfe941cd75ed38a7be21e756f"
integrity sha512-tEQ7oinq1/CjSG9uSTerca3v4AZ+dFa+4Yu6ihaG8Ud8ddqLQgFGcnwYls13H5X5CPDPZJdYxyeMui6muOLd4g==

"@nicolo-ribaudo/[email protected]":
version "5.1.1-v1"
resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129"
integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==
dependencies:
eslint-scope "5.1.1"

"@nodelib/[email protected]":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
Expand Down Expand Up @@ -2561,7 +2577,7 @@ eslint-rule-composer@^0.3.0:
resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9"
integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==

eslint-scope@^5.1.1:
eslint-scope@5.1.1, eslint-scope@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
Expand All @@ -2577,6 +2593,11 @@ eslint-scope@^7.2.2:
esrecurse "^4.3.0"
estraverse "^5.2.0"

eslint-visitor-keys@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==

eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3:
version "3.4.3"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
Expand Down

0 comments on commit ba09213

Please sign in to comment.