Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyong committed Dec 4, 2017
1 parent 828d74d commit c4b94b1
Show file tree
Hide file tree
Showing 21 changed files with 84 additions and 3,547 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Command styles for Respo apps.

Demo http://ui.respo.site/

Read stylesheets: https://github.com/Respo/respo-ui/blob/master/src/respo_ui/style.cljc
Read stylesheets: [style.cljs](https://github.com/Respo/respo-ui/blob/master/src/respo_ui/style.cljs)

### Usages

Expand All @@ -20,10 +20,9 @@ Read stylesheets: https://github.com/Respo/respo-ui/blob/master/src/respo_ui/sty
[respo-ui.style :as ui]
[respo-ui.style.colors :as colors]
[respo-ui.comp.switchy :refer [comp-switch]] ; `switch` is a reserved word
[respo-ui.command :refer [init-input update-input on-input]]
```

Use `ui/button` as `style` attributes for buttons.
Use `ui/button` as `:style` attributes for buttons.

### Develop

Expand Down
2 changes: 1 addition & 1 deletion coir.edn

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions entry/dev.js

This file was deleted.

2 changes: 0 additions & 2 deletions entry/release.js

This file was deleted.

29 changes: 7 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@
"description": "Respo UI",
"main": "index.js",
"scripts": {
"cdn": "ls -1 dist | xargs -I % upx put dist/% respo-ui/%",
"tiye": "rsync -r dist/{index.html,manifest.json} tiye.me:repo/Respo/ui/",
"cdn": "rsync -avr --progress dist/* tiye.me:cdn/respo-ui",
"tiye": "rsync -avr --progress dist/{index.html,manifest.json} tiye.me:repo/Respo/ui/",
"upload": "yarn cdn && yarn tiye",
"release": "shadow-cljs release browser",
"watch": "shadow-cljs watch browser",
"compile-ssr": "shadow-cljs compile ssr",
"html-dev": "env=dev node target/ssr.js && cp entry/manifest.json target/",
"html": "node target/ssr.js",
"hmr": "webpack-dev-server --config webpack.dev.coffee --hot-only",
"webpack": "webpack --config webpack.release.coffee --hide-modules --progress",
"dev": "yarn compile-ssr && yarn html-dev && yarn hmr",
"html": "node target/ssr.js && cp entry/manifest.json dist/",
"index.html": "yarn compile-ssr && yarn html-dev",
"del": "rm -rf dist/*",
"serve": "http-server dist",
"manifest": "cp entry/manifest.json dist/",
"build": "yarn del && yarn release && yarn webpack && yarn compile-ssr && yarn html && yarn manifest"
"serve": "http-server dist -s",
"build": "yarn del && yarn release && yarn compile-ssr && yarn html"
},
"repository": {
"type": "git",
Expand All @@ -27,20 +24,8 @@
"author": "jiyinyiyong",
"license": "MIT",
"devDependencies": {
"coffeescript": "^2.0.1",
"css-loader": "^0.28.7",
"extract-text-webpack-plugin": "^3.0.1",
"file-loader": "^1.1.5",
"http-server": "^0.10.0",
"respo-ui": "^0.1.2",
"shadow-cljs": "^2.0.20",
"source-map-loader": "^0.2.2",
"style-loader": "^0.19.0",
"uglifyjs-webpack-plugin": "^1.0.0-beta.3",
"url-loader": "^0.6.2",
"webpack": "^3.8.0",
"webpack-dev-server": "^2.9.2",
"webpack-manifest-plugin": "^1.3.2"
"shadow-cljs": "^2.0.114"
},
"dependencies": {}
}
21 changes: 13 additions & 8 deletions shadow-cljs.edn
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@

{:source-paths ["src"]
:dependencies [[mvc-works/hsl "0.1.2"]
[mvc-works/shell-page "0.1.3"]
[mvc-works/verbosely "0.1.0-rc2"]
[respo "0.6.4"]
[respo/router "0.2.2"]]
:http {:host "localhost" :port 8081}
[mvc-works/shell-page "0.1.6"]
[mvc-works/verbosely "0.1.1"]
[respo/ui "0.2.0"]
[respo/reel "0.2.2"]
[mvc-works/keycode "0.1.3"]
[respo/value "0.2.3"]
[respo/router "0.4.0"]
[respo "0.8.1"]]
:open-file-command ["subl" ["%s:%s:%s" :file :line :column]]
:builds {:browser {:target :browser
:output-dir "target/browser"
Expand All @@ -15,10 +18,12 @@
:lib {:entries [respo.core respo.macros
respo.comp.inspect]}}
:devtools {:after-load respo-ui.main/reload!
:preloads [shadow.cljs.devtools.client.hud]}
:preloads [shadow.cljs.devtools.client.hud]
:http-root "target"
:http-port 8080}
:release {:output-dir "dist/"
:module-hash-names true
:build-options {:manifest-name "cljs-manifest.json"}}}
:module-hash-names 8
:build-options {:manifest-name "assets.edn"}}}
:ssr {:target :node-script
:output-to "target/ssr.js"
:main respo-ui.render/main!
Expand Down
3 changes: 1 addition & 2 deletions src/respo_ui/comp/colors_page.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

(ns respo-ui.comp.colors-page
(:require-macros [respo.macros :refer [defcomp div <>]])
(:require [respo.core :refer [create-comp]]
(:require [respo.macros :refer [defcomp div <>]]
[respo-ui.style.colors :as colors]
[respo-ui.style :as ui]))

Expand Down
3 changes: 1 addition & 2 deletions src/respo_ui/comp/components.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

(ns respo-ui.comp.components
(:require-macros [respo.macros :refer [defcomp div a <>]])
(:require [respo.core :refer [create-comp]]
(:require [respo.macros :refer [defcomp div a <>]]
[respo.comp.space :refer [=<]]
[respo-ui.comp.switchy :refer [comp-switch]]))

Expand Down
7 changes: 4 additions & 3 deletions src/respo_ui/comp/container.cljs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

(ns respo-ui.comp.container
(:require-macros [respo.macros :refer [defcomp cursor-> div span input <>]])
(:require [hsl.core :refer [hsl]]
[respo.core :refer [create-comp]]
[respo.macros :refer [defcomp cursor-> div span input <>]]
[respo.comp.space :refer [=<]]
[respo-ui.style :as ui]
[respo-ui.style.colors :as colors]
Expand All @@ -20,7 +19,9 @@
(defcomp
comp-container
(store)
(let [router (:router store), mobile? (:mobile? store), states (:states store)]
(let [router (first (:path (:router store)))
mobile? (:mobile? store)
states (:states store)]
(div
{:style (merge ui/fullscreen ui/global)}
(comp-navbar)
Expand Down
4 changes: 1 addition & 3 deletions src/respo_ui/comp/fonts_page.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

(ns respo-ui.comp.fonts-page
(:require-macros [respo.macros :refer [defcomp div <>]])
(:require [respo.core :refer [create-comp]]))
(ns respo-ui.comp.fonts-page (:require [respo.macros :refer [defcomp div <>]]))

(def style-demo {:font-size 20, :font-weight "bold", :line-height "56px"})

Expand Down
5 changes: 2 additions & 3 deletions src/respo_ui/comp/home.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

(ns respo-ui.comp.home
(:require-macros [respo.macros :refer [defcomp div a img <>]])
(:require [respo.core :refer [create-comp]]
(:require [respo.macros :refer [defcomp div a img <>]]
[respo.comp.space :refer [=<]]
[respo-ui.style.colors :as colors]))

Expand All @@ -24,7 +23,7 @@
(div
{:style style-home}
(<> "Styles for Respo")
(=< 16)
(=< 16 nil)
(img {:src "https://img.shields.io/clojars/v/respo/ui.svg"}))
(div {:style style-logo})
(=< nil 32)
Expand Down
3 changes: 1 addition & 2 deletions src/respo_ui/comp/layouts_page.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

(ns respo-ui.comp.layouts-page
(:require [respo.macros :refer [defcomp div a <>]])
(:require [respo.core :refer [create-comp]]
(:require [respo.macros :refer [defcomp div a <>]]
[respo.comp.space :refer [=<]]
[respo-ui.style :as ui]
[respo-ui.style.colors :as colors]))
Expand Down
3 changes: 1 addition & 2 deletions src/respo_ui/comp/navbar.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

(ns respo-ui.comp.navbar
(:require-macros [respo.macros :refer [defcomp div <>]])
(:require [respo.core :refer [create-comp]]
(:require [respo.macros :refer [defcomp div <>]]
[respo-ui.style :as ui]
[respo-ui.style.colors :as colors]))

Expand Down
3 changes: 1 addition & 2 deletions src/respo_ui/comp/sidebar.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

(ns respo-ui.comp.sidebar
(:require-macros [respo.macros :refer [defcomp div <>]])
(:require [respo.core :refer [create-comp]] [respo-ui.style.colors :as colors]))
(:require [respo.macros :refer [defcomp div <>]] [respo-ui.style.colors :as colors]))

(defn on-route [path-name] (fn [e dispatch! mutate!] (dispatch! :router/nav path-name)))

Expand Down
3 changes: 1 addition & 2 deletions src/respo_ui/comp/switchy.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

(ns respo-ui.comp.switchy
(:require-macros [respo.macros :refer [defcomp div a img <>]])
(:require [respo.core :refer [create-comp]]
(:require [respo.macros :refer [defcomp div a img <>]]
[respo.comp.space :refer [=<]]
[respo-ui.style.colors :as colors]))

Expand Down
5 changes: 1 addition & 4 deletions src/respo_ui/comp/widgets_page.cljs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

(ns respo-ui.comp.widgets-page
(:require-macros [respo.macros
:refer
[defcomp div input textarea button span select option a <>]])
(:require [respo.core :refer [create-comp create-element]]
(:require [respo.macros :refer [defcomp div input textarea button span select option a <>]]
[respo.comp.space :refer [=<]]
[respo-ui.style :as ui]
[respo-ui.style.colors :as colors]))
Expand Down
4 changes: 2 additions & 2 deletions src/respo_ui/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
[respo.cursor :refer [mutate]]
[respo-ui.comp.container :refer [comp-container]]
[respo-router.core :refer [render-url!]]
[respo-router.util.listener :refer [listen! parse-address]]
[respo-router.listener :refer [listen!]]
[respo-router.parser :refer [parse-address]]
[respo-ui.router :as router]
[cljs.reader :refer [read-string]]
[respo-ui.schema :as schema]))
Expand All @@ -14,7 +15,6 @@
(defn updater [store op op-data]
(case op
:states (update store :states (mutate op-data))
:router/route (assoc store :router op-data)
:router/nav (assoc store :router (parse-address op-data router/dict))
store))

Expand Down
16 changes: 6 additions & 10 deletions src/respo_ui/render.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[respo-ui.comp.container :refer [comp-container]]
[respo-ui.schema :as schema]
[respo-ui.router :as router]
[respo-router.util.listener :refer [parse-address]]))
[respo-router.parser :refer [parse-address]]
[cljs.reader :refer [read-string]]))

(def base-info {:title "Respo UI", :icon "http://cdn.tiye.me/logo/respo.png", :ssr nil})

Expand All @@ -15,23 +16,18 @@
(merge
base-info
{:styles ["http://localhost:8100/main.css"],
:scripts ["/main.js" "/browser/lib.js" "/browser/main.js"]})))
:scripts ["/browser/lib.js" "/browser/main.js"]})))

(def preview? (= "preview" js/process.env.prod))

(defn prod-page [path]
(let [webpack-info (.parse js/JSON (slurp "dist/webpack-manifest.json"))
cljs-info (.parse js/JSON (slurp "dist/cljs-manifest.json"))
(let [assets (read-string (slurp "dist/assets.edn"))
cdn (if preview? "" "http://cdn.tiye.me/respo-ui/")
prefix-cdn (fn [x] (str cdn x))
page-options (merge
base-info
{:styles ["http://cdn.tiye.me/favored-fonts/main.css"
(prefix-cdn (aget webpack-info "main.css"))],
:scripts (map
prefix-cdn
[(-> cljs-info (aget 0) (aget "js-name"))
(-> cljs-info (aget 1) (aget "js-name"))]),
{:styles ["http://cdn.tiye.me/favored-fonts/main.css"],
:scripts (map #(-> % :output-name prefix-cdn) assets),
:ssr nil})]
(make-page
(make-string
Expand Down
32 changes: 0 additions & 32 deletions webpack.dev.coffee

This file was deleted.

37 changes: 0 additions & 37 deletions webpack.release.coffee

This file was deleted.

Loading

0 comments on commit c4b94b1

Please sign in to comment.