From b5aa10e79b2cc97e38ca5a5eedcc25337014d50f Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Mon, 3 Jul 2023 11:56:27 +0100 Subject: [PATCH] Ensure README is packaged and use npm ci --- .github/workflows/publish-docker.yaml | 4 ++-- rollup.config.js | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/publish-docker.yaml index 8a09d58c..4cb8c0f6 100644 --- a/.github/workflows/publish-docker.yaml +++ b/.github/workflows/publish-docker.yaml @@ -44,12 +44,12 @@ jobs: - name: Build app with src bundle if: github.event.inputs.target == 'ghpages' || github.event_name == 'push' run: | - npm install + npm ci npm run build-src - name: Build app with production bundle (src bundle also provided) if: github.event.inputs.target == 'docker' || github.event_name == 'release' run: | - npm install + npm ci npm run build echo "After deployment the production app will be available at https://pwa.kiwix.org" - name: Build docker image and push diff --git a/rollup.config.js b/rollup.config.js index 316e1f7a..37a10787 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,3 +1,4 @@ +/* eslint-disable object-property-newline, object-curly-newline */ // rollup.config.js import resolve from '@rollup/plugin-node-resolve'; import babel from '@rollup/plugin-babel'; @@ -42,7 +43,7 @@ const config = { copy({ targets: [ { src: ['www/js/lib/*dec-wasm.wasm', 'www/js/lib/libzim-asm.js', 'www/js/lib/libzim-wasm.*', 'www/js/lib/darkreader.min.js', 'www/js/lib/webpHeroBundle*', '!www/js/lib/libzim-wasm.dev*'], dest: 'dist/www/js' }, - { src: ['archives', 'images', 'index.html', 'manifest.json', 'package.json', 'LICENSE', 'CHANGELOG.md', '*.appxmanifest', '*.pfx', '*.cjs', 'Package.StoreAssociation.xml'], dest: 'dist' } + { src: ['archives', 'images', 'index.html', 'manifest.json', 'package.json', 'LICENSE', 'CHANGELOG.md', 'README.md', '*.appxmanifest', '*.pfx', '*.cjs', 'Package.StoreAssociation.xml'], dest: 'dist' } ], flatten: true }) @@ -72,10 +73,10 @@ if (process.env.BUILD === 'production') { // Link the html to the new bundle entry point transform: (contents, filename) => contents.toString() // Uncomment the bundle link - .replace(//, "$1") + .replace(//, '$1') .replace(/bundle\.js/, 'bundle.min.js') // Comment out the old app.js link - .replace(/(