Skip to content
Browse files

Managing dependencies with the kiwi package manager. Closes #228

Merge branch 'kiwi'
  • Loading branch information...
2 parents f93af82 + 565f68d commit 6da4a942caf956bd90df100283a716680c889eea @tj tj committed
Showing with 45 additions and 97 deletions.
  1. +0 −12 .gitmodules
  2. +17 −0 History.md
  3. +1 −4 Makefile
  4. +1 −6 Readme.md
  5. +6 −3 examples/chat/app.js
  6. +4 −0 examples/upload/app.js
  7. +3 −7 lib/express.js
  8. +1 −1 lib/express/core.js
  9. +3 −7 lib/express/plugins/view.js
  10. +0 −53 lib/support/ejs/lib/ejs.js
  11. +0 −1 lib/support/ext
  12. +0 −1 lib/support/haml
  13. +0 −1 lib/support/js-oo
  14. +0 −1 lib/support/sass
  15. +9 −0 seed.yml
View
12 .gitmodules
@@ -1,12 +0,0 @@
-[submodule "lib/support/haml"]
- path = lib/support/haml
- url = git://github.com/creationix/haml-js.git
-[submodule "lib/support/js-oo"]
- path = lib/support/js-oo
- url = git://github.com/visionmedia/js-oo.git
-[submodule "lib/support/sass"]
- path = lib/support/sass
- url = git://github.com/visionmedia/sass.js.git
-[submodule "lib/support/ext"]
- path = lib/support/ext
- url = git://github.com/visionmedia/ext.js.git
View
17 History.md
@@ -1,4 +1,21 @@
+0.6.0 / 2010-03-11
+==================
+
+ * Added seed.yml for kiwi package management support
+ * Added HTTP client query string support when method is GET. Closes #205
+
+ * Added support for arbitrary view engines.
+ For example "foo.engine.html" will now require('engine'),
+ the exports from this module are cached after the first require().
+
+ * Added async plugin support
+
+ * Removed usage of RESTful route funcs as http client
+ get() etc, use http.get() and friends
+
+ * Removed custom exceptions
+
0.5.0 / 2010-03-10
==================
View
5 Makefile
@@ -3,9 +3,6 @@ NODE = node
all: test
-init:
- @git submodule init && git submodule update
-
test:
@$(NODE) spec/node.js all
@@ -17,4 +14,4 @@ app-chat:
app-upload:
@$(NODE) examples/upload/app.js
-.PHONY: init test app
+.PHONY: test app
View
7 Readme.md
@@ -70,13 +70,9 @@ Below is a minimal app example when express is already within your load path.
## Running Tests
-First we need to ensure all submodules are updated:
-
- $ make init
-
Express uses the [JSpec](http://jspec.info) BDD JavaScript testing
framework to write and run elegant spec suites. JSpec is frozen
-to spec/lib and does not require separate installation.
+to spec/lib and **does not** require separate installation.
$ make test
@@ -94,7 +90,6 @@ Express is currently being developed with node --version:
* [JavaScript Extensions & Utilities](http://github.com/visionmedia/ext.js)
* [JavaScript Sass](http://github.com/visionmedia/sass.js)
- * [Scons Build System](http://www.scons.org/) (some development dependencies rely on this, ex libxmljs)
* Featured in [Advanced JavaScript e-book](http://www.dev-mag.com/2010/02/18/advanced-javascript/) for only $4
## Contributors
View
9 examples/chat/app.js
@@ -3,9 +3,15 @@ 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)
@@ -15,9 +21,6 @@ configure(function(){
set('root', __dirname)
})
-var messages = [],
- utils = require('express/utils')
-
get('/', function(){
this.redirect('/chat')
})
View
4 examples/upload/app.js
@@ -3,7 +3,11 @@ 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)
View
10 lib/express.js
@@ -1,9 +1,5 @@
-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')
View
2 lib/express/core.js
@@ -302,7 +302,7 @@ Server = Class({
// --- Express
Express = {
- version: '0.5.0',
+ version: '0.6.0',
config: [],
routes: [],
plugins: [],
View
10 lib/express/plugins/view.js
@@ -10,14 +10,10 @@ var utils = require('express/utils'),
fs = require('fs')
/**
- * Supported template engines.
+ * Cache supported template engine exports.
*/
-var engine = {
- ejs: require('ejs'),
- haml: require('haml'),
- sass: require('sass')
-}
+var engines = {}
// --- View
@@ -73,7 +69,7 @@ exports.View = Plugin.extend({
options.context = options.context || this
self.contentType(ext)
function render(content) {
- content = engine[type].render(content, options)
+ content = (engines[type] = engines[type] || require(type)).render(content, options)
if (layout)
self.render(layout + '.' + type + ext, utils.mixin(true, options, {
layout: false,
View
53 lib/support/ejs/lib/ejs.js
@@ -1,53 +0,0 @@
-/* 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;
1 lib/support/ext
@@ -1 +0,0 @@
-Subproject commit 57febd6774968d2bdb8fe7e3d299a1b1cf05f943
1 lib/support/haml
@@ -1 +0,0 @@
-Subproject commit 908480ed5d98fb8d246d7a464c1ed65e40cabcfd
1 lib/support/js-oo
@@ -1 +0,0 @@
-Subproject commit 1f94bd897994a952114cb1f280c1949d5e6a0648
1 lib/support/sass
@@ -1 +0,0 @@
-Subproject commit 0dd500e7cd3be0ccc58d6f6ff98f16ff5246b09d
View
9 seed.yml
@@ -0,0 +1,9 @@
+---
+ name: Express
+ description: Sinatra inspired web development framework
+ version: 0.6.0
+ dependencies:
+ - ext >= 0.2.2
+ - oo >= 1.2.0
+ - sass >= 0.3.0
+ - haml >= 0.1.2

0 comments on commit 6da4a94

Please sign in to comment.
Something went wrong with that request. Please try again.