gbv / wikidata-jskos

Access Wikidata in JSKOS format
https://coli-conc.gbv.de/services/wikidata/
MIT License
7 stars 3 forks source link

Include package-lock.json in source control #59

Closed stefandesu closed 4 years ago

stefandesu commented 4 years ago

This was the cause for #58 and I'm copy-pasting my reply here as a separate issue:


If you had tried any other mapping, or looked at the network response, you would have seen that it was an issue with our instance. First of all, I temporarily fixed it by installing the dependencies on our instance and restarting it. Here's the problem:

I see three different possibilities to fix this:

  1. Include package-lock.json in this repo.
  2. Adjust our server so that either npm install is used always, or that it checks whether package-lock.json is part of the repo and uses that to decided whether to use npm install or npm ci.
  3. Use npm install --no-package-lock on the server so that a package-lock.json is never generated.

I'm voting for 1. package-lock.json is intended to be included in source control by design. The arguments against using it are either not convincing or only refer to packages that are used as dependencies by other applications (so it doesn't apply to wikidata-jskos). I'm voting for including the file and always using npm ci to install dependencies, except if the purpose is to update the dependencies (because then the updated package-lock.json will be committed).

I will still implement 3. because it fixes the immediate problem, but I'm also voting for 1. for all our projects. We have the package-lock.json file in source control in most of our repos anyway.

Relevant post on StackOverflow: https://stackoverflow.com/a/56254478