@avsbhq/vue 1.0.2 → 1.1.1

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.
@@ -0,0 +1,34 @@
1
+ import { AvsbClientOptions } from '@avsbhq/browser';
2
+ import { EvalContext, FlagDatafile } from '@avsbhq/core';
3
+ import { V as VueAvsbClient } from './clientInterface-BMlQ7Uhe.cjs';
4
+
5
+ /**
6
+ * - `'loading'`: the first datafile has not arrived and nothing is cached.
7
+ * - `'ready'`: flags are readable. Also the state of a DEGRADED client
8
+ * (serving a cached datafile after a failed refresh): flags work, they
9
+ * may be stale, and `error` says why.
10
+ * - `'error'`: nothing could be loaded. Every flag returns the default you
11
+ * pass, and `error.message` names the status, the URL, and the fix.
12
+ */
13
+ type AvsbStatus = 'loading' | 'ready' | 'error';
14
+ /** Every `AvsbClientOptions` field except the ones with their own prop. */
15
+ type AvsbProviderOptions = Omit<AvsbClientOptions, 'sdkKey' | 'context' | 'bootstrap'>;
16
+ interface AvsbProviderModeAProps {
17
+ /** SDK key for the environment you are targeting. Required in Mode A. */
18
+ sdkKey: string;
19
+ /** Evaluation context. Omit for an anonymous, persisted visitor id. */
20
+ context?: EvalContext;
21
+ /** A datafile fetched on the server, so the first paint has real values. */
22
+ bootstrap?: FlagDatafile;
23
+ /** Everything else `AvsbClient` accepts (polling, logging, caching). */
24
+ options?: AvsbProviderOptions;
25
+ client?: never;
26
+ }
27
+ interface AvsbProviderModeBProps {
28
+ /** A client you built and own. The provider will not close it. */
29
+ client: VueAvsbClient;
30
+ sdkKey?: never;
31
+ }
32
+ type AvsbProviderProps = AvsbProviderModeAProps | AvsbProviderModeBProps;
33
+
34
+ export type { AvsbProviderModeAProps as A, AvsbProviderModeBProps as a, AvsbProviderOptions as b, AvsbProviderProps as c, AvsbStatus as d };
@@ -0,0 +1,34 @@
1
+ import { AvsbClientOptions } from '@avsbhq/browser';
2
+ import { EvalContext, FlagDatafile } from '@avsbhq/core';
3
+ import { V as VueAvsbClient } from './clientInterface-BMlQ7Uhe.js';
4
+
5
+ /**
6
+ * - `'loading'`: the first datafile has not arrived and nothing is cached.
7
+ * - `'ready'`: flags are readable. Also the state of a DEGRADED client
8
+ * (serving a cached datafile after a failed refresh): flags work, they
9
+ * may be stale, and `error` says why.
10
+ * - `'error'`: nothing could be loaded. Every flag returns the default you
11
+ * pass, and `error.message` names the status, the URL, and the fix.
12
+ */
13
+ type AvsbStatus = 'loading' | 'ready' | 'error';
14
+ /** Every `AvsbClientOptions` field except the ones with their own prop. */
15
+ type AvsbProviderOptions = Omit<AvsbClientOptions, 'sdkKey' | 'context' | 'bootstrap'>;
16
+ interface AvsbProviderModeAProps {
17
+ /** SDK key for the environment you are targeting. Required in Mode A. */
18
+ sdkKey: string;
19
+ /** Evaluation context. Omit for an anonymous, persisted visitor id. */
20
+ context?: EvalContext;
21
+ /** A datafile fetched on the server, so the first paint has real values. */
22
+ bootstrap?: FlagDatafile;
23
+ /** Everything else `AvsbClient` accepts (polling, logging, caching). */
24
+ options?: AvsbProviderOptions;
25
+ client?: never;
26
+ }
27
+ interface AvsbProviderModeBProps {
28
+ /** A client you built and own. The provider will not close it. */
29
+ client: VueAvsbClient;
30
+ sdkKey?: never;
31
+ }
32
+ type AvsbProviderProps = AvsbProviderModeAProps | AvsbProviderModeBProps;
33
+
34
+ export type { AvsbProviderModeAProps as A, AvsbProviderModeBProps as a, AvsbProviderOptions as b, AvsbProviderProps as c, AvsbStatus as d };
package/package.json CHANGED
@@ -1,34 +1,70 @@
1
1
  {
2
2
  "name": "@avsbhq/vue",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
+ "description": "Vue SDK for A vs B feature flags and experiments: composables, a provider component, an optional Pinia store, and test helpers.",
5
+ "keywords": [
6
+ "avsb",
7
+ "feature-flags",
8
+ "ab-testing",
9
+ "experiments",
10
+ "vue",
11
+ "composables",
12
+ "pinia",
13
+ "sdk"
14
+ ],
15
+ "license": "MIT",
4
16
  "type": "module",
17
+ "sideEffects": false,
5
18
  "main": "dist/index.cjs",
6
19
  "module": "dist/index.js",
7
20
  "types": "dist/index.d.ts",
8
21
  "exports": {
9
22
  ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.cjs"
13
- }
23
+ "import": {
24
+ "types": "./dist/index.d.ts",
25
+ "default": "./dist/index.js"
26
+ },
27
+ "require": {
28
+ "types": "./dist/index.d.cts",
29
+ "default": "./dist/index.cjs"
30
+ }
31
+ },
32
+ "./pinia": {
33
+ "import": {
34
+ "types": "./dist/pinia.d.ts",
35
+ "default": "./dist/pinia.js"
36
+ },
37
+ "require": {
38
+ "types": "./dist/pinia.d.cts",
39
+ "default": "./dist/pinia.cjs"
40
+ }
41
+ },
42
+ "./testing": {
43
+ "import": {
44
+ "types": "./dist/testing.d.ts",
45
+ "default": "./dist/testing.js"
46
+ },
47
+ "require": {
48
+ "types": "./dist/testing.d.cts",
49
+ "default": "./dist/testing.cjs"
50
+ }
51
+ },
52
+ "./package.json": "./package.json"
53
+ },
54
+ "files": [
55
+ "dist"
56
+ ],
57
+ "publishConfig": {
58
+ "access": "public"
14
59
  },
15
- "files": ["dist"],
16
- "publishConfig": { "access": "public" },
17
60
  "repository": {
18
61
  "type": "git",
19
- "url": "git+https://github.com/main1479/a-vs-b.git",
62
+ "url": "git+https://github.com/avsbhq/a-vs-b.git",
20
63
  "directory": "packages/avsb-vue"
21
64
  },
22
- "homepage": "https://github.com/main1479/a-vs-b/tree/main/packages/avsb-vue#readme",
23
- "peerDependencies": {
24
- "vue": ">=3.4.0"
25
- },
26
- "peerDependenciesMeta": {
27
- "pinia": { "optional": true }
28
- },
29
- "dependencies": {
30
- "@avsbhq/core": "1.4.0",
31
- "@avsbhq/browser": "1.3.1"
65
+ "homepage": "https://github.com/avsbhq/a-vs-b/tree/main/packages/avsb-vue#readme",
66
+ "bugs": {
67
+ "url": "https://github.com/avsbhq/a-vs-b/issues"
32
68
  },
33
69
  "scripts": {
34
70
  "build": "tsup",
@@ -36,14 +72,28 @@
36
72
  "test": "vitest run",
37
73
  "typecheck": "tsc --noEmit"
38
74
  },
75
+ "peerDependencies": {
76
+ "pinia": ">=2.1.0",
77
+ "vue": ">=3.4.0"
78
+ },
79
+ "peerDependenciesMeta": {
80
+ "pinia": {
81
+ "optional": true
82
+ }
83
+ },
84
+ "dependencies": {
85
+ "@avsbhq/browser": "^1.3.1",
86
+ "@avsbhq/core": "^1.4.0"
87
+ },
39
88
  "devDependencies": {
89
+ "@avsbhq/test": "^1.0.1",
40
90
  "@vitejs/plugin-vue": "^5.0.0",
41
91
  "@vue/test-utils": "^2.4.0",
42
92
  "happy-dom": "^14.0.0",
43
93
  "pinia": "^2.1.0",
44
94
  "tsup": "^8.0.0",
45
95
  "typescript": "^5.5.0",
46
- "vitest": "^1.6.0",
96
+ "vitest": "^4.1.4",
47
97
  "vue": "^3.4.0"
48
98
  }
49
99
  }