-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: components-first-release #7
Changes from 3 commits
af8e810
7781d6f
657cd4b
15826a9
84ff0fa
aefd082
207a668
73ab5c5
5c550a6
9b58fd2
cccbe1a
7cd6fed
f8100cc
33477ad
8edc81c
ee3a393
e48e40a
99e1d8c
8baba22
cbd05c4
eb13794
c72bf5a
f5ff6b6
f541320
c6d97bf
dfc1798
935f48b
7dc6e58
2f3e319
ca98734
0c84712
1987956
efd5257
46df98a
4dc125b
bf83370
ff9a234
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
clojars: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: "DeLaGuardo/[email protected]" | ||
with: | ||
cli: "1.11.1.1139" | ||
- name: release | ||
env: | ||
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} | ||
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} | ||
run: | | ||
clojure -T:dev:build clean && \ | ||
clojure -T:dev:build jar && \ | ||
clojure -T:dev:build install && \ | ||
clojure -X:deploy-clojars | ||
|
||
Felipe-gsilva marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
(ns build | ||
(:require [clojure.tools.build.api :as b])) | ||
|
||
(def lib 'com.github.moclojer/mockingbird) | ||
(def version "0.0.1") | ||
Felipe-gsilva marked this conversation as resolved.
Show resolved
Hide resolved
|
||
(def class-dir "target/classes") | ||
(def basis (b/create-basis {:project "deps.edn"})) | ||
(def jar-file (format "target/%s-%s.jar" (name lib) version)) | ||
Comment on lines
+5
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Consider Centralizing the Version Number The version number 🔗 Analysis chainLGTM: Project metadata definitions are correct The project metadata definitions look good for a first release. However, for future releases, consider implementing a more flexible version management system. To ensure consistency across the project, let's verify if the version is used elsewhere: To accurately verify if the version number 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for other occurrences of the version number
rg --type-add 'json:*.json' --type-add 'edn:*.edn' --type json,edn,clojure '"0.0.1"'
Length of output: 127 Script: #
#!/bin/bash
# Description: Check for other occurrences of the version number
rg -tjson -tedn -tclojure '"0.0.1"'
Length of output: 470 |
||
|
||
(defn clean [_] | ||
(b/delete | ||
{:path "target"})) | ||
|
||
(defn jar [_] | ||
(b/write-pom | ||
{:class-dir class-dir | ||
:lib lib | ||
:version version | ||
:basis basis | ||
:src-dirs ["src"]}) | ||
(b/copy-dir | ||
{:src-dirs ["src" "resources"] | ||
:target-dir class-dir}) | ||
(b/jar | ||
{:class-dir class-dir | ||
:jar-file jar-file})) | ||
|
||
(defn install [_] | ||
(b/install | ||
{:basis basis | ||
:lib lib | ||
:version version | ||
:jar-file jar-file | ||
:class-dir class-dir})) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{:paths ["src" "resources"] | ||
:deps {org.clojure/clojure {:mvn/version "1.11.1"} | ||
org.clojure/clojurescript {:mvn/version "1.11.60"} | ||
com.google.javascript/closure-compiler-unshaded {:mvn/version "v20220803"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a more recent version of the Closure Compiler. Adding the Closure Compiler dependency is a great choice for optimizing the JavaScript output. However, the specified version |
||
com.fbeyer/refx {:mvn/version "0.0.49"} | ||
lilactown/helix {:mvn/version "0.1.9"} | ||
funcool/promesa {:mvn/version "9.0.494"} | ||
|
@@ -15,4 +17,12 @@ | |
:clojure-lsp {:replace-deps {com.github.clojure-lsp/clojure-lsp-standalone {:mvn/version "2024.08.05_18.16.00-1"}} | ||
:main-opts ["-m" "clojure-lsp.main"]} | ||
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.4"}} | ||
:ns-default build}}} | ||
:ns-default build} | ||
;; env CLOJARS_USERNAME=username CLOJARS_PASSWORD=clojars-token | ||
;; clj -X:deploy-clojars | ||
:deploy-clojars {:extra-deps {slipset/deps-deploy {:mvn/version (build/version)}} | ||
:exec-fn deps-deploy.deps-deploy/deploy | ||
:exec-args {:installer :remote | ||
:sign-releases? false | ||
:pom-file "target/classes/META-INF/maven/com.moclojer/mockingbird/pom.xml" | ||
:artifact "target/com.moclojer.mockingbird.jar"}}}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,66 @@ | ||
{:deps {:aliases [:dev]} | ||
:nrepl {:port 9000} | ||
:builds {:app {:target :browser | ||
:output-dir "resources/public/assets/js" | ||
:asset-path "/assets/js" | ||
:devtools {:reload-strategy :full | ||
:http-port 8101 | ||
:http-root "resources/public"} | ||
:builds {:app {:target :browser | ||
:output-dir "resources/public/assets/js" | ||
:asset-path "/assets/js" | ||
:devtools {:reload-strategy :full | ||
:http-port 8101 | ||
:http-root "resources/public"} | ||
:build-hooks [(dev.shadow.hooks/hash-files | ||
["./resources/public/assets/css/output.css" | ||
"./resources/public/assets/js/core.js"]) | ||
(dev.shadow.hooks/replace-hashed-files | ||
"./resources/index.src.html" | ||
"./resources/public/index.html")] | ||
:dev {:modules {:core {:init-fn dev.core/init}} | ||
:compiler-options {:warning-as-errors true} | ||
:build-hooks [(dev.shadow.hooks/build-css | ||
true | ||
"./src/mockingbird/css/tailwind.css" | ||
"./resources/public/assets/css/output.css")]} | ||
:release {:modules {:core {:init-fn mockingbird.core/init}} | ||
:compiler-options {:optimizations :advanced | ||
:infer-externs :auto | ||
:source-map true | ||
:warnings-as-errors true} | ||
:build-options {:manifest-name "manifest.json"} | ||
:build-hooks [(dev.shadow.hooks/build-css | ||
false | ||
"./src/mockingbird/css/tailwind.css" | ||
"./resources/public/assets/css/output.css")]}} | ||
:tests {:target :browser-test | ||
:test-dir "resources/test" | ||
:ns-regexp "-test$" | ||
:devtools {:http-port 8102 | ||
:http-root "resources/test"}} | ||
:dev {:modules {:core {:init-fn dev.core/init}} | ||
:compiler-options {:warning-as-errors true} | ||
Felipe-gsilva marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:build-hooks [(dev.shadow.hooks/build-css | ||
true | ||
"./src/mockingbird/css/tailwind.css" | ||
"./resources/public/assets/css/output.css")]} | ||
:release {:modules {:core {:init-fn mockingbird.core/init}} | ||
:compiler-options {:optimizations :advanced | ||
:infer-externs :auto | ||
:source-map true | ||
:warnings-as-errors true} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Reconsider Including |
||
:build-options {:manifest-name "manifest.json"} | ||
:build-hooks [(dev.shadow.hooks/build-css | ||
false | ||
"./src/mockingbird/css/tailwind.css" | ||
"./resources/public/assets/css/output.css")]}} | ||
:tests {:target :browser-test | ||
:test-dir "resources/test" | ||
:ns-regexp "-test$" | ||
:devtools {:http-port 8102 | ||
:http-root "resources/test"}} | ||
|
||
:ci-tests {:target :karma | ||
:output-to "resources/test/ci.js" | ||
:ns-regexp "-test$" | ||
:compiler-options {:static-fns false}}}} | ||
:compiler-options {:static-fns false}} | ||
:node-lib {:target :node-library | ||
:output-dir "resources/node/" | ||
:output-to "resources/node/mockingbird-lib.js" | ||
:exports-fn mockingbird.node/generate-exports | ||
:build-hooks [(dev.shadow.hooks/hash-files | ||
["./resources/public/assets/css/output.css" | ||
"./resources/public/assets/js/core.js"]) | ||
(dev.shadow.hooks/replace-hashed-files | ||
"./resources/index.src.html" | ||
"./resources/public/index.html")] | ||
:dev {:modules {:core {:init-fn dev.core/init}} | ||
:compiler-options {:warning-as-errors true} | ||
:build-hooks [(dev.shadow.hooks/build-css | ||
true | ||
"./src/mockingbird/css/tailwind.css" | ||
"./resources/public/assets/css/output.css")]} | ||
:release {:modules {:core {:init-fn mockingbird.core/init}} | ||
:compiler-options {:optimizations :advanced | ||
:infer-externs :auto | ||
:source-map true | ||
:warnings-as-errors true} | ||
:build-options {:manifest-name "manifest.json"} | ||
:build-hooks [(dev.shadow.hooks/build-css | ||
false | ||
"./src/mockingbird/css/tailwind.css" | ||
"./resources/public/assets/css/output.css")]}}}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
(:require | ||
[mockingbird.core :as m])) | ||
|
||
;; TODO | ||
(defn ^:export init | ||
[] | ||
(try | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -9,39 +9,23 @@ | |||||
[refx.alpha :as refx] | ||||||
[reitit.frontend.easy :as rfe])) | ||||||
|
||||||
#_(defnc mock [] | ||||||
(let [aside (refx/use-sub [:app.dashboard/aside]) | ||||||
aside-open? (:open? aside) | ||||||
current-user (refx/use-sub [:app.auth/current-user]) | ||||||
menu-open? (refx/use-sub [:app.dashboard/is-menu-open?]) | ||||||
mocks-raw (refx/use-sub [:app.dashboard/mocks-raw])] | ||||||
|
||||||
(hooks/use-effect | ||||||
[mocks-raw] | ||||||
(when (nil? mocks-raw) | ||||||
(refx/dispatch-sync [:app.dashboard/get-mocks current-user]))) | ||||||
|
||||||
;; TODO add mock content | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Address the TODO: Add mock content The TODO comment indicates that mock content needs to be added to the |
||||||
(defnc mock [{:keys [aside aside-open? | ||||||
current-user menu-open? | ||||||
mocks-raw when-mock-raw | ||||||
children] | ||||||
:or {aside "" aside-open? false | ||||||
current-user "" menu-open? false | ||||||
mocks-raw false when-mock-raw ""}}] | ||||||
(d/li | ||||||
(d/div | ||||||
{:class "flex flex-row"} | ||||||
(d/button | ||||||
{:on-click #(rfe/push-state :app.core/mocks) | ||||||
:class (str "flex items-center p-2 w-full text-base font-normal text-gray-900 rounded-lg " | ||||||
"transition duration-75 group hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-gray-700 ") | ||||||
:aria-controls "dropdown-mocks" | ||||||
:aria-expanded aside-open? | ||||||
:data-collapse-toggle "dropdown-mocks"} | ||||||
(d/span {:class (str "flex ml-3 text-left whitespace-nowrap " | ||||||
(when-not aside-open? | ||||||
"lg:absolute lg:hidden"))} "Mocks")) | ||||||
(d/button | ||||||
{:class (str "px-2 rounded-lg fill-gray-200 bg-transparent hover:bg-gray-200 hover:fill-gray-400 " | ||||||
(if aside-open? "block " "hidden ")) | ||||||
:on-click #(refx/dispatch-sync [:app.dashboard/toggle-menu])}))))) | ||||||
children))) | ||||||
|
||||||
(defnc aside | ||||||
[{:keys [id class type theme | ||||||
aria-label position] | ||||||
aria-label position | ||||||
children] | ||||||
Comment on lines
+27
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Ensure proper handling of The |
||||||
:or {id "" | ||||||
class "" | ||||||
theme :mockingbird | ||||||
|
@@ -92,3 +76,7 @@ | |||||
#_(when aside-open? | ||||||
(d/span {:class "ml-3"} | ||||||
"Logout")))))))) | ||||||
|
||||||
|
||||||
;; TODO aside specific components | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Address the TODO: Add aside-specific components The TODO comment suggests adding specific components for the |
||||||
(defnc aside-componet []) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in function name The function name Apply this diff to correct the typo: -defnc aside-componet []
+defnc aside-component [] 📝 Committable suggestion
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
;; TODO | ||
|
||
(def styles | ||
{}) | ||
{:mockingbird {}}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) LGTM! Consider adding a clarifying comment and addressing the TODO. The change to the
;; Styles map for theme-specific customization
(def styles
{:mockingbird {}})
|
||
|
||
(defnc icon | ||
[{:keys [class theme label href | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
LGTM! The workflow name and triggers are well-defined.
The workflow name "Release" is clear and descriptive. The triggers are appropriate for a release workflow, allowing for both automated releases on version tags and manual triggering.
Consider adding a brief description comment at the beginning of the file to provide more context:
🧰 Tools
🪛 yamllint