Let's say I have a monorepo workspace with multiple packages.
I want to build each package independently, and then traverse the dependency tree and build the children of the package.
However, I want to target the exec in such a way that it only runs if the package files have changed.
E.g. run pnpm build inside packages/foo but only if files in packages/foo/* have changed and then cache that layer.
Then I would use this layer and run build in the package bar that uses foo and again, only if the files in bar have changed, otherwise reuse cache.
Effectively, what I am trying to say is how to compute a layer cache key based on some pattern of globs, similar to how turborepo does it.
Thanks!