This PR updates Calliope’s internal watch task to use whatever task is currently registered with Gulp with a given name, instead of attempting to require a file with that name.
Motivation / Context
The current strategy assumes that the task being processed is defined within Calliope itself, which is not always the case. In the case of a custom pipeline defined in a downstream project, the start command fails catastrophically. Arguably worse, in the case of a pipeline task override, the process simply picks up Calliope’s local task and uses that to generate files instead of the downstream project’s override.
Testing Instructions / How This Has Been Tested
Two options here:
Trust me and the screenshots below.
Trust me, yet still check this yourself locally.
If you’re still reading: congratulations! Here’s what you need to do:
Description
This PR updates Calliope’s internal
watch
task to use whatever task is currently registered with Gulp with a given name, instead of attempting to require a file with that name.Motivation / Context
The current strategy assumes that the task being processed is defined within Calliope itself, which is not always the case. In the case of a custom pipeline defined in a downstream project, the
start
command fails catastrophically. Arguably worse, in the case of a pipeline task override, the process simply picks up Calliope’s local task and uses that to generate files instead of the downstream project’s override.Testing Instructions / How This Has Been Tested
Two options here:
If you’re still reading: congratulations! Here’s what you need to do:
yarn link
from the root of this repo.chromatichq-eleventy
repo.chromatichq-eleventy
, run:yarn install
yarn start
- Confirm you see the error shown in the screenshots below (or the ticket).yarn link @chromatichq/calliope
yarn start
- Confirm you no longer see the error.yarn unlink @chromatichq/calliope && yarn install
- This is just to make sure you don’t forget to unlink it later.Screenshots
watch
appears to be trying to load an./eleventy
file relative to itself.yarn link @chromatichq/calliope
.Documentation
n/a