mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 21:58:39 -09:00
use import instead of require
This commit is contained in:
parent
cee275f61b
commit
2a4771fad5
3 changed files with 3 additions and 9 deletions
|
|
@ -17,7 +17,7 @@ remoteInitialize();
|
||||||
import {resolve} from 'path';
|
import {resolve} from 'path';
|
||||||
|
|
||||||
// Packages
|
// Packages
|
||||||
import {app, BrowserWindow, Menu} from 'electron';
|
import {app, BrowserWindow, Menu, screen} from 'electron';
|
||||||
import {gitDescribe} from 'git-describe';
|
import {gitDescribe} from 'git-describe';
|
||||||
import isDev from 'electron-is-dev';
|
import isDev from 'electron-is-dev';
|
||||||
import * as config from './config';
|
import * as config from './config';
|
||||||
|
|
@ -98,8 +98,6 @@ app.on('ready', () =>
|
||||||
let [startX, startY] = winSet.position;
|
let [startX, startY] = winSet.position;
|
||||||
|
|
||||||
const [width, height] = options.size ? options.size : cfg.windowSize || winSet.size;
|
const [width, height] = options.size ? options.size : cfg.windowSize || winSet.size;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const {screen} = require('electron');
|
|
||||||
|
|
||||||
const winPos = options.position;
|
const winPos = options.position;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import {IPty, IWindowsPtyForkOptions, spawn as npSpawn} from 'node-pty';
|
||||||
import {cliScriptPath} from './config/paths';
|
import {cliScriptPath} from './config/paths';
|
||||||
import {dirname} from 'path';
|
import {dirname} from 'path';
|
||||||
import shellEnv from 'shell-env';
|
import shellEnv from 'shell-env';
|
||||||
|
import osLocale from 'os-locale';
|
||||||
|
|
||||||
const createNodePtyError = () =>
|
const createNodePtyError = () =>
|
||||||
new Error(
|
new Error(
|
||||||
|
|
@ -106,8 +107,6 @@ export default class Session extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
init({uid, rows, cols: columns, cwd, shell: _shell, shellArgs: _shellArgs}: SessionOptions) {
|
init({uid, rows, cols: columns, cwd, shell: _shell, shellArgs: _shellArgs}: SessionOptions) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const osLocale = require('os-locale') as typeof import('os-locale');
|
|
||||||
const cleanEnv =
|
const cleanEnv =
|
||||||
process.env['APPIMAGE'] && process.env['APPDIR'] ? shellEnv.sync(_shell || defaultShell) : process.env;
|
process.env['APPIMAGE'] && process.env['APPDIR'] ? shellEnv.sync(_shell || defaultShell) : process.env;
|
||||||
const baseEnv = Object.assign(
|
const baseEnv = Object.assign(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
import Copy from 'copy-webpack-plugin';
|
||||||
const Copy = require('copy-webpack-plugin');
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import TerserPlugin from 'terser-webpack-plugin';
|
import TerserPlugin from 'terser-webpack-plugin';
|
||||||
import webpack from 'webpack';
|
import webpack from 'webpack';
|
||||||
|
|
@ -29,7 +28,6 @@ const config: webpack.Configuration[] = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
||||||
new Copy({
|
new Copy({
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
|
|
@ -99,7 +97,6 @@ const config: webpack.Configuration[] = [
|
||||||
NODE_ENV: JSON.stringify(nodeEnv)
|
NODE_ENV: JSON.stringify(nodeEnv)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
||||||
new Copy({
|
new Copy({
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue