mogge
Mornin'... dang, it's been hard to get started on actual work this morning...
I know the feeling! Here the work day is almost over and, although I've been focused on work things for a few hours, it's troubleshooting unplanned work and not the work I wanted to get on with.
This is what has been distracting me: https://github.com/hashicorp/terraform-provider-aws/issues/49181
Sean, expectations is deprecated in favour of lazy-test. But lazy-test doesn't work with koacha. Unless it does?
Technically, Expectations is not yet deprecated, but I'm no longer working on it π
checking
looks like no
I've never used Kaocha and have no interest in it, sorry. It never even occurred to me that people would use Kaocha with Expectations.
What does Kaocha provide that you can't do with LazyTest's runner or my fork of Cognitect's runner (which can run both LazyTest and regular clojure.test-compatible stuff).
I don't know, as I don't run LazyTest
π
I'll stick with expectations and koacha.
LazyTest has an Expectations-compatibility mode but requires its own runner. Maybe, at some point, we can persuade the Kaocha team to support LazyTest?
I have LazyTest support in test-runner (Cognitect) and my Polylith external test runner...
Seems doable, but for another day π
expectations + kaocha work very well for us
(along with nubank matchers)
LazyTest supports the Nubank matchers too π
btw sean, having a lot of fun with deps-new, I've resurrected a project (template) that I'm bringing up-to-date, so that I can spit out a working project, with my favourite stack easily
Oh, cool!! LMK if you have any feedback/thoughts on improvements (docs or code).
Something that did bite me, until I groked it, is this. I wanted to use :raw on a directory (woff and woff2 font files - perhaps that can be added along with the existing image files...anyway)....these files were inside root/resources/templates/html/assets/fonts
I had this in my template.edn...
["resources/templates/html/assets/fonts" "resources/templates/html/assets/fonts" :raw] ;; binary data
didn't work, until I realised, I had to bring "fonts" up to the top-level directory, to sit beside src test and root
i.e., ["fonts" "resources/templates/html/assets/fonts" :raw] ;; binary data
I guess, it wasn't clear in the documentation I had to do that, since all the template examples only provide a "top-level" example, of one directory, not how to use :raw if one has a directory deep in the project "root" - one has to bring it up to sit beside src, test and root
i.e., now I have this:
drwxr-xr-x 4 david david 4 Jul 26 22:05 fonts
drwxr-xr-x 7 david david 14 Jul 29 18:38 root
drwxr-xr-x 7 david david 8 Jul 27 08:44 src
-rw-r--r-- 1 david david 438 Jul 27 17:25 template.edn
drwxr-xr-x 4 david david 5 Jul 29 18:15 testand it works grand now
Hmm, I would have expected a relative path like that to work... I wonder what prevents that?
When I had (the first example), the font files were being parsed by, looking for {{ and }} and natch, since they do coantain that (somewhere in the binary data), then strange stuff happened π
the fonts wouldn't render - firefox would complain about bad data.
.
Sounds like a bug to me. Can you create an issue with deets, so I can take a look when I get a chance?
np. I'l away for a couple of days, but will make a note to do that when I come back.
.
I think I figured out your issueβI commented in the issue. I couldn't actually figure out how best to test it since there's no README and the notes you gave in the issue are specific you your environment.
If I'm right about it, I suspect the docs around root need some clarification.
Thanks, I thought the github repo was reproduceable, but that's fine. I understood the gist, updated the issue and left a suggestion.
(it's a pity that deps don't allow shell expansion, like "$HOME")
:local/root can be relative which would address the different environment path issues π
I would like you to test my suggestion tho', to make sure that full path-to-path copying works as expected.
#78 looks great
I would be happy to oblige
will test full path-to-path copying now...
Yes, if I move resources to be top-level, sitting alongside template.edn, add this to my template.edn ["resources" "resources" :raw]]} ;; binary data, then when the project is created using clj -X:deps-new-2, the binary data, the woff files are copied across as-is.
My suggestion was full-path to full-path, not just top-level to top-level.
In that case, I don't follow
The whole point of this discussion (for me) was around deep path copying.
This (from you): ["resources/templates/html/assets/fonts" "resources/templates/html/assets/fonts" :raw] ;; binary data (with resources at the top, alongside root).
I want to eliminate any special case such as @fmjrey was curious about.
(esp. since the src path should have been "root/resources/templates/html/assets/fonts" in the first place, since you had it nested inside root)
TBH, even specifying root/resources/... might have been enough to fix this problem. That's really what needs to be tested.
Your path in your test project was just wrong, since there was no top-level resources folder to copy.
The source path was root/resources/templates/html/assets/fonts to begin with
I had a resources directory, within the root directory
Your project:
:transform [["src" "src/{{top/file}}" {"main.clj" "{{main/file}}.clj"}]
["resources/templates/html/assets/fonts" "resources/templates/html/assets/fonts" :raw]]} ;; binary dataI'm saying that "root/resources/..." in that second line might have fixed the problem. Because you had resources nested inside root and not at the top level.
I will try that now
None of the paths are relative to root, they are relative to the template "root". root is just a special folder inside the template "root" that you don't need to specify in the :transform since it is always copied.
Anything nested inside root needs root/ as a path prefix if you're adding additional transforms.
Oh I understand your comment now @seancorfield, the above 2 messages deserve their place in the doc
Putting the resources directory back under the directory called root, then changing my template.edn to be this:
["root/resources/templates/html/assets/fonts" "resources/templates/html/assets/fonts" :raw]]} ;; binary data
copied the files across as-is
Is that what you were looking to confirm?
IIUC that would mean fonts are copied twice, first with replace, second as raw, overwritting the altered files
Right, yes, but getting the src path correct in the first place would have "solved" this. That's what I wanted confirmed, in David's environment.
This all feeds into what I need to clarify in the docs. Thank you!
Sorry for being slow π
If there is anything else I can help you test, let me know π
Thanks. This has been great since it shows the docs are not clear enough.
I am enjoying deps-new, I've got it now so I can cookie-cut out my default project + stack easily
lowers my barrier of entry to try out new ideas
The Writing Templates docs have been substantially updated around "root" folder handling, and a new :raw-exts option has been added to template.edn to allows users to specify more file types that should be copied as-is. v0.13.0 is out with those changes.