Permalink
Browse files

Moving workspace

  • Loading branch information...
1 parent 8852c22 commit fd72c304eff55a7b9726803883bd9f9eb0798409 @ggoodman ggoodman committed Nov 26, 2013
Showing with 339 additions and 27 deletions.
  1. +6 −1 compilers/traceur.coffee
  2. +17 −19 index.coffee
  3. +6 −5 package.json
  4. +277 −0 public/markdown.css
  5. +33 −2 server.js
@@ -1,5 +1,7 @@
nconf = require("nconf")
traceur = require("traceur")
+uglify = require("uglify-js")
+fs = require("fs")
SourceMapGenerator = traceur.outputgeneration.SourceMapGenerator
@@ -10,6 +12,9 @@ traceur.options.experimental = true
ext = 'es6.js'
extRegex = /\.es6\.js$/
+runtime = fs.readFileSync(__dirname + "/../node_modules/traceur/src/runtime/runtime.js", "utf8")
+runtime = uglify.minify(runtime, fromString: true)
+
module.exports =
match: /\.js$/
ext: [ext]
@@ -30,7 +35,7 @@ module.exports =
for file in results.keys() when file.name is filename
tree = results.get(file)
code = traceur.outputgeneration.TreeWriter.write(tree, false)
- return fn(null, code)
+ return fn(null, "#{runtime.code}\n#{code}")
return fn(new Error("Unable to parse file"))
View
@@ -6,9 +6,9 @@ mime = require("mime")
url = require("url")
request = require("request")
path = require("path")
-ga = require("node-ga")
+#ga = require("node-ga")
genid = require("genid")
-
+lactate = require("lactate")
# Set defaults in nconf
@@ -23,10 +23,12 @@ genid = (len = 16, prefix = "", keyspace = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghij
prefix
-app.use ga("UA-28928507-4", safe: false)
+#app.use ga("UA-28928507-4", safe: false)
app.use require("./middleware/cors").middleware()
-app.use express.bodyParser()
-
+app.use express.urlencoded()
+app.use express.json()
+app.use lactate.static "#{__dirname}/public",
+ 'max age': 'one week'
LRU = require("lru-cache")
previews = LRU(512)
@@ -36,7 +38,6 @@ apiUrl = nconf.get("url:api")
coffee = require("coffee-script")
livescript = require("LiveScript")
-iced = require("iced-coffee-script")
less = require("less")
sass = require("sass")
scss = require("node-sass")
@@ -64,7 +65,7 @@ compilers =
fn(null, sass.render(str))
catch err
fn(err)
-
+
less:
match: /\.css$/
ext: ['less']
@@ -115,15 +116,6 @@ compilers =
catch err
fn(err)
- icedcoffee:
- match: /\.js$/
- ext: ['iced']
- compile: (path, filename, source, str, plunk, fn) ->
- try
- fn(null, iced.compile(str, runtime: "inline"))
- catch err
- fn(err)
-
jade:
match: /\.html$/
ext: ['jade']
@@ -138,8 +130,14 @@ compilers =
match: /\.html$/
ext: ['md',"markdown"]
compile: (path, filename, source, str, plunk, fn) ->
+ return fn(null, "") unless source
+
try
- fn(null, markdown(str))
+ fn null, """
+ <link rel="stylesheet" href="/markdown.css" type="text/css">
+
+ #{markdown(str)}
+ """
catch err
fn(err)
@@ -209,8 +207,8 @@ renderPlunkFile = (req, res, next) ->
test = [filename]
test.push(file) for file in ["index.html", "example.html", "demo.html", "readme.html"] when 0 > test.indexOf(file)
- for filename in test
- return if render(filename)
+ for attempt in test
+ return if render(attempt)
# Control will reach here if no file was found
console.log "[ERR] No suitable source file for: ", filename
View
@@ -10,7 +10,7 @@
"engines": {
"node": "0.8.x"
},
- "version": "0.3.17-2",
+ "version": "0.3.20-3",
"private": true,
"dependencies": {
"coffee-script": "1.6.x",
@@ -22,20 +22,21 @@
"json-schema": "https://github.com/kriszyp/json-schema/tarball/master",
"lru-cache": "1.1.x",
"request": "2.x",
- "node-sass": "https://github.com/filearts/node-sass/tarball/master",
- "sass": "*",
"less": "*",
"jade": "*",
"marked": "*",
"LiveScript": "*",
- "iced-coffee-script": "*",
"stylus": "*",
"nib": "*",
"typescript-wrapper": "*",
"traceur": "0.0.x",
"uglify-js": "2.3.x",
"node-ga": "0.1.x",
- "genid": "0.1.x"
+ "genid": "0.1.x",
+ "lactate": "~0.13.12",
+ "sass": "~0.5.0",
+ "node-sass": "~0.6.7",
+ "strong-agent": "~0.2.18"
},
"bundledDependencies": [
"json-schema"
Oops, something went wrong.

0 comments on commit fd72c30

Please sign in to comment.