Skip to content

chore(deps): upgrade dev deps to fix audit and bump 3.2.0#27

Merged
andrenfe merged 3 commits intomasterfrom
chore/dependabot
Apr 25, 2026
Merged

chore(deps): upgrade dev deps to fix audit and bump 3.2.0#27
andrenfe merged 3 commits intomasterfrom
chore/dependabot

Conversation

@andrekutianski
Copy link
Copy Markdown
Collaborator

@andrekutianski andrekutianski commented Apr 25, 2026

Summary

  • Resolves all 14 npm audit vulnerabilities (7 high, 7 moderate) in devDependencies — runtime SDK behavior is unchanged
  • Bumps version 3.1.03.2.0 (minor) with CHANGELOG entry in Portuguese
  • Adapts type generation to openapi-typescript v7 (AST output, URL input, Redocly config) — fixes a real duplicate operationId in nf-servico-v1.yaml that v6 silently merged

Dependency upgrades (devDependencies only)

Package From To
@typescript-eslint/eslint-plugin ^6.21.0 ^8.59.0
@typescript-eslint/parser ^6.21.0 ^8.59.0
vitest ^1.6.1 ^3.2.4
@vitest/coverage-v8 ^1.6.1 ^3.2.4
@vitest/ui ^1.6.1 ^3.2.4
openapi-typescript ^6.7.0 ^7.13.0

Vitest stayed on the 3.x line (not 4.x) to keep Node 18 supported — vitest 4 depends on rolldown, which requires Node 20+. The patched esbuild is already available via vitest 3.x's Vite dependency, so audit remains at 0 vulnerabilities.

Spec change

openapi/spec/nf-servico-v1.yaml: renamed operationId of GET /v1/companies/{company_id}/serviceinvoices/external/{id} from ServiceInvoices_idGetServiceInvoices_externalIdGet. Resolves a real duplicate that v6 silently merged. Metadata-only change — does not affect API runtime behavior.

Possible type-level impact for consumers

Users referencing internal generated types (operations["ServiceInvoices_idGet"]) for the /external/{id} endpoint must switch to operations["ServiceInvoices_externalIdGet"]. Consumers using only NfeClient and its public methods are not affected.

Test plan

  • npm audit reports 0 vulnerabilities
  • npm run validate:spec — all 12 specs valid
  • npm run generate — 7 specs generated successfully
  • npm run lint — 0 errors (35 preexisting any warnings)
  • npm run typecheck — passes
  • npm test -- --run606 passed, 47 skipped
  • npm run build — success (dist/index.d.ts 457 KB)
  • Full pipeline validated under Node 18.20.8 and Node 24.13.1
  • CI green on Node 18.x, 20.x, 22.x

Resolves all 14 npm audit vulnerabilities (7 high, 7 moderate) by
upgrading devDependencies. Runtime behavior unchanged — vulnerabilities
were only in build/test tooling, not distributed in the published package.

Upgrades:
- @typescript-eslint/{eslint-plugin,parser}: ^6.21.0 → ^8.59.0
- vitest, @vitest/coverage-v8, @vitest/ui: ^1.6.1 → ^4.1.5
- openapi-typescript: ^6.7.0 → ^7.13.0

Adapts scripts/generate-types.ts to openapi-typescript v7 (AST output via
astToString, URL input, Redocly config to tolerate legacy specs). Renames
duplicate operationId in nf-servico-v1.yaml — v6 silently merged the two
distinct operations under /external/{id} and /{id}; v7 correctly keeps
them separate. Migrates test signatures for vitest 4 (it() options arg
moved to second position, FormData mock uses function instead of arrow).

Bumps version 3.1.0 → 3.2.0 (minor) and adds CHANGELOG entry.
CI on Node 18 failed because vitest 4 depends on rolldown, which
imports `styleText` from node:util — only available in Node 20+.

Downgrade vitest, @vitest/coverage-v8 and @vitest/ui from ^4.1.5 to
^3.2.4. Vitest 3.2.4 supports Node 18 ^ 20 ^ >=22 and already ships
with the patched esbuild via Vite, so npm audit remains at 0
vulnerabilities. Existing test changes (it(name, opts, fn) signature,
FormData function mock) are forward-compatible with both 3.x and 4.x.

Validated full pipeline (validate:spec, generate, lint, typecheck,
build, test) under Node 18.20.8 and Node 24.13.1.
The job uses actions/github-script to post a PR comment with spec
validation info, but failed with HTTP 403 "Resource not accessible by
integration" because the default GITHUB_TOKEN permissions for the
workflow were read-only.

Scope the new permissions to this job only (least privilege) and
keep `contents: read` for checkout — adding a `permissions:` block
implicitly drops all other defaults to none.
@github-actions
Copy link
Copy Markdown

📋 OpenAPI Spec Validation

✅ All specs validated and types generated successfully

Specs processed:

  • calculo-impostos-v1.yaml - 27.90 KB, 853 lines
  • consulta-cnpj.yaml - 34.28 KB, 1128 lines
  • consulta-cpf.yaml - 3.39 KB, 83 lines
  • consulta-cte-v2.yaml - 18.33 KB, 578 lines
  • consulta-endereco.yaml - 11.17 KB, 343 lines
  • consulta-nf-consumidor.yaml - 43.41 KB, 1279 lines
  • consulta-nf.yaml - 137.87 KB, 3119 lines
  • consulta-nfe-distribuicao-v1.yaml - 53.07 KB, 1775 lines
  • nf-consumidor-v2.yaml - 293.87 KB, 7609 lines
  • nf-produto-v2.yaml - 309.41 KB, 8204 lines
  • nf-servico-v1.yaml - 257.42 KB, 6252 lines
  • nfeio.yaml - 15.86 KB, 630 lines

Generated types available as artifact in src/generated/.

@andrenfe andrenfe merged commit 73e5587 into master Apr 25, 2026
15 checks passed
@andrenfe andrenfe deleted the chore/dependabot branch April 25, 2026 23:47
@andrenfe andrenfe self-assigned this Apr 26, 2026
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.

2 participants