Skip to content

Commit

Permalink
task: update to node v20 lts
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Jul 15, 2024
1 parent 0d45071 commit ff55c32
Show file tree
Hide file tree
Showing 26 changed files with 612 additions and 478 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
php:
- '8.2'
node:
- 18
- 20
python:
- 3.11
os:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gulp_sass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
build:
strategy:
matrix:
node: [18]
node: [20]
python: [3.11]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Install modules
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.17
v20.15
10 changes: 0 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,3 @@ repos:
hooks:
- id: shellcheck
files: ^install-photobooth.sh$

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.56.0
hooks:
- id: eslint
args:
- --fix
additional_dependencies:
- eslint@latest
- eslint-plugin-n@latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM webdevops/php-apache:8.3
# Adjust LimitRequestLine and
# update and install dependencies
RUN echo "LimitRequestLine 12000" > /opt/docker/etc/httpd/conf.d/limits.conf \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ _\*2 Capture from webcam is possible e.g. using [fswebcam](https://www.sanslogic

| Software | Required version | Note |
| --------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Node.js | >=v18.17.0 | Currently only v18 is tested. Our installer will check your Node.js version and suggest an update/downgrade if needed. Versions below v18 aren't supported anymore. |
| npm | >=v9.6.0 | |
| Node.js | >=v20.15.0 | Currently only v20 is tested. Our installer will check your Node.js version and suggest an update/downgrade if needed. Versions below v20 aren't supported anymore. |
| npm | >=v10.7.0 | |
| php | >=v8.2 | |
| Webserver | | Apache, Nginx or lighttpd is needed. By default Apache webserver is installed by our installer. |

Expand Down
1 change: 1 addition & 0 deletions assets/js/admin/buttons.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint n/no-unsupported-features/node-builtins: "off" */
/* globals photoboothTools shellCommand */
$(function () {
$('#reset-btn').on('click', function (e) {
Expand Down
1 change: 1 addition & 0 deletions assets/js/core.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint n/no-unsupported-features/node-builtins: "off" */
/* globals initPhotoSwipeFromDOM initRemoteBuzzerFromDOM processChromaImage remoteBuzzerClient rotaryController globalGalleryHandle photoboothTools photoboothPreview */

const photoBooth = (function () {
Expand Down
2 changes: 2 additions & 0 deletions assets/js/debugpanel.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint n/no-unsupported-features/node-builtins: "off" */

class DebugPanel {
constructor() {
this.autorefresh = false;
Expand Down
14 changes: 7 additions & 7 deletions assets/js/photoswipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function initPhotoSwipeFromDOM(gallerySelector) {
doubleTapAction: actionDoubleTap,

wheelToZoom: true,
// eslint-disable-next-line object-property-newline

//padding: {top: 20, bottom: 40, left: 100, right: 100},
escKey: true,
arrowKeys: true,
Expand Down Expand Up @@ -132,7 +132,7 @@ function initPhotoSwipeFromDOM(gallerySelector) {
order: orderNumber.shift(),
isButton: true,
html: '<i class="' + config.icons.mail + '"></i>',
// eslint-disable-next-line no-unused-vars

onClick: (event, el, pswp) => {
photoBooth.showMailForm(pswp.currSlide.data.src.split('\\').pop().split('/').pop());
}
Expand All @@ -146,7 +146,7 @@ function initPhotoSwipeFromDOM(gallerySelector) {
order: orderNumber.shift(),
isButton: true,
html: '<i class="' + config.icons.print + '"></i>',
// eslint-disable-next-line no-unused-vars

onClick: (event, el, pswp) => {
event.preventDefault();
event.stopPropagation();
Expand Down Expand Up @@ -174,7 +174,7 @@ function initPhotoSwipeFromDOM(gallerySelector) {
order: orderNumber.shift(),
isButton: true,
html: '<i class="' + config.icons.qr + '"></i>',
// eslint-disable-next-line no-unused-vars

onClick: (event, el, pswp) => {
const image = pswp.currSlide.data.src.split('\\').pop().split('/').pop();
photoBooth.showQrCode(image);
Expand All @@ -189,7 +189,7 @@ function initPhotoSwipeFromDOM(gallerySelector) {
order: orderNumber.shift(),
isButton: true,
html: '<i class=" center ' + config.icons.download + '"></i>',
// eslint-disable-next-line no-unused-vars

onInit: (el, pswp) => {
pswp.on('change', () => {
el.href =
Expand All @@ -208,7 +208,7 @@ function initPhotoSwipeFromDOM(gallerySelector) {
order: orderNumber.shift(),
isButton: true,
html: '<i class=" center ' + config.icons.chroma + '"></i>',
// eslint-disable-next-line no-unused-vars

onInit: (el, pswp) => {
pswp.on('change', () => {
el.href =
Expand Down Expand Up @@ -243,7 +243,7 @@ function initPhotoSwipeFromDOM(gallerySelector) {
order: orderNumber.shift(),
isButton: true,
html: '<i class="' + config.icons.delete + '"></i>',
// eslint-disable-next-line no-unused-vars

onClick: async (event, el, pswp) => {
event.preventDefault();
event.stopPropagation();
Expand Down
1 change: 1 addition & 0 deletions assets/js/preview.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint n/no-unsupported-features/node-builtins: "off" */
/* globals photoBooth photoboothTools */
const photoboothPreview = (function () {
// vars
Expand Down
8 changes: 7 additions & 1 deletion assets/js/remotebuzzer-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,8 @@ function move2usbAction() {
//Assuming that the lsblk version supports JSON output!
const output = execSync('export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL').toString();
json = JSON.parse(output);

// eslint-disable-next-line no-unused-vars
} catch (err) {
log(
'ERROR: Could not parse the output of lsblk! Please make sure its installed and that it offers JSON output!'
Expand All @@ -1317,13 +1319,13 @@ function move2usbAction() {
try {
device = json.blockdevices.find(
(blk) =>
// eslint-disable-next-line implicit-arrow-linebreak
blk.subsystems.includes('usb') &&
((blk.name && drive === blk.name.toLowerCase()) ||
(blk.kname && drive === blk.kname.toLowerCase()) ||
(blk.path && drive === blk.path.toLowerCase()) ||
(blk.label && drive === blk.label.toLowerCase()))
);
// eslint-disable-next-line no-unused-vars
} catch (err) {
device = false;
}
Expand All @@ -1341,6 +1343,7 @@ function move2usbAction() {
.replace(/[\n.]/gu, '');

drive.mountpoint = mountPoint;
// eslint-disable-next-line no-unused-vars
} catch (error) {
log('ERROR: unable to mount drive', drive.path);
drive = null;
Expand Down Expand Up @@ -1444,6 +1447,7 @@ function move2usbAction() {
try {
execSync(`export LC_ALL=C; udisksctl unmount -b ${mountedDrive.path}; unset LC_ALL`).toString();
log('Unmounted drive', mountedDrive.path);
// eslint-disable-next-line no-unused-vars
} catch (error) {
log('ERROR: unable to unmount drive', mountedDrive.path);
}
Expand Down Expand Up @@ -1531,13 +1535,15 @@ function move2usbAction() {
const driveInfo = getDriveInfo(parsedConfig);
try {
log(`Processing drive ${driveInfo.label} -> ${driveInfo.path}`);
// eslint-disable-next-line no-unused-vars
} catch (error) {
return;
}

const mountedDrive = mountDrive(driveInfo);
try {
log(`Mounted drive ${mountedDrive.name} -> ${mountedDrive.mountpoint}`);
// eslint-disable-next-line no-unused-vars
} catch (error) {
return;
}
Expand Down
2 changes: 0 additions & 2 deletions assets/js/slideshow.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* exported initPhotoSlideFromDOM */
/* global photoboothTools */

// eslint-disable-next-line no-unused-vars
let ssTimeOut,
ssRunning = false,
lastDBSize = -1;
Expand All @@ -11,7 +10,6 @@ const ssDelay = config.slideshow.pictureTime,
interval = 1000 * config.slideshow.refreshTime,
ajaxurl = environment.publicFolders.api + '/gallery.php?status';

// eslint-disable-next-line no-unused-vars
function initPhotoSlideFromDOM(gallerySelector) {
const gallery = new PhotoSwipeLightbox({
gallery: gallerySelector,
Expand Down
6 changes: 3 additions & 3 deletions assets/js/sync-to-drive.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class SyncToDrive {
.replace(/[\n.]/gu, '');
device.mountpoint = mountPoint;
}
// eslint-disable-next-line no-unused-vars
} catch (error) {
throw new Error('Unable to mount device');
}
Expand All @@ -186,6 +187,7 @@ class SyncToDrive {
const command = `export LC_ALL=C; udisksctl unmount -b ${device.path}; unset LC_ALL`;
execSync(command);
log('Unmounted drive ' + device.path + ', command: "' + command + '"');
// eslint-disable-next-line no-unused-vars
} catch (error) {
throw new Error('Unable to unmount device');
}
Expand Down Expand Up @@ -217,9 +219,8 @@ class SyncToDrive {
}, 60000);

const sleep = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
// eslint-disable-next-line no-unmodified-loop-condition

while (this.rsyncProcess) {
// eslint-disable-next-line no-await-in-loop
await sleep(1000);
}
}
Expand Down Expand Up @@ -258,7 +259,6 @@ class SyncToDrive {
}
}

// eslint-disable-next-line no-unused-vars
const syncToDrive = new SyncToDrive();

['SIGTERM', 'SIGHUP', 'SIGINT'].forEach((term) =>
Expand Down
1 change: 1 addition & 0 deletions assets/js/tools.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint n/no-unsupported-features/node-builtins: "off" */
/* globals remoteBuzzerClient */
const photoboothTools = (function () {
// vars
Expand Down
6 changes: 3 additions & 3 deletions assets/sass/components/_gallery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
&:focus,
&:hover,
&.focused {
--gallery-card-color: var(--gallery-card-focus-color);
--gallery-card-background: var(--gallery-card-focus-background);

img {
opacity: 0.75;
}

--gallery-card-color: var(--gallery-card-focus-color);
--gallery-card-background: var(--gallery-card-focus-background);
}
}

Expand Down
12 changes: 6 additions & 6 deletions assets/sass/themes/_classic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
[data-ui-theme='classic_rounded'] {
.stage--start {
.stage-inner {
width: auto;
height: auto;
margin-left: 2rem;
margin-right: 2rem;
max-width: 40rem;

&:before {
content: '';
position: absolute;
Expand All @@ -20,12 +26,6 @@
// workaround to allow background blur
position: relative;
}

width: auto;
height: auto;
margin-left: 2rem;
margin-right: 2rem;
max-width: 40rem;
}

.names {
Expand Down
2 changes: 1 addition & 1 deletion docs/install/install-debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ npm run build
exit
```

**Please note:** depending on your hardware `npm install` and `npm run build` takes up to 15min! Node.js is needed in v18 or later!
**Please note:** depending on your hardware `npm install` and `npm run build` takes up to 15min! Node.js is needed in v20 or later!

Next we have to give our webserver user access to the USB device:

Expand Down
4 changes: 2 additions & 2 deletions docs/install/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Software | Required version | Note
|-------------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| Node.js | >=v18.17.0 | Currently only v18 is tested. Our installer will check your Node.js version and suggest an update/downgrade if needed. Versions below v18 aren't supported anymore. |
| npm | >=v9.6.0 | |
| Node.js | >=v20.15.0 | Currently only v20 is tested. Our installer will check your Node.js version and suggest an update/downgrade if needed. Versions below v20 aren't supported anymore. |
| npm | >=v10.7.0 | |
| php | >=v8.2 | |
| Webserver | | Apache, Nginx or lighttpd is needed. By default Apache webserver is installed by our installer. |
2 changes: 1 addition & 1 deletion docs/update/update-linux.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Updating Photobooth on Linux

Node.js **must** be installed in v18. Our installer will check your Node.js version and suggest an update/downgrade if needed.
Node.js **must** be installed in v20. Our installer will check your Node.js version and suggest an update/downgrade if needed.
Update will fail if Node.js is installed in a version below v18!


Expand Down
Loading

0 comments on commit ff55c32

Please sign in to comment.