The Polylith documentation can be found here:
You can also get in touch with the Polylith Team on Slack.
- docker
- poly -
brew install polyfy/polylith/poly
- psql -
brew install postgresql
- clj-kondo -
brew install borkdude/brew/clj-kondo
- zprint -
brew install --cask zprint
- see https://cljdoc.org/d/polylith/clj-poly/0.2.19/doc/development
- some notes for Cursive
- select the Aliases
dev, test
- Go to
Settings→Languages & Frameworks→Clojure→Project Specific Options and check "Resolve over whole project"
to make things resolve correctly across different subprojects with our rootdeps.edn
setup
- select the Aliases
- run
bin/docker-up.sh
- start a clojure nrepl with opts
-A:dev:test
- the dev system will start on its own via loading
components/development/user.clj
- go to http://localhost:9000/api-docs/ to see endpoints and send requests from your browser
You can create a pre commit hook to lint and format files before they are committed
touch .git/hooks/pre-commit
- add contents
#!/usr/bin/env bash
if ! (./bin/zprint-diff.sh)
then
exit 1
fi
./bin/kondo-diff.sh
exit $?
chmod +x .git/hooks/pre-commit
You can force a commit through if you want with the --no-verify
flag
poly libs
- see project dependenciespoly libs :outdated
- see outdated dependenciespoly libs :update
- update dependencies
building block that encapsulates a specific domain or part of the system
poly shell
create component name:user
- add component to
<root>/deps.edn
{:aliases {:dev {:extra-paths ["development/src"]
;; to extra dev deps
:extra-deps {poly/user {:local/root "components/user"}}}}
;; to extra test paths
:test {:extra-paths ["components/user/test"]}}
info
building block that exposes a public API to the outside world, e.g., external systems and users
poly shell
create base name:web
- add base to
<root>/deps.edn
:aliases {:dev {:extra-paths ["development/src"]
;; to extra dev deps
:extra-deps {poly/web {:local/root "bases/cli"}}}
;; to extra test paths
:test {:extra-paths ["bases/cli/test"]}}
used to build a deployable artifact
poly shell
create project name:backend
- add project to
<root>/workspace.edn
{:projects {"backend" {:alias "backend"}}}
- add components and bases to
<root>/projects/backend/deps.edn
{:deps {poly/user {:local/root "../../components/user"}
poly/web {:local/root "../../bases/cli"}}}