workspace.ednin a text editor and set
createcommand is also added to git, which will come in handy in this example (normally we will leave the setting as it is).
poly info- using the compiled version of the tool.
clojure -M:poly info- using Clojure CLI from the workspace directory.
clojure -Tpoly info- as a Clojure CLI Tool
deps.edn. If we don't, then tools.deps and the development environment will not recognize our newly created component, which would be a pity! The tool leaves this task to you as a developer, with the idea to give you as much control as possible (files are only edited by you, not by the tool).
deps.ednfiles, because no projects have been created yet.
development/srcdirectory still has to be specified as a path):
components/user/srcas a source directory in the IDE (it will not be marked as green). This is also why we use the first form in this example.
resourcesdirectory from a brick, without updating
:extra-pathsbecause we use Cursive in this example.
./deps.ednto be able to run the tests.
deps.ednfile that looks like this:
testdirectory and will later be needed by the projects that include this component.
usercomponent and one
userinterface but no base (yet). Components and bases are referred to as
bricks(we will soon explain what a base is). The cryptic
st-will be described in the flags section.
Note: Use the copy icon when copying the text from these examples, otherwise all the lines will be copied into one single line, and the "new line" characters will not be included. If you use Firefox, you need to switch to another browser (it doesn't work in Firefox).
corenamespace, which is the recommended way of structuring the code in Polylith. Here we put all our implementing code in one single namespace, but as the codebase grows, more namespaces can be added to the component when needed. The implementing
corenamespace can be renamed to something else, but here we choose to keep it as it is.