@picked/vite-plugin-picked 0.0.75 → 0.0.76-next.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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +15 -16
- package/dist/esm/index.js +162 -148
- package/dist/types/launcher.d.ts +8 -0
- package/dist/types/launcher.d.ts.map +1 -1
- package/dist/types/util.d.ts +19 -3
- package/dist/types/util.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/types/launcher.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
/** @file Dev launcher page: lists the project's feature flags and previews an experience. */
|
|
2
2
|
import type { ProjectConfigFeature } from '@picked/delivery-api-client';
|
|
3
|
+
/**
|
|
4
|
+
* Renders the dev launcher page: a URL box, the project's feature flags with an
|
|
5
|
+
* override picker each, and the script that assembles them into a preview URL.
|
|
6
|
+
*
|
|
7
|
+
* @param {ReadonlyArray<ProjectConfigFeature>} features - The project's features, in wire order.
|
|
8
|
+
* @returns {string} The complete HTML document.
|
|
9
|
+
* @example getLauncherHtml(config.features)
|
|
10
|
+
*/
|
|
3
11
|
export declare function getLauncherHtml(features: ReadonlyArray<ProjectConfigFeature>): string;
|
|
4
12
|
//# sourceMappingURL=launcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../../src/launcher.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../../src/launcher.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAkDvE;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAgcrF"}
|
package/dist/types/util.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Shared utilities for the Picked Vite plugin
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* @file Shared utilities for the Picked Vite plugin: a defensive helper for API
|
|
3
|
+
* entity arrays that may be omitted at runtime despite being typed as required,
|
|
4
|
+
* and the console rendering of a feature's traffic split.
|
|
5
5
|
*/
|
|
6
|
+
import type { ProjectConfigFeature } from '@picked/delivery-api-client';
|
|
6
7
|
/**
|
|
7
8
|
* Safely coerce a value to an array, returning an empty array for nullish inputs.
|
|
8
9
|
* Needed because the API response may omit entity arrays at runtime even though
|
|
@@ -15,4 +16,19 @@
|
|
|
15
16
|
* toArray(undefined) // []
|
|
16
17
|
*/
|
|
17
18
|
export declare function toArray<T>(value: ReadonlyArray<T> | null | undefined): ReadonlyArray<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Renders a feature's traffic split for the dev-server console.
|
|
21
|
+
*
|
|
22
|
+
* A boolean feature reports `weight`, which is already a percentage. A text feature
|
|
23
|
+
* reports each arm against the total of the arms, since an arm's `weight` is a share
|
|
24
|
+
* relative to its siblings: `1` against `1, 2` is a quarter of the traffic.
|
|
25
|
+
*
|
|
26
|
+
* A feature whose arms are absent or all weigh zero reports its own weight.
|
|
27
|
+
*
|
|
28
|
+
* @param {ProjectConfigFeature} feature - The feature to describe.
|
|
29
|
+
* @returns {string} The split, as a percentage or a comma-separated list of arms.
|
|
30
|
+
* @example
|
|
31
|
+
* formatFeatureSplit({ valueType: 'text', variants: [{ key: 'a', value: 'a', weight: 1 }] })
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatFeatureSplit(feature: ProjectConfigFeature): string;
|
|
18
34
|
//# sourceMappingURL=util.d.ts.map
|
package/dist/types/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAEvE;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,CAEvF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAcxE"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/vite-plugin-picked",
|
|
3
3
|
"description": "Vite plugin for build-time config injection",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.76-next.1",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@picked/client": "0.0.
|
|
7
|
-
"@picked/config": "0.0.
|
|
8
|
-
"@picked/delivery-api-client": "0.0.
|
|
9
|
-
"@picked/typegen": "0.0.
|
|
6
|
+
"@picked/client": "0.0.76-next.1",
|
|
7
|
+
"@picked/config": "0.0.76-next.1",
|
|
8
|
+
"@picked/delivery-api-client": "0.0.76-next.1",
|
|
9
|
+
"@picked/typegen": "0.0.76-next.1"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@repo/eslint-config": "workspace:*",
|