MarcyLeite / spring-vue-monorepo-pipeline-poc

2 stars 0 forks source link

Exclude .vscode folder and .env from version control #1

Open c137santos opened 2 weeks ago

c137santos commented 2 weeks ago

The .vscode folder contains user-specific configurations for Visual Studio Code, which should not be tracked in version control to avoid conflicts between developers. To resolve this, we need to add the .vscode directory to the .gitignore file, ensuring it is excluded from the repository. The same action for .env. We need use docker-env,maybe.

MarcyLeite commented 1 week ago

.vscode

I was looking on better practices with dev container, and vscode has specific configurations that can be saved to better integration with the text editor, and some of this configurations are saved in .vscode folder. Besides that, .vscode is also used to save share settings and recommendations, like extensions.json to save extension recommendations for fella developers in the team. So Thinking that in the future, that might be extra configuration for this dev-env to work well with vscode, i will not add to .gitignore for now.

.env

Now, I do understand the problem with .env, and I was following a principle similar to Vite Env Environment and Modes, where you can work with N numbers of .env files, like .env.prod, .env.staging, and this files just save public values that changes between environments, so i can have somthing like:

# .env.prod
VITE_PAGE_TITLE=Hello World!
# .env.staging
VITE_PAGE_TITLE=Hello again, fake world...

In the same vain, if you have secrets that should not be controlled, in vite you could use .env.local or .env.prod.local.

With all that said, since the usage of .env on this repo has nothing to do with vite, npm tasks or Java, I think a docker-config or docker-env would be a better solution, like we had in (this project)[https://github.com/c137santos/FATEC-API-3-SEMESTRE], to avoid any problems or conflicts between the container and vite building process, but i will not add .env to .gitignore because of vite usage of this files. If you have any suggestion for additional configuration, let me know.