Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rpofuk committed Jan 7, 2021
1 parent c27b1d4 commit e4ee8d1
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 51 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish
on:
push:
tags:
- v*.*.*
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}

93 changes: 43 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,67 +39,60 @@ Generated project has folowing structure
```
.
├── deps.edn
├── Dockerfile
├── package.json
├── package-lock.json
├── project.iml
├── resources
│   └── public
│   ├── devcards.html
│   └── index.html
├── src
│   └── main
│   └── myproject
│   ├── about
│   │   ├── db.cljs
│   │   ├── events.cljs
│   │   ├── subs.cljs
│   │   ── views.cljs
│   ├── home
│   │   ├── db.cljs
│   │   ├── events.cljs
│   │   ── subs.cljs
│   │   └── views.cljs
│   ├── config.cljs
│   ├── core.cljs
│   ├── db.cljs
│   ├── events.cljs
│   ── routes.cljs
│   ├── styles.cljs
│   ├── subs.cljs
│   ├── util.cljs
│   ── views.cljs
├── deps.edn
── package.json
── shadow-cljs.edn
├── shadow-cljs.edn
└── src
└── main
├── edd
│   ├── core.cljs
│   ├── db.cljs
│   ├── events.cljs
│   ── i18n.cljs
│   ├── routing.cljs
│   ├── subs.cljs
│   ├── util.cljs
│   ── views.cljs
└── myproject
├── about
│   ├── db.cljs
│   ├── events.cljs
│   ├── subs.cljs
│   └── views.cljs
├── core.cljs
├── home
│   ├── db.cljs
│   ├── events.cljs
│   ├── subs.cljs
│   └── views.cljs
── i18n.cljs
└── styles.cljs
```

Adding new view
```
npx @rpofuk/re-gen add news
# File src/main/views.cljs (dont forget required :)
(def components
{:home home/main-panel
:about about/main-panel
:news news/main-panel})
# File src/main/routes.cljs
(def routes ["/" {"" :home
"about" :about
"news" :news}])
# New page should be now reachable
http://127.0.0.1:3000/news
# To add link to this page in app do for example in src/main/views.cljs
[:nav
[:ul
[:li
[:> Button {:href "/"} "Home"]]
[:li
[:> Button {:href "/about"} "About"]]
[:li
[:> Button {:href "/news"} "News"]]]]]])`
; src/main/myproject/core.cljs (dont forget required :))
; Add translations to i18n file for UX
(defn ^:export init
[config]
(core/init
{...
:panels {...
:news news/main-panel}
...}))
```
Development
Expand Down
10 changes: 10 additions & 0 deletions local-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

rm -rf templates/project/.shadow-cljs
rm -rf templates/project/node_modules
rm -rf templates/project/.cpcache
rm -rf templates/project/resources/public/js
rm -rf templates/project/.idea
rm -rf templates/project/*.iml

sudo npm install -g ./
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rpofuk/re-gen",
"version": "1.1.7",
"version": "1.2.0",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit e4ee8d1

Please sign in to comment.