Skip to content

Commit

Permalink
refactor: move some files
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed May 12, 2024
1 parent 6078a16 commit b31a123
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions examples/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<LokiOptions>({
// 👇 Replace this with "pino-loki"
Expand Down
2 changes: 1 addition & 1 deletion examples/batching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<LokiOptions>({
// 👇 Replace this with "pino-loki"
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/log_builder/index.ts → src/log_builder.ts
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/log_pusher/index.ts → src/log_pusher.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/integration/loki.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!,
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/log_builder.spec.ts
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/log_pusher.spec.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down

0 comments on commit b31a123

Please sign in to comment.