Skip to content

Chore/2.3.0#641

Merged
Baroshem merged 10 commits intomainfrom
chore/2.3.0
Jul 23, 2025
Merged

Chore/2.3.0#641
Baroshem merged 10 commits intomainfrom
chore/2.3.0

Conversation

@Baroshem
Copy link
Copy Markdown
Owner

This pull request includes updates to align the project with Node.js 20, refactor type definitions, and enhance testing for security features. The most important changes include updating dependencies and configurations for Node.js 20, modifying type exports and type compatibility, and refining test cases for Content Security Policy (CSP) and Subresource Integrity (SRI).

Node.js 20 Migration:

  • Updated the Node.js version in the CI workflow from 18 to 20 (.github/workflows/ci.yml).
  • Changed the engines.node field in package.json to require Node.js 20 or higher (package.json).
  • Updated @types/node to match Node.js 20 and upgraded @nuxt/module-builder to version 1.0.1 (package.json).

Type Definitions and Exports:

  • Refactored type exports to use .mts files and removed the CommonJS require export (package.json).
  • Added typesVersions to specify type mappings for consumers (package.json).
  • Declared new runtime hooks and route configuration types for nitropack to support security rules (src/types/module.ts).

Code Simplification:

  • Removed compatibility code for Node.js 18 in the crypto utility, as Node.js 20 provides global crypto support (src/utils/crypto.ts).

CSP and SRI Testing Enhancements:

  • Adjusted expected counts for CSP nonces and SRI attributes in various test cases to reflect updated behavior (test/perRoute.test.ts, test/sri.test.ts, test/ssgHashes.test.ts, test/ssrNonce.test.ts) [1] [2] [3] [4] [5].
  • Marked a test for server-only components as skipped, with a TODO to re-enable it after addressing island context sharing (test/ssrNonce.test.ts).

Additional Notes:

  • Added a TODO comment to address compatibility with modern Nuxt versions that no longer use the island property (src/runtime/nitro/plugins/50-updateCsp.ts).

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 23, 2025

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

Name Status Preview Comments Updated (UTC)
nuxt-security ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2025 5:57am

@Baroshem Baroshem merged commit 9049b87 into main Jul 23, 2025
6 checks passed
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