Skip to content
Myr

Merge branch 'bin'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parents 704e9c1, da8d036 · Browse files · 3 files+73 added−23 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+73 added−23 removed

  • other:+73 added−23 removed

3 files+73 added−23 removed

modified:bin/express+72 added-22 removed
31 unmodified lines
3233var cssEngine;3435/**36 * Template engine to utilize.37 */3839var templateEngine = 'jade';4041/**42 * Usage documentation.43 */4445var usage = ''46 + '\x1b[1mUsage\x1b[0m: express [options] [PATH]\n'47 + '\n'48 + '\x1b[1mOptions\x1b[0m:\n'43 + ' -s, --sessions Add session support\n'44 + ' -c, --css ENGINE Add stylesheet ENGINE support (less|sass). Defaults to plain css\n'45 + ' -v, --version Output framework version\n'46 + ' -h, --help Output help information\n'49 + ' -s, --sessions Add session support\n'50 + ' -t, --template ENGINE Add template ENGINE support (jade|ejs). Defaults to jade\n'51 + ' -c, --css ENGINE Add stylesheet ENGINE support (less|sass). Defaults to plain css\n'52 + ' -v, --version Output framework version\n'53 + ' -h, --help Output help information\n'54 ;5556/**57 * Jade layout template.
1 unmodified line
5960var jadeLayout = [61 '!!!'62 , 'html'56 , ' head'57 , ' title= title'58 , ' link(rel=\'stylesheet\', href=\'/stylesheets/style.css\')'59 , ' body!= body'63 , ' head'64 , ' title= title'65 , ' link(rel=\'stylesheet\', href=\'/stylesheets/style.css\')'66 , ' body!= body'67].join('\n');6869/**70 * Jade index template.71 */7273var jadeIndex = [74 'h1= title'75 , 'p Welcome to #{title}'76].join('\n');7778/**79 * EJS layout template.80 */8182var ejsLayout = [83 '<!DOCTYPE html>'84 , '<html>'85 , ' <head>'86 , ' <title><%= title %></title>'87 , ' <link rel=\'stylesheet\' href=\'/stylesheets/style.css\' />'88 , ' </head>'89 , ' <body>'90 , ' <%- body %>'91 , ' </body>'92 , '</html>'93].join('\n');9495/**96 * EJS index template.97 */9899var ejsIndex = [100 '<h1><%= title %></h1>'101 , '<p>Welcome to <%= title %></p>'102 ].join('\n');103104/**105 * Default css template.106 */107108var css = [
24 unmodified lines
133 , ' :font 14px "Lucida Grande", Helvetica, Arial, sans-serif'134].join('\n');135136/**95 * Jade index template.96 */9798var jadeIndex = [99 'h1= title'100 , 'p Welcome to #{title}'101].join('\n');102103/**137 * App test template.138 */139140var appTest = [
35 unmodified lines
176 , '// Configuration'177 , ''178 , 'app.configure(function(){'179 , ' app.set(\'views\', __dirname + \'/views\');'147 , ' app.set(\'view engine\', \'jade\');'180 , ' app.set(\'view engine\', \':TEMPLATE\');'181 , ' app.use(express.bodyDecoder());'182 , ' app.use(express.methodOverride());:SESS:CSS'183 , ' app.use(app.router);'184 , ' app.use(express.staticProvider(__dirname + \'/public\'));'
52 unmodified lines
237 args.length238 ? (cssEngine = args.shift())239 : abort('--css requires an argument');240 break;241 case '-t':242 case '--template':243 args.length244 ? (templateEngine = args.shift())245 : abort('--template requires an argument');246 break;247 default:248 path = arg;249 }250}
41 unmodified lines
292 write(path + '/public/stylesheets/style.css', css);293 }294 });295 mkdir(path + '/views/partials', function(){296 switch (templateEngine) {297 case 'ejs':298 write(path + '/views/layout.ejs', ejsLayout);299 write(path + '/views/index.ejs', ejsIndex);300 break;301 case 'jade':257 write(path + '/views/layout.jade', jadeLayout);258 write(path + '/views/index.jade', jadeIndex);302 write(path + '/views/layout.jade', jadeLayout);303 write(path + '/views/index.jade', jadeIndex);304 break;305 }306 });307 mkdir(path + '/test', function(){308 write(path + '/test/app.test.js', appTest);309 });
12 unmodified lines
322 app = app.replace(':SESS', sessions323 ? '\n app.use(express.cookieDecoder());\n app.use(express.session());'324 : '');325326 // Template support327 app = app.replace(':TEMPLATE', templateEngine);328329 write(path + '/app.js', app);330331 // Suggestions332 process.on('exit', function(){
2 unmodified lines
335 , cssEngine336 , cssEngine);337 }338 console.log(' - make sure you have installed %s: \x1b[33m$ npm install %s\x1b[0m'289 , 'jade'290 , 'jade');339 , templateEngine340 , templateEngine);341 });342 });343}344
81 unmodified lines
modified:support/connectnot shown

Its text is not shown, modified.

modified:package.json+1 added-1 removed