Include of Ajv package are not placed into segment.ts
See original GitHub issueAfter 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:
- Created a year ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top GitHub Comments
Thanks everyonefor the report!
I just pushed a PR to address this issue, I’ll make a release shortly after merging.
Awesome! Thank youu 🥳