diff --git a/examples/basic.ts b/examples/basic.ts index 034a210..45fc39a 100644 --- a/examples/basic.ts +++ b/examples/basic.ts @@ -2,8 +2,8 @@ import 'dotenv/config' import { pino } from 'pino' -import { LokiLogLevel } from '../src/types/index' -import type { LokiOptions } from '../src/types/index' +import { LokiLogLevel } from '../src/types' +import type { LokiOptions } from '../src/types' const transport = pino.transport({ // 👇 Replace this with "pino-loki" diff --git a/examples/batching.ts b/examples/batching.ts index 5d3a4b6..e1b6ae6 100644 --- a/examples/batching.ts +++ b/examples/batching.ts @@ -6,7 +6,7 @@ import 'dotenv/config' import { pino } from 'pino' -import type { LokiOptions } from '../src/types/index' +import type { LokiOptions } from '../src/types' const transport = pino.transport({ // 👇 Replace this with "pino-loki" diff --git a/src/cli.ts b/src/cli.ts index fdaef52..ba84c61 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -3,7 +3,7 @@ import { program } from 'commander' import build from './index' import pkg from '../package.json' -import type { LokiOptions } from './types/index' +import type { LokiOptions } from './types' program .version(pkg.version) diff --git a/src/index.ts b/src/index.ts index eabd571..de87cfd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,9 @@ import abstractTransportBuild from 'pino-abstract-transport' import debug from './debug' -import { LokiLogLevel } from './types/index' -import { LogPusher } from './log_pusher/index' -import type { PinoLog, LokiOptions } from './types/index' +import { LokiLogLevel } from './types' +import { LogPusher } from './log_pusher' +import type { PinoLog, LokiOptions } from './types' /** * Resolves the options for the Pino Loki transport diff --git a/src/log_builder/index.ts b/src/log_builder.ts similarity index 96% rename from src/log_builder/index.ts rename to src/log_builder.ts index 3144b4c..246c157 100644 --- a/src/log_builder/index.ts +++ b/src/log_builder.ts @@ -1,5 +1,5 @@ -import { LokiLogLevel } from '../types/index' -import type { LokiLog, PinoLog, LokiOptions } from '../types/index' +import { LokiLogLevel } from './types' +import type { LokiLog, PinoLog, LokiOptions } from './types' const NANOSECONDS_LENGTH = 19 diff --git a/src/log_pusher/index.ts b/src/log_pusher.ts similarity index 93% rename from src/log_pusher/index.ts rename to src/log_pusher.ts index a423414..9af1bf9 100644 --- a/src/log_pusher/index.ts +++ b/src/log_pusher.ts @@ -1,9 +1,9 @@ import type { Got } from 'got' import got, { RequestError } from 'got' -import debug from '../debug' -import { LogBuilder } from '../log_builder/index' -import type { PinoLog, LokiOptions } from '../types/index' +import debug from './debug' +import { LogBuilder } from './log_builder' +import type { PinoLog, LokiOptions } from './types' /** * Responsible for pushing logs to Loki diff --git a/src/types/index.ts b/src/types.ts similarity index 100% rename from src/types/index.ts rename to src/types.ts diff --git a/src/utils/index.ts b/src/utils.ts similarity index 100% rename from src/utils/index.ts rename to src/utils.ts diff --git a/tests_helpers/index.ts b/tests/helpers.ts similarity index 100% rename from tests_helpers/index.ts rename to tests/helpers.ts diff --git a/tests/integration/loki.spec.ts b/tests/integration/loki.spec.ts index 4cdacb8..965dd4a 100644 --- a/tests/integration/loki.spec.ts +++ b/tests/integration/loki.spec.ts @@ -3,9 +3,9 @@ import { test } from '@japa/runner' import { randomUUID } from 'node:crypto' import pinoLoki from '../../src/index' -import { sleep } from '../../src/utils/index' -import { LokiClient } from '../../tests_helpers/index' -import type { LokiOptions } from '../../src/types/index' +import { sleep } from '../../src/utils' +import { LokiClient } from '../helpers' +import type { LokiOptions } from '../../src/types' const credentials = { host: process.env.LOKI_HOST!, diff --git a/tests/unit/log_builder.spec.ts b/tests/unit/log_builder.spec.ts index c2bc3c8..f5869dc 100644 --- a/tests/unit/log_builder.spec.ts +++ b/tests/unit/log_builder.spec.ts @@ -1,9 +1,9 @@ import { test } from '@japa/runner' -import { sleep } from '../../src/utils/index' -import { LokiLogLevel } from '../../src/types/index' -import type { PinoLog } from '../../src/types/index' -import { LogBuilder } from '../../src/log_builder/index' +import { sleep } from '../../src/utils' +import { LokiLogLevel } from '../../src/types' +import type { PinoLog } from '../../src/types' +import { LogBuilder } from '../../src/log_builder' const loadNs = process.hrtime() const loadMs = new Date().getTime() diff --git a/tests/unit/log_pusher.spec.ts b/tests/unit/log_pusher.spec.ts index c43e780..853c169 100644 --- a/tests/unit/log_pusher.spec.ts +++ b/tests/unit/log_pusher.spec.ts @@ -1,7 +1,7 @@ import nock from 'nock' import { test } from '@japa/runner' -import { LogPusher } from '../../src/log_pusher/index' +import { LogPusher } from '../../src/log_pusher' test.group('LogPusher', (group) => { group.teardown(async () => {