Remove stray top-level prepare key from package.json - #133
Merged
Conversation
npm only reads lifecycle scripts from `scripts`, so this key never ran. It was also self-referential — `npm run prepare` calling `prepare` — so anyone moving it into `scripts` to "fix" it would have replaced the working script with an infinite loop. Verified inert: `npm pack --dry-run` lists the same nine files before and after, and the real `scripts.prepare` still runs.
✅ Deploy Preview for image-compare-component ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
package.jsoncarried apreparekey at the top level, outside thescriptsblock. npm only reads lifecycle scripts fromscripts, so it never ran — the realscripts.prepareis what executes on install and publish, and it's correct. The problem is that the stray key is self-referential ("prepare": "npm run prepare"), so anyone who noticed it and "fixed" it by moving it intoscriptswould have replaced a working build script with an infinite loop. Deleting it removes that trap.Since the whole claim here is that the key was inert, I confirmed it rather than assuming:
npm pack --dry-runlists the same nine files before and after, and thepreparelifecycle still runs the build and doc generation as it did.Screenshots
Testing
npm ci— installation should complete normally, running the build and generating the manifests along the waynpm test— 53 tests should passnpm run prepareon its own — it should builddist/and regeneratemanifests/, then exit rather than loopingCloses #131