duct-framework / duct

Server-side application framework for Clojure
MIT License
1.13k stars 51 forks source link

Base config.edn dev profile include conflicts with other libraries artifact name #112

Open lucassousaf opened 1 year ago

lucassousaf commented 1 year ago

The base config.edn declares two profile includes for dev and local .

 :duct.profile/dev   #duct/include "dev"
 :duct.profile/local #duct/include "local"

This is a problem for artifact names that start with either dev or local.

For example, if you include the following library to your project: [dev.gethop/sql-utils "0.4.13"]

When duct starts reading the configuration it will throw the following exception:

Execution error at integrant.core/read-string (core.cljc:155).
EOF while reading

We think the root of the problem is this line in the core library. Because if you run the following:

dev> (io/resource "dev")
#object[java.net.URL 0x482a879d "jar:file:/home/hop/.m2/repository/dev/gethop/sql-utils/0.4.13/sql-utils-0.4.13.jar!/dev"]

you can see that the return value is not the expected one from the duct point of view.

We think that the #duct/include for profiles in the base config of the duct template, should point to existing files explicitly. For example dev.edn and local.edn. That means changing the following lines in the base config of the duct template:

 :duct.profile/dev   #duct/include "dev.edn"
 :duct.profile/local #duct/include "local.edn"

What do you think? Is there are reason for having just dev and local instead of specific file names and extensions?