Skip to content

Commit c1e9036

Browse files
committed
chore: remove umd.ts
1 parent 329df9b commit c1e9036

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "judgeval",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"description": "JavaScript/TypeScript client for Judgment evaluation platform",
55
"main": "./dist/index.mjs",
66
"module": "./dist/index.mjs",

scripts/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function buildLib() {
4444

4545
async function buildUmd() {
4646
const config: BuildConfig = {
47-
entrypoints: ["./src/umd.ts"],
47+
entrypoints: ["./src/index.ts"],
4848
outdir: "./dist",
4949
target: "browser",
5050
format: "iife",

src/data/example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Example as ExampleModel } from "../internal/api/models/Example";
33
export type Example<T extends Record<string, any> = Record<string, any>> =
44
ExampleModel & T;
55

6-
export function createExample<T extends Record<string, any>>(
6+
export function Example<T extends Record<string, any>>(
77
properties: T,
88
): Example<T> {
99
const example: Example<T> = {

src/tracer/NodeTracer.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
import { resourceFromAttributes } from "@opentelemetry/resources";
22
import { NodeSDK, NodeSDKConfiguration } from "@opentelemetry/sdk-node";
3-
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-node";
43
import { VERSION } from "../version";
54
import { OpenTelemetryKeys } from "./OpenTelemetryKeys";
65
import { Tracer, TracerInitializeOptions } from "./Tracer";
76
import { TracerConfiguration } from "./TracerConfiguration";
87

98
export type NodeTracerInitializeOptions = TracerInitializeOptions & {
10-
instrumentations?: NodeSDKConfiguration["instrumentations"];
119
resourceAttributes?: Record<string, unknown>;
12-
};
10+
} & Partial<NodeSDKConfiguration>;
1311

1412
export class NodeTracer extends Tracer {
1513
private nodeSDK?: NodeSDK;
1614

1715
public async initialize(
18-
options: NodeTracerInitializeOptions = {},
16+
options: NodeTracerInitializeOptions = {}
1917
): Promise<NodeTracer> {
2018
if (this._initialized) {
2119
return this;
@@ -34,7 +32,7 @@ export class NodeTracer extends Tracer {
3432
this.nodeSDK = new NodeSDK({
3533
resource: resourceFromAttributes(resourceAttributes),
3634
instrumentations: options.instrumentations,
37-
spanProcessor: new BatchSpanProcessor(spanExporter),
35+
traceExporter: spanExporter,
3836
...options,
3937
});
4038

@@ -44,7 +42,7 @@ export class NodeTracer extends Tracer {
4442
return this;
4543
} catch (error) {
4644
throw new Error(
47-
`Failed to initialize node tracer: ${error instanceof Error ? error.message : String(error)}`,
45+
`Failed to initialize node tracer: ${error instanceof Error ? error.message : String(error)}`
4846
);
4947
}
5048
}
@@ -66,11 +64,17 @@ export class NodeTracer extends Tracer {
6664
}
6765

6866
public static createWithConfiguration(
69-
configuration: TracerConfiguration,
67+
configuration: TracerConfiguration
7068
): NodeTracer {
7169
return new NodeTracer(configuration);
7270
}
7371

72+
public async forceFlush(): Promise<void> {
73+
if (this.nodeSDK) {
74+
await this.nodeSDK.shutdown();
75+
}
76+
}
77+
7478
public async shutdown(): Promise<void> {
7579
if (this.nodeSDK) {
7680
await this.nodeSDK.shutdown();

src/tracer/Tracer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export abstract class Tracer {
5555
);
5656

5757
this._initialized = false;
58+
5859
}
5960

6061
public abstract initialize(options: TracerInitializeOptions): Promise<Tracer>;

src/umd.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/version.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export const VERSION = "0.3.3";
1+
import { version } from "../package.json" with { type: "json" };
2+
3+
export const VERSION = version;

0 commit comments

Comments
 (0)