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

Aprimorando a seleção de versículos bíblicos #4

Merged

Conversation

eoSalinas
Copy link
Owner

Estou empolgado em mostrar essas melhorias na seleção dos versículos, olha o que fizemos:

Adicionamos uma lista de versículos pré-selecionados para resolver o problema da falta de contexto em alguns versículos, conforme descrito na issue #2.

Implementamos um schema JSON para validar o arquivo verses.json (lista de versículos), garantindo consistência e prevenindo erros de formatação. Além disso, o arquivo agora conta com suporte a intellisense para facilitar a edição.

Antes de realizar um commit, o husky executa um script para garantir que o arquivo de versículos esteja de acordo com o schema JSON. Além disso, são executados lint e verificação do padrão de commit (Conventional Commits). Qualquer falha nesses processos resultará no bloqueio do commit.

Adicionamos uma nova variável de ambiente chamada API_BASE_URL para permitir uma URL a cada ambiente. Isso se tornou necessário por conta de uma nova rota (/api/random-verse) para buscar um versículo aleatório da lista (verses.json) e, em seguida, fazer a requisição deste versículo na API do @omarciovsena. Também implementamos validação e tipagem das variáveis de ambiente.

Por favor, se puder dar uma olhada, pode ser que deixei passar algo nestas modificações… além disso você pode ver algum ponto a ser melhorado!

Se estiver com dúvida ou precisar de alguma informação, não hesite em deixar um comentário aqui!

Added a new route in our application at `api/random-verse` to select random verses from a pre-selected group.

This addition addresses the issue described in #2, where verses could be returned without context or meaning. Now, the selected verses will be more meaningful and relevant.

See issue #2
This commit adds a JSON schema to validate the structure and uniqueness of verses.

This addition not only provides intellisense for future contributors but also ensures that each item contains the necessary: abbreviation, chapter, and verse, and that there are no duplicate verses. This promotes greater data integrity within the project.
This addition implements validation of `verses.json` against `verses.schema.json` using ajv-cli in Husky's pre-commit.

This ensures the integrity and consistency of the verses in the project with each commit, ensuring that only "valid" data is sent to the repository.

Additionally, the execution of the linting script has been included in the pre-commit to maintain code quality.

The setup of @commitlint/cli and @commitlint/config-conventional has also been configured, providing a consistent pattern for commit messages ensured by Husky.
Now, the API URL is defined through an environment variable, allowing flexibility to use different URLs according to the execution environment.

Also implements type and validation of environment variables. Additionally, adds a function to facilitate and abstract requests to our API routes for better code organization and readability.
Copy link

vercel bot commented Mar 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
verse ✅ Ready (Inspect) Visit Preview Mar 24, 2024 1:17am

@eoSalinas eoSalinas linked an issue Mar 24, 2024 that may be closed by this pull request
@eoSalinas eoSalinas merged commit 45da882 into develop Mar 26, 2024
2 checks passed
@eoSalinas eoSalinas deleted the feat/aprimorando-a-seleção-de-versículos-bíblicos branch March 26, 2024 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aprimorando a seleção de versículos bíblicos
1 participant