guybedford / chomp

'JS Make' - parallel task runner for the frontend ecosystem with a JS extension system.
https://chompbuild.com
Apache License 2.0
143 stars 7 forks source link

Feature: Single-level interpolation #100

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

It could be valuable to support distinguishing between deep globbing interpolation and single level interpolation (** v *) via eg ## and #.

The suggestion would be to rename the current form to ## so that:

[[task]]
target = 'lib/##.js'
dep = 'src/##.ts'

would mean that deep folders can be globbed and output by the interpolation.

Then single level interpolation would be #:

[[task]]
target = 'lib/#.js'
dep = 'src/#.ts'

Using a # in target or dep and a ## in the other would throw an error informing to use one or the other form.

I hope this wouldn't be too confusing, and it's an unfortunate early breaking change, but it seems like the right direction for interpolation for me, while retaining its linear and reversible properties.