Skip to content

Commit 3f47c83

Browse files
authored
Merge pull request #363 from hypermodules/dependabot/npm_and_yarn/electron-28.0.0
Bump electron from 27.1.3 to 28.0.0
2 parents 4e28295 + 8fcd067 commit 3f47c83

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
"electron-window-state": "^5.0.2",
8585
"entypo": "^2.1.0",
8686
"existy": "^1.0.1",
87-
"file-url": "^3.0.0",
8887
"flush-write-stream": "^2.0.0",
8988
"folder-walker": "^3.2.0",
9089
"format-duration": "^3.0.2",
@@ -110,7 +109,7 @@
110109
"common-shakeify": "^1.1.2",
111110
"concat-stream": "^2.0.0",
112111
"dependency-check": "^4.1.0",
113-
"electron": "^27.0.1",
112+
"electron": "^28.0.0",
114113
"electron-builder": "^24.4.0",
115114
"electron-renderify": "0.0.2",
116115
"envify": "^4.1.0",

renderer/audio/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const path = require('path')
77
const mainState = remote.require('./index.js')
88
const needle = 'file://' + path.resolve(__dirname, 'needle.mp3')
99
let startupNode = document.querySelector('#needle')
10-
const fileUrlFromPath = require('file-url')
10+
const fileUrlFromPath = require('../shared/file-url')
1111

1212
needleSound(startupNode, needle, mainState.volume, mainState.muted)
1313

renderer/player/elements/player/artwork.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const html = require('choo/html')
22
const Component = require('nanocomponent')
3-
const fileUrlFromPath = require('file-url')
3+
const fileUrlFromPath = require('../../../shared/file-url')
44
const path = require('path')
55
const defaultBG = path.resolve(window.__dirname, 'default-artwork.png')
66
const compare = require('nanocomponent/compare')

renderer/shared/file-url.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const path = require('path')
2+
3+
// Vendored from https://github.com/sindresorhus/file-url/blob/982123e9af861ce26167de7ef40be3ff9cad2be7/index.js#L2
4+
// because inconvient ESM upgrade
5+
6+
function fileUrl (filePath, options = {}) {
7+
if (typeof filePath !== 'string') {
8+
throw new TypeError(`Expected a string, got ${typeof filePath}`)
9+
}
10+
11+
const { resolve = true } = options
12+
13+
let pathName = filePath
14+
if (resolve) {
15+
pathName = path.resolve(filePath)
16+
}
17+
18+
pathName = pathName.replace(/\\/g, '/')
19+
20+
// Windows drive letter must be prefixed with a slash.
21+
if (pathName[0] !== '/') {
22+
pathName = `/${pathName}`
23+
}
24+
25+
// Escape required characters for path components.
26+
// See: https://tools.ietf.org/html/rfc3986#section-3.3
27+
return encodeURI(`file://${pathName}`).replace(/[?#]/g, encodeURIComponent)
28+
}
29+
30+
module.exports = fileUrl

0 commit comments

Comments
 (0)