poly
tool gives us access to the data structure that represents the workspace, which is the same structure that all the poly
commands operate on.poly ws get:keys
from the examples/doc-example
directory:poly ws get:bases:user-api
:interface-deps
Lists the interfaces each base depends on. Here it depends on the user
interface from the src
context. This is because the se.example.user-api.api
namespace imports se.example.user.interface
.test
context in this example.:lib-deps
Lists the library dependencies the base depends on, defined in the :deps
key in its deps.edn
file for the src
context, and the :aliases > :test > :extra-deps
for the test
context. The :size
is in bytes.:lib-imports
The name is a bit misleading as internal namespaces for the base is also included.src
Lists all imports from the src
context except component interfaces.test
Lists all imports from the test
context except component interfaces.:lines-of-code
The total number of lines of code for this base (all namespaces included).:name
The name of the directory for this base under the bases
directory.:namespaces
:src
Lists all the namespaces that live under the src
directory.:file-path
The absolute path to the namespace.:imports
Lists all its namespaces.:name
The name of the namespace where top namespace + base name (se.example
+ user-api
in this case) have been stripped away.namespace
The full name of the namespace.:test
Lists all the namespaces that live under the test
directory.:non-top-namespace
If the base contains any non-top namespaces, they will be stored in a vector with elements like this::non-top-ns
"com.wrong", :file
"bases/cli/src/com/wrong/cli/interface.clj"}:paths
The paths that are specified in its deps.edn
file (paths
for src
and resources
paths + aliases > :test > :extra-paths
for test
paths).:type
Set to "base".poly ws get:components:user
base
plus the :interfaces
key::interface
:definitions
Lists all public def
, defn
and defmacro
definitions in the interface namespace. If a type hint is given, then :type
will also be set and be part of the contract.:interface-deps
Lists the interfaces each component depends on. This component doesn't depend on any other interface.:lib-deps
Lists the library dependencies the component depends on, defined in the :deps
key in its deps.edn
file for the src
context, and the :aliases > :test > :extra-deps
for the test
context.:lib-imports
Lists all imports except component interfaces. The name is a bit misleading as internal namespaces for the component are also included.:lines-of-code
The total number of lines of code for this component (all namespaces included).:name
The name of the directory for this component in the components
directory.:namespaces
:src
Lists all the namespaces that live under the src
directory.:file-path
The absolute path to the namespace.:imports
Lists all its namespaces.:name
The name of the namespace where top namespace + component name (se.example
+ user
in this case) are stripped away.namespace
The full name of the namespace.:test
Lists all the namespaces that live under the test
directory.:non-top-namespace
If the component contains any non-top namespaces, they will be stored in a vector with elements like this::non-top-ns
"com.wrong", :file
"components/invoicer/src/com/wrong/invoicer/interface.clj"}​
:paths
The paths that are specified in its deps.edn
file (paths
for src
and resources
paths + aliases > :test > :extra-paths
for test
paths).:type
Set to "component".poly ws get:changes since:b339c35
:changed-bases
Lists the changed bases since the sha b339c35
(or last stable point in time if :since
is not given).:changed-components
Lists the changed components since the sha b339c35
(or last stable point in time if :since
is not given).:changed-files
The same list that is returned by poly diff since:b339c35
. The keys :changed-bases
, :changed-components
and :changed-projects
are calculated from this list.:changed-or-affected-projects
Lists the projects that are directly changed, e.g. its file deps.edn
or indirectly changed, e.g. if one of the bricks it incudes are changed.:changed-projects
Lists the changed projects since the sha b339c35
(or last stable point in time if :since
is not given).:git-diff-command
The git command that was executed to calculate the :changed-files
list.:project-to-bricks-to-test
A map that stores project names with a list of the bricks to test from that project if executing the test
command.:project-to-indirect-changes
A map that stores project names with a list of the bricks that are indirectly changed (directly changed bricks excluded). E.g. if components a
and b
are included in the project, and a
has not changed, but b
has changed and a
uses b
, then b
will be included in the list.:project-to-projects-to-test
A map that stores project names with a list of projects to test from that project if executing the test
command.:since
Set to "stable" if since:SINCE
is not given.:since-sha
The full sha if since:SINCE
was not given, e.g. b339c358079fa36ca20ed0163708ba010a0ffd4c
.:since-tag
The name of the tag, e.g. v0.1.0-alpha9
if since:release
was given.poly ws get:interfaces:user
:definitions
A list of the public def
, defn
and defmacro
definitions that are part of the interface.:name
the name of the def
, defn
or defmacro
definition. If it's a multi-arity function or macro, then each arity will be stored separately.:parameters
Set for functions and macros. Specifies the function/macro parameters::name
The name of the parameter.:type
If a type hint, e.g. ^String
is given then this attribute is set.:type
Set to data
, function
or macro
.:name
The name of the interface. In this case the bricks user
and user-remote
share the same user
interface and live in the se.example.user.interface
namespace.:type
Set to "interface".poly ws get:messages
hello
function from the user
component interface.:code
The code of the error or warning. To get a full list of existing codes, executepoly help check
.:message
The error message.:colorized-message
The error message using colors so the text can be printed in color.:components
Each error message can have extra keys/information, like affected components as in this case.type
Set to "error" or "warning".poly ws get:name
poly ws get:old ws-file:ws.edn
ws-file:WS-FILE
then the :old
key is populated.user-input
The user input from the original ws
file.:active-profiles
If any profiles are given, then this key is added with the value of :active-profiles
taken from the :settings
key from the original ws
file.poly ws get:paths
:existing
All existing paths in the workspace that are used in bricks, projects, and profiles.:on-disk
All paths to directories within the workspace.missing
All missing paths in the workspace that are used in bricks, projects, and profiles but don't exist on disk.poly ws get:projects:user-service
:alias
The alias that is specified in :projects
in workspace.edn
for this project.:base-names
:src
The bases that are included in the project for the src
context, either as paths or included as :local/root
.:test
The bases that are included in the project for the test
context, either as paths or included as :local/root
.:component-names
:src
The components that are included in the project for the src
context, either as paths or included as :local/root
.:test
The components that are included in the project for the test
context, either as paths or included as :local/root
.:config-filename
The absolute path to the deps.edn
config file.:deps
A map that stores brick names with a list of the interfaces each brick uses.:is-dev
Set to true
for the development
project.:lib-deps
:src
Stores a map with the libraries that are used in the project for the src
context.:size
The size of this library in bytes.:type
The type of the library, maven
, local
or git
(:mvn/version
, :local/root
and :git/url
).:version
The library version:maven
then version is set to groupId/artifactId.local
then the version is set to -
.git
then the version is set to the first seven characters in the sha
.:test
Stores a map with the libraries that are used in the project for the test
context.:lib-imports
src
All :lib-imports
taken from the bricks that are included in this project for the src
context.test
All :lib-imports
taken from the bricks that are included in this project for the test
context.:lines-of-code
:src
Number of lines of code living in the project's src
directory.:test
Number of lines of code living in the project's test
directory.:total
The total number of lines of code for all the bricks that are included in this project.:maven-repos
The maven repos that are used by this project. If :mvn/repos
is specified by a brick that is included in this project, then it will automatically turn up in this list.:name
The name of the project directory under the projects
directory.:namespaces
If the project has a test
directory (and/or a src
directory, but they are discouraged to use for projects) then the included namespaces are listed here.:paths
:src
Lists the paths that are either explicitly defined as paths or implicitly defined as :local/root
bricks, for the src
context.:test
Lists the paths that are either explicitly defined as paths or implicitly defined as :local/root
bricks, for the test
context.:project-dir
The absolute path to the project directory.:type
Set to "project".poly ws get:settings
:active-profiles
If any profiles are defined in ./deps.edn
then the active profiles(s) are listed here.:color-mode
The color mode specified in ~/.polylith/config.edn
.:compact-views
The set of views that should be shown in a more compact way, specified in workspace.edn
.:default-profile-name
The name of the default profile name, specified in workspace.edn
.:empty-character
The character used to represent empty space in output from e.g. the libs
command, specified in workspace.edn
.:interface-ns
The name of the namespace/package that is used to represent interfaces, specified in workspace.edn
.:m2-dir
Maven user root directory. Set to "~/.m2" by default, but can be overridden in ~/.polylith/config.edn
.:profile-to-settings
A map with profile name as key and profile definition as value, specified as aliases starting with a +
in ./deps.edn
::base-names
The bases that are referenced from the specified paths.:component-names
The components that are referenced from the specified paths.:lib-deps
The library dependencies specified by the key :extra-deps
.:paths
The paths specified by the key :extra-paths
.:project-names
The projects that are referenced from the specified paths.:projects
A map with extra information per project, specified in workspace.edn
.:alias
The alias for a project, used by e.g. the info
command.:test
:include
Specifies which bricks should be included when running the test
command. Empty if no bricks, missing if all bricks.:tag-patterns
The tag patterns that are specified in workspace.edn
.:thousand-separator
Used by numbers >= 1000 (e.g. the KB column in the libs
command) specified in ~/.polylith/config.edn
.:top-namespace
The top namespace for the workspace, specified in workspace.edn
.:user-config-filename
The full path to the user config name.:user-home
The user home, specified by the user.home
environment variable.:vcs
:auto-add
Set to true
if files and directories created by the create
command should be automatically added to git
. Specified in workspace.edn
.:branch
The name of the git branch.:git-root
The root of the git repository.:name
Set to "git".:polylith
:branch
Set master
or BRANCH
if branch:BRANCH
is given. The branch is used when calculating the latest sha
in ./deps.edn
for the key :aliases > :poly > :extra-deps > sha
.:latest-sha
If :latest-sha
is given, then the latest sha
from the Polylith repo (https://github.com/polyfy/polylith.git
) is retrieved.:stable-since
:sha
The latest stable point in time.:tag
The tag
for the latest stable point in time (if given).poly ws get:user-input
:args
The arguments to the poly
tool where the first argument is the command.:cmd
The first argument to the poly
command.:get
The ARGS
of get:ARGS
if given.:is-all
Set to true
if :all
is given.:is-dev
Set to true
if :dev
is given.:is-latest-sha
Set to true
if :latest-sha
is given.:is-no-exit
Set to true
if :no-exit
is given. This will prevent the poly
command from exiting with System/exit
.:is-run-all-brick-tests
Set to true
if :all
or :all-bricks
are given.:is-run-project-tests
Set to true
if :all
or :project
are given.:is-shell
Set to true
if a shell has been started with the shell
command.:is-search-for-ws-dir
Set to true
if ::
is given.:is-show-brick
Set to true
if :brick
is given. Used by poly help deps :brick
to show help for the deps
command when brick:BRICK
is given.:is-show-loc
Set to true
if :loc
is given. If given, then the info
command will show the number of lines of code.:is-show-project
Set to true
if :project
is given. Used by poly help deps :project
to show help for the deps
command when project:PROJECT
is given.:is-show-resources
Set to true
if :r
or :resources
is given. This will tell the info
command to show the r
status flag.:is-show-workspace
Set to true
if :workspace
is given. Used by poly help deps :workspace
to show help for the deps
command when workspace:WORKSPACE
is given.:is-verbose
Experimental at the moment. Can be used in combination with the test
command to show extra information.:selected-profiles
A list with the passed in profiles, e.g. ["defult" "extra"]
if poly info +default +extra
is executed.:selected-projects
The list of projects given by project:PROJECT
and/or :dev
(handled as "dev" if given).:unnamed-args
All given arguments that don't contain a :
. So if we type poly ws get:user-input:unnamed-args arg xx:123
it will return ["arg"]
but not xx
.:is-compact
Set to true
if :compact
is given. Used in combination with the libs
and deps
commands.:fake-sha
Set to c91fdad
if fake-sha:c91fdad
is given. Used to set the "stable since" sha for the output from the info
command.:is-no-changes
Set to true
if :no-changes
is given. Used to fake that no changes have been made since the last stable point in time.:is-no-exit
Set to true
if :no-exit
is given. Tells the poly
command to not exit with System/exit
.:replace
Set to e.g. [{:from "/Users/joakimtengstrand", :to "my-home"}]
if replace:$HOME:my-home
is given. It will replace this text too, so the output will actually be [{:from "my-home", :to "my-home"}]
which is the behavior we want (the whole idea with the replace
parameter is to get the same output every time).poly ws get:version
:release
:date
The date of the release in the format yyyy-mm-dd
.:major
The major version, set to zero.:minor
Increased by one if any breaking changes.:patch
Increased by one for each release within a given major.minor
.:revision
What comes after major.minor.path
.:name
The full name of the release.:ws
Versioning of the internal ws
format, returned by poly ws
.:breaking
Increased by one if introducing a non-backward compatible change of the ws
format. The goal is to never increase this number.:non-breaking
Increased by one when a non-breaking change is added to the ws
format.:type
Set to :toolsdeps1
if a workspace created by v0.1.0-alpha9
or earlier. Set to :toolsdeps2
if a workspace created by v0.2.0-alpha10
or later.:toolsdeps1
format (created by v0.1.0-alpha9
or earlier) then it will be transformed to the latest format and the :from
key is added::from
:ws
:type
Set to ":toolsdeps1"ws file
that was created by v0.1.0-alpha9
or earlier, then the ws
structure is transformed to the new format and the :from
key is added:poly ws get:version ws-file:ws1.edn
:from
:release-name
The version of the poly
tool from which this ws
file was created.:ws
:breaking
The breaking version of the original ws
format.:non-breaking
The non-breaking version of the original ws
format.:type
The type of the original ws
file.poly ws get:ws-dir
poly ws get:ws-local-dir
poly create workspace ...
, then this attribute is not set. If the workspace lives inside the git root as a directory or subdirectory, then it is set to the relative path to the git root.poly ws get:ws-reader
ws
structure (the poly
tool in this case) and the idea is that new tooling could support the ws
format and populate this structure so that it can be used by external tooling.:file-extensions
Lists the supported file extensions.:language
The name of the supported language.:name
The name of the workspace reader.:project-url
The URL to the workspace reader tool.:type-position
Set to postfix
because types (type hints) come before the arguments, in Clojure, e.g. ^String arg
. In some other languages like Scala, the types come after the arguments.