Skip to content
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

Updates round two #390

Merged
merged 22 commits into from
Jan 18, 2024
Merged
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
4 changes: 4 additions & 0 deletions .erb/configs/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export default {
},
},
},
{
test: /\.node$/,
loader: "node-loader",
},
],
},

Expand Down
11 changes: 10 additions & 1 deletion .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ module.exports = {
// cause sometimes concat is more readable
'prefer-template': 'off',
'react-hooks/exhaustive-deps': 'off',
'@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }],
'no-explicit-any': 'off',
'import/no-unresolved': 'off',
'import/extensions': 'off',
'react/function-component-definition': 'off',
'react/jsx-filename-extension': 'off',
'react/no-unstable-nested-components': 'off',
'class-methods-use-this': 'off',
'react/jsx-no-useless-fragment': 'off',
'no-unsafe-optional-chaining': 'off',
'no-promise-executor-return': 'off',
},
parserOptions: {
ecmaVersion: 2020,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install Node, NPM and Yarn
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: 16.13.0
node-version: 20.6.1

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: 16.13.0
node-version: 20.6.1

- name: yarn install
run: |
Expand Down
1 change: 0 additions & 1 deletion assets/assets.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
declare module '*.svg' {
const content: any;
export default content;
Expand Down
186 changes: 94 additions & 92 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,135 +159,137 @@
]
},
"devDependencies": {
"@babel/core": "^7.14.8",
"@babel/core": "^7.23.7",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-decorators": "^7.14.5",
"@babel/plugin-proposal-do-expressions": "^7.14.5",
"@babel/plugin-proposal-export-default-from": "^7.14.5",
"@babel/plugin-proposal-export-namespace-from": "^7.14.5",
"@babel/plugin-proposal-function-bind": "^7.14.5",
"@babel/plugin-proposal-function-sent": "^7.14.5",
"@babel/plugin-proposal-decorators": "^7.23.7",
"@babel/plugin-proposal-do-expressions": "^7.23.3",
"@babel/plugin-proposal-export-default-from": "^7.23.3",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-proposal-function-bind": "^7.23.3",
"@babel/plugin-proposal-function-sent": "^7.23.3",
"@babel/plugin-proposal-json-strings": "^7.14.5",
"@babel/plugin-proposal-logical-assignment-operators": "^7.14.5",
"@babel/plugin-proposal-logical-assignment-operators": "^7.20.7",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
"@babel/plugin-proposal-pipeline-operator": "^7.14.8",
"@babel/plugin-proposal-throw-expressions": "^7.14.5",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/plugin-proposal-pipeline-operator": "^7.23.3",
"@babel/plugin-proposal-throw-expressions": "^7.23.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-react-constant-elements": "^7.14.5",
"@babel/plugin-transform-react-inline-elements": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.14.8",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@babel/register": "^7.14.5",
"@babel/plugin-transform-react-constant-elements": "^7.23.3",
"@babel/plugin-transform-react-inline-elements": "^7.23.3",
"@babel/plugin-transform-runtime": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/register": "^7.23.7",
"@electron/notarize": "^2.2.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@types/enzyme": "^3.10.9",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/history": "4.7.8",
"@types/jest": "^26.0.24",
"@types/node": "15.0.2",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/react-router": "5.1.18",
"@types/react-test-renderer": "^18.0.0",
"@types/webpack-env": "^1.16.2",
"@typescript-eslint/eslint-plugin": "^4.29.1",
"@typescript-eslint/parser": "^4.29.1",
"axios": "^0.21.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@testing-library/jest-dom": "^6.2.0",
"@testing-library/react": "^14.1.2",
"@types/enzyme": "^3.10.18",
"@types/enzyme-adapter-react-16": "^1.0.9",
"@types/history": "5.0.0",
"@types/jest": "^29.5.11",
"@types/node": "20.11.5",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"@types/react-router": "5.1.20",
"@types/react-test-renderer": "^18.0.7",
"@types/webpack-env": "^1.18.4",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"axios": "^1.6.5",
"babel-eslint": "^10.1.0",
"babel-jest": "^27.0.6",
"babel-loader": "^8.2.2",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.3",
"babel-plugin-dev-expression": "^0.2.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"browserslist-config-erb": "^0.0.1",
"browserslist-config-erb": "^0.0.3",
"chalk": "^4.1.2",
"concurrently": "^6.2.1",
"core-js": "^3.16.1",
"concurrently": "^8.2.2",
"core-js": "^3.35.0",
"cross-env": "^7.0.3",
"css-loader": "^6.2.0",
"detect-port": "^1.3.0",
"css-loader": "^6.9.0",
"detect-port": "^1.5.1",
"electron": "18.3.0",
"electron-builder": "^23.6.0",
"electron-rebuild": "^2.3.2",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-erb": "^3.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-webpack": "^0.13.1",
"eslint-plugin-compat": "^3.12.0",
"eslint-plugin-import": "^2.24.0",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.24.0",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-erb": "^4.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-webpack": "^0.13.8",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.2.0",
"file-loader": "^6.2.0",
"gunzip-stream": "^1.0.1",
"husky": "^7.0.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.0.6",
"lint-staged": "^11.1.2",
"mini-css-extract-plugin": "^2.2.0",
"jest": "^29.7.0",
"lint-staged": "^15.2.0",
"mini-css-extract-plugin": "^2.7.7",
"node-loader": "^2.0.0",
"optimize-css-assets-webpack-plugin": "^6.0.1",
"prettier": "^2.3.2",
"prettier": "^3.2.4",
"react-refresh": "^0.14.0",
"react-test-renderer": "^17.0.2",
"react-test-renderer": "^18.2.0",
"rimraf": "^3.0.2",
"sass-loader": "^12.1.0",
"style-loader": "^3.2.1",
"tar-stream": "^2.2.0",
"terser-webpack-plugin": "^5.1.4",
"ts-node": "^10.2.1",
"typescript": "^4.3.5",
"sass-loader": "^14.0.0",
"style-loader": "^3.3.4",
"tar-stream": "^3.1.6",
"terser-webpack-plugin": "^5.3.10",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"unzip-stream": "^0.3.1",
"url-loader": "^4.1.1",
"webpack": "^5.75.0",
"webpack-bundle-analyzer": "^4.4.2",
"webpack": "^5.89.0",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^4.9.3",
"webpack-merge": "^5.8.0",
"yarn-deduplicate": "^3.1.0"
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0",
"yarn-deduplicate": "^6.0.2"
},
"dependencies": {
"@babel/plugin-proposal-numeric-separator": "^7.14.5",
"@babel/plugin-proposal-private-methods": "^7.14.5",
"@babel/plugin-proposal-private-property-in-object": "^7.14.5",
"@emotion/react": "^11.8.1",
"@emotion/styled": "^11.8.1",
"@fontsource/dm-sans": "^4.5.6",
"@grpc/grpc-js": "^1.4.2",
"@mui/lab": "^5.0.0-alpha.71",
"@mui/material": "^5.5.0",
"@mui/styles": "^5.4.4",
"@sentry/electron": "^4.1.2",
"electron-context-menu": "^3.1.1",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@fontsource/dm-sans": "^5.0.18",
"@grpc/grpc-js": "^1.9.14",
"@mui/lab": "^5.0.0-alpha.161",
"@mui/material": "^5.15.5",
"@mui/styles": "^5.15.5",
"@sentry/electron": "^4.17.0",
"electron-context-menu": "^3.6.1",
"electron-debug": "^3.1.0",
"electron-is-packaged": "^1.0.2",
"electron-log": "^4.4.1",
"electron-store": "^8.0.0",
"electron-updater": "^4.3.9",
"electron-log": "^5.0.3",
"electron-store": "^8.1.0",
"electron-updater": "^6.1.7",
"history": "^5.0.0",
"json-schema": "^0.4.0",
"menubar": "^9.0.5",
"moment": "^2.29.2",
"notistack": "^2.0.3",
"nth-check": "2.0.1",
"menubar": "^9.4.0",
"moment": "^2.30.1",
"notistack": "^3.0.1",
"nth-check": "2.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-feather": "^2.0.9",
"react-router": "6.3.0",
"react-router-dom": "6.3.0",
"regenerator-runtime": "^0.13.9",
"react-router": "6.21.2",
"react-router-dom": "6.21.2",
"regenerator-runtime": "^0.14.1",
"source-map-support": "^0.5.19",
"ts-proto": "^1.85.0",
"validator": "^13.7.0"
"ts-proto": "^1.166.2",
"typescript-eslint": "^0.0.1-alpha.0",
"validator": "^13.11.0"
},
"devEngines": {
"node": ">=16.13",
Expand Down
4 changes: 2 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ export async function start(sentryDSN: string): Promise<CLI> {

const configClient = new ConfigClient(
grpcAddress,
ChannelCredentials.createInsecure()
ChannelCredentials.createInsecure(),
);
const listenerClient = new ListenerClient(
grpcAddress,
ChannelCredentials.createInsecure()
ChannelCredentials.createInsecure(),
);

return { process, configClient, listenerClient };
Expand Down
22 changes: 13 additions & 9 deletions src/main.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
* When running `yarn build` or `yarn build-main`, this file is compiled to
* `./src/main.prod.js` using webpack. This gives us some performance wins.
*/
import 'core-js/stable';
import { app, BrowserWindow, dialog, ipcMain } from 'electron';
import {
app,
BrowserWindow,
dialog,
ipcMain,
MessageBoxOptions,
} from 'electron';
import * as grpc from '@grpc/grpc-js';
import * as Sentry from '@sentry/electron';
import log from 'electron-log';
Expand All @@ -20,7 +25,6 @@ import path from 'path';
import fs from 'fs';
import contextMenu from 'electron-context-menu';
import createWindow from './renderer/window';
import 'regenerator-runtime/runtime';
import {
isDev,
isProd,
Expand Down Expand Up @@ -101,7 +105,7 @@ const onUncaughtException = (() => {
message:
'If you would like to file a bug report please include the following Sentry Id: ' +
sentryId,
} as Electron.MessageBoxOptions;
} as MessageBoxOptions;

if ('spawnargs' in err) {
msg.title = 'Incorrect CLI supplied.';
Expand All @@ -117,7 +121,7 @@ const onUncaughtException = (() => {
process.on('uncaughtException', onUncaughtException);

app.on('activate', async () => {
// On macOS it's common to re-create a window in the app when the
// 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 (mainWindow === null) mainWindow = createWindow();
});
Expand All @@ -141,7 +145,7 @@ async function init(): Promise<void> {
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true,
})
}),
);

const trayMenuHelper = new Helper([], {}, [], mainWindow, null);
Expand Down Expand Up @@ -204,7 +208,7 @@ async function init(): Promise<void> {
trayMenuHelper.setRecords(res.records);
menu.tray.setContextMenu(trayMenuHelper.createContextMenu());
}
}
},
);
});
ipcMain.on(GET_UNIQUE_TAGS, (evt) => {
Expand Down Expand Up @@ -264,7 +268,7 @@ async function init(): Promise<void> {
data: res?.data || [],
filename: args.filename,
});
}
},
);
});
ipcMain.on(IMPORT, (evt) => {
Expand All @@ -279,7 +283,7 @@ async function init(): Promise<void> {
} as ImportRequest,
(err, res) => {
evt?.sender?.send(IMPORT, { err, res });
}
},
);
}
return null;
Expand Down
Loading