Permalink
Browse files

Initial Commit

  • Loading branch information...
0 parents commit b37fed010ad3f89489b507cb9da427efef9afc03 Matthew Smith committed Jan 5, 2012
Showing with 3,283 additions and 0 deletions.
  1. BIN .build-npm-linux.swp
  2. +3 −0 .gitmodules
  3. +21 −0 build-npm-linux
  4. +4 −0 node-npm-header.js
  5. +3,239 −0 npm/lib/knockout.js
  6. +15 −0 npm/package.json
  7. +1 −0 src
Binary file not shown.
@@ -0,0 +1,3 @@
+[submodule "src"]
+ path = src
+ url = git://github.com/SteveSanderson/knockout.git
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+OutFile='npm/lib/knockout.js'
+rm -rf $OutFile.temp
+
+# Combine the source files
+SourceFiles=`grep js < src/build/source-references.js | # Find JS references
+ sed "s/[ \',]//g" | # Strip off JSON fluff (whitespace, commas, quotes)
+ sed -e 's/.*/src\/&/' | # Fix the paths by prefixing with ../
+ tr '\n' ' '` # Combine into single line
+cat src/build/amd-pre.js > $OutFile.temp
+cat $SourceFiles >> $OutFile.temp
+cat src/build/amd-post.js >> $OutFile.temp
+
+# Finalise each file by prefixing with version header and surrounding in function closure
+cp src/build/version-header.js $OutFile
+cat node-npm-header.js >> $OutFile
+echo "(function(window,document,navigator,undefined){" >> $OutFile
+cat $OutFile.temp >> $OutFile
+echo "})(window,document,navigator);" >> $OutFile
+rm -rf $OutFile.temp
@@ -0,0 +1,4 @@
+var jsdom = require('jsdom').jsdom,
+ document = jsdom('<html><head></head><body></body></html>'),
+ window = document.createWindow(),
+ navigator = window.navigator;
Oops, something went wrong.

0 comments on commit b37fed0

Please sign in to comment.