toonvanstrijp / nestjs-i18n

The i18n module for nestjs.
https://nestjs-i18n.com
Other
643 stars 108 forks source link

typescript dependencies #438

Closed huangang closed 1 year ago

huangang commented 1 year ago

typescript should be moved to dependencies, because src/utils/util.ts uses it

Toilal commented 1 year ago

I just hit this issue too. I'm not sure having typescript in production dependencies is a good idea though.

Toilal commented 1 year ago

The whole new Type Safety feature should be moved to another npm package for it to be loaded only in dev environment. Then typescript could stay in devDependencies.

toonvanstrijp commented 1 year ago

@Toilal when NODE_ENV is set to production the package disables typescript generation features. So this is kind of already taken care of. It would be better to move it to a separate package indeed but this is not something I'm going to put an effort in right now. Feel free to create a PR however.

arkus7 commented 1 year ago

when NODE_ENV is set to production the package disables typescript generation features. So this is kind of already taken care of.

There is no requirement to set this ENV variable in order to run the app in production, sometimes people have different NODE_ENV values for different environments of their app like preproduction.

So it's not a solution...

Toilal commented 1 year ago

Problem is that typescript is most often placed in devDependencies and unavailable in distrubution, but will still be required by util.js.

util.js should at least use a dynamic import to support case where typescript is not available and avoid the whole application to crash.

If you are OK with this, I can write a pull request.