Open absynce opened 2 years ago
If you only want to install a few files in a folder, but not all, move those files to a new folder and install the folder.
elm-codegen install codegen/helpers-to-install/
Mm, good catch!
I wonder if I should just remove the recommendation to install single files. Installing a whole folder seems to be more sustainable goin forward. Thoughts?
It would simplify things by using the built-in configuration Elm provides with the source-directories
config. Especially since the installed file/folder is copied into generated
.
My original intent was to install a module from src/
. I realized there's a second problem with that. Since I have both src/
and generated/
in my source folders, it finds two (2) of the module with the same name. By using a separate folder, I can withhold it from the main application's source-directories
config, knowing it will be copied into generated/
instead.
I don't know if it would be within scope, but it might be helpful if the CLI were to throw an error if someone tries to install a file or folder that comes from the main application's source-directories
. Then it could suggest this alternative approach.
My solution has been to move the root files into the traditional src
directory and to just copy-pasta things around after any elm-codegen
install.
Moving things around to a folder to install as a whole helps but I still get a warning from either Elm or Elm Language Server that I have a nested source-directory setup
EDIT I think what I'm referring to is a slightly separate issue.
Overview
Installing a local file inside of a directory fails when
run
is called.This follows the pattern in the install help guide:
SSCCE project: https://github.com/absynce/elm-codegen-local-import-error.
Expected behavior
elm-codegen install codegen/helpers/LocalFile.elm
creates helper. Then it runs withelm-codegen run
.Actual behavior
elm-codegen install codegen/helpers/LocalFile.elm
creates helper. Then it errors withelm-codegen run
.To reproduce inside SSCCE project
Error
Full stacktrace
System info: