Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 17, 2022
1 parent a25ae53 commit 74c6891
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 66 deletions.
4 changes: 2 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const Store = require('electron-store');

module.exports = new Store({
defaults: {
favoriteAnimal: '🦄'
}
favoriteAnimal: '🦄',
},
});
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ app.setAppUserModelId('com.company.AppName');
let mainWindow;

const createMainWindow = async () => {
const win = new BrowserWindow({
const window_ = new BrowserWindow({
title: app.name,
show: false,
width: 600,
height: 400
height: 400,
});

win.on('ready-to-show', () => {
win.show();
window_.on('ready-to-show', () => {
window_.show();
});

win.on('closed', () => {
window_.on('closed', () => {
// Dereference the window
// For multiple windows store them in an array
mainWindow = undefined;
});

await win.loadFile(path.join(__dirname, 'index.html'));
await window_.loadFile(path.join(__dirname, 'index.html'));

return win;
return window_;
};

// Prevent multiple instances of the app
Expand Down
78 changes: 39 additions & 39 deletions menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
aboutMenuItem,
openUrlMenuItem,
openNewGitHubIssue,
debugInfo
debugInfo,
} = require('electron-util');
const config = require('./config.js');

Expand All @@ -18,11 +18,11 @@ const showPreferences = () => {
const helpSubmenu = [
openUrlMenuItem({
label: 'Website',
url: 'https://github.com/sindresorhus/electron-boilerplate'
url: 'https://github.com/sindresorhus/electron-boilerplate',
}),
openUrlMenuItem({
label: 'Source Code',
url: 'https://github.com/sindresorhus/electron-boilerplate'
url: 'https://github.com/sindresorhus/electron-boilerplate',
}),
{
label: 'Report an Issue…',
Expand All @@ -38,21 +38,21 @@ ${debugInfo()}`;
openNewGitHubIssue({
user: 'sindresorhus',
repo: 'electron-boilerplate',
body
body,
});
}
}
},
},
];

if (!is.macos) {
helpSubmenu.push(
{
type: 'separator'
type: 'separator',
},
aboutMenuItem({
icon: path.join(__dirname, 'static', 'icon.png'),
text: 'Created by Your Name'
})
text: 'Created by Your Name',
}),
);
}

Expand All @@ -61,33 +61,33 @@ const debugSubmenu = [
label: 'Show Settings',
click() {
config.openInEditor();
}
},
},
{
label: 'Show App Data',
click() {
shell.openItem(app.getPath('userData'));
}
},
},
{
type: 'separator'
type: 'separator',
},
{
label: 'Delete Settings',
click() {
config.clear();
app.relaunch();
app.quit();
}
},
},
{
label: 'Delete App Data',
click() {
shell.moveItemToTrash(app.getPath('userData'));
app.relaunch();
app.quit();
}
}
},
},
];

const macosTemplate = [
Expand All @@ -97,36 +97,36 @@ const macosTemplate = [
accelerator: 'Command+,',
click() {
showPreferences();
}
}
},
},
]),
{
role: 'fileMenu',
submenu: [
{
label: 'Custom'
label: 'Custom',
},
{
type: 'separator'
type: 'separator',
},
{
role: 'close'
}
]
role: 'close',
},
],
},
{
role: 'editMenu'
role: 'editMenu',
},
{
role: 'viewMenu'
role: 'viewMenu',
},
{
role: 'windowMenu'
role: 'windowMenu',
},
{
role: 'help',
submenu: helpSubmenu
}
submenu: helpSubmenu,
},
];

// Linux and Windows
Expand All @@ -135,44 +135,44 @@ const otherTemplate = [
role: 'fileMenu',
submenu: [
{
label: 'Custom'
label: 'Custom',
},
{
type: 'separator'
type: 'separator',
},
{
label: 'Settings',
accelerator: 'Control+,',
click() {
showPreferences();
}
},
},
{
type: 'separator'
type: 'separator',
},
{
role: 'quit'
}
]
role: 'quit',
},
],
},
{
role: 'editMenu'
role: 'editMenu',
},
{
role: 'viewMenu'
role: 'viewMenu',
},
{
role: 'help',
submenu: helpSubmenu
}
submenu: helpSubmenu,
},
];

const template = is.macos ? macosTemplate : otherTemplate;

if (is.development) {
template.push({
label: 'Debug',
submenu: debugSubmenu
submenu: debugSubmenu,
});
}

Expand Down
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,27 @@
"release": "np"
},
"dependencies": {
"electron-context-menu": "^3.0.0",
"electron-context-menu": "^3.4.0",
"electron-debug": "^3.2.0",
"electron-store": "^8.0.0",
"electron-unhandled": "^3.0.2",
"electron-updater": "^4.3.8",
"electron-util": "^0.15.1"
"electron-store": "^8.1.0",
"electron-unhandled": "^4.0.1",
"electron-updater": "^5.2.1",
"electron-util": "^0.17.2"
},
"devDependencies": {
"electron": "^12.0.6",
"electron-builder": "^22.10.5",
"np": "^7.5.0",
"xo": "^0.39.1"
"electron": "^13.0.0",
"electron-builder": "^23.3.3",
"np": "^7.6.2",
"xo": "^0.51.0"
},
"xo": {
"envs": [
"node",
"browser"
]
],
"rules": {
"unicorn/prefer-module": "off"
}
},
"np": {
"publish": false,
Expand Down
16 changes: 8 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ See [Caprine](https://github.com/sindresorhus/caprine) for a production app base

Alternatively, create a new directory and then run:

```
$ curl -fsSL https://github.com/sindresorhus/electron-boilerplate/archive/main.tar.gz | tar -xz --strip-components 1
```sh
curl -fsSL https://github.com/sindresorhus/electron-boilerplate/archive/main.tar.gz | tar -xz --strip-components 1
```

There's also a [Yeoman generator](https://github.com/sindresorhus/generator-electron).
Expand All @@ -42,7 +42,7 @@ There's also a [Yeoman generator](https://github.com/sindresorhus/generator-elec
## Install

*macOS 10.10+, Linux, and Windows 7+ are supported (64-bit only).*
*macOS 10.13+, Linux, and Windows 7+ are supported (64-bit only).*

**macOS**

Expand All @@ -66,15 +66,15 @@ Built with [Electron](https://electronjs.org).

### Run

```
$ npm install
$ npm start
```sh
npm install
npm start
```

### Publish

```
$ npm run release
```sh
npm run release
```

After Travis finishes building your app, open the release draft it created and click "Publish".

0 comments on commit 74c6891

Please sign in to comment.