Skip to content

chore(deps): update dependency electron-is-dev to v3 #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 10 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"author": "Matthew Scharley <[email protected]>",
"private": true,
"version": "0.8.0",
"type": "module",
"funding": {
"type": "individual",
"url": "https://github.com/sponsors/mscharley"
Expand Down Expand Up @@ -33,7 +34,7 @@
"start:vite": "node ./bin/vite-dev-server.mjs",
"clean": "rimraf -rf ts-build coverage dist",
"build": "node ./bin/build.mjs",
"build:esbuild": "esbuild ./src/main/index.ts ./src/main/preload.ts --color=true --bundle --minify --sourcemap=external --outdir=ts-build/main --platform=node --external:electron --external:electron-is-dev --external:electron-devtools-installer",
"build:esbuild": "esbuild ./src/main/index.ts ./src/main/preload.ts --color=true --bundle --minify --sourcemap=external --outdir=ts-build/main --platform=esm --external:electron --external:electron-is-dev --external:electron-devtools-installer",
"build:vite": "vite build",
"test": "npm run test:lint && npm run test:jest && npm run test:build",
"test:electronegativity": "electronegativity -i ./src -e $(electron --version)",
Expand Down Expand Up @@ -99,7 +100,7 @@
"electron": "29.3.0",
"electron-builder": "24.13.3",
"electron-devtools-installer": "3.2.0",
"electron-is-dev": "2.0.0",
"electron-is-dev": "3.0.1",
"esbuild": "0.20.2",
"generic-type-guard": "4.0.3",
"husky": "9.0.11",
Expand Down
22 changes: 11 additions & 11 deletions src/main/ApplicationModule.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { CustomProtocol, ReadyHandler } from '~main/dot/tokens';
import { AboutElectron } from '~main/services/AboutElectron';
import { Configuration } from '~main/services/Configuration';
import { DevTools } from '~main/services/DevTools';
import { Entrypoint } from '~main/Entrypoint';
import { FileSystem } from '~main/services/FileSystem';
import { CustomProtocol, ReadyHandler } from '~main/dot/tokens.js';
import { AboutElectron } from '~main/services/AboutElectron.js';
import { Configuration } from '~main/services/Configuration.js';
import { DevTools } from '~main/services/DevTools.js';
import { Entrypoint } from '~main/Entrypoint.js';
import { FileSystem } from '~main/services/FileSystem.js';
import type { interfaces } from '@mscharley/dot';
import { LinuxIntegration } from './services/LinuxIntegration';
import { LinuxIntegration } from './services/LinuxIntegration.js';
import log from 'electron-log';
import { MainWindow } from '~main/MainWindow';
import { RendererLogging } from '~main/services/RendererLogging';
import { SecurityProvider } from '~main/services/SecurityProvider';
import { UpdatesProvider } from '~main/services/UpdatesProvider';
import { MainWindow } from '~main/MainWindow.js';
import { RendererLogging } from '~main/services/RendererLogging.js';
import { SecurityProvider } from '~main/services/SecurityProvider.js';
import { UpdatesProvider } from '~main/services/UpdatesProvider.js';

export const ApplicationModule = (): interfaces.SyncContainerModule => (bind) => {
log.debug('Binding application modules.');
Expand Down
4 changes: 2 additions & 2 deletions src/main/Entrypoint.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eng-disable REMOTE_MODULE_JS_CHECK */

import { CustomProtocol, ElectronApp, ReadyHandler } from '~main/dot/tokens';
import { CustomProtocol, ElectronApp, ReadyHandler } from '~main/dot/tokens.js';
import { injectable, withOptions } from '@mscharley/dot';
import log from 'electron-log';
import { MainWindow } from '~main/MainWindow';
import { MainWindow } from '~main/MainWindow.js';
import { protocol } from 'electron/main';

@injectable(
Expand Down
8 changes: 4 additions & 4 deletions src/main/MainWindow.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { BrowserWindow, Menu } from 'electron/main';
import { ElectronDialog, ElectronIpcMain } from '~main/dot/tokens';
import { ElectronDialog, ElectronIpcMain } from '~main/dot/tokens.js';
import { injectable, unmanaged } from '@mscharley/dot';
import { DEFAULT_VITE_PORT } from '~shared/defaults';
import { DevTools } from '~main/services/DevTools';
import { DEFAULT_VITE_PORT } from '~shared/defaults.js';
import { DevTools } from '~main/services/DevTools.js';
import log from 'electron-log';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler.js';
import path from 'path';
import { shell } from 'electron/common';

Expand Down
2 changes: 1 addition & 1 deletion src/main/dot/ElectronModule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dialog, ipcMain } from 'electron/main';
import { ElectronApp, ElectronDialog, ElectronIpcMain } from '~main/dot/tokens';
import { ElectronApp, ElectronDialog, ElectronIpcMain } from '~main/dot/tokens.js';
import type { interfaces } from '@mscharley/dot';

export const ElectronModule
Expand Down
4 changes: 2 additions & 2 deletions src/main/dot/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApplicationModule } from '~main/ApplicationModule';
import { ApplicationModule } from '~main/ApplicationModule.js';
import { createContainer } from '@mscharley/dot';
import { ElectronModule } from '~main/dot/ElectronModule';
import { ElectronModule } from '~main/dot/ElectronModule.js';
import type { interfaces } from '@mscharley/dot';

export const getContainer = (app: Electron.App): interfaces.Container => {
Expand Down
4 changes: 2 additions & 2 deletions src/main/dot/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import type { Dialog, IpcMain } from 'electron/main';
import { Token, type TokenType } from '@mscharley/dot';
import type { CustomProtocolProvider } from '~main/interfaces/CustomProtocolProvider';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler';
import type { CustomProtocolProvider } from '~main/interfaces/CustomProtocolProvider.js';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler.js';

export const ElectronApp = new Token<Electron.App>('electron.app');
export type ElectronApp = TokenType<typeof ElectronApp>;
Expand Down
4 changes: 2 additions & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import 'source-map-support';
import 'reflect-metadata';
import { app } from 'electron/main';
import { Entrypoint } from '~main/Entrypoint';
import { getContainer } from '~main/dot';
import { Entrypoint } from '~main/Entrypoint.js';
import { getContainer } from '~main/dot/index.js';
import log from 'electron-log';

if (process.argv.includes('--self-test')) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/services/AboutElectron.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ElectronApp, ElectronIpcMain } from '~main/dot/tokens';
import { ElectronApp, ElectronIpcMain } from '~main/dot/tokens.js';
import { injectable, unmanaged } from '@mscharley/dot';
import type { AboutDetails } from '~shared/model/AboutDetails';
import { DevTools } from '~main/services/DevTools';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler';
import type { AboutDetails } from '~shared/model/AboutDetails.js';
import { DevTools } from '~main/services/DevTools.js';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler.js';

@injectable(ElectronApp, ElectronIpcMain, DevTools, unmanaged(globalThis.process))
export class AboutElectron implements OnReadyHandler {
Expand Down
10 changes: 5 additions & 5 deletions src/main/services/Configuration.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ElectronApp, ElectronIpcMain } from '~main/dot/tokens';
import type { AppConfiguration } from '~shared/model';
import { ElectronApp, ElectronIpcMain } from '~main/dot/tokens.js';
import type { AppConfiguration } from '~shared/model/index.js';
import EventEmitter from 'events';
import { v4 as generateUuid } from 'uuid';
import { injectable } from '@mscharley/dot';
import { LinuxIntegration } from './LinuxIntegration';
import { MainWindow } from '~main/MainWindow';
import type { ReadyHandler } from '~main/dot/tokens';
import { LinuxIntegration } from './LinuxIntegration.js';
import { MainWindow } from '~main/MainWindow.js';
import type { ReadyHandler } from '~main/dot/tokens.js';
import type { Schema } from 'electron-store';
import Store from 'electron-store';

Expand Down
4 changes: 2 additions & 2 deletions src/main/services/DevTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import log from 'electron-log';

let isDevTmp = false;
try {
const electronDev = require('electron-is-dev') as typeof import('electron-is-dev');
isDevTmp = electronDev;
const electronDev = await import('electron-is-dev') as typeof import('electron-is-dev');
isDevTmp = electronDev.default;
} catch (e: unknown) {
/* do nothing, default is already set */
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/services/FileSystem.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/* eng-disable PROTOCOL_HANDLER_JS_CHECK */

import * as http from '~shared/http';
import type { CategoryDescription, FileDescription, FolderConfiguration, FolderDescription } from '~shared/model';
import { ElectronApp, ElectronIpcMain } from '~main/dot/tokens';
import * as http from '~shared/http.js';
import type { CategoryDescription, FileDescription, FolderConfiguration, FolderDescription } from '~shared/model/index.js';
import { ElectronApp, ElectronIpcMain } from '~main/dot/tokens.js';
import { mkdirp, readdir, rename, rmdir, stat, unlink, writeFile } from 'fs-extra';
import type { Protocol, ProtocolResponse } from 'electron/main';
import { Configuration } from '~main/services/Configuration';
import type { CustomProtocolProvider } from '~main/interfaces/CustomProtocolProvider';
import { Configuration } from '~main/services/Configuration.js';
import type { CustomProtocolProvider } from '~main/interfaces/CustomProtocolProvider.js';
import { injectable } from '@mscharley/dot';
import log from 'electron-log';
import { MainWindow } from '~main/MainWindow';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler';
import { MainWindow } from '~main/MainWindow.js';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler.js';
import path from 'path';

const matchMarkdownSuffix = /\.(?:md|markdown)/u;
Expand Down
6 changes: 3 additions & 3 deletions src/main/services/LinuxIntegration.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { copyFile, rename, unlink, writeFile } from 'fs/promises';
import { ElectronApp, ElectronIpcMain } from '~main/dot/tokens';
import { ElectronApp, ElectronIpcMain } from '~main/dot/tokens.js';
import { injectable } from '@mscharley/dot';
import type { LinuxInstallOptions } from '~shared/model/LinuxInstallOptions';
import type { LinuxInstallOptions } from '~shared/model/LinuxInstallOptions.js';
import log from 'electron-log';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler.js';
import { resolve } from 'path';

@injectable(ElectronApp, ElectronIpcMain)
Expand Down
2 changes: 1 addition & 1 deletion src/main/services/RendererLogging.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { injectable } from '@mscharley/dot';
import { ipcMain } from 'electron';
import log from 'electron-log';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler.js';

@injectable()
export class RendererLogging implements OnReadyHandler {
Expand Down
6 changes: 3 additions & 3 deletions src/main/services/SecurityProvider.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eng-disable CSP_GLOBAL_CHECK */

import { ipcMain, session } from 'electron/main';
import { DEFAULT_VITE_PORT } from '~shared/defaults';
import { DevTools } from '~main/services/DevTools';
import { DEFAULT_VITE_PORT } from '~shared/defaults.js';
import { DevTools } from '~main/services/DevTools.js';
import { injectable } from '@mscharley/dot';
import log from 'electron-log';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler.js';
import { v4 as uuid } from 'uuid';

@injectable(DevTools)
Expand Down
10 changes: 5 additions & 5 deletions src/main/services/UpdatesProvider.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { AppUpdater, UpdateCheckResult } from 'electron-updater';
import { injectable, unmanaged } from '@mscharley/dot';
import { autoUpdater } from 'electron-updater';
import { DevTools } from '~main/services/DevTools';
import { ElectronIpcMain } from '~main/dot/tokens';
import { DevTools } from '~main/services/DevTools.js';
import { ElectronIpcMain } from '~main/dot/tokens.js';
import log from 'electron-log';
import { MainWindow } from '~main/MainWindow';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler';
import type { UpdateStatus } from '~shared/model';
import { MainWindow } from '~main/MainWindow.js';
import type { OnReadyHandler } from '~main/interfaces/OnReadyHandler.js';
import type { UpdateStatus } from '~shared/model/index.js';

// eslint-disable-next-line @typescript-eslint/no-magic-numbers
export const ONE_WEEK_IN_MILLISECONDS = 7 * 24 * 60 * 60 * 1000;
Expand Down
8 changes: 4 additions & 4 deletions src/main/services/__tests__/FileSystem.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as td from 'testdouble';
import type { Configuration } from '~main/services/Configuration';
import { FileSystem } from '~main/services/FileSystem';
import type { MainWindow } from '~main/MainWindow';
import type { Mutable } from '~shared/util';
import type { Configuration } from '~main/services/Configuration.js';
import { FileSystem } from '~main/services/FileSystem.js';
import type { MainWindow } from '~main/MainWindow.js';
import type { Mutable } from '~shared/util/index.js';

describe('fileSystem', () => {
const app: Electron.App = td.object('app');
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/Application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import './index.scss';

import { StrictMode, useEffect, useState } from 'react';
import createCache from '@emotion/cache';
import { DialogOverlays } from './components/DialogOverlays';
import { DialogOverlays } from './components/DialogOverlays.js';
import type { EmotionCache } from '@emotion/cache';
import { generateStore } from '~renderer/redux';
import { LayoutRouter } from './layouts/LayoutRouter';
import { NotificationsOverlay } from './components/NotificationsOverlay';
import { ProviderWrapper } from './ProviderWrapper';
import { generateStore } from '~renderer/redux/index.js';
import { LayoutRouter } from './layouts/LayoutRouter.js';
import { NotificationsOverlay } from './components/NotificationsOverlay.js';
import { ProviderWrapper } from './ProviderWrapper.js';

const Application: React.FC = () => {
const [cache, setCache] = useState<EmotionCache | undefined>();
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/DataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
setFileListing,
setUpdateStatus,
updateAppConfiguration,
} from '~renderer/redux';
import { useAppDispatch, useAppSelector } from '~renderer/hooks';
} from '~renderer/redux/index.js';
import { useAppDispatch, useAppSelector } from '~renderer/hooks/index.js';
import { useCallback, useEffect, useState } from 'react';
import CircularProgress from '@mui/material/CircularProgress';
import type { FolderConfiguration } from '~shared/model';
import { CircularProgress } from '@mui/material';
import type { FolderConfiguration } from '~shared/model/index.js';

export const DataProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const dispatch = useAppDispatch();
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/KeyboardShortcuts.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { setActiveOverlay } from '~renderer/redux';
import { useAppDispatch } from '~renderer/hooks';
import { setActiveOverlay } from '~renderer/redux/index.js';
import { useAppDispatch } from '~renderer/hooks/index.js';
import { useEffect } from 'react';

export const KeyboardShortcuts: React.FC<{ children: React.ReactNode }> = ({ children }) => {
Expand Down
13 changes: 6 additions & 7 deletions src/renderer/ProviderWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { CircularProgress, CssBaseline } from '@mui/material';
import { CacheProvider } from '@emotion/react';
import { CircularProgress } from '@mui/material';
import CssBaseline from '@mui/material/CssBaseline';
import { DataProvider } from './DataProvider';
import { DataProvider } from './DataProvider.js';
import type { EmotionCache } from '@emotion/cache';
import { ErrorWrapper } from './components/error-handling/ErrorWrapper';
import { KeyboardShortcuts } from './KeyboardShortcuts';
import { ErrorWrapper } from './components/error-handling/ErrorWrapper.js';
import { KeyboardShortcuts } from './KeyboardShortcuts.js';
import { Provider as ReduxProvider } from 'react-redux';
import type { Store } from './redux';
import { theme } from './theme';
import type { Store } from './redux/index.js';
import { theme } from './theme.js';
import { ThemeProvider } from '@mui/material/styles';

export interface RootProps {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/__viteshot__/ScreenshotWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import './ScreenshotWrapper.css';
import './mocks';

import CssBaseline from '@mui/material/CssBaseline';
import { generateStore } from '~renderer/redux';
import { CssBaseline } from '@mui/material';
import { generateStore } from '~renderer/redux/index.js';
import { Provider as ReduxProvider } from 'react-redux';
import { theme } from '~renderer/theme';
import { theme } from '~renderer/theme.js';
import { ThemeProvider } from '@mui/material/styles';

export const ScreenshotWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
Expand Down
15 changes: 4 additions & 11 deletions src/renderer/components/AboutDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import Button from '@mui/material/Button';
import CircularProgress from '@mui/material/CircularProgress';
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import IconButton from '@mui/material/IconButton';
import { noop } from '~shared/util';
import { SpinningRefreshIcon } from './SpinningRefreshIcon';
import Typography from '@mui/material/Typography';
import { useAppSelector } from '~renderer/hooks';
import { Button, CircularProgress, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Typography } from '@mui/material';
import { noop } from '~shared/util/index.js';
import { SpinningRefreshIcon } from './SpinningRefreshIcon.js';
import { useAppSelector } from '~renderer/hooks/index.js';

export interface AboutDialogProps {
open: boolean;
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/components/DialogOverlays.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useAppDispatch, useAppSelector } from '~renderer/hooks';
import { AboutDialog } from '~renderer/components/AboutDialog';
import { closeOverlay } from '~renderer/redux';
import { ConfigurationDialog } from '~renderer/components/configuration/ConfigurationDialog';
import { DeleteConfirmationDialog } from './sidebar/DeleteConfirmationDialog';
import { useAppDispatch, useAppSelector } from '~renderer/hooks/index.js';
import { AboutDialog } from '~renderer/components/AboutDialog.js';
import { closeOverlay } from '~renderer/redux/index.js';
import { ConfigurationDialog } from '~renderer/components/configuration/ConfigurationDialog.js';
import { DeleteConfirmationDialog } from './sidebar/DeleteConfirmationDialog.js';

export const DialogOverlays: React.FC = () => {
const dispatch = useAppDispatch();
Expand Down
Loading
Loading