headlamp-plugin: Fix template/package-lock.json handling #4163
+109
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There were some bugs in how it uses a package-lock.json distributed with the headlamp-plugin to speed up installs. Now it generates a valid template package-lock.json and the install works properly.
There is a circular dependency on the integrity field when including the package-lock.json inside the package. Because it refers to itself. The digest can't be generated and included in itself when it relies on itself.
So when creating a new package we make sure we get the integrity field from the npm registry and then update the package-lock.json before "npm ci" is run. This way "npm ci" has the correct integrity field and can run quickly.
Testing
npx --yes @kinvolk/[email protected] create myplug --version=0.13.0-alpha.14Here it is creating a new plugin.
