I know the main point of having .lock files is that they contains specific versions of packages (whereas package.json can specify ranges), so that when you install the same project on different machines, you can guarantee the same versions of packages.
What I Want To Know:
When is package.json used and when is package-lock.json used? For instance, if the bundler finds a package.json file but no package-lock.json file, does it use package.json and create package-lock.json, but use package-lock.json if it finds it? If that's the case, then am I correct that if you never re-generate package-lock.json, even when you run npm install
the bundler won't install the latest version of packages allowed by semver ranges in package.json, and rather just install the specific versions from package-lock.json?