From 03bcc505dca1afe3c4b2bc52c257d4b2c1cbddf8 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Tue, 17 Mar 2015 15:57:45 +0700 Subject: [PATCH] Package structure and building --- .gitignore | 8 +++-- Makefile | 14 +++++++++ app/scripts/hello.js => README.md | 0 app/{styles => css}/app.css | 0 app/{styles => css}/charts.css | 0 app/{styles => css}/logo.css | 0 app/{styles => css}/menu.css | 0 app/hello.html | 12 -------- app/{app.html => index.html} | 28 +++++++++--------- app/{scripts => js}/colors.js | 0 app/{scripts => js}/date.js | 0 app/{scripts => js}/svground.js | 0 app/{scripts/src => jsx}/app.jsx | 0 app/{scripts/src => jsx}/charts/animation.jsx | 0 app/{scripts/src => jsx}/charts/bar_chart.jsx | 0 app/{scripts/src => jsx}/charts/charts.jsx | 0 app/{scripts/src => jsx}/charts/data.jsx | 0 app/{scripts/src => jsx}/charts/selector.jsx | 0 .../src => jsx}/charts/stacked_area_chart.jsx | 0 app/styles/hello.css | 29 ------------------- build/index.html | 16 ++++++++++ package.json | 8 +++++ 22 files changed, 57 insertions(+), 58 deletions(-) rename app/scripts/hello.js => README.md (100%) rename app/{styles => css}/app.css (100%) rename app/{styles => css}/charts.css (100%) rename app/{styles => css}/logo.css (100%) rename app/{styles => css}/menu.css (100%) delete mode 100644 app/hello.html rename app/{app.html => index.html} (56%) rename app/{scripts => js}/colors.js (100%) rename app/{scripts => js}/date.js (100%) rename app/{scripts => js}/svground.js (100%) rename app/{scripts/src => jsx}/app.jsx (100%) rename app/{scripts/src => jsx}/charts/animation.jsx (100%) rename app/{scripts/src => jsx}/charts/bar_chart.jsx (100%) rename app/{scripts/src => jsx}/charts/charts.jsx (100%) rename app/{scripts/src => jsx}/charts/data.jsx (100%) rename app/{scripts/src => jsx}/charts/selector.jsx (100%) rename app/{scripts/src => jsx}/charts/stacked_area_chart.jsx (100%) delete mode 100644 app/styles/hello.css create mode 100644 build/index.html create mode 100644 package.json diff --git a/.gitignore b/.gitignore index d16350a..3d8b524 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ // JSX cache .module-cache -// Bower +// Packages +node_modules bower_components // Config files @@ -11,5 +12,6 @@ bower_components // Workspace documents and notes *.txt -// Compiled app (reconsider later) -app/scripts/compiled +// Compiled +app/jsx/build +build/* diff --git a/Makefile b/Makefile index 7007511..0aae423 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,16 @@ +UGLIFY = ./node_modules/uglify-js/bin/uglifyjs +CLEANCSS = ./node_modules/clean-css/bin/cleancss + cloc: cloc . --exclude-dir=app/bower_components,app/scripts/.module-cache + +static: + $(UGLIFY) \ + app/bower_components/react/react.js \ + app/bower_components/react-router/build/global/ReactRouter.js \ + app/bower_components/lodash/lodash.js \ + app/bower_components/jquery/dist/jquery.js \ + app/js/* \ + app/jsx/build/*/* \ + > build/app.js + cat app/css/* | $(CLEANCSS) -o build/app.css diff --git a/app/scripts/hello.js b/README.md similarity index 100% rename from app/scripts/hello.js rename to README.md diff --git a/app/styles/app.css b/app/css/app.css similarity index 100% rename from app/styles/app.css rename to app/css/app.css diff --git a/app/styles/charts.css b/app/css/charts.css similarity index 100% rename from app/styles/charts.css rename to app/css/charts.css diff --git a/app/styles/logo.css b/app/css/logo.css similarity index 100% rename from app/styles/logo.css rename to app/css/logo.css diff --git a/app/styles/menu.css b/app/css/menu.css similarity index 100% rename from app/styles/menu.css rename to app/css/menu.css diff --git a/app/hello.html b/app/hello.html deleted file mode 100644 index 8807550..0000000 --- a/app/hello.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Hello - - - -

Hello!

-Sign In - - - diff --git a/app/app.html b/app/index.html similarity index 56% rename from app/app.html rename to app/index.html index 36338db..afd18f4 100644 --- a/app/app.html +++ b/app/index.html @@ -9,10 +9,10 @@ - - - - + + + + @@ -20,14 +20,14 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/app/scripts/colors.js b/app/js/colors.js similarity index 100% rename from app/scripts/colors.js rename to app/js/colors.js diff --git a/app/scripts/date.js b/app/js/date.js similarity index 100% rename from app/scripts/date.js rename to app/js/date.js diff --git a/app/scripts/svground.js b/app/js/svground.js similarity index 100% rename from app/scripts/svground.js rename to app/js/svground.js diff --git a/app/scripts/src/app.jsx b/app/jsx/app.jsx similarity index 100% rename from app/scripts/src/app.jsx rename to app/jsx/app.jsx diff --git a/app/scripts/src/charts/animation.jsx b/app/jsx/charts/animation.jsx similarity index 100% rename from app/scripts/src/charts/animation.jsx rename to app/jsx/charts/animation.jsx diff --git a/app/scripts/src/charts/bar_chart.jsx b/app/jsx/charts/bar_chart.jsx similarity index 100% rename from app/scripts/src/charts/bar_chart.jsx rename to app/jsx/charts/bar_chart.jsx diff --git a/app/scripts/src/charts/charts.jsx b/app/jsx/charts/charts.jsx similarity index 100% rename from app/scripts/src/charts/charts.jsx rename to app/jsx/charts/charts.jsx diff --git a/app/scripts/src/charts/data.jsx b/app/jsx/charts/data.jsx similarity index 100% rename from app/scripts/src/charts/data.jsx rename to app/jsx/charts/data.jsx diff --git a/app/scripts/src/charts/selector.jsx b/app/jsx/charts/selector.jsx similarity index 100% rename from app/scripts/src/charts/selector.jsx rename to app/jsx/charts/selector.jsx diff --git a/app/scripts/src/charts/stacked_area_chart.jsx b/app/jsx/charts/stacked_area_chart.jsx similarity index 100% rename from app/scripts/src/charts/stacked_area_chart.jsx rename to app/jsx/charts/stacked_area_chart.jsx diff --git a/app/styles/hello.css b/app/styles/hello.css deleted file mode 100644 index ed6fde6..0000000 --- a/app/styles/hello.css +++ /dev/null @@ -1,29 +0,0 @@ -* { - box-sizing: border-box; - font-family: 'Helvetica Neue', Helvetica, sans-serif; - font-weight: 400; -} -html, body { - margin: 0; - padding: 0; -} - -h1 { - position: absolute; - left: 15%; - top: 20%; - width: 70%; - text-align: center; - color: #aaa; -} - -a { - position: absolute; - top: 40%; - width: 100%; - text-align: center; -} - -img { - width: 60px; -} diff --git a/build/index.html b/build/index.html new file mode 100644 index 0000000..730266b --- /dev/null +++ b/build/index.html @@ -0,0 +1,16 @@ + + + + + Empact + + + + + + + + + + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..bd494a2 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "name": "empact", + "private": true, + "dependencies": { + "uglify-js": "2.4.17", + "clean-css": "3.1.7" + } +}