Build recent maps version

It is just a simple and maybe dumb question:

How can i build the recent version of maps?

Before i just cloned the git repository and made a “make” inside and all was fine. But now it tells me “there is no rule for make” and thats it.

Can someone please just tell me how this works? :grinning_face:

They remove the makefile here:

I don’t know, is krankerl a build system? Just after that there is already someone with a problem on the build system ([Bug]: can't build v1.7.1 with npm>10 due to missing packages in lock file · Issue #1623 · nextcloud/maps · GitHub), perhaps just open a bug report and ask to update the documentation.

Yes, they use krankerl.

Best look at the krankerl toml file. There are the steps to setup the app during deployment. If you want to debug, you might want to modify these.

Chris

Looks like “make” was replaced with:

composer install --no-dev -o
npm ci
npm run build

That allowed me to build a working version!
The only “problem” is that it’s now very big.

Thank you all!

Are you thinking of an installation for productive use? In that case, you can get rid of a few folders. Foremost the node_modules which is build during npm ci. Also, there is typically folders src and tests that can be removed. These are needed during development but once you built everything in the Frontend npm run build, the node_modules and src are transpired into js and css.

Tests and vendor-bin are for backend testing and development (PHP) but not needed on productive instances.

There might be more files but these are the big (in terms of number and size of files).

PS: Sorry, I forgot to send this post to you in time. It was already pre-written but obviously forgotten when my browser was closed.

Yes i am trying to build a working version for “production” (although that’s a bit of an exaggeration—it’s just for my personal use. :wink: )
Maps wasn’t really usable anymore, so i almost have to build a “daily build.”

So this means i can remove this folders:

  • node_modules (504M!)
  • src (672K)
  • tests (2.6M)

Right?

Typically yes. Here is whats inside (at least unless the original authors did nasty things):

  • node_modules is not part of the sources. It is completely rebuild upon npm ci. So, you can safely delete it. It contains the sources of all JavaScript dependencies the app uses.
  • src are the app-native sources of the frontend. Together with the node_modules, npm run build will run Vite (or Webpack ?) on the sources and build js and css assets. These assets are the files, you need in the browser. The sources (aka in src) are not needed unless you want to debug or develop.
  • tests are the PHPUnit test files. Not needed to run the app.

You can look if there is a .krankerlignore file somewhere. If yes: this is the list of files to not be deployed and thus safely removed.

Depending on your exact setup, you could safe yourself a bit of trouble. If you have SSH access and the NPM environment is on the server, you could just keep the git repo checked out and the JS sources (src and node_modules) there. Then, you can avoid the npm ci and the app is directly usable. This would make the update eventually simpler. npm ci is only needed, when you need to update the dependencies (aks as you pull new version of package-lock.json).