Skip to content

Commit

Permalink
fix: explicitly set the styler type (#1830)
Browse files Browse the repository at this point in the history
This fixes an issue where the build procecss auto adds and `import`
statement
that fails in other environments when the package gets installed.
  • Loading branch information
jmcdo29 authored Oct 23, 2024
2 parents 136ed2f + 48dbd4d commit d49c8e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/violet-steaks-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ogma/nestjs-module': patch
---

Explicitly set the styler type
3 changes: 2 additions & 1 deletion packages/nestjs-module/src/ogma.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Injectable, LoggerService, Optional } from '@nestjs/common';
import { LogLevel, OgmaWritableLevel } from '@ogma/common';
import { Ogma } from '@ogma/logger';
import type { Styler } from '@ogma/styler';

import { InjectOgma, InjectOgmaContext, InjectTraceMethod } from './decorators';
import { OgmaServiceMeta } from './interfaces';
Expand Down Expand Up @@ -47,7 +48,7 @@ export class OgmaService implements LoggerService {
* instance that the logger uses for custom coloring without needing
* to manage a new styler instance
*/
public get style() {
public get style(): Styler {
return this.ogma.style;
}

Expand Down

0 comments on commit d49c8e3

Please sign in to comment.