Skip to content

Commit 4b39a74

Browse files
committed
update
1 parent d60559d commit 4b39a74

File tree

3 files changed

+43
-23
lines changed

3 files changed

+43
-23
lines changed

.github/workflows/javascript.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
npm install
2727
npm run lint
2828
29-
ts-check:
29+
typescript_check:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- uses: actions/checkout@v3

scripts/run-ts-example.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
#!/usr/bin/env node
22

33
/**
4-
* Script to build the SDK and run the TypeScript example
4+
* Copyright 2025, Optimizely
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
517
*/
618

719
const { execSync, spawn } = require('child_process');
@@ -72,26 +84,20 @@ async function cleanup() {
7284
async function main() {
7385
console.log('=== Building SDK and Running TypeScript Example ===\n');
7486

75-
// Step 1: Build the SDK
7687
console.log('Step 1: Building SDK...');
7788
run('npm run build', rootDir);
7889

79-
// Step 2: Install dependencies for ts-example
8090
console.log('\nStep 2: Installing ts-example dependencies...');
8191
run('npm install', exampleDir);
8292

83-
// Step 3: Build the ts-example
8493
console.log('\nStep 3: Building ts-example...');
8594
run('npm run build', exampleDir);
8695

87-
// Step 4: Start the datafile server
8896
await startDatafileServer();
8997

90-
// Step 5: Run the ts-example
9198
console.log('\nStep 4: Running ts-example...');
9299
run('npm start', exampleDir);
93100

94-
// Cleanup and exit
95101
await cleanup();
96102
console.log('\n=== Example completed successfully! ===\n');
97103
}

ts-example/src/index.ts

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,51 @@
1+
/**
2+
* Copyright 2025, Optimizely
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
import {
2-
createInstance,
3-
createStaticProjectConfigManager,
4-
createPollingProjectConfigManager,
5-
createForwardingEventProcessor,
617
createBatchEventProcessor,
18+
createErrorNotifier,
19+
createForwardingEventProcessor,
20+
createInstance,
21+
createLogger,
722
createOdpManager,
23+
createPollingProjectConfigManager,
24+
createStaticProjectConfigManager,
825
createVuidManager,
9-
createLogger,
10-
createErrorNotifier,
11-
getSendBeaconEventDispatcher,
1226
eventDispatcher,
1327
INFO,
1428
NOTIFICATION_TYPES,
1529
type Client,
1630
type Config,
31+
type DecisionNotificationPayload,
32+
type ErrorHandler,
33+
type EventDispatcher,
34+
type LogHandler,
1735
type OpaqueConfigManager,
36+
type OpaqueErrorNotifier,
1837
type OpaqueEventProcessor,
38+
type OpaqueLogger,
1939
type OpaqueOdpManager,
2040
type OpaqueVuidManager,
21-
type OpaqueLogger,
22-
type OpaqueErrorNotifier,
23-
type EventDispatcher,
2441
type OptimizelyDecision,
2542
type OptimizelyUserContext,
26-
type DecisionNotificationPayload,
27-
type UserAttributes,
28-
type ErrorHandler,
29-
type LogHandler,
43+
type UserAttributes
3044
} from '@optimizely/optimizely-sdk';
3145
import * as fs from 'fs';
3246
import * as path from 'path';
33-
import { fileURLToPath } from 'url';
3447
import { dirname } from 'path';
48+
import { fileURLToPath } from 'url';
3549

3650
const __filename: string = fileURLToPath(import.meta.url);
3751
const __dirname: string = dirname(__filename);

0 commit comments

Comments
 (0)