Fork me on GitHub
#boot
<
2017-07-30
>
richiardiandrea10:07:41

so this use case came up a couple of times already and it might be nice to think of a solution: I need a way to map back from a boot file in .boot/cache to a project file. I don't think we have that at the moment, do we?

richiardiandrea10:07:45

In particular for resources or assets, once you add things to the fileset, the conversion to roles loses information and you will only have a file path that is relative to a cache folder, to exemplify in boot-figreload I see:

{:relative-path "store.js",
 :dir-path "/home/arichiardi/.boot/cache/tmp/home/arichiardi/git/figreload-demo/5hc/fwjp2k",
 :full-path "/home/arichiardi/.boot/cache/tmp/home/arichiardi/git/figreload-demo/5hc/fwjp2k/store.js"}
where store in reality is in assets/store.js

richiardiandrea11:07:55

the current hack/solution is to use fake.class.path and kind of reverse engineer it

richiardiandrea11:07:26

but if we could store some meta along of course we would avoid that, open to ideas!

juhoteperi12:07:54

@richiardiandrea I have thought about this, but the metadata would be lost when a task modifies the file

richiardiandrea14:07:09

right, so we'd need a persisted way to have this info, for instance now the blob file name contains hash and time, we could encode the info in the file name as well (I have never seen big paths anyway). So the blob name could become something like src.hash.time

richiardiandrea14:07:21

or assets.hash.time

richiardiandrea14:07:02

don't know, again just brainstorming šŸ˜„

richiardiandrea16:07:46

Also @kommen there is a SHAPSHOT out solving the dreaded is not a relative file issue on our side

Chris Bidler22:07:31

I am losing my tiny little mind over this problem - I have written a custom tag reader to shoehorn ā€œplease fetch that db connect string from the environmentā€ into an EDN file as #my-project/config "DB_CONNECT_URI"

Chris Bidler22:07:50

I have src/data_readers.clj containing {myproject/config my-project.readers/get-config} and a src/my_project/readers.clj that declares the my-project.readers ns and has a (defn get-config ...) in it

Chris Bidler22:07:18

aaaaand Iā€™m pretty sure I just figured out that the problem was that data_readers.clj actually said {my-project/config my*_*project.readers/get-config} by going to copy the exception I was seeing

Chris Bidler22:07:54

indeed. Thanks for being my rubber duck, again, Slack friends! šŸ˜