Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 2.5.0, missing dependency on @types/triple-beam #242

Closed
carboneater opened this issue Feb 6, 2023 · 2 comments
Closed

[Bug]: 2.5.0, missing dependency on @types/triple-beam #242

carboneater opened this issue Feb 6, 2023 · 2 comments

Comments

@carboneater
Copy link
Contributor

carboneater commented Feb 6, 2023

The problem

On Typescript, since 2.5.0, transpilation fails, due to missing types

script-checker/node_modules/logform/index.d.ts:6:37 - error TS7016: Could not find a declaration file for module 'triple-beam'. '/home/gfournier/focus/ts/script-checker/node_modules/triple-beam/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/triple-beam` if it exists or add a new declaration (.d.ts) file containing `declare module 'triple-beam';`

6 import {LEVEL, MESSAGE, SPLAT} from 'triple-beam'
                                      ~~~~~~~~~~~~~

script-checker/node_modules/logform/index.d.ts:11:3 - error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.

11   [LEVEL]?: string;
     ~~~~~~~

script-checker/node_modules/logform/index.d.ts:12:3 - error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.

12   [MESSAGE]?: any;
     ~~~~~~~~~

script-checker/node_modules/logform/index.d.ts:13:3 - error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.

13   [SPLAT]?: any;
     ~~~~~~~

What version of Logform presents the issue?

2.5.0

What version of Node are you using?

18.14.0

If this worked in a previous version of Logform, which was it?

2.4.2

Minimum Working Example

npm i winston logform typescript @types/node

import {createLogger } from 'winston'

createLogger()

npx tsc

... Boom!

Additional information

add npm i @types/triple-beam to the example and it builds

🔎 Search Terms

2.5.0

@wbt
Copy link
Contributor

wbt commented Feb 7, 2023

Thanks for the report. Would someone like to make a PR adding tests to prevent future regression?

@wbt
Copy link
Contributor

wbt commented Feb 7, 2023

Closing as fixed by @carboneater's PR #243 released in v2.5.1; can be reopened if that isn't a fix.
Tests to prevent future regressions would still be welcome.

@wbt wbt closed this as completed Feb 7, 2023
wbt referenced this issue Feb 7, 2023
* add triple beam properties to types

* run npm install to update lock

---------

Minor merge conflict in package-lock.json resolved by @wbt
wbt referenced this issue Feb 7, 2023
Being able to use a Symbol as a key for TransformableInfo makes it easier to create cleaner transforms.

The current typing forbids this, so this change enables it.

Merge conflict resolved by @wbt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants