Permalink
Browse files

release 0.0.1

  • Loading branch information...
1 parent b7ba66b commit 0a2388b1b5705fa2f1f36a6a8e3ce188820e5e5e @steida steida committed Feb 16, 2013
Showing with 384 additions and 3 deletions.
  1. +4 −0 .bowerrc
  2. +7 −0 .gitignore
  3. +15 −3 README.md
  4. +12 −0 bower.json
  5. +3 −0 client/.gitignore
  6. +7 −0 client/app/css/app.styl
  7. +39 −0 client/app/js/start.coffee
  8. +10 −0 client/app/js/templates.soy
  9. +206 −0 gruntfile.coffee
  10. +34 −0 package.json
  11. +22 −0 server/index-compiled.html
  12. +25 −0 server/index.html
View
@@ -0,0 +1,4 @@
+{
+ "directory": "bower_components",
+ "json" : "bower.json"
+}
View
@@ -0,0 +1,7 @@
+# http://git-scm.com/docs/gitignore
+
+.DS_Store
+este-boilerplate.sublime-workspace
+
+bower_components/
+node_modules/
View
@@ -1,4 +1,16 @@
-este
-====
+# Este - robust, modular, comfortable
-Este is development stack build on top of the many technologies
+Este is development stack build on top of the many technologies.
+
+## Usage
+ ```javascript
+ git clone https://github.com/Steida/este.git
+ npm install
+ bower install
+ grunt
+ ```
+
+## License
+Copyright (c) 2013 Daniel Steigerwald
+
+Licensed under the MIT license.
View
@@ -0,0 +1,12 @@
+{
+ "name": "este-boilerplate",
+ "version": "0.0.0",
+ "dependencies": {
+ "animate-css": "git://github.com/daneden/animate.css.git",
+ "closure-compiler": "http://closure-compiler.googlecode.com/files/compiler-latest.zip",
+ "closure-templates": "http://closure-templates.googlecode.com/files/closure-templates-for-javascript-latest.zip",
+ "este-library": "git://github.com/Steida/este-library.git",
+ "html5-boilerplate": "~4.1.0",
+ "normalize-css": "git://github.com/necolas/normalize.css.git"
+ }
+}
View
@@ -0,0 +1,3 @@
+.DS_Store
+*.js
+*.css
@@ -0,0 +1,7 @@
+@import '../../../bower_components/este-library/css'
+@import '../../../node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib'
+@import '../../../bower_components/normalize-css/normalize.css'
+
+body
+ font-family Tahoma
+ margin 1em
@@ -0,0 +1,39 @@
+###*
+ @fileoverview App start.
+###
+
+goog.provide 'app.start'
+
+goog.require 'app.templates'
+goog.require 'este.dev.Monitor.create'
+goog.require 'goog.dom'
+goog.require 'goog.events'
+
+###*
+ @param {Object} data JSON from server
+###
+app.start = (data) ->
+
+ # use [] syntax for uncompiled json
+ # e.g. data['someDataFromServer']
+
+ if goog.DEBUG
+ este.dev.Monitor.create()
+
+ html = app.templates.callToAction action: 'click'
+
+ box = goog.dom.createDom 'div',
+ style: 'width: 250px; height: 80px; background-color: #ff8c55; padding: 1em'
+ innerHTML: html
+ document.body.appendChild box
+
+ ###*
+ @desc Text shown in alert after click.
+ ###
+ app.MSG_THANKYOU = goog.getMsg 'Thank you!'
+
+ goog.events.listen box, 'click', ->
+ alert app.MSG_THANKYOU
+
+# ensures the symbol will be visible after compiler renaming
+goog.exportSymbol 'app.start', app.start
@@ -0,0 +1,10 @@
+{namespace app.templates autoescape="contextual"}
+
+/**
+ * @param action
+ */
+{template .callToAction}
+ {msg desc="text in some div calling to action"}
+ {$action} on me
+ {/msg}
+{/template}
View
@@ -0,0 +1,206 @@
+module.exports = (grunt) ->
+
+ ###
+ Start simple static server in another cmd window.
+ grunt connect
+
+ Start development. Compile all and start watching.
+ grunt run:app
+
+ Compiles code with closureBuilder.
+ grunt run:app --stage
+
+ Debug makes compiled code readable.
+ grunt run:app --stage=debug
+
+ Default task runs grunt run:app.
+ grunt
+ grunt --stage
+ grunt --stage=debug
+
+ No color means no friendly beeps too.
+ grunt --no-color
+
+ ###
+
+ appDirs = [
+ 'bower_components/closure-library'
+ 'bower_components/closure-templates'
+ 'bower_components/este-library'
+ 'client/app/js'
+ ]
+
+ appStylusFiles = [
+ 'bower_components/este-library/**/*.styl'
+ 'client/app/css/**/*.styl'
+ ]
+
+ appCoffeeFiles = [
+ 'bower_components/este-library/**/*.coffee'
+ 'client/app/js/**/*.coffee'
+ ]
+
+ appJsFiles = [
+ 'bower_components/este-library/**/*.js'
+ 'client/app/js/**/*.js'
+ ]
+
+ appTemplates = [
+ 'bower_components/este-library/**/*.soy'
+ 'client/app/js/**/*.soy'
+ ]
+
+ appDepsPath =
+ 'client/app/assets/deps.js'
+
+ appCompiledOutputPath =
+ 'client/app/assets/app.js'
+
+ # from closure base.js dir to app root dir
+ appDepsPrefix = '../../../../'
+
+ grunt.initConfig
+ # pkg: grunt.file.readJSON('package.json')
+
+ # same params as grunt-contrib-stylus
+ esteStylus:
+ options:
+ 'include css': true
+ app:
+ files: [
+ expand: true
+ src: appStylusFiles
+ ext: '.css'
+ ]
+
+ # same params as grunt-contrib-coffee
+ esteCoffee:
+ options:
+ bare: true
+ app:
+ files: [
+ expand: true
+ src: appCoffeeFiles
+ ext: '.js'
+ ]
+
+ esteTemplates:
+ options:
+ soyToJsJarPath: 'bower_components/closure-templates/SoyToJsSrcCompiler.jar'
+ app:
+ src: appTemplates
+
+ esteDeps:
+ options:
+ depsWriterPath: 'bower_components/closure-library/closure/bin/build/depswriter.py'
+ app:
+ options:
+ # TODO: consider make it global per projects
+ output_file: appDepsPath
+ prefix: appDepsPrefix
+ root: appDirs
+ este:
+ options:
+ output_file: 'bower_components/este-library/deps.js'
+ prefix: '../../../../'
+ root: [
+ 'bower_components/este-library'
+ 'bower_components/closure-library'
+ 'bower_components/closure-templates'
+ ]
+
+ esteBuilder:
+ options:
+ closureBuilderPath: 'bower_components/closure-library/closure/bin/build/closurebuilder.py'
+ compilerPath: 'bower_components/closure-compiler/compiler.jar'
+ namespace: 'app.start'
+ # needs Java 1.7+
+ fastCompilation: false
+ compilerFlags: if grunt.option('stage') == 'debug' then [
+ '--output_wrapper="(function(){%output%})();"'
+ '--compilation_level="ADVANCED_OPTIMIZATIONS"'
+ '--warning_level="VERBOSE"'
+ '--define=goog.DEBUG=true'
+ '--debug=true'
+ '--formatting="PRETTY_PRINT"'
+ ]
+ else [
+ '--output_wrapper="(function(){%output%})();"'
+ '--compilation_level="ADVANCED_OPTIMIZATIONS"'
+ '--warning_level="VERBOSE"'
+ '--define=goog.DEBUG=false'
+ ]
+ app:
+ options:
+ root: appDirs
+ outputFilePath: appCompiledOutputPath
+ depsPath: appDepsPath
+
+ esteUnitTests:
+ options:
+ basePath: 'bower_components/closure-library/closure/goog/base.js'
+ app:
+ options:
+ depsPath: appDepsPath
+ prefix: appDepsPrefix
+ src: [
+ 'bower_components/este-library/**/*_test.js'
+ 'client/**/*_test.js'
+ ]
+
+ connect:
+ server:
+ options:
+ port: 8000
+ keepalive: true
+
+ esteWatch:
+ app:
+ styl:
+ files: appStylusFiles
+ tasks: 'esteStylus:app'
+
+ js:
+ files: appJsFiles
+ tasks: if grunt.option('stage') then [
+ 'esteDeps:app'
+ 'esteUnitTests:app'
+ 'esteBuilder:app'
+ ]
+ else [
+ 'esteDeps:app'
+ 'esteUnitTests:app'
+ ]
+
+ coffee:
+ files: appCoffeeFiles
+ tasks: 'esteCoffee:app'
+
+ soy:
+ files: appTemplates
+ tasks: 'esteTemplates:app'
+
+ grunt.loadNpmTasks 'grunt-contrib-clean'
+ grunt.loadNpmTasks 'grunt-contrib-coffee'
+ grunt.loadNpmTasks 'grunt-contrib-connect'
+ grunt.loadNpmTasks 'grunt-contrib-jshint'
+ grunt.loadNpmTasks 'grunt-contrib-stylus'
+ grunt.loadNpmTasks 'grunt-contrib-watch'
+ grunt.loadNpmTasks 'grunt-este'
+
+ grunt.registerTask 'run', 'To start development.', (app) ->
+ tasks = [
+ "esteStylus:#{app}"
+ "esteCoffee:#{app}"
+ "esteTemplates:#{app}"
+ "esteDeps:este"
+ "esteDeps:#{app}"
+ "esteUnitTests:#{app}"
+ ]
+ if grunt.option 'stage'
+ tasks.push "esteBuilder:#{app}"
+ tasks.push 'esteWatch'
+
+ grunt.task.run tasks
+
+ grunt.registerTask 'default', 'run:app'
View
@@ -0,0 +1,34 @@
+{
+ "name": "este",
+ "version": "0.0.1",
+ "description": "Este is development stack build on top of the many technologies",
+ "keywords": [
+ "Este",
+ "CoffeeScript",
+ "Google",
+ "Closure",
+ "Compiler",
+ "Stylus",
+ "Mocha",
+ "Soy"
+ ],
+ "author": "Daniel Steigerwald <daniel@steigerwald.cz>",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Steida/este.git"
+ },
+ "dependencies": {
+ "express": "*"
+ },
+ "devDependencies": {
+ "grunt": "git://github.com/gruntjs/grunt.git",
+ "grunt-contrib-stylus": "git://github.com/gruntjs/grunt-contrib-stylus.git",
+ "grunt-contrib-watch": "git://github.com/gruntjs/grunt-contrib-watch.git",
+ "grunt-contrib-coffee": "git://github.com/gruntjs/grunt-contrib-coffee.git",
+ "grunt-contrib-jshint": "git://github.com/gruntjs/grunt-contrib-jshint.git",
+ "grunt-contrib-clean": "git://github.com/gruntjs/grunt-contrib-clean.git",
+ "grunt-contrib-connect": "git://github.com/gruntjs/grunt-contrib-connect.git",
+ "grunt-este": "~0.0.1"
+ },
+ "license": "MIT"
+}
@@ -0,0 +1,22 @@
+<!doctype html>
+<head>
+ <meta charset="utf-8">
+ <title>github.com/Steida/este</title>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <link href="/client/app/css/app.css?build=hcce8ayk" rel="stylesheet">
+ <!--<script src='/assets/js/dev/livereload.js'></script>-->
+ <script src='/client/app/assets/app.js'></script>
+</head>
+<body>
+ <h1>demos</h1>
+ <ul>
+ <li><a href="/bower_components/este-library/demos/index.html">
+ este demos
+ </a></li>
+ <li><a href="http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/index.html"> closure demos
+ </a></li>
+ </ul>
+ <script>
+ app.start({"someDataFromServer": 123})
+ </script>
+</body>
Oops, something went wrong.

0 comments on commit 0a2388b

Please sign in to comment.