Skip to content

rfc: Hook script linking#48

Closed
lachlanhunt wants to merge 1 commit into
npm:mainfrom
lachlanhunt:hook-script-linking
Closed

rfc: Hook script linking#48
lachlanhunt wants to merge 1 commit into
npm:mainfrom
lachlanhunt:hook-script-linking

Conversation

@lachlanhunt

Copy link
Copy Markdown

No description provided.

@isaacs

isaacs commented Aug 29, 2019

Copy link
Copy Markdown
Contributor

My main concern to investigate would be timing during installation.

Ie, if you npm install, and one of the packages being installed adds a preinstall hook, does it fire for the modules installed afterwards? If it adds a postinstall hook, does it fire for itself?

Even if we're ok with whatever the current default behavior would be, I'd like it documented so we don't break folks later by changing some undefined behavior.

@wesleytodd

wesleytodd commented Nov 18, 2019

Copy link
Copy Markdown

Since there can be only one file of each name (each of the predefined list of hook scripts), you would need some resolution logic to determine which to link wins or how to call them all (possibly changing the way that feature works today). Also, allowing any hook from any direct or transitive dep to be called for every installed dependency just by defining one in its package.json seems like an unintended (or at least unexpected) behavior.

Maybe I am not seeing the clear path forward for this RFC, but it seems like it is missing some large issues as it is defined today.

@darcyclarke

Copy link
Copy Markdown
Contributor

Closing this as hook scripts were removed in v7

owlstronaut pushed a commit that referenced this pull request May 29, 2026
Bot-generated transition of RFC **#48** to status `implemented`.

Moved to `implemented/0048-no-integrity-for-git.md`. Front-matter
`status` and the relevant date field were updated. `INDEX.md` was
regenerated.

Implementation: npm/cli#4468

Co-authored-by: npm CLI robot <npm-cli+bot@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement new feature or improvement Needs Discussion is pending a discussion Needs Documentation pull request requires docs before merging semver:minor new backwards-compatible feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants