davestewart / alias-hq

The end-to-end solution for configuring, refactoring, maintaining and using path aliases
https://davestewart.co.uk/projects/open-source/alias-hq/
MIT License
330 stars 11 forks source link

CI Integration #26

Closed FlorianWendelborn closed 1 year ago

FlorianWendelborn commented 3 years ago

Is there any way to set-up alias-hq CLI as a CI tool?

Basically, I’d want to use GitLab pipelines to run alias-hq and fail if a path alias is not used, to enforce that the entire project always uses them.

So, the requirements would be:

  1. Run some sort of command (e.g. yarn run alias-hq --check)
  2. Command uses exit code 1 if some issue was found
  3. Command uses exit code 0 if no issue was found

Thanks for the tool BTW, really useful and well-done

davestewart commented 3 years ago

Hey Florian,

Thanks for the kind words!

So I don't know much about CLI / Pipelines, but if I understand you correctly, you'd like to:

I haven't worked on this for a good few months, but I don't see why that wouldn't be possible.

I don't have much time at the moment, which is a problem (I have an existing PR for renaming aliases which I've not touched in months too!)

I'd be happy for you to submit a PR though. The codemod side of things is surprisingly straightforward; I'd be happy to help you if you needed it.

davestewart commented 3 years ago

Looking at file which sets up the source transforms:

If newPath is returned, it means the import / require could be simplified, so I presume at this point you would want to exit with code 1.

One of the surprisingly challenging bits of this project was working out how best to ask questions and how best to preview and report results, so I suspect you might also want to think about that, rather than just exiting?

davestewart commented 3 years ago

Any more interest in this @FlorianWendelborn or should I close the issue?

FlorianWendelborn commented 3 years ago

@davestewart I’d say neither. I don’t have the time right now to develop this, but I still think it’s a useful/vital piece of what this software should be able to do. I’d hope that tagging it as Help Wanted, one day someone will have time to submit a PR.

davestewart commented 3 years ago

Sure. I'm also busy, but I'll leave this open and maybe find time to do it when I need a break from something else!

davestewart commented 1 year ago

Closing as stale / not high priority. Feel free to reopen!