Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
59809d2
Add linting checks to CI/CD and fix code style issues
marcelorodrigo Jan 1, 2026
217c396
Merge branch 'master' into lint
marcelorodrigo Jan 1, 2026
d5df4d4
style: Improve code formatting and accessibility in AmountInput, defa…
marcelorodrigo Jan 1, 2026
b03af91
chore: Remove unused eslint-stylistic dependency from package.json an…
marcelorodrigo Jan 1, 2026
48a052a
refactor: Use Number.parseFloat for consistency in compoundInterest f…
marcelorodrigo Jan 1, 2026
ff8e71d
refactor: Simplify condition checks for interest, tax, and IOF amount…
marcelorodrigo Jan 1, 2026
e9e5dc8
refactor: Replace parseInt with Number.parseInt for consistency in va…
marcelorodrigo Jan 1, 2026
2d4ea6e
feat: Update update-indexes script to use ES modules and fetch financ…
marcelorodrigo Jan 1, 2026
40c5983
Merge branch 'master' into lint
marcelorodrigo Jan 1, 2026
83e1686
chore: Update cron schedule for index updates and add write permissions
marcelorodrigo Jan 1, 2026
ce811ba
chore: Consolidate permissions for GitHub Pages deployment in publish…
marcelorodrigo Jan 1, 2026
8ad2e76
chore: Update CI permissions to allow read access for contents
marcelorodrigo Jan 1, 2026
8489a3e
refactor: Simplify amount handling in AmountInput component
marcelorodrigo Jan 1, 2026
4dba2e2
refactor: Simplify interest amount check in InvestmentResult component
marcelorodrigo Jan 1, 2026
c5eb674
refactor: Improve validator logic for amount in InvestmentResult comp…
marcelorodrigo Jan 1, 2026
a783752
refactor: Enhance error handling for indicadores.json file access
marcelorodrigo Jan 1, 2026
0f0689c
refactor: Improve error handling for BCB API response in update-index…
marcelorodrigo Jan 1, 2026
a879422
refactor: Add null return for error handling in BCB API response
marcelorodrigo Jan 1, 2026
37dc4ab
refactor: Enhance error handling for BCB API response data validation
marcelorodrigo Jan 1, 2026
529070c
refactor: Update documentation to reflect change from update-indexes.…
marcelorodrigo Jan 1, 2026
fc482ac
refactor: Improve error handling and validation for Selic and CDI val…
marcelorodrigo Jan 1, 2026
ba0eea9
refactor: Clean up error handling and formatting in update-indexes.mj…
marcelorodrigo Jan 1, 2026
c4b97e4
refactor: Remove redundant validation tests and improve input handlin…
marcelorodrigo Jan 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

14 changes: 12 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pnpm build && pnpm preview # Test production build locally
```bash
pnpm update-indexes # Fetch latest DI/SELIC/savings rates from BCB API
```
This runs `update-indexes.js`, which calls `https://api.bcb.gov.br/` endpoints and updates `app/assets/indicadores.json`. Critical for production accuracy.
This runs `update-indexes.mjs`, which calls `https://api.bcb.gov.br/` endpoints and updates `app/assets/indicadores.json`. Critical for production accuracy.

## Project-Specific Conventions

Expand Down Expand Up @@ -75,14 +75,24 @@ const periodMultiplier = {
- Pinia: Store initialized in `index.vue` page via `store.initializeStore()`
- Tailwind CSS + Vite integration (check `@tailwindcss/vite` in config)

### Linting & Formatting (Nuxt 4/Vue 3 Best Practice)
- Project uses **ESLint flat config** with official `@nuxt/eslint` module. See `eslint.config.mjs` (auto-generated).
- Formatting rules are enforced by the **ESLint Stylistic** plugin—no `.editorconfig` file is needed or used.
- No Prettier: all stylistic and layout concerns handled via ESLint rules.
- **Lint scripts:**
- `pnpm lint` — Check entire codebase for lint and style violations
- `pnpm lint:fix` — Auto-fix fixable issues (recommended before commit)
- **CI/CD:** Lint runs automatically in GitHub Actions (`.github/workflows/ci.yml` and `publish.yml`). Commits/PRs failing lint will cause the pipeline to fail.
- TypeScript and Vue SFCs are deeply integrated in lint setup. Prefer explicit, non-`any` types.

## Testing Patterns
- Unit tests in `test/unit/src/` use **Vitest** with `describe`/`it` blocks
- Example: `finance.spec.ts` tests IR brackets and compound interest edge cases
- Test critical financial calculations exhaustively (tax tables, compound formulas)

## External Dependencies & Integration Points
- **BCB API** (`https://api.bcb.gov.br/`): Fetches DI, SELIC, savings rates
- Series IDs: `4391` (DI), `1 month avg`, others in `update-indexes.js`
- Series IDs: `4391` (DI), `1 month avg`, others in `update-indexes.mjs`
- **Nuxt Schema Org**: SEO metadata (Portuguese pt-BR)
- **Axios**: HTTP calls for index updates
- **SonarCloud**: CI/CD quality gates (see badges in README)
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout 🛎
uses: actions/checkout@v6
with:
fetch-depth: 0
show-progress: false
- uses: pnpm/action-setup@v4
name: Configure PNPM
- name: Setup node env 🏗
Expand All @@ -19,6 +22,8 @@ jobs:
cache: 'pnpm'
- name: Install dependencies 👨🏻‍💻
run: pnpm install --frozen-lockfile
- name: Lint check ✅
run: pnpm lint
- name: Tests 🧑‍🔬
run: pnpm test
- name: Deploy 😎
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ on:
branches:
- master
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout 🛎
uses: actions/checkout@v6
Expand All @@ -32,13 +30,19 @@ jobs:
cache: 'pnpm'
- name: Install dependencies 👨🏻‍💻
run: pnpm install --frozen-lockfile
- name: Lint check ✅
run: pnpm lint
- name: Deploy 😎
run: pnpm generate
- name: Publish 🍻
uses: actions/upload-pages-artifact@v4
with:
path: ./dist
deploy:
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/update-indexes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: Update Indexes
on:
workflow_dispatch:
schedule:
- cron: '0 8,12,18 * * 1-5'
timezone: 'America/Sao_Paulo'
- cron: '0 11,15,21 * * 1-5'

jobs:
update-indicadores:
permissions:
contents: write
name: Update indicadores
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 3 additions & 2 deletions app/components/InvestmentInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import PeriodTypeInput from './investment/PeriodTypeInput.vue'
<template>
<div class="bg-white rounded-lg shadow-md">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-lg font-semibold text-gray-900">Investimento</h2>
<h2 class="text-lg font-semibold text-gray-900">
Investimento
</h2>
</div>
<div class="px-6 py-4">
<form @submit.prevent>
Expand All @@ -37,4 +39,3 @@ import PeriodTypeInput from './investment/PeriodTypeInput.vue'
gap: 1rem;
}
</style>

Loading