From ce06fc3c286effdc24fef547e0293dea68d5fe18 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Mon, 15 Aug 2022 08:25:38 +0200 Subject: [PATCH 1/4] Remove NPM prepare script --- package.json | 1 - scripts/prepare.js | 12 ------------ 2 files changed, 13 deletions(-) delete mode 100755 scripts/prepare.js diff --git a/package.json b/package.json index bc19c04a9..4148aad18 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,6 @@ "scripts": { "start": "npm run serve", "serve": "webpack serve --config webpack.dev.js", - "prepare": "node ./scripts/prepare.js", "build:development": "webpack --config webpack.dev.js", "build:production": "cross-env NODE_ENV=\"production\" webpack --config webpack.prod.js", "build:check": "tsc --noEmit", diff --git a/scripts/prepare.js b/scripts/prepare.js deleted file mode 100755 index 898b105e2..000000000 --- a/scripts/prepare.js +++ /dev/null @@ -1,12 +0,0 @@ -const { execSync } = require('child_process'); - -/** - * The npm `prepare` script needs to run a build to support installing - * a package from git repositories (this is dumb but a limitation of how - * npm behaves). We don't want to run these in CI though because - * building is slow so this script will skip the build when the - * `SKIP_PREPARE` environment variable has been set. - */ -if (!process.env.SKIP_PREPARE) { - execSync('webpack --config webpack.prod.js', { stdio: 'inherit' }); -} From c50bc44c3b0f289a6b958f992669141b2e519576 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 10 Mar 2023 12:24:43 -0500 Subject: [PATCH 2/4] Run web build script manually --- debian/rules | 1 + deployment/Dockerfile.docker | 4 +++- deployment/build.portable | 1 + fedora/jellyfin-web.spec | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index d9ba35ed3..091af0db1 100755 --- a/debian/rules +++ b/debian/rules @@ -12,6 +12,7 @@ override_dh_clistrip: override_dh_auto_build: npm ci --no-audit --unsafe-perm + npm run build:production mv $(CURDIR)/dist $(CURDIR)/web override_dh_auto_clean: diff --git a/deployment/Dockerfile.docker b/deployment/Dockerfile.docker index 33cf50166..5605e1150 100644 --- a/deployment/Dockerfile.docker +++ b/deployment/Dockerfile.docker @@ -8,4 +8,6 @@ RUN apk add autoconf g++ make libpng-dev gifsicle alpine-sdk automake libtool ma WORKDIR ${SOURCE_DIR} COPY . . -RUN npm ci --no-audit --unsafe-perm && mv dist ${ARTIFACT_DIR} +RUN npm ci --no-audit --unsafe-perm \ + && npm run build:production \ + && mv dist ${ARTIFACT_DIR} diff --git a/deployment/build.portable b/deployment/build.portable index 18f7a8d1e..8bf8a0d2a 100755 --- a/deployment/build.portable +++ b/deployment/build.portable @@ -15,6 +15,7 @@ fi # build archives npm ci --no-audit --unsafe-perm +npm run build:production mv dist jellyfin-web_${version} tar -czf jellyfin-web_${version}_portable.tar.gz jellyfin-web_${version} rm -rf dist diff --git a/fedora/jellyfin-web.spec b/fedora/jellyfin-web.spec index 28407b8bc..595ef33f2 100644 --- a/fedora/jellyfin-web.spec +++ b/fedora/jellyfin-web.spec @@ -35,6 +35,7 @@ chown root:root -R . %build npm ci --no-audit --unsafe-perm +npm run build:production %install From 8277fa0d3294e3b3c456f16c4a666b074a60b532 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 10 Mar 2023 12:31:36 -0500 Subject: [PATCH 3/4] Remove SKIP_PREPARE env variable usages --- .ci/azure-pipelines-build.yml | 2 -- .github/workflows/lint.yml | 6 ------ 2 files changed, 8 deletions(-) diff --git a/.ci/azure-pipelines-build.yml b/.ci/azure-pipelines-build.yml index 021b6471c..9c3a51c9f 100644 --- a/.ci/azure-pipelines-build.yml +++ b/.ci/azure-pipelines-build.yml @@ -26,8 +26,6 @@ jobs: - script: 'npm ci --no-audit' displayName: 'Install Dependencies' - env: - SKIP_PREPARE: 'true' - script: 'npm run build:development' displayName: 'Build Development' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 15526f009..498d800fe 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -50,8 +50,6 @@ jobs: - name: Install Node.js dependencies run: npm ci --no-audit - env: - SKIP_PREPARE: true - name: Run eslint run: npm run lint @@ -76,8 +74,6 @@ jobs: - name: Install Node.js dependencies run: npm ci --no-audit - env: - SKIP_PREPARE: true - name: Run stylelint run: npm run stylelint:css @@ -102,8 +98,6 @@ jobs: - name: Install Node.js dependencies run: npm ci --no-audit - env: - SKIP_PREPARE: true - name: Run stylelint run: npm run stylelint:scss From 51fee9d55ab8c9cc81a6b02077f95baaa44f2939 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 10 Mar 2023 12:33:12 -0500 Subject: [PATCH 4/4] Remove SKIP_PREPARE env variable usages --- .github/workflows/lint.yml | 2 -- .github/workflows/tsc.yml | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 498d800fe..4d8519501 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,8 +24,6 @@ jobs: - name: Install Node.js dependencies run: npm ci --no-audit - env: - SKIP_PREPARE: true - name: Run a production build run: npm run build:production diff --git a/.github/workflows/tsc.yml b/.github/workflows/tsc.yml index be0f2596a..2b1b3bf59 100644 --- a/.github/workflows/tsc.yml +++ b/.github/workflows/tsc.yml @@ -24,8 +24,6 @@ jobs: - name: Install Node.js dependencies run: npm ci --no-audit - env: - SKIP_PREPARE: true - name: Run tsc - run: npm run build:check \ No newline at end of file + run: npm run build:check