Socket
Socket
Sign inDemoInstall

jitsu

Package Overview
Dependencies
Maintainers
4
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jitsu - npm Package Compare versions

Comparing version 0.8.3 to 0.8.4-1

config.json

33

lib/jitsu.js

@@ -54,2 +54,6 @@ /*

string: true
},
raw: {
description: 'jitsu will only output line-delimited raw JSON ( useful for piping )',
boolean: true
}

@@ -59,2 +63,8 @@ }

jitsu.options.log = {
console: {
raw: jitsu.argv.raw
}
};
//

@@ -216,10 +226,19 @@ // Setup config, users, command aliases and prompt settings

}
jitsu.users = new jitsu.api.Users(jitsu.config);
jitsu.apps = new jitsu.api.Apps(jitsu.config);
jitsu.snapshots = new jitsu.api.Snapshots(jitsu.config);
jitsu.databases = new jitsu.api.Databases(jitsu.config);
jitsu.logs = new jitsu.api.Logs(jitsu.config);
['Users', 'Apps', 'Snapshots', 'Databases', 'Logs'].forEach(function (key) {
var k = key.toLowerCase();
jitsu[k] = new jitsu.api[key](jitsu.config);
jitsu[k].on('debug::request', debug);
jitsu[k].on('debug::response', debug);
function debug (data) {
if (jitsu.argv.debug || jitsu.config.get('debug')) {
//
// TODO: replace with custom logger method
//
// console.log(data);
}
};
});
jitsu.started = true;
callback();

@@ -226,0 +245,0 @@ };

@@ -22,6 +22,5 @@ /*

create: function (details) {
jitsu.log.help('Your account has been created, but it is not yet active');
jitsu.log.help('Please check the email we sent to ' + details.email.grey + ' for further instructions');
jitsu.log.help('You must check the email we sent to ' + details.email.grey + ' for further activation instructions.');
}
}
});

@@ -16,4 +16,2 @@ /*

var thisPath = process.cwd();
//

@@ -26,34 +24,37 @@ // "nodeapps" is a hash of aliases and npm packages,

"package": "nodeapps-helloworld",
"description": "demo `hello world` http server"
"description": " demo `hello world` http server"
},
"http-server": {
"package": "http-server",
"description": "a robust and customizable http server"
},
"express": {
"package": "nodeapps-express",
"description": "express.js boilerplate"
"description": " express.js boilerplate"
},
"socket.io": {
"package": "nodeapps-socket.io",
"description": "socket.io boilerplate"
"description": " socket.io boilerplate"
},
"dnode": {
"package": "nodeapps-dnode",
"description": "dnode boilerplate"
},
"web-http-client": {
"package": "web-http-client",
"description": "web based http-client ( with server-side proxy )"
},
"custom-vimeo-site": {
"package": "custom-vimeo-site",
"description": "custom homepage for your vimeo videos"
},
"my-nodeapps": {
"package": "nodeapps-my-nodeapps",
"description": "simple site to display your node apps"
"http-server": {
"package": "http-server",
"description": " a robust and customizable http server"
}
};
/*
"web-http-client": {
"package": "web-http-client",
"description": "web based http-client ( with server-side proxy )"
},
"custom-vimeo-site": {
"package": "custom-vimeo-site",
"description": "custom homepage for your vimeo videos"
},
"my-nodeapps": {
"package": "nodeapps-my-nodeapps",
"description": "simple site to display your node apps"
}
*/
module.exports = function (starterName, callback) {

@@ -64,6 +65,2 @@ npmModule.load({ exit: false }, function (err) {

}
if (fs.readdirSync(thisPath).length !== 0) {
return warnOverwrite(starterName, callback);
}

@@ -78,5 +75,8 @@ if (typeof starterName === 'string') {

function installApp(starterName, cb) {
var thisPath = process.cwd();
jitsu.log.info('Installing ' + starterName.magenta + ' locally.');
jitsu.log.warn('Downloading packages from npm, this may take a moment...');
npmModule.commands.install(thisPath, [nodeapps[starterName].package], function (err, result) {
npmModule.commands.install(starterName, [nodeapps[starterName].package], function (err, result) {
if (err) {

@@ -86,4 +86,28 @@ return cb(err);

cpr(path.join(thisPath, 'node_modules', nodeapps[starterName].package), thisPath, function (err) {
return err ? cb(err) : cb(err, result);
cpr(path.join(thisPath + '/' + starterName, 'node_modules', nodeapps[starterName].package), thisPath + '/' + starterName, function (err) {
if (err) {
return cb(err);
}
//
// Read current package.json
//
var pkg = JSON.parse(fs.readFileSync(thisPath + '/' + starterName + '/package.json').toString());
//
// Strip out any un-needed internal ids
//
for(var k in pkg) {
if (k.search("_") !== -1) {
delete pkg[k];
}
}
//
// Write modified package.json back out
//
fs.writeFileSync(thisPath + '/' + starterName + '/package.json', JSON.stringify(pkg, true, 2));
return cb(err, result);
});

@@ -112,2 +136,5 @@ });

function promptforAppName(cb) {
jitsu.log.help('The ' + 'install'.magenta + ' command downloads pre-built node applications.');
jitsu.log.help('To continue, you will need to select an application.');
jitsu.log.info('Please choose a node app so we can get you started.');

@@ -136,5 +163,4 @@ jitsu.log.info('Available node apps:');

function postInstall(starterName, cb) {
jitsu.log.info(starterName.magenta + ' installed.')
jitsu.log.info(starterName.magenta + ' installed.');
jitsu.log.help('You can now ' + 'jitsu deploy'.magenta + ' this application')
jitsu.prompt.get(['start_local'], function (err, results) {

@@ -155,26 +181,7 @@ return results['start_local'] === 'yes'

jitsu.log.info(starterName.magenta + ' is now starting.')
jitsu.log.help('To exit application, press CTRL-C \n');
if (dest === "local") {
//
// Remark: It would be nice to use:
//
// npmModule.start(starterName, cb);
//
// but there is a conflict in package.json formats of `npm` versus `haibu`
// in the scripts.start property containing the word "node" in it
//
var pkg = JSON.parse(fs.readFileSync(process.cwd() + '/package.json').toString());
jitsu.log.warn(('Outputting logs from: ' + pkg.name));
console.log('\n');
app = spawn('node', [pkg.scripts.start.replace(/node /, '')]);
app.stdout.on('data', function (data) {
console.log(data.toString());
});
app.stderr.on('data', function (data) {
console.log(data.toString());
});
app.on('exit', function (code) {
console.log('Application exited ', code);
});
return npmModule.start(process.cwd() + '/' + starterName, cb);
}

@@ -192,3 +199,3 @@ }

jitsu.log.info('You can run additional deployments using `jitsu deploy`');
return jitsu.commands.run(['deploy'], callback);
return jitsu.plugins.cli.executeCommand(['deploy'],callback);
});

@@ -195,0 +202,0 @@ }

@@ -35,3 +35,3 @@ /*

if (/^y[es]+/i.test(res['request password reset'])) {
return jitsu.commands.run(['users', 'forgot', username], callback);
return jitsu.plugins.cli.executeCommand(['users', 'forgot', username ], callback);
}

@@ -62,3 +62,3 @@

jitsu.log.info('Would you like to reset your password?');
return offerReset(result.username);
return offerReset(username);
}

@@ -65,0 +65,0 @@ return setupAuth();

@@ -47,3 +47,2 @@ /*

colors: true,
debug: true,
gzipbin: 'gzip',

@@ -50,0 +49,0 @@ loglevel: 'info',

@@ -290,2 +290,8 @@ /*

jitsu.log.warn('About to write ' + path.join(dir, 'package.json').magenta);
//
// analyze and throw warnings if any dependencies have version of '*'
//
policeDependencies(pkg)
jitsu.inspect.putObject(pkg, 2);

@@ -304,2 +310,3 @@ jitsu.prompt.get([{

})
});

@@ -309,3 +316,3 @@ };

//
// ### function checkDependencies (pkg, dir, callback)
// ### function analyzeDependencies (pkg, dir, callback)
// #### @pkg {Object} Parsed package.json to check dependencies for.

@@ -601,2 +608,12 @@ // #### @dir {string} Directory containing the package.json file.

});
//
// auto-suggest a new domain field based on username
//
for (var p in props) {
if(props[p].name === 'subdomain') {
props[p].default = props[p].default + '.' + jitsu.config.get('username');
}
}
if (fields.indexOf('name') !== -1) {

@@ -655,2 +672,16 @@ jitsu.log.error('The application name you have requested is already in use.');

function policeDependencies (pkg) {
dependencies = pkg.dependencies;
for (var key in dependencies) {
if (dependencies[key].toString().match(/(\*)/)) {
jitsu.log.warn('Using \'*\' as version for dependencies may eventually cause issues.');
jitsu.log.warn('Please use specific versions for dependencies to avoid future problems.');
return false;
}
}
}
function fillPackage (base, dir, callback) {

@@ -657,0 +688,0 @@ base = base || {};

@@ -29,6 +29,2 @@ /*

'To install a pre-built application'.cyan,
' jitsu install',
'',
'To sign up for Nodejitsu'.cyan,

@@ -42,2 +38,6 @@ ' jitsu signup',

'To install a pre-built application'.cyan,
' jitsu install',
'',
'Deploys current path to Nodejitsu'.cyan,

@@ -47,6 +47,2 @@ ' jitsu deploy',

'Creates a new application on Nodejitsu'.cyan,
' jitsu create',
'',
'Lists all applications for the current user'.cyan,

@@ -53,0 +49,0 @@ ' jitsu list',

@@ -11,3 +11,3 @@ {

],
"version": "0.8.3",
"version": "0.8.4-1",
"author": "Nodejitsu Inc. <support@nodejitsu.com>",

@@ -21,7 +21,7 @@ "repository": {

"colors": "0.6.0-1",
"flatiron": "0.1.14",
"flatiron": "0.1.16",
"flatiron-cli-config": "0.1.1",
"flatiron-cli-users": "0.1.1",
"npm": "1.1.4",
"nodejitsu-api": "0.2.4-1",
"npm": "1.1.12",
"nodejitsu-api": "0.2.5",
"pkginfo": "0.2.2",

@@ -41,3 +41,4 @@ "request": "2.9.100",

"scripts": {
"test": "vows test/commands/*-test.js --spec"
"test": "vows test/commands/*-test.js --spec",
"postinstall": "node ./bin/jitsu help"
},

@@ -44,0 +45,0 @@ "engines": {

@@ -35,14 +35,13 @@ # jitsu [![Build Status](https://secure.travis-ci.org/nodejitsu/jitsu.png)](http://travis-ci.org/nodejitsu/jitsu)

*( inside an empty directory )*
**If you don't have an application yet, you can use one of ours!**
jitsu install
# One-Line Node App Deployment
jitsu deploy
*( inside the path of your Node.js application )*
jitsu deploy
This will create a new application, package.json, and deploy your path to [Nodejitsu](http://nodejitsu.com). If it's your first deployment, you'll be prompted for some information such as *subdomain* and *start script* but it's really easy and we promise it will only take a few seconds.

@@ -75,6 +74,2 @@

*To install a pre-built application*
jitsu install
*To sign up for [Nodejitsu](http://nodejitsu.com)*

@@ -88,2 +83,6 @@

*To install a pre-built application*
jitsu install
*Deploys current path to [Nodejitsu](http://nodejitsu.com)*

@@ -90,0 +89,0 @@

@@ -7,3 +7,3 @@ {

},
"version": "0.0.0-1",
"version": "0.0.0-2",
"engines": {

@@ -10,0 +10,0 @@ "node": "0.6.x"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc