Skip to content

feat: allow configuring load_paths for non-Rails (Zeitwerk) apps#467

Open
swiknaba wants to merge 3 commits into
Shopify:mainfrom
swiknaba:main
Open

feat: allow configuring load_paths for non-Rails (Zeitwerk) apps#467
swiknaba wants to merge 3 commits into
Shopify:mainfrom
swiknaba:main

Conversation

@swiknaba

@swiknaba swiknaba commented Jul 11, 2026

Copy link
Copy Markdown

What are you trying to accomplish?

I want to use it in my non-Rails (but Zeitwerk) apps. Packwerk is like 99% there already. This adds the last missing piece to run the check without loading Railties.

What approach did you choose and why?

There was actually just 1 part that blew up when running this on a non Rails app: file path resolution relied on the Rails load path. It now allows to define load paths in the packwerk.yml file.

I also noticed two other minor bugs that blew up when Rails wasn't present. See commit messages :)

=> POC here: swiknaba/kirei#39

=> if #410 get's merged, my PR should be trivial to update. Would need to return a Zeitwerk::LOader object instead of the Hash[String, Module].

=> #447 makes my PR obsolete if I see it right, since it also removes any hard dependency on Railties. Feel free to discard my PR if 447 gets merged soon anyway.

What should reviewers focus on?

no clue what to write here. Tiny change I believe. Thanks for making this open source <3

Type of Change

  • Bugfix <= two tiny 1-liner fixes snugged in
  • New feature <= main thing here
  • Non-breaking change (a change that doesn't alter functionality - i.e., code refactor, configs, etc.)

Additional Release Notes

  • Breaking change (fix or feature that would cause existing functionality to change)

Include any notes here to include in the release description. For example, if you selected "breaking change" above, leave notes on how users can transition to this version.

If no additional notes are necessary, delete this section or leave it unchanged.

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • It is safe to rollback this change.

Before

=> from my dummy test app, see link "POC" above

before-failing

After

=> from my dummy test app, see link "POC" above

after-works

@swiknaba

Copy link
Copy Markdown
Author

I have signed the CLA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant