Managing dependencies with the kiwi package manager. Closes #228
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Merge branch 'kiwi'
authored by visionmedia · committed by visionmedia · parents f93af82, 565f68d · Browse files · 15 files·+45 added−93 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
15 files+45 added−93 removed
- other:+45 added−93 removed
Provenance
- Commit
6da4a94- Tree
f7419d4- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent 1
f93af82- Parent 2
565f68d
15 files changed+45 added−93 removed
modified:examples/chat/app.js+6 added-3 removed
12345678910111213141516171819202122231819202425262757 unmodified lines
require.paths.unshift('lib')require('express')require('express/plugins')
var messages = [], utils = require('express/utils'), kiwi = require('kiwi')
configure(function(){ var fiveMinutes = 300000, oneMinute = 60000 kiwi.seed('haml') kiwi.seed('sass') use(MethodOverride) use(ContentLength) use(CommonLogger) use(Cookie) use(Cache, { lifetime: fiveMinutes, reapInterval: oneMinute }) use(Session, { lifetime: fiveMinutes, reapInterval: oneMinute }) set('root', __dirname)})
var messages = [], utils = require('express/utils') get('/', function(){ this.redirect('/chat')})
57 unmodified linesmodified:examples/upload/app.js+4 added
123456789101112131434 unmodified lines
require.paths.unshift('lib')require('express')require('express/plugins')
var kiwi = require('kiwi')
configure(function(){ kiwi.seed('haml') kiwi.seed('sass') use(MethodOverride) use(ContentLength) use(CommonLogger) use(Cookie)34 unmodified linesmodified:lib/express/plugins/view.js+3 added-7 removed
8 unmodified lines9 extname = require('path').extname,10 fs = require('fs')11 12 /**13- * Supported template engines.13+ * Cache supported template engine exports.14 */15 16-var engine = {17- ejs: require('ejs'),18- haml: require('haml'),19- sass: require('sass')20-}16+var engines = {}17 18 // --- View19 20 exports.View = Plugin.extend({47 unmodified lines68 layout = options.layout === undefined ? 'layout' : options.layout69 options.context = options.context || this70 self.contentType(ext)71 function render(content) {76- content = engine[type].render(content, options)72+ content = (engines[type] = engines[type] || require(type)).render(content, options)73 if (layout)74 self.render(layout + '.' + type + ext, utils.mixin(true, options, {75 layout: false,76 locals: {21 unmodified linesmodified:lib/express/core.js+1 added-1 removed
300 unmodified lines301 302 // --- Express303 304 Express = { 305- version: '0.5.0',305+ version: '0.6.0',306 config: [],307 routes: [],308 plugins: [],309 settings: {},25 unmodified linesdeleted:lib/support/ejs/lib/ejs.js-53 removed
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253/* Ejs template parser for CommonJS * * Copyright (c) 2009, Howard Rauscher * Licensed under the MIT License * * base on: * Simple JavaScript Templating (http://ejohn.org/blog/javascript-micro-templating/) * John Resig - http://ejohn.org/ - MIT Licensed */ (function(){ var cache = {}; var ejs = this.ejs = {}; ejs.parse = function tmpl(str, options) { options = options || {}; options.context = options.context || {}; options.locals = options.locals || {}; // Figure out if we're getting a template, or if we need to // load the template - and be sure to cache the result. var fn = cache[str] || // Generate a reusable function that will serve as a template // generator (and which will be cached). new Function("obj", "var p=[];" + // Introduce the data as local variables using with(){} "with(obj){p.push('" + // Convert the template into pure JavaScript str .replace(/\-%>(\n|\r)/g, "%>") .replace(/[\t\b\f]/g, " ") .replace(/[\n\r]/g, "\f") .split("<%").join("\t") .replace(/((^|%>)[^\t]*)'/g, "$1\r") .replace(/\t=(.*?)%>/g, "',$1,'") .split("\t").join("');") .split("%>").join("p.push('") .split("\r").join("\\'").replace(/\f+/g, '\\n') + "');}return p.join('');"); cache[str] = fn; // Provide some basic currying to the user return fn.call(options.context, options.locals); };})(); exports.render = ejs.parse;No newline at end of filedeleted:lib/support/extnot shown
Its text is not shown, deleted.
deleted:lib/support/hamlnot shown
Its text is not shown, deleted.
deleted:lib/support/js-oonot shown
Its text is not shown, deleted.
deleted:lib/support/sassnot shown
Its text is not shown, deleted.
modified:lib/express.js+3 added-7 removed
123456782345
require.paths.unshift(__dirname + '/support/js-oo/lib')require.paths.unshift(__dirname + '/support/ejs/lib')require.paths.unshift(__dirname + '/support/haml/lib')require.paths.unshift(__dirname + '/support/sass/lib')require.paths.unshift(__dirname + '/support/ext/lib')require('oo')require('ext')var kiwi = require('kiwi')kiwi.require('oo', '>= 1.2.0')kiwi.require('ext', '>= 0.2.2')require('express/core')No newline at end of fileNo newline at end of filedeleted:.gitmodules-12 removed
1-[submodule "lib/support/haml"]2- path = lib/support/haml3- url = git://github.com/creationix/haml-js.git4-[submodule "lib/support/js-oo"]5- path = lib/support/js-oo6- url = git://github.com/visionmedia/js-oo.git7-[submodule "lib/support/sass"]8- path = lib/support/sass9- url = git://github.com/visionmedia/sass.js.git10-[submodule "lib/support/ext"]11- path = lib/support/ext12- url = git://github.com/visionmedia/ext.js.gitmodified:History.md+17 added
1 2+0.6.0 / 2010-03-113+==================4+5+ * Added seed.yml for kiwi package management support6+ * Added HTTP client query string support when method is GET. Closes #2057+ 8+ * Added support for arbitrary view engines.9+ For example "foo.engine.html" will now require('engine'),10+ the exports from this module are cached after the first require().11+ 12+ * Added async plugin support13+ 14+ * Removed usage of RESTful route funcs as http client15+ get() etc, use http.get() and friends16+ 17+ * Removed custom exceptions18+19 0.5.0 / 2010-03-1020 ==================21 22 * Added ext dependency (library of js extensions)90 unmodified linesmodified:Makefile+1 added-4 removed
1 unmodified line2 NODE = node3 4 all: test5 6-init:7- @git submodule init && git submodule update8-6 test:7 @$(NODE) spec/node.js all8 9 app: app-chat3 unmodified lines13 14 app-upload:15 @$(NODE) examples/upload/app.js16 20-.PHONY: init test app17+.PHONY: test appmodified:Readme.md+1 added-6 removed
68 unmodified lines69 run()70 71 ## Running Tests72 73-First we need to ensure all submodules are updated:74- 75- $ make init76-73 Express uses the [JSpec](http://jspec.info) BDD JavaScript testing74 framework to write and run elegant spec suites. JSpec is frozen 79-to spec/lib and does not require separate installation.75+to spec/lib and **does not** require separate installation.76 77 $ make test78 79 Run individual suites:9 unmodified lines89 ## More Information90 91 * [JavaScript Extensions & Utilities](http://github.com/visionmedia/ext.js)92 * [JavaScript Sass](http://github.com/visionmedia/sass.js)97- * [Scons Build System](http://www.scons.org/) (some development dependencies rely on this, ex libxmljs)93 * Featured in [Advanced JavaScript e-book](http://www.dev-mag.com/2010/02/18/advanced-javascript/) for only $494 95 ## Contributors96 29 unmodified linesadded:seed.yml+9 added
1+---2+ name: Express3+ description: Sinatra inspired web development framework4+ version: 0.6.05+ dependencies:6+ - ext >= 0.2.27+ - oo >= 1.2.08+ - sass >= 0.3.09+ - haml >= 0.1.2