From 624dd8763048c3088aac0e4691c6bccfc916024e Mon Sep 17 00:00:00 2001 From: Rafael Delboni Date: Sat, 30 Oct 2021 12:46:09 -0300 Subject: [PATCH 1/2] refact: Renaming stasis to nota --- README.md | 8 ++--- bb.edn | 16 +++++----- package-lock.json | 4 +-- package.json | 6 ++-- resources/config.edn | 2 +- resources/public/index.html | 6 ++-- resources/public/pages/home.md | 8 ++--- scripts/{stasis => nota}/main.clj | 14 ++++---- scripts/{stasis => nota}/tests.clj | 8 ++--- shadow-cljs.edn | 16 +++++----- src/css/{stasis.css => nota.css} | 0 src/{stasis => nota}/adapters.cljs | 2 +- src/{stasis => nota}/application.cljs | 32 +++++++++---------- src/{stasis => nota}/application/build.clj | 4 +-- src/{stasis => nota}/application/data.cljs | 2 +- src/{stasis => nota}/application/env.cljc | 4 +-- src/{stasis => nota}/application/remote.cljs | 2 +- src/{stasis => nota}/logics.cljs | 2 +- src/{stasis => nota}/resolvers.cljs | 6 ++-- src/{stasis => nota}/routing.cljs | 6 ++-- src/{stasis => nota}/routing/pushy.cljs | 2 +- src/{stasis => nota}/ui.cljs | 14 ++++---- src/{stasis => nota}/ui/markdown.cljs | 2 +- src/{stasis => nota}/ui/pages.cljs | 6 ++-- src/{stasis => nota}/ui/posts.cljs | 8 ++--- src/{stasis => nota}/ui/posts/pagination.cljs | 4 +-- test/{stasis => nota}/adapters_test.cljs | 4 +-- test/{stasis => nota}/logics_test.cljs | 4 +-- test/{stasis => nota}/routing/pushy_test.cljs | 4 +-- .../ui/posts/pagination_test.cljs | 4 +-- test/{stasis => nota}/ui/root_test.cljs | 12 +++---- 31 files changed, 106 insertions(+), 106 deletions(-) rename scripts/{stasis => nota}/main.clj (97%) rename scripts/{stasis => nota}/tests.clj (92%) rename src/css/{stasis.css => nota.css} (100%) rename src/{stasis => nota}/adapters.cljs (99%) rename src/{stasis => nota}/application.cljs (54%) rename src/{stasis => nota}/application/build.clj (87%) rename src/{stasis => nota}/application/data.cljs (96%) rename src/{stasis => nota}/application/env.cljc (71%) rename src/{stasis => nota}/application/remote.cljs (98%) rename src/{stasis => nota}/logics.cljs (97%) rename src/{stasis => nota}/resolvers.cljs (97%) rename src/{stasis => nota}/routing.cljs (93%) rename src/{stasis => nota}/routing/pushy.cljs (99%) rename src/{stasis => nota}/ui.cljs (83%) rename src/{stasis => nota}/ui/markdown.cljs (95%) rename src/{stasis => nota}/ui/pages.cljs (92%) rename src/{stasis => nota}/ui/posts.cljs (95%) rename src/{stasis => nota}/ui/posts/pagination.cljs (98%) rename test/{stasis => nota}/adapters_test.cljs (98%) rename test/{stasis => nota}/logics_test.cljs (97%) rename test/{stasis => nota}/routing/pushy_test.cljs (95%) rename test/{stasis => nota}/ui/posts/pagination_test.cljs (92%) rename test/{stasis => nota}/ui/root_test.cljs (87%) diff --git a/README.md b/README.md index 9d47bb9..7e30b6a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Stasis +# Nota Static Markdown Blog/Site using Fulcro & Pathom with no backend # Prerequisites @@ -9,7 +9,7 @@ Things you need installed to use this repository - [babashka](https://github.com/babashka/babashka#installation) # Developers -Commands and alias for tooling while developing stasis. +Commands and alias for tooling while developing nota. ## Install dependencies ```bash @@ -17,7 +17,7 @@ npm install ``` ## Set configurations -Set the [`resources/config.edn`](https://github.com/rafaeldelboni/stasis/blob/main/resources/config.edn) with your keys or the corresponding enviroment variables. +Set the [`resources/config.edn`](https://github.com/rafaeldelboni/nota/blob/main/resources/config.edn) with your keys or the corresponding enviroment variables. The config is generated using shadow-cljs hook, macros and [juxt/aero](https://github.com/juxt/aero) under the hood, check it's documentation for more information on how to use. _[Aero's #profile](https://github.com/juxt/aero#profile)_ reader conditionals available: @@ -146,7 +146,7 @@ Are you sure? (y/N): This will **delete** the file `resources/public/posts/hello-world.md` and remove the entry in the database `src/data.edn`. ## Tags -Tags aren't required to stasis work, but you can override it's default behaviour (capitalize tag) to customize the name that will be shown. +Tags aren't required to nota work, but you can override it's default behaviour (capitalize tag) to customize the name that will be shown. ### New Tags ```bash diff --git a/bb.edn b/bb.edn index ea10ca7..7f3db62 100644 --- a/bb.edn +++ b/bb.edn @@ -3,11 +3,11 @@ :deps {babashka/fs {:mvn/version "0.1.0"} borkdude/rewrite-edn {:mvn/version "0.1.0"} dev.nubank/docopt {:mvn/version "0.6.1-fix7"}} - :tasks {new:post stasis.main/new-post - del:post stasis.main/del-post - new:page stasis.main/new-page - del:page stasis.main/del-page - new:tag stasis.main/new-tag - del:tag stasis.main/del-tag - tests (do (load-file "scripts/stasis/tests.clj") - (clojure.test/run-tests 'stasis.tests))}} + :tasks {new:post nota.main/new-post + del:post nota.main/del-post + new:page nota.main/new-page + del:page nota.main/del-page + new:tag nota.main/new-tag + del:tag nota.main/del-tag + tests (do (load-file "scripts/nota/tests.clj") + (clojure.test/run-tests 'nota.tests))}} diff --git a/package-lock.json b/package-lock.json index f2fb581..3277afd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "stasis", + "name": "nota", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "stasis", + "name": "nota", "version": "1.0.0", "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index cb8f328..5382434 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "stasis", + "name": "nota", "version": "1.0.0", "description": "Static Markdown Blog/Site using Fulcro & Pathom with no backend", "scripts": { - "css:watch": "sass --watch src/css/sakura.css:resources/public/css/sakura.min.css src/css/stasis.css:resources/public/css/stasis.min.css", - "css:release": "sass src/css/sakura.css:resources/public/css/sakura.min.css src/css/stasis.css:resources/public/css/stasis.min.css --style=compressed", + "css:watch": "sass --watch src/css/sakura.css:resources/public/css/sakura.min.css src/css/nota.css:resources/public/css/nota.min.css", + "css:release": "sass src/css/sakura.css:resources/public/css/sakura.min.css src/css/nota.css:resources/public/css/nota.min.css --style=compressed", "js:watch": "shadow-cljs watch main", "js:release": "shadow-cljs release main", "ci-tests": "shadow-cljs compile ci-tests && karma start --single-run", diff --git a/resources/config.edn b/resources/config.edn index dcf9348..0a88cb7 100644 --- a/resources/config.edn +++ b/resources/config.edn @@ -1,4 +1,4 @@ {:path-prefix #profile {:dev "" - :release "stasis"} + :release "nota"} :app-prefix "#" :default-route "home"} diff --git a/resources/public/index.html b/resources/public/index.html index 8e11ebf..a5ef523 100644 --- a/resources/public/index.html +++ b/resources/public/index.html @@ -4,7 +4,7 @@ - Stasis + Nota @@ -19,10 +19,10 @@ - +
- + diff --git a/resources/public/pages/home.md b/resources/public/pages/home.md index cdf4429..2d3f0db 100644 --- a/resources/public/pages/home.md +++ b/resources/public/pages/home.md @@ -1,4 +1,4 @@ -# Stasis +# Nota Static Markdown Blog/Site using Fulcro & Pathom with no backend # Prerequisites @@ -9,7 +9,7 @@ Things you need installed to use this repository - [babashka](https://github.com/babashka/babashka#installation) # Developers -Commands and alias for tooling while developing stasis. +Commands and alias for tooling while developing nota. ## Install dependencies ```bash @@ -17,7 +17,7 @@ npm install ``` ## Set configurations -Set the [`resources/config.edn`](https://github.com/rafaeldelboni/stasis/blob/main/resources/config.edn) with your keys or the corresponding enviroment variables. +Set the [`resources/config.edn`](https://github.com/rafaeldelboni/nota/blob/main/resources/config.edn) with your keys or the corresponding enviroment variables. The config is generated using shadow-cljs hook, macros and [juxt/aero](https://github.com/juxt/aero) under the hood, check it's documentation for more information on how to use. _[Aero's #profile](https://github.com/juxt/aero#profile)_ reader conditionals available: @@ -146,7 +146,7 @@ Are you sure? (y/N): This will **delete** the file `resources/public/posts/hello-world.md` and remove the entry in the database `src/data.edn`. ## Tags -Tags aren't required to stasis work, but you can override it's default behaviour (capitalize tag) to customize the name that will be shown. +Tags aren't required to nota work, but you can override it's default behaviour (capitalize tag) to customize the name that will be shown. ### New Tags ```bash diff --git a/scripts/stasis/main.clj b/scripts/nota/main.clj similarity index 97% rename from scripts/stasis/main.clj rename to scripts/nota/main.clj index 23c340e..e7a1598 100644 --- a/scripts/stasis/main.clj +++ b/scripts/nota/main.clj @@ -1,4 +1,4 @@ -(ns stasis.main +(ns nota.main (:require [babashka.fs :as fs] [borkdude.rewrite-edn :as r] [clojure.edn :as edn] @@ -141,7 +141,7 @@ (println "Item not found."))) ; inputs -(def new-post-doc "Stasis: New post +(def new-post-doc "Nota: New post Usage: new:post [Options] new:post -h | --help @@ -173,7 +173,7 @@ Options: :tags tags} :posts))))) -(def del-post-doc "Stasis: New post +(def del-post-doc "Nota: New post Usage: del:post [Options] del:post -h | --help @@ -195,7 +195,7 @@ Options: (let [id-slug (or (arg-map "") (arg-map "--slug"))] (delete-item-action id-slug :posts))))) -(def new-page-doc "Stasis: New page +(def new-page-doc "Nota: New page Usage: new:page [Options] new:page -h | --help @@ -221,7 +221,7 @@ Options: :slug slug} :pages))))) -(def del-page-doc "Stasis: New page +(def del-page-doc "Nota: New page Usage: del:page [Options] del:page -h | --help @@ -243,7 +243,7 @@ Options: (let [id-slug (or (arg-map "") (arg-map "--slug"))] (delete-item-action id-slug :pages))))) -(def new-tag-doc "Stasis: New tag +(def new-tag-doc "Nota: New tag Usage: new:tag [Options] new:tag -h | --help @@ -269,7 +269,7 @@ Options: :slug slug} :tags))))) -(def del-tag-doc "Stasis: New tag +(def del-tag-doc "Nota: New tag Usage: del:tag [Options] del:tag -h | --help diff --git a/scripts/stasis/tests.clj b/scripts/nota/tests.clj similarity index 92% rename from scripts/stasis/tests.clj rename to scripts/nota/tests.clj index 67d230c..46ec539 100644 --- a/scripts/stasis/tests.clj +++ b/scripts/nota/tests.clj @@ -1,5 +1,5 @@ -(ns stasis.tests - (:require [stasis.main :as main] +(ns nota.tests + (:require [nota.main :as main] [clojure.test :as t :refer [deftest is]])) ; logic tests @@ -41,8 +41,8 @@ ; files tests (deftest get-file - (is (= "(ns stasis.main" - (->> (main/get-file ["scripts" "stasis" "main.clj"]) + (is (= "(ns nota.main\n " + (->> (main/get-file ["scripts" "nota" "main.clj"]) slurp (take 15) (apply str))))) diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 5a1c680..5644d40 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -2,22 +2,22 @@ :dev-http {8000 "classpath:public"} :builds { :tests {:target :browser-test - :build-hooks [(stasis.application.build/load-env)] + :build-hooks [(nota.application.build/load-env)] :test-dir "resources/public/js/test" :ns-regexp "-test$" :devtools {:http-port 8022 :http-root "resources/public/js/test"}} :ci-tests {:target :karma - :build-hooks [(stasis.application.build/load-env)] + :build-hooks [(nota.application.build/load-env)] :compiler-options {:static-fns false :external-config {:guardrails {:throw? true}}} :output-to "target/ci.js" :ns-regexp "-test$"} :main {:target :browser - :build-hooks [(stasis.application.build/load-env)] - :output-dir "resources/public/js/stasis" - :asset-path "/js/stasis" - :modules {:main {:init-fn stasis.application/init - :entries [stasis.application]}} - :devtools {:after-load stasis.application/refresh + :build-hooks [(nota.application.build/load-env)] + :output-dir "resources/public/js/nota" + :asset-path "/js/nota" + :modules {:main {:init-fn nota.application/init + :entries [nota.application]}} + :devtools {:after-load nota.application/refresh :preloads [com.fulcrologic.fulcro.inspect.preload]}}}} diff --git a/src/css/stasis.css b/src/css/nota.css similarity index 100% rename from src/css/stasis.css rename to src/css/nota.css diff --git a/src/stasis/adapters.cljs b/src/nota/adapters.cljs similarity index 99% rename from src/stasis/adapters.cljs rename to src/nota/adapters.cljs index 86d47d2..dda5ffe 100644 --- a/src/stasis/adapters.cljs +++ b/src/nota/adapters.cljs @@ -1,4 +1,4 @@ -(ns stasis.adapters +(ns nota.adapters (:require [clojure.string :as string])) (defn vec->map-list-id diff --git a/src/stasis/application.cljs b/src/nota/application.cljs similarity index 54% rename from src/stasis/application.cljs rename to src/nota/application.cljs index ac607b3..db87c8b 100644 --- a/src/stasis/application.cljs +++ b/src/nota/application.cljs @@ -1,17 +1,17 @@ -(ns stasis.application +(ns nota.application (:require [com.fulcrologic.fulcro.application :as app] [com.fulcrologic.fulcro.components :as comp] [com.fulcrologic.fulcro.data-fetch :as df] [com.fulcrologic.fulcro.routing.dynamic-routing :as dr] - [stasis.application.data :as data] - [stasis.application.env :as env] - [stasis.application.remote :as remote] - [stasis.resolvers :as resolvers] - [stasis.routing :as routing] - [stasis.ui :as ui] - [stasis.ui.pages :as ui.pages])) + [nota.application.data :as data] + [nota.application.env :as env] + [nota.application.remote :as remote] + [nota.resolvers :as resolvers] + [nota.routing :as routing] + [nota.ui :as ui] + [nota.ui.pages :as ui.pages])) -(defonce stasis-app +(defonce nota-app (app/fulcro-app {:remotes {:remote (remote/local-pathom resolvers/resolvers {:config env/config @@ -20,16 +20,16 @@ (defn ^:export init [] - (app/set-root! stasis-app ui/Root {:initialize-state? true}) - (dr/initialize! stasis-app) - (routing/start! stasis-app) - (app/mount! stasis-app ui/Root "app" {:initialize-state? false}) - (df/load! stasis-app :list-pages ui.pages/ListPage) + (app/set-root! nota-app ui/Root {:initialize-state? true}) + (dr/initialize! nota-app) + (routing/start! nota-app) + (app/mount! nota-app ui/Root "app" {:initialize-state? false}) + (df/load! nota-app :list-pages ui.pages/ListPage) (js/console.log "Loaded!")) (defn ^:export refresh [] ;; re-mounting will cause forced UI refresh - (app/mount! stasis-app ui/Root "app") + (app/mount! nota-app ui/Root "app") ;; 3.3.0+ Make sure dynamic queries are refreshed - (comp/refresh-dynamic-queries! stasis-app) + (comp/refresh-dynamic-queries! nota-app) (js/console.log "Hot reload!")) diff --git a/src/stasis/application/build.clj b/src/nota/application/build.clj similarity index 87% rename from src/stasis/application/build.clj rename to src/nota/application/build.clj index 9c1b523..6ecbc1e 100644 --- a/src/stasis/application/build.clj +++ b/src/nota/application/build.clj @@ -1,6 +1,6 @@ -(ns stasis.application.build +(ns nota.application.build (:require [aero.core :as aero] - [stasis.application.env :as env] + [nota.application.env :as env] [clojure.java.io :as io])) (defn read-env [release-flag] diff --git a/src/stasis/application/data.cljs b/src/nota/application/data.cljs similarity index 96% rename from src/stasis/application/data.cljs rename to src/nota/application/data.cljs index e49808f..e2a7289 100644 --- a/src/stasis/application/data.cljs +++ b/src/nota/application/data.cljs @@ -1,4 +1,4 @@ -(ns stasis.application.data +(ns nota.application.data (:require [cljs.core.async :as async] [cljs.core.async.interop :refer-macros [) diff --git a/test/stasis/logics_test.cljs b/test/nota/logics_test.cljs similarity index 97% rename from test/stasis/logics_test.cljs rename to test/nota/logics_test.cljs index 6041e07..25f28cb 100644 --- a/test/stasis/logics_test.cljs +++ b/test/nota/logics_test.cljs @@ -1,6 +1,6 @@ -(ns stasis.logics-test +(ns nota.logics-test (:require - [stasis.logics :as logics] + [nota.logics :as logics] [clojure.test :refer [deftest is]] [fulcro-spec.core :refer [behavior assertions]])) diff --git a/test/stasis/routing/pushy_test.cljs b/test/nota/routing/pushy_test.cljs similarity index 95% rename from test/stasis/routing/pushy_test.cljs rename to test/nota/routing/pushy_test.cljs index 4e8af4e..34d6ef8 100644 --- a/test/stasis/routing/pushy_test.cljs +++ b/test/nota/routing/pushy_test.cljs @@ -1,7 +1,7 @@ -(ns stasis.routing.pushy-test +(ns nota.routing.pushy-test (:require [clojure.test :refer [async deftest is] :as test] [secretary.core :as secretary :refer-macros [defroute]] - [stasis.routing.pushy :as pushy]) + [nota.routing.pushy :as pushy]) (:import goog.history.Html5History)) (secretary/set-config! :prefix "/") diff --git a/test/stasis/ui/posts/pagination_test.cljs b/test/nota/ui/posts/pagination_test.cljs similarity index 92% rename from test/stasis/ui/posts/pagination_test.cljs rename to test/nota/ui/posts/pagination_test.cljs index 4b6d921..6db8d38 100644 --- a/test/stasis/ui/posts/pagination_test.cljs +++ b/test/nota/ui/posts/pagination_test.cljs @@ -1,7 +1,7 @@ -(ns stasis.ui.posts.pagination-test +(ns nota.ui.posts.pagination-test (:require [clojure.test :refer [deftest]] - [stasis.ui.posts.pagination :as ui.posts.pagination] + [nota.ui.posts.pagination :as ui.posts.pagination] [fulcro-spec.core :refer [behavior assertions]])) (declare =>) diff --git a/test/stasis/ui/root_test.cljs b/test/nota/ui/root_test.cljs similarity index 87% rename from test/stasis/ui/root_test.cljs rename to test/nota/ui/root_test.cljs index fe6d975..155ed05 100644 --- a/test/stasis/ui/root_test.cljs +++ b/test/nota/ui/root_test.cljs @@ -1,14 +1,14 @@ -(ns stasis.ui.root-test +(ns nota.ui.root-test (:require [clojure.test :refer [async deftest]] [com.fulcrologic.fulcro.application :as app] [com.fulcrologic.fulcro.data-fetch :as df] [com.fulcrologic.fulcro.routing.dynamic-routing :as dr] [fulcro-spec.core :refer [assertions]] - [stasis.application.remote :as remote] - [stasis.resolvers :as resolvers] - [stasis.routing :as routing] - [stasis.ui :as ui] - [stasis.ui.pages :as ui.pages])) + [nota.application.remote :as remote] + [nota.resolvers :as resolvers] + [nota.routing :as routing] + [nota.ui :as ui] + [nota.ui.pages :as ui.pages])) (declare =>) From 2fccccde658a30714ab510762106392f23608553 Mon Sep 17 00:00:00 2001 From: Rafael Delboni Date: Sat, 30 Oct 2021 12:50:12 -0300 Subject: [PATCH 2/2] feat: Adds nota meaning --- README.md | 2 ++ resources/public/pages/about.md | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 7e30b6a..0c08e15 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Nota +> nota : mark, token, note, sign. + Static Markdown Blog/Site using Fulcro & Pathom with no backend # Prerequisites diff --git a/resources/public/pages/about.md b/resources/public/pages/about.md index e65d4d2..719ab15 100644 --- a/resources/public/pages/about.md +++ b/resources/public/pages/about.md @@ -1,4 +1,5 @@ # About +> nota : mark, token, note, sign. ## Acknowledgment Great tools used to build this: