@featurevisor/vue 1.20.0 → 1.27.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintcache +1 -1
- package/CHANGELOG.md +19 -0
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/setupApp.ts.html +1 -1
- package/dist/index.js.gz +0 -0
- package/jest.config.js +3 -0
- package/lib/activateFeature.js +2 -3
- package/lib/activateFeature.js.map +1 -1
- package/lib/index.spec.js +54 -90
- package/lib/index.spec.js.map +1 -1
- package/lib/setupApp.js +1 -1
- package/lib/setupApp.js.map +1 -1
- package/lib/useFlag.js +2 -3
- package/lib/useFlag.js.map +1 -1
- package/lib/useSdk.js +1 -1
- package/lib/useSdk.js.map +1 -1
- package/lib/useStatus.js +4 -4
- package/lib/useStatus.js.map +1 -1
- package/lib/useVariable.js +2 -3
- package/lib/useVariable.js.map +1 -1
- package/lib/useVariation.js +2 -3
- package/lib/useVariation.js.map +1 -1
- package/package.json +3 -3
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/home/runner/work/featurevisor/featurevisor/packages/vue/src/activateFeature.ts":"1","/home/runner/work/featurevisor/featurevisor/packages/vue/src/index.spec.ts":"2","/home/runner/work/featurevisor/featurevisor/packages/vue/src/index.ts":"3","/home/runner/work/featurevisor/featurevisor/packages/vue/src/setupApp.ts":"4","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useFlag.ts":"5","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useSdk.ts":"6","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useStatus.ts":"7","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useVariable.ts":"8","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useVariation.ts":"9","/home/runner/work/featurevisor/featurevisor/packages/vue/stub/types__react/index.d.ts":"10"},{"size":299,"mtime":
|
|
1
|
+
[{"/home/runner/work/featurevisor/featurevisor/packages/vue/src/activateFeature.ts":"1","/home/runner/work/featurevisor/featurevisor/packages/vue/src/index.spec.ts":"2","/home/runner/work/featurevisor/featurevisor/packages/vue/src/index.ts":"3","/home/runner/work/featurevisor/featurevisor/packages/vue/src/setupApp.ts":"4","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useFlag.ts":"5","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useSdk.ts":"6","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useStatus.ts":"7","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useVariable.ts":"8","/home/runner/work/featurevisor/featurevisor/packages/vue/src/useVariation.ts":"9","/home/runner/work/featurevisor/featurevisor/packages/vue/stub/types__react/index.d.ts":"10"},{"size":299,"mtime":1733086696755,"results":"11","hashOfConfig":"12"},{"size":1941,"mtime":1733086696755,"results":"13","hashOfConfig":"12"},{"size":209,"mtime":1733086696755,"results":"14","hashOfConfig":"12"},{"size":233,"mtime":1733086696755,"results":"15","hashOfConfig":"12"},{"size":250,"mtime":1733086696755,"results":"16","hashOfConfig":"12"},{"size":261,"mtime":1733086696755,"results":"17","hashOfConfig":"12"},{"size":435,"mtime":1733086696755,"results":"18","hashOfConfig":"12"},{"size":350,"mtime":1733086696755,"results":"19","hashOfConfig":"12"},{"size":300,"mtime":1733086696755,"results":"20","hashOfConfig":"12"},{"size":11,"mtime":1733086696755,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","suppressedMessages":"24","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"kw5o68",{"filePath":"25","messages":"26","suppressedMessages":"27","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"28","messages":"29","suppressedMessages":"30","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","suppressedMessages":"33","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","suppressedMessages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","suppressedMessages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","suppressedMessages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","suppressedMessages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","suppressedMessages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","suppressedMessages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/featurevisor/featurevisor/packages/vue/src/activateFeature.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/vue/src/index.spec.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/vue/src/index.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/vue/src/setupApp.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/vue/src/useFlag.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/vue/src/useSdk.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/vue/src/useStatus.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/vue/src/useVariable.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/vue/src/useVariation.ts",[],[],"/home/runner/work/featurevisor/featurevisor/packages/vue/stub/types__react/index.d.ts",[],[]]
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.27.4](https://github.com/featurevisor/featurevisor/compare/v1.27.3...v1.27.4) (2024-12-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @featurevisor/vue
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.27.2](https://github.com/featurevisor/featurevisor/compare/v1.27.1...v1.27.2) (2024-08-28)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* ESM bundle for SDK ([#324](https://github.com/featurevisor/featurevisor/issues/324)) ([54556ea](https://github.com/featurevisor/featurevisor/commit/54556ea5ce9a6c221f482b230905a42e24e64886))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [1.20.0](https://github.com/featurevisor/featurevisor/compare/v1.19.0...v1.20.0) (2024-04-30)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @featurevisor/vue
|
package/coverage/clover.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1733086830888" clover="3.2.0">
|
|
3
|
+
<project timestamp="1733086830888" name="All files">
|
|
4
4
|
<metrics statements="3" coveredstatements="3" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1" elements="4" coveredelements="4" complexity="0" loc="3" ncloc="3" packages="1" files="1" classes="1"/>
|
|
5
5
|
<file name="setupApp.ts" path="/home/runner/work/featurevisor/featurevisor/packages/vue/src/setupApp.ts">
|
|
6
6
|
<metrics statements="3" coveredstatements="3" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at 2024-
|
|
104
|
+
at 2024-12-01T21:00:30.871Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -94,7 +94,7 @@ export function setupApp(app: App, sdk: FeaturevisorInstance) {
|
|
|
94
94
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
95
95
|
Code coverage generated by
|
|
96
96
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
97
|
-
at 2024-
|
|
97
|
+
at 2024-12-01T21:00:30.871Z
|
|
98
98
|
</div>
|
|
99
99
|
<script src="prettify.js"></script>
|
|
100
100
|
<script>
|
package/dist/index.js.gz
CHANGED
|
Binary file
|
package/jest.config.js
CHANGED
package/lib/activateFeature.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useSdk } from "./useSdk";
|
|
2
|
-
export function activateFeature(featureKey, context) {
|
|
3
|
-
|
|
4
|
-
var sdk = useSdk();
|
|
2
|
+
export function activateFeature(featureKey, context = {}) {
|
|
3
|
+
const sdk = useSdk();
|
|
5
4
|
return sdk.activate(featureKey, context);
|
|
6
5
|
}
|
|
7
6
|
//# sourceMappingURL=activateFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activateFeature.js","sourceRoot":"","sources":["../src/activateFeature.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,UAAU,eAAe,CAC7B,UAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"activateFeature.js","sourceRoot":"","sources":["../src/activateFeature.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,UAAU,eAAe,CAC7B,UAAsB,EACtB,UAAmB,EAAE;IAErB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,OAAO,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC"}
|
package/lib/index.spec.js
CHANGED
|
@@ -7,103 +7,67 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
10
|
import { createApp } from "vue";
|
|
38
11
|
import { createInstance } from "@featurevisor/sdk";
|
|
39
12
|
import { mount } from "@vue/test-utils";
|
|
40
13
|
import { setupApp, PROVIDER_NAME } from "./setupApp";
|
|
41
14
|
describe("vue: index", function () {
|
|
42
15
|
it("can set up sdk in app and then inject the sdk instance", function () {
|
|
43
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
attributes: [],
|
|
72
|
-
segments: [],
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
TestComponent = {
|
|
76
|
-
inject: [PROVIDER_NAME],
|
|
77
|
-
data: function () {
|
|
78
|
-
var revision = this[PROVIDER_NAME].getRevision();
|
|
79
|
-
return {
|
|
80
|
-
revision: revision,
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
template: "<div>\n <p data-test=\"p\">TestComponent here</p>\n <p data-test=\"revision\">{{ revision }}</p>\n </div>",
|
|
84
|
-
};
|
|
85
|
-
App = {
|
|
86
|
-
components: { TestComponent: TestComponent },
|
|
87
|
-
template: "<div><TestComponent /></div>",
|
|
88
|
-
provide: (_a = {},
|
|
89
|
-
_a[PROVIDER_NAME] = sdk,
|
|
90
|
-
_a),
|
|
91
|
-
};
|
|
92
|
-
app = createApp(App);
|
|
93
|
-
setupApp(app, sdk);
|
|
94
|
-
wrapper = mount(App);
|
|
95
|
-
expect(wrapper.exists()).toEqual(true);
|
|
96
|
-
return [4 /*yield*/, wrapper.get("[data-test=\"p\"]").text()];
|
|
97
|
-
case 1:
|
|
98
|
-
pText = _b.sent();
|
|
99
|
-
expect(pText).toEqual("TestComponent here");
|
|
100
|
-
return [4 /*yield*/, wrapper.get("[data-test=\"revision\"]").text()];
|
|
101
|
-
case 2:
|
|
102
|
-
revisionText = _b.sent();
|
|
103
|
-
expect(revisionText).toEqual("1.0");
|
|
104
|
-
return [2 /*return*/];
|
|
105
|
-
}
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const sdk = createInstance({
|
|
18
|
+
datafile: {
|
|
19
|
+
schemaVersion: "1",
|
|
20
|
+
revision: "1.0",
|
|
21
|
+
features: [
|
|
22
|
+
{
|
|
23
|
+
key: "test",
|
|
24
|
+
bucketBy: "userId",
|
|
25
|
+
variations: [{ value: "control" }, { value: "treatment" }],
|
|
26
|
+
traffic: [
|
|
27
|
+
{
|
|
28
|
+
key: "1",
|
|
29
|
+
segments: "*",
|
|
30
|
+
percentage: 100000,
|
|
31
|
+
allocation: [
|
|
32
|
+
{ variation: "control", range: [0, 100000] },
|
|
33
|
+
{ variation: "treatment", range: [0, 0] },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
attributes: [],
|
|
40
|
+
segments: [],
|
|
41
|
+
},
|
|
106
42
|
});
|
|
43
|
+
const TestComponent = {
|
|
44
|
+
inject: [PROVIDER_NAME],
|
|
45
|
+
data: function () {
|
|
46
|
+
const revision = this[PROVIDER_NAME].getRevision();
|
|
47
|
+
return {
|
|
48
|
+
revision,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
template: `<div>
|
|
52
|
+
<p data-test="p">TestComponent here</p>
|
|
53
|
+
<p data-test="revision">{{ revision }}</p>
|
|
54
|
+
</div>`,
|
|
55
|
+
};
|
|
56
|
+
const App = {
|
|
57
|
+
components: { TestComponent },
|
|
58
|
+
template: `<div><TestComponent /></div>`,
|
|
59
|
+
provide: {
|
|
60
|
+
[PROVIDER_NAME]: sdk,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
const app = createApp(App);
|
|
64
|
+
setupApp(app, sdk);
|
|
65
|
+
const wrapper = mount(App);
|
|
66
|
+
expect(wrapper.exists()).toEqual(true);
|
|
67
|
+
const pText = yield wrapper.get(`[data-test="p"]`).text();
|
|
68
|
+
expect(pText).toEqual("TestComponent here");
|
|
69
|
+
const revisionText = yield wrapper.get(`[data-test="revision"]`).text();
|
|
70
|
+
expect(revisionText).toEqual("1.0");
|
|
107
71
|
});
|
|
108
72
|
});
|
|
109
73
|
// @TODO: add more tests that utilizes Composition API
|
package/lib/index.spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErD,QAAQ,CAAC,YAAY,EAAE;IACrB,EAAE,CAAC,wDAAwD,EAAE;;YAC3D,MAAM,GAAG,GAAG,cAAc,CAAC;gBACzB,QAAQ,EAAE;oBACR,aAAa,EAAE,GAAG;oBAClB,QAAQ,EAAE,KAAK;oBACf,QAAQ,EAAE;wBACR;4BACE,GAAG,EAAE,MAAM;4BACX,QAAQ,EAAE,QAAQ;4BAClB,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;4BAC1D,OAAO,EAAE;gCACP;oCACE,GAAG,EAAE,GAAG;oCACR,QAAQ,EAAE,GAAG;oCACb,UAAU,EAAE,MAAM;oCAClB,UAAU,EAAE;wCACV,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE;wCAC5C,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;qCAC1C;iCACF;6BACF;yBACF;qBACF;oBACD,UAAU,EAAE,EAAE;oBACd,QAAQ,EAAE,EAAE;iBACb;aACF,CAAC,CAAC;YAEH,MAAM,aAAa,GAAG;gBACpB,MAAM,EAAE,CAAC,aAAa,CAAC;gBACvB,IAAI,EAAE;oBACJ,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,CAAC;oBAEnD,OAAO;wBACL,QAAQ;qBACT,CAAC;gBACJ,CAAC;gBACD,QAAQ,EAAE;;;aAGH;aACR,CAAC;YAEF,MAAM,GAAG,GAAG;gBACV,UAAU,EAAE,EAAE,aAAa,EAAE;gBAC7B,QAAQ,EAAE,8BAA8B;gBACxC,OAAO,EAAE;oBACP,CAAC,aAAa,CAAC,EAAE,GAAG;iBACrB;aACF,CAAC;YAEF,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;YAC3B,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAEnB,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3B,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAEvC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1D,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;YAE5C,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,IAAI,EAAE,CAAC;YACxE,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC;KAAA,CAAC,CAAC;IAEH,sDAAsD;AACxD,CAAC,CAAC,CAAC"}
|
package/lib/setupApp.js
CHANGED
package/lib/setupApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupApp.js","sourceRoot":"","sources":["../src/setupApp.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"setupApp.js","sourceRoot":"","sources":["../src/setupApp.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC;AAE5C,MAAM,UAAU,QAAQ,CAAC,GAAQ,EAAE,GAAyB;IAC1D,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC"}
|
package/lib/useFlag.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useSdk } from "./useSdk";
|
|
2
|
-
export function useFlag(featureKey, context) {
|
|
3
|
-
|
|
4
|
-
var sdk = useSdk();
|
|
2
|
+
export function useFlag(featureKey, context = {}) {
|
|
3
|
+
const sdk = useSdk();
|
|
5
4
|
return sdk.isEnabled(featureKey, context);
|
|
6
5
|
}
|
|
7
6
|
//# sourceMappingURL=useFlag.js.map
|
package/lib/useFlag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFlag.js","sourceRoot":"","sources":["../src/useFlag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,UAAU,OAAO,CAAC,UAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"useFlag.js","sourceRoot":"","sources":["../src/useFlag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,UAAU,OAAO,CAAC,UAAsB,EAAE,UAAmB,EAAE;IACnE,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,OAAO,GAAG,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC"}
|
package/lib/useSdk.js
CHANGED
package/lib/useSdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSdk.js","sourceRoot":"","sources":["../src/useSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,UAAU,MAAM;IACpB,
|
|
1
|
+
{"version":3,"file":"useSdk.js","sourceRoot":"","sources":["../src/useSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,UAAU,MAAM;IACpB,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAyB,CAAC;IAE1D,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/lib/useStatus.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { readonly, ref } from "vue";
|
|
2
2
|
import { useSdk } from "./useSdk";
|
|
3
3
|
export function useStatus() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const sdk = useSdk();
|
|
5
|
+
const initialStatus = sdk.isReady();
|
|
6
|
+
const result = ref({
|
|
7
7
|
isReady: initialStatus,
|
|
8
8
|
});
|
|
9
9
|
if (initialStatus) {
|
|
10
10
|
return result;
|
|
11
11
|
}
|
|
12
|
-
sdk.on("ready",
|
|
12
|
+
sdk.on("ready", () => {
|
|
13
13
|
result.value.isReady = true;
|
|
14
14
|
});
|
|
15
15
|
return readonly(result);
|
package/lib/useStatus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStatus.js","sourceRoot":"","sources":["../src/useStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAMlC,MAAM,UAAU,SAAS;IACvB,
|
|
1
|
+
{"version":3,"file":"useStatus.js","sourceRoot":"","sources":["../src/useStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAMlC,MAAM,UAAU,SAAS;IACvB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IAEpC,MAAM,MAAM,GAAG,GAAG,CAAC;QACjB,OAAO,EAAE,aAAa;KACvB,CAAC,CAAC;IAEH,IAAI,aAAa,EAAE;QACjB,OAAO,MAAM,CAAC;KACf;IAED,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACnB,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC"}
|
package/lib/useVariable.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useSdk } from "./useSdk";
|
|
2
|
-
export function useVariable(featureKey, variableKey, context) {
|
|
3
|
-
|
|
4
|
-
var sdk = useSdk();
|
|
2
|
+
export function useVariable(featureKey, variableKey, context = {}) {
|
|
3
|
+
const sdk = useSdk();
|
|
5
4
|
return sdk.getVariable(featureKey, variableKey, context);
|
|
6
5
|
}
|
|
7
6
|
//# sourceMappingURL=useVariable.js.map
|
package/lib/useVariable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVariable.js","sourceRoot":"","sources":["../src/useVariable.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,UAAU,WAAW,CACzB,UAAsB,EACtB,WAAwB,EACxB,
|
|
1
|
+
{"version":3,"file":"useVariable.js","sourceRoot":"","sources":["../src/useVariable.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,UAAU,WAAW,CACzB,UAAsB,EACtB,WAAwB,EACxB,UAAmB,EAAE;IAErB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,OAAO,GAAG,CAAC,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC"}
|
package/lib/useVariation.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useSdk } from "./useSdk";
|
|
2
|
-
export function useVariation(featureKey, context) {
|
|
3
|
-
|
|
4
|
-
var sdk = useSdk();
|
|
2
|
+
export function useVariation(featureKey, context = {}) {
|
|
3
|
+
const sdk = useSdk();
|
|
5
4
|
return sdk.getVariation(featureKey, context);
|
|
6
5
|
}
|
|
7
6
|
//# sourceMappingURL=useVariation.js.map
|
package/lib/useVariation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVariation.js","sourceRoot":"","sources":["../src/useVariation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,UAAU,YAAY,CAC1B,UAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"useVariation.js","sourceRoot":"","sources":["../src/useVariation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,UAAU,YAAY,CAC1B,UAAsB,EACtB,UAAmB,EAAE;IAErB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,OAAO,GAAG,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@featurevisor/vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.4",
|
|
4
4
|
"description": "Vue.js package for Featurevisor",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"url": "https://github.com/featurevisor/featurevisor/issues"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@featurevisor/sdk": "^1.
|
|
48
|
+
"@featurevisor/sdk": "^1.27.4",
|
|
49
49
|
"@featurevisor/types": "^1.3.0",
|
|
50
50
|
"vue": "^3.3.4"
|
|
51
51
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"@vue/cli-plugin-unit-jest": "^5.0.8",
|
|
55
55
|
"@vue/test-utils": "^2.4.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "d50199428b4315f96a07b2b5e789d944c8dc4260"
|
|
58
58
|
}
|