Skip to content

Commit bc517e0

Browse files
committed
Merge branch 'develop'
2 parents a5e2935 + 41900b0 commit bc517e0

File tree

96 files changed

+3803
-3653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3803
-3653
lines changed

.github/workflows/publishImage.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,28 @@ on:
1212
- '**.md'
1313

1414
jobs:
15+
test:
16+
name: Run Tests
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check out the repo
20+
uses: actions/checkout@v4
21+
- name: Use Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '18.x'
25+
cache: 'npm'
26+
- name: Install dev dependencies
27+
run: npm ci
28+
- name: Build Backend
29+
run: 'npm run build:backend'
30+
- name: Test Backend
31+
run: npm run test
32+
1533
push_to_registry:
16-
name: Push Docker image to Docker Hub
34+
name: Build and push container images
1735
runs-on: ubuntu-latest
36+
needs: test
1837
strategy:
1938
fail-fast: false
2039
matrix:
@@ -26,7 +45,7 @@ jobs:
2645
suffix: '-debian'
2746
# can't build arm64 due to a TLS issue when running npm install??
2847
# https://github.com/FoxxMD/multi-scrobbler/issues/126
29-
platforms: 'linux/amd64'
48+
platforms: 'linux/amd64,linux/arm64'
3049
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
3150
permissions:
3251
packages: write

.github/workflows/test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish Docker image to Dockerhub
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
test:
9+
name: Run Tests
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out the repo
13+
uses: actions/checkout@v4
14+
- name: Use Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: '18.x'
18+
cache: 'npm'
19+
- name: Install dev dependencies
20+
run: npm ci
21+
- name: Build Backend
22+
run: 'npm run build:backend'
23+
- name: Test Backend
24+
run: npm run test

.mocharc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"reporter": "dot"
2+
"reporter": "dot",
3+
"extension": "ts",
4+
"import": "tsx/esm"
35
}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.16.0
1+
v18.19.1

Dockerfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@ ENV TZ=Etc/GMT
55
RUN \
66
echo "**** install build packages ****" && \
77
apk add --no-cache \
8-
alpine-base \
98
avahi \
109
avahi-tools \
11-
git \
1210
nodejs \
1311
npm \
14-
#yarn \
15-
openssh && \
12+
&& \
1613
echo "**** cleanup ****" && \
1714
rm -rf \
1815
/root/.cache \
@@ -26,9 +23,6 @@ ENV CONFIG_DIR=$data_dir
2623

2724
COPY docker/root/ /
2825

29-
RUN npm install -g patch-package \
30-
&& chown -R root:root /usr/local/lib/node_modules/patch-package
31-
3226
WORKDIR /app
3327

3428
FROM base as build
@@ -41,8 +35,7 @@ FROM base as build
4135
COPY --chown=abc:abc package*.json tsconfig.json ./
4236
COPY --chown=abc:abc patches ./patches
4337

44-
45-
RUN npm install \
38+
RUN npm ci \
4639
&& chown -R root:root node_modules
4740
#RUN yarn install
4841

@@ -66,6 +59,7 @@ COPY --from=base /usr/local/lib /usr/local/lib
6659

6760
ENV NODE_ENV=production
6861
ENV IS_DOCKER=true
62+
ENV COLORED_STD=true
6963
#
7064
#RUN yarn global add patch-package \
7165
# && yarn install --production=true \
@@ -75,7 +69,7 @@ ENV IS_DOCKER=true
7569
# && rm -rf node_modules/ts-node \
7670
# && rm -rf node_modules/typescript
7771

78-
RUN npm install --omit=dev \
72+
RUN npm ci --omit=dev \
7973
&& npm cache clean --force \
8074
&& chown -R abc:abc node_modules \
8175
&& rm -rf node_modules/@types

debian.Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM ghcr.io/linuxserver/baseimage-debian:bookworm as base
33

44
ENV TZ=Etc/GMT
5-
ENV NODE_VERSION 18.19.0
5+
ENV NODE_VERSION 20.11.1
66

77
# borrowing openssl header removal trick from offical docker-node
88
# https://github.com/nodejs/docker-node/blob/main/18/bookworm-slim/Dockerfile#L8
@@ -57,10 +57,6 @@ ENV CONFIG_DIR=$data_dir
5757

5858
COPY docker/root /
5959

60-
RUN npm install -g \
61-
patch-package \
62-
&& chown -R root:root /usr/lib/node_modules/patch-package
63-
6460
WORKDIR /app
6561

6662
FROM base as build

eslint.config.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tsEslint from 'typescript-eslint';
5+
import arrow from 'eslint-plugin-prefer-arrow-functions';
6+
7+
export default tsEslint.config(
8+
eslint.configs.recommended,
9+
...tsEslint.configs.recommended,
10+
// use to enable typed linting (way more errors) https://typescript-eslint.io/linting/typed-linting
11+
/* ...tsEslint.configs.recommendedTypeChecked,
12+
{
13+
languageOptions: {
14+
parserOptions: {
15+
project: true,
16+
tsconfigDirName: import.meta.dirname,
17+
},
18+
},
19+
},*/
20+
{
21+
files: ['src/backend/**/*.ts'],
22+
ignores: ['eslint.config.js'],
23+
plugins: {
24+
"prefer-arrow-functions": arrow
25+
},
26+
rules: {
27+
'no-useless-catch': 'off',
28+
'@typescript-eslint/no-unused-vars': 'off',
29+
"prefer-arrow-functions/prefer-arrow-functions": [
30+
"warn",
31+
{
32+
"allowNamedFunctions": false,
33+
"classPropertiesAllowed": false,
34+
"disallowPrototype": false,
35+
"returnStyle": "unchanged",
36+
"singleReturnOnly": false
37+
}
38+
],
39+
"arrow-body-style": ["warn", "as-needed"],
40+
"@typescript-eslint/no-explicit-any": "warn"
41+
}
42+
}
43+
);

flatpak/io.github.foxxmd.multiscrobbler.metainfo.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
<id>io.github.foxxmd.multiscrobbler</id>
44
<provides>
55
<id>io.github.foxxmd.multiscrobbler.desktop</id>
6+
<binary>multiscrobbler</binary>
67
</provides>
78
<launchable type="desktop-id">io.github.foxxmd.multiscrobbler.desktop</launchable>
89
<name>multi-scrobbler</name>
9-
<summary>Scrobbles music from many sources to many clients</summary>
10+
<summary>Scrobbles music from many sources</summary>
1011
<url type="homepage">https://foxxmd.github.io/multi-scrobbler</url>
1112
<url type="help">https://foxxmd.github.io/multi-scrobbler/docs/configuration</url>
1213
<metadata_license>MIT</metadata_license>
1314
<project_license>MIT</project_license>
15+
<developer id="tld.vendor">
16+
<name>FoxxMD</name>
17+
</developer>
1418
<description>
1519
<p>
1620
Track your music listening history from many different sources:
@@ -45,6 +49,7 @@
4549
</screenshot>
4650
</screenshots>
4751
<releases>
52+
<release version="0.7.0" date="2024-03-26"/>
4853
<release version="0.6.5" date="2024-02-05"/>
4954
<release version="0.6.4" date="2024-01-29"/>
5055
<release version="0.6.3" date="2024-01-10"/>

flatpak/io.github.foxxmd.multiscrobbler.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ modules:
3030
- mkdir -p /app/bin /app/lib /app/lib/dist /app/lib/src /app/lib/assets
3131
- cp -a /usr/lib/sdk/node18/bin/{node,npm} /app/bin
3232
- cp -a /usr/lib/sdk/node18/lib/* /app/lib
33-
- rm -r /app/lib/node_modules/npm/{docs,man}
33+
- rm -r /app/lib/node_modules/npm/{docs,man} # remove this when updating to newer runtime-version
3434

3535
# remove dev dependencies
3636
- npm prune --production
3737

3838
# copy node_modules needed to run app
3939
- cp -r node_modules/. /app/lib/node_modules
4040

41+
# even if not using package.json for scripts it must be present
42+
# so that tsx/node runs as esm (needs to see "type": "module" in file)
43+
- cp package.json /app/lib/package.json
44+
4145
# copy app files to runtime dir
4246
- cp -r dist/. /app/lib/dist
4347
- cp -r src/. /app/lib/src
@@ -59,11 +63,12 @@ modules:
5963
subdir: main
6064
sources:
6165
# use for official releases
62-
- type: git
63-
url: https://github.com/FoxxMD/multi-scrobbler
64-
tag: 0.6.3
65-
commit: 4bd996eb466137ffc5c3f48305afabde03720525
66-
dest: main
66+
# - type: git
67+
# url: https://github.com/FoxxMD/multi-scrobbler
68+
# tag: 0.6.3
69+
# commit: 4bd996eb466137ffc5c3f48305afabde03720525
70+
# dest: main
71+
6772
# use if developing locally
6873
# - type: dir
6974
# path: /home/yourUser/multi-scrobbler

0 commit comments

Comments
 (0)