Skip to content

refactor(tiktokPixel): use shared logger; fix docs passive voice#777

Merged
harlan-zw merged 1 commit into
mainfrom
fix/tiktok-pixel-logger-and-docs
May 14, 2026
Merged

refactor(tiktokPixel): use shared logger; fix docs passive voice#777
harlan-zw merged 1 commit into
mainfrom
fix/tiktok-pixel-logger-and-docs

Conversation

@harlan-zw
Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Follow-up to #776.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Two cleanups against #776:

  • Use the project's shared logger (packages/script/src/runtime/logger.ts) for the unhashed-PII warning in identify() instead of raw console.warn. Tags the message under nuxt-scripts:tiktokPixel so it matches every other registry warning.
  • Resolve the eslint passive-voice warning on 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.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 14, 2026

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

Project Deployment Actions Updated (UTC)
scripts-playground Ready Ready Preview, Comment May 14, 2026 6:06am

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 14, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@777

commit: 43d9733

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR improves logging in the TikTok Pixel integration by switching from console.warn to a structured logger when unhashed advanced-matching fields are detected in the identify() method. The logger is imported from the shared project utilities and tagged with 'tiktokPixel'. Documentation is updated to reflect that TikTok silently drops raw values and that Nuxt Scripts logs a development warning upon detection.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes both main changes: refactoring to use a shared logger and fixing documentation passive voice issues.
Description check ✅ Passed The description clearly relates to the changeset, detailing the logger refactoring and documentation fix with verification confirmation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tiktok-pixel-logger-and-docs

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

@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.

🧹 Nitpick comments (1)
packages/script/src/runtime/registry/tiktok-pixel.ts (1)

3-3: ⚡ Quick win

The logger module and API are correct. The Consola logger has a default tag 'nuxt-scripts' that auto-prefixes all withTag() calls, so logger.withTag('tiktokPixel').warn() correctly produces logs tagged as nuxt-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

📥 Commits

Reviewing files that changed from the base of the PR and between c5b6905 and 43d9733.

📒 Files selected for processing (2)
  • docs/content/scripts/tiktok-pixel.md
  • packages/script/src/runtime/registry/tiktok-pixel.ts

@harlan-zw harlan-zw merged commit 8b486fd into main May 14, 2026
19 checks passed
@harlan-zw harlan-zw deleted the fix/tiktok-pixel-logger-and-docs branch May 14, 2026 06:11
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.

1 participant