Skip to content

Commit

Permalink
refactor: rename FeaturevisorCLI executable to featurevisor (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
polok authored Jul 22, 2024
1 parent e2c893a commit 30415b7
Show file tree
Hide file tree
Showing 20 changed files with 25 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ let package = Package(
targets: ["FeaturevisorTypes"]
),
.executable(
name: "FeaturevisorCLI",
targets: ["FeaturevisorCLI"]
name: "featurevisor",
targets: ["Featurevisor"]
),
],
dependencies: [
Expand All @@ -43,7 +43,7 @@ let package = Package(
]
),
.executableTarget(
name: "FeaturevisorCLI",
name: "Featurevisor",
dependencies: [
"FeaturevisorSDK",
"FeaturevisorTypes",
Expand All @@ -52,7 +52,7 @@ let package = Package(
.product(name: "Commands", package: "swift-commands"),
.product(name: "ArgumentParser", package: "swift-argument-parser")
],
path: "Sources/FeaturevisorCLI"
path: "Sources/Featurevisor"
),
.testTarget(
name: "FeaturevisorSDKTests",
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ let f = try createInstance(options: options)

### Test runner

@TODO: Work still in progress. Currently we have an early POC.

### Options

```bash
Expand All @@ -332,18 +330,23 @@ If you are interested to see only the test specs that fail:

Example command:

First you need to install the Swift Test Runner using above steps (until we release official version)
```
$ swift run featurevisor test .
```

You can also install it locally using below commands. Note, we use featurevisor-swift to avoid conflicts with other Featurevisor CLIs

```
$ cd path/to/featurevisor-swift-sdk
$ swift build -c release
$ cd .build/release
$ cp -f FeaturevisorSwiftTestRunner /usr/local/bin/featurevisor-swift-test-runner
$ cp -f Featurevisor /usr/local/bin/featurevisor-swift
```

Now you can usage like below:
```
$ cd path/to/featurevisor-project-with-yamls
$ featurevisor-swift-cli test .
$ featurevisor-swift test .
```

### Benchmarking
Expand All @@ -355,7 +358,7 @@ The `--n` option is used to specify the number of iterations to run the benchmar
To benchmark evaluating a feature itself if it is enabled or disabled via SDK's `.isEnabled()` method:

```bash
featurevisor-swift-cli benchmark \
featurevisor-swift benchmark \
--environment staging \
--feature feature_key \
--context '{"user_id":"123"}' \
Expand All @@ -366,7 +369,7 @@ To benchmark evaluating a feature itself if it is enabled or disabled via SDK's
To benchmark evaluating a feature's variation via SDKs's `.getVariation()` method:

```bash
featurevisor-swift-cli benchmark \
featurevisor-swift benchmark \
--environment staging \
--feature feature_key \
--context '{"user_id":"123"}' \
Expand All @@ -378,7 +381,7 @@ To benchmark evaluating a feature's variation via SDKs's `.getVariation()` metho
To benchmark evaluating a feature's variable via SDKs's `.getVariable()` method:

```bash
featurevisor-swift-cli benchmark \
featurevisor-swift benchmark \
--environment staging \
--feature feature_key \
--variable variable_key \
Expand All @@ -390,7 +393,7 @@ To benchmark evaluating a feature's variable via SDKs's `.getVariable()` method:
To learn why certain values (like feature and its variation or variables) are evaluated as they are against provided [context](https://featurevisor.com/docs/sdks/javascript/#context):

```bash
featurevisor-swift-cli evaluate \
featurevisor-swift evaluate \
--environment staging \
--feature feature_key \
--context '{"user_id":"123"}' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FeaturevisorSDK
import FeaturevisorTypes
import Foundation

extension FeaturevisorCLI.Benchmark {
extension Featurevisor.Benchmark {

func benchmarkFeature(options: Options) {

Expand Down Expand Up @@ -76,7 +76,7 @@ extension FeaturevisorCLI.Benchmark {
}
}

extension FeaturevisorCLI.Benchmark {
extension Featurevisor.Benchmark {

func benchmarkFeatureFlag(
_ f: FeaturevisorInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FeaturevisorSDK
import FeaturevisorTypes
import Foundation

extension FeaturevisorCLI.Evaluate {
extension Featurevisor.Evaluate {

func evaluateFeature(options: Options) {

Expand Down Expand Up @@ -88,7 +88,7 @@ extension FeaturevisorCLI.Evaluate {
}
}

extension FeaturevisorCLI.Evaluate {
extension Featurevisor.Evaluate {

fileprivate func printHeader(_ message: String) {
print("\n\n###############")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import Foundation
import Yams

@main
struct FeaturevisorCLI: ParsableCommand {
struct Featurevisor: ParsableCommand {

static let configuration = CommandConfiguration(
abstract: "Featurevisor CLI.",
subcommands: [Benchmark.self, Evaluate.self, Test.self]
)
}

extension FeaturevisorCLI {
extension Featurevisor {

struct Benchmark: ParsableCommand {

Expand Down Expand Up @@ -95,7 +95,7 @@ extension FeaturevisorCLI {
}
}

extension FeaturevisorCLI {
extension Featurevisor {

struct Evaluate: ParsableCommand {

Expand Down Expand Up @@ -152,7 +152,7 @@ extension FeaturevisorCLI {
}
}

extension FeaturevisorCLI {
extension Featurevisor {

struct Test: ParsableCommand {

Expand Down Expand Up @@ -402,7 +402,7 @@ extension FeaturevisorCLI {
}
}

extension FeaturevisorCLI.Test {
extension Featurevisor.Test {

func loadAllFeatures(featuresTestDirectoryPath: String) throws -> [Feature] {

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 30415b7

Please sign in to comment.