Skip to content

Conversation

@fritzy
Copy link
Contributor

@fritzy fritzy commented Jan 19, 2022

THIS PR HAS BEEN MIGRATED

Originally from npm/arborist#342
Originally By @ylemkimon

This PR adds the ability to add a hook via options.hook. It adds a single hook options.hook[Symbol.for('beforeReify')](Arborist), that runs after this[_loadTrees]() but before this[_reifyPackages](options). Other hook can be added later, with backward compatability.

Sometimes in a project, there is a need to enforce some policies on dependencies used in the project or mutate the tree. However, npm or Arborist doesn't provide a way to hook into its process.

References

Related to npm/rfcs#460

Other package managers

@fritzy fritzy requested a review from a team as a code owner January 19, 2022 00:49
@fritzy fritzy added the ws:arborist Related to the arborist workspace label Jan 19, 2022
@fritzy fritzy changed the title feat(reify): add an ability to add a hook feat(arborist)(reify): add an ability to add a hook Jan 19, 2022
@darcyclarke darcyclarke added Agenda will be discussed at the Open RFC call Needs Discussion is pending a discussion Needs Review semver:minor new backwards-compatible feature labels Jan 25, 2022
@wraithgar wraithgar changed the base branch from latest to release-next January 26, 2022 20:43
@darcyclarke darcyclarke removed the Agenda will be discussed at the Open RFC call label Feb 23, 2022
@wraithgar wraithgar changed the base branch from release-next to latest March 9, 2022 18:24
@npm npm deleted a comment from npm-robot Jun 1, 2022
@fritzy fritzy force-pushed the latest branch 2 times, most recently from 3037d35 to f3b0c43 Compare September 14, 2022 23:09
@saquibkhan
Copy link
Contributor

closing this PR as its around 1 year old now

@saquibkhan saquibkhan closed this Mar 1, 2024
@lukekarrys lukekarrys deleted the ylemkimon/hooks branch April 29, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Discussion is pending a discussion semver:minor new backwards-compatible feature ws:arborist Related to the arborist workspace

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants