sbs20 / scanservjs

SANE scanner nodejs web ui
https://sbs20.github.io/scanservjs/
GNU General Public License v2.0
689 stars 137 forks source link

Arch AUR Package #660

Closed sbs20 closed 7 months ago

sbs20 commented 8 months ago

With version 3 coming up, there are some notable changes to the overall build.

  1. It is now updated to use vue3 annd vite - so no more webpack; this makes everything compatible with Node 18 and beyond - not to mention much faster to build.
  2. the distribution asset will be a .deb package. This an ar archive with some nested tarballs and installation scripts

Before everything is committed to mainline and released I wanted to see if there was anything I could do to make things better or easier for the Arch AUR maintenance.

dadosch commented 8 months ago

Hi, so I've noticed that the systemd service has been integrated into the Debian packaging script, but this is not a problem, since I can just put the service inside the AUR git repo (and I suppose there won't be any big changes there). Also as I am not totally fond with vue and npm in its specifics, I want to verify that the building commands looks correct to you:

npm run build:version && npm run build --workspaces && node build.js --assemble npm install --production

I've adopted the PKGBUILD file, and it builds succesfully, but I didn't have time yet to test it.

sbs20 commented 8 months ago

Ah yes, the build.

This might be useful

The minimum you need to do is:

# Run clean-install instead of just npm install - you can google the behaviour but
# in short it's faster and more reliable for deployment
npm clean-install .

# You can just do this instead which will call the same commands you added above
npm run build

# This is the final step for you though which is to install the node_modules you need
# only at runtime. See:
# https://github.com/sbs20/scanservjs/blob/f25d6ceec45f7b8318219ccf50a40b1e745e60e9/makedeb.sh#L37
npm clean-install --omit=dev --only=prod --loglevel=error --prefix dist

So your build becomes the following (diffed from AUR):

build() {
    cd scanservjs-${pkgver}

-    export NODE_OPTIONS=--openssl-legacy-provider
-    npm run install
+    npm clean-install .
    npm run build

-    cd dist
-    npm install --production
+    npm clean-install --omit=dev --only=prod --loglevel=error --prefix dist
+
+    # Get rid of map files (only used for development debugging)
+    find dist/node_modules -name "*.map" -type f -delete
}

I'm still a little way off actually releasing this new version, but wanted to keep you in the loop.

Thank you so much for your help. It assisted with #662!

Also you may wish to take depends and optdepends from Depends and Recommends here

sbs20 commented 7 months ago

Closing because there's nothing more I can do here. If you need any assistance drop a note here and I'll do whatever I can to help.