New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

navy

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

navy - npm Package Compare versions

Comparing version 2.1.0-rc5 to 2.1.0

lib/cli/refresh-config.js

3

lib/cli/develop.js

@@ -122,3 +122,4 @@ 'use strict';

_develop: {
mounts: mounts
mounts: mounts,
command: navyRc.develop.command
}

@@ -125,0 +126,0 @@ })))

@@ -33,2 +33,4 @@ 'use strict';

var _driverLogging = require('../driver-logging');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -72,3 +74,18 @@

case 11:
_context.next = 13;
return env.ensurePluginsLoaded();
case 13:
_context.next = 15;
return env.emitAsync('cli.import');
case 15:
(0, _driverLogging.startDriverLogging)('Ensuring services are up to date...');
_context.next = 18;
return env.relaunch();
case 18:
(0, _driverLogging.stopDriverLogging)();
console.log();

@@ -90,3 +107,3 @@ console.log(_chalk2.default.green(' Navy "' + _chalk2.default.white.bold(opts.navy) + '" has now been imported and initialised. 🎉'));

case 20:
case 28:
case 'end':

@@ -93,0 +110,0 @@ return _context.stop();

@@ -85,3 +85,3 @@ 'use strict';

_context.next = 20;
return env.emitAsync('cli:launch:before-launch');
return env.emitAsync('cli.before.launch');

@@ -88,0 +88,0 @@ case 20:

@@ -28,10 +28,5 @@ 'use strict';

_context.next = 3;
return env.safeGetDriver();
return env.spawnLogStream(services);
case 3:
_context.t0 = services;
_context.next = 6;
return _context.sent.spawnLogStream(_context.t0);
case 6:
case 'end':

@@ -38,0 +33,0 @@ return _context.stop();

@@ -69,4 +69,2 @@ 'use strict';

var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(maybeServices) {
var _getNavy;
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {

@@ -76,3 +74,3 @@ args[_key - 1] = arguments[_key];

var _require, getNavy, opts, otherArgs, envName, returnVal;
var _require, getNavy, opts, otherArgs, envName, navy, returnVal;

@@ -92,8 +90,20 @@ return _regenerator2.default.wrap(function _callee$(_context) {

_context.next = 8;
return wrapper((_getNavy = getNavy(envName))[fnName].apply(_getNavy, [Array.isArray(maybeServices) && maybeServices.length === 0 ? undefined : maybeServices].concat((0, _toConsumableArray3.default)(otherArgs))));
navy = getNavy(envName);
_context.next = 9;
return navy.ensurePluginsLoaded();
case 8:
case 9:
_context.next = 11;
return navy.emitAsync('cli.before.' + fnName, fnName);
case 11:
_context.next = 13;
return wrapper(navy[fnName].apply(navy, [Array.isArray(maybeServices) && maybeServices.length === 0 ? undefined : maybeServices].concat((0, _toConsumableArray3.default)(otherArgs))));
case 13:
returnVal = _context.sent;
_context.next = 16;
return navy.emitAsync('cli.after.' + fnName, fnName);
case 16:

@@ -103,3 +113,3 @@ if (driverLogging) (0, _driverLogging.stopDriverLogging)();

if (!Array.isArray(returnVal)) {
_context.next = 12;
_context.next = 19;
break;

@@ -110,3 +120,3 @@ }

case 12:
case 19:

@@ -117,3 +127,3 @@ if (returnVal != null) {

case 13:
case 20:
case 'end':

@@ -138,3 +148,3 @@ return _context.stop();

var defaultNavy = (0, _config.getConfig)().defaultNavy;
var defaultNavy = process.env.NAVY_NAME || (0, _config.getConfig)().defaultNavy;

@@ -193,2 +203,4 @@ var importCommand = _commander2.default.command('import').option('-e, --navy [env]', 'set the navy name to be used [' + defaultNavy + ']', defaultNavy).description('Imports docker compose configuration from the current working directory and initialises a new navy').action(lazyRequire('./import'));

_commander2.default.command('refresh-config').option('-e, --navy [env]', 'set the navy name to be used [' + defaultNavy + ']', defaultNavy).description('Refreshes the configuration for the given Navy').action(lazyRequire('./refresh-config'));
_commander2.default.command('status').option('--json', 'output JSON instead of a table').description('List all of the running navies and the status of their services').action(lazyRequire('./status'));

@@ -195,0 +207,0 @@

@@ -96,4 +96,12 @@ 'use strict';

if (state && state.services && state.services[service.name] && state.services[service.name]._develop) {
statusString += ' ' + _chalk2.default.yellow('(development)');
if (state && state.services && state.services[service.name]) {
var serviceState = state.services[service.name];
if (serviceState._develop) {
statusString += ' ' + _chalk2.default.yellow('(development)');
}
if (serviceState._tag) {
statusString += ' ' + _chalk2.default.cyan('@ ' + serviceState._tag);
}
}

@@ -100,0 +108,0 @@

@@ -91,2 +91,20 @@ 'use strict';

}))();
},
refreshConfig: function refreshConfig() {
var _this3 = this;
return (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3() {
return _regenerator2.default.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
return _context3.abrupt('return', false);
case 1:
case 'end':
return _context3.stop();
}
}
}, _callee3, _this3);
}))();
}

@@ -93,0 +111,0 @@ };

@@ -176,2 +176,39 @@ 'use strict';

}))();
},
refreshConfig: function refreshConfig() {
var _this3 = this;
return (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5() {
var envState;
return _regenerator2.default.wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
_context5.next = 2;
return navy.getState();
case 2:
envState = _context5.sent;
if (envState) {
_context5.next = 5;
break;
}
throw new Error('State doesn\'t exist for navy');
case 5:
_context5.next = 7;
return tryAndInstall(envState.npmPackage);
case 7:
return _context5.abrupt('return', true);
case 8:
case 'end':
return _context5.stop();
}
}
}, _callee5, _this3);
}))();
}

@@ -184,34 +221,17 @@ };

createNpmConfigProvider.getImportOptionsForCLI = function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(opts) {
return _regenerator2.default.wrap(function _callee5$(_context5) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(opts) {
return _regenerator2.default.wrap(function _callee6$(_context6) {
while (1) {
switch (_context5.prev = _context5.next) {
switch (_context6.prev = _context6.next) {
case 0:
if (!opts.npmPackage) {
_context5.next = 15;
_context6.next = 4;
break;
}
_context5.prev = 1;
_context5.t0 = _fs2.default;
_context5.next = 5;
return pathToModule(opts.npmPackage);
case 5:
_context5.t1 = _context5.sent;
_context5.next = 8;
return _context5.t0.accessAsync.call(_context5.t0, _context5.t1);
case 8:
_context5.next = 14;
break;
case 10:
_context5.prev = 10;
_context5.t2 = _context5['catch'](1);
_context5.next = 14;
_context6.next = 3;
return tryAndInstall(opts.npmPackage);
case 14:
return _context5.abrupt('return', {
case 3:
return _context6.abrupt('return', {
configProvider: 'npm',

@@ -221,8 +241,8 @@ npmPackage: opts.npmPackage

case 15:
case 4:
case 'end':
return _context5.stop();
return _context6.stop();
}
}
}, _callee5, undefined, [[1, 10]]);
}, _callee6, undefined);
}));

@@ -229,0 +249,0 @@ return function (_x3) {

@@ -25,5 +25,11 @@ "use strict";

if (serviceState._develop) {
serviceConfig.stdin_open = true;
serviceConfig.volumes = [].concat((0, _toConsumableArray3.default)(serviceConfig.volumes || []), (0, _toConsumableArray3.default)((0, _keys2.default)(serviceState._develop.mounts).map(function (local) {
return local + ":" + serviceState._develop.mounts[local];
})));
if (serviceState._develop.command) {
serviceConfig.command = serviceState._develop.command;
}
}

@@ -30,0 +36,0 @@ });

@@ -49,15 +49,15 @@ 'use strict';

var getLaunchedNavies = exports.getLaunchedNavies = function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee28() {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee29() {
var navyNames;
return _regenerator2.default.wrap(function _callee28$(_context28) {
return _regenerator2.default.wrap(function _callee29$(_context29) {
while (1) {
switch (_context28.prev = _context28.next) {
switch (_context29.prev = _context29.next) {
case 0:
_context28.prev = 0;
_context28.next = 3;
_context29.prev = 0;
_context29.next = 3;
return fs.readdirAsync((0, _state.pathToNavys)());
case 3:
navyNames = _context28.sent;
return _context28.abrupt('return', navyNames.map(function (name) {
navyNames = _context29.sent;
return _context29.abrupt('return', navyNames.map(function (name) {
return getNavy(name);

@@ -67,12 +67,12 @@ }));

case 7:
_context28.prev = 7;
_context28.t0 = _context28['catch'](0);
return _context28.abrupt('return', []);
_context29.prev = 7;
_context29.t0 = _context29['catch'](0);
return _context29.abrupt('return', []);
case 10:
case 'end':
return _context28.stop();
return _context29.stop();
}
}
}, _callee28, this, [[0, 7]]);
}, _callee29, this, [[0, 7]]);
}));

@@ -117,3 +117,5 @@ return function getLaunchedNavies() {

var _this = (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(Navy).call(this, {
maxListeners: _maxSafeInteger2.default
maxListeners: _maxSafeInteger2.default,
wildcard: true,
delimiter: '.'
}));

@@ -649,2 +651,3 @@

var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13(opts) {
var services;
return _regenerator2.default.wrap(function _callee13$(_context13) {

@@ -655,5 +658,19 @@ while (1) {

_context13.next = 2;
return this.getLaunchedServiceNames();
case 2:
services = _context13.sent;
if (!(services.length === 0)) {
_context13.next = 5;
break;
}
return _context13.abrupt('return');
case 5:
_context13.next = 7;
return this.launch(undefined, opts);
case 2:
case 7:
case 'end':

@@ -1011,6 +1028,5 @@ return _context13.stop();

}, {
key: 'useTag',
key: 'spawnLogStream',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee22(service, tag) {
var state;
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee22(services) {
return _regenerator2.default.wrap(function _callee22$(_context22) {

@@ -1020,33 +1036,23 @@ while (1) {

case 0:
_context22.next = 2;
return this.getState();
case 2:
_context22.t0 = _context22.sent;
if (_context22.t0) {
_context22.next = 5;
if (services) {
_context22.next = 4;
break;
}
_context22.t0 = {};
_context22.next = 3;
return this.getLaunchedServiceNames();
case 5:
state = _context22.t0;
_context22.next = 8;
return this.saveState((0, _extends5.default)({}, state, {
services: (0, _extends5.default)({}, state.services, (0, _defineProperty3.default)({}, service, (0, _extends5.default)({}, (state.services || {})[service], {
_tag: tag
})))
}));
case 3:
services = _context22.sent;
case 8:
_context22.next = 10;
return this.kill([service]);
case 4:
_context22.next = 6;
return this.safeGetDriver();
case 10:
_context22.next = 12;
return this.launch([service], { noDeps: true });
case 6:
_context22.t0 = services;
_context22.next = 9;
return _context22.sent.spawnLogStream(_context22.t0);
case 12:
case 9:
case 'end':

@@ -1059,12 +1065,12 @@ return _context22.stop();

function useTag(_x14, _x15) {
function spawnLogStream(_x14) {
return ref.apply(this, arguments);
}
return useTag;
return spawnLogStream;
}()
}, {
key: 'resetTag',
key: 'useTag',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee23(service) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee23(service, tag) {
var state;

@@ -1093,3 +1099,3 @@ return _regenerator2.default.wrap(function _callee23$(_context23) {

services: (0, _extends5.default)({}, state.services, (0, _defineProperty3.default)({}, service, (0, _extends5.default)({}, (state.services || {})[service], {
_tag: undefined
_tag: tag
})))

@@ -1114,12 +1120,13 @@ }));

function resetTag(_x16) {
function useTag(_x15, _x16) {
return ref.apply(this, arguments);
}
return resetTag;
return useTag;
}()
}, {
key: 'host',
key: 'resetTag',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee24(service, index) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee24(service) {
var state;
return _regenerator2.default.wrap(function _callee24$(_context24) {

@@ -1130,13 +1137,32 @@ while (1) {

_context24.next = 2;
return this.safeGetDriver();
return this.getState();
case 2:
_context24.t0 = service;
_context24.next = 5;
return _context24.sent.host(_context24.t0);
_context24.t0 = _context24.sent;
if (_context24.t0) {
_context24.next = 5;
break;
}
_context24.t0 = {};
case 5:
return _context24.abrupt('return', _context24.sent);
state = _context24.t0;
_context24.next = 8;
return this.saveState((0, _extends5.default)({}, state, {
services: (0, _extends5.default)({}, state.services, (0, _defineProperty3.default)({}, service, (0, _extends5.default)({}, (state.services || {})[service], {
_tag: undefined
})))
}));
case 6:
case 8:
_context24.next = 10;
return this.kill([service]);
case 10:
_context24.next = 12;
return this.launch([service], { noDeps: true });
case 12:
case 'end':

@@ -1149,13 +1175,12 @@ return _context24.stop();

function host(_x17, _x18) {
function resetTag(_x17) {
return ref.apply(this, arguments);
}
return host;
return resetTag;
}()
}, {
key: 'port',
key: 'host',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee25(service, privatePort) {
var index = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee25(service, index) {
return _regenerator2.default.wrap(function _callee25$(_context25) {

@@ -1170,11 +1195,9 @@ while (1) {

_context25.t0 = service;
_context25.t1 = privatePort;
_context25.t2 = index;
_context25.next = 7;
return _context25.sent.port(_context25.t0, _context25.t1, _context25.t2);
_context25.next = 5;
return _context25.sent.host(_context25.t0);
case 7:
case 5:
return _context25.abrupt('return', _context25.sent);
case 8:
case 6:
case 'end':

@@ -1187,12 +1210,13 @@ return _context25.stop();

function port(_x19, _x20, _x21) {
function host(_x18, _x19) {
return ref.apply(this, arguments);
}
return port;
return host;
}()
}, {
key: 'getLaunchedServiceNames',
key: 'port',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee26() {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee26(service, privatePort) {
var index = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];
return _regenerator2.default.wrap(function _callee26$(_context26) {

@@ -1206,9 +1230,12 @@ while (1) {

case 2:
_context26.next = 4;
return _context26.sent.getLaunchedServiceNames();
_context26.t0 = service;
_context26.t1 = privatePort;
_context26.t2 = index;
_context26.next = 7;
return _context26.sent.port(_context26.t0, _context26.t1, _context26.t2);
case 4:
case 7:
return _context26.abrupt('return', _context26.sent);
case 5:
case 8:
case 'end':

@@ -1221,10 +1248,10 @@ return _context26.stop();

function getLaunchedServiceNames() {
function port(_x20, _x21, _x22) {
return ref.apply(this, arguments);
}
return getLaunchedServiceNames;
return port;
}()
}, {
key: 'getAvailableServiceNames',
key: 'getLaunchedServiceNames',
value: function () {

@@ -1241,3 +1268,3 @@ var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee27() {

_context27.next = 4;
return _context27.sent.getAvailableServiceNames();
return _context27.sent.getLaunchedServiceNames();

@@ -1255,2 +1282,34 @@ case 4:

function getLaunchedServiceNames() {
return ref.apply(this, arguments);
}
return getLaunchedServiceNames;
}()
}, {
key: 'getAvailableServiceNames',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee28() {
return _regenerator2.default.wrap(function _callee28$(_context28) {
while (1) {
switch (_context28.prev = _context28.next) {
case 0:
_context28.next = 2;
return this.safeGetDriver();
case 2:
_context28.next = 4;
return _context28.sent.getAvailableServiceNames();
case 4:
return _context28.abrupt('return', _context28.sent);
case 5:
case 'end':
return _context28.stop();
}
}
}, _callee28, this);
}));
function getAvailableServiceNames() {

@@ -1257,0 +1316,0 @@ return ref.apply(this, arguments);

{
"name": "navy",
"version": "2.1.0-rc5",
"version": "2.1.0",
"description": "Docker Compose wrapper to allow for easy development workflows",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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