question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include of Ajv package are not placed into segment.ts

See original GitHub issue

After running commands: npx typewriter init npx typewriter dev

File some_segment_folder/segment.ts is generated, and at this file we can find some code like:

export type ViolationHandler = (
    message: TrackMessage<Record<string, any>>,
    violations: Ajv.ErrorObject[]
) => void

Ajv package dependency are in use, but it is not included into this file like: import Ajv from 'ajv'

Earlier there was this template: https://github.com/segmentio/typewriter/blob/b3c2c327b15ba08b4d5321345b4212d2ecdb3d3b/src/generators/javascript/templates/index.hbs#L14 Which was including dependency.

But for now it should be done by developer.

Could you describe best practice how to manage this package at DEV environment, please?

Environment:

  • Typewriter v8.0.6
  • language JavaScript and TypeScript

Expected: After generating file by npx typewriter dev, all dependencies will be already in the file. Or it should be configurable option by npx typewriter init.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
oscbcommented, Oct 31, 2022

Thanks everyonefor the report!

I just pushed a PR to address this issue, I’ll make a release shortly after merging.

0reactions
cajotafercommented, Oct 31, 2022

Awesome! Thank youu 🥳

Read more comments on GitHub >

github_iconTop Results From Across the Web

v7.0.3 throws TypeScript error when adding ajv-formats (works ...
I can sometimes get it to a point where tsc will compile, but webpack still reports the error. Tried deleting yarn.lock , etc....
Read more >
Typewriter | Segment Documentation
Typewriter is a tool for generating strongly-typed Segment analytics libraries based on your pre-defined Tracking Plan spec.
Read more >
Using with TypeScript - Ajv JSON schema validator
when utility type is used, compiled JTD serializers only accept data of correct type (as they do not validate that the data is...
Read more >
Ajv options - Ajv JSON schema validator
There is no need to pass default option values - it is recommended to only pass option values that are different from defaults....
Read more >
ajv-formats - Ajv JSON schema validator
If format keyword is not present schema compilation will throw exception. When these keyword are added, they also add comparison functions to formats...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found