From af8e8104918a888d7a5b9b74ddef0aa338f2064d Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Mon, 9 Sep 2024 18:14:58 -0300 Subject: [PATCH 01/37] feat: building .jar adds: build.clj file and release.yml --- .github/workflows/release.yml | 29 +++++++++++++ README.md | 54 ------------------------- build.clj | 30 ++++++++++++++ deps.edn | 13 +++++- package.json | 7 ++-- src/mockingbird/components/aside.cljs | 42 +++++++------------ src/mockingbird/components/icon.cljs | 2 +- src/mockingbird/components/image.cljs | 43 ++++++++++++++++---- src/mockingbird/components/popup.cljs | 20 ++++----- src/mockingbird/components/profile.cljs | 19 --------- src/mockingbird/helpers/props.cljs | 2 +- test/unit/components/props_test.cljs | 8 ++-- 12 files changed, 142 insertions(+), 127 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 README.md create mode 100644 build.clj diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1d26717 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +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/setup-clojure@12.5" + 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 -X:deploy-clojars + diff --git a/README.md b/README.md deleted file mode 100644 index b39de56..0000000 --- a/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# mockingbird - -Design System using [tailwind](https://tailwindcss.com/) and [helix](https://github.com/lilactown/helix) in [ClojureScript](https://clojurescript.org/). - -A simple way to develop a user interface with a consistent user experience, without the need to clutter `cljs` code with **CSS**. - -## name reference? - -> "mockingbird" is for everyone! - -The name is a reference to the book [To Kill a Mockingbird](https://en.wikipedia.org/wiki/To_Kill_a_Mockingbird) by Harper Lee. The idea is that the design system is a "mockingbird" that sings the same song everywhere. - -It's impossible to talk about *"mockingbird"* without remembering the song [Mockingbird by Eminem](https://www.youtube.com/watch?v=S9bCLPwzSC0) with his daughter Hailie Jade. The song is a declaration of love from a father to his daughter. - -**mockingbird** is a declaration of love for all developers ~~(frontend will never be easy for backend developers)~~. - -# Overview - -Mockingbird offers a set of reusable components and utilities that increases speed and beauty on your UI development. By integrating Tailwind, Helix and ReFx, Mockingbird combines functional programming, a powerful component model together creating a fast and lightweight design system. This allows your team (or simply yourself) to focus on building robust, reactive interfaces without getting bogged down in styling and local state management concerns. - -# Getting Started - -Prerequisites - -Before you begin, ensure you have the following installed: -- Clojure: Follow the [Clojure Installation guide](https://clojure.org/guides/install_clojure) to set up your environment. -- Node.js: Required for managing dependencies and building your project. Download it from [here](https://www.npmjs.com/package/downloads). - -# Installation - -- Set up your project: Start by creating a new ClojureScript project, or use an existing one. - -- Install node dependencies with a simple command: - -``` sh -npm i -``` - -- configure your shadow cljs: - -> for better understanding, follow the offcial [guide](https://github.com/thheller/shadow-cljs) - - -# Usage - -;; TODO - -# Testing - -And you are now done, you can clone and build this repo in order to see some examples of good usage of our dear Mockingbird. You can read more [here](docs/test.md). - -# Contributing - -Mockingbird is open-source, and contributions are welcome! If you have ideas for new features, improvements, or bug fixes, feel free to open an issue or submit a pull request. diff --git a/build.clj b/build.clj new file mode 100644 index 0000000..58e4fb5 --- /dev/null +++ b/build.clj @@ -0,0 +1,30 @@ +(ns build + (:require [clojure.tools.build.api :as b])) + +(def lib 'com.github.moclojer/mockingbird) +(def version "0.0.1") +(def class-dir "target/classes") +(def basis (b/create-basis {:project "deps.edn"})) +(def jar-file (format "target/%s-%s.jar" (name lib) version)) + +(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})) + diff --git a/deps.edn b/deps.edn index fe08405..0fd7063 100644 --- a/deps.edn +++ b/deps.edn @@ -1,5 +1,6 @@ {:paths ["src" "resources"] :deps {org.clojure/clojure {:mvn/version "1.11.1"} + org.clojure/clojurescript {:mvn/version "1.11.4"} com.fbeyer/refx {:mvn/version "0.0.49"} lilactown/helix {:mvn/version "0.1.9"} funcool/promesa {:mvn/version "9.0.494"} @@ -15,4 +16,14 @@ :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} + + ;; clj -M:dev --report stderr -m com.moclojer.tools.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"}}}} diff --git a/package.json b/package.json index ee5aa1c..ab5c8be 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,10 @@ "ci:tests": "npm run ci:karma-make && npx shadow-cljs compile ci-tests && npx karma start --single-run", "postcss:build": "npx cross-env TAILWIND_MODE=build postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/output.css --verbose", "postcss:watch": "npx cross-env TAILWIND_MODE=watch postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/output.css --verbose -w", - "app:watch": "npx shadow-cljs watch app", - "watch": "run-p -l *:watch", - "repl": "npx shadow-cljs clj-repl" + "watch": "npx shadow-cljs watch app", + "repl": "npx shadow-cljs clj-repl", + "release": "run-s shadow:release", + "shadow:release": "npx shadow-cljs release app" }, "dependencies": { "@codemirror/language": "^6.6.0", diff --git a/src/mockingbird/components/aside.cljs b/src/mockingbird/components/aside.cljs index 822fa14..9d61191 100644 --- a/src/mockingbird/components/aside.cljs +++ b/src/mockingbird/components/aside.cljs @@ -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 +(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] :or {id "" class "" theme :mockingbird @@ -92,3 +76,7 @@ #_(when aside-open? (d/span {:class "ml-3"} "Logout")))))))) + + +;; TODO aside specific components +(defnc aside-componet []) diff --git a/src/mockingbird/components/icon.cljs b/src/mockingbird/components/icon.cljs index a5ababe..5fabade 100644 --- a/src/mockingbird/components/icon.cljs +++ b/src/mockingbird/components/icon.cljs @@ -6,7 +6,7 @@ ;; TODO (def styles - {}) + {:mockingbird {}}) (defnc icon [{:keys [class theme label href diff --git a/src/mockingbird/components/image.cljs b/src/mockingbird/components/image.cljs index 5c13b43..ce00c9c 100644 --- a/src/mockingbird/components/image.cljs +++ b/src/mockingbird/components/image.cljs @@ -5,7 +5,10 @@ [mockingbird.lib :refer-macros [defnc]] [helix.dom :as d])) -(def pfp-styles {:mockingbird ""}) +(def pfp-styles + {:default "w-8 h-8 rounded-none opacity-100" + :rounded "w-8 h-8 rounded-full opacity-100" + :loading "w-8 h-8 rounded-full opacity-30 animate-pulse"}) (defnc pfp [{:keys [class theme image @@ -22,12 +25,38 @@ padding :none}}] (d/div (d/img {:class (str (get pfp-styles theme) " " - (get-props {:size size - :roundness roundness - :shadow shadow - :margin margin - :padding padding - :class class})) + (get-props + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) + :src image + :alt alt}) + children)) + +(defnc img + [{:keys [class theme image + alt size roundness + shadow margin padding + children] + :or {theme :mockingbird + image "/images/logo.png" + alt "test" + size :md + roundness :none + shadow :none + margin :none + padding :none}}] + (d/div + (d/img {:class (str (get-props + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) :src image :alt alt}) children)) diff --git a/src/mockingbird/components/popup.cljs b/src/mockingbird/components/popup.cljs index 79d7041..9101ffa 100644 --- a/src/mockingbird/components/popup.cljs +++ b/src/mockingbird/components/popup.cljs @@ -6,6 +6,15 @@ [helix.hooks :as hooks] [refx.alpha :as refx])) +(def error-styles + {:card "rounded border-l-4 border-red-500 bg-red-50 p-4" + :tittle "block font-medium text-red-700" + :desc "mt-2 text-sm text-red-700"}) + +(def toast-data-styles + {:info {:class "bg-green-50 fill-green-700 text-green-700 border-green-700"} + :error {:class "bg-red-50 fill-red-700 text-red-700 border-red-700"}}) + ;; notification (refx/reg-sub :app/notifications @@ -28,11 +37,6 @@ (fn [notification] (refx/dispatch [:app/enqueue-notification notification]))) -;; alerts -(def error-styles - {:card "rounded border-l-4 border-red-500 bg-red-50 p-4" - :tittle "block font-medium text-red-700" - :desc "mt-2 text-sm text-red-700"}) (defnc error [{:keys [id error description]}] @@ -48,10 +52,6 @@ {:class desc} (str description)))))) -(def toast-data - {:info {:class "bg-green-50 fill-green-700 text-green-700 border-green-700"} - :error {:class "bg-red-50 fill-red-700 text-red-700 border-red-700"}}) - (defnc toast [{[id {:keys [type content icon]}] :children}] (hooks/use-effect :once @@ -61,7 +61,7 @@ (d/div {:class (str "w-fit px-5 py-4 bg-blue-600 rounded-lg border-2 " - (get-in toast-data [type :class]))} + (get-in toast-data-styles [type :class]))} (d/div {:class "flex flex-row items-center align-center space-between"} (d/div diff --git a/src/mockingbird/components/profile.cljs b/src/mockingbird/components/profile.cljs index 82e324c..a229d50 100644 --- a/src/mockingbird/components/profile.cljs +++ b/src/mockingbird/components/profile.cljs @@ -7,25 +7,6 @@ [promesa.core :as p] [refx.alpha :as refx])) -(def gravatar-base-url "https://gravatar.com/avatar/") -(def auth0-cdn-base-url "https://cdn.auth0.com/avatars/") - -(def pfp-styles - {:default "w-8 h-8 rounded-none opacity-100" - :rounded "w-8 h-8 rounded-full opacity-100" - :loading "w-8 h-8 rounded-full opacity-30 animate-pulse"}) - -(defn get-simple-avatar-url [username] - (let [uq-names (-> username - (str/split #" ")) - initials (->> uq-names - (take 2) - (map #(take 1 %)) - flatten - (str/join "") - str/lower-case)] - (str auth0-cdn-base-url initials ".png"))) - (defn get-image-style [{:keys [children image-style]}] (let [image-style (keyword image-style)] diff --git a/src/mockingbird/helpers/props.cljs b/src/mockingbird/helpers/props.cljs index 170d3ff..8eec45b 100644 --- a/src/mockingbird/helpers/props.cljs +++ b/src/mockingbird/helpers/props.cljs @@ -41,5 +41,5 @@ :md "m-4 " :lg "m-8 " nil)] - (str actual-size actual-roundness cast-shadow + (str actual-size actual-roundness cast-shadow actual-padding actual-margin class))) diff --git a/test/unit/components/props_test.cljs b/test/unit/components/props_test.cljs index 9db50e6..9957c99 100644 --- a/test/unit/components/props_test.cljs +++ b/test/unit/components/props_test.cljs @@ -36,15 +36,15 @@ (testing "All defaults (empty map)" (is (= (get-props {}) "w-16 h-16 "))) - + (testing "Partial defaults" (is (= (get-props {:size :sm}) "w-8 h-8 ")) - (is (= (get-props {:roundness :full + (is (= (get-props {:roundness :full :shadow :lg}) "w-16 h-16 rounded-full shadow-lg "))) - + (testing "Nil values" - (is (= (get-props {:size nil + (is (= (get-props {:size nil :roundness nil}) "w-16 h-16 "))))) From 7781d6f2b161a5c1e713f187f3ed762859e4aacc Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Mon, 9 Sep 2024 18:17:59 -0300 Subject: [PATCH 02/37] doc: enhance installation process --- README.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..631a537 --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +# mockingbird + +Design System using [tailwind](https://tailwindcss.com/) and [helix](https://github.com/lilactown/helix) in [ClojureScript](https://clojurescript.org/). + +A simple way to develop a user interface with a consistent user experience, without the need to clutter `cljs` code with **CSS**. + +## name reference? + +> "mockingbird" is for everyone! + +The name is a reference to the book [To Kill a Mockingbird](https://en.wikipedia.org/wiki/To_Kill_a_Mockingbird) by Harper Lee. The idea is that the design system is a "mockingbird" that sings the same song everywhere. + +It's impossible to talk about *"mockingbird"* without remembering the song [Mockingbird by Eminem](https://www.youtube.com/watch?v=S9bCLPwzSC0) with his daughter Hailie Jade. The song is a declaration of love from a father to his daughter. + +**mockingbird** is a declaration of love for all developers ~~(frontend will never be easy for backend developers)~~. + +# Overview + +Mockingbird offers a set of reusable components and utilities that increases speed and beauty on your UI development. By integrating Tailwind, Helix and ReFx, Mockingbird combines functional programming, a powerful component model together creating a fast and lightweight design system. This allows your team (or simply yourself) to focus on building robust, reactive interfaces without getting bogged down in styling and local state management concerns. + +# Getting Started + +Prerequisites + +Before you begin, ensure you have the following installed: +- Clojure: Follow the [Clojure Installation guide](https://clojure.org/guides/install_clojure) to set up your environment. +- [Node.js](https://nodejs.org/en/download/prebuilt-installer/current). +- [npm](https://www.npmjs.com/package/downloads). + +# Installation + +We distribute our software via Clojars, so you are able to just plug and play! + +``` clj + +;; TODO + +``` + + + +# Usage + +;; TODO + + +# Testing Locally + +And you are now done, you can clone and build this repo in order to see some examples of good usage of our dear Mockingbird. You can read more [here](docs/test.md). + +- Set up your project: Start by creating a new ClojureScript project, or use an existing one. + +- Install node dependencies with a simple command: + +``` sh +npm i +``` + +- configure your shadow cljs + +> for better understanding, follow the offcial [guide](https://github.com/thheller/shadow-cljs) + +# Contributing + +Mockingbird is open-source, and contributions are welcome! If you have ideas for new features, improvements, or bug fixes, feel free to open an issue or submit a pull request. From 657cd4b344d53991c993bf6e1a0082f6864cbb69 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Wed, 11 Sep 2024 15:59:02 -0300 Subject: [PATCH 03/37] feat: creating node library (unfinished) --- .github/workflows/ci-tests.yml | 2 +- .github/workflows/release.yml | 1 + .gitignore | 4 +- README.md | 2 +- build.clj | 35 +++++++----- deps.edn | 5 +- docs/Roadmap.md | 1 + package.json | 3 +- shadow-cljs.edn | 82 ++++++++++++++++++---------- src/dev/core.cljs | 1 - src/mockingbird/core.cljs | 3 +- src/mockingbird/lib.cljc | 2 +- src/mockingbird/node.cljs | 15 +++++ test/unit/components/props_test.cljs | 63 +++++++++++---------- 14 files changed, 136 insertions(+), 83 deletions(-) create mode 100644 src/mockingbird/node.cljs diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 8552ce0..a803f96 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -28,7 +28,7 @@ jobs: java-version: '11' - name: Install clojure cli - uses: DeLaGuardo/setup-clojure@master + uses: DeLaGuardo/setup-clojure@12.5 with: cli: 1.11.1.1113 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d26717..790e9ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,5 +25,6 @@ jobs: run: | clojure -T:dev:build clean && \ clojure -T:dev:build jar && \ + clojure -T:dev:build install && \ clojure -X:deploy-clojars diff --git a/.gitignore b/.gitignore index d23e7f9..baa1528 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,6 @@ pom.xml.asc /.shadow-cljs/ /resources/public/index.html /resources/public/assets -/resources/public/css/site.css +/resources/public/css/ /resources/test/ - +/resources/node/ diff --git a/README.md b/README.md index 631a537..3ee961d 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Before you begin, ensure you have the following installed: # Installation -We distribute our software via Clojars, so you are able to just plug and play! +We distribute our software via Clojars, so you are can just plug and play! ``` clj diff --git a/build.clj b/build.clj index 58e4fb5..d8abc78 100644 --- a/build.clj +++ b/build.clj @@ -8,23 +8,28 @@ (def jar-file (format "target/%s-%s.jar" (name lib) version)) (defn clean [_] - (b/delete {:path "target"})) + (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})) + (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})) + (b/install + {:basis basis + :lib lib + :version version + :jar-file jar-file + :class-dir class-dir})) diff --git a/deps.edn b/deps.edn index 0fd7063..0a258e4 100644 --- a/deps.edn +++ b/deps.edn @@ -1,6 +1,7 @@ {:paths ["src" "resources"] :deps {org.clojure/clojure {:mvn/version "1.11.1"} - org.clojure/clojurescript {:mvn/version "1.11.4"} + org.clojure/clojurescript {:mvn/version "1.11.60"} + com.google.javascript/closure-compiler-unshaded {:mvn/version "v20220803"} com.fbeyer/refx {:mvn/version "0.0.49"} lilactown/helix {:mvn/version "0.1.9"} funcool/promesa {:mvn/version "9.0.494"} @@ -17,8 +18,6 @@ :main-opts ["-m" "clojure-lsp.main"]} :build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.4"}} :ns-default build} - - ;; clj -M:dev --report stderr -m com.moclojer.tools.build ;; env CLOJARS_USERNAME=username CLOJARS_PASSWORD=clojars-token ;; clj -X:deploy-clojars :deploy-clojars {:extra-deps {slipset/deps-deploy {:mvn/version (build/version)}} diff --git a/docs/Roadmap.md b/docs/Roadmap.md index f5d4aa4..b3b1ffd 100644 --- a/docs/Roadmap.md +++ b/docs/Roadmap.md @@ -1,5 +1,6 @@ # Roadmap +- distribuition - layout - components - themes (mockingbird, nightjar, kiwi) diff --git a/package.json b/package.json index ab5c8be..f2006d8 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "watch": "npx shadow-cljs watch app", "repl": "npx shadow-cljs clj-repl", "release": "run-s shadow:release", - "shadow:release": "npx shadow-cljs release app" + "shadow:release": "npx shadow-cljs release app", + "lib": "npx shadow-cljs compile node-lib " }, "dependencies": { "@codemirror/language": "^6.6.0", diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 26dbbb3..74fdb67 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -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} + :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"}} :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")]}}}} diff --git a/src/dev/core.cljs b/src/dev/core.cljs index 741a172..26a72f0 100644 --- a/src/dev/core.cljs +++ b/src/dev/core.cljs @@ -2,7 +2,6 @@ (:require [mockingbird.core :as m])) -;; TODO (defn ^:export init [] (try diff --git a/src/mockingbird/core.cljs b/src/mockingbird/core.cljs index 8d690bd..844fb78 100644 --- a/src/mockingbird/core.cljs +++ b/src/mockingbird/core.cljs @@ -2,8 +2,7 @@ (:require ["react-dom/client" :as rdom] [mockingbird.examples.main :as ex] - [helix.core :refer [$ <>]] - [helix.dom :as d])) + [helix.core :refer [$ <>]])) ;; this is a front app application using shadow-cljs, postcss, helix and refx. ;; You can see a simple page example running here. diff --git a/src/mockingbird/lib.cljc b/src/mockingbird/lib.cljc index d41c559..4b4467f 100644 --- a/src/mockingbird/lib.cljc +++ b/src/mockingbird/lib.cljc @@ -2,7 +2,7 @@ (:require [helix.core])) -(defmacro defnc [type & form-body] +(defmacro ^:export defnc [type & form-body] (let [[docstring form-body] (if (string? (first form-body)) [(first form-body) (rest form-body)] [nil form-body]) diff --git a/src/mockingbird/node.cljs b/src/mockingbird/node.cljs new file mode 100644 index 0000000..bcf5b6f --- /dev/null +++ b/src/mockingbird/node.cljs @@ -0,0 +1,15 @@ +(ns mockingbird.node + (:require + [mockingbird.components.button :refer [button]] + [mockingbird.components.image :refer [pfp]] + [helix.dom :as d])) + +(defn hello [] + (prn "hello") + "hello") + +(defn generate-exports [] + #js{:hello hello + :helix-dom d/img + :button button + :image pfp}) diff --git a/test/unit/components/props_test.cljs b/test/unit/components/props_test.cljs index 9957c99..7999256 100644 --- a/test/unit/components/props_test.cljs +++ b/test/unit/components/props_test.cljs @@ -1,34 +1,38 @@ (ns unit.components.props-test (:require - [clojure.test :refer [is testing deftest]] - [mockingbird.helpers.props :refer [get-props]])) + [clojure.test :refer [is testing deftest]] + [mockingbird.helpers.props :refer [get-props]])) (deftest test-get-props (testing "Check for props args" - (is (= (get-props {:size :sm - :roundness :sm - :shadow :sm - :margin :sm - :padding :sm - :class "custom-class"}) + (is (= (get-props + {:size :sm + :roundness :sm + :shadow :sm + :margin :sm + :padding :sm + :class "custom-class"}) "w-8 h-8 rounded-sm shadow-sm p-2 m-2 custom-class")) - (is (= (get-props {:size :lg - :roundness :full - :shadow :lg - :margin :md - :padding :lg - :class "another-class"}) + (is (= (get-props + {:size :lg + :roundness :full + :shadow :lg + :margin :md + :padding :lg + :class "another-class"}) "w-32 h-32 rounded-full shadow-lg p-8 m-4 another-class")) - (is (= (get-props {:size :full - :roundness :none - :shadow :none - :margin :none - :padding :none - :class "basic-class"}) + (is (= (get-props + {:size :full + :roundness :none + :shadow :none + :margin :none + :padding :none + :class "basic-class"}) "w-full basic-class")) - (is (= (get-props {:size :xl - :roundness :none - :shadow :none}) + (is (= (get-props + {:size :xl + :roundness :none + :shadow :none}) "w-64 h-64 ")))) (deftest test-default-cases @@ -38,13 +42,16 @@ "w-16 h-16 "))) (testing "Partial defaults" - (is (= (get-props {:size :sm}) + (is (= (get-props + {:size :sm}) "w-8 h-8 ")) - (is (= (get-props {:roundness :full - :shadow :lg}) + (is (= (get-props + {:roundness :full + :shadow :lg}) "w-16 h-16 rounded-full shadow-lg "))) (testing "Nil values" - (is (= (get-props {:size nil - :roundness nil}) + (is (= (get-props + {:size nil + :roundness nil}) "w-16 h-16 "))))) From 15826a9394d3d1bfa9ae5bc209309e1013c5e7bc Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Thu, 12 Sep 2024 16:31:08 -0300 Subject: [PATCH 04/37] fix: node-lib building config --- .github/workflows/release.yml | 7 ++-- build.clj | 35 ---------------- deps.edn | 10 +---- shadow-cljs.edn | 39 ++++++------------ src/mockingbird/components/image.cljs | 2 +- src/mockingbird/css/tailwind.css | 5 --- src/mockingbird/node.cljs | 9 +++-- test/unit/components/props_test.cljs | 57 --------------------------- 8 files changed, 23 insertions(+), 141 deletions(-) delete mode 100644 build.clj delete mode 100644 src/mockingbird/css/tailwind.css delete mode 100644 test/unit/components/props_test.cljs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 790e9ef..45eae3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,8 +23,7 @@ jobs: 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 + npm ci && \ + npm run release && \ + npm release diff --git a/build.clj b/build.clj deleted file mode 100644 index d8abc78..0000000 --- a/build.clj +++ /dev/null @@ -1,35 +0,0 @@ -(ns build - (:require [clojure.tools.build.api :as b])) - -(def lib 'com.github.moclojer/mockingbird) -(def version "0.0.1") -(def class-dir "target/classes") -(def basis (b/create-basis {:project "deps.edn"})) -(def jar-file (format "target/%s-%s.jar" (name lib) version)) - -(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})) - diff --git a/deps.edn b/deps.edn index 0a258e4..5a0a583 100644 --- a/deps.edn +++ b/deps.edn @@ -17,12 +17,4 @@ :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} - ;; 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"}}}} + :ns-default build}}} diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 74fdb67..535e25c 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -38,29 +38,16 @@ :output-to "resources/test/ci.js" :ns-regexp "-test$" :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")]}}}} + :node-lib {:target :node-library + :output-dir "./resources/node/" + :output-to "./resources/node/lib.js" + :exports-fn mockingbird.node/generate-exports + :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/node/output.css")]}}} diff --git a/src/mockingbird/components/image.cljs b/src/mockingbird/components/image.cljs index ce00c9c..4b7f3c1 100644 --- a/src/mockingbird/components/image.cljs +++ b/src/mockingbird/components/image.cljs @@ -36,7 +36,7 @@ :alt alt}) children)) -(defnc img +(defnc image [{:keys [class theme image alt size roundness shadow margin padding diff --git a/src/mockingbird/css/tailwind.css b/src/mockingbird/css/tailwind.css deleted file mode 100644 index 9943073..0000000 --- a/src/mockingbird/css/tailwind.css +++ /dev/null @@ -1,5 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; -@tailwind style; - diff --git a/src/mockingbird/node.cljs b/src/mockingbird/node.cljs index bcf5b6f..118033c 100644 --- a/src/mockingbird/node.cljs +++ b/src/mockingbird/node.cljs @@ -1,8 +1,8 @@ (ns mockingbird.node (:require [mockingbird.components.button :refer [button]] - [mockingbird.components.image :refer [pfp]] - [helix.dom :as d])) + [mockingbird.components.input :refer [input]] + [mockingbird.components.image :refer [image pfp]])) (defn hello [] (prn "hello") @@ -10,6 +10,7 @@ (defn generate-exports [] #js{:hello hello - :helix-dom d/img :button button - :image pfp}) + :image image + :pfp pfp + :input input}) diff --git a/test/unit/components/props_test.cljs b/test/unit/components/props_test.cljs deleted file mode 100644 index 7999256..0000000 --- a/test/unit/components/props_test.cljs +++ /dev/null @@ -1,57 +0,0 @@ -(ns unit.components.props-test - (:require - [clojure.test :refer [is testing deftest]] - [mockingbird.helpers.props :refer [get-props]])) - -(deftest test-get-props - (testing "Check for props args" - (is (= (get-props - {:size :sm - :roundness :sm - :shadow :sm - :margin :sm - :padding :sm - :class "custom-class"}) - "w-8 h-8 rounded-sm shadow-sm p-2 m-2 custom-class")) - (is (= (get-props - {:size :lg - :roundness :full - :shadow :lg - :margin :md - :padding :lg - :class "another-class"}) - "w-32 h-32 rounded-full shadow-lg p-8 m-4 another-class")) - (is (= (get-props - {:size :full - :roundness :none - :shadow :none - :margin :none - :padding :none - :class "basic-class"}) - "w-full basic-class")) - (is (= (get-props - {:size :xl - :roundness :none - :shadow :none}) - "w-64 h-64 ")))) - -(deftest test-default-cases - (testing "Check for default cases" - (testing "All defaults (empty map)" - (is (= (get-props {}) - "w-16 h-16 "))) - - (testing "Partial defaults" - (is (= (get-props - {:size :sm}) - "w-8 h-8 ")) - (is (= (get-props - {:roundness :full - :shadow :lg}) - "w-16 h-16 rounded-full shadow-lg "))) - - (testing "Nil values" - (is (= (get-props - {:size nil - :roundness nil}) - "w-16 h-16 "))))) From 84ff0faaac92e8702dd63638a4200a201e6e0e26 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Thu, 12 Sep 2024 17:10:05 -0300 Subject: [PATCH 05/37] doc: code rabbit snippets --- README.md | 2 +- docs/Roadmap.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ee961d..c7ab9c4 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ We distribute our software via Clojars, so you are can just plug and play! # Testing Locally -And you are now done, you can clone and build this repo in order to see some examples of good usage of our dear Mockingbird. You can read more [here](docs/test.md). +You can clone and build this repo, to see some examples of good usage of our dear Mockingbird. You can read more [here](docs/test.md). - Set up your project: Start by creating a new ClojureScript project, or use an existing one. diff --git a/docs/Roadmap.md b/docs/Roadmap.md index b3b1ffd..f5d4aa4 100644 --- a/docs/Roadmap.md +++ b/docs/Roadmap.md @@ -1,6 +1,5 @@ # Roadmap -- distribuition - layout - components - themes (mockingbird, nightjar, kiwi) From aefd0821c627e42f9faa1cd7b4db7b0d616d273d Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Thu, 12 Sep 2024 17:32:18 -0300 Subject: [PATCH 06/37] fix: glob, rimraf and cliui deps --- package-lock.json | 241 +++++++++++++++++++++++++++------------------- package.json | 5 +- 2 files changed, 145 insertions(+), 101 deletions(-) diff --git a/package-lock.json b/package-lock.json index 639281e..19d31b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "mockingbird", + "name": "mockingbird-cljs", "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "mockingbird", + "name": "mockingbird-cljs", "version": "0.0.1", "dependencies": { "@codemirror/language": "^6.6.0", @@ -13,6 +13,7 @@ "@codemirror/lint": "^6.4.2", "@codemirror/state": "^6.3.3", "@codemirror/view": "^6.22.3", + "@isaacs/cliui": "^8.0.2", "@sentry/cli": "^2.31.0", "@sentry/react": "^7.109.0", "@supabase/supabase-js": "^2.25.0", @@ -23,6 +24,7 @@ "cross-env": "^7.0.3", "flowbite": "^1.6.6", "flowbite-react": "^0.4.7", + "glob": "^11.0.0", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", "postcss-focus-visible": "^8.0.2", @@ -31,6 +33,7 @@ "react-dom": "18.2.0", "react-refresh": "^0.14.0", "react-router-dom": "^6.13.0", + "rimraf": "^6.0.1", "slugify": "^1.6.6", "svgmap": "^2.10.1", "tls-test": "https://tls-test.npmjs.com/tls-test-1.0.0.tgz", @@ -1124,7 +1127,7 @@ }, "node_modules/@isaacs/cliui": { "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-7.0.2.tgz", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "license": "ISC", "dependencies": { @@ -2767,9 +2770,9 @@ "license": "MIT" }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "license": "MIT", "dependencies": { @@ -2781,7 +2784,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -2808,22 +2811,6 @@ "dev": true, "license": "MIT" }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -5283,21 +5270,24 @@ } }, "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" + "path-scurry": "^2.0.0" }, "bin": { "glob": "dist/esm/bin.mjs" }, + "engines": { + "node": "20 || >=22" + }, "funding": { "url": "https://github.com/sponsors/isaacs" } @@ -6283,13 +6273,16 @@ "license": "ISC" }, "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", + "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, + "engines": { + "node": "20 || >=22" + }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -6560,6 +6553,23 @@ "node": "*" } }, + "node_modules/karma/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/karma/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -6797,10 +6807,13 @@ } }, "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "license": "ISC" + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz", + "integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==", + "license": "ISC", + "engines": { + "node": "20 || >=22" + } }, "node_modules/lz-string": { "version": "1.5.0", @@ -6971,15 +6984,15 @@ "license": "MIT" }, "node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -7829,25 +7842,25 @@ "license": "MIT" }, "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-to-regexp": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz", - "integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", "dev": true, "license": "MIT" }, @@ -9931,68 +9944,24 @@ "license": "MIT" }, "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", + "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", "license": "ISC", "dependencies": { - "glob": "^7.1.3" + "glob": "^11.0.0", + "package-json-from-dist": "^1.0.0" }, "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "rimraf": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -10893,6 +10862,78 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/sucrase/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sucrase/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/sucrase/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/sucrase/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sucrase/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", diff --git a/package.json b/package.json index f2006d8..9700524 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "mockingbird", + "name": "mockingbird-cljs", "version": "0.0.1", "private": true, "devDependencies": { @@ -35,6 +35,7 @@ "@codemirror/lint": "^6.4.2", "@codemirror/state": "^6.3.3", "@codemirror/view": "^6.22.3", + "@isaacs/cliui": "^8.0.2", "@sentry/cli": "^2.31.0", "@sentry/react": "^7.109.0", "@supabase/supabase-js": "^2.25.0", @@ -45,6 +46,7 @@ "cross-env": "^7.0.3", "flowbite": "^1.6.6", "flowbite-react": "^0.4.7", + "glob": "^11.0.0", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", "postcss-focus-visible": "^8.0.2", @@ -53,6 +55,7 @@ "react-dom": "18.2.0", "react-refresh": "^0.14.0", "react-router-dom": "^6.13.0", + "rimraf": "^6.0.1", "slugify": "^1.6.6", "svgmap": "^2.10.1", "tls-test": "https://tls-test.npmjs.com/tls-test-1.0.0.tgz", From 207a668d3bad6f04c55d0df9ce7ddc6de819a54c Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Thu, 12 Sep 2024 17:37:56 -0300 Subject: [PATCH 07/37] fix: adds prop test unit (back) --- test/unit/components/props_test.cljs | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 test/unit/components/props_test.cljs diff --git a/test/unit/components/props_test.cljs b/test/unit/components/props_test.cljs new file mode 100644 index 0000000..7999256 --- /dev/null +++ b/test/unit/components/props_test.cljs @@ -0,0 +1,57 @@ +(ns unit.components.props-test + (:require + [clojure.test :refer [is testing deftest]] + [mockingbird.helpers.props :refer [get-props]])) + +(deftest test-get-props + (testing "Check for props args" + (is (= (get-props + {:size :sm + :roundness :sm + :shadow :sm + :margin :sm + :padding :sm + :class "custom-class"}) + "w-8 h-8 rounded-sm shadow-sm p-2 m-2 custom-class")) + (is (= (get-props + {:size :lg + :roundness :full + :shadow :lg + :margin :md + :padding :lg + :class "another-class"}) + "w-32 h-32 rounded-full shadow-lg p-8 m-4 another-class")) + (is (= (get-props + {:size :full + :roundness :none + :shadow :none + :margin :none + :padding :none + :class "basic-class"}) + "w-full basic-class")) + (is (= (get-props + {:size :xl + :roundness :none + :shadow :none}) + "w-64 h-64 ")))) + +(deftest test-default-cases + (testing "Check for default cases" + (testing "All defaults (empty map)" + (is (= (get-props {}) + "w-16 h-16 "))) + + (testing "Partial defaults" + (is (= (get-props + {:size :sm}) + "w-8 h-8 ")) + (is (= (get-props + {:roundness :full + :shadow :lg}) + "w-16 h-16 rounded-full shadow-lg "))) + + (testing "Nil values" + (is (= (get-props + {:size nil + :roundness nil}) + "w-16 h-16 "))))) From 73ab5c58e7adf65206c1b962df493c520e644ba8 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Thu, 12 Sep 2024 20:17:08 -0300 Subject: [PATCH 08/37] feat: mockingbird as npm-module --- package.json | 3 +- shadow-cljs.edn | 39 ++++++++++++------- src/mockingbird/components/filedropdown.cljs | 2 +- .../components/selectdropdown.cljs | 2 +- src/mockingbird/components/status.cljs | 2 +- src/mockingbird/node.cljs | 16 -------- 6 files changed, 31 insertions(+), 33 deletions(-) delete mode 100644 src/mockingbird/node.cljs diff --git a/package.json b/package.json index 9700524..f050d9c 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "mockingbird-cljs", "version": "0.0.1", "private": true, + "main": "target/mockingbird-lib.js" "devDependencies": { "@testing-library/react": "^14.0.0", "autoprefixer": "^10.4.14", @@ -27,7 +28,7 @@ "repl": "npx shadow-cljs clj-repl", "release": "run-s shadow:release", "shadow:release": "npx shadow-cljs release app", - "lib": "npx shadow-cljs compile node-lib " + "lib": "npx shadow-cljs release npm-module" }, "dependencies": { "@codemirror/language": "^6.6.0", diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 535e25c..53fec63 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -38,16 +38,29 @@ :output-to "resources/test/ci.js" :ns-regexp "-test$" :compiler-options {:static-fns false}} - :node-lib {:target :node-library - :output-dir "./resources/node/" - :output-to "./resources/node/lib.js" - :exports-fn mockingbird.node/generate-exports - :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/node/output.css")]}}} + :npm-module {:target :npm-module + :output-dir "./target/" + :entries [mockingbird.components.button + mockingbird.components.breadcrumb + mockingbird.components.aside + mockingbird.components.filedropdown + mockingbird.components.form + mockingbird.components.hero + mockingbird.components.icon + mockingbird.components.input + mockingbird.components.image + ;; [mockingbird.components.popup [popup]] + ;; [mockingbird.components.profile [profile]] + mockingbird.components.selectdropdown + #_[mockingbird.components.status [status]] + ] + + :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/node/output.css")]}}} diff --git a/src/mockingbird/components/filedropdown.cljs b/src/mockingbird/components/filedropdown.cljs index 59878f4..d4c6567 100644 --- a/src/mockingbird/components/filedropdown.cljs +++ b/src/mockingbird/components/filedropdown.cljs @@ -5,7 +5,7 @@ (def styles {}) -(defnc form-dropdown +(defnc filedropdown [{:keys [class theme label children] :or {theme :mockingbird diff --git a/src/mockingbird/components/selectdropdown.cljs b/src/mockingbird/components/selectdropdown.cljs index 4240adb..8973d44 100644 --- a/src/mockingbird/components/selectdropdown.cljs +++ b/src/mockingbird/components/selectdropdown.cljs @@ -6,7 +6,7 @@ ;; TODO (def styles {}) -(defnc select-dropdown +(defnc selectdropdown [{:keys [class theme label children] :or {theme :mockingbird diff --git a/src/mockingbird/components/status.cljs b/src/mockingbird/components/status.cljs index 8dc0918..0d2c5cb 100644 --- a/src/mockingbird/components/status.cljs +++ b/src/mockingbird/components/status.cljs @@ -1,6 +1,6 @@ (ns mockingbird.components.status (:require - [mockingbird.lib :refer [defnc]] + [mockingbird.lib :refer-macros [defnc]] [helix.core :refer [$]] [helix.hooks :as hooks] [helix.dom :as d] diff --git a/src/mockingbird/node.cljs b/src/mockingbird/node.cljs deleted file mode 100644 index 118033c..0000000 --- a/src/mockingbird/node.cljs +++ /dev/null @@ -1,16 +0,0 @@ -(ns mockingbird.node - (:require - [mockingbird.components.button :refer [button]] - [mockingbird.components.input :refer [input]] - [mockingbird.components.image :refer [image pfp]])) - -(defn hello [] - (prn "hello") - "hello") - -(defn generate-exports [] - #js{:hello hello - :button button - :image image - :pfp pfp - :input input}) From 5c550a60d709487de3d09d27648dd3d6800ebc0c Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Thu, 12 Sep 2024 20:19:16 -0300 Subject: [PATCH 09/37] fix: comma on package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f050d9c..d166f27 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "mockingbird-cljs", "version": "0.0.1", "private": true, - "main": "target/mockingbird-lib.js" + "main": "target/mockingbird-lib.js", "devDependencies": { "@testing-library/react": "^14.0.0", "autoprefixer": "^10.4.14", From 9b58fd28805fed456c5f84ed91e53521e5642627 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Tue, 17 Sep 2024 16:17:51 -0300 Subject: [PATCH 10/37] feat: adds webpack config --- .gitignore | 2 +- package-lock.json | 1264 +++++++++++++++++++++++++--- package.json | 9 +- resources/index.src.html | 1 - shadow-cljs.edn | 9 +- src/mockingbird/css/tailwind.css | 3 + src/mockingbird/examples/main.cljs | 2 +- webpack.config.js | 22 + 8 files changed, 1168 insertions(+), 144 deletions(-) create mode 100644 src/mockingbird/css/tailwind.css create mode 100644 webpack.config.js diff --git a/.gitignore b/.gitignore index baa1528..707870c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ pom.xml.asc /resources/public/assets /resources/public/css/ /resources/test/ -/resources/node/ +/dist/ diff --git a/package-lock.json b/package-lock.json index 19d31b7..4c4358e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,11 +37,15 @@ "slugify": "^1.6.6", "svgmap": "^2.10.1", "tls-test": "https://tls-test.npmjs.com/tls-test-1.0.0.tgz", - "use-sync-external-store": "1.2.0" + "use-sync-external-store": "1.2.0", + "webpack": "^5.94.0", + "webpack-cli": "^5.1.4" }, "devDependencies": { "@testing-library/react": "^14.0.0", - "autoprefixer": "^10.4.14", + "autoprefixer": "^10.4.20", + "babel-loader": "^9.2.1", + "css-loader": "^7.1.2", "cssnano": "^6.0.1", "karma": "^6.4.2", "karma-chrome-launcher": "^3.2.0", @@ -68,6 +72,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", @@ -81,6 +100,178 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/compat-data": { + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.4.tgz", + "integrity": "sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz", + "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-module-transforms": "^7.25.2", + "@babel/helpers": "^7.25.0", + "@babel/parser": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.2", + "@babel/types": "^7.25.2", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz", + "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.25.6", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", + "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/compat-data": "^7.25.2", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", + "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.2" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", @@ -90,6 +281,32 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-validator-option": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", + "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.6.tgz", + "integrity": "sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/highlight": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", @@ -167,6 +384,23 @@ "node": ">=4" } }, + "node_modules/@babel/parser": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", + "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.25.6" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/runtime": { "version": "7.25.0", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.0.tgz", @@ -179,6 +413,58 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/template": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.6.tgz", + "integrity": "sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.6", + "@babel/parser": "^7.25.6", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@codemirror/autocomplete": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.0.tgz", @@ -1072,6 +1358,15 @@ "postcss": "^8.4" } }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/@floating-ui/core": { "version": "1.6.7", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.7.tgz", @@ -1178,9 +1473,7 @@ "version": "0.3.6", "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25" @@ -1871,9 +2164,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@types/js-levenshtein": { "version": "1.1.3", @@ -1886,9 +2177,7 @@ "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@types/ms": { "version": "0.7.34", @@ -2057,9 +2346,7 @@ "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6" @@ -2069,33 +2356,25 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@webassemblyjs/helper-api-error": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@webassemblyjs/helper-buffer": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@webassemblyjs/floating-point-hex-parser": "1.11.6", "@webassemblyjs/helper-api-error": "1.11.6", @@ -2106,17 +2385,13 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@webassemblyjs/helper-wasm-section": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-buffer": "1.12.1", @@ -2128,9 +2403,7 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@xtuc/ieee754": "^1.2.0" } @@ -2139,9 +2412,7 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", - "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@xtuc/long": "4.2.2" } @@ -2150,17 +2421,13 @@ "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@webassemblyjs/wasm-edit": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-buffer": "1.12.1", @@ -2176,9 +2443,7 @@ "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", @@ -2191,9 +2456,7 @@ "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-buffer": "1.12.1", @@ -2205,9 +2468,7 @@ "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@webassemblyjs/ast": "1.12.1", "@webassemblyjs/helper-api-error": "1.11.6", @@ -2221,14 +2482,56 @@ "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, + "node_modules/@webpack-cli/configtest": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", + "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", + "license": "MIT", + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", + "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", + "license": "MIT", + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", + "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", + "license": "MIT", + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, "node_modules/@xmldom/xmldom": { "version": "0.8.10", "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", @@ -2243,17 +2546,13 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true, - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@xtuc/long": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/@zxing/text-encoding": { "version": "0.9.0", @@ -2281,9 +2580,7 @@ "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", - "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2295,9 +2592,7 @@ "version": "1.9.5", "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", - "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "acorn": "^8" } @@ -2330,13 +2625,53 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-formats/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, "node_modules/ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "ajv": "^6.9.1" } @@ -2581,31 +2916,106 @@ "node": "^10 || ^12 || >=14" }, "peerDependencies": { - "postcss": "^8.1.0" + "postcss": "^8.1.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/b4a": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", + "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==", + "license": "Apache-2.0" + }, + "node_modules/babel-loader": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.2.1.tgz", + "integrity": "sha512-fqe8naHt46e0yIdkjUZYqddSXfej3AHajX+CSO5X7oy0EmPc6o5Xh+RClNoHjnieWz9AW4kZxW9yyFMhVB1QLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-cache-dir": "^4.0.0", + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 14.15.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0", + "webpack": ">=5" + } + }, + "node_modules/babel-loader/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/babel-loader/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" } }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "node_modules/babel-loader/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/babel-loader/node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, "license": "MIT", "dependencies": { - "possible-typed-array-names": "^1.0.0" + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" }, "engines": { - "node": ">= 0.4" + "node": ">= 12.13.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/b4a": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", - "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==", - "license": "Apache-2.0" - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2933,7 +3343,6 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", - "dev": true, "funding": [ { "type": "opencollective", @@ -2987,9 +3396,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/buffer-xor": { "version": "1.0.3", @@ -3070,7 +3477,6 @@ "version": "1.0.30001651", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==", - "dev": true, "funding": [ { "type": "opencollective", @@ -3167,9 +3573,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", - "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.0" } @@ -3338,6 +3742,20 @@ "node": ">=0.8" } }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "license": "MIT", + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/codemirror": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", @@ -3378,6 +3796,12 @@ "dev": true, "license": "MIT" }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "license": "MIT" + }, "node_modules/commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", @@ -3387,6 +3811,13 @@ "node": ">= 6" } }, + "node_modules/common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true, + "license": "ISC" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -3450,6 +3881,14 @@ "node": ">= 0.6" } }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/cookie": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", @@ -3686,6 +4125,42 @@ "postcss": "^8.4" } }, + "node_modules/css-loader": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.2.tgz", + "integrity": "sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA==", + "dev": true, + "license": "MIT", + "dependencies": { + "icss-utils": "^5.1.0", + "postcss": "^8.4.33", + "postcss-modules-extract-imports": "^3.1.0", + "postcss-modules-local-by-default": "^4.0.5", + "postcss-modules-scope": "^3.2.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "webpack": "^5.27.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, "node_modules/css-prefers-color-scheme": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-8.0.2.tgz", @@ -4329,7 +4804,6 @@ "version": "1.5.13", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz", "integrity": "sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==", - "dev": true, "license": "ISC" }, "node_modules/elliptic": { @@ -4438,9 +4912,7 @@ "version": "5.17.1", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -4484,6 +4956,18 @@ "node": ">=6" } }, + "node_modules/envinfo": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz", + "integrity": "sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg==", + "license": "MIT", + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -4609,9 +5093,7 @@ "version": "1.5.4", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/es-object-atoms": { "version": "1.0.0", @@ -4719,9 +5201,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -4734,9 +5214,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, "license": "BSD-2-Clause", - "peer": true, "engines": { "node": ">=4.0" } @@ -4758,9 +5236,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -4797,7 +5273,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.x" @@ -4915,6 +5390,22 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "license": "MIT" }, + "node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "license": "MIT", + "engines": { + "node": ">= 4.9.1" + } + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -5010,6 +5501,136 @@ "node": ">= 0.8" } }, + "node_modules/find-cache-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz", + "integrity": "sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "common-path-prefix": "^3.0.0", + "pkg-dir": "^7.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-cache-dir/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-cache-dir/node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-cache-dir/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-cache-dir/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-cache-dir/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/find-cache-dir/node_modules/pkg-dir": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", + "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^6.3.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", @@ -5179,6 +5800,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -5308,9 +5940,18 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "license": "BSD-2-Clause" + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, - "license": "BSD-2-Clause", - "peer": true + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } }, "node_modules/globalthis": { "version": "1.0.4", @@ -5405,7 +6046,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -5638,6 +6278,19 @@ "node": ">=0.10.0" } }, + "node_modules/icss-utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -5690,6 +6343,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -5827,6 +6499,15 @@ "node": ">= 0.4" } }, + "node_modules/interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/ip-address": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", @@ -6096,6 +6777,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "license": "MIT", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -6272,6 +6965,15 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/jackspeak": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", @@ -6294,9 +6996,7 @@ "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -6310,9 +7010,7 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -6375,6 +7073,20 @@ "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", "license": "MIT" }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -6394,6 +7106,20 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "license": "MIT" }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -6655,6 +7381,15 @@ "node": ">=10" } }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/lie": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", @@ -6723,9 +7458,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.11.5" } @@ -6739,6 +7472,18 @@ "lie": "3.1.1" } }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -6867,9 +7612,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", @@ -6931,7 +7674,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -6941,7 +7683,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -7183,9 +7924,7 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/netmask": { "version": "2.0.2", @@ -7259,7 +7998,6 @@ "version": "2.0.18", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", - "dev": true, "license": "MIT" }, "node_modules/normalize-package-data": { @@ -7681,6 +8419,42 @@ "dev": true, "license": "MIT" }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/pac-proxy-agent": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz", @@ -7816,6 +8590,15 @@ "dev": true, "license": "MIT" }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -7946,6 +8729,18 @@ "node": ">= 6" } }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/possible-typed-array-names": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", @@ -8731,6 +9526,69 @@ "postcss": "^8.4.31" } }, + "node_modules/postcss-modules-extract-imports": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", + "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-local-by-default": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.5.tgz", + "integrity": "sha512-6MieY7sIfTK0hYfafw1OMEG+2bg8Q1ocHCpoWLqOKj3JXlKu4G7btkmM/B7lFubYkYWmRSPLZi5chid63ZaZYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-scope": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.0.tgz", + "integrity": "sha512-oq+g1ssrsZOsx9M96c5w8laRmvEu9C3adDSjI8oTcbfkrTE8hx/zfyobUoWIxaKPO8bt6S62kxpw5GqypEw1QQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "postcss-selector-parser": "^6.0.4" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "icss-utils": "^5.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, "node_modules/postcss-nested": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", @@ -9593,7 +10451,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" @@ -9838,6 +10695,18 @@ "node": ">= 0.8.0" } }, + "node_modules/rechoir": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "license": "MIT", + "dependencies": { + "resolve": "^1.20.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", @@ -9872,6 +10741,16 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -9896,6 +10775,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -10046,7 +10946,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -10101,9 +11000,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -10133,9 +11030,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "randombytes": "^2.1.0" } @@ -10237,6 +11132,18 @@ "dev": true, "license": "ISC" }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "license": "MIT", + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -11067,9 +11974,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -11103,9 +12008,7 @@ "version": "5.31.6", "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", - "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -11123,9 +12026,7 @@ "version": "5.3.10", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", @@ -11159,17 +12060,13 @@ "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/terser/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "license": "BSD-3-Clause", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -11178,9 +12075,7 @@ "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -11266,6 +12161,17 @@ "dev": true, "license": "MIT" }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -11526,7 +12432,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", - "dev": true, "funding": [ { "type": "opencollective", @@ -11681,9 +12586,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -11739,9 +12642,7 @@ "version": "5.94.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", - "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", @@ -11783,13 +12684,79 @@ } } }, + "node_modules/webpack-cli": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", + "license": "MIT", + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^2.1.1", + "@webpack-cli/info": "^2.0.2", + "@webpack-cli/serve": "^2.0.5", + "colorette": "^2.0.14", + "commander": "^10.0.1", + "cross-spawn": "^7.0.3", + "envinfo": "^7.7.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/webpack-cli/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/webpack-merge": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", + "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", + "license": "MIT", + "dependencies": { + "clone-deep": "^4.0.1", + "flat": "^5.0.2", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10.13.0" } @@ -11873,6 +12840,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wildcard": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", + "license": "MIT" + }, "node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -12011,6 +12984,14 @@ "node": ">=10" } }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC", + "peer": true + }, "node_modules/yaml": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", @@ -12101,6 +13082,19 @@ "fd-slicer": "~1.1.0" } }, + "node_modules/yocto-queue": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/zod": { "version": "3.23.8", "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", diff --git a/package.json b/package.json index d166f27..bf8fefe 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,11 @@ "name": "mockingbird-cljs", "version": "0.0.1", "private": true, - "main": "target/mockingbird-lib.js", "devDependencies": { "@testing-library/react": "^14.0.0", - "autoprefixer": "^10.4.14", + "autoprefixer": "^10.4.20", + "babel-loader": "^9.2.1", + "css-loader": "^7.1.2", "cssnano": "^6.0.1", "karma": "^6.4.2", "karma-chrome-launcher": "^3.2.0", @@ -60,7 +61,9 @@ "slugify": "^1.6.6", "svgmap": "^2.10.1", "tls-test": "https://tls-test.npmjs.com/tls-test-1.0.0.tgz", - "use-sync-external-store": "1.2.0" + "use-sync-external-store": "1.2.0", + "webpack": "^5.94.0", + "webpack-cli": "^5.1.4" }, "msw": { "workerDirectory": "resources/test" diff --git a/resources/index.src.html b/resources/index.src.html index debbc20..df65536 100644 --- a/resources/index.src.html +++ b/resources/index.src.html @@ -9,7 +9,6 @@ Mockingbird - diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 53fec63..f52d92b 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -39,7 +39,7 @@ :ns-regexp "-test$" :compiler-options {:static-fns false}} :npm-module {:target :npm-module - :output-dir "./target/" + :output-dir "./target/src/" :entries [mockingbird.components.button mockingbird.components.breadcrumb mockingbird.components.aside @@ -53,7 +53,10 @@ ;; [mockingbird.components.profile [profile]] mockingbird.components.selectdropdown #_[mockingbird.components.status [status]] - ] + mockingbird.layout.auth + mockingbird.layout.footer + mockingbird.layout.header + mockingbird.layout.navbar] :compiler-options {:optimizations :advanced :infer-externs :auto @@ -63,4 +66,4 @@ :build-hooks [(dev.shadow.hooks/build-css false "./src/mockingbird/css/tailwind.css" - "./resources/node/output.css")]}}} + "./target/src/output.css")]}}} diff --git a/src/mockingbird/css/tailwind.css b/src/mockingbird/css/tailwind.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/src/mockingbird/css/tailwind.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/src/mockingbird/examples/main.cljs b/src/mockingbird/examples/main.cljs index de8dab4..6b93ea5 100644 --- a/src/mockingbird/examples/main.cljs +++ b/src/mockingbird/examples/main.cljs @@ -14,7 +14,7 @@ (defnc app [] (d/div {:class "w-screen h-screen"} ($ header - ($ nav-bar) + #_($ nav-bar) ($ hero)) (comment ($ aside)) ($ main (d/p "ok")) diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..69acae4 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,22 @@ +const path = require('path'); + +module.exports = { + context: path.resolve(__dirname, 'target'), + module: { + rules: [ + { + test: /\.js$/, + use: 'babel-loader', + exclude: /node_modules/, + }, + { + test: /\.css$/, + use: ['style-loader', 'css-loader'], + }, + ], + }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'bundle.js', + }, +}; From cccbe1a505c6fb756782e48c957fa3f3df59f1c3 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Wed, 18 Sep 2024 13:20:24 -0300 Subject: [PATCH 11/37] chore: webpack and npm module config --- .github/workflows/release.yml | 3 +- package.json | 9 ++- shadow-cljs.edn | 28 +++----- src/mockingbird/components/hero.cljs | 2 +- src/mockingbird/components/image.cljs | 30 -------- src/mockingbird/components/pfp.cljs | 37 ++++++++++ src/mockingbird/components/profile.cljs | 96 ------------------------- webpack.config.js | 13 ++-- 8 files changed, 62 insertions(+), 156 deletions(-) create mode 100644 src/mockingbird/components/pfp.cljs delete mode 100644 src/mockingbird/components/profile.cljs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45eae3d..56cea88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,5 @@ jobs: CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} run: | npm ci && \ - npm run release && \ - npm release + npm run lib diff --git a/package.json b/package.json index bf8fefe..04f06e3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,12 @@ { "name": "mockingbird-cljs", "version": "0.0.1", - "private": true, + "main": "dist/bundle.js", + "files": [ + "dist/", + "README.md", + "docs/" + ], "devDependencies": { "@testing-library/react": "^14.0.0", "autoprefixer": "^10.4.20", @@ -29,7 +34,7 @@ "repl": "npx shadow-cljs clj-repl", "release": "run-s shadow:release", "shadow:release": "npx shadow-cljs release app", - "lib": "npx shadow-cljs release npm-module" + "lib": "npx shadow-cljs release npm-module && npx webpack --config webpack.config.js" }, "dependencies": { "@codemirror/language": "^6.6.0", diff --git a/shadow-cljs.edn b/shadow-cljs.edn index f52d92b..7b46747 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -38,25 +38,13 @@ :output-to "resources/test/ci.js" :ns-regexp "-test$" :compiler-options {:static-fns false}} - :npm-module {:target :npm-module - :output-dir "./target/src/" - :entries [mockingbird.components.button - mockingbird.components.breadcrumb - mockingbird.components.aside - mockingbird.components.filedropdown - mockingbird.components.form - mockingbird.components.hero - mockingbird.components.icon - mockingbird.components.input - mockingbird.components.image - ;; [mockingbird.components.popup [popup]] - ;; [mockingbird.components.profile [profile]] - mockingbird.components.selectdropdown - #_[mockingbird.components.status [status]] - mockingbird.layout.auth - mockingbird.layout.footer - mockingbird.layout.header - mockingbird.layout.navbar] + :npm-module {:target :npm-module + :output-dir "./target/" + :asset-path "./target" + :exports {:components mockingbird.components + :layout mockingbird.layout + :helpers mockingbird.helpers + :lib mockingbird.lib} :compiler-options {:optimizations :advanced :infer-externs :auto @@ -66,4 +54,4 @@ :build-hooks [(dev.shadow.hooks/build-css false "./src/mockingbird/css/tailwind.css" - "./target/src/output.css")]}}} + "./target/output.css")]}}} diff --git a/src/mockingbird/components/hero.cljs b/src/mockingbird/components/hero.cljs index f8525a0..37d1730 100644 --- a/src/mockingbird/components/hero.cljs +++ b/src/mockingbird/components/hero.cljs @@ -4,7 +4,7 @@ [helix.core :refer [$]] [mockingbird.lib :refer-macros [defnc]] [mockingbird.components.button :refer [button]] - [mockingbird.components.image :refer [pfp]])) + [mockingbird.components.pfp :refer [pfp]])) (defnc hero [] (d/div {:class "group w-screen h-screen bg-gray-50 flex items-center justify-left pl-16"} diff --git a/src/mockingbird/components/image.cljs b/src/mockingbird/components/image.cljs index 4b7f3c1..43f9ceb 100644 --- a/src/mockingbird/components/image.cljs +++ b/src/mockingbird/components/image.cljs @@ -5,36 +5,6 @@ [mockingbird.lib :refer-macros [defnc]] [helix.dom :as d])) -(def pfp-styles - {:default "w-8 h-8 rounded-none opacity-100" - :rounded "w-8 h-8 rounded-full opacity-100" - :loading "w-8 h-8 rounded-full opacity-30 animate-pulse"}) - -(defnc pfp - [{:keys [class theme image - alt size roundness - shadow margin padding - children] - :or {theme :mockingbird - image "/images/logo.png" - alt "test" - size :md - roundness :none - shadow :none - margin :none - padding :none}}] - (d/div - (d/img {:class (str (get pfp-styles theme) " " - (get-props - {:size size - :roundness roundness - :shadow shadow - :margin margin - :padding padding - :class class})) - :src image - :alt alt}) - children)) (defnc image [{:keys [class theme image diff --git a/src/mockingbird/components/pfp.cljs b/src/mockingbird/components/pfp.cljs new file mode 100644 index 0000000..a1f8a4a --- /dev/null +++ b/src/mockingbird/components/pfp.cljs @@ -0,0 +1,37 @@ +(ns mockingbird.components.pfp + (:refer-clojure :exclude [class]) + (:require + [mockingbird.helpers.props :refer [get-props]] + [mockingbird.lib :refer-macros [defnc]] + [helix.dom :as d])) + +(def pfp-styles + {:default "w-8 h-8 rounded-none opacity-100" + :rounded "w-8 h-8 rounded-full opacity-100" + :loading "w-8 h-8 rounded-full opacity-30 animate-pulse"}) + +(defnc pfp + [{:keys [class theme image + alt size roundness + shadow margin padding + children] + :or {theme :mockingbird + image "/images/logo.png" + alt "test" + size :md + roundness :none + shadow :none + margin :none + padding :none}}] + (d/div + (d/img {:class (str (get pfp-styles theme) " " + (get-props + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) + :src image + :alt alt}) + children)) diff --git a/src/mockingbird/components/profile.cljs b/src/mockingbird/components/profile.cljs deleted file mode 100644 index a229d50..0000000 --- a/src/mockingbird/components/profile.cljs +++ /dev/null @@ -1,96 +0,0 @@ -(ns mockingbird.components.profile - (:require [clojure.string :as str] - [mockingbird.lib :refer-macros [defnc]] - [helix.core :refer [$]] - [helix.dom :as d] - [helix.hooks :as hooks] - [promesa.core :as p] - [refx.alpha :as refx])) - -(defn get-image-style - [{:keys [children image-style]}] - (let [image-style (keyword image-style)] - (str (get pfp-styles image-style) - children))) - -;; TODO integrate this to the normal pfp - -(defnc pfp-img - [{:keys [image-style - pfp-loading? pfp-url] :as props}] - (let [classes (get-image-style props)] - (d/img {:class-name classes & (dissoc props :image-style) - :src (if (= true pfp-loading?) - "/images/default-pfp.png" - pfp-url)}))) - -(defnc user-profile [{:keys [user-data]}] - (let [[pfp-url set-pfp-url!] (hooks/use-state nil) - username (:username user-data) - default-pfp-url (if username - (get-simple-avatar-url username) - "/images/default-pfp.png") - pfp-loading? (and (nil? pfp-url) (not= pfp-url default-pfp-url)) - [dropdown-open? toggle-dropdown!] (hooks/use-state false)] - - ;; https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest - ;; https://cdn.auth0.com/avatars/jt.png - (hooks/use-effect - [pfp-url] - (when (and pfp-loading? (nil? pfp-url)) - (if-let [email (some->> (:email user-data) - str/trim - str/lower-case - (.encode (js/TextEncoder. "utf-8")))] - (-> (.digest (.-subtle js/crypto) "SHA-256" email) - (p/then - (fn [hash-buf] - (-> (.from js/Array (js/Uint8Array. hash-buf)) - (.map #(-> (.toString % 16) - (.padStart 2 "0"))) - (.join "")))) - (p/then - (fn [hex] - (set-pfp-url! (str gravatar-base-url hex - "?default=" default-pfp-url)))) - (p/catch - (fn [err] - (.log js/console "failed to digest email hash:" err) - (set-pfp-url! default-pfp-url)))) - (set-pfp-url! default-pfp-url)))) - - (d/div {:class-name "hidden lg:block"} - (d/button {:type "button" - :class-name (str "flex text-sm bg-gray-800 aspect-square rounded-full " - (when dropdown-open? "focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600")) - :on-click #(toggle-dropdown! not)} - (d/span {:class-name "sr-only"} "Open user menu") - ($ pfp-img {:image-style "rounded" - :pfp-loading? pfp-loading? - :pfp-url pfp-url})) - (d/div {:class-name (str "absolute z-50 my-4 right-0 text-base list-none bg-white rounded divide-y" - "divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600 " - (when-not dropdown-open? "hidden"))} - (d/div {:class-name "py-3 px-4" :role "none"} - (d/p {:class-name "text-sm font-medium text-gray-900 truncate dark:text-gray-300" :role "none"} - (:email user-data))) - (d/ul {:class-name "py-1" :role "none"} - (d/li - (d/a {:href "" - ;; TODO settings - :class-name "block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-600 dark:hover:text-white" - :role "menuitem"} - "Settings")) - - (d/li - (d/button - {:class-name (str "w-full block py-2 px-4 text-sm text-left text-gray-700 hover:bg-gray-100" - "dark:text-gray-300 dark:hover:bg-gray-600 dark:hover:text-white") - :on-click (fn [e] - (.preventDefault e) - (supabase/sign-out - #(refx/dispatch-sync [:app.auth/logout %]))) - :role "menuitem"} - "Logout"))))))) - - diff --git a/webpack.config.js b/webpack.config.js index 69acae4..767858a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,22 +1,25 @@ -const path = require('path'); +const path = require('path'); // Use Node.js 'path' module module.exports = { + mode: 'production', context: path.resolve(__dirname, 'target'), + entry: './mockingbird.lib.js', module: { rules: [ { - test: /\.js$/, + test: /\.js$/, use: 'babel-loader', - exclude: /node_modules/, + exclude: /node_modules/, }, { - test: /\.css$/, + test: /\.css$/, // Match CSS files use: ['style-loader', 'css-loader'], }, ], }, output: { - path: path.resolve(__dirname, 'dist'), + path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', }, }; +; From 7cd6fed8469bd736e7abe6c45991c4fd1fe5b319 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Wed, 18 Sep 2024 16:36:36 -0300 Subject: [PATCH 12/37] feat: build jar back and gh releases --- .github/workflows/npm.yml | 24 ++++++++++++++++++++++++ .github/workflows/release.yml | 7 ++++--- build.clj | 30 ++++++++++++++++++++++++++++++ deps.edn | 8 +++++++- package.json | 2 +- 5 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/npm.yml create mode 100644 build.clj diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..1231fd2 --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,24 @@ +name: Npm-Release + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + - uses: "DeLaGuardo/setup-clojure@12.5" + with: + node-version: "20" + - name: + run: | + npm ci && \ + npm run lib + - uses: "JS-DevTools/npm-publish@v3.1.1" + with: + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56cea88..7593ed3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ on: jobs: clojars: runs-on: ubuntu-latest - environment: release + environment: env defaults: run: shell: bash @@ -23,6 +23,7 @@ jobs: CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} run: | - npm ci && \ - npm run lib + clojure -T:dev:build clean && \ + clojure -T:dev:build jar && \ + clojure -X:deploy-clojars diff --git a/build.clj b/build.clj new file mode 100644 index 0000000..e02904a --- /dev/null +++ b/build.clj @@ -0,0 +1,30 @@ +(ns build + (:require [clojure.tools.build.api :as b])) + +(def lib 'com.github.moclojer/mockingbird) +(def version "0.0.1") +(def class-dir "target/classes") +(def basis (b/create-basis {:project "deps.edn"})) +(def jar-file (format "target/%s-%s.jar" (name lib) version)) + + +(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})) diff --git a/deps.edn b/deps.edn index 5a0a583..9a4068e 100644 --- a/deps.edn +++ b/deps.edn @@ -17,4 +17,10 @@ :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} + :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.github.moclojer/mockingbird/pom.xml" + :artifact build/jar-file}}}} diff --git a/package.json b/package.json index 04f06e3..b009d43 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "mockingbird-cljs", + "name": "mockingbird-lib", "version": "0.0.1", "main": "dist/bundle.js", "files": [ From f8100ccb7127486b20f5b018675c7ab64471670d Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Wed, 18 Sep 2024 16:47:39 -0300 Subject: [PATCH 13/37] fix: minor issues fix: release yml actions versions and deps.edn versions --- .github/workflows/npm.yml | 4 ++-- deps.edn | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 1231fd2..e7a6e39 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - uses: "DeLaGuardo/setup-clojure@12.5" + - uses: actions/setup-node@v3 with: node-version: "20" - - name: + - name: Build and package the library run: | npm ci && \ npm run lib diff --git a/deps.edn b/deps.edn index 9a4068e..b0be66a 100644 --- a/deps.edn +++ b/deps.edn @@ -18,9 +18,9 @@ :main-opts ["-m" "clojure-lsp.main"]} :build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.4"}} :ns-default build} - :deploy-clojars {:extra-deps {slipset/deps-deploy {:mvn/version (build/version)}} + :deploy-clojars {:extra-deps {slipset/deps-deploy {:mvn/version "RELEASE"}} :exec-fn deps-deploy.deps-deploy/deploy :exec-args {:installer :remote :sign-releases? false :pom-file "target/classes/META-INF/maven/com.github.moclojer/mockingbird/pom.xml" - :artifact build/jar-file}}}} + :artifact "target/mockingbird-0.0.1.jar"}}}} From 33477ad60517bf09778db4955da68c44dd1eed7e Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Fri, 20 Sep 2024 20:42:16 -0300 Subject: [PATCH 14/37] fix: testing compiling options --- README.md | 22 ++++++++++++++++++++-- deps.edn | 2 +- package.json | 6 +++++- shadow-cljs.edn | 3 ++- src/mockingbird/components/button.cljs | 6 +++++- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c7ab9c4..de26718 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Design System using [tailwind](https://tailwindcss.com/) and [helix](https://git A simple way to develop a user interface with a consistent user experience, without the need to clutter `cljs` code with **CSS**. +> if your desire is to use mockingbird without ClojureScript (how you dare!) you can of course use our npm package into your JS application. Read more [here](#Installation). + ## name reference? > "mockingbird" is for everyone! @@ -24,19 +26,35 @@ Prerequisites Before you begin, ensure you have the following installed: - Clojure: Follow the [Clojure Installation guide](https://clojure.org/guides/install_clojure) to set up your environment. -- [Node.js](https://nodejs.org/en/download/prebuilt-installer/current). +- [Node](https://nodejs.org/en/download/prebuilt-installer/current). - [npm](https://www.npmjs.com/package/downloads). # Installation -We distribute our software via Clojars, so you are can just plug and play! +We distribute our software via npm and clojars, so you can choose whatever fits best for you. + +npm: +``` bash + +npm i mockingbird-lib + +``` + +if you are prone to build using our clojar, you will also need to install the deps on node and start a project with shadow-cljs!!! read more [here](# Testing Locally) +deps.edn: ``` clj ;; TODO ``` +leiningen: +``` clj +;; TODO + +``` + # Usage diff --git a/deps.edn b/deps.edn index b0be66a..4578098 100644 --- a/deps.edn +++ b/deps.edn @@ -3,7 +3,7 @@ org.clojure/clojurescript {:mvn/version "1.11.60"} com.google.javascript/closure-compiler-unshaded {:mvn/version "v20220803"} com.fbeyer/refx {:mvn/version "0.0.49"} - lilactown/helix {:mvn/version "0.1.9"} + lilactown/helix {:mvn/version "0.1.11"} funcool/promesa {:mvn/version "9.0.494"} metosin/reitit-schema {:mvn/version "0.5.18"} metosin/reitit-frontend {:mvn/version "0.5.18"} diff --git a/package.json b/package.json index b009d43..17dfffc 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "files": [ "dist/", "README.md", - "docs/" + "docs/" ], "devDependencies": { "@testing-library/react": "^14.0.0", @@ -25,6 +25,10 @@ "shadow-cljs": "^2.23.3", "tailwindcss": "^3.3.2" }, + "resolutions": { + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, "scripts": { "ci:karma-make": "npx msw init resources/test", "ci:tests": "npm run ci:karma-make && npx shadow-cljs compile ci-tests && npx karma start --single-run", diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 7b46747..25d51e4 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -45,7 +45,8 @@ :layout mockingbird.layout :helpers mockingbird.helpers :lib mockingbird.lib} - + :js-options {:js-provider :import} + :module-type :es6 :compiler-options {:optimizations :advanced :infer-externs :auto :source-map true diff --git a/src/mockingbird/components/button.cljs b/src/mockingbird/components/button.cljs index 2badfe5..b1fedaf 100644 --- a/src/mockingbird/components/button.cljs +++ b/src/mockingbird/components/button.cljs @@ -8,7 +8,7 @@ {:default {:mockingbird "group inline-flex ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300 "} :highlight {:mockingbird "group inline-flex ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 bg-mockingbird-main text-gray-50 bg-mockingbird-main hover:bg-mockingbird-700 text-gray-50"}}) -(defnc button +(defnc Button [{:keys [class theme type disabled label on-click children] @@ -24,3 +24,7 @@ :type type :disabled disabled} children))) + + +(defn ^:export button [{:keys [keys]}] + (Button {:keys keys})) From 8edc81c943529db9b3a42e68a21a58662c271884 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Mon, 23 Sep 2024 14:20:58 -0300 Subject: [PATCH 15/37] test: exporting fn button --- src/mockingbird/components/button.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mockingbird/components/button.cljs b/src/mockingbird/components/button.cljs index b1fedaf..7130179 100644 --- a/src/mockingbird/components/button.cljs +++ b/src/mockingbird/components/button.cljs @@ -8,7 +8,7 @@ {:default {:mockingbird "group inline-flex ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300 "} :highlight {:mockingbird "group inline-flex ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 bg-mockingbird-main text-gray-50 bg-mockingbird-main hover:bg-mockingbird-700 text-gray-50"}}) -(defnc Button +(defnc ^:export Button [{:keys [class theme type disabled label on-click children] @@ -27,4 +27,4 @@ (defn ^:export button [{:keys [keys]}] - (Button {:keys keys})) + ( Button {:keys keys})) From ee3a3933a3fad210aa7467503f0a219a857ded41 Mon Sep 17 00:00:00 2001 From: J0sueTM Date: Mon, 23 Sep 2024 15:53:48 -0300 Subject: [PATCH 16/37] feat: diff prod and dev on webpack bundle --- package-lock.json | 4 ++-- package.json | 6 +++++- webpack.config.js | 51 ++++++++++++++++++++++++++--------------------- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4c4358e..ca143a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "mockingbird-cljs", + "name": "mockingbird-lib", "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "mockingbird-cljs", + "name": "mockingbird-lib", "version": "0.0.1", "dependencies": { "@codemirror/language": "^6.6.0", diff --git a/package.json b/package.json index 17dfffc..4c84ae4 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,11 @@ "repl": "npx shadow-cljs clj-repl", "release": "run-s shadow:release", "shadow:release": "npx shadow-cljs release app", - "lib": "npx shadow-cljs release npm-module && npx webpack --config webpack.config.js" + "shadow:lib": "npx shadow-cljs release npm-module", + "dev:webpack": "npx webpack --config webpack.config.js --env isProduction=false", + "prod:webpack": "npx webpack --config webpack.config.js --env isProduction=true", + "dev:lib": "run-s shadow:lib dev:webpack", + "prod:lib": "run-s shadow:lib prod:webpack" }, "dependencies": { "@codemirror/language": "^6.6.0", diff --git a/webpack.config.js b/webpack.config.js index 767858a..6c8b26e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,25 +1,30 @@ -const path = require('path'); // Use Node.js 'path' module +const path = require('path'); -module.exports = { - mode: 'production', - context: path.resolve(__dirname, 'target'), - entry: './mockingbird.lib.js', - module: { - rules: [ - { - test: /\.js$/, - use: 'babel-loader', - exclude: /node_modules/, - }, - { - test: /\.css$/, // Match CSS files - use: ['style-loader', 'css-loader'], - }, - ], - }, - output: { - path: path.resolve(__dirname, 'dist'), - filename: 'bundle.js', - }, +module.exports = (env) => { + const isProduction = env.isProduction === 'true'; + + return { + mode: (isProduction ? 'production' : 'development'), + context: path.resolve(__dirname, 'target'), + entry: './mockingbird.lib.js', + module: { + rules: [ + { + test: /\.js$/, + use: 'babel-loader', + exclude: /node_modules/, + }, + { + test: /\.css$/, + use: ['style-loader', 'css-loader'], + }, + ], + }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'mockingbird-lib' + + (isProduction ? '.min' : '') + + '.js', + }, + }; }; -; From e48e40a4c626f4fbf10b2cf261b4555f74ffd605 Mon Sep 17 00:00:00 2001 From: Avelino <31996+avelino@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:20:55 -0300 Subject: [PATCH 17/37] Update webpack.config.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- webpack.config.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 6c8b26e..da1cb94 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -22,9 +22,7 @@ module.exports = (env) => { }, output: { path: path.resolve(__dirname, 'dist'), - filename: 'mockingbird-lib' + - (isProduction ? '.min' : '') + - '.js', + filename: `mockingbird-lib${isProduction ? '.min' : ''}.js`, }, }; }; From 99e1d8c5c4e55866c45f7b793d0cd375d52ddbb1 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Tue, 24 Sep 2024 18:46:39 -0300 Subject: [PATCH 18/37] feat: submit button --- package.json | 16 +++++++-------- src/mockingbird/components/button.cljs | 27 +++++++++++++++++++------- src/mockingbird/components/hero.cljs | 3 ++- src/mockingbird/examples/main.cljs | 4 ++-- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 4c84ae4..2d26d4d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mockingbird-lib", "version": "0.0.1", - "main": "dist/bundle.js", + "main": "dist/mockingbird-lib.js", "files": [ "dist/", "README.md", @@ -23,7 +23,12 @@ "postcss-loader": "^7.3.3", "postcss-preset-env": "^8.5.0", "shadow-cljs": "^2.23.3", - "tailwindcss": "^3.3.2" + "tailwindcss": "^3.3.2", + "webpack": "^5.94.0", + "webpack-cli": "^5.1.4", + "rimraf": "^6.0.1", + "glob": "^11.0.0", + "@isaacs/cliui": "^8.0.2" }, "resolutions": { "react": "^18.2.0", @@ -50,7 +55,6 @@ "@codemirror/lint": "^6.4.2", "@codemirror/state": "^6.3.3", "@codemirror/view": "^6.22.3", - "@isaacs/cliui": "^8.0.2", "@sentry/cli": "^2.31.0", "@sentry/react": "^7.109.0", "@supabase/supabase-js": "^2.25.0", @@ -61,7 +65,6 @@ "cross-env": "^7.0.3", "flowbite": "^1.6.6", "flowbite-react": "^0.4.7", - "glob": "^11.0.0", "js-cookie": "^3.0.5", "js-yaml": "^4.1.0", "postcss-focus-visible": "^8.0.2", @@ -70,13 +73,10 @@ "react-dom": "18.2.0", "react-refresh": "^0.14.0", "react-router-dom": "^6.13.0", - "rimraf": "^6.0.1", "slugify": "^1.6.6", "svgmap": "^2.10.1", "tls-test": "https://tls-test.npmjs.com/tls-test-1.0.0.tgz", - "use-sync-external-store": "1.2.0", - "webpack": "^5.94.0", - "webpack-cli": "^5.1.4" + "use-sync-external-store": "1.2.0" }, "msw": { "workerDirectory": "resources/test" diff --git a/src/mockingbird/components/button.cljs b/src/mockingbird/components/button.cljs index 7130179..ea761f1 100644 --- a/src/mockingbird/components/button.cljs +++ b/src/mockingbird/components/button.cljs @@ -1,30 +1,43 @@ (ns mockingbird.components.button (:refer-clojure :exclude [type class]) (:require + [mockingbird.helpers.props :refer [get-props]] [mockingbird.lib :refer-macros [defnc]] [helix.dom :as d])) (def styles - {:default {:mockingbird "group inline-flex ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300 "} - :highlight {:mockingbird "group inline-flex ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 bg-mockingbird-main text-gray-50 bg-mockingbird-main hover:bg-mockingbird-700 text-gray-50"}}) + {:default {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300 "} + :highlight {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center py-2 px-4 text-sm focus:outline-none ring-slate-200 text-gray-50 bg-mockingbird-main hover:bg-mockingbird-700 text-gray-50 "} + :submit {:mockingbird "group transition-all py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-mockingbird-main hover:bg-mockingbird-700 focus:ring-4 focus:ring-primary-300 transition-all"}}) -(defnc ^:export Button +(defnc ^:export button [{:keys [class theme type disabled label on-click - children] + size roundness shadow + margin padding children] :or {type :default theme :mockingbird on-click (fn [_]) disabled false + roundness :none + size :none + shadow :none + margin :none + padding :none children "Insert some text"}}] (d/div (d/button - {:class (str (get-in styles [type theme]) " " class) + {:class (str (get-in styles [type theme]) " " + (get-props + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) :on-click on-click :type type :disabled disabled} children))) -(defn ^:export button [{:keys [keys]}] - ( Button {:keys keys})) diff --git a/src/mockingbird/components/hero.cljs b/src/mockingbird/components/hero.cljs index 37d1730..f6144eb 100644 --- a/src/mockingbird/components/hero.cljs +++ b/src/mockingbird/components/hero.cljs @@ -17,6 +17,7 @@ ($ button {:theme :mockingbird :class "mr-2"} "Learn More") ($ button {:type :highlight - :theme :mockingbird} "Test It Out"))))) + :theme :mockingbird + :roundness :full} "Test It Out"))))) ;; TODO: Implement the hero component diff --git a/src/mockingbird/examples/main.cljs b/src/mockingbird/examples/main.cljs index 6b93ea5..d47168e 100644 --- a/src/mockingbird/examples/main.cljs +++ b/src/mockingbird/examples/main.cljs @@ -12,9 +12,9 @@ ;; TODO create a example to render on this app and demonstrate the components power! (defnc app [] - (d/div {:class "w-screen h-screen"} + (d/div {:class "w-screen h-screen "} ($ header - #_($ nav-bar) + ($ nav-bar) ($ hero)) (comment ($ aside)) ($ main (d/p "ok")) From 8baba2275bfb6fcd1e15163a8a578aea7247e7ce Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Tue, 24 Sep 2024 20:28:55 -0300 Subject: [PATCH 19/37] feat: loading prop and fixes on example page --- .babelrc | 3 +++ package.json | 6 +++-- src/mockingbird/components/button.cljs | 16 +++++++------ src/mockingbird/components/hero.cljs | 26 ++++++++++++--------- src/mockingbird/components/image.cljs | 31 ++++++++++++++------------ src/mockingbird/components/input.cljs | 22 ++++++++++++++---- src/mockingbird/components/pfp.cljs | 29 +++++++++++++----------- src/mockingbird/examples/main.cljs | 2 +- src/mockingbird/helpers/props.cljs | 2 +- 9 files changed, 85 insertions(+), 52 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..2b7bafa --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/preset-env", "@babel/preset-react"] +} diff --git a/package.json b/package.json index 2d26d4d..3f44639 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,11 @@ "ci:tests": "npm run ci:karma-make && npx shadow-cljs compile ci-tests && npx karma start --single-run", "postcss:build": "npx cross-env TAILWIND_MODE=build postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/output.css --verbose", "postcss:watch": "npx cross-env TAILWIND_MODE=watch postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/output.css --verbose -w", - "watch": "npx shadow-cljs watch app", + "watch": "run-p shadow:watch-css shadow:watch-cljs", + "shadow:watch-css": "npx cross-env TAILWIND_MODE=watch postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/output.css --verbose -w", + "shadow:watch-cljs": "npx shadow-cljs watch app", "repl": "npx shadow-cljs clj-repl", - "release": "run-s shadow:release", + "release": "run-s postcss:build shadow:release", "shadow:release": "npx shadow-cljs release app", "shadow:lib": "npx shadow-cljs release npm-module", "dev:webpack": "npx webpack --config webpack.config.js --env isProduction=false", diff --git a/src/mockingbird/components/button.cljs b/src/mockingbird/components/button.cljs index ea761f1..b0bc653 100644 --- a/src/mockingbird/components/button.cljs +++ b/src/mockingbird/components/button.cljs @@ -14,7 +14,7 @@ [{:keys [class theme type disabled label on-click size roundness shadow - margin padding children] + margin padding loading? children] :or {type :default theme :mockingbird on-click (fn [_]) @@ -24,7 +24,8 @@ shadow :none margin :none padding :none - children "Insert some text"}}] + loading? false + children nil}}] (d/div (d/button {:class (str (get-in styles [type theme]) " " @@ -35,9 +36,10 @@ :margin margin :padding padding :class class})) - :on-click on-click + :on-click (when-not disabled on-click) :type type - :disabled disabled} - children))) - - + :disabled (or disabled loading?) + :aria-label (if loading? "Loading..." label)} + (if loading? + "Loading..." + (or children "Insert some text"))))) diff --git a/src/mockingbird/components/hero.cljs b/src/mockingbird/components/hero.cljs index f6144eb..d256e82 100644 --- a/src/mockingbird/components/hero.cljs +++ b/src/mockingbird/components/hero.cljs @@ -4,20 +4,26 @@ [helix.core :refer [$]] [mockingbird.lib :refer-macros [defnc]] [mockingbird.components.button :refer [button]] - [mockingbird.components.pfp :refer [pfp]])) + [mockingbird.components.image :refer [image]])) (defnc hero [] - (d/div {:class "group w-screen h-screen bg-gray-50 flex items-center justify-left pl-16"} - (d/div {:class "flex justify-center w-1/3"} - ($ pfp {:theme :mockingbird - :size :full})) - (d/div {:class "w-full ml-32 "} - (d/h1 {:class "text-[calc(120px)] lg:text-[calc(90px)] md:text-[calc(60px)]"} "MOCKINGBIRD") + (d/div {:class "group w-screen h-screen bg-gray-50 flex items-center justify-left pl-16 flex-row md:flex-row sm:flex-col md:h-screen sm:h-[calc(600px)]"} + (d/div {:class "flex justify-center lg:w-1/3 sm:w-full"} + ($ image {:theme :mockingbird + :size :full })) + (d/div {:class "w-full lg:ml-32 md:ml-0"} + (d/h1 {:class "text-[calc(120px)] lg:text-[calc(90px)] md:text-[calc(60px)] sm:text-[calc(40px)]"} "MOCKINGBIRD") + (d/p {:class "ml-2 pb-4 w-[calc(60%)] line-clamp-6"} "A simple way to develop a user interface with a consistent user experience, without the need to clutter cljs code with CSS.") (d/div {:class "flex"} ($ button {:theme :mockingbird - :class "mr-2"} "Learn More") + :class "mr-2"} + (d/a {:href "https://github.com/moclojer/mockingbird/blob/main/README.md" + :target "blank"} + "Learn More")) ($ button {:type :highlight :theme :mockingbird - :roundness :full} "Test It Out"))))) + :roundness :full} + (d/a {:href "https://github.com/moclojer/mockingbird" + :target "blank"} + "Test It Out")))))) -;; TODO: Implement the hero component diff --git a/src/mockingbird/components/image.cljs b/src/mockingbird/components/image.cljs index 43f9ceb..9ed4820 100644 --- a/src/mockingbird/components/image.cljs +++ b/src/mockingbird/components/image.cljs @@ -5,28 +5,31 @@ [mockingbird.lib :refer-macros [defnc]] [helix.dom :as d])) - -(defnc image +(defnc ^:export image [{:keys [class theme image alt size roundness shadow margin padding - children] + loading? children] :or {theme :mockingbird image "/images/logo.png" - alt "test" + alt "Image description" size :md roundness :none shadow :none margin :none - padding :none}}] + padding :none + loading? false + children nil }}] (d/div - (d/img {:class (str (get-props - {:size size - :roundness roundness - :shadow shadow - :margin margin - :padding padding - :class class})) - :src image - :alt alt}) + (if loading? + (d/div {:class "loading-placeholder"} "Loading...") + (d/img {:class (str (get-props + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) + :src image + :alt alt })) children)) diff --git a/src/mockingbird/components/input.cljs b/src/mockingbird/components/input.cljs index 0cb7132..d40e6a0 100644 --- a/src/mockingbird/components/input.cljs +++ b/src/mockingbird/components/input.cljs @@ -1,6 +1,7 @@ (ns mockingbird.components.input (:refer-clojure :exclude [class type]) (:require + [mockingbird.helpers.props :refer [get-props]] [mockingbird.lib :refer-macros [defnc]] [helix.dom :as d])) @@ -15,22 +16,35 @@ :select {:default (str "")} :login (str "")}) -(defnc input +(defnc ^:export input [{:keys [class type theme on-load on-change placeholder label + size roundness shadow margin padding children] :or {theme :mockingbird type :text on-load (fn [_]) on-change (fn [_]) - placeholder "Type here..."}}] - (d/div + placeholder "Type here..." + size :none + roundness :none + shadow :none + margin :none + padding :none}}] + (d/div {:class (when label "flex flex-col")} (when label (d/label {:class label-style} label)) (d/input - {:class (str (get-in styles [type theme]) " " class) + {:class (str (get-in styles [type theme]) " " + (get-props + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) :type (name type) :on-load on-load :on-change on-change diff --git a/src/mockingbird/components/pfp.cljs b/src/mockingbird/components/pfp.cljs index a1f8a4a..a9ae3e5 100644 --- a/src/mockingbird/components/pfp.cljs +++ b/src/mockingbird/components/pfp.cljs @@ -14,24 +14,27 @@ [{:keys [class theme image alt size roundness shadow margin padding - children] + loading? children] :or {theme :mockingbird image "/images/logo.png" - alt "test" + alt "Profile picture" size :md roundness :none shadow :none margin :none - padding :none}}] + padding :none + loading? false}}] (d/div - (d/img {:class (str (get pfp-styles theme) " " - (get-props - {:size size - :roundness roundness - :shadow shadow - :margin margin - :padding padding - :class class})) - :src image - :alt alt}) + (if loading? + (d/div {:class (get pfp-styles :loading)} "Loading...") + (d/img {:class (str (get pfp-styles theme) " " + (get-props + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) + :src image + :alt alt})) children)) diff --git a/src/mockingbird/examples/main.cljs b/src/mockingbird/examples/main.cljs index d47168e..de8dab4 100644 --- a/src/mockingbird/examples/main.cljs +++ b/src/mockingbird/examples/main.cljs @@ -12,7 +12,7 @@ ;; TODO create a example to render on this app and demonstrate the components power! (defnc app [] - (d/div {:class "w-screen h-screen "} + (d/div {:class "w-screen h-screen"} ($ header ($ nav-bar) ($ hero)) diff --git a/src/mockingbird/helpers/props.cljs b/src/mockingbird/helpers/props.cljs index 8eec45b..a8788bf 100644 --- a/src/mockingbird/helpers/props.cljs +++ b/src/mockingbird/helpers/props.cljs @@ -11,7 +11,7 @@ :md "w-16 h-16 " :lg "w-32 h-32 " :xl "w-64 h-64 " - :full "w-full " + :full "lg:w-full sm:w-[calc(50%)]" "w-16 h-16 ") actual-roundness (case roundness From cbd05c4161eb31bd8ff5c9f2cb979b2d4df85d95 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Tue, 24 Sep 2024 21:26:07 -0300 Subject: [PATCH 20/37] doc: updates README.md for clojar and new usage --- README.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index de26718..dd4c47a 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,12 @@ Before you begin, ensure you have the following installed: # Installation -We distribute our software via npm and clojars, so you can choose whatever fits best for you. +We distribute our software via clojars (and intend to do so also by npm): npm: ``` bash -npm i mockingbird-lib +npm install react autoprefixer babel-loader css-loader cssnano karma karma-chrome-launcher karma-cljs-test msw npm-run-all postcss postcss-cli postcss-loade postcss-preset-env shadow-cljs tailwindcss webpack webpack-cli rimraf glob @isaacs/cliui --save-dev ``` @@ -44,23 +44,20 @@ npm i mockingbird-lib if you are prone to build using our clojar, you will also need to install the deps on node and start a project with shadow-cljs!!! read more [here](# Testing Locally) deps.edn: ``` clj - -;; TODO - -``` - -leiningen: -``` clj -;; TODO - + moclojer/mockingbird {:mvn/version "0.0.1"} ``` - - # Usage -;; TODO +add a import on a specific component or layout component you want and load it in your screen +``` clj +(:require + [mockingbird.components.button :refer [button]] + [helix.core :refer [$]]) +;; use it then + ($ button) +``` # Testing Locally @@ -71,7 +68,7 @@ You can clone and build this repo, to see some examples of good usage of our dea - Install node dependencies with a simple command: ``` sh -npm i +npm ci ``` - configure your shadow cljs From eb13794225abcd995ef22f2f14f4c5b49434235b Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Wed, 25 Sep 2024 09:31:42 -0300 Subject: [PATCH 21/37] docs: improves text cohesion --- README.md | 33 ++++++++++++++++++++++++--------- docs/params.md | 14 ++++++++++++-- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index dd4c47a..a0069bd 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ It's impossible to talk about *"mockingbird"* without remembering the song [Mock # Overview -Mockingbird offers a set of reusable components and utilities that increases speed and beauty on your UI development. By integrating Tailwind, Helix and ReFx, Mockingbird combines functional programming, a powerful component model together creating a fast and lightweight design system. This allows your team (or simply yourself) to focus on building robust, reactive interfaces without getting bogged down in styling and local state management concerns. +Mockingbird offers a set of reusable components and utilities that increases speed and beauty on your UI development. By integrating Tailwind, Helix and ReFx, Mockingbird combines functional programming and a powerful component model in order to create a fast and lightweight design system. This allows your team to focus on building robust, reactive interfaces without getting bogged down in styling and local state management concerns. # Getting Started @@ -33,23 +33,26 @@ Before you begin, ensure you have the following installed: We distribute our software via clojars (and intend to do so also by npm): -npm: -``` bash +deps.edn: +``` clj + moclojer/mockingbird {:mvn/version "0.0.1"} +``` -npm install react autoprefixer babel-loader css-loader cssnano karma karma-chrome-launcher karma-cljs-test msw npm-run-all postcss postcss-cli postcss-loade postcss-preset-env shadow-cljs tailwindcss webpack webpack-cli rimraf glob @isaacs/cliui --save-dev +You will also need to start a project with shadow-cljs and install the npm deps. -``` +npm: +``` sh + +$ npx create-cljs-project your-project +$ npm install react autoprefixer babel-loader css-loader cssnano karma karma-chrome-launcher karma-cljs-test msw npm-run-all postcss postcss-cli postcss-loade postcss-preset-env shadow-cljs tailwindcss webpack webpack-cli rimraf glob @isaacs/cliui --save-dev -if you are prone to build using our clojar, you will also need to install the deps on node and start a project with shadow-cljs!!! read more [here](# Testing Locally) -deps.edn: -``` clj - moclojer/mockingbird {:mvn/version "0.0.1"} ``` # Usage add a import on a specific component or layout component you want and load it in your screen + ``` clj (:require [mockingbird.components.button :refer [button]] @@ -59,6 +62,18 @@ add a import on a specific component or layout component you want and load it in ``` +you can pass arguments into our components simply as this: + + +``` clj + ($ button {:class "special-class-i-want-to-add" + :theme :mockingbird + :size :sm + :label "My-special-label"}) + +``` +As you can see, our components have specific built-in styles for you. You can see a handful tutorial on the parameters for styling the components [here](docs/params.md) + # Testing Locally You can clone and build this repo, to see some examples of good usage of our dear Mockingbird. You can read more [here](docs/test.md). diff --git a/docs/params.md b/docs/params.md index ac6341d..381c11b 100644 --- a/docs/params.md +++ b/docs/params.md @@ -1,6 +1,6 @@ # Props parameters -In order to get specific parameters while not having to pass tailwind classes (as w-64 for width or h-64 for height), we added a simple parameter list for your team. The idea is to pass a keyword, such as `:sm` or `:full`,making it easier to just plug and play our componentes. +In order to get specific parameters while not having to pass tailwind classes (as w-64 for width or h-64 for height), we added keyword-based parameters for easy configuration. The idea is to pass a keyword, such as `:sm` or `:full`, making it easier to just plug and play our componentes. ## Examples - component roundness: @@ -16,4 +16,14 @@ you can pass on your component the key roundness and a value into it, such as :f :roundness :full})) ``` -;; TODO list of all these new types + +## Parameter Overview + +The available options (until now) are: + +- **Size**: `:none`, `:sm`, `:md`, `:lg`, `:xl`, `:full` +- **Roundness**: `:none`, `:sm`, `:md`, `:full` +- **Shadow**: `:none`, `:sm`, `:md`, `:lg` +- **Padding**: `:none`, `:sm`, `:md`, `:lg` +- **Margin**: `:none`, `:sm`, `:md`, `:lg` + From c72bf5ac92eecbf6633ad77dcaa87b212945582d Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Wed, 25 Sep 2024 10:03:08 -0300 Subject: [PATCH 22/37] feat: enhance on navbar --- src/mockingbird/components/button.cljs | 3 +- src/mockingbird/examples/main.cljs | 2 +- src/mockingbird/helpers/props.cljs | 6 ++- src/mockingbird/layout/navbar.cljs | 61 ++++++++++++++++---------- 4 files changed, 45 insertions(+), 27 deletions(-) diff --git a/src/mockingbird/components/button.cljs b/src/mockingbird/components/button.cljs index b0bc653..ff7e214 100644 --- a/src/mockingbird/components/button.cljs +++ b/src/mockingbird/components/button.cljs @@ -8,7 +8,8 @@ (def styles {:default {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300 "} :highlight {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center py-2 px-4 text-sm focus:outline-none ring-slate-200 text-gray-50 bg-mockingbird-main hover:bg-mockingbird-700 text-gray-50 "} - :submit {:mockingbird "group transition-all py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-mockingbird-main hover:bg-mockingbird-700 focus:ring-4 focus:ring-primary-300 transition-all"}}) + :submit {:mockingbird "group transition-all py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-mockingbird-main hover:bg-mockingbird-700 focus:ring-4 focus:ring-primary-300 transition-all"} + :icon {:mockingbird "group transition-all p-0"}}) (defnc ^:export button [{:keys [class theme type diff --git a/src/mockingbird/examples/main.cljs b/src/mockingbird/examples/main.cljs index de8dab4..1fca1e2 100644 --- a/src/mockingbird/examples/main.cljs +++ b/src/mockingbird/examples/main.cljs @@ -14,7 +14,7 @@ (defnc app [] (d/div {:class "w-screen h-screen"} ($ header - ($ nav-bar) + ($ nav-bar {:logo "/images/logo.png" }) ($ hero)) (comment ($ aside)) ($ main (d/p "ok")) diff --git a/src/mockingbird/helpers/props.cljs b/src/mockingbird/helpers/props.cljs index a8788bf..a309635 100644 --- a/src/mockingbird/helpers/props.cljs +++ b/src/mockingbird/helpers/props.cljs @@ -1,9 +1,11 @@ (ns mockingbird.helpers.props) + (defn get-props - [{:keys [size roundness shadow + [{:keys [size width height + roundness shadow margin padding class] - :or {size :md roundness :none shadow :none padding :none margin :none}}] + :or {size :md width nil height nil roundness :none shadow :none padding :none margin :none}}] (let [actual-size (case size :none "" diff --git a/src/mockingbird/layout/navbar.cljs b/src/mockingbird/layout/navbar.cljs index 3eb024b..d960867 100644 --- a/src/mockingbird/layout/navbar.cljs +++ b/src/mockingbird/layout/navbar.cljs @@ -1,6 +1,7 @@ (ns mockingbird.layout.navbar (:require [mockingbird.components.button :refer [button]] + [mockingbird.components.image :refer [image]] [mockingbird.lib :refer-macros [defnc]] [reitit.frontend.easy :as rfe] [helix.core :refer [$]] @@ -9,7 +10,7 @@ (def navlink-style "inline-block rounded-lg py-1 px-2 text-sm text-slate-700 hover:bg-slate-100 hover:text-slate-900 ") -(def styles {}) +(def styles {:mockingbird "z-30 w-full h-max bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700 "}) (defnc nav-link [{:keys [href on-click children] @@ -23,31 +24,45 @@ children)) (defnc nav-bar - [{:keys [aside-state hamburguer-menu hamburguer-menu-close + [{:keys [theme aside-state hamburguer-menu + hamburguer-menu-close label logo buttons fixed? & children] - :or {aside-state false + :or {theme :mockingbird + aside-state false fixed? true - hamburguer-menu " " - hamburguer-menu-close " " - buttons nil}}] + hamburguer-menu false + hamburguer-menu-close false + buttons nil + label false + logo false}}] (let [aside-open? (:open? aside-state)] (d/nav - {:class (str (when fixed? "fixed ") "z-30 w-full h-max bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700")} + {:class (str (when fixed? "fixed ") + (get styles theme))} (d/div - {:class "py-3 px-3 lg:px-5 lg:pl-3"} - (d/div - {:class "flex justify-between items-center"} - (d/div {:class "flex justify-start items-center"} - ($ button {:id "toggleSidebar" - :on-click "" #_#(rfe/push-state :app.core/dashboard) - :class (str "p-2 mr-3 text-gray-600 rounded cursor-pointer " - "hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 " - "dark:hover:text-white dark:hover:bg-gray-700 lg:hidden")} - #_(if aside-open? - ($ icon hamburger-menu-close) - ($ icon hamburger-menu))) - ($ button {:type :icon - :on-click " " #_#(rfe/push-state :app.core/dashboard)} - (d/img {:src "/images/logo.png" - :class "mr-3 h-9"})))))))) + {:class "py-3 px-3 lg:px-5 lg:pl-3"} + (d/div + {:class "flex justify-between items-center"} + (d/div {:class "flex justify-start items-center"} + (when hamburguer-menu + ($ button {:id "toggleSidebar" + :on-click "" #_#(rfe/push-state :app.core/dashboard) + :class (str "p-2 mr-3 text-gray-600 rounded cursor-pointer " + "hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 " + "dark:hover:text-white dark:hover:bg-gray-700 lg:hidden")} + #_(if aside-open? + ($ icon hamburger-menu-close) + ($ icon hamburger-menu)))) + (when logo + ($ button {:type :icon + :disabled false + :class "flex "} + ($ image {:src logo + :class "mr-3 "}) + (when label + (d/div {:class "w-max h-full flex items-center justify-center"} + (d/h1 {:class "text-2xl text-center"} "MOCKINGBIRD"))))) + (when buttons + buttons))) + children)))) From f5ff6b6232697535e1420caca24a31fdf075c943 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Wed, 25 Sep 2024 17:16:34 -0300 Subject: [PATCH 23/37] feat: better compiling on css and component enhancement --- build.clj | 3 +- package.json | 6 +-- resources/index.src.html | 2 +- shadow-cljs.edn | 10 ++--- src/mockingbird/components/aside.cljs | 11 +++-- src/mockingbird/components/button.cljs | 18 ++++----- src/mockingbird/components/hero.cljs | 6 +-- src/mockingbird/components/image.cljs | 16 ++++---- src/mockingbird/components/input.cljs | 36 ++++++++--------- src/mockingbird/examples/main.cljs | 2 +- src/mockingbird/helpers/props.cljs | 3 +- src/mockingbird/layout/navbar.cljs | 52 ++++++++++++------------ test/unit/components/props_test.cljs | 56 +++++++++++++------------- webpack.config.js | 1 + 14 files changed, 111 insertions(+), 111 deletions(-) diff --git a/build.clj b/build.clj index e02904a..7d8b5a7 100644 --- a/build.clj +++ b/build.clj @@ -1,5 +1,6 @@ (ns build - (:require [clojure.tools.build.api :as b])) + (:require + [clojure.tools.build.api :as b])) (def lib 'com.github.moclojer/mockingbird) (def version "0.0.1") diff --git a/package.json b/package.json index 3f44639..66d83f1 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,10 @@ "scripts": { "ci:karma-make": "npx msw init resources/test", "ci:tests": "npm run ci:karma-make && npx shadow-cljs compile ci-tests && npx karma start --single-run", - "postcss:build": "npx cross-env TAILWIND_MODE=build postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/output.css --verbose", - "postcss:watch": "npx cross-env TAILWIND_MODE=watch postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/output.css --verbose -w", + "postcss:build": "npx cross-env TAILWIND_MODE=build postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/target.css --verbose", + "postcss:watch": "npx cross-env TAILWIND_MODE=watch postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/target.css --verbose -w", "watch": "run-p shadow:watch-css shadow:watch-cljs", - "shadow:watch-css": "npx cross-env TAILWIND_MODE=watch postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/output.css --verbose -w", + "shadow:watch-css": "npx cross-env TAILWIND_MODE=watch postcss src/mockingbird/css/tailwind.css -o ./resources/public/assets/css/target.css --verbose -w", "shadow:watch-cljs": "npx shadow-cljs watch app", "repl": "npx shadow-cljs clj-repl", "release": "run-s postcss:build shadow:release", diff --git a/resources/index.src.html b/resources/index.src.html index df65536..2254d73 100644 --- a/resources/index.src.html +++ b/resources/index.src.html @@ -8,7 +8,7 @@ Mockingbird - + diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 25d51e4..ad38402 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -7,17 +7,17 @@ :http-port 8101 :http-root "resources/public"} :build-hooks [(dev.shadow.hooks/hash-files - ["./resources/public/assets/css/output.css" + ["./resources/public/assets/css/target.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} + :compiler-options {:warnings-as-errors true} :build-hooks [(dev.shadow.hooks/build-css true "./src/mockingbird/css/tailwind.css" - "./resources/public/assets/css/output.css")]} + "./resources/public/assets/css/target.css")]} :release {:modules {:core {:init-fn mockingbird.core/init}} :compiler-options {:optimizations :advanced :infer-externs :auto @@ -27,7 +27,7 @@ :build-hooks [(dev.shadow.hooks/build-css false "./src/mockingbird/css/tailwind.css" - "./resources/public/assets/css/output.css")]}} + "./resources/public/assets/css/target.css")]}} :tests {:target :browser-test :test-dir "resources/test" :ns-regexp "-test$" @@ -55,4 +55,4 @@ :build-hooks [(dev.shadow.hooks/build-css false "./src/mockingbird/css/tailwind.css" - "./target/output.css")]}}} + "./target/target.css")]}}} diff --git a/src/mockingbird/components/aside.cljs b/src/mockingbird/components/aside.cljs index 9d61191..119ec4a 100644 --- a/src/mockingbird/components/aside.cljs +++ b/src/mockingbird/components/aside.cljs @@ -10,17 +10,17 @@ [reitit.frontend.easy :as rfe])) ;; TODO add mock content -(defnc mock [{:keys [aside aside-open? +(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"} - children))) + (d/li + (d/div + {:class "flex flex-row"} + children))) (defnc aside [{:keys [id class type theme @@ -77,6 +77,5 @@ (d/span {:class "ml-3"} "Logout")))))))) - ;; TODO aside specific components (defnc aside-componet []) diff --git a/src/mockingbird/components/button.cljs b/src/mockingbird/components/button.cljs index ff7e214..6165c10 100644 --- a/src/mockingbird/components/button.cljs +++ b/src/mockingbird/components/button.cljs @@ -8,7 +8,7 @@ (def styles {:default {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300 "} :highlight {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center py-2 px-4 text-sm focus:outline-none ring-slate-200 text-gray-50 bg-mockingbird-main hover:bg-mockingbird-700 text-gray-50 "} - :submit {:mockingbird "group transition-all py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-mockingbird-main hover:bg-mockingbird-700 focus:ring-4 focus:ring-primary-300 transition-all"} + :submit {:mockingbird "group py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-mockingbird-main hover:bg-mockingbird-700 focus:ring-4 focus:ring-primary-300 transition-all"} :icon {:mockingbird "group transition-all p-0"}}) (defnc ^:export button @@ -29,14 +29,14 @@ children nil}}] (d/div (d/button - {:class (str (get-in styles [type theme]) " " - (get-props - {:size size - :roundness roundness - :shadow shadow - :margin margin - :padding padding - :class class})) + {:class (str (get-in styles [type theme]) " " + (get-props + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) :on-click (when-not disabled on-click) :type type :disabled (or disabled loading?) diff --git a/src/mockingbird/components/hero.cljs b/src/mockingbird/components/hero.cljs index d256e82..f35afa8 100644 --- a/src/mockingbird/components/hero.cljs +++ b/src/mockingbird/components/hero.cljs @@ -10,19 +10,19 @@ (d/div {:class "group w-screen h-screen bg-gray-50 flex items-center justify-left pl-16 flex-row md:flex-row sm:flex-col md:h-screen sm:h-[calc(600px)]"} (d/div {:class "flex justify-center lg:w-1/3 sm:w-full"} ($ image {:theme :mockingbird - :size :full })) + :size :full})) (d/div {:class "w-full lg:ml-32 md:ml-0"} (d/h1 {:class "text-[calc(120px)] lg:text-[calc(90px)] md:text-[calc(60px)] sm:text-[calc(40px)]"} "MOCKINGBIRD") (d/p {:class "ml-2 pb-4 w-[calc(60%)] line-clamp-6"} "A simple way to develop a user interface with a consistent user experience, without the need to clutter cljs code with CSS.") (d/div {:class "flex"} ($ button {:theme :mockingbird - :class "mr-2"} + :class "mr-2"} (d/a {:href "https://github.com/moclojer/mockingbird/blob/main/README.md" :target "blank"} "Learn More")) ($ button {:type :highlight :theme :mockingbird - :roundness :full} + :roundness :full} (d/a {:href "https://github.com/moclojer/mockingbird" :target "blank"} "Test It Out")))))) diff --git a/src/mockingbird/components/image.cljs b/src/mockingbird/components/image.cljs index 9ed4820..a481fd1 100644 --- a/src/mockingbird/components/image.cljs +++ b/src/mockingbird/components/image.cljs @@ -19,17 +19,17 @@ margin :none padding :none loading? false - children nil }}] + children nil}}] (d/div (if loading? (d/div {:class "loading-placeholder"} "Loading...") (d/img {:class (str (get-props - {:size size - :roundness roundness - :shadow shadow - :margin margin - :padding padding - :class class})) + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) :src image - :alt alt })) + :alt alt})) children)) diff --git a/src/mockingbird/components/input.cljs b/src/mockingbird/components/input.cljs index d40e6a0..0c41c88 100644 --- a/src/mockingbird/components/input.cljs +++ b/src/mockingbird/components/input.cljs @@ -32,21 +32,21 @@ margin :none padding :none}}] (d/div {:class (when label "flex flex-col")} - (when label - (d/label - {:class label-style} - label)) - (d/input - {:class (str (get-in styles [type theme]) " " - (get-props - {:size size - :roundness roundness - :shadow shadow - :margin margin - :padding padding - :class class})) - :type (name type) - :on-load on-load - :on-change on-change - :placeholder placeholder}) - children)) + (when label + (d/label + {:class label-style} + label)) + (d/input + {:class (str (get-in styles [type theme]) " " + (get-props + {:size size + :roundness roundness + :shadow shadow + :margin margin + :padding padding + :class class})) + :type (name type) + :on-load on-load + :on-change on-change + :placeholder placeholder}) + children)) diff --git a/src/mockingbird/examples/main.cljs b/src/mockingbird/examples/main.cljs index 1fca1e2..b89f8f0 100644 --- a/src/mockingbird/examples/main.cljs +++ b/src/mockingbird/examples/main.cljs @@ -14,7 +14,7 @@ (defnc app [] (d/div {:class "w-screen h-screen"} ($ header - ($ nav-bar {:logo "/images/logo.png" }) + ($ nav-bar {:logo "/images/logo.png"}) ($ hero)) (comment ($ aside)) ($ main (d/p "ok")) diff --git a/src/mockingbird/helpers/props.cljs b/src/mockingbird/helpers/props.cljs index a309635..b9734c7 100644 --- a/src/mockingbird/helpers/props.cljs +++ b/src/mockingbird/helpers/props.cljs @@ -1,8 +1,7 @@ (ns mockingbird.helpers.props) - (defn get-props - [{:keys [size width height + [{:keys [size width height roundness shadow margin padding class] :or {size :md width nil height nil roundness :none shadow :none padding :none margin :none}}] diff --git a/src/mockingbird/layout/navbar.cljs b/src/mockingbird/layout/navbar.cljs index d960867..aa90389 100644 --- a/src/mockingbird/layout/navbar.cljs +++ b/src/mockingbird/layout/navbar.cljs @@ -37,32 +37,32 @@ logo false}}] (let [aside-open? (:open? aside-state)] (d/nav - {:class (str (when fixed? "fixed ") + {:class (str (when fixed? "fixed ") (get styles theme))} (d/div - {:class "py-3 px-3 lg:px-5 lg:pl-3"} - (d/div - {:class "flex justify-between items-center"} - (d/div {:class "flex justify-start items-center"} - (when hamburguer-menu - ($ button {:id "toggleSidebar" - :on-click "" #_#(rfe/push-state :app.core/dashboard) - :class (str "p-2 mr-3 text-gray-600 rounded cursor-pointer " - "hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 " - "dark:hover:text-white dark:hover:bg-gray-700 lg:hidden")} - #_(if aside-open? - ($ icon hamburger-menu-close) - ($ icon hamburger-menu)))) - (when logo - ($ button {:type :icon - :disabled false - :class "flex "} - ($ image {:src logo - :class "mr-3 "}) - (when label - (d/div {:class "w-max h-full flex items-center justify-center"} - (d/h1 {:class "text-2xl text-center"} "MOCKINGBIRD"))))) - (when buttons - buttons))) - children)))) + {:class "py-3 px-3 lg:px-5 lg:pl-3"} + (d/div + {:class "flex justify-between items-center"} + (d/div {:class "flex justify-start items-center"} + (when hamburguer-menu + ($ button {:id "toggleSidebar" + :on-click "" #_#(rfe/push-state :app.core/dashboard) + :class (str "p-2 mr-3 text-gray-600 rounded cursor-pointer " + "hover:text-gray-900 hover:bg-gray-100 dark:text-gray-400 " + "dark:hover:text-white dark:hover:bg-gray-700 lg:hidden")} + #_(if aside-open? + ($ icon hamburger-menu-close) + ($ icon hamburger-menu)))) + (when logo + ($ button {:type :icon + :disabled false + :class "flex "} + ($ image {:src logo + :class "mr-3 "}) + (when label + (d/div {:class "w-max h-full flex items-center justify-center"} + (d/h1 {:class "text-2xl text-center"} "MOCKINGBIRD"))))) + (when buttons + buttons))) + children)))) diff --git a/test/unit/components/props_test.cljs b/test/unit/components/props_test.cljs index 7999256..3391337 100644 --- a/test/unit/components/props_test.cljs +++ b/test/unit/components/props_test.cljs @@ -1,38 +1,38 @@ (ns unit.components.props-test (:require - [clojure.test :refer [is testing deftest]] - [mockingbird.helpers.props :refer [get-props]])) + [clojure.test :refer [is testing deftest]] + [mockingbird.helpers.props :refer [get-props]])) (deftest test-get-props (testing "Check for props args" (is (= (get-props - {:size :sm - :roundness :sm - :shadow :sm - :margin :sm - :padding :sm - :class "custom-class"}) + {:size :sm + :roundness :sm + :shadow :sm + :margin :sm + :padding :sm + :class "custom-class"}) "w-8 h-8 rounded-sm shadow-sm p-2 m-2 custom-class")) (is (= (get-props - {:size :lg - :roundness :full - :shadow :lg - :margin :md - :padding :lg - :class "another-class"}) + {:size :lg + :roundness :full + :shadow :lg + :margin :md + :padding :lg + :class "another-class"}) "w-32 h-32 rounded-full shadow-lg p-8 m-4 another-class")) (is (= (get-props - {:size :full - :roundness :none - :shadow :none - :margin :none - :padding :none - :class "basic-class"}) + {:size :full + :roundness :none + :shadow :none + :margin :none + :padding :none + :class "basic-class"}) "w-full basic-class")) (is (= (get-props - {:size :xl - :roundness :none - :shadow :none}) + {:size :xl + :roundness :none + :shadow :none}) "w-64 h-64 ")))) (deftest test-default-cases @@ -43,15 +43,15 @@ (testing "Partial defaults" (is (= (get-props - {:size :sm}) + {:size :sm}) "w-8 h-8 ")) (is (= (get-props - {:roundness :full - :shadow :lg}) + {:roundness :full + :shadow :lg}) "w-16 h-16 rounded-full shadow-lg "))) (testing "Nil values" (is (= (get-props - {:size nil - :roundness nil}) + {:size nil + :roundness nil}) "w-16 h-16 "))))) diff --git a/webpack.config.js b/webpack.config.js index da1cb94..b2f1eb8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,6 +5,7 @@ module.exports = (env) => { return { mode: (isProduction ? 'production' : 'development'), + devtool: isProduction ? 'source-map' : 'eval-source-map', context: path.resolve(__dirname, 'target'), entry: './mockingbird.lib.js', module: { From f5413204d45cd2eeccc140de403dbfd884aca3c6 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Thu, 26 Sep 2024 21:22:18 -0300 Subject: [PATCH 24/37] feat: copy the css file from .jar (on build hook) --- src/dev/shadow/hooks.clj | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/dev/shadow/hooks.clj b/src/dev/shadow/hooks.clj index 8e012d5..8f42d31 100644 --- a/src/dev/shadow/hooks.clj +++ b/src/dev/shadow/hooks.clj @@ -1,11 +1,50 @@ (ns dev.shadow.hooks (:require [babashka.process :as proc] + [clojure.java.shell :as shell] [clojure.java.io :as io] [clojure.string :as str] [shadow.build :as build] [shadow.cljs.util :as s.util])) +(def file (io/file "resources/public/assets/css/target.css")) + +(defn retrieve-css + ([] + (retrieve-css nil)) + ([css-path] + (let [css-file (if (nil? css-path) + file + (io/file css-path))] + css-file))) + +(defn file-exists? [file] + (.exists file)) + +(defn copy-from-jar [jar-path file dest-dir] + (let [cmd (str "jar xf " jar-path " " file " | mv target.css " (str dest-dir "/target.css"))] + (shell/sh "sh" "-c" cmd))) + +(defn list-jar [jar-path] + (let [ cmd (str "jar tf " jar-path " | grep target.css")] + (shell/sh "sh" "-c" cmd))) + +(defn target-css [{::build/keys [mode] :as build-state} + {:keys [path] + :or {path "resources/public/assets/css/target.css"}}] + (let [css-file (retrieve-css path) + css-jar-file (str/replace "\n" "" (:out (list-jar "target/mockingbird-0.0.1.jar")))] + + (if (file-exists? css-file) + (prn "CSS file already exists. No action needed.") + (do + (prn "CSS file does not exist. Copying from .jar...") + (copy-from-jar "target/mockingbird-0.0.1.jar" css-jar-file path) + (prn "CSS file copied."))))) + +(target-css {} {:path "public/react.css"}) + + (defn build-css {:shadow.build/stage :configure} [{::build/keys [mode] :as build-state} watch? src dst] From c6d97bf758bca105138f68d5cde0ac845005794c Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Sat, 28 Sep 2024 13:11:42 -0300 Subject: [PATCH 25/37] fix: css build hook --- src/dev/shadow/hooks.clj | 70 ++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/src/dev/shadow/hooks.clj b/src/dev/shadow/hooks.clj index 8f42d31..7f14ca1 100644 --- a/src/dev/shadow/hooks.clj +++ b/src/dev/shadow/hooks.clj @@ -1,7 +1,6 @@ (ns dev.shadow.hooks (:require [babashka.process :as proc] - [clojure.java.shell :as shell] [clojure.java.io :as io] [clojure.string :as str] [shadow.build :as build] @@ -18,32 +17,49 @@ (io/file css-path))] css-file))) -(defn file-exists? [file] - (.exists file)) - -(defn copy-from-jar [jar-path file dest-dir] - (let [cmd (str "jar xf " jar-path " " file " | mv target.css " (str dest-dir "/target.css"))] - (shell/sh "sh" "-c" cmd))) - -(defn list-jar [jar-path] - (let [ cmd (str "jar tf " jar-path " | grep target.css")] - (shell/sh "sh" "-c" cmd))) - -(defn target-css [{::build/keys [mode] :as build-state} - {:keys [path] - :or {path "resources/public/assets/css/target.css"}}] - (let [css-file (retrieve-css path) - css-jar-file (str/replace "\n" "" (:out (list-jar "target/mockingbird-0.0.1.jar")))] - - (if (file-exists? css-file) - (prn "CSS file already exists. No action needed.") - (do - (prn "CSS file does not exist. Copying from .jar...") - (copy-from-jar "target/mockingbird-0.0.1.jar" css-jar-file path) - (prn "CSS file copied."))))) - -(target-css {} {:path "public/react.css"}) - +(defn copy-from-jar [jar-path file dest-dir file-name] + (try + (with-open [jar (java.util.jar.JarFile. jar-path)] + (if-let [entry (.getEntry jar file)] + (let [in (.getInputStream jar entry) + out (io/output-stream (io/file dest-dir file-name))] + (io/copy in out) + (prn "CSS file copied.")) + (throw (Exception. (str "File " file " not found in JAR."))))) + (catch Exception e + (println "Error copying file from JAR:" (.getMessage e))))) + +(defn list-jar-files [jar-path] + (try + (with-open [jar (java.util.jar.JarFile. jar-path)] + (seq (filter #(.endsWith % "target.css") + (map #(.getName %) (enumeration-seq (.entries jar)))))) + (catch Exception e + (println "Error listing JAR contents:" (.getMessage e))))) + +(defn get-target-css [{::build/keys [mode] :as build-state} + {:keys [path jar-path file-name] + :or {path "resources/public/assets/css/target.css" + jar-path "target/mockingbird-0.0.1.jar" + file-name "target.css"}}] + (let [file-name (if (str/includes? path ".css") + (last (str/split path #"/")) + file-name) + path (if (str/includes? path file-name) + (str/replace path file-name "") + path) + css-file (retrieve-css (str path file-name)) + jar-files (list-jar-files jar-path) + css-jar-file (first jar-files)] + (if (nil? css-jar-file) + (prn "CSS file not found in the JAR.") + (if (.exists css-file) + (prn "CSS file already exists. No action needed.") + (try + (prn "CSS file does not exist. Copying from .jar...") + (copy-from-jar jar-path css-jar-file path file-name) + (catch Exception e + (prn "Error copying CSS file:" (.getMessage e)))))))) (defn build-css {:shadow.build/stage :configure} From dfc17983b0bb64f9dc5ef2309f9038dc6acc4a2c Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Sat, 28 Sep 2024 13:19:51 -0300 Subject: [PATCH 26/37] fix: unit test for props --- src/mockingbird/helpers/props.cljs | 2 +- test/unit/components/props_test.cljs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mockingbird/helpers/props.cljs b/src/mockingbird/helpers/props.cljs index b9734c7..42f1533 100644 --- a/src/mockingbird/helpers/props.cljs +++ b/src/mockingbird/helpers/props.cljs @@ -12,7 +12,7 @@ :md "w-16 h-16 " :lg "w-32 h-32 " :xl "w-64 h-64 " - :full "lg:w-full sm:w-[calc(50%)]" + :full "lg:w-full sm:w-[calc(50%)] " "w-16 h-16 ") actual-roundness (case roundness diff --git a/test/unit/components/props_test.cljs b/test/unit/components/props_test.cljs index 3391337..216aedc 100644 --- a/test/unit/components/props_test.cljs +++ b/test/unit/components/props_test.cljs @@ -28,7 +28,7 @@ :margin :none :padding :none :class "basic-class"}) - "w-full basic-class")) + "lg:w-full sm:w-[calc(50%)] basic-class")) (is (= (get-props {:size :xl :roundness :none From 935f48b2d759bb0c92b412720c82bebacd21b625 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Mon, 30 Sep 2024 10:16:19 -0300 Subject: [PATCH 27/37] feat: copy target.css on any project to a specified path --- deps.edn | 2 +- shadow-cljs.edn | 12 +++---- src/{ => mockingbird}/dev/core.cljs | 2 +- src/{ => mockingbird}/dev/shadow/hooks.clj | 40 ++++++++++++++-------- 4 files changed, 33 insertions(+), 23 deletions(-) rename src/{ => mockingbird}/dev/core.cljs (87%) rename src/{ => mockingbird}/dev/shadow/hooks.clj (81%) diff --git a/deps.edn b/deps.edn index 4578098..a086a82 100644 --- a/deps.edn +++ b/deps.edn @@ -1,6 +1,7 @@ {:paths ["src" "resources"] :deps {org.clojure/clojure {:mvn/version "1.11.1"} org.clojure/clojurescript {:mvn/version "1.11.60"} + org.clojure/tools.deps {:mvn/version "0.21.1449"} com.google.javascript/closure-compiler-unshaded {:mvn/version "v20220803"} com.fbeyer/refx {:mvn/version "0.0.49"} lilactown/helix {:mvn/version "0.1.11"} @@ -9,7 +10,6 @@ metosin/reitit-frontend {:mvn/version "0.5.18"} lambdaisland/fetch {:mvn/version "1.1.60"} com.teknql/shadow-cljs-tailwind-jit {:mvn/version "1.0.0"}} - :aliases {:dev {:extra-paths ["test"] :extra-deps {cider/cider-nrepl {:mvn/version "0.28.6"} diff --git a/shadow-cljs.edn b/shadow-cljs.edn index ad38402..18096ab 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -6,15 +6,15 @@ :devtools {:reload-strategy :full :http-port 8101 :http-root "resources/public"} - :build-hooks [(dev.shadow.hooks/hash-files + :build-hooks [(mockingbird.dev.shadow.hooks/hash-files ["./resources/public/assets/css/target.css" "./resources/public/assets/js/core.js"]) - (dev.shadow.hooks/replace-hashed-files + (mockingbird.dev.shadow.hooks/replace-hashed-files "./resources/index.src.html" "./resources/public/index.html")] - :dev {:modules {:core {:init-fn dev.core/init}} + :dev {:modules {:core {:init-fn mockingbird.dev.core/init}} :compiler-options {:warnings-as-errors true} - :build-hooks [(dev.shadow.hooks/build-css + :build-hooks [(mockingbird.dev.shadow.hooks/build-css true "./src/mockingbird/css/tailwind.css" "./resources/public/assets/css/target.css")]} @@ -24,7 +24,7 @@ :source-map true :warnings-as-errors true} :build-options {:manifest-name "manifest.json"} - :build-hooks [(dev.shadow.hooks/build-css + :build-hooks [(mockingbird.dev.shadow.hooks/build-css false "./src/mockingbird/css/tailwind.css" "./resources/public/assets/css/target.css")]}} @@ -52,7 +52,7 @@ :source-map true :warnings-as-errors true} :build-options {:manifest-name "manifest.json"} - :build-hooks [(dev.shadow.hooks/build-css + :build-hooks [(mockingbird.dev.shadow.hooks/build-css false "./src/mockingbird/css/tailwind.css" "./target/target.css")]}}} diff --git a/src/dev/core.cljs b/src/mockingbird/dev/core.cljs similarity index 87% rename from src/dev/core.cljs rename to src/mockingbird/dev/core.cljs index 26a72f0..8ca2318 100644 --- a/src/dev/core.cljs +++ b/src/mockingbird/dev/core.cljs @@ -1,4 +1,4 @@ -(ns dev.core +(ns mockingbird.dev.core (:require [mockingbird.core :as m])) diff --git a/src/dev/shadow/hooks.clj b/src/mockingbird/dev/shadow/hooks.clj similarity index 81% rename from src/dev/shadow/hooks.clj rename to src/mockingbird/dev/shadow/hooks.clj index 7f14ca1..ec912f4 100644 --- a/src/dev/shadow/hooks.clj +++ b/src/mockingbird/dev/shadow/hooks.clj @@ -1,8 +1,10 @@ -(ns dev.shadow.hooks +(ns mockingbird.dev.shadow.hooks (:require [babashka.process :as proc] [clojure.java.io :as io] [clojure.string :as str] + [clojure.tools.deps :as deps] + [clojure.tools.deps.tool :as tool] [shadow.build :as build] [shadow.cljs.util :as s.util])) @@ -37,11 +39,12 @@ (catch Exception e (println "Error listing JAR contents:" (.getMessage e))))) -(defn get-target-css [{::build/keys [mode] :as build-state} - {:keys [path jar-path file-name] - :or {path "resources/public/assets/css/target.css" - jar-path "target/mockingbird-0.0.1.jar" - file-name "target.css"}}] +(defn get-target-css ^:export + {:shadow.build/stage :configure} + [{::build/keys [mode] :as build-state} + {:keys [path file-name] + :or {path "resources/public/assets/css/target.css" + file-name "target.css"}}] (let [file-name (if (str/includes? path ".css") (last (str/split path #"/")) file-name) @@ -49,17 +52,24 @@ (str/replace path file-name "") path) css-file (retrieve-css (str path file-name)) + jar-path (some #(when (re-find #"mockingbird" %) %) + (get-in (deps/create-basis + (deps/find-edn-maps + (io/file "deps.edn"))) + [:classpath-roots])) jar-files (list-jar-files jar-path) css-jar-file (first jar-files)] + (prn jar-path) (if (nil? css-jar-file) (prn "CSS file not found in the JAR.") (if (.exists css-file) (prn "CSS file already exists. No action needed.") (try - (prn "CSS file does not exist. Copying from .jar...") - (copy-from-jar jar-path css-jar-file path file-name) + (prn "CSS file does not exist. Copying from .jar...") + (copy-from-jar jar-path css-jar-file path file-name) (catch Exception e - (prn "Error copying CSS file:" (.getMessage e)))))))) + (prn "Error copying CSS file:" (.getMessage e))))))) + build-state) (defn build-css {:shadow.build/stage :configure} @@ -67,12 +77,12 @@ (let [proc-data ["./node_modules/.bin/postcss" src "-o" dst "--verbose"]] (proc/process - (if watch? (conj proc-data "-w") proc-data) - {:env (if watch? - {"TAILWIND_MODE" "watch"} - {"NODE_MODE" (if (= mode :release) - "production" - "build")})})) + (if watch? (conj proc-data "-w") proc-data) + {:env (if watch? + {"TAILWIND_MODE" "watch"} + {"NODE_MODE" (if (= mode :release) + "production" + "build")})})) build-state) (defn hash-files From 7dc6e58a1d620feb65117e3b0d2199cf11056f88 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Mon, 30 Sep 2024 10:17:03 -0300 Subject: [PATCH 28/37] fix: formatting --- src/mockingbird/dev/shadow/hooks.clj | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mockingbird/dev/shadow/hooks.clj b/src/mockingbird/dev/shadow/hooks.clj index ec912f4..b70d035 100644 --- a/src/mockingbird/dev/shadow/hooks.clj +++ b/src/mockingbird/dev/shadow/hooks.clj @@ -10,11 +10,11 @@ (def file (io/file "resources/public/assets/css/target.css")) -(defn retrieve-css - ([] +(defn retrieve-css + ([] (retrieve-css nil)) ([css-path] - (let [css-file (if (nil? css-path) + (let [css-file (if (nil? css-path) file (io/file css-path))] css-file))) @@ -39,9 +39,9 @@ (catch Exception e (println "Error listing JAR contents:" (.getMessage e))))) -(defn get-target-css ^:export +(defn get-target-css ^:export {:shadow.build/stage :configure} - [{::build/keys [mode] :as build-state} + [{::build/keys [mode] :as build-state} {:keys [path file-name] :or {path "resources/public/assets/css/target.css" file-name "target.css"}}] @@ -53,9 +53,9 @@ path) css-file (retrieve-css (str path file-name)) jar-path (some #(when (re-find #"mockingbird" %) %) - (get-in (deps/create-basis - (deps/find-edn-maps - (io/file "deps.edn"))) + (get-in (deps/create-basis + (deps/find-edn-maps + (io/file "deps.edn"))) [:classpath-roots])) jar-files (list-jar-files jar-path) css-jar-file (first jar-files)] @@ -77,12 +77,12 @@ (let [proc-data ["./node_modules/.bin/postcss" src "-o" dst "--verbose"]] (proc/process - (if watch? (conj proc-data "-w") proc-data) - {:env (if watch? - {"TAILWIND_MODE" "watch"} - {"NODE_MODE" (if (= mode :release) - "production" - "build")})})) + (if watch? (conj proc-data "-w") proc-data) + {:env (if watch? + {"TAILWIND_MODE" "watch"} + {"NODE_MODE" (if (= mode :release) + "production" + "build")})})) build-state) (defn hash-files From 2f3e31905b6e9704530a42ab186fa5d56095d24d Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Tue, 1 Oct 2024 17:59:05 -0300 Subject: [PATCH 29/37] fix: gray-50 color error --- tailwind.config.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tailwind.config.js b/tailwind.config.js index f8c2363..380b57d 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,10 +1,10 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - mode: 'jit', - purge: { - content: ['./src/mockingbird/**/*.cljs'] - }, + content: [ + './src/mockingbird/**/*.cljs', + './public/**/*.html', + ], safelist: [ 'w-64', 'w-1/2', @@ -42,11 +42,11 @@ module.exports = { extend: { colors: { mockingbird: {"main": "#FF009E", "100": "#AA397F", "400":"#A9397E", "500": "#D42490", "600": "#e90562","700": "#66003F", "text":"#55394A"}, - nightjar: {"main": "#E0D94A", "bg": "#36362C"}, - kiwi: {"main": "#7FE04A", "bg": "#2F362C"}, + nightjar: {"main": "#E0D94A"}, + kiwi: {"main": "#7FE04A"}, warning: {"50": "#fde8e8", "900": "#F05252"}, success: {"50": "#def7ec", "700": "#046c4e"}, - gray: {"50": "#fde8e8", "700": "#808080", "800": "#5e5e5e" }, + gray: {"700": "#808080", "800": "#5e5e5e" }, }, fontFamily: { From ca9873470ea6367c42a90618eec6bd38e41118bd Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Tue, 1 Oct 2024 18:37:25 -0300 Subject: [PATCH 30/37] fix: button, input and props fix --- src/mockingbird/components/button.cljs | 2 +- src/mockingbird/components/input.cljs | 6 +++--- src/mockingbird/helpers/props.cljs | 5 ++--- test/unit/components/props_test.cljs | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mockingbird/components/button.cljs b/src/mockingbird/components/button.cljs index 6165c10..d8dc381 100644 --- a/src/mockingbird/components/button.cljs +++ b/src/mockingbird/components/button.cljs @@ -8,7 +8,7 @@ (def styles {:default {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300 "} :highlight {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center py-2 px-4 text-sm focus:outline-none ring-slate-200 text-gray-50 bg-mockingbird-main hover:bg-mockingbird-700 text-gray-50 "} - :submit {:mockingbird "group py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-mockingbird-main hover:bg-mockingbird-700 focus:ring-4 focus:ring-primary-300 transition-all"} + :submit {:mockingbird "group py-3 px-5 transition-all text-base font-medium text-center text-white rounded-lg bg-mockingbird-main hover:bg-mockingbird-700 focus:ring-4 focus:ring-primary-300 "} :icon {:mockingbird "group transition-all p-0"}}) (defnc ^:export button diff --git a/src/mockingbird/components/input.cljs b/src/mockingbird/components/input.cljs index 0c41c88..04699af 100644 --- a/src/mockingbird/components/input.cljs +++ b/src/mockingbird/components/input.cljs @@ -5,12 +5,12 @@ [mockingbird.lib :refer-macros [defnc]] [helix.dom :as d])) -(def label-style "block mb-2 text-sm font-medium text-gray-900") +(def label-style "block mb-2 text-sm font-medium text-gray-900 ") (def styles {:text {:mockingbird (str "shadow-sm bg-gray-50 focus:ring-mockingbird-main " - "focus:border-mockingbird-main block w-full sm:text-sm " - "border-gray-300 rounded-md")} + "focus:border-mockingbird-main block sm:text-sm " + "border-gray-300 rounded-md ")} :checkbox {:default (str "")} :file {:default (str "")} :select {:default (str "")} diff --git a/src/mockingbird/helpers/props.cljs b/src/mockingbird/helpers/props.cljs index 42f1533..d46f155 100644 --- a/src/mockingbird/helpers/props.cljs +++ b/src/mockingbird/helpers/props.cljs @@ -12,7 +12,7 @@ :md "w-16 h-16 " :lg "w-32 h-32 " :xl "w-64 h-64 " - :full "lg:w-full sm:w-[calc(50%)] " + :full "w-full " "w-16 h-16 ") actual-roundness (case roundness @@ -42,5 +42,4 @@ :md "m-4 " :lg "m-8 " nil)] - (str actual-size actual-roundness cast-shadow - actual-padding actual-margin class))) + (str class " " actual-size actual-roundness cast-shadow actual-padding actual-margin ))) diff --git a/test/unit/components/props_test.cljs b/test/unit/components/props_test.cljs index 216aedc..3391337 100644 --- a/test/unit/components/props_test.cljs +++ b/test/unit/components/props_test.cljs @@ -28,7 +28,7 @@ :margin :none :padding :none :class "basic-class"}) - "lg:w-full sm:w-[calc(50%)] basic-class")) + "w-full basic-class")) (is (= (get-props {:size :xl :roundness :none From 0c84712e94ad49642e9b31b5e0ec8b70d117a1f8 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Tue, 1 Oct 2024 18:41:22 -0300 Subject: [PATCH 31/37] fix: props test --- src/mockingbird/helpers/props.cljs | 2 +- test/unit/components/props_test.cljs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mockingbird/helpers/props.cljs b/src/mockingbird/helpers/props.cljs index d46f155..bbff6d3 100644 --- a/src/mockingbird/helpers/props.cljs +++ b/src/mockingbird/helpers/props.cljs @@ -42,4 +42,4 @@ :md "m-4 " :lg "m-8 " nil)] - (str class " " actual-size actual-roundness cast-shadow actual-padding actual-margin ))) + (str class actual-size actual-roundness cast-shadow actual-padding actual-margin ))) diff --git a/test/unit/components/props_test.cljs b/test/unit/components/props_test.cljs index 3391337..3303bfe 100644 --- a/test/unit/components/props_test.cljs +++ b/test/unit/components/props_test.cljs @@ -11,24 +11,24 @@ :shadow :sm :margin :sm :padding :sm - :class "custom-class"}) - "w-8 h-8 rounded-sm shadow-sm p-2 m-2 custom-class")) + :class "custom-class "}) + "custom-class w-8 h-8 rounded-sm shadow-sm p-2 m-2 ")) (is (= (get-props {:size :lg :roundness :full :shadow :lg :margin :md :padding :lg - :class "another-class"}) - "w-32 h-32 rounded-full shadow-lg p-8 m-4 another-class")) + :class "another-class "}) + "another-class w-32 h-32 rounded-full shadow-lg p-8 m-4 ")) (is (= (get-props {:size :full :roundness :none :shadow :none :margin :none :padding :none - :class "basic-class"}) - "w-full basic-class")) + :class "basic-class "}) + "basic-class w-full ")) (is (= (get-props {:size :xl :roundness :none From 19879562804c85706fe66f1744691b05e95a998a Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Wed, 2 Oct 2024 16:24:14 -0300 Subject: [PATCH 32/37] fix: component style enhance --- src/mockingbird/components/button.cljs | 12 ++--- src/mockingbird/components/image.cljs | 6 +-- src/mockingbird/components/message.cljs | 59 +++++++++++++++++++++++++ src/mockingbird/components/pfp.cljs | 24 +++++----- src/mockingbird/examples/main.cljs | 28 +++++++----- 5 files changed, 100 insertions(+), 29 deletions(-) create mode 100644 src/mockingbird/components/message.cljs diff --git a/src/mockingbird/components/button.cljs b/src/mockingbird/components/button.cljs index d8dc381..d6dc37c 100644 --- a/src/mockingbird/components/button.cljs +++ b/src/mockingbird/components/button.cljs @@ -5,11 +5,13 @@ [mockingbird.lib :refer-macros [defnc]] [helix.dom :as d])) + (def styles - {:default {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300 "} - :highlight {:mockingbird "group inline-flex transition-all ring-1 items-center justify-center py-2 px-4 text-sm focus:outline-none ring-slate-200 text-gray-50 bg-mockingbird-main hover:bg-mockingbird-700 text-gray-50 "} - :submit {:mockingbird "group py-3 px-5 transition-all text-base font-medium text-center text-white rounded-lg bg-mockingbird-main hover:bg-mockingbird-700 focus:ring-4 focus:ring-primary-300 "} - :icon {:mockingbird "group transition-all p-0"}}) + {:mockingbird + {:default "group inline-flex transition-all ring-1 items-center justify-center rounded-full py-2 px-4 text-sm focus:outline-none ring-slate-200 text-slate-700 hover:text-slate-900 hover:ring-slate-300 active:bg-slate-100 active:text-slate-600 focus-visible:outline-blue-600 focus-visible:ring-slate-300" + :highlight "group inline-flex transition-all ring-1 items-center justify-center py-2 px-4 text-sm focus:outline-none ring-slate-200 text-gray-50 bg-mockingbird-main hover:bg-mockingbird-700 text-gray-50" + :submit "group py-3 px-5 transition-all text-base font-medium text-center text-white rounded-lg bg-mockingbird-main hover:bg-mockingbird-700 focus:ring-4 focus:ring-primary-300" + :icon "group transition-all p-0"}}) (defnc ^:export button [{:keys [class theme type @@ -29,7 +31,7 @@ children nil}}] (d/div (d/button - {:class (str (get-in styles [type theme]) " " + {:class (str (get-in styles [theme type]) " " (get-props {:size size :roundness roundness diff --git a/src/mockingbird/components/image.cljs b/src/mockingbird/components/image.cljs index a481fd1..7d06c45 100644 --- a/src/mockingbird/components/image.cljs +++ b/src/mockingbird/components/image.cljs @@ -6,12 +6,12 @@ [helix.dom :as d])) (defnc ^:export image - [{:keys [class theme image + [{:keys [class theme src alt size roundness shadow margin padding loading? children] :or {theme :mockingbird - image "/images/logo.png" + src "/images/logo.png" alt "Image description" size :md roundness :none @@ -30,6 +30,6 @@ :margin margin :padding padding :class class})) - :src image + :src src :alt alt})) children)) diff --git a/src/mockingbird/components/message.cljs b/src/mockingbird/components/message.cljs new file mode 100644 index 0000000..8121432 --- /dev/null +++ b/src/mockingbird/components/message.cljs @@ -0,0 +1,59 @@ +(ns mockingbird.components.message + (:require + [cljs.pprint :as pprint] + [clojure.string :as str] + [mockingbird.lib :refer-macros [defnc]] + [mockingbird.components.pfp :refer [pfp]] + [helix.dom :as d] + [helix.core :refer [$]])) + +(defn gen-today-date [] + (let [date (js/Date.) + pad-comp-fn #(-> (.toString %) + (.padStart 2 "0"))] + (->> [(.getDate date) (inc (.getMonth date)) (.getFullYear date)] + (map pad-comp-fn) + (str/join "/")))) + +(defnc text + [{:keys [message index]}] + (let [msg-seq (seq message)] + (d/div + (d/p {:class "text-base font-normal text-gray-500 dark:text-gray-400"} + (nth msg-seq index)) + (when (< index (dec (count message))) + (do + (d/br) + ($ text {:message message :index (inc index)})))))) + +(defnc message + [{:keys [image children author title message email] + :or {image "" + author "Team Mockingbird"}}] + (d/section + (d/div {:class (str "p-4 bg-white block sm:flex items-center justify-between border-b" + "border-gray-200 lg:mt-1.5 dark:bg-gray-800 dark:border-gray-700")} + (d/div {:class "flex items-center divide-x divide-gray-100 dark:divide-gray-700"} + (d/div {:class "pl-3 text-sm font-medium text-gray-500"} + (gen-today-date)))) + + (d/div {:class "p-5"} + (d/div {:class "flex items-center mb-4"} + (d/div {:class "flex-shrink-0"} + ($ pfp + {:src image + :pfp-loading? false})) + (d/div {:class "ml-4"} + (d/p author) + (d/div {:class "mltext-sm text-gray-500 text-normal dark:text-gray-400"} + (d/i email)))) + (d/h1 {:class "mb-4 text-2xl font-bold text-gray-900 dark:text-white"} + title) + (d/div {:class "space-y-1"} + ($ text {:message (seq message) :index 0}) + (d/p {:class "p-2 text-base font-normal text-gray-500 dark:text-gray-400"} + "Best Regards," + (d/br) + (d/i "Avelino Founder Team")))))) + + diff --git a/src/mockingbird/components/pfp.cljs b/src/mockingbird/components/pfp.cljs index a9ae3e5..dd56023 100644 --- a/src/mockingbird/components/pfp.cljs +++ b/src/mockingbird/components/pfp.cljs @@ -6,17 +6,18 @@ [helix.dom :as d])) (def pfp-styles - {:default "w-8 h-8 rounded-none opacity-100" - :rounded "w-8 h-8 rounded-full opacity-100" - :loading "w-8 h-8 rounded-full opacity-30 animate-pulse"}) + {:mockinbird {:default "w-8 h-8 rounded-none opacity-100" + :rounded "w-8 h-8 rounded-full opacity-100" + :loading "w-8 h-8 rounded-full opacity-30 animate-pulse"}}) (defnc pfp - [{:keys [class theme image + [{:keys [class theme style src alt size roundness shadow margin padding loading? children] - :or {theme :mockingbird - image "/images/logo.png" + :or {theme :mockinbird + style :default + src "/images/logo.png" alt "Profile picture" size :md roundness :none @@ -25,9 +26,10 @@ padding :none loading? false}}] (d/div - (if loading? - (d/div {:class (get pfp-styles :loading)} "Loading...") - (d/img {:class (str (get pfp-styles theme) " " + (d/img {:class (str (get-in pfp-styles + [theme (if loading? + :loading + style)] " ") (get-props {:size size :roundness roundness @@ -35,6 +37,6 @@ :margin margin :padding padding :class class})) - :src image - :alt alt})) + :src src + :alt alt}) children)) diff --git a/src/mockingbird/examples/main.cljs b/src/mockingbird/examples/main.cljs index b89f8f0..71909cd 100644 --- a/src/mockingbird/examples/main.cljs +++ b/src/mockingbird/examples/main.cljs @@ -1,14 +1,15 @@ (ns mockingbird.examples.main (:require - [helix.core :refer [$]] - [helix.dom :as d] - [mockingbird.lib :refer-macros [defnc]] - [mockingbird.components.aside :refer [aside]] - [mockingbird.layout.footer :refer [footer]] - [mockingbird.layout.header :refer [header]] - [mockingbird.components.hero :refer [hero]] - [mockingbird.layout.main :refer [main]] - [mockingbird.layout.navbar :refer [nav-bar]])) + [helix.core :refer [$]] + [helix.dom :as d] + [mockingbird.lib :refer-macros [defnc]] + [mockingbird.components.aside :refer [aside]] + [mockingbird.components.message :refer [message]] + [mockingbird.layout.footer :refer [footer]] + [mockingbird.layout.header :refer [header]] + [mockingbird.components.hero :refer [hero]] + [mockingbird.layout.main :refer [main]] + [mockingbird.layout.navbar :refer [nav-bar]])) ;; TODO create a example to render on this app and demonstrate the components power! (defnc app [] @@ -17,5 +18,12 @@ ($ nav-bar {:logo "/images/logo.png"}) ($ hero)) (comment ($ aside)) - ($ main (d/p "ok")) + ($ main + ($ message + {:title "Welcome to moclojer beta" + :email "avelino@moclojer.com" + :author "Avelino" + :image "/images/logo.png" + :image-style "rounded" + :message ["I'm happy to have you here, we are launching the SaaS version of moclojer, seeking to make it simple for you to put a mock API in the air to develop your projects." "I look forward to your feedback (this is the only way we can improve the product)."]})) ($ footer))) From efd525703bb51ca5f5ca506bf96637d8022b0a7a Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Thu, 3 Oct 2024 16:57:45 -0300 Subject: [PATCH 33/37] fix: ci workflow fixes - npm compiling on clojar for css generation - building names --- .github/workflows/npm.yml | 6 +++--- .github/workflows/release.yml | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index e7a6e39..843621c 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -11,14 +11,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: "DeLaGuardo/setup-clojure@12.5" + - uses: DeLaGuardo/setup-clojure@12.5 - uses: actions/setup-node@v3 with: node-version: "20" - - name: Build and package the library + - name: npm release run: | npm ci && \ npm run lib - - uses: "JS-DevTools/npm-publish@v3.1.1" + - uses: JS-DevTools/npm-publish@v3.1.1 with: token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7593ed3..8bb82e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,11 +18,15 @@ jobs: - uses: "DeLaGuardo/setup-clojure@12.5" with: cli: "1.11.1.1139" - - name: release + - uses: actions/setup-node@v3 + with: + node-version: "20" + - name: Clojars release env: CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} run: | + npm run release && \ clojure -T:dev:build clean && \ clojure -T:dev:build jar && \ clojure -X:deploy-clojars From 46df98af0478a45b91381db49403d8ca4a0b8d97 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Thu, 3 Oct 2024 17:18:53 -0300 Subject: [PATCH 34/37] fix: npm install --- .github/workflows/npm.yml | 1 + .github/workflows/release.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 843621c..96dd8a7 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -22,3 +22,4 @@ jobs: - uses: JS-DevTools/npm-publish@v3.1.1 with: token: ${{ secrets.NPM_TOKEN }} + # TODO diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8bb82e3..9c55268 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: shell: bash steps: - uses: actions/checkout@v4 - - uses: "DeLaGuardo/setup-clojure@12.5" + - uses: DeLaGuardo/setup-clojure@12.5 with: cli: "1.11.1.1139" - uses: actions/setup-node@v3 @@ -26,8 +26,8 @@ jobs: CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} run: | + npm ci && \ npm run release && \ clojure -T:dev:build clean && \ clojure -T:dev:build jar && \ clojure -X:deploy-clojars - From 4dc125bdb76533b89ffb6a0f2a3be16cd3481253 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Fri, 4 Oct 2024 13:41:12 -0300 Subject: [PATCH 35/37] docs: improve reading flow --- README.md | 18 ++++++------------ docs/Roadmap.md | 3 --- docs/test.md | 6 +++--- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index a0069bd..e55d791 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ Design System using [tailwind](https://tailwindcss.com/) and [helix](https://github.com/lilactown/helix) in [ClojureScript](https://clojurescript.org/). -A simple way to develop a user interface with a consistent user experience, without the need to clutter `cljs` code with **CSS**. +A simple way to develop a user interface with a consistent user experience, without the need to clutter **cljs** code with **CSS** (unless you want to). -> if your desire is to use mockingbird without ClojureScript (how you dare!) you can of course use our npm package into your JS application. Read more [here](#Installation). +> Work In Progress: if your desire is to use mockingbird without ClojureScript (how dare you!) you can of course use our npm package into your JS application. Read more [here](#Installation). ## name reference? @@ -49,6 +49,8 @@ $ npm install react autoprefixer babel-loader css-loader cssnano karma karma-chr ``` +Copy our [tailwind.config.js](tailwind.config.js), specially the colors, into your own config. + # Usage add a import on a specific component or layout component you want and load it in your screen @@ -78,17 +80,9 @@ As you can see, our components have specific built-in styles for you. You can se You can clone and build this repo, to see some examples of good usage of our dear Mockingbird. You can read more [here](docs/test.md). -- Set up your project: Start by creating a new ClojureScript project, or use an existing one. - -- Install node dependencies with a simple command: - -``` sh -npm ci -``` - -- configure your shadow cljs +- you will need to configure your shadow cljs environment too! -> for better understanding, follow the offcial [guide](https://github.com/thheller/shadow-cljs) +> for better understanding, follow the offcial [shadow-cljs guide](https://github.com/thheller/shadow-cljs) # Contributing diff --git a/docs/Roadmap.md b/docs/Roadmap.md index f5d4aa4..0ffee83 100644 --- a/docs/Roadmap.md +++ b/docs/Roadmap.md @@ -3,8 +3,5 @@ - layout - components - themes (mockingbird, nightjar, kiwi) -- ReFx -- animations -- text editor? - tests diff --git a/docs/test.md b/docs/test.md index 826d8db..951c5cd 100644 --- a/docs/test.md +++ b/docs/test.md @@ -1,8 +1,8 @@ # Running the local mocking bird tests -Mockingbird is a powerful tool for helping you build your project, but, as a great dev, you will not insert any random tool someone told you to. Instead, you are probably gonna test it several times and also contribute to the open source code, won't you? +Mockingbird is a powerful tool for helping you build your project, but, as a great dev, you will not insert any random tool someone told you to. Instead, you will test it several times and also contribute to the open source code, won't you? -> To do so, follow this simple md file +> To do so, follow this simple tutorial ## Dev @@ -12,7 +12,7 @@ To start our demo, simply run: ```sh - npm run app:watch + npm run watch ``` From bf833707958d51fb2509a8fd4a4bddf362381039 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Fri, 4 Oct 2024 14:12:00 -0300 Subject: [PATCH 36/37] doc: adds more context on README.md --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e55d791..02b7c3d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Design System using [tailwind](https://tailwindcss.com/) and [helix](https://git A simple way to develop a user interface with a consistent user experience, without the need to clutter **cljs** code with **CSS** (unless you want to). -> Work In Progress: if your desire is to use mockingbird without ClojureScript (how dare you!) you can of course use our npm package into your JS application. Read more [here](#Installation). +> Work In Progress: if your desire is to use mockingbird without ClojureScript (how dare you!), you can, of course, use our npm package in your JS application. Read more [here](#Installation). ## name reference? @@ -49,7 +49,9 @@ $ npm install react autoprefixer babel-loader css-loader cssnano karma karma-chr ``` -Copy our [tailwind.config.js](tailwind.config.js), specially the colors, into your own config. +Copy our [tailwind.config.js](tailwind.config.js), especially the colors, into your own config. + +Consider creating a package.json file with these dependencies pre-configured or, maybe, you can even copy our package.json. # Usage @@ -76,14 +78,48 @@ you can pass arguments into our components simply as this: ``` As you can see, our components have specific built-in styles for you. You can see a handful tutorial on the parameters for styling the components [here](docs/params.md) -# Testing Locally +# Rendering with shadow-cljs -You can clone and build this repo, to see some examples of good usage of our dear Mockingbird. You can read more [here](docs/test.md). +You will also need to render the components on your UI, so you can use our [core file](src/mockingbird/core.cljs) and this [example file](src/mockingbird/examples/main.cljs). + + +It will look something like this: + +``` clj + +(ns your-project.core + (:require + ["react-dom/client" :as rdom] + [mockingbird.examples.main :as ex] + [helix.core :refer [$ <>]])) + +;; this is a front app application using shadow-cljs, postcss, helix and refx. +;; You can see a simple page example running here. + +(defn app [] + (<> + ($ ex/app))) -- you will need to configure your shadow cljs environment too! +(defonce root + (rdom/createRoot (js/document.getElementById "app"))) + +(defn render [] + (.render root ($ app))) + +(defn config [] + (println "ok")) + +(defn ^:export init [] + (config) + (render)) + +``` > for better understanding, follow the offcial [shadow-cljs guide](https://github.com/thheller/shadow-cljs) +You can clone and build this repo, to see some examples of good usage of our dear Mockingbird. You can read more [here](docs/test.md). + + # Contributing Mockingbird is open-source, and contributions are welcome! If you have ideas for new features, improvements, or bug fixes, feel free to open an issue or submit a pull request. From ff9a234821480cf5b670853abfe11a1d291f83e0 Mon Sep 17 00:00:00 2001 From: Felipe-gsilva Date: Fri, 4 Oct 2024 14:52:40 -0300 Subject: [PATCH 37/37] feat: export tag for shadow npm compiling --- src/mockingbird/components/filedropdown.cljs | 2 +- src/mockingbird/components/form.cljs | 2 +- src/mockingbird/components/hero.cljs | 2 +- src/mockingbird/components/icon.cljs | 2 +- src/mockingbird/components/message.cljs | 2 +- src/mockingbird/components/pfp.cljs | 2 +- src/mockingbird/components/selectdropdown.cljs | 2 +- src/mockingbird/components/status.cljs | 2 +- src/mockingbird/components/texteditor.cljs | 17 ----------------- 9 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 src/mockingbird/components/texteditor.cljs diff --git a/src/mockingbird/components/filedropdown.cljs b/src/mockingbird/components/filedropdown.cljs index d4c6567..2cdddf7 100644 --- a/src/mockingbird/components/filedropdown.cljs +++ b/src/mockingbird/components/filedropdown.cljs @@ -5,7 +5,7 @@ (def styles {}) -(defnc filedropdown +(defnc ^:export filedropdown [{:keys [class theme label children] :or {theme :mockingbird diff --git a/src/mockingbird/components/form.cljs b/src/mockingbird/components/form.cljs index b7b904c..c3c886a 100644 --- a/src/mockingbird/components/form.cljs +++ b/src/mockingbird/components/form.cljs @@ -7,7 +7,7 @@ (def styles {}) -(defnc form +(defnc ^:export form [{:keys [class theme label children] :or {theme :mockingbird diff --git a/src/mockingbird/components/hero.cljs b/src/mockingbird/components/hero.cljs index f35afa8..f30cdc1 100644 --- a/src/mockingbird/components/hero.cljs +++ b/src/mockingbird/components/hero.cljs @@ -6,7 +6,7 @@ [mockingbird.components.button :refer [button]] [mockingbird.components.image :refer [image]])) -(defnc hero [] +(defnc ^:export hero [] (d/div {:class "group w-screen h-screen bg-gray-50 flex items-center justify-left pl-16 flex-row md:flex-row sm:flex-col md:h-screen sm:h-[calc(600px)]"} (d/div {:class "flex justify-center lg:w-1/3 sm:w-full"} ($ image {:theme :mockingbird diff --git a/src/mockingbird/components/icon.cljs b/src/mockingbird/components/icon.cljs index 5fabade..41422cb 100644 --- a/src/mockingbird/components/icon.cljs +++ b/src/mockingbird/components/icon.cljs @@ -8,7 +8,7 @@ (def styles {:mockingbird {}}) -(defnc icon +(defnc ^:export icon [{:keys [class theme label href children] :or {theme :mockingbird diff --git a/src/mockingbird/components/message.cljs b/src/mockingbird/components/message.cljs index 8121432..11faa3f 100644 --- a/src/mockingbird/components/message.cljs +++ b/src/mockingbird/components/message.cljs @@ -26,7 +26,7 @@ (d/br) ($ text {:message message :index (inc index)})))))) -(defnc message +(defnc ^:export message [{:keys [image children author title message email] :or {image "" author "Team Mockingbird"}}] diff --git a/src/mockingbird/components/pfp.cljs b/src/mockingbird/components/pfp.cljs index dd56023..277cc0f 100644 --- a/src/mockingbird/components/pfp.cljs +++ b/src/mockingbird/components/pfp.cljs @@ -10,7 +10,7 @@ :rounded "w-8 h-8 rounded-full opacity-100" :loading "w-8 h-8 rounded-full opacity-30 animate-pulse"}}) -(defnc pfp +(defnc ^:export pfp [{:keys [class theme style src alt size roundness shadow margin padding diff --git a/src/mockingbird/components/selectdropdown.cljs b/src/mockingbird/components/selectdropdown.cljs index 8973d44..b3ef9f6 100644 --- a/src/mockingbird/components/selectdropdown.cljs +++ b/src/mockingbird/components/selectdropdown.cljs @@ -6,7 +6,7 @@ ;; TODO (def styles {}) -(defnc selectdropdown +(defnc ^:export selectdropdown [{:keys [class theme label children] :or {theme :mockingbird diff --git a/src/mockingbird/components/status.cljs b/src/mockingbird/components/status.cljs index 0d2c5cb..54258d3 100644 --- a/src/mockingbird/components/status.cljs +++ b/src/mockingbird/components/status.cljs @@ -6,7 +6,7 @@ [helix.dom :as d] [refx.alpha :as refx])) -(defnc status-card +(defnc ^:export status-card [{:keys [status loading? title offline publishing published] :or {status false}}] diff --git a/src/mockingbird/components/texteditor.cljs b/src/mockingbird/components/texteditor.cljs deleted file mode 100644 index a1cbfc7..0000000 --- a/src/mockingbird/components/texteditor.cljs +++ /dev/null @@ -1,17 +0,0 @@ -(ns mockingbird.components.texteditor - (:require - [mockingbird.lib :refer-macros [defnc]] - [helix.dom :as d])) - -;; TODO -(def styles {}) - -(defnc text-editor - [{:keys [class theme label - children] - :or {theme :mockingbird - children "Insert some text"}}] - (d/div - (d/form - {:class (str (get-in styles [theme]) " " class)} - children)))