Skip to content

Commit 30415b7

Browse files
authored
refactor: rename FeaturevisorCLI executable to featurevisor (#75)
1 parent e2c893a commit 30415b7

20 files changed

+25
-22
lines changed

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ let package = Package(
1717
targets: ["FeaturevisorTypes"]
1818
),
1919
.executable(
20-
name: "FeaturevisorCLI",
21-
targets: ["FeaturevisorCLI"]
20+
name: "featurevisor",
21+
targets: ["Featurevisor"]
2222
),
2323
],
2424
dependencies: [
@@ -43,7 +43,7 @@ let package = Package(
4343
]
4444
),
4545
.executableTarget(
46-
name: "FeaturevisorCLI",
46+
name: "Featurevisor",
4747
dependencies: [
4848
"FeaturevisorSDK",
4949
"FeaturevisorTypes",
@@ -52,7 +52,7 @@ let package = Package(
5252
.product(name: "Commands", package: "swift-commands"),
5353
.product(name: "ArgumentParser", package: "swift-argument-parser")
5454
],
55-
path: "Sources/FeaturevisorCLI"
55+
path: "Sources/Featurevisor"
5656
),
5757
.testTarget(
5858
name: "FeaturevisorSDKTests",

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,6 @@ let f = try createInstance(options: options)
320320

321321
### Test runner
322322

323-
@TODO: Work still in progress. Currently we have an early POC.
324-
325323
### Options
326324

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

333331
Example command:
334332

335-
First you need to install the Swift Test Runner using above steps (until we release official version)
333+
```
334+
$ swift run featurevisor test .
335+
```
336+
337+
You can also install it locally using below commands. Note, we use featurevisor-swift to avoid conflicts with other Featurevisor CLIs
338+
336339
```
337340
$ cd path/to/featurevisor-swift-sdk
338341
$ swift build -c release
339342
$ cd .build/release
340-
$ cp -f FeaturevisorSwiftTestRunner /usr/local/bin/featurevisor-swift-test-runner
343+
$ cp -f Featurevisor /usr/local/bin/featurevisor-swift
341344
```
342345

343346
Now you can usage like below:
344347
```
345348
$ cd path/to/featurevisor-project-with-yamls
346-
$ featurevisor-swift-cli test .
349+
$ featurevisor-swift test .
347350
```
348351

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

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

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

380383
```bash
381-
featurevisor-swift-cli benchmark \
384+
featurevisor-swift benchmark \
382385
--environment staging \
383386
--feature feature_key \
384387
--variable variable_key \
@@ -390,7 +393,7 @@ To benchmark evaluating a feature's variable via SDKs's `.getVariable()` method:
390393
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):
391394

392395
```bash
393-
featurevisor-swift-cli evaluate \
396+
featurevisor-swift evaluate \
394397
--environment staging \
395398
--feature feature_key \
396399
--context '{"user_id":"123"}' \

Sources/FeaturevisorCLI/FeaturevisorCLI+Benchmark.swift renamed to Sources/Featurevisor/Featurevisor+Benchmark.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import FeaturevisorSDK
33
import FeaturevisorTypes
44
import Foundation
55

6-
extension FeaturevisorCLI.Benchmark {
6+
extension Featurevisor.Benchmark {
77

88
func benchmarkFeature(options: Options) {
99

@@ -76,7 +76,7 @@ extension FeaturevisorCLI.Benchmark {
7676
}
7777
}
7878

79-
extension FeaturevisorCLI.Benchmark {
79+
extension Featurevisor.Benchmark {
8080

8181
func benchmarkFeatureFlag(
8282
_ f: FeaturevisorInstance,

Sources/FeaturevisorCLI/FeaturevisorCLI+Evaluate.swift renamed to Sources/Featurevisor/Featurevisor+Evaluate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import FeaturevisorSDK
33
import FeaturevisorTypes
44
import Foundation
55

6-
extension FeaturevisorCLI.Evaluate {
6+
extension Featurevisor.Evaluate {
77

88
func evaluateFeature(options: Options) {
99

@@ -88,7 +88,7 @@ extension FeaturevisorCLI.Evaluate {
8888
}
8989
}
9090

91-
extension FeaturevisorCLI.Evaluate {
91+
extension Featurevisor.Evaluate {
9292

9393
fileprivate func printHeader(_ message: String) {
9494
print("\n\n###############")

Sources/FeaturevisorCLI/FeaturevisorCLI.swift renamed to Sources/Featurevisor/Featurevisor.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import Foundation
77
import Yams
88

99
@main
10-
struct FeaturevisorCLI: ParsableCommand {
10+
struct Featurevisor: ParsableCommand {
1111

1212
static let configuration = CommandConfiguration(
1313
abstract: "Featurevisor CLI.",
1414
subcommands: [Benchmark.self, Evaluate.self, Test.self]
1515
)
1616
}
1717

18-
extension FeaturevisorCLI {
18+
extension Featurevisor {
1919

2020
struct Benchmark: ParsableCommand {
2121

@@ -95,7 +95,7 @@ extension FeaturevisorCLI {
9595
}
9696
}
9797

98-
extension FeaturevisorCLI {
98+
extension Featurevisor {
9999

100100
struct Evaluate: ParsableCommand {
101101

@@ -152,7 +152,7 @@ extension FeaturevisorCLI {
152152
}
153153
}
154154

155-
extension FeaturevisorCLI {
155+
extension Featurevisor {
156156

157157
struct Test: ParsableCommand {
158158

@@ -402,7 +402,7 @@ extension FeaturevisorCLI {
402402
}
403403
}
404404

405-
extension FeaturevisorCLI.Test {
405+
extension Featurevisor.Test {
406406

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

0 commit comments

Comments
 (0)