-
Notifications
You must be signed in to change notification settings - Fork 1
Chore/refactor types #42
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if removing dotenv and using fastify.env add more/less complexity for testing.
I'm not sure what the rest of the team think about removing dotenv. has it been discussed and I just missed the meeting?
I like this change! 🎉
i would say so far so good. |
… in createClient function
… logging in createClient function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @JoelFickson. I almost forgot one thing.
We have post-deploy script and pre-undeploy script, which makes use of env-var and also are executed once after deployment / before undeployment. Therefore they are outside Fastify scope. I guess we still have to keep dotenv in our package.json for this purpose, or at least move dotenv to devDependencies.
I think there should be a way to do a pre and post deploy env var binding with fastify/env. I will take a look and if I cant find a work around I will revert the dotenv package |
# Conflicts: # processor/src/clients/ingrid/ingrid.client.ts # processor/src/clients/ingrid/types/ingrid.client.type.ts # processor/src/config/index.ts # processor/src/server/plugins/ingrid-shipping.plugin.ts
… and update related configurations
This pull request includes several changes to the
processorpackage to enhance environment variable management, update dependencies, and refactor code for better maintainability. The most important changes include replacingdotenvwith@fastify/env, updating theIngridApiClientconstructor, and removing theconfigmodule.Environment Variable Management:
dotenvwith@fastify/envfor loading environment variables and added a newEnv.tsfile to configure environment variables using a schema. (processor/package-lock.json[1] [2] [3] [4]processor/package.json[5]processor/src/server/Env.ts[6]Dependency Updates:
@fastify/envand removeddotenvfrom the dependencies. (processor/package-lock.json[1] [2]processor/package.json[3]Code Refactoring:
IngridApiClientto use a newIngridClientOptionstype for the constructor parameters and updated thecreateClientfunction accordingly. (processor/src/clients/ingrid/ingrid.client.ts[1] [2] [3] [4]processor/src/clients/ingrid/types/ingrid.client.type.ts[5]configmodule and updated all references to use environment variables directly. (processor/src/config/index.ts[1]processor/src/libs/logger/index.ts[2] [3]processor/src/main.ts[4]processor/src/server/plugins/ingrid-shipping.plugin.ts[5] [6]processor/src/server/server.ts[7] [8]