poly
Search…
Workspace structure
The 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.
Here we will use the output from the example in the documentation.
To list all the keys at the root, execute poly ws get:keys from the examples/doc-example directory:
1
[:bases
2
:components
3
:changes
4
:interfaces
5
:messages
6
:name
7
:old
8
:paths
9
:projects
10
:settings
11
:user-input
12
:version
13
:ws-dir
14
:ws-local-dir
15
:ws-reader]
Copied!
An even better way is to explore the workspace interactively from a shell:
Let's go through all the keys.

bases

poly ws get:bases:user-api
1
{:interface-deps {:src ["user"], :test []},
2
:lib-deps {:src {"slacker/slacker" {:size 28408,
3
:type "maven",
4
:version "0.17.0"}}},
5
:lib-imports {:src ["se.example.user-api.api" "slacker.server"],
6
:test ["clojure.test" "se.example.user-api.core"]},
7
:lines-of-code {:src 13, :test 6},
8
:name "user-api",
9
:namespaces {:src [{:file-path "/Users/joakimtengstrand/source/polylith/examples/doc-example/bases/user-api/src/se/example/user_api/core.clj",
10
:imports ["se.example.user-api.api" "slacker.server"],
11
:name "core",
12
:namespace "se.example.user-api.core"}
13
{:file-path "/Users/joakimtengstrand/source/polylith/examples/doc-example/bases/user-api/src/se/example/user_api/api.clj",
14
:imports ["se.example.user.interface"],
15
:name "api",
16
:namespace "se.example.user-api.api"}],
17
:test [{:file-path "/Users/joakimtengstrand/source/polylith/examples/doc-example/bases/user-api/test/se/example/user_api/core_test.clj",
18
:imports ["clojure.test" "se.example.user-api.core"],
19
:name "core-test",
20
:namespace "se.example.user-api.core-test"}]},
21
:paths {:src ["src" "resources"], :test ["test"]},
22
:type "base"}
Copied!
  • :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.
    No interfaces are imported from the 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".

components

poly ws get:components:user
1
{:interface {:definitions [{:name "hello",
2
:parameters [{:name "name"}],
3
:type "function"}],
4
:name "user"},
5
:interface-deps {:src [], :test []},
6
:lib-deps {},
7
:lib-imports {:test ["clojure.test"]},
8
:lines-of-code {:src 9, :test 7},
9
:name "user",
10
:namespaces {:src [{:file-path "/Users/joakimtengstrand/source/polylith/examples/doc-example/components/user/src/se/example/user/interface.clj",
11
:imports ["se.example.user.core"],
12
:name "interface",
13
:namespace "se.example.user.interface"}
14
{:file-path "/Users/joakimtengstrand/source/polylith/examples/doc-example/components/user/src/se/example/user/core.clj",
15
:imports [],
16
:name "core",
17
:namespace "se.example.user.core"}],
18
:test [{:file-path "/Users/joakimtengstrand/source/polylith/examples/doc-example/components/user/test/se/example/user/interface_test.clj",
19
:imports ["clojure.test" "se.example.user.interface"],
20
:name "interface-test",
21
:namespace "se.example.user.interface-test"}]},
22
:paths {:src ["src" "resources"], :test ["test"]},
23
:type "component"}
Copied!
Component keys are the same as for the 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".

changes

poly ws get:changes since:b339c35
1
{:changed-bases ["cli" "user-api"],
2
:changed-components ["user" "user-remote"],
3
:changed-files ["bases/cli/deps.edn"
4
"bases/cli/resources/cli/.keep"
5
"bases/cli/src/se/example/cli/core.clj"
6
"bases/cli/test/se/example/cli/core_test.clj"
7
"bases/user-api/deps.edn"
8
"bases/user-api/resources/user-api/.keep"
9
"bases/user-api/src/se/example/user_api/api.clj"
10
"bases/user-api/src/se/example/user_api/core.clj"
11
"bases/user-api/test/se/example/user_api/core_test.clj"
12
"components/user-remote/deps.edn"
13
"components/user-remote/resources/user-remote/.keep"
14
"components/user-remote/src/se/example/user/core.clj"
15
"components/user-remote/src/se/example/user/interface.clj"
16
"components/user-remote/test/se/example/user/interface_test.clj"
17
"components/user/deps.edn"
18
"components/user/resources/user/.keep"
19
"components/user/src/se/example/user/core.clj"
20
"components/user/src/se/example/user/interface.clj"
21
"components/user/test/se/example/user/interface_test.clj"
22
"deps.edn"
23
"development/src/dev/lisa.clj"
24
"projects/command-line/deps.edn"
25
"projects/command-line/test/project/command_line/dummy_test.clj"
26
"projects/user-service/deps.edn"
27
"readme.txt"
28
"scripts/build-cli-uberjar.sh"
29
"scripts/build-uberjar.sh"
30
"scripts/build-user-service-uberjar.sh"
31
"workspace.edn"],
32
:changed-or-affected-projects ["command-line" "development" "user-service"],
33
:changed-projects ["command-line" "development" "user-service"],
34
:git-diff-command "git diff b339c35 --name-only",
35
:project-to-bricks-to-test {"command-line" ["cli" "user-remote"],
36
"development" [],
37
"user-service" ["user" "user-api"]},
38
:project-to-indirect-changes {"command-line" {:src [], :test []},
39
"development" {:src [], :test []},
40
"user-service" {:src [], :test []}},
41
:project-to-projects-to-test {"command-line" [],
42
"development" [],
43
"user-service" []},
44
:since "b339c35",
45
:since-sha "b339c35"}
Copied!
  • :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.

interfaces

poly ws get:interfaces:user
1
{:definitions [{:name "hello",
2
:parameters [{:name "name"}],
3
:type "function"}],
4
:implementing-components ["user" "user-remote"],
5
:name "user",
6
:type "interface"}
Copied!
  • :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".

messages

poly ws get:messages
1
[{:code 103,
2
:message "Missing definitions in user's interface: hello[name]",
3
:colorized-message "Missing definitions in user's interface: hello[name]",
4
:components ["user"],
5
:type "error"}]
Copied!
To trigger this error, we commented out the 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".

name

poly ws get:name
1
doc-example
Copied!
The name of the workspace directory.

old

poly ws get:old ws-file:ws.edn
1
{:user-input {:args ["ws" "out:ws.edn"],
2
:cmd "ws",
3
:is-all false,
4
:is-dev false,
5
:is-latest-sha false,
6
:is-no-exit false,
7
:is-run-all-brick-tests false,
8
:is-run-project-tests false,
9
:is-search-for-ws-dir false,
10
:is-show-brick false,
11
:is-show-loc false,
12
:is-show-project false,
13
:is-show-resources false,
14
:is-show-workspace false,
15
:is-verbose false,
16
:out "ws.edn",
17
:selected-profiles #{},
18
:selected-projects #{},
19
:unnamed-args []}}
Copied!
If the workspace is loaded using 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.

paths

poly ws get:paths
1
{:existing ["bases/cli/resources"
2
"bases/cli/src"
3
"bases/cli/test"
4
"bases/user-api/resources"
5
"bases/user-api/src"
6
"bases/user-api/test"
7
"components/user-remote/resources"
8
"components/user-remote/src"
9
"components/user-remote/test"
10
"components/user/resources"
11
"components/user/src"
12
"components/user/test"
13
"development/src"
14
"projects/command-line/test"],
15
:on-disk ["bases/cli/resources"
16
"bases/cli/src"
17
"bases/cli/test"
18
"bases/user-api/resources"
19
"bases/user-api/src"
20
"bases/user-api/test"
21
"components/user-remote/resources"
22
"components/user-remote/src"
23
"components/user-remote/test"
24
"components/user/resources"
25
"components/user/src"
26
"components/user/test"
27
"projects/command-line/test"],
28
:missing []}
Copied!
  • :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.

projects

poly ws get:projects:user-service
1
{:alias "user-s",
2
:base-names {:src ["user-api"], :test ["user-api"]},
3
:component-names {:src ["user"], :test ["user"]},
4
:config-filename "/Users/joakimtengstrand/source/polylith/examples/doc-example/projects/user-service/deps.edn",
5
:deps {"user" {:src {}, :test {}},
6
"user-api" {:src {:direct ["user-remote"]},
7
:test {:direct ["user-remote"]}}},
8
:is-dev false,
9
:is-run-tests true,
10
:lib-deps {:src {"org.apache.logging.log4j/log4j-core" {:size 1714164,
11
:type "maven",
12
:version "2.13.3"},
13
"org.apache.logging.log4j/log4j-slf4j-impl" {:size 23590,
14
:type "maven",
15
:version "2.13.3"},
16
"org.clojure/clojure" {:size 3914649,
17
:type "maven",
18
:version "1.10.3"},
19
"org.clojure/tools.deps.alpha" {:size 60953,
20
:type "maven",
21
:version "0.12.1003"},
22
"slacker/slacker" {:size 28408,
23
:type "maven",
24
:version "0.17.0"}}},
25
:lib-imports {:src ["se.example.user-api.api" "slacker.server"],
26
:test ["clojure.test" "se.example.user-api.core"]},
27
:lines-of-code {:src 0, :test 0, :total {:src 44, :test 26}},
28
:maven-repos {"central" {:url "https://repo1.maven.org/maven2/"},
29
"clojars" {:url "https://repo.clojars.org/"}},
30
:name "user-service",
31
:namespaces {},
32
:paths {:src ["bases/user-api/resources"
33
"bases/user-api/src"
34
"components/user/resources"
35
"components/user/src"],
36
:test ["bases/user-api/test" "components/user/test"]},
37
:project-dir "/Users/joakimtengstrand/source/polylith/examples/doc-example/projects/user-service",
38
:type "project"}
Copied!
  • :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 with the interfaces each brick uses.
  • :is-dev Set to true for the development project.
  • :is-run-tests Set to true if the project is relevant for running tests. The development project is not included by default (and therefore set to false) but can be added by passing in :dev or by giving it as projects:dev or projects:development. This flag is also affected by passing in :all and :all-bricks.
  • :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:
        • if type is maven then version is set to groupId/artifactId.
        • if type is local then the version is set to -.
        • if type is 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".

settings

poly ws get:settings
1
{:active-profiles #{"default"},
2
:color-mode "dark",
3
:compact-views #{},
4
:default-profile-name "default",
5
:empty-character ".",
6
:interface-ns "interface",
7
:m2-dir "/Users/joakimtengstrand/.m2",
8
:profile-to-settings {"default" {:base-names [],
9
:component-names ["user"],
10
:lib-deps {},
11
:paths ["components/user/src"
12
"components/user/resources"
13
"components/user/test"],
14
:project-names []},
15
"remote" {:base-names [],
16
:component-names ["user-remote"],
17
:lib-deps {},
18
:paths ["components/user-remote/src"
19
"components/user-remote/resources"
20
"components/user-remote/test"],
21
:project-names []}},
22
:projects {"command-line" {:alias "cl"},
23
"development" {:alias "dev"},
24
"user-service" {:alias "user-s"}},
25
:tag-patterns {:release "v[0-9]*", :stable "stable-*"},
26
:thousand-separator ",",
27
:top-namespace "se.example",
28
:user-config-filename "/Users/joakimtengstrand/.polylith/config.edn",
29
:user-home "/Users/joakimtengstrand",
30
:vcs {:auto-add true,
31
:branch "master",
32
:git-root "/Users/joakimtengstrand/source/polylith",
33
:name "git",
34
:polylith {:branch "master",
35
:repo "https://github.com/polyfy/polylith.git"},
36
:stable-since {:sha "f7e8cd7fe83f6d2fdfdedda35fed5806ac418964",
37
:tag "stable-jote"}}}
Copied!
  • :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).

user-input

poly ws get:user-input
1
{:args ["ws" "get:user-input"],
2
:cmd "ws",
3
:get "user-input",
4
:is-all false,
5
:is-dev false,
6
:is-latest-sha false,
7
:is-no-exit false,
8
:is-run-all-brick-tests false,
9
:is-run-project-tests false,
10
:is-search-for-ws-dir false,
11
:is-show-brick false,
12
:is-show-loc false,
13
:is-show-project false,
14
:is-show-resources false,
15
:is-show-workspace false,
16
:is-verbose false,
17
:selected-profiles #{},
18
:selected-projects #{},
19
:unnamed-args []}
Copied!
  • :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.
There are a few more user input parameters that are mainly useful if you are a maintainer of the Polylith codebase itself:
  • :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).

version

poly ws get:version
1
{:release {:date "2021-08-28",
2
:major 0,
3
:minor 2,
4
:name "0.2.12-alpha",
5
:patch 12,
6
:revision "alpha"},
7
:ws {:breaking 1, :non-breaking 0, :type :toolsdeps2}}
Copied!
  • :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.
If the workspace has the old :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:
1
{:from {:ws {:type :toolsdeps1}
2
...}
Copied!
  • :from
    • :ws
      • :type Set to ":toolsdeps1"
If the workspace is read from a 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
1
{:from {:release-name "0.1.0-alpha9",
2
:ws {:breaking 0,
3
:non-breaking 0,
4
:type :toolsdeps1}}
5
...
Copied!
  • :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.

ws-dir

poly ws get:ws-dir
1
"/Users/joakimtengstrand/source/polylith/examples/doc-example"
Copied!
The absolute path of the workspace directory.

ws-local-dir

poly ws get:ws-local-dir
1
"examples/doc-example"
Copied!
If the workspace lives at the same level as the git root, which is the case if we create a workspace with 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.

ws-reader

poly ws get:ws-reader
1
{:file-extensions ["clj" "cljc"],
2
:language "Clojure",
3
:name "polylith-clj",
4
:project-url "https://github.com/polyfy/polylith",
5
:type-position "postfix"}
Copied!
This structure explains different aspects of the tool that created this 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.
Last modified 2mo ago