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

@featurevisor/cli

Package Overview
Dependencies
Maintainers
1
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@featurevisor/cli - npm Package Compare versions

Comparing version 1.17.0 to 1.18.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [1.18.0](https://github.com/featurevisor/featurevisor/compare/v1.17.0...v1.18.0) (2024-04-16)
### Features
* assess traffic distribution via CLI ([#297](https://github.com/featurevisor/featurevisor/issues/297)) ([2063ad9](https://github.com/featurevisor/featurevisor/commit/2063ad9a5408071bfb1636c748cabe616065191d))
# [1.17.0](https://github.com/featurevisor/featurevisor/compare/v1.16.0...v1.17.0) (2024-04-07)

@@ -8,0 +19,0 @@

@@ -499,2 +499,53 @@ "use strict";

/**
* Assess distribution
*/
.command({
command: "assess-distribution",
handler: function (options) {
return __awaiter(this, void 0, void 0, function () {
var deps, e_8;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!options.environment) {
console.error("Please specify an environment with --environment flag.");
process.exit(1);
}
if (!options.feature) {
console.error("Please specify a feature with --feature flag.");
process.exit(1);
}
return [4 /*yield*/, getDependencies(options)];
case 1:
deps = _a.sent();
_a.label = 2;
case 2:
_a.trys.push([2, 4, , 5]);
return [4 /*yield*/, (0, core_1.assessDistribution)(deps, {
environment: options.environment,
feature: options.feature,
context: options.context ? JSON.parse(options.context) : {},
populateUuid: Array.isArray(options.populateUuid)
? options.populateUuid
: [options.populateUuid].filter(Boolean),
n: parseInt(options.n, 10) || 1,
verbose: options.verbose,
})];
case 3:
_a.sent();
return [3 /*break*/, 5];
case 4:
e_8 = _a.sent();
console.error(e_8.message);
process.exit(1);
return [3 /*break*/, 5];
case 5: return [2 /*return*/];
}
});
});
},
})
.example("$0 assess-distribution", "test traffic distribution of a feature")
.example("$0 assess-distribution --environment=production --feature=my_feature --context='{}' --populateUuid=userId --n=100", "test traffic distribution a feature against provided context")
/**
* Options

@@ -501,0 +552,0 @@ */

6

package.json
{
"name": "@featurevisor/cli",
"version": "1.17.0",
"version": "1.18.0",
"description": "CLI package of Featurevisor",

@@ -50,3 +50,3 @@ "main": "bin.js",

"dependencies": {
"@featurevisor/core": "^1.17.0",
"@featurevisor/core": "^1.18.0",
"yargs": "^17.6.2"

@@ -57,3 +57,3 @@ },

},
"gitHead": "41b21ee48a1508fad58824b255403125ce175f95"
"gitHead": "beedecac433ebb53ec5c856ecdf5bf8c5ea159fd"
}

@@ -28,2 +28,3 @@ import * as fs from "fs";

evaluateFeature,
assessDistribution,
} from "@featurevisor/core";

@@ -372,2 +373,43 @@

/**
* Assess distribution
*/
.command({
command: "assess-distribution",
handler: async function (options) {
if (!options.environment) {
console.error("Please specify an environment with --environment flag.");
process.exit(1);
}
if (!options.feature) {
console.error("Please specify a feature with --feature flag.");
process.exit(1);
}
const deps = await getDependencies(options);
try {
await assessDistribution(deps, {
environment: options.environment,
feature: options.feature,
context: options.context ? JSON.parse(options.context) : {},
populateUuid: Array.isArray(options.populateUuid)
? options.populateUuid
: [options.populateUuid as string].filter(Boolean),
n: parseInt(options.n, 10) || 1,
verbose: options.verbose,
});
} catch (e) {
console.error(e.message);
process.exit(1);
}
},
})
.example("$0 assess-distribution", "test traffic distribution of a feature")
.example(
"$0 assess-distribution --environment=production --feature=my_feature --context='{}' --populateUuid=userId --n=100",
"test traffic distribution a feature against provided context",
)
/**
* Options

@@ -374,0 +416,0 @@ */

Sorry, the diff of this file is not supported yet

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