Skip to content

Commit ea45a88

Browse files
authored
feat(events): Use new event dispatcher API (#77)
* feat(events): Use new event dispatcher API * add tests for splice * fix tests * fix tests * Add test matrix
1 parent 1900fb8 commit ea45a88

25 files changed

+509
-353
lines changed

.github/workflows/lint-test-sdk.yml

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,29 @@ on:
1919
type: string
2020
description: The branch of the SDK to test
2121
required: false
22-
22+
2323
jobs:
2424
lint-test-sdk:
2525
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
node-version: [ '18', '20', '22', '23' ]
2629
steps:
27-
- uses: actions/checkout@v2
28-
with:
29-
repository: Eppo-exp/node-server-sdk
30-
ref: ${{ env.SDK_BRANCH_NAME }}
30+
- uses: actions/checkout@v3
3131
- name: Use Node.js
32-
uses: actions/setup-node@v1
32+
uses: actions/setup-node@v3
3333
with:
34-
node-version: '18.x'
35-
- uses: actions/cache@v2
34+
node-version: ${{ matrix.node-version }}
35+
- name: Get yarn cache directory path
36+
id: yarn-cache-dir-path
37+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
38+
- uses: actions/cache@v4
39+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
3640
with:
37-
path: './node_modules'
38-
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }}
41+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
42+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
43+
restore-keys: |
44+
${{ runner.os }}-yarn-
3945
- name: Install root dependencies
4046
run: yarn --frozen-lockfile
4147
working-directory: ./
@@ -50,19 +56,25 @@ jobs:
5056
working-directory: ./
5157
typecheck:
5258
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
node-version: [ '18', '20', '22', '23' ]
5362
steps:
54-
- uses: actions/checkout@v2
55-
with:
56-
repository: Eppo-exp/node-server-sdk
57-
ref: ${{ env.SDK_BRANCH_NAME }}
63+
- uses: actions/checkout@v3
5864
- name: Use Node.js
59-
uses: actions/setup-node@v1
65+
uses: actions/setup-node@v3
6066
with:
61-
node-version: '18.x'
62-
- uses: actions/cache@v2
67+
node-version: ${{ matrix.node-version }}
68+
- name: Get yarn cache directory path
69+
id: yarn-cache-dir-path
70+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
71+
- uses: actions/cache@v4
72+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
6373
with:
64-
path: './node_modules'
65-
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }}
74+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
75+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
76+
restore-keys: |
77+
${{ runner.os }}-yarn-
6678
- name: Install root dependencies
6779
run: yarn --frozen-lockfile
6880
working-directory: ./

docs/node-server-sdk.getinstance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export declare function getInstance(): EppoClient;
1515

1616
EppoClient
1717

18-
a singleton client instance
18+
a singleton client instance or throws an Error if init() has not been called
1919

docs/node-server-sdk.iclientconfig.apikey.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/node-server-sdk.iclientconfig.assignmentlogger.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/node-server-sdk.iclientconfig.banditlogger.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/node-server-sdk.iclientconfig.baseurl.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/node-server-sdk.iclientconfig.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/node-server-sdk.iclientconfig.numinitialrequestretries.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/node-server-sdk.iclientconfig.numpollrequestretries.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/node-server-sdk.iclientconfig.pollafterfailedinitialization.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)