Skip to content

Commit 5b8af87

Browse files
authored
Generate separate (vs. inline) source map files (#78)
* include typescript with source maps * bump common version * don't use inline maps * anticipate correct version for common repo * install updated common with yarn * include ts in dist after all * include typescript source * use the released common repo * specify exact version of common repo * update yarn.lock
1 parent 025f80d commit 5b8af87

10 files changed

+28
-23
lines changed

docs/js-client-sdk.chromestorageengine._constructor_.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ Constructs a new instance of the `ChromeStorageEngine` class
99
**Signature:**
1010

1111
```typescript
12-
constructor(storageArea: chrome.storage.StorageArea);
12+
constructor(storageArea: chrome.storage.StorageArea, storageKeySuffix: string);
1313
```
1414

1515
## Parameters
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
1919
| storageArea | chrome.storage.StorageArea | |
20+
| storageKeySuffix | string | |
2021

docs/js-client-sdk.chromestorageengine.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Chrome storage implementation of a string-valued store for storing a configurati
88

99
This serializes the entire configuration object into a string and then stores it to a single key within the object for another single top-level key. Same with metadata about the store (e.g., when it was last updated).
1010

11+
Note: this behaves a bit differently than local storage as the chrome storage API gets and sets subsets of key-value pairs, so we have to dereference or re-specify the key.
12+
1113
**Signature:**
1214

1315
```typescript
@@ -19,7 +21,7 @@ export declare class ChromeStorageEngine implements IStringStorageEngine
1921
2022
| Constructor | Modifiers | Description |
2123
| --- | --- | --- |
22-
| [(constructor)(storageArea)](./js-client-sdk.chromestorageengine._constructor_.md) | | Constructs a new instance of the <code>ChromeStorageEngine</code> class |
24+
| [(constructor)(storageArea, storageKeySuffix)](./js-client-sdk.chromestorageengine._constructor_.md) | | Constructs a new instance of the <code>ChromeStorageEngine</code> class |
2325
2426
## Properties
2527

docs/js-client-sdk.eppojsclient.getbooleanassignment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
**Signature:**
88

99
```typescript
10-
getBooleanAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, any>, defaultValue: boolean): boolean;
10+
getBooleanAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: boolean): boolean;
1111
```
1212

1313
## Parameters
@@ -16,7 +16,7 @@ getBooleanAssignment(flagKey: string, subjectKey: string, subjectAttributes: Rec
1616
| --- | --- | --- |
1717
| flagKey | string | |
1818
| subjectKey | string | |
19-
| subjectAttributes | Record&lt;string, any&gt; | |
19+
| subjectAttributes | Record&lt;string, AttributeType&gt; | |
2020
| defaultValue | boolean | |
2121

2222
**Returns:**

docs/js-client-sdk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
| Class | Description |
1010
| --- | --- |
11-
| [ChromeStorageEngine](./js-client-sdk.chromestorageengine.md) | <p>Chrome storage implementation of a string-valued store for storing a configuration and its metadata.</p><p>This serializes the entire configuration object into a string and then stores it to a single key within the object for another single top-level key. Same with metadata about the store (e.g., when it was last updated).</p> |
11+
| [ChromeStorageEngine](./js-client-sdk.chromestorageengine.md) | <p>Chrome storage implementation of a string-valued store for storing a configuration and its metadata.</p><p>This serializes the entire configuration object into a string and then stores it to a single key within the object for another single top-level key. Same with metadata about the store (e.g., when it was last updated).</p><p>Note: this behaves a bit differently than local storage as the chrome storage API gets and sets subsets of key-value pairs, so we have to dereference or re-specify the key.</p> |
1212
| [EppoJSClient](./js-client-sdk.eppojsclient.md) | Client for assigning experiment variations. |
1313

1414
## Functions

js-client-sdk.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { IEppoClient } from '@eppo/js-client-sdk-common';
1818
//
1919
// @public
2020
export class ChromeStorageEngine implements IStringStorageEngine {
21-
constructor(storageArea: chrome.storage.StorageArea);
21+
constructor(storageArea: chrome.storage.StorageArea, storageKeySuffix: string);
2222
// (undocumented)
2323
getContentsJsonString: () => Promise<string | null>;
2424
// (undocumented)
@@ -34,7 +34,7 @@ export class EppoJSClient extends EppoClient {
3434
// @deprecated (undocumented)
3535
getBoolAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: boolean): boolean;
3636
// (undocumented)
37-
getBooleanAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, any>, defaultValue: boolean): boolean;
37+
getBooleanAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: boolean): boolean;
3838
// (undocumented)
3939
getIntegerAssignment(flagKey: string, subjectKey: string, subjectAttributes: Record<string, AttributeType>, defaultValue: number): number;
4040
// (undocumented)

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "@eppo/js-client-sdk",
3-
"version": "3.1.1",
3+
"version": "3.1.2",
44
"description": "Eppo SDK for client-side JavaScript applications",
55
"main": "dist/index.js",
66
"files": [
7-
"/dist"
7+
"/dist",
8+
"/src",
9+
"!*.spec.ts"
810
],
911
"typings": "dist/js-client-sdk.d.ts",
1012
"scripts": {
@@ -57,6 +59,6 @@
5759
"webpack-cli": "^4.10.0"
5860
},
5961
"dependencies": {
60-
"@eppo/js-client-sdk-common": "3.1.0"
62+
"@eppo/js-client-sdk-common": "3.2.2"
6163
}
6264
}

src/index.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
IAsyncStore,
1313
} from '@eppo/js-client-sdk-common';
1414
import * as td from 'testdouble';
15-
import { encode } from 'universal-base64';
1615

1716
const { POLL_INTERVAL_MS, POLL_JITTER_PCT } = constants;
1817

@@ -219,7 +218,7 @@ describe('EppoJSClient E2E test', () => {
219218
{
220219
attribute: md5Hash('appVersion'),
221220
operator: md5Hash('GT'),
222-
value: encode('10'),
221+
value: base64Encode('10'),
223222
},
224223
],
225224
},

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class EppoJSClient extends EppoClient {
157157
public getBooleanAssignment(
158158
flagKey: string,
159159
subjectKey: string,
160-
subjectAttributes: Record<string, any>,
160+
subjectAttributes: Record<string, AttributeType>,
161161
defaultValue: boolean,
162162
): boolean {
163163
EppoJSClient.getAssignmentInitializationCheck();

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
const path = require('path');
23

34
const TerserPlugin = require('terser-webpack-plugin');

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -380,15 +380,15 @@
380380
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
381381
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==
382382

383-
"@eppo/js-client-sdk-common@3.1.0":
384-
version "3.1.0"
385-
resolved "https://registry.yarnpkg.com/@eppo/js-client-sdk-common/-/js-client-sdk-common-3.1.0.tgz#3958fa591d8e5b4026b1e58de86eb9865a2751e7"
386-
integrity sha512-r/zHyE60QlIBEq91o/0PQud0fbLKqN1s8FDvN9OWjYEJx8XAUyYAx+rivAGycxwqU76TV1y8EUCOMFYvAVR1Jg==
383+
"@eppo/js-client-sdk-common@3.2.2":
384+
version "3.2.2"
385+
resolved "https://registry.yarnpkg.com/@eppo/js-client-sdk-common/-/js-client-sdk-common-3.2.2.tgz#70693343feaf4e5b9c7fefe5108ab6d8b5318d8f"
386+
integrity sha512-cCqgvwVcaa0L7PJ1KrOoedfTQiJzVYv+u0o35lyiBBPhTxGgNpgAjiKwrnugh8OcEzh+63185SHCyBP9a5MU+g==
387387
dependencies:
388+
js-base64 "^3.7.7"
388389
md5 "^2.3.0"
389390
pino "^8.19.0"
390391
semver "^7.5.4"
391-
universal-base64 "^2.1.0"
392392

393393
"@eslint/eslintrc@^1.3.0":
394394
version "1.3.0"
@@ -3293,6 +3293,11 @@ jju@~1.4.0:
32933293
resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a"
32943294
integrity sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==
32953295

3296+
js-base64@^3.7.7:
3297+
version "3.7.7"
3298+
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79"
3299+
integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==
3300+
32963301
js-tokens@^4.0.0:
32973302
version "4.0.0"
32983303
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -4671,11 +4676,6 @@ unbox-primitive@^1.0.2:
46714676
has-symbols "^1.0.3"
46724677
which-boxed-primitive "^1.0.2"
46734678

4674-
universal-base64@^2.1.0:
4675-
version "2.1.0"
4676-
resolved "https://registry.yarnpkg.com/universal-base64/-/universal-base64-2.1.0.tgz#511af92b3a07340fc2647036045aadb3bedcc320"
4677-
integrity sha512-WeOkACVnIXJZr/qlv7++Rl1zuZOHN96v2yS5oleUuv8eJOs5j9M5U3xQEIoWqn1OzIuIcgw0fswxWnUVGDfW6g==
4678-
46794679
universalify@^0.1.0:
46804680
version "0.1.2"
46814681
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"

0 commit comments

Comments
 (0)