Skip to content

Commit

Permalink
Merge pull request #4 from rafaeldelboni/refact/rename-project-to-nota
Browse files Browse the repository at this point in the history
refact: Renaming stasis to nota
  • Loading branch information
rafaeldelboni authored Oct 30, 2021
2 parents 7cde518 + 2fccccd commit 9ef882b
Show file tree
Hide file tree
Showing 32 changed files with 109 additions and 106 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Stasis
# Nota
> nota : mark, token, note, sign.
Static Markdown Blog/Site using Fulcro & Pathom with no backend

# Prerequisites
Expand All @@ -9,15 +11,15 @@ 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
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:
Expand Down Expand Up @@ -146,7 +148,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
Expand Down
16 changes: 8 additions & 8 deletions bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -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))}}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion resources/config.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:path-prefix #profile {:dev ""
:release "stasis"}
:release "nota"}
:app-prefix "#"
:default-route "home"}
6 changes: 3 additions & 3 deletions resources/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<title>Stasis</title>
<title>Nota</title>

<!-- 114px PNG Icon -->
<link rel="icon" type="image/png" href="img/favicon.png">
Expand All @@ -19,10 +19,10 @@

<!-- CSS -->
<link rel="stylesheet" href="./css/sakura.min.css" type="text/css">
<link rel="stylesheet" href="./css/stasis.min.css" type="text/css">
<link rel="stylesheet" href="./css/nota.min.css" type="text/css">
</head>
<body>
<div id="app"></div>
<script src="./js/stasis/main.js"></script>
<script src="./js/nota/main.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions resources/public/pages/about.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# About
> nota : mark, token, note, sign.
## Acknowledgment
Great tools used to build this:
Expand Down
8 changes: 4 additions & 4 deletions resources/public/pages/home.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Stasis
# Nota
Static Markdown Blog/Site using Fulcro &amp; Pathom with no backend

# Prerequisites
Expand All @@ -9,15 +9,15 @@ 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
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:
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions scripts/stasis/main.clj → scripts/nota/main.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns stasis.main
(ns nota.main
(:require [babashka.fs :as fs]
[borkdude.rewrite-edn :as r]
[clojure.edn :as edn]
Expand Down Expand Up @@ -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 <name> [Options]
new:post -h | --help
Expand Down Expand Up @@ -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 <slug> [Options]
del:post -h | --help
Expand All @@ -195,7 +195,7 @@ Options:
(let [id-slug (or (arg-map "<slug>") (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 <name> [Options]
new:page -h | --help
Expand All @@ -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 <slug> [Options]
del:page -h | --help
Expand All @@ -243,7 +243,7 @@ Options:
(let [id-slug (or (arg-map "<slug>") (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 <slug> <name> [Options]
new:tag -h | --help
Expand All @@ -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 <slug> [Options]
del:tag -h | --help
Expand Down
8 changes: 4 additions & 4 deletions scripts/stasis/tests.clj → scripts/nota/tests.clj
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)))))
16 changes: 8 additions & 8 deletions shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -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]}}}}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/stasis/adapters.cljs → src/nota/adapters.cljs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns stasis.adapters
(ns nota.adapters
(:require [clojure.string :as string]))

(defn vec->map-list-id
Expand Down
32 changes: 16 additions & 16 deletions src/stasis/application.cljs → src/nota/application.cljs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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!"))
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns stasis.application.data
(ns nota.application.data
(:require [cljs.core.async :as async]
[cljs.core.async.interop :refer-macros [<p!]]
[cljs.reader :as reader]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns stasis.application.env
#?(:cljs (:require-macros [stasis.application.env :as env])))
(ns nota.application.env
#?(:cljs (:require-macros [nota.application.env :as env])))

(def config
"Map of environment variables, to be read at runtime."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns stasis.application.remote
(ns nota.application.remote
(:require [cljs.core.async :as async]
[com.fulcrologic.fulcro.algorithms.tx-processing :as txn]
[com.wsscode.pathom.connect :as pc]
Expand Down
2 changes: 1 addition & 1 deletion src/stasis/logics.cljs → src/nota/logics.cljs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns stasis.logics
(ns nota.logics
(:require [clojure.string :as string]))

(defn assoc-if-exists
Expand Down
6 changes: 3 additions & 3 deletions src/stasis/resolvers.cljs → src/nota/resolvers.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns stasis.resolvers
(ns nota.resolvers
(:require [com.wsscode.pathom.connect :as pc]
[stasis.adapters :as adapters]
[stasis.logics :as logics]))
[nota.adapters :as adapters]
[nota.logics :as logics]))

(pc/defresolver page-body-resolver
[{:keys [config fetch-text-fn]} {:page/keys [path]}]
Expand Down
6 changes: 3 additions & 3 deletions src/stasis/routing.cljs → src/nota/routing.cljs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns stasis.routing
(ns nota.routing
(:require [clojure.string :as str]
[com.fulcrologic.fulcro.routing.dynamic-routing :as dr]
[stasis.application.env :as env]
[stasis.routing.pushy :as pushy]))
[nota.application.env :as env]
[nota.routing.pushy :as pushy]))

(defonce history (atom nil))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns stasis.routing.pushy
(ns nota.routing.pushy
(:require [clojure.string]
[goog.dom :as dom]
[goog.events :as events])
Expand Down
Loading

0 comments on commit 9ef882b

Please sign in to comment.