Skip to content

chore: use nuxt-security#1656

Closed
iiio2 wants to merge 1 commit intonpmx-dev:mainfrom
iiio2:chore/use-nuxt-security
Closed

chore: use nuxt-security#1656
iiio2 wants to merge 1 commit intonpmx-dev:mainfrom
iiio2:chore/use-nuxt-security

Conversation

@iiio2
Copy link
Copy Markdown
Contributor

@iiio2 iiio2 commented Feb 26, 2026

🔗 Linked issue

🧭 Context

📚 Description

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs.npmx.dev Ready Ready Preview, Comment Feb 26, 2026 6:49am
npmx.dev Ready Ready Preview, Comment Feb 26, 2026 6:49am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Feb 26, 2026 6:49am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

This pull request introduces the nuxt-security module as a new runtime dependency version 2.5.1 in package.json. Additionally, nuxt.config.ts is modified to conditionally include this module during build time. The configuration uses environment checks to exclude nuxt-security when either in development mode or running on Windows systems. The module installation path and runtime behaviour are adjusted based on these conditions.

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is empty and provides no substantive information about the changes, though the title and file changes indicate this PR adds nuxt-security integration. Please provide a detailed description explaining the purpose of adding nuxt-security, why it was needed, and how the conditional logic (dev/Windows environments) addresses the use case.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e61657e and 87225f4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • nuxt.config.ts
  • package.json

Comment thread nuxt.config.ts
import process from 'node:process'
import { currentLocales } from './config/i18n'
import { isCI, isTest, provider } from 'std-env'
import { isCI, isDevelopment, isWindows, isTest, provider } from 'std-env'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find and examine the nuxt.config.ts file
find . -name "nuxt.config.ts" -type f

Repository: npmx-dev/npmx.dev

Length of output: 99


🏁 Script executed:

# Once we locate it, let's examine lines around 3 and 18
cat -n nuxt.config.ts | head -30

Repository: npmx-dev/npmx.dev

Length of output: 931


🌐 Web query:

nuxt-security module Windows compatibility limitations requirements

💡 Result:

Windows compatibility (nuxt-security / nuxt-security)

  • No Windows-specific limitation is documented: the module is JavaScript/TypeScript and is expected to work on Windows, macOS, and Linux anywhere Nuxt runs. [1]
  • Practical “Windows compatibility” therefore mostly means: your Node + Nuxt versions must be supported, and your target runtime (Node serverless/edge/worker/static) must support the underlying Nuxt/Nitro features you’re using. [1]

Requirements

  • Nuxt: Nuxt 3.x or newer (incl. Nuxt 4.x). [1]
  • Node.js: Node 18+ (Nuxt 3’s baseline; nuxt-security explicitly restored/targets Node 18 compatibility). [2]

Notable limitations / constraints (not Windows-specific)

  • Strict CSP nuances: strict-dynamic is script-src only, and it authorizes scripts, not styles (dynamic styles can still be blocked depending on your setup). [3]
  • Devtools + strict CSP: there have been compatibility edge-cases between Nuxt DevTools script injection and strict CSP nonce injection (fixed/improved over time, but it’s a known area). [4]
  • Lightweight runtimes (workers/edge): the project has explicitly optimized to reduce CPU/memory (e.g., removing cheerio) to behave better in lightweight environments—meaning runtime choice can matter more than OS choice. [5]

Sources: [1] [2] [3] [4] [5]


Avoid disabling nuxt-security for every Windows environment.

Line 18 currently skips the module whenever isWindows is true, including production runs, which silently removes security hardening. Web verification confirms no documented Windows-specific limitations exist for nuxt-security—the module is JavaScript/TypeScript and works across all operating systems where Nuxt runs.

Suggested patch
-    ...(isDevelopment || isWindows ? [] : ['nuxt-security']),
+    ...(isDevelopment && isWindows ? [] : ['nuxt-security']),

@danielroe
Copy link
Copy Markdown
Member

let's avoid this for now - happy to revisit later.

@danielroe danielroe closed this Feb 26, 2026
@iiio2
Copy link
Copy Markdown
Contributor Author

iiio2 commented Feb 26, 2026

@danielroe , Ok. Thanks.

@iiio2 iiio2 deleted the chore/use-nuxt-security branch February 26, 2026 11:10
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