-
Notifications
You must be signed in to change notification settings - Fork 346
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
fix: nuxt module not passing options correctly #1018
Conversation
🦋 Changeset detectedLatest commit: 7bb47cc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
WalkthroughThis pull request introduces a patch for the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
📦 Bundle size comparison
|
More templates
commit: |
A new canary is available for testing. You can install this latest build in your project with: pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add [email protected]
pnpm add @uploadthing/[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
.changeset/sharp-needles-collect.md (1)
1-5
: LGTM! Consider enhancing the change description.The changeset file is correctly formatted and appropriately describes the patch update for the "@uploadthing/nuxt" package. The use of a patch version bump is suitable for this bug fix.
To improve clarity, consider expanding the change description slightly. Here's a suggested revision:
- fix: options was not forwarded to uploadthing handler correctly + fix: ensure options are correctly forwarded to uploadthing handler in Nuxt moduleThis revision provides more context about the specific module affected by the fix.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- .changeset/sharp-needles-collect.md (1 hunks)
- packages/nuxt/src/module.ts (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
packages/nuxt/src/module.ts (2)
Line range hint
1-91
: Clarification needed on ModuleOptions interface changesThe AI-generated summary mentions the removal of
secret
andappId
properties from theModuleOptions
interface. However, these changes are not visible in the provided code snippet. Could you please clarify:
- Were these properties removed from the
ModuleOptions
interface?- If so, in which part of the file did this change occur?
- What was the rationale behind removing these properties?
This information is crucial for understanding the full scope of the changes and their potential impact on existing implementations.
To help clarify this, please run the following verification script:
#!/bin/bash # Description: Check for the presence or absence of 'secret' and 'appId' in ModuleOptions # Test: Search for 'secret' and 'appId' in ModuleOptions interface echo "Checking ModuleOptions interface for 'secret' and 'appId':" ast-grep --lang typescript --pattern 'export type ModuleOptions = RouteHandlerConfig & { $$$ secret?: $_ $$$ appId?: $_ $$$ }'This script will help determine if these properties are still present in the
ModuleOptions
interface.
38-38
: Approve change with considerationsThe modification to merge the entire
options
object intonuxt.options.runtimeConfig.uploadthing
aligns with the PR objective of fixing the issue with passing options correctly. This change simplifies the configuration process and allows for more flexible option passing.However, please consider the following:
- Verify that all properties in
options
are safe to include in the runtime config, as this change could potentially expose sensitive information if not handled carefully.- Update the documentation to reflect this change in behavior, clearly explaining which options are now available in the runtime config.
- Consider adding a migration guide for users upgrading from the previous version, especially if they relied on the specific handling of
token
andlogLevel
properties.To ensure that this change doesn't introduce any unintended consequences, please run the following verification script:
This script will help identify any potential security concerns and verify the usage of the runtime config throughout the codebase.
✅ Verification successful
Verified: No sensitive information is exposed by merging
options
intonuxt.options.runtimeConfig.uploadthing
.The
ModuleOptions
interface does not include sensitive keys, and the usage ofnuxt.options.runtimeConfig.uploadthing
is appropriately scoped withinmodule.ts
. No further issues were found.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any sensitive information in the options object and verify usage of runtime config # Test 1: Check for any sensitive keys in the ModuleOptions interface echo "Checking ModuleOptions interface for potentially sensitive keys:" ast-grep --lang typescript --pattern 'export type ModuleOptions = RouteHandlerConfig & { $$$ }' # Test 2: Search for usage of nuxt.options.runtimeConfig.uploadthing in the codebase echo "Checking usage of nuxt.options.runtimeConfig.uploadthing:" rg --type typescript 'nuxt\.options\.runtimeConfig\.uploadthing' # Test 3: Look for any comments or TODOs related to sensitive information in the config echo "Checking for comments about sensitive information:" rg --type typescript '(?i)(sensitive|secret|password|key).*config'Length of output: 869
Script:
#!/bin/bash # Description: Check for any sensitive information in the options object and verify usage of runtime config # Test 1: Check for any sensitive keys in the ModuleOptions interface echo "Checking ModuleOptions interface for potentially sensitive keys:" ast-grep --lang typescript --pattern 'export type ModuleOptions = RouteHandlerConfig & { $$$ }' # Test 2: Search for usage of nuxt.options.runtimeConfig.uploadthing in the codebase echo "Checking usage of nuxt.options.runtimeConfig.uploadthing:" rg 'nuxt\.options\.runtimeConfig\.uploadthing' --type-add 'typescript:*.ts,*.tsx' --type=typescript # Test 3: Look for any comments or TODOs related to sensitive information in the config echo "Checking for comments about sensitive information:" rg '(?i)(sensitive|secret|password|key).*config' --type-add 'typescript:*.ts,*.tsx' --type=typescriptLength of output: 1147
Script:
#!/bin/bash # Description: Check for any sensitive information in the options object and verify usage of runtime config # Test 1: Check for any sensitive keys in the ModuleOptions interface echo "Checking ModuleOptions interface for potentially sensitive keys:" ast-grep --lang typescript --pattern 'export type ModuleOptions = RouteHandlerConfig & { $$$ }' # Test 2: Search for usage of nuxt.options.runtimeConfig.uploadthing in the codebase echo "Checking usage of nuxt.options.runtimeConfig.uploadthing:" fd --extension ts --extension tsx --type f | xargs rg 'nuxt\.options\.runtimeConfig\.uploadthing' # Test 3: Look for any comments or TODOs related to sensitive information in the config echo "Checking for comments about sensitive information:" fd --extension ts --extension tsx --type f | xargs rg '(?i)(sensitive|secret|password|key).*config'Length of output: 1860
Closes #1014
Summary by CodeRabbit
Bug Fixes
New Features
Documentation
secret
andappId
properties.