Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jspm

Package Overview
Dependencies
Maintainers
1
Versions
264
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jspm - npm Package Compare versions

Comparing version 0.7.0-beta.19 to 0.7.0-beta.20

24

jspm.js

@@ -272,5 +272,5 @@ #!/usr/bin/env node

if (action == 'configure') {
if (action == 'config') {
if (!args[2])
ui.log('warn', 'You must provide an endpoint name to configure.');
return ui.log('warn', 'You must provide an endpoint name to configure.');
return Promise.resolve(endpoint.configure(args[2]))

@@ -281,7 +281,21 @@ .then(function() {

ui.log('err', err.stack || err);
})
});
}
else if (action == 'create') {
// NB todo
if (!args[2])
return ui.log('warn', 'You must provide an endpoint name to create.');
if (!args[3])
return ui.log('warn', 'You must provide the endpoint module name to generate from.');
return Promise.resolve(endpoint.create(args[2], args[3]))
.then(function(created) {
if (created)
ui.log('ok', 'Enpoint %' + args[2] + '% created successfully.');
}, function(err) {
ui.log('err', err.stack || err);
});
}
else {
showInstructions();
ui.log('Invalid endpoint argument ' + args[1]);
}
break;

@@ -307,5 +321,5 @@

default:
showInstructions();
if (args[0])
ui.log('Invalid argument ' + args[0]);
showInstructions();
}

@@ -312,0 +326,0 @@ })();

@@ -133,3 +133,5 @@ var ui = require('./ui');

}
config.curConfig.bundles[bundleName] = Object.keys(buildTree);
config.curConfig.bundles[bundleName] = Object.keys(buildTree).filter(function(moduleName) {
return buildTree[moduleName].metadata.build !== false;
});
ui.log('ok', '`' + bundleName + '` added to config bundles.');

@@ -136,0 +138,0 @@ }

@@ -861,2 +861,6 @@ #!/usr/bin/env node

}
// remove source maps
if (url.substr(url.length - 14, 14) == 'traceur.min.js' || url.substr(url.length - 22, 22) == 'traceur-runtime.min.js') {
output = output.replace(/\n[^\n]+$/, '');
}

@@ -863,0 +867,0 @@ return asp(fs.writeFile)(path.resolve(config.jspmPackages, filename), output);

@@ -65,2 +65,4 @@ var fs = require('graceful-fs');

options.name = endpoint;
if (!options.handler)

@@ -87,7 +89,16 @@ throw 'Endpoint not found.';

var endpointClass = require(handler);
try {
var endpointClass = require(handler);
}
catch(e) {
throw 'Endpoint handler `' + handler + '` not installed.';
}
if (!endpointClass.configure)
return;
endpointConfig.name = endpoint;
return Promise.resolve(endpointClass.configure(endpointConfig, ui))
.then(function(_config) {
delete _config.name;
_config.handler = handler;

@@ -103,5 +114,32 @@ config.globalConfig.endpoints[endpoint] = _config;

// creates a custom endpoint based on the given handler
// needs wiring up, but straightforward to do
exports.create = function(endpoint, name) {
exports.create = function(name, handler, override) {
// handle override prompts etc
if (!override && config.globalConfig.endpoints[name]) {
if (config.globalConfig.endpoints[name].handler == handler)
return ui.confirm('Endpoint %' + name + '% already exists. Do you want to reconfigure it now?')
.then(function(configure) {
if (configure)
return Promise.resolve(exports.configure(name))
.then(function() {
ui.log('ok', 'Endpoint %' + name + '% configured successfully.');
return false;
});
else
return false;
});
else
return ui.confirm('Endpoint %' + name + '% already exists, but based on `' + handler + '`. Are you sure you want to override it?')
.then(function(override) {
if (override)
return Promise.resolve(exports.create(name, handler, true));
return false;
});
}
var endpointConfig = config.globalConfig.endpoints[name] = config.globalConfig.endpoints[name] || {};
endpointConfig.handler = handler;
// load the endpoint and configure it
return exports.configure(name);
}
{
"name": "jspm",
"description": "",
"version": "0.7.0-beta.19",
"version": "0.7.0-beta.20",
"main": "./api.js",

@@ -10,4 +10,4 @@ "author": "",

"graceful-fs": "~2.0.1",
"jspm-github": "~0.5.1",
"jspm-npm": "~0.5.1",
"jspm-github": "~0.6.0",
"jspm-npm": "~0.6.0",
"minimatch": "^0.2.14",

@@ -14,0 +14,0 @@ "mkdirp": "~0.3.5",

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