ojkelly / yarn.build

Build 🛠 and Bundle 📦 your local workspaces. Like Bazel, Buck, Pants and Please but for Yarn Berry. Build any language, mix javascript, typescript, golang and more in one polyglot repo. Ship your bundles to AWS Lambda, Docker, or any nodejs runtime.
https://yarn.BUILD
MIT License
325 stars 28 forks source link

yarn build --since <commithash>|<numberof commits> not building anything. #228

Open cmark1302 opened 2 years ago

cmark1302 commented 2 years ago

Describe the bug yarn build --since with commit hash or number of commits are not working

Also, it shouldn't build the dependencies. Instead it should do other way round (Let's say if package file got changed, then we should build whoever(apps) using the package

To Reproduce Steps to reproduce the behavior: yarn build --since | yarn build --since 2 [ Summary ]--------------------------------------------------------------------- Success: 0 Fail: 0 Skipped: 0 Up to date: 0 Total: 0

Runtime (wall): 0.01s [ build finished ]-------------------------------------------------------------- ➤ YN0000: Done in 0s 12ms

Expected behavior build should happen

Desktop (please complete the following information):

cmark1302 commented 2 years ago

@ojkelly

It started to partially work after adding --relative as an argument to git diff. However, building dependencies is still an issue

https://github.com/ojkelly/yarn.build/blob/main/packages/plugins/shared/src/changes.ts#L14 https://github.com/ojkelly/yarn.build/blob/main/packages/plugins/shared/src/changes.ts#L17

    if (options.commit) {
      cmd = `git diff --name-only --relative ..${options.commit}`;
    }
    if (options.sinceBranch && options.sinceBranch.length > 0) {
      cmd = `git diff --name-only --relative ${options.sinceBranch}...`;
    }
ojkelly commented 2 years ago

Do you think it would be valuable for you also to be able to do something like yarn build --diff $ where the result is just passed to git diff directly?

I'm also working on a cleaner and better tested approach to determining what to build, that is working to address this.

cmark1302 commented 2 years ago

Yes. that sounds good