Skip to content

Commit

Permalink
Upgrade dependencies (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus authored Aug 8, 2019
1 parent accb695 commit 53a3373
Show file tree
Hide file tree
Showing 6 changed files with 403 additions and 460 deletions.
9 changes: 4 additions & 5 deletions main/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const MIN_VIDEO_HEIGHT = MIN_VIDEO_WIDTH * VIDEO_ASPECT;
const MIN_WINDOW_HEIGHT = MIN_VIDEO_HEIGHT + OPTIONS_BAR_HEIGHT;
const editorEmitter = new EventEmitter();

const showSaveDialog = pify(dialog.showSaveDialog, {errorFirst: false});
const getEditorName = (filePath, isNewRecording) => isNewRecording ? `New Recording ${moment().format('YYYY-MM-DD')} at ${moment().format('H.mm.ss')}` : path.basename(filePath);

const openEditorWindow = async (filePath, {recordedFps, isNewRecording, originalFilePath} = {}) => {
Expand Down Expand Up @@ -55,7 +54,7 @@ const openEditorWindow = async (filePath, {recordedFps, isNewRecording, original
if (isNewRecording) {
editorWindow.setDocumentEdited(true);
editorWindow.on('close', event => {
const buttonIndex = dialog.showMessageBox(editorWindow, {
const buttonIndex = dialog.showMessageBoxSync(editorWindow, {
type: 'question',
buttons: [
'Discard',
Expand Down Expand Up @@ -102,12 +101,12 @@ const getEditors = () => editors.values();
ipc.answerRenderer('save-original', async ({inputPath}) => {
const now = moment();

const path = await showSaveDialog(BrowserWindow.getFocusedWindow(), {
const {filePath} = await dialog.showSaveDialog(BrowserWindow.getFocusedWindow(), {
defaultPath: `Kapture ${now.format('YYYY-MM-DD')} at ${now.format('H.mm.ss')}.mp4`
});

if (path) {
await pify(fs.copyFile)(inputPath, path, fs.constants.COPYFILE_FICLONE);
if (filePath) {
await pify(fs.copyFile)(inputPath, filePath, fs.constants.COPYFILE_FICLONE);
}
});

Expand Down
8 changes: 3 additions & 5 deletions main/export-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const {dialog, BrowserWindow} = require('electron');
const fs = require('fs');
const {dirname} = require('path');
const pify = require('pify');
const {ipcMain: ipc} = require('electron-better-ipc');
const base64Img = require('base64-img');
const tmp = require('tmp');
Expand All @@ -22,7 +21,6 @@ const {toggleExportMenuItem} = require('./menus');
const Export = require('./export');

const ffmpegPath = util.fixPathForAsarUnpack(ffmpeg.path);
const showSaveDialog = pify(dialog.showSaveDialog, {errorFirst: false});
let lastSavedDirectory;

const filterMap = new Map([
Expand Down Expand Up @@ -61,7 +59,7 @@ const getDragIcon = async inputPath => {
const saveSnapshot = async ({inputPath, time}) => {
const now = moment();

const outputPath = await showSaveDialog(BrowserWindow.getFocusedWindow(), {
const {filePath: outputPath} = await dialog.showSaveDialog(BrowserWindow.getFocusedWindow(), {
defaultPath: `Snapshot ${now.format('YYYY-MM-DD')} at ${now.format('H.mm.ss')}.jpg`
});

Expand Down Expand Up @@ -136,7 +134,7 @@ class ExportList {

const filters = filterMap.get(options.format);

const filePath = await showSaveDialog(exportsWindow, {
const {filePath} = await dialog.showSaveDialog(exportsWindow, {
title: newExport.defaultFileName,
defaultPath: `${lastSavedDirectory || kapturesDir}/${newExport.defaultFileName}`,
filters
Expand All @@ -155,7 +153,7 @@ class ExportList {
}

if (!newExport.plugin.isConfigValid()) {
const result = dialog.showMessageBox({
const result = dialog.showMessageBoxSync({
type: 'error',
buttons: ['Configure', 'Cancel'],
defaultId: 0,
Expand Down
2 changes: 1 addition & 1 deletion main/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const openFileItem = {
click: () => {
closeAllCroppers();

dialog.showOpenDialog({
dialog.showOpenDialogSync({
filters: [{name: 'Videos', extensions: supportedVideoExtensions}],
properties: ['openFile']
}, filePaths => {
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,45 @@
"test": "xo",
"start": "yarn && electron .",
"build": "next build renderer && next export renderer",
"dist": "npm run build && build",
"pack": "npm run build && build --dir",
"dist": "npm run build && electron-builder",
"pack": "npm run build && electron-builder --dir",
"postinstall": "electron-builder install-app-deps"
},
"bundle": {
"name": "Kap"
},
"dependencies": {
"@ffmpeg-installer/ffmpeg": "^1.0.19",
"@sentry/browser": "^5.5.0",
"@sentry/electron": "^0.17.1",
"@sentry/browser": "^5.6.0",
"@sentry/electron": "^0.17.3",
"@sindresorhus/do-not-disturb": "^1.1.0",
"@sindresorhus/to-milliseconds": "^1.2.0",
"ajv": "^6.10.1",
"ajv": "^6.10.2",
"aperture": "^5.2.0",
"base64-img": "^1.0.4",
"classnames": "^2.2.6",
"delay": "^4.3.0",
"electron-better-ipc": "^0.3.0",
"electron-log": "^3.0.6",
"electron-log": "^3.0.7",
"electron-next": "^3.1.5",
"electron-store": "^4.0.0",
"electron-updater": "^4.0.14",
"electron-updater": "^4.1.2",
"electron-util": "^0.12.1",
"execa": "^2.0.3",
"file-icon": "^3.0.0",
"first-run": "^2.0.0",
"got": "^9.6.0",
"hide-desktop-icons": "^0.4.0",
"insight": "^0.10.3",
"lodash": "^4.17.10",
"lodash": "^4.17.15",
"mac-windows": "^0.7.1",
"macos-version": "^5.2.0",
"make-dir": "^3.0.0",
"moment": "^2.24.0",
"move-file": "^1.2.0",
"nearest-normal-aspect-ratio": "^1.2.1",
"node-mac-app-icon": "^1.4.0",
"npm": "^6.10.0",
"npm": "^6.10.3",
"p-cancelable": "^2.0.0",
"p-event": "^4.1.0",
"package-json": "^6.5.0",
Expand All @@ -72,12 +72,12 @@
},
"devDependencies": {
"babel-eslint": "^10.0.2",
"electron": "5.0.4",
"electron-builder": "^20.44.4",
"electron": "6.0.1",
"electron-builder": "^21.2.0",
"eslint-config-xo-react": "^0.20.0",
"eslint-plugin-react": "^7.14.2",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^1.6.1",
"husky": "^3.0.0",
"husky": "^3.0.2",
"next": "^8.1.0",
"xo": "^0.24.0"
},
Expand Down
2 changes: 1 addition & 1 deletion renderer/containers/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class PreferencesContainer extends Container {
pickKapturesDir = () => {
const {dialog, getCurrentWindow} = this.remote;

const directories = dialog.showOpenDialog(getCurrentWindow(), {
const directories = dialog.showOpenDialogSync(getCurrentWindow(), {
properties: [
'openDirectory',
'createDirectory'
Expand Down
Loading

0 comments on commit 53a3373

Please sign in to comment.