feat(install-tracker): idiomatic <Script> for Next.js + optional subdir input - #14
Merged
Merged
Conversation
Two upgrades to the auto-PR flow: 1. For Next.js layouts (.tsx/.jsx targets), insert the snippet as the <Script> component from next/script with strategy="afterInteractive" instead of a raw <script> tag. Avoids hydration warnings; matches how Next docs tell you to add third-party scripts. Auto-adds `import Script from "next/script";` after the last top-level import if the file doesn't already pull it in. Plain HTML / Hugo / Jekyll / Astro layouts still get a raw <script>. 2. The Stats-tab "Install via GitHub" modal now has an optional collapsed "Subdirectory" input. Fill in e.g. "apps/web" for monorepos where auto-detection picks the wrong file (or to be explicit). Empty = auto-detect (canonical paths first, then code search). API + installTracker were already plumbed for rootPath; this just exposes it in the UI. PR body now also shows the actual snippet that was inserted (with the right language fence: tsx for Next.js, html otherwise) and mentions the auto-added import. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two improvements: (a) For .tsx/.jsx targets the snippet uses next/script's <Script> component with strategy="afterInteractive" + auto-adds the import. (b) The install modal has a collapsible 'Subdirectory' input for monorepos so users can pin apps/web when auto-detection misses.