Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Add a hook command to netlify-dev #187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add a hook command to netlify-dev #187

wants to merge 2 commits into from

Conversation

biilmann
Copy link
Member

- Summary

Add a netlify dev:hook <Hook Name> command

- Test plan

Projects with a [dev.hooks] setting in their netlify.toml file will be able to trigger the commands
specified in those hooks via netlify dev:hook <Hook Name>

As an example, a section like this in the netlify.toml file:

[dev.hooks]
  Contentful = "npm run fetch-contentful-data"

Would define a hook that can be triggered via netlify dev:hook Contentful to refetch data.

Once we have this feature in place and testable in netlify dev, we can tie it into Netlify's general inbound webhook system and allow netlify dev to listen for inbound hooks so the dev server rebuilds on external data source changes. Especially useful with netlify dev --live

- Description for the changelog

Add a netlify dev:hook <Hook Name> command

- A picture of a cute animal (not mandatory but encouraged)

main-qimg-79c4206d7b80619b39a92b1efe296ed3

@swyxio
Copy link
Contributor

swyxio commented May 19, 2019

regarding the concept of hooks:

someday we will want an [addons] field in netlify.toml as well. it seems that we'll probably want addons to be able to define their own hooks and automatically set it up instead of duplicate. i considered proposing merging the concept of addons and hooks but i think they are different enough that they should be separate concepts.

anyway, just noting that there is likely to be some correspondence between hooks and addons, although there will be addons with no hooks and hooks with no addons.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants