Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated deps and enabled SocketStream to work with Node 0.7/0.8. Plea…

…se report any issues in #250.
  • Loading branch information...
commit 4f613ebd630f4ee130cc4810e822d50032af116d 1 parent 1e2aa7b
Owen Barnes authored
View
2  HISTORY.md
@@ -13,6 +13,8 @@ Not yet released. These are the changes so far...
##### Other
+* Updated many package dependencies
+* Removed restriction on testing with Node 0.7/0.8. [Discuss here](https://github.com/socketstream/socketstream/issues/250)
* Added documentation in Korean (thanks EngForDev)
* Enable proper handling of question marks and params when routing HTTP requests (thanks matthiasg)
View
6 lib/client/pack.js
@@ -1,4 +1,4 @@
-var cleanCSS, deleteOldFiles, formatKb, fs, log, magicPath, mkdir, pathlib, system, view;
+var cleanCSS, deleteOldFiles, existslib, formatKb, fs, log, magicPath, mkdir, pathlib, system, view;
log = console.log;
@@ -8,6 +8,8 @@ fs = require('fs');
pathlib = require('path');
+existslib = process.version.split('.')[1] === '6' && require('path') || require('fs');
@luksch
luksch added a note

This seems to break socketstream apps when used with iojs 1.6.x (instead of the slower moving nodejs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
cleanCSS = require('clean-css');
system = require('./system');
@@ -94,7 +96,7 @@ formatKb = function(size) {
};
mkdir = function(dir) {
- if (!pathlib.existsSync(dir)) return fs.mkdirSync(dir);
+ if (!existslib.existsSync(dir)) return fs.mkdirSync(dir);
};
deleteOldFiles = function(clientDir) {
View
6 lib/http/index.js
@@ -1,9 +1,11 @@
-var app, connect, eventMiddleware, fileUtils, fs, loadStaticDirs, pathlib, router, settings, staticDirs, staticFiles, transformURL, useAfterStack;
+var app, connect, eventMiddleware, existslib, fileUtils, fs, loadStaticDirs, pathlib, router, settings, staticDirs, staticFiles, transformURL, useAfterStack;
fs = require('fs');
pathlib = require('path');
+existslib = process.version.split('.')[1] === '6' && require('path') || require('fs');
+
connect = require('connect');
fileUtils = require('../utils/file');
@@ -108,7 +110,7 @@ transformURL = function(url) {
loadStaticDirs = function(path) {
var pathLength;
- if (pathlib.existsSync(path)) {
+ if (existslib.existsSync(path)) {
staticDirs = fs.readdirSync(path);
if (!(staticDirs.indexOf('assets') >= 0)) staticDirs.push('assets');
pathLength = path.length;
View
6 lib/request/middleware/index.js
@@ -1,7 +1,9 @@
-var apiTree, pathlib;
+var apiTree, existslib, pathlib;
pathlib = require('path');
+existslib = process.version.split('.')[1] === '6' && require('path') || require('fs');
+
apiTree = require('apitree');
module.exports = function(ss, config) {
@@ -11,7 +13,7 @@ module.exports = function(ss, config) {
return {
load: function() {
var k, stack, v;
- stack = pathlib.existsSync(customDir) && apiTree.createApiTree(customDir) || {};
+ stack = existslib.existsSync(customDir) && apiTree.createApiTree(customDir) || {};
for (k in internal) {
v = internal[k];
stack[k] = v;
View
18 package.json
@@ -20,17 +20,17 @@
],
"dependencies": {
"colors": "= 0.6.0-1",
- "commander": "= 0.5.2",
+ "commander": "= 0.6.1",
"eventemitter2": "= 0.4.9",
"apitree": "= 1.0.0",
- "uglify-js": "= 1.2.6",
- "clean-css": "= 0.3.2",
- "semver": "= 1.0.13",
+ "uglify-js": "= 1.3.1",
+ "clean-css": "= 0.4.1",
+ "semver": "= 1.0.14",
"socket.io": "= 0.9.6",
- "redis": "= 0.7.1",
- "connect": "= 2.0.3",
- "connect-redis": "= 1.3.0",
- "chokidar": "= 0.2.3"
+ "redis": "= 0.7.2",
+ "connect": "= 2.3.3",
+ "connect-redis": "= 1.4.0",
+ "chokidar": "= 0.2.6"
},
"devDependencies": {
"coffee-script": "= 1.2.0",
@@ -42,6 +42,6 @@
},
"directories": { "lib": "./lib", "doc": "./doc" },
"main": "./index.js",
- "engines": { "node": ">= 0.6.0 < 0.7.0" },
+ "engines": { "node": ">= 0.6.0" },
"bin": { "socketstream": "./bin/socketstream" }
}
View
3  src/client/pack.coffee
@@ -8,6 +8,7 @@ require('colors')
fs = require('fs')
pathlib = require('path')
+existslib = process.version.split('.')[1] == '6' && require('path') || require('fs')
cleanCSS = require('clean-css')
system = require('./system')
@@ -82,7 +83,7 @@ formatKb = (size) ->
"#{Math.round((size / 1024) * 1000) / 1000} KB"
mkdir = (dir) ->
- fs.mkdirSync(dir) unless pathlib.existsSync(dir)
+ fs.mkdirSync(dir) unless existslib.existsSync(dir)
deleteOldFiles = (clientDir) ->
numFilesDeleted = 0
View
3  src/http/index.coffee
@@ -5,6 +5,7 @@
fs = require('fs')
pathlib = require('path')
+existslib = process.version.split('.')[1] == '6' && require('path') || require('fs')
connect = require('connect')
fileUtils = require('../utils/file')
@@ -104,7 +105,7 @@ transformURL = (url) ->
loadStaticDirs = (path) ->
- if pathlib.existsSync(path)
+ if existslib.existsSync(path)
# Get a list of top-level static directories (used by the router)
staticDirs = fs.readdirSync(path)
View
4 src/request/middleware/index.coffee
@@ -3,8 +3,10 @@
# Allows incoming requests to be pre-processed, transformed, or sent elsewhere
pathlib = require('path')
+existslib = process.version.split('.')[1] == '6' && require('path') || require('fs')
apiTree = require('apitree')
+
module.exports = (ss, config) ->
customDir = pathlib.join(ss.root, 'server/middleware')
@@ -15,7 +17,7 @@ module.exports = (ss, config) ->
# Return API
load: ->
# Load custom middleware
- stack = pathlib.existsSync(customDir) && apiTree.createApiTree(customDir) || {}
+ stack = existslib.existsSync(customDir) && apiTree.createApiTree(customDir) || {}
# Append internal/default middleware
stack[k] = v for k, v of internal
stack
Please sign in to comment.
Something went wrong with that request. Please try again.