Skip to content

Use assets config path relative to app root in assets command#381

Merged
timriley merged 2 commits intohanami:mainfrom
haileys:assets-config-relative-path
Feb 6, 2026
Merged

Use assets config path relative to app root in assets command#381
timriley merged 2 commits intohanami:mainfrom
haileys:assets-config-relative-path

Conversation

@haileys
Copy link
Contributor

@haileys haileys commented Feb 4, 2026

A little context first because this is a weird one: I have a somewhat ..unorthodox node.js setup on my dev machines where node, npm, etc. are wrapper scripts that transparently run node stuff in a container where only the essentials are mounted in. Usually this just works, and surprisingly well too, but it does mean that workspace path node sees is not the same as the workspace path outside of the container. Most stuff I run seems to use relative paths so this hasn't really been an issue.

The hanami assets command invokes node with an absolute path however, and my weird setup breaks. I did a bit of digging and it looks like assets-js already assumes cwd == app.root, so I think it should be safe also assume cwd == app.root here in the assets command, and invoke node with a path relative to the app root.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

ℹ️ Optional job failed: Ruby jruby

@timriley
Copy link
Member

timriley commented Feb 4, 2026

Thanks @haileys! This looks like a fair change to me, and I'd be happy if we can support your setup :)

Looks like the tests are failing due to the changed paths. Would you mind adjusting those?

@haileys haileys force-pushed the assets-config-relative-path branch from 1af6dd0 to a577fc5 Compare February 4, 2026 22:11
@haileys haileys force-pushed the assets-config-relative-path branch from a577fc5 to bee56aa Compare February 4, 2026 22:12
@timriley
Copy link
Member

timriley commented Feb 6, 2026

Thanks again @haileys! I'm going to release this today to help you stay unblocked :)

@timriley timriley merged commit 99e7f9f into hanami:main Feb 6, 2026
13 checks passed
@timriley
Copy link
Member

timriley commented Feb 6, 2026

Released in v2.3.5 🎉

@haileys
Copy link
Contributor Author

haileys commented Feb 6, 2026

Thank you!

@haileys haileys deleted the assets-config-relative-path branch February 6, 2026 05:48
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.

2 participants