Skip to content

Commit

Permalink
chore: non-conflicting dependency updates (#1016)
Browse files Browse the repository at this point in the history
* use package-lock to ensure devs are using the same versions of dependencies

* update sqlite

* update genius-lyrics

* update @googleapis/drive

* add prettier in dev deps so the config is actually used

* update @rollup/plugin-commonjs

* update @rollup/plugin-typescript

* update rollup
  • Loading branch information
DAcodedBEAT authored Nov 14, 2024
1 parent 3b0affd commit 5cdc75d
Show file tree
Hide file tree
Showing 29 changed files with 10,550 additions and 488 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*.env

.DS_Store
package-lock.json

test-output/
test-results/
10,085 changes: 10,085 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"start:electron:dev": "npm-run-all -s build:electron:dev start:electron:script start:electron:run",
"start:electron:script": "node scripts/electronDevPostBuild.js",
"start:electron": "npm-run-all -p build:electron:dev:watch start:electron:dev",
"test": "npm-run-all -s build test:playwright",
"test": "npm-run-all -s build test:*",
"test:*": "npm-run-all -p test:prettier test:playwright",
"test:prettier": "npx prettier --check src scripts",
"test:playwright": "npx playwright test",
"postinstall": "electron-builder install-app-deps",
"prepack": "npm run build",
Expand Down Expand Up @@ -135,10 +137,10 @@
"devDependencies": {
"@electron/notarize": "^2.4.0",
"@playwright/test": "^1.40.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"@rollup/plugin-typescript": "^12.1.1",
"@tsconfig/svelte": "^2.0.0",
"@types/adm-zip": "^0.5.6",
"@types/exif": "^0.6.3",
Expand All @@ -150,7 +152,8 @@
"electron": "^32.1.2",
"electron-builder": "^24.13.3",
"playwright": "^1.40.1",
"rollup": "^4.6.1",
"prettier": "^3.3.3",
"rollup": "^4.26.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-css-only": "^4.5.2",
"rollup-plugin-livereload": "^2.0.5",
Expand All @@ -164,7 +167,7 @@
"typescript": "^4.5.4"
},
"dependencies": {
"@googleapis/drive": "^6.0.0",
"@googleapis/drive": "^8.14.0",
"@mapbox/node-pre-gyp": "^1.0.11",
"@sveltejs/svelte-virtual-list": "^3.0.1",
"@vimeo/player": "^2.16.4",
Expand All @@ -178,7 +181,7 @@
"express": "^4.17.2",
"follow-redirects": "^1.15.2",
"font-list": "^1.4.5",
"genius-lyrics": "4.4.6",
"genius-lyrics": "^4.4.7",
"grandiose": "vassbo/grandiose#9857c8e",
"jzz": "^1.5.9",
"mp4box": "^0.5.2",
Expand All @@ -193,7 +196,7 @@
"socket.io": "^4.4.1",
"socket.io-client": "^4.4.1",
"sqlite-to-json": "^0.1.3",
"sqlite3": "5.1.6",
"sqlite3": "^5.1.7",
"svelte-youtube": "0.0.2",
"tmp": "^0.2.3",
"uid": "^2.0.0",
Expand Down
13 changes: 8 additions & 5 deletions src/electron/data/downloadMedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ async function startDownload(downloading: any) {
next()
}

let timeout = setTimeout(() => {
fileStream.close()
console.error(`File timed out: ${file.name}`)
next()
}, 60 * 8 * 1000) // 8 minutes timeout
let timeout = setTimeout(
() => {
fileStream.close()
console.error(`File timed out: ${file.name}`)
next()
},
60 * 8 * 1000
) // 8 minutes timeout
}
1 change: 0 additions & 1 deletion src/electron/ndi/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { NdiSender } from "./NdiSender"
// const ebml = require("ebml")
// const Opus = require("@discordjs/opus")


// if (audio) captureAudio()

const audioChannelCount = 2
Expand Down
9 changes: 6 additions & 3 deletions src/frontend/components/drawer/audio/metronome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ function scheduleNextNote(time = 0, beat = 1) {
if (beat > (metronomeValues.beats || defaultMetronomeValues.beats)) beat = 1

playingMetronome.set(
setTimeout(() => {
scheduleNote(beat)
}, (time + timeBetweenEachBeat - preScheduleTime) * 1000)
setTimeout(
() => {
scheduleNote(beat)
},
(time + timeBetweenEachBeat - preScheduleTime) * 1000
)
)
}

Expand Down
138 changes: 69 additions & 69 deletions src/frontend/components/edit/scripts/Cursor.ts
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
// Credit to Liam (Stack Overflow)
// https://stackoverflow.com/a/41034697/3480193
export class Cursor {
static getCurrentCursorPosition(parentElement: any) {
var selection = window.getSelection(),
charCount = -1,
node
static getCurrentCursorPosition(parentElement: any) {
var selection = window.getSelection(),
charCount = -1,
node

if (selection?.focusNode) {
if (Cursor._isChildOf(selection.focusNode, parentElement)) {
node = selection.focusNode
charCount = selection.focusOffset
if (selection?.focusNode) {
if (Cursor._isChildOf(selection.focusNode, parentElement)) {
node = selection.focusNode
charCount = selection.focusOffset

while (node) {
if (node === parentElement) {
break
}
while (node) {
if (node === parentElement) {
break
}

if (node.previousSibling) {
node = node.previousSibling
charCount += node.textContent!.length
} else {
node = node.parentNode
if (node === null) {
break
if (node.previousSibling) {
node = node.previousSibling
charCount += node.textContent!.length
} else {
node = node.parentNode
if (node === null) {
break
}
}
}
}
}
}
}
}

return charCount
}
return charCount
}

static setCurrentCursorPosition(chars: number, element: any) {
if (chars >= 0) {
var selection = window.getSelection()
static setCurrentCursorPosition(chars: number, element: any) {
if (chars >= 0) {
var selection = window.getSelection()

let range = Cursor._createRange(element, { count: chars })
let range = Cursor._createRange(element, { count: chars })

if (range) {
range.collapse(false)
selection!.removeAllRanges()
selection!.addRange(range)
}
if (range) {
range.collapse(false)
selection!.removeAllRanges()
selection!.addRange(range)
}
}
}
}

static _createRange(node: any, chars: any, range: any = null) {
if (!range) {
range = document.createRange()
range.selectNode(node)
range.setStart(node, 0)
}
static _createRange(node: any, chars: any, range: any = null) {
if (!range) {
range = document.createRange()
range.selectNode(node)
range.setStart(node, 0)
}

console.log(range, node, chars)
console.log(range, node, chars)

if (chars.count === 0) {
range.setEnd(node, chars.count)
} else if (node && chars.count > 0) {
if (node.nodeType === Node.TEXT_NODE) {
if (node.textContent.length < chars.count) {
chars.count -= node.textContent.length
} else {
range.setEnd(node, chars.count)
chars.count = 0
}
} else {
for (var lp = 0; lp < node.childNodes.length; lp++) {
range = Cursor._createRange(node.childNodes[lp], chars, range)
if (chars.count === 0) {
range.setEnd(node, chars.count)
} else if (node && chars.count > 0) {
if (node.nodeType === Node.TEXT_NODE) {
if (node.textContent.length < chars.count) {
chars.count -= node.textContent.length
} else {
range.setEnd(node, chars.count)
chars.count = 0
}
} else {
for (var lp = 0; lp < node.childNodes.length; lp++) {
range = Cursor._createRange(node.childNodes[lp], chars, range)

if (chars.count === 0) {
break
}
if (chars.count === 0) {
break
}
}
}
}
}

return range
}

return range
}
static _isChildOf(node: any, parentElement: any) {
while (node !== null) {
if (node === parentElement) {
return true
}
node = node.parentNode
}

static _isChildOf(node: any, parentElement: any) {
while (node !== null) {
if (node === parentElement) {
return true
}
node = node.parentNode
return false
}

return false
}
}
12 changes: 6 additions & 6 deletions src/frontend/components/helpers/bytes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export function formatBytes(bytes: number, decimals: number = 0): string {
if (bytes === 0) return "0 Bytes"
const k = 1024
const dm: number = decimals < 0 ? 0 : decimals
const sizes: string[] = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
const i: number = Math.floor(Math.log(bytes) / Math.log(k))
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i]
if (bytes === 0) return "0 Bytes"
const k = 1024
const dm: number = decimals < 0 ? 0 : decimals
const sizes: string[] = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
const i: number = Math.floor(Math.log(bytes) / Math.log(k))
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i]
}
2 changes: 1 addition & 1 deletion src/frontend/components/helpers/historyActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export const historyActions = ({ obj, undo = null }: any) => {
if (isParent) {
// get layout slides index (without children)
let refAtIndex = ref[slideIndex - 1]?.parent || ref[slideIndex - 1]
let slideLayoutIndex = refAtIndex ? refAtIndex.index + 1 : slideIndex ?? ref.length
let slideLayoutIndex = refAtIndex ? refAtIndex.index + 1 : (slideIndex ?? ref.length)

// add to layout at index
// _show(showId).layouts([layout]).slides().add([layoutValue], null, slideIndex)
Expand Down
36 changes: 18 additions & 18 deletions src/frontend/components/helpers/inputActions.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/** Selects the text inside a text node when the node is focused */
export function selectTextOnFocus(node: any) {
const handleFocus = () => {
node && typeof node.select === "function" && node.select()
}
const handleFocus = () => {
node && typeof node.select === "function" && node.select()
}

node.addEventListener("focus", handleFocus)
node.addEventListener("focus", handleFocus)

return {
destroy() {
node.removeEventListener("focus", handleFocus)
},
}
return {
destroy() {
node.removeEventListener("focus", handleFocus)
},
}
}

/** Blurs the node when Escape is pressed */
export function blurOnEscape(node: any) {
const handleKey = (event: any) => {
if (event.key === "Escape" && node && typeof node.blur === "function") node.blur()
}
const handleKey = (event: any) => {
if (event.key === "Escape" && node && typeof node.blur === "function") node.blur()
}

node.addEventListener("keydown", handleKey)
node.addEventListener("keydown", handleKey)

return {
destroy() {
node.removeEventListener("keydown", handleKey)
},
}
return {
destroy() {
node.removeEventListener("keydown", handleKey)
},
}
}
3 changes: 2 additions & 1 deletion src/frontend/components/show/formatTextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ function getChords(line: string) {

if (char === "]") {
currentlyInChord = false
if (currentChord.length > 12) text += `[${currentChord}]` // probably not a chord
if (currentChord.length > 12)
text += `[${currentChord}]` // probably not a chord
else chords.push(createChord(text.length, currentChord))
return
}
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/components/system/autoscroll.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function autoscroll(scrollElem: any, index: number, grid: number = 1) {
if (!scrollElem || index === undefined || index === null) return 0
return scrollElem.querySelector(".ParentBlock").children[Math.max(0, index)]?.offsetTop - scrollElem.offsetTop
console.log(grid)
if (!scrollElem || index === undefined || index === null) return 0
return scrollElem.querySelector(".ParentBlock").children[Math.max(0, index)]?.offsetTop - scrollElem.offsetTop
console.log(grid)
}
2 changes: 1 addition & 1 deletion src/frontend/converters/openlp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function XMLtoObject(xml: string) {
let currentSongTitle = properties.titles?.title || []
if (Array.isArray(currentSongTitle)) currentSongTitle = currentSongTitle[0]

let title = (typeof currentSongTitle["#text"] != "undefined") ? currentSongTitle["#text"] : currentSongTitle
let title = typeof currentSongTitle["#text"] != "undefined" ? currentSongTitle["#text"] : currentSongTitle

return title
}
Expand Down
Loading

0 comments on commit 5cdc75d

Please sign in to comment.