Permalink
Browse files

uki tools binary, package to support tools, common uki build, better …

…static_require
  • Loading branch information...
1 parent eaf26cf commit 5694139daa1760ec567b695d503c90f1f4228a99 @voloko committed Feb 12, 2011
Showing with 14 additions and 7 deletions.
  1. +1 −0 CHANGELOG
  2. +1 −1 examples/core-examples/attachment/attachment.js
  3. +3 −2 package.json
  4. +1 −1 src/uki-core.js
  5. +2 −0 src/uki.js
  6. +3 −0 tools/bin/uki
  7. +3 −3 tools/static_require.js
View
@@ -1,4 +1,5 @@
v0.4a
+- Nodejs tool chain
- Remove IE6 support
- Replace 2 phase layout with default css based layout
- Support css inlining
@@ -3,7 +3,7 @@
@example_order 1
@example_html
<div id='test' style='width: 50%; height: 100px; background: #EEE; position:relative'>#test</div>
- <script src="/src/uki-view.js"></script>
+ <script src="/src/uki.js"></script>
<script src="attachment.js"></script>
*/
View
@@ -15,9 +15,10 @@
"directories": {
"lib": "./src",
"spec": "./spec",
- "example": "./examples"
+ "example": "./examples",
+ "bin": "./tools/bin"
},
- "main": "./index.js",
+ "main": "./src/uki.js",
"engines": {
"node": ">=0.2.0"
},
View
@@ -31,4 +31,4 @@ uki.Attachement = require('./uki-core/attachment').Attachement;
uki.Mustache = require('uki-core/mustache').Mustache;
-module.exports = global.uki = uki;
+module.exports = uki;
View
@@ -0,0 +1,2 @@
+module.exports = global.uki = require('uki-core');
+require('uki-view');
View
@@ -0,0 +1,3 @@
+#! /usr/bin/env node
+
+require('../tools.js');
@@ -99,14 +99,14 @@ function static_require (filePath, options) {
state.searchPaths = state.options.searchPaths || [path.dirname(state.currentPath)];
state.moduleAsts = [];
- file_to_ast(filePath);
+ file_to_ast(filePath, true);
var code = 'var global = this;';
code += 'function require(index) { if (!require.cache[index]) {var module = {exports: {}}; require.cache[index] = require.modules[index].call(module.exports, global, module);} return require.cache[index]; }\n';
code += 'require.modules = []; require.cache = [];';
var body = jsp.parse(code)[1];
- for (var i=1; i < state.includedCount; i++) {
+ for (var i=0; i < state.includedCount; i++) {
body[body.length] =
[ 'stat',
['assign',
@@ -119,7 +119,7 @@ function static_require (filePath, options) {
]
];
};
- body = body.concat(state.moduleAsts[0][1]);
+ body.push(['stat', ['call', ['name', 'require'], [['num', '0']]]]);
return [ 'toplevel',
[ [ 'stat',

0 comments on commit 5694139

Please sign in to comment.