refactor(tiktokPixel): use shared logger; fix docs passive voice#777
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
📝 WalkthroughWalkthroughThis PR improves logging in the TikTok Pixel integration by switching from Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/script/src/runtime/registry/tiktok-pixel.ts (1)
3-3: ⚡ Quick winThe logger module and API are correct. The Consola logger has a default tag
'nuxt-scripts'that auto-prefixes all withTag() calls, sologger.withTag('tiktokPixel').warn()correctly produces logs tagged asnuxt-scripts:tiktokPixel.Minor note: Other registry scripts use a variable for the tag (e.g.,
logger.withTag(registryKey)) rather than hardcoding it. Consider aligning with this pattern for consistency.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/script/src/runtime/registry/tiktok-pixel.ts` at line 3, Replace the hardcoded tag string in the logger call with the registry key variable for consistency: locate the logger usage (logger.withTag('tiktokPixel').warn(...) or similar) in tiktok-pixel.ts and change it to use the existing registryKey variable (logger.withTag(registryKey).warn(...)) so it matches other registry scripts that use a variable tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/script/src/runtime/registry/tiktok-pixel.ts`:
- Line 3: Replace the hardcoded tag string in the logger call with the registry
key variable for consistency: locate the logger usage
(logger.withTag('tiktokPixel').warn(...) or similar) in tiktok-pixel.ts and
change it to use the existing registryKey variable
(logger.withTag(registryKey).warn(...)) so it matches other registry scripts
that use a variable tag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a0ab0ae8-2723-4efb-93d2-3421d79bd44d
📒 Files selected for processing (2)
docs/content/scripts/tiktok-pixel.mdpackages/script/src/runtime/registry/tiktok-pixel.ts
🔗 Linked issue
Follow-up to #776.
❓ Type of change
📚 Description
Two cleanups against #776:
logger(packages/script/src/runtime/logger.ts) for the unhashed-PII warning inidentify()instead of rawconsole.warn. Tags the message undernuxt-scripts:tiktokPixelso it matches every other registry warning.docs/content/scripts/tiktok-pixel.md(Advanced Matching section).✅ Verification
pnpm lint packages/script/src/runtime/registry/tiktok-pixel.ts docs/content/scripts/tiktok-pixel.md— zero issues on the modified files.