vedatrace 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -223,6 +223,22 @@ app.post('/webhook', async (req, res) => {
223
223
  })
224
224
  ```
225
225
 
226
+ ### Graceful Shutdown
227
+
228
+ The SDK uses background batching that doesn't block your app. For short-lived scripts or when you need explicit cleanup:
229
+
230
+ ```typescript
231
+ const logger = vedatrace({ apiKey: '...' })
232
+
233
+ logger.info('Processing...')
234
+
235
+ // For short-lived scripts
236
+ await logger.flush()
237
+ logger.stop() // Stop background timer
238
+ ```
239
+
240
+ The SDK timer uses `unref()` so the process will exit automatically when there's nothing else to do. Call `stop()` if you need explicit cleanup.
241
+
226
242
  ### Error Handling
227
243
 
228
244
  ```typescript
@@ -288,6 +304,10 @@ Create a child logger with default metadata.
288
304
 
289
305
  Manually flush pending logs. Returns a Promise.
290
306
 
307
+ ### `logger.stop()`
308
+
309
+ Stop the background flush timer. Call this for explicit cleanup in long-running processes or before shutdown.
310
+
291
311
  ## License
292
312
 
293
313
  MIT
package/dist/index.cjs CHANGED
@@ -5,11 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var transports_index = require('./transports/index.cjs');
6
6
 
7
7
  class VedaTraceBatcher {
8
- constructor(transports, config, onError, onSuccess) {
8
+ constructor(transports, config, onError, onSuccess, immediateFlush = false) {
9
9
  this.transports = transports;
10
10
  this.config = config;
11
11
  this.onError = onError;
12
12
  this.onSuccess = onSuccess;
13
+ this.immediateFlush = immediateFlush;
13
14
  this.startFlushTimer();
14
15
  }
15
16
  queue = [];
@@ -19,7 +20,7 @@ class VedaTraceBatcher {
19
20
  /** Add log to queue */
20
21
  add(log) {
21
22
  this.queue.push(log);
22
- if (this.queue.length >= this.config.batchSize) {
23
+ if (this.immediateFlush || this.queue.length >= this.config.batchSize) {
23
24
  this.flush();
24
25
  }
25
26
  }
@@ -73,6 +74,9 @@ class VedaTraceBatcher {
73
74
  this.flush();
74
75
  }
75
76
  }, this.config.flushInterval);
77
+ if (this.config.unrefTimer !== false) {
78
+ this.flushTimer.unref();
79
+ }
76
80
  }
77
81
  /** Stop the flush timer */
78
82
  stop() {
@@ -109,7 +113,8 @@ class VedaTraceLogger {
109
113
  retryDelay: config.retryDelay ?? 1e3,
110
114
  onError: config.onError,
111
115
  onSuccess: config.onSuccess,
112
- debug: config.debug ?? false
116
+ debug: config.debug ?? false,
117
+ immediateFlush: config.immediateFlush ?? false
113
118
  };
114
119
  if (!config.disabled) {
115
120
  this.initializeBatcher(config);
@@ -129,7 +134,8 @@ class VedaTraceLogger {
129
134
  retryDelay: this.config.retryDelay
130
135
  },
131
136
  this.config.onError,
132
- this.config.onSuccess
137
+ this.config.onSuccess,
138
+ this.config.immediateFlush
133
139
  );
134
140
  }
135
141
  }
@@ -209,6 +215,12 @@ class VedaTraceLogger {
209
215
  await this.batcher.flush();
210
216
  }
211
217
  }
218
+ /** Stop the batcher and flush timer */
219
+ stop() {
220
+ if (this.batcher) {
221
+ this.batcher.stop();
222
+ }
223
+ }
212
224
  /** Detect runtime environment */
213
225
  detectEnvironment() {
214
226
  if (typeof globalThis !== "undefined" && "navigator" in globalThis) {
@@ -305,7 +317,7 @@ function vedatrace(config = {}) {
305
317
  [httpTransport],
306
318
  {
307
319
  batchSize: config.batchSize ?? 100,
308
- flushInterval: config.flushInterval ?? 5e3,
320
+ flushInterval: config.flushInterval ?? 1e3,
309
321
  maxRetries: config.maxRetries ?? 3,
310
322
  retryDelay: config.retryDelay ?? 1e3
311
323
  },
@@ -313,12 +325,21 @@ function vedatrace(config = {}) {
313
325
  config.onSuccess
314
326
  );
315
327
  logger.setBatcher(batcher);
328
+ if (typeof process !== "undefined") {
329
+ const flushLogs = async () => {
330
+ await batcher.flush();
331
+ };
332
+ process.on("beforeExit", flushLogs);
333
+ process.on("SIGTERM", flushLogs);
334
+ process.on("SIGINT", flushLogs);
335
+ }
316
336
  }
317
337
  return logger;
318
338
  }
319
339
  function devVedatrace(config = {}) {
320
340
  return vedatrace({
321
341
  ...config,
342
+ immediateFlush: true,
322
343
  transports: [
323
344
  new transports_index.VedaTraceConsoleTransport({
324
345
  format: "pretty",
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { b as VedaTraceTransport, B as BatcherConfig, I as InternalLogEntry, V as VedaTraceLoggerInterface, a as VedaTraceConfig, L as LogMetadata, R as RedactionConfig } from './types-wnAhugbp.cjs';
2
- export { c as VedaTraceLevel, d as VedaTraceLog } from './types-wnAhugbp.cjs';
1
+ import { b as VedaTraceTransport, B as BatcherConfig, I as InternalLogEntry, V as VedaTraceLoggerInterface, a as VedaTraceConfig, L as LogMetadata, R as RedactionConfig } from './types-CGtcllp9.cjs';
2
+ export { c as VedaTraceLevel, d as VedaTraceLog } from './types-CGtcllp9.cjs';
3
3
  export { ConsoleFormat, ConsoleTransportConfig, HttpTransportConfig, VedaTraceConsoleTransport, VedaTraceHttpTransport } from './transports/index.cjs';
4
4
 
5
5
  /**
@@ -12,11 +12,12 @@ declare class VedaTraceBatcher {
12
12
  private config;
13
13
  private onError?;
14
14
  private onSuccess?;
15
+ private immediateFlush;
15
16
  private queue;
16
17
  private flushTimer;
17
18
  private isFlushing;
18
19
  private pendingFlush;
19
- constructor(transports: VedaTraceTransport[], config: BatcherConfig, onError?: ((error: Error) => void) | undefined, onSuccess?: (() => void) | undefined);
20
+ constructor(transports: VedaTraceTransport[], config: BatcherConfig, onError?: ((error: Error) => void) | undefined, onSuccess?: (() => void) | undefined, immediateFlush?: boolean);
20
21
  /** Add log to queue */
21
22
  add(log: InternalLogEntry): void;
22
23
  /** Flush logs to all transports */
@@ -62,6 +63,8 @@ declare class VedaTraceLogger implements VedaTraceLoggerInterface {
62
63
  child(defaults: LogMetadata): VedaTraceLoggerInterface;
63
64
  /** Flush pending logs */
64
65
  flush(): Promise<void>;
66
+ /** Stop the batcher and flush timer */
67
+ stop(): void;
65
68
  /** Detect runtime environment */
66
69
  private detectEnvironment;
67
70
  }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { b as VedaTraceTransport, B as BatcherConfig, I as InternalLogEntry, V as VedaTraceLoggerInterface, a as VedaTraceConfig, L as LogMetadata, R as RedactionConfig } from './types-wnAhugbp.mjs';
2
- export { c as VedaTraceLevel, d as VedaTraceLog } from './types-wnAhugbp.mjs';
1
+ import { b as VedaTraceTransport, B as BatcherConfig, I as InternalLogEntry, V as VedaTraceLoggerInterface, a as VedaTraceConfig, L as LogMetadata, R as RedactionConfig } from './types-CGtcllp9.mjs';
2
+ export { c as VedaTraceLevel, d as VedaTraceLog } from './types-CGtcllp9.mjs';
3
3
  export { ConsoleFormat, ConsoleTransportConfig, HttpTransportConfig, VedaTraceConsoleTransport, VedaTraceHttpTransport } from './transports/index.mjs';
4
4
 
5
5
  /**
@@ -12,11 +12,12 @@ declare class VedaTraceBatcher {
12
12
  private config;
13
13
  private onError?;
14
14
  private onSuccess?;
15
+ private immediateFlush;
15
16
  private queue;
16
17
  private flushTimer;
17
18
  private isFlushing;
18
19
  private pendingFlush;
19
- constructor(transports: VedaTraceTransport[], config: BatcherConfig, onError?: ((error: Error) => void) | undefined, onSuccess?: (() => void) | undefined);
20
+ constructor(transports: VedaTraceTransport[], config: BatcherConfig, onError?: ((error: Error) => void) | undefined, onSuccess?: (() => void) | undefined, immediateFlush?: boolean);
20
21
  /** Add log to queue */
21
22
  add(log: InternalLogEntry): void;
22
23
  /** Flush logs to all transports */
@@ -62,6 +63,8 @@ declare class VedaTraceLogger implements VedaTraceLoggerInterface {
62
63
  child(defaults: LogMetadata): VedaTraceLoggerInterface;
63
64
  /** Flush pending logs */
64
65
  flush(): Promise<void>;
66
+ /** Stop the batcher and flush timer */
67
+ stop(): void;
65
68
  /** Detect runtime environment */
66
69
  private detectEnvironment;
67
70
  }
package/dist/index.mjs CHANGED
@@ -1,11 +1,12 @@
1
1
  import { VedaTraceHttpTransport, VedaTraceConsoleTransport } from './transports/index.mjs';
2
2
 
3
3
  class VedaTraceBatcher {
4
- constructor(transports, config, onError, onSuccess) {
4
+ constructor(transports, config, onError, onSuccess, immediateFlush = false) {
5
5
  this.transports = transports;
6
6
  this.config = config;
7
7
  this.onError = onError;
8
8
  this.onSuccess = onSuccess;
9
+ this.immediateFlush = immediateFlush;
9
10
  this.startFlushTimer();
10
11
  }
11
12
  queue = [];
@@ -15,7 +16,7 @@ class VedaTraceBatcher {
15
16
  /** Add log to queue */
16
17
  add(log) {
17
18
  this.queue.push(log);
18
- if (this.queue.length >= this.config.batchSize) {
19
+ if (this.immediateFlush || this.queue.length >= this.config.batchSize) {
19
20
  this.flush();
20
21
  }
21
22
  }
@@ -69,6 +70,9 @@ class VedaTraceBatcher {
69
70
  this.flush();
70
71
  }
71
72
  }, this.config.flushInterval);
73
+ if (this.config.unrefTimer !== false) {
74
+ this.flushTimer.unref();
75
+ }
72
76
  }
73
77
  /** Stop the flush timer */
74
78
  stop() {
@@ -105,7 +109,8 @@ class VedaTraceLogger {
105
109
  retryDelay: config.retryDelay ?? 1e3,
106
110
  onError: config.onError,
107
111
  onSuccess: config.onSuccess,
108
- debug: config.debug ?? false
112
+ debug: config.debug ?? false,
113
+ immediateFlush: config.immediateFlush ?? false
109
114
  };
110
115
  if (!config.disabled) {
111
116
  this.initializeBatcher(config);
@@ -125,7 +130,8 @@ class VedaTraceLogger {
125
130
  retryDelay: this.config.retryDelay
126
131
  },
127
132
  this.config.onError,
128
- this.config.onSuccess
133
+ this.config.onSuccess,
134
+ this.config.immediateFlush
129
135
  );
130
136
  }
131
137
  }
@@ -205,6 +211,12 @@ class VedaTraceLogger {
205
211
  await this.batcher.flush();
206
212
  }
207
213
  }
214
+ /** Stop the batcher and flush timer */
215
+ stop() {
216
+ if (this.batcher) {
217
+ this.batcher.stop();
218
+ }
219
+ }
208
220
  /** Detect runtime environment */
209
221
  detectEnvironment() {
210
222
  if (typeof globalThis !== "undefined" && "navigator" in globalThis) {
@@ -301,7 +313,7 @@ function vedatrace(config = {}) {
301
313
  [httpTransport],
302
314
  {
303
315
  batchSize: config.batchSize ?? 100,
304
- flushInterval: config.flushInterval ?? 5e3,
316
+ flushInterval: config.flushInterval ?? 1e3,
305
317
  maxRetries: config.maxRetries ?? 3,
306
318
  retryDelay: config.retryDelay ?? 1e3
307
319
  },
@@ -309,12 +321,21 @@ function vedatrace(config = {}) {
309
321
  config.onSuccess
310
322
  );
311
323
  logger.setBatcher(batcher);
324
+ if (typeof process !== "undefined") {
325
+ const flushLogs = async () => {
326
+ await batcher.flush();
327
+ };
328
+ process.on("beforeExit", flushLogs);
329
+ process.on("SIGTERM", flushLogs);
330
+ process.on("SIGINT", flushLogs);
331
+ }
312
332
  }
313
333
  return logger;
314
334
  }
315
335
  function devVedatrace(config = {}) {
316
336
  return vedatrace({
317
337
  ...config,
338
+ immediateFlush: true,
318
339
  transports: [
319
340
  new VedaTraceConsoleTransport({
320
341
  format: "pretty",
@@ -1,5 +1,5 @@
1
1
  import { Request, Response, NextFunction } from 'express';
2
- import { V as VedaTraceLoggerInterface, a as VedaTraceConfig, L as LogMetadata } from '../types-wnAhugbp.cjs';
2
+ import { V as VedaTraceLoggerInterface, a as VedaTraceConfig, L as LogMetadata } from '../types-CGtcllp9.cjs';
3
3
 
4
4
  /**
5
5
  * Express.js middleware integration for VedaTrace
@@ -1,5 +1,5 @@
1
1
  import { Request, Response, NextFunction } from 'express';
2
- import { V as VedaTraceLoggerInterface, a as VedaTraceConfig, L as LogMetadata } from '../types-wnAhugbp.mjs';
2
+ import { V as VedaTraceLoggerInterface, a as VedaTraceConfig, L as LogMetadata } from '../types-CGtcllp9.mjs';
3
3
 
4
4
  /**
5
5
  * Express.js middleware integration for VedaTrace
@@ -1,4 +1,4 @@
1
- import { a as VedaTraceConfig, L as LogMetadata, V as VedaTraceLoggerInterface } from '../types-wnAhugbp.cjs';
1
+ import { a as VedaTraceConfig, L as LogMetadata, V as VedaTraceLoggerInterface } from '../types-CGtcllp9.cjs';
2
2
 
3
3
  /**
4
4
  * Next.js integration for VedaTrace
@@ -1,4 +1,4 @@
1
- import { a as VedaTraceConfig, L as LogMetadata, V as VedaTraceLoggerInterface } from '../types-wnAhugbp.mjs';
1
+ import { a as VedaTraceConfig, L as LogMetadata, V as VedaTraceLoggerInterface } from '../types-CGtcllp9.mjs';
2
2
 
3
3
  /**
4
4
  * Next.js integration for VedaTrace
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
- import { a as VedaTraceConfig, V as VedaTraceLoggerInterface, L as LogMetadata } from '../types-wnAhugbp.cjs';
2
+ import { a as VedaTraceConfig, V as VedaTraceLoggerInterface, L as LogMetadata } from '../types-CGtcllp9.cjs';
3
3
 
4
4
  /**
5
5
  * React integration for VedaTrace
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
- import { a as VedaTraceConfig, V as VedaTraceLoggerInterface, L as LogMetadata } from '../types-wnAhugbp.mjs';
2
+ import { a as VedaTraceConfig, V as VedaTraceLoggerInterface, L as LogMetadata } from '../types-CGtcllp9.mjs';
3
3
 
4
4
  /**
5
5
  * React integration for VedaTrace
@@ -92,6 +92,13 @@ class VedaTraceHttpTransport {
92
92
  async send(logs) {
93
93
  const controller = new AbortController();
94
94
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
95
+ const payload = logs.map((log) => ({
96
+ level: log.level,
97
+ message: log.message,
98
+ service: log.service,
99
+ timestamp: log.timestamp ? new Date(log.timestamp).toISOString() : void 0,
100
+ metadata: log.metadata
101
+ }));
95
102
  try {
96
103
  const response = await fetch(this.endpoint, {
97
104
  method: "POST",
@@ -100,7 +107,7 @@ class VedaTraceHttpTransport {
100
107
  "X-API-Key": this.apiKey,
101
108
  ...this.headers
102
109
  },
103
- body: JSON.stringify(logs),
110
+ body: JSON.stringify(payload),
104
111
  signal: controller.signal
105
112
  });
106
113
  clearTimeout(timeoutId);
@@ -1,4 +1,4 @@
1
- import { c as VedaTraceLevel, b as VedaTraceTransport, d as VedaTraceLog } from '../types-wnAhugbp.cjs';
1
+ import { c as VedaTraceLevel, b as VedaTraceTransport, I as InternalLogEntry } from '../types-CGtcllp9.cjs';
2
2
 
3
3
  /**
4
4
  * Console transport for development/debugging
@@ -20,7 +20,7 @@ declare class VedaTraceConsoleTransport implements VedaTraceTransport {
20
20
  private minLevel;
21
21
  constructor(config?: ConsoleTransportConfig);
22
22
  /** Send logs to console */
23
- send(logs: VedaTraceLog[]): void;
23
+ send(logs: InternalLogEntry[]): void;
24
24
  /** Format as JSON */
25
25
  private logJson;
26
26
  /** Format as simple text */
@@ -51,7 +51,7 @@ declare class VedaTraceHttpTransport implements VedaTraceTransport {
51
51
  private headers;
52
52
  constructor(config: HttpTransportConfig);
53
53
  /** Send logs via HTTP POST */
54
- send(logs: VedaTraceLog[]): Promise<void>;
54
+ send(logs: InternalLogEntry[]): Promise<void>;
55
55
  }
56
56
 
57
57
  export { VedaTraceConsoleTransport, VedaTraceHttpTransport };
@@ -1,4 +1,4 @@
1
- import { c as VedaTraceLevel, b as VedaTraceTransport, d as VedaTraceLog } from '../types-wnAhugbp.mjs';
1
+ import { c as VedaTraceLevel, b as VedaTraceTransport, I as InternalLogEntry } from '../types-CGtcllp9.mjs';
2
2
 
3
3
  /**
4
4
  * Console transport for development/debugging
@@ -20,7 +20,7 @@ declare class VedaTraceConsoleTransport implements VedaTraceTransport {
20
20
  private minLevel;
21
21
  constructor(config?: ConsoleTransportConfig);
22
22
  /** Send logs to console */
23
- send(logs: VedaTraceLog[]): void;
23
+ send(logs: InternalLogEntry[]): void;
24
24
  /** Format as JSON */
25
25
  private logJson;
26
26
  /** Format as simple text */
@@ -51,7 +51,7 @@ declare class VedaTraceHttpTransport implements VedaTraceTransport {
51
51
  private headers;
52
52
  constructor(config: HttpTransportConfig);
53
53
  /** Send logs via HTTP POST */
54
- send(logs: VedaTraceLog[]): Promise<void>;
54
+ send(logs: InternalLogEntry[]): Promise<void>;
55
55
  }
56
56
 
57
57
  export { VedaTraceConsoleTransport, VedaTraceHttpTransport };
@@ -90,6 +90,13 @@ class VedaTraceHttpTransport {
90
90
  async send(logs) {
91
91
  const controller = new AbortController();
92
92
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
93
+ const payload = logs.map((log) => ({
94
+ level: log.level,
95
+ message: log.message,
96
+ service: log.service,
97
+ timestamp: log.timestamp ? new Date(log.timestamp).toISOString() : void 0,
98
+ metadata: log.metadata
99
+ }));
93
100
  try {
94
101
  const response = await fetch(this.endpoint, {
95
102
  method: "POST",
@@ -98,7 +105,7 @@ class VedaTraceHttpTransport {
98
105
  "X-API-Key": this.apiKey,
99
106
  ...this.headers
100
107
  },
101
- body: JSON.stringify(logs),
108
+ body: JSON.stringify(payload),
102
109
  signal: controller.signal
103
110
  });
104
111
  clearTimeout(timeoutId);
@@ -47,6 +47,8 @@ interface VedaTraceConfig {
47
47
  disabled?: boolean;
48
48
  /** Enable debug mode (verbose console output) */
49
49
  debug?: boolean;
50
+ /** Flush immediately after each log (for console/dev mode) */
51
+ immediateFlush?: boolean;
50
52
  }
51
53
  /** Redaction configuration */
52
54
  interface RedactionConfig {
@@ -62,7 +64,7 @@ interface VedaTraceTransport {
62
64
  /** Transport name */
63
65
  name: string;
64
66
  /** Send logs to destination */
65
- send(logs: VedaTraceLog[]): Promise<void> | void;
67
+ send(logs: InternalLogEntry[]): Promise<void> | void;
66
68
  /** Flush any pending logs */
67
69
  flush?(): Promise<void>;
68
70
  }
@@ -96,6 +98,7 @@ interface BatcherConfig {
96
98
  flushInterval: number;
97
99
  maxRetries: number;
98
100
  retryDelay: number;
101
+ unrefTimer?: boolean;
99
102
  }
100
103
  /** Logger interface */
101
104
  interface VedaTraceLoggerInterface {
@@ -106,6 +109,7 @@ interface VedaTraceLoggerInterface {
106
109
  fatal(message: string | Error, metadata?: LogMetadata): void;
107
110
  child(defaults: LogMetadata): VedaTraceLoggerInterface;
108
111
  flush(): Promise<void>;
112
+ stop(): void;
109
113
  }
110
114
 
111
115
  export type { BatcherConfig as B, InternalLogEntry as I, LogMetadata as L, RedactionConfig as R, VedaTraceLoggerInterface as V, VedaTraceConfig as a, VedaTraceTransport as b, VedaTraceLevel as c, VedaTraceLog as d };
@@ -47,6 +47,8 @@ interface VedaTraceConfig {
47
47
  disabled?: boolean;
48
48
  /** Enable debug mode (verbose console output) */
49
49
  debug?: boolean;
50
+ /** Flush immediately after each log (for console/dev mode) */
51
+ immediateFlush?: boolean;
50
52
  }
51
53
  /** Redaction configuration */
52
54
  interface RedactionConfig {
@@ -62,7 +64,7 @@ interface VedaTraceTransport {
62
64
  /** Transport name */
63
65
  name: string;
64
66
  /** Send logs to destination */
65
- send(logs: VedaTraceLog[]): Promise<void> | void;
67
+ send(logs: InternalLogEntry[]): Promise<void> | void;
66
68
  /** Flush any pending logs */
67
69
  flush?(): Promise<void>;
68
70
  }
@@ -96,6 +98,7 @@ interface BatcherConfig {
96
98
  flushInterval: number;
97
99
  maxRetries: number;
98
100
  retryDelay: number;
101
+ unrefTimer?: boolean;
99
102
  }
100
103
  /** Logger interface */
101
104
  interface VedaTraceLoggerInterface {
@@ -106,6 +109,7 @@ interface VedaTraceLoggerInterface {
106
109
  fatal(message: string | Error, metadata?: LogMetadata): void;
107
110
  child(defaults: LogMetadata): VedaTraceLoggerInterface;
108
111
  flush(): Promise<void>;
112
+ stop(): void;
109
113
  }
110
114
 
111
115
  export type { BatcherConfig as B, InternalLogEntry as I, LogMetadata as L, RedactionConfig as R, VedaTraceLoggerInterface as V, VedaTraceConfig as a, VedaTraceTransport as b, VedaTraceLevel as c, VedaTraceLog as d };
package/package.json CHANGED
@@ -1,143 +1,143 @@
1
1
  {
2
- "name": "vedatrace",
3
- "description": "Universal JavaScript logging SDK for VedaTrace - type-safe, lightweight, and developer-friendly",
4
- "version": "0.1.4",
5
- "scripts": {
6
- "setup": "rm -rf node_modules && npm i && git init && husky",
7
- "prepublishOnly": "npm run build",
8
- "build": "pkgroll --clean-dist",
9
- "test": "vitest --run",
10
- "lint": "npx @biomejs/biome check --write",
11
- "changeset": "changeset",
12
- "version": "changeset version",
13
- "release": "bun run build && changeset publish",
14
- "ci:version": "changeset version",
15
- "ci:publish": "bun run build && changeset publish --provenance"
16
- },
17
- "publishConfig": {
18
- "provenance": true,
19
- "access": "public"
20
- },
21
- "files": [
22
- "dist"
23
- ],
24
- "lint-staged": {
25
- "*.{ts,tsx}": [
26
- "npm run lint"
27
- ]
28
- },
29
- "type": "module",
30
- "main": "./dist/index.cjs",
31
- "module": "./dist/index.mjs",
32
- "types": "./dist/index.d.cts",
33
- "exports": {
34
- ".": {
35
- "require": {
36
- "types": "./dist/index.d.cts",
37
- "default": "./dist/index.cjs"
38
- },
39
- "import": {
40
- "types": "./dist/index.d.mts",
41
- "default": "./dist/index.mjs"
42
- }
43
- },
44
- "./express": {
45
- "require": {
46
- "types": "./dist/integrations/express.d.cts",
47
- "default": "./dist/integrations/express.cjs"
48
- },
49
- "import": {
50
- "types": "./dist/integrations/express.d.mts",
51
- "default": "./dist/integrations/express.mjs"
52
- }
53
- },
54
- "./next": {
55
- "require": {
56
- "types": "./dist/integrations/nextjs.d.cts",
57
- "default": "./dist/integrations/nextjs.cjs"
58
- },
59
- "import": {
60
- "types": "./dist/integrations/nextjs.d.mts",
61
- "default": "./dist/integrations/nextjs.mjs"
62
- }
63
- },
64
- "./react": {
65
- "require": {
66
- "types": "./dist/integrations/react.d.cts",
67
- "default": "./dist/integrations/react.cjs"
68
- },
69
- "import": {
70
- "types": "./dist/integrations/react.d.mts",
71
- "default": "./dist/integrations/react.mjs"
72
- }
73
- },
74
- "./transports": {
75
- "require": {
76
- "types": "./dist/transports/index.d.cts",
77
- "default": "./dist/transports/index.cjs"
78
- },
79
- "import": {
80
- "types": "./dist/transports/index.d.mts",
81
- "default": "./dist/transports/index.mjs"
82
- }
83
- }
84
- },
85
- "keywords": [
86
- "logging",
87
- "logs",
88
- "observability",
89
- "monitoring",
90
- "typescript",
91
- "javascript",
92
- "cloudflare",
93
- "edge",
94
- "serverless"
95
- ],
96
- "devDependencies": {
97
- "@biomejs/biome": "^2.3.14",
98
- "@changesets/cli": "^2.29.8",
99
- "@vitest/coverage-v8": "^4.0.18",
100
- "execa": "^9.6.1",
101
- "husky": "^9.1.7",
102
- "lint-staged": "^16.2.7",
103
- "pkgroll": "^2.23.0",
104
- "react": "^19.2.4",
105
- "tsup": "^8.5.1",
106
- "tsx": "^4.21.0",
107
- "typescript": "^5.9.3",
108
- "vitest": "^4.0.18"
109
- },
110
- "peerDependencies": {
111
- "express": "latest",
112
- "react": ">=16.8.0",
113
- "@types/express": "^5.0.6",
114
- "@types/react": "^19.2.13"
115
- },
116
- "peerDependenciesMeta": {
117
- "react": {
118
- "optional": true
119
- },
120
- "express": {
121
- "optional": true
122
- },
123
- "@types/express": {
124
- "optional": true
125
- },
126
- "@types/react": {
127
- "optional": true
128
- }
129
- },
130
- "repository": {
131
- "type": "git",
132
- "url": "git+https://github.com/kurtiz/vedatrace-npm.git"
133
- },
134
- "bugs": {
135
- "url": "https://github.com/kurtiz/vedatrace-npm/issues"
136
- },
137
- "author": {
138
- "name": "Aaron Will Djaba",
139
- "email": "aaronwilldjaba@outlook.com",
140
- "url": "https://iamaaronwilldjaba.me"
141
- },
142
- "license": "MIT"
2
+ "name": "vedatrace",
3
+ "description": "Universal JavaScript logging SDK for VedaTrace - type-safe, lightweight, and developer-friendly",
4
+ "version": "0.1.5",
5
+ "scripts": {
6
+ "setup": "rm -rf node_modules && npm i && git init && husky",
7
+ "prepublishOnly": "npm run build",
8
+ "build": "pkgroll --clean-dist",
9
+ "test": "vitest --run",
10
+ "lint": "npx @biomejs/biome check --write",
11
+ "changeset": "changeset",
12
+ "version": "changeset version",
13
+ "release": "bun run build && changeset publish",
14
+ "ci:version": "changeset version",
15
+ "ci:publish": "bun run build && changeset publish --provenance"
16
+ },
17
+ "publishConfig": {
18
+ "provenance": true,
19
+ "access": "public"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "lint-staged": {
25
+ "*.{ts,tsx}": [
26
+ "npm run lint"
27
+ ]
28
+ },
29
+ "type": "module",
30
+ "main": "./dist/index.cjs",
31
+ "module": "./dist/index.mjs",
32
+ "types": "./dist/index.d.cts",
33
+ "exports": {
34
+ ".": {
35
+ "require": {
36
+ "types": "./dist/index.d.cts",
37
+ "default": "./dist/index.cjs"
38
+ },
39
+ "import": {
40
+ "types": "./dist/index.d.mts",
41
+ "default": "./dist/index.mjs"
42
+ }
43
+ },
44
+ "./express": {
45
+ "require": {
46
+ "types": "./dist/integrations/express.d.cts",
47
+ "default": "./dist/integrations/express.cjs"
48
+ },
49
+ "import": {
50
+ "types": "./dist/integrations/express.d.mts",
51
+ "default": "./dist/integrations/express.mjs"
52
+ }
53
+ },
54
+ "./next": {
55
+ "require": {
56
+ "types": "./dist/integrations/nextjs.d.cts",
57
+ "default": "./dist/integrations/nextjs.cjs"
58
+ },
59
+ "import": {
60
+ "types": "./dist/integrations/nextjs.d.mts",
61
+ "default": "./dist/integrations/nextjs.mjs"
62
+ }
63
+ },
64
+ "./react": {
65
+ "require": {
66
+ "types": "./dist/integrations/react.d.cts",
67
+ "default": "./dist/integrations/react.cjs"
68
+ },
69
+ "import": {
70
+ "types": "./dist/integrations/react.d.mts",
71
+ "default": "./dist/integrations/react.mjs"
72
+ }
73
+ },
74
+ "./transports": {
75
+ "require": {
76
+ "types": "./dist/transports/index.d.cts",
77
+ "default": "./dist/transports/index.cjs"
78
+ },
79
+ "import": {
80
+ "types": "./dist/transports/index.d.mts",
81
+ "default": "./dist/transports/index.mjs"
82
+ }
83
+ }
84
+ },
85
+ "keywords": [
86
+ "logging",
87
+ "logs",
88
+ "observability",
89
+ "monitoring",
90
+ "typescript",
91
+ "javascript",
92
+ "cloudflare",
93
+ "edge",
94
+ "serverless"
95
+ ],
96
+ "devDependencies": {
97
+ "@biomejs/biome": "^2.3.14",
98
+ "@changesets/cli": "^2.29.8",
99
+ "@vitest/coverage-v8": "^4.0.18",
100
+ "execa": "^9.6.1",
101
+ "husky": "^9.1.7",
102
+ "lint-staged": "^16.2.7",
103
+ "pkgroll": "^2.23.0",
104
+ "react": "^19.2.4",
105
+ "tsup": "^8.5.1",
106
+ "tsx": "^4.21.0",
107
+ "typescript": "^5.9.3",
108
+ "vitest": "^4.0.18"
109
+ },
110
+ "peerDependencies": {
111
+ "express": "latest",
112
+ "react": ">=16.8.0",
113
+ "@types/express": "^5.0.6",
114
+ "@types/react": "^19.2.13"
115
+ },
116
+ "peerDependenciesMeta": {
117
+ "react": {
118
+ "optional": true
119
+ },
120
+ "express": {
121
+ "optional": true
122
+ },
123
+ "@types/express": {
124
+ "optional": true
125
+ },
126
+ "@types/react": {
127
+ "optional": true
128
+ }
129
+ },
130
+ "repository": {
131
+ "type": "git",
132
+ "url": "git+https://github.com/kurtiz/vedatrace-npm.git"
133
+ },
134
+ "bugs": {
135
+ "url": "https://github.com/kurtiz/vedatrace-npm/issues"
136
+ },
137
+ "author": {
138
+ "name": "Aaron Will Djaba",
139
+ "email": "aaronwilldjaba@outlook.com",
140
+ "url": "https://iamaaronwilldjaba.me"
141
+ },
142
+ "license": "MIT"
143
143
  }