Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rc of v1.2

  • Loading branch information...
commit cd5bf56398af27a1d9d3c1b9e4cfabbbacf142de 1 parent 4936475
Tom Wilson authored
40 Cakefile
View
@@ -1,40 +0,0 @@
-fs = require 'fs'
-{print} = require 'sys'
-{spawn, exec} = require 'child_process'
-
-build = (watch, callback) ->
- if typeof watch is 'function'
- callback = watch
- watch = false
- options = ['-c', '-o', 'lib', 'src']
- options.unshift '-w' if watch
-
- coffee = spawn 'coffee', options
- coffee.stdout.on 'data', (data) -> print data.toString()
- coffee.stderr.on 'data', (data) -> print data.toString()
- coffee.on 'exit', (status) -> callback?() if status is 0
-
-spec = (callback) ->
- options = ['spec', '--coffee']
- spec = spawn 'jasmine-node', options
- spec.stdout.on 'data', (data) -> print data.toString()
- spec.stderr.on 'data', (data) -> print data.toString()
- spec.on 'exit', (status) -> callback?() if status is 0
-
-
-task 'docs', 'Generate annotated source code with Docco', ->
- fs.readdir 'src', (err, contents) ->
- files = ("src/#{file}" for file in contents when /\.coffee$/.test file)
- docco = spawn 'docco', files
- docco.stdout.on 'data', (data) -> print data.toString()
- docco.stderr.on 'data', (data) -> print data.toString()
- docco.on 'exit', (status) -> callback?() if status is 0
-
-task 'build', 'Compile CoffeeScript source files', ->
- build()
-
-task 'watch', 'Recompile CoffeeScript source files when modified', ->
- build true
-
-task 'spec', 'Run Jasmine-Node', ->
- build -> spec -> console.log ":)"
10 app.coffee
View
@@ -0,0 +1,10 @@
+express = require 'express'
+assets = require 'connect-assets'
+
+app = express.createServer()
+app.use assets()
+app.set 'view engine', 'jade'
+
+app.get '/', (req, resp) -> resp.render 'index'
+
+app.listen 3000
16 assets/css/app.css
View
@@ -0,0 +1,16 @@
+h2.animate {
+ -moz-animation-duration: 3s;
+ -moz-animation-name: slidein;
+ }
+
+ @-moz-keyframes slidein {
+ from {
+ margin-left: 100%;
+ width: 300%
+ }
+
+ to {
+ margin-left: 0%;
+ width: 100%;
+ }
+ }
3  assets/js/app.coffee
View
@@ -0,0 +1,3 @@
+$ ->
+ x = -> $('<h2 style="background: black;color:white;margin:10px;width:100%;text-align:center;">Express Coffee Template 1.2</h2>').prependTo('.right')
+ setTimeout x, 2000
12 lib/app.js
View
@@ -1,12 +0,0 @@
-(function() {
- var app, express;
- express = require('express');
- app = express.createServer();
- app.register('.coffee', require('coffeekup'));
- app.set('view engine', 'coffee');
- app.use(express.static(__dirname + '/public'));
- app.get('/', function(request, response) {
- return response.render('index');
- });
- app.listen(process.env.PORT || 8000);
-}).call(this);
19 package.json
View
@@ -1,19 +1,16 @@
{
"name": "express-coffee"
- , "version": "v0.1.0"
+ , "version": "v1.2.0"
, "private": true
- ,"directories" : {
- "lib" : "./lib",
- "spec": "./spec"
- }
, "dependencies": {
- "express": "2.4.x"
- , "coffeekup": "0.3.x"
+ "coffee-script": "1.1.x"
+ , "express": "2.5.x"
+ , "jade": "0.x.x"
+ , "connect-assets": "2.1.x"
+ , "stylus": "*"
+ , "markdown": "*"
}
, "devDependencies": {
- "coffee-script": "1.1.x"
- ,"jasmine-node": "1.x.x"
- ,"request": "1.x.x"
}
- , "engine": "node >= 0.4.11"
+ , "engine": "node ~> 0.6.x"
}
39 readme.md
View
@@ -1,21 +1,26 @@
-# Express Coffee
+# Express Coffee Template 2
-This is a template node web app
+This is a Node Express CoffeeScript Stack Template
+
+It comes ready to go with connect-assets that give you the option
+to use coffee-script and stylus for the client side.
## Technologies
This is a template that can be used to create nodejs applications using
-* Node v0.4.11
+* Node v0.6.1
* Express v2.4.6
-* CoffeeScript! v1.1.2
-* Coffeekup v0.3.0
+* CoffeeScript! v1.1.3
+* Jade v0.17.0
+* Connect Assets v2.1.5
## Requirements
* [NodeJs](http://nodejs.org)
* [Express](http://expressjs.com)
* [CoffeeScript](http://coffeescript.org)
-* [Coffeekup](http://coffeekup.org/)
+* [Jade](http://jade-lang.org/)
+* [connect-assets](http://github.com/TrevorBurnham/connect-assets)
* [Jasmine-Node](https://github.com/mhevery/jasmine-node/)
These will install with npm, just do
@@ -37,29 +42,16 @@ git clone http://github.com/twilson63/express-coffee.git [project-name]
cd [project-name]
npm install
-# Build
-
-cake build
# Run
node server.js
-# Test
-
-cake spec
-
-# Watch - Compile when files change.
-
-cake watch
-
-```
## Thanks to
* [Jeremy Ashkenas](https://github.com/jashkenas) for creating coffee-script
* [TJ Holowaychuk](https://github.com/visionmedia) for creating express
-* [Maurice Machado](https://github.com/mauricemach) for creating coffeekup
* [Miško Hevery](https://github.com/mhevery) for creating Jasmine-Node
* [Pivotal Labs](http://github.com/pivotal/jasmine) for creating Jasmine
@@ -75,16 +67,9 @@ coffeekup views in the views folder and put your public assets in the public
folder. Enjoy your express-coffee
~
-c[_] 0.1.0
+c[_] 1.2.0
-Coffeekup Layout View borrowed from CoffeeKup Examples
## License
See LICENSE
-
-## Ready to Deploy on Heroku
-
-[heroku](http://devcenter.heroku.com/articles/node-js)
-
-
3  server.js
View
@@ -1 +1,2 @@
-require('./lib/app')
+require('coffee-script');
+require('./app');
11 spec/app_spec.coffee
View
@@ -1,11 +0,0 @@
-require '../lib/app'
-request = require('request')
-
-root_uri = 'http://localhost:8000'
-
-describe 'APP Routes', ->
- it 'GET /', ->
- request uri: "#{root_uri}/", (req, resp) ->
- expect(resp.statusCode).toEqual(200)
- asyncSpecDone()
- asyncSpecWait()
16 src/app.coffee
View
@@ -1,16 +0,0 @@
-express = require('express')
-app = express.createServer()
-
-# Setup Template Engine
-app.register '.coffee', require('coffeekup')
-app.set 'view engine', 'coffee'
-
-# Setup Static Files
-app.use express.static(__dirname + '/public')
-
-# App Routes
-app.get '/', (request, response) ->
- response.render 'index'
-
-# Listen
-app.listen process.env.PORT || 8000
1  views/index.coffee
View
@@ -1 +0,0 @@
-h1 'CoffeeScript Rocks!!'
46 views/index.jade
View
@@ -0,0 +1,46 @@
+.container
+ .four.columns
+ h1 Express CoffeeScript Template
+ div.
+ <a href="http://www.flickr.com/photos/astrapica/2560897976/" title="Uk express... by astrapi, on Flickr"><img src="http://farm4.staticflickr.com/3049/2560897976_48257593b7.jpg" width="100%" height="100%" alt="Uk express..."></a>
+ :markdown
+ ### About
+
+ This template was built to make it very easy to get up and going on small little prototypes and weekend projects.
+
+ ### Contact Us
+
+ Have questions, or would like to contribute?
+
+ * [Post an Issue](https://github.com/twilson63/express-coffee/issues)
+ * [Submit a pull request](https://github.com/twilson63/express-coffee)
+ * Follow Us on twitter! [@jackhq](http://twitter.com/jackhq)
+ .right.ten.columns.offset-by-two
+ :markdown
+ The express-coffee template is now upgraded to use node version 0.6.1 and refined to utilized a few new features to get up and running.
+
+ # Features
+
+ ### No more Compile step
+
+ express-coffee template is made to quickly start putting together an application/prototype. So we have changed the template back to automatically compile the coffee-script when you run your node app.
+
+ ### Rails-like Asset Pipeline
+
+ express-coffee template comes ready to go with connect-assets a rails like asset pipeline. You can add your css and js to the assets folder. Then in jade you can reference your assets using a couple of helper methods.
+
+ != css('mycss')
+ #= Pull from /assets/css/mycss.styl
+
+ != js('app')
+ #= Pull from /assets/js/app.coffee or app.js
+
+ See [connect-assets](http://github.com/TrevorBurnham/connect-assets) for more information
+
+ ### Jade as the default template language
+
+ express-coffee template as switched to jade as the default template language. It seems to be the clear winner and the most mature at this point. The rich featureset of integrating markdown and coffeescript and other helpers is big plus for getting things up fast.
+
+ ### Skeleton CSS as the default responsive grid
+
+ skeleton is clean and basic and can easily be adjusted.
40 views/layout.coffee
View
@@ -1,40 +0,0 @@
-doctype 5
-html ->
- head ->
- title 'Express Coffee with CoffeeKup'
- meta charset: 'utf-8'
-
- title "#{@title} | My Site" if @title?
- meta(name: 'description', content: @description) if @description?
- link(rel: 'canonical', href: @canonical) if @canonical?
-
- link rel: 'icon', href: '/favicon.png'
- link rel: 'stylesheet', href: '/app.css'
-
- script src: 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'
- script src: '/app.js'
-
- coffeescript ->
- $(document).ready ->
- alert 'hi!'
-
- style '''
- header, nav, section, article, aside, footer {display: block}
- nav li {display: inline; margin:10px}
- nav.sub {float: right}
- #content {margin-left: 120px}
- '''
- body ->
- header ->
- a href: '/', title: 'Home', -> 'Home'
-
- nav ->
- ul ->
- for item in ['About', 'Pricing', 'Contact']
- li -> a href: "/#{item.toLowerCase()}", title: item, -> item
-
- div id: 'content', ->
- @body
-
- footer ->
- p -> a href: '/privacy', -> 'Privacy Policy'
24 views/layout.jade
View
@@ -0,0 +1,24 @@
+!!! 5
+//if lt IE 7 ]><html class="ie ie6" lang="en">
+//if IE 7 ]><html class="ie ie7" lang="en">
+//if IE 8 ]><html class="ie ie8" lang="en">
+// [if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]
+head
+ meta(charset='utf-8')
+ title Express CoffeeScript Template
+ meta(name='description', content='')
+ meta(name='author', content='')
+ // Mobile Specific
+ meta(name="viewport", content="width=device-width, initial-scale=1.0")
+
+ // CSS
+ != css("http://wilbur.io.s3.amazonaws.com/all.css")
+ != css('app.css')
+
+body
+ != body
+
+ != js('http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7/jquery.min.js')
+ != js('app')
+
+| </html>
Please sign in to comment.
Something went wrong with that request. Please try again.