-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added 'check' to the clj-poly API. * Added 'check', 'test', and 'test-all' to the clj-poly API. * Added support for :config-filename in workspace.edn. * Added note that you should use more unique prefixes if they are exposed outside the workspace. * Make "lib names" for bricks in projects, globally unique. The reason is that we build the clj-poly library out of it, and that we want to avoid name clashes for people that use the library. * Removed the examples where we can use c/b/p/w instead of component/base/project/workspace. * Show a warning that the short form "create c", "create b", "create p", and "create w" are deprecated. * Remove the :: examples + print deprecation message if used. * Updated polylith overview image (in production systems in the cljdoc).
- Loading branch information
1 parent
15cd173
commit 748fb9a
Showing
72 changed files
with
666 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(ns ^:no-doc polylith.clj.core.api.test | ||
(:require [polylith.clj.core.change.interface :as change] | ||
[polylith.clj.core.common.interface :as common] | ||
[polylith.clj.core.test-runner-orchestrator.interface :as test-runner-orchestrator] | ||
[polylith.clj.core.user-input.interface :as user-input] | ||
[polylith.clj.core.workspace-clj.interface :as ws-clj] | ||
[polylith.clj.core.workspace.interface :as ws])) | ||
|
||
(defn run-tests [user-input] | ||
(-> user-input | ||
(ws-clj/workspace-from-disk) | ||
(ws/enrich-workspace) | ||
(change/with-changes) | ||
(test-runner-orchestrator/run false "dark")) | ||
{:ok? true}) | ||
|
||
(defn print-argument-error [message] | ||
(println message) | ||
{:ok? false}) | ||
|
||
(defn test [since args] | ||
(let [cmd-args (concat ["test" (str "since:" since)] args) | ||
user-input (user-input/extract-arguments cmd-args) | ||
unnamed-args (:unnamed-args user-input) | ||
{:keys [ok? message]} (common/validate-args unnamed-args "test project:dev")] | ||
(if ok? | ||
(run-tests user-input) | ||
(print-argument-error message)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{:paths ["src"] | ||
:deps {} | ||
:aliases {:test {:extra-paths [] | ||
:extra-deps {}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(ns ^:no-doc polylith.clj.core.check.core | ||
(:require [polylith.clj.core.util.interface.color :as color] | ||
[polylith.clj.core.validator.interface :as validator])) | ||
|
||
(defn check [{:keys [messages]}] | ||
(let [error-messages (validator/error-messages messages) | ||
ok? (empty? error-messages)] | ||
{:ok? ok? | ||
:error-messages error-messages})) | ||
|
||
(defn print-check [{:keys [messages] :as workspace} color-mode] | ||
(let [error-messages (validator/error-messages messages)] | ||
(if (empty? error-messages) | ||
(println (color/ok color-mode "OK")) | ||
(validator/print-messages workspace)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns ^:no-doc polylith.clj.core.check.interface | ||
(:require [polylith.clj.core.check.core :as core])) | ||
|
||
(defn check [workspace] | ||
(core/check workspace)) | ||
|
||
(defn print-check [workspace color-mode] | ||
(core/print-check workspace color-mode)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 13 additions & 2 deletions
15
components/command/src/polylith/clj/core/command/create.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
(ns ^:no-doc polylith.clj.core.command.create | ||
(:require [polylith.clj.core.common.interface :as common] | ||
[polylith.clj.core.util.interface.color :as color] | ||
[polylith.clj.core.creator.interface :as creator])) | ||
|
||
(defn print-error-message [entity-short color-mode] | ||
(println (str " The short form 'create " entity-short "' is " (color/error color-mode "deprecated") " and support for it will be dropped. " | ||
"Please use 'create " (common/entity->long entity-short) "' instead."))) | ||
|
||
(defn create [current-dir workspace | ||
[_ entity] name alias top-ns interface branch git-add? commit? color-mode] | ||
[_ entity] name alias top-ns interface branch git-add? commit? config-filename color-mode] | ||
(let [ent (common/entity->short entity) | ||
git-add (if (-> git-add? nil? not) | ||
git-add? | ||
(-> workspace :settings :vcs :auto-add))] | ||
(if (contains? #{"b" "c" "p" "w"} entity) | ||
(print-error-message entity color-mode)) | ||
(condp = ent | ||
"w" (creator/create-workspace current-dir name top-ns branch commit?) | ||
"p" (when (= :ok (creator/create-project workspace name alias git-add)) | ||
(creator/print-alias-message name alias color-mode)) | ||
(creator/print-alias-message name alias config-filename color-mode)) | ||
"b" (creator/create-base workspace name git-add) | ||
"c" (creator/create-component workspace name interface git-add)))) | ||
|
||
(comment | ||
(print-error-message "c" "dark") | ||
#__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.