Skip to content

Commit 7c63dbe

Browse files
committed
chore: bump node
1 parent cbe5068 commit 7c63dbe

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- uses: actions/setup-node@v4
2323
with:
24-
node-version: "18"
24+
node-version: "20"
2525
cache: "npm"
2626
registry-url: "https://registry.npmjs.org"
2727

@@ -66,7 +66,7 @@ jobs:
6666

6767
- uses: actions/setup-node@v4
6868
with:
69-
node-version: "18"
69+
node-version: "20"
7070
registry-url: "https://registry.npmjs.org"
7171
cache: "npm"
7272

.github/workflows/test-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: "18"
20+
node-version: "20"
2121
cache: "npm"
2222

2323
- name: Install dependencies

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@
7171
"webpack-cli": "^6.0.1"
7272
},
7373
"engines": {
74-
"node": ">=16.0.0"
74+
"node": ">=18.0.0"
7575
}
7676
}

src/tracer/BrowserTracer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class BrowserTracer extends Tracer {
1414
private webTracerProvider?: WebTracerProvider;
1515

1616
public async initialize(
17-
options: BrowserTracerInitializeOptions = {}
17+
options: BrowserTracerInitializeOptions = {},
1818
): Promise<BrowserTracer> {
1919
if (this._initialized) {
2020
return this;
@@ -41,7 +41,7 @@ export class BrowserTracer extends Tracer {
4141
return this;
4242
} catch (error) {
4343
throw new Error(
44-
`Failed to initialize browser tracer: ${error instanceof Error ? error.message : String(error)}`
44+
`Failed to initialize browser tracer: ${error instanceof Error ? error.message : String(error)}`,
4545
);
4646
}
4747
}
@@ -62,7 +62,7 @@ export class BrowserTracer extends Tracer {
6262
}
6363

6464
public static createWithConfiguration(
65-
configuration: TracerConfiguration
65+
configuration: TracerConfiguration,
6666
): BrowserTracer {
6767
return new BrowserTracer(configuration);
6868
}

src/tracer/Tracer.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export abstract class Tracer {
5454
this.apiClient = new JudgmentApiClient(
5555
this.configuration.apiUrl,
5656
this.configuration.apiKey,
57-
this.configuration.organizationId
57+
this.configuration.organizationId,
5858
);
5959

6060
this._initialized = false;
@@ -65,7 +65,7 @@ export abstract class Tracer {
6565
private async resolveProjectId(): Promise<string> {
6666
try {
6767
Logger.info(
68-
`Resolving project ID for project: ${this.configuration.projectName}`
68+
`Resolving project ID for project: ${this.configuration.projectName}`,
6969
);
7070

7171
const response = await this.apiClient.projectsResolve({
@@ -76,7 +76,7 @@ export abstract class Tracer {
7676

7777
if (!resolvedProjectId) {
7878
throw new Error(
79-
`Project ID not found for project: ${this.configuration.projectName}`
79+
`Project ID not found for project: ${this.configuration.projectName}`,
8080
);
8181
}
8282

@@ -86,15 +86,15 @@ export abstract class Tracer {
8686
return this.projectId;
8787
} catch (error) {
8888
throw new Error(
89-
`Failed to resolve project ID: ${error instanceof Error ? error.message : String(error)}`
89+
`Failed to resolve project ID: ${error instanceof Error ? error.message : String(error)}`,
9090
);
9191
}
9292
}
9393

9494
public static getExporter(
9595
apiKey: string,
9696
organizationId: string,
97-
projectId: string
97+
projectId: string,
9898
): JudgmentSpanExporter {
9999
const endpoint = JUDGMENT_API_URL?.endsWith("/")
100100
? `${JUDGMENT_API_URL}otel/v1/traces`
@@ -120,7 +120,7 @@ export abstract class Tracer {
120120
this.configuration.projectName +
121121
", please create it first at https://app.judgmentlabs.ai/org/" +
122122
(this.configuration.organizationId || "unknown") +
123-
"/projects. Skipping Judgment export."
123+
"/projects. Skipping Judgment export.",
124124
);
125125
return new NoOpSpanExporter();
126126
}
@@ -135,7 +135,7 @@ export abstract class Tracer {
135135
if (kind !== null) {
136136
currentSpan.setAttribute(
137137
OpenTelemetryKeys.AttributeKeys.JUDGMENT_SPAN_KIND,
138-
kind
138+
kind,
139139
);
140140
}
141141
}
@@ -186,7 +186,7 @@ export abstract class Tracer {
186186
public asyncEvaluate(
187187
scorer: BaseScorer,
188188
example: ExampleModel,
189-
model?: string
189+
model?: string,
190190
): void {
191191
if (!this._initialized) {
192192
Logger.warn("Tracer not initialized, skipping asyncEvaluate");
@@ -212,15 +212,15 @@ export abstract class Tracer {
212212
const spanId = spanContext.spanId;
213213

214214
Logger.info(
215-
`asyncEvaluate: project=${this.configuration.projectName}, traceId=${traceId}, spanId=${spanId}, scorer=${scorer.name}`
215+
`asyncEvaluate: project=${this.configuration.projectName}, traceId=${traceId}, spanId=${spanId}, scorer=${scorer.name}`,
216216
);
217217

218218
const evaluationRun = this.createEvaluationRun(
219219
scorer,
220220
example,
221221
model,
222222
traceId,
223-
spanId
223+
spanId,
224224
);
225225
this.enqueueEvaluation(evaluationRun);
226226
}
@@ -250,24 +250,24 @@ export abstract class Tracer {
250250
const spanId = spanContext.spanId;
251251

252252
Logger.info(
253-
`asyncTraceEvaluate: project=${this.configuration.projectName}, traceId=${traceId}, spanId=${spanId}, scorer=${scorer.name}`
253+
`asyncTraceEvaluate: project=${this.configuration.projectName}, traceId=${traceId}, spanId=${spanId}, scorer=${scorer.name}`,
254254
);
255255

256256
try {
257257
const traceEvaluationRun = this.createTraceEvaluationRun(
258258
scorer,
259259
model,
260260
traceId,
261-
spanId
261+
spanId,
262262
);
263263
const traceEvalJson = this.serializer(traceEvaluationRun);
264264
currentSpan.setAttribute(
265265
OpenTelemetryKeys.AttributeKeys.PENDING_TRACE_EVAL,
266-
traceEvalJson
266+
traceEvalJson,
267267
);
268268
} catch (error) {
269269
Logger.error(
270-
`Failed to serialize trace evaluation: ${error instanceof Error ? error.message : String(error)}`
270+
`Failed to serialize trace evaluation: ${error instanceof Error ? error.message : String(error)}`,
271271
);
272272
}
273273
}
@@ -276,7 +276,7 @@ export abstract class Tracer {
276276
scorer: BaseScorer,
277277
model: string | undefined,
278278
traceId: string,
279-
spanId: string
279+
spanId: string,
280280
): Record<string, unknown> {
281281
const evalName = `async_trace_evaluate_${spanId || Date.now()}`;
282282
const modelName = model || JUDGMENT_DEFAULT_GPT_MODEL;
@@ -312,7 +312,7 @@ export abstract class Tracer {
312312
example: ExampleModel,
313313
model: string | undefined,
314314
traceId: string,
315-
spanId: string
315+
spanId: string,
316316
): ExampleEvaluationRun {
317317
const runId = `async_evaluate_${spanId || Date.now()}`;
318318
const modelName = model || JUDGMENT_DEFAULT_GPT_MODEL;
@@ -334,7 +334,7 @@ export abstract class Tracer {
334334
}
335335

336336
private async enqueueEvaluation(
337-
evaluationRun: ExampleEvaluationRun
337+
evaluationRun: ExampleEvaluationRun,
338338
): Promise<void> {
339339
if (!this.apiClient) {
340340
Logger.warn("API client not available, skipping evaluation enqueue");
@@ -346,14 +346,14 @@ export abstract class Tracer {
346346
Logger.info(`Enqueuing evaluation run: ${evaluationRun.eval_name}`);
347347
} catch (error) {
348348
Logger.error(
349-
`Failed to enqueue evaluation run: ${error instanceof Error ? error.message : String(error)}`
349+
`Failed to enqueue evaluation run: ${error instanceof Error ? error.message : String(error)}`,
350350
);
351351
}
352352
}
353353

354354
public observe<TArgs extends any[], TResult>(
355355
func: (...args: TArgs) => TResult,
356-
spanKind: SpanKind = "span"
356+
spanKind: SpanKind = "span",
357357
): (...args: TArgs) => TResult {
358358
return (...args: TArgs) => {
359359
const currentSpan = trace.getActiveSpan();
@@ -373,7 +373,7 @@ export abstract class Tracer {
373373
try {
374374
span.setAttribute(
375375
OpenTelemetryKeys.AttributeKeys.JUDGMENT_SPAN_KIND,
376-
spanKind
376+
spanKind,
377377
);
378378

379379
const argNames = parseFunctionArgs(func);
@@ -384,7 +384,7 @@ export abstract class Tracer {
384384
});
385385
span.setAttribute(
386386
OpenTelemetryKeys.AttributeKeys.JUDGMENT_INPUT,
387-
this.serializer(inputObj)
387+
this.serializer(inputObj),
388388
);
389389
}
390390

@@ -395,7 +395,7 @@ export abstract class Tracer {
395395
.then((res) => {
396396
span.setAttribute(
397397
OpenTelemetryKeys.AttributeKeys.JUDGMENT_OUTPUT,
398-
this.serializer(res)
398+
this.serializer(res),
399399
);
400400
span.end();
401401
return res;
@@ -408,7 +408,7 @@ export abstract class Tracer {
408408
} else {
409409
span.setAttribute(
410410
OpenTelemetryKeys.AttributeKeys.JUDGMENT_OUTPUT,
411-
this.serializer(result)
411+
this.serializer(result),
412412
);
413413
span.end();
414414
return result;
@@ -418,7 +418,7 @@ export abstract class Tracer {
418418
span.end();
419419
throw err;
420420
}
421-
}
421+
},
422422
);
423423
});
424424
};

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = (env, argv) => {
1111
entry: "./src/index.ts",
1212
filename: "index.mjs",
1313
libraryType: "module",
14-
target: "node",
14+
target: "node20",
1515
};
1616
case "umd":
1717
return {

0 commit comments

Comments
 (0)