edwardanthony / nestjs-seeder

An extension library for NestJS to perform seeding.
MIT License
102 stars 21 forks source link

I think faker dependency should be updated to @faker-js/faker #26

Closed ulises39 closed 2 years ago

ulises39 commented 2 years ago

As faker dependency was removed a few months ago due to malicious code incident:https://www.infoworld.com/article/3647750/faker-npm-package-back-on-track-after-malicious-coding-incident.html, this package is now presenting some issues:

In factory.decorator.d.ts:2:23 Cannot find type definition file for 'faker 2 /// <reference types="faker" />

Also factory.decorator.d.ts:5:54 Cannot find namespace 'Faker' 5 export type FactoryValueGenerator = (faker?: Faker.FakerStatic, ctx?: Record<string, any>) => FactoryValue;

I managed to partially resolve it by editing this file and just removingFactoryValueGenerator, however i don't think this is the best approach

RaphaelWoude commented 2 years ago

Just needs to be updated to the new package. I would love to make a PR but unfortunately this repo is abandoned.

impsdc commented 2 years ago

@RaphaelWoude Could u manage to do a PR ? I'm getting a lot of errors updating to faker-js. Thanks !

edwardanthony commented 2 years ago

@impsdc Hello. What version of faker do you need? I’ll update it in the next 5 hours.

impsdc commented 2 years ago

@edwardanthony Hello, Thank you for your quick reply ! The last one if it's possible according to this doc, v7.5.0. Because some modules API is unknown in your current package. (node:6244) UnhandledPromiseRejectionWarning: TypeError: faker.random.numeric is not a function

edwardanthony commented 2 years ago

Sure. I’ll test it with with v7.5.0

edwardanthony commented 2 years ago

I've updated the library. Please kindly check and let me know if you have any problems. Have a good one!