Skip to content
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

Feature: .env file for the api #126

Closed
1 of 2 tasks
a0m0rajab opened this issue May 25, 2023 · 9 comments · Fixed by #151
Closed
1 of 2 tasks

Feature: .env file for the api #126

a0m0rajab opened this issue May 25, 2023 · 9 comments · Fixed by #151

Comments

@a0m0rajab
Copy link
Contributor

Type of feature

🔥 Performance

Current behavior

Based on the conversation here: https://discord.com/channels/714698561081704529/928693344358514698/1111046044646645931
I think it would be nice to have a .env file for the beta and test and using it in production.

Suggested solution

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributing Docs

  • I agree to follow this project's Contribution Docs
@a0m0rajab
Copy link
Contributor Author

related to: #101

@bdougie
Copy link
Member

bdougie commented May 25, 2023

I want to understand this before implementing it. This adds a level of complexity to the development process and we will have insight from all active contributors.

Could we do this for production& beta builds? This would allow us to provide beta apis by default, while not breaking anything.

NODE_ENV=production 
npm run build

@a0m0rajab
Copy link
Contributor Author

I think it's possible to do. It will be similar to the https://github.com/open-sauced/insights repo.

We will need to apply the .env variables on the constant file: https://github.com/open-sauced/ai/blob/beta/src/constants.ts

@a0m0rajab
Copy link
Contributor Author

Based on the vite documentation, this is possible to be done with --mode command.

vite build --mode prod 
vite build --mode beta

The .env files will .env.prod and .env.beta

Related docs:
https://vitejs.dev/guide/env-and-mode.html

@diivi
Copy link
Contributor

diivi commented May 25, 2023

Why do you need an env file though, we don't have any secrets right now afaik. For constant values, constants.ts should be enough?

@a0m0rajab a0m0rajab self-assigned this May 25, 2023
@a0m0rajab
Copy link
Contributor Author

@diivi it's not about secrets only, the constants we have right now is for productions, we need to have beta values to be able to test features like: post to highlight from the extension, otherwise the tests will go to production always.

@bdougie
Copy link
Member

bdougie commented May 25, 2023

we need to have beta values to be able to test features like: post to highlight from the extension, otherwise the tests will go to production always.

My suggestion use the mode env only production and create an if statement for NODE_ENV to use the production URL only in production.

@a0m0rajab a0m0rajab mentioned this issue May 27, 2023
19 tasks
@a0m0rajab a0m0rajab moved this to In Progress in Extension Status Board May 27, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Extension Status Board May 29, 2023
@github-actions
Copy link

github-actions bot commented Jun 3, 2023

🎉 This issue has been resolved in version 1.3.1-beta.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jun 3, 2023

🎉 This issue has been resolved in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants