feat: add React 19 support, shared components, utilities, and CLI tooling#1
Merged
feat: add React 19 support, shared components, utilities, and CLI tooling#1
Conversation
…ling - Add React 19 support and enhance type definitions - Add CLI tool (htk) and standardized templates (Makefile, next.config, sitemap) - Add shared components: GoogleAnalytics, ScrollToTop, BasicPageLayout - Add ThemeContext with useTheme hook - Add utility functions: URL helpers, sitemap generation, address formatting, array shuffle (Fisher-Yates), email validation and obfuscation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6c17af1 to
68acf11
Compare
jontsai
commented
Feb 25, 2026
jontsai
commented
Feb 25, 2026
jontsai
commented
Feb 25, 2026
jontsai
commented
Feb 25, 2026
jontsai
commented
Feb 25, 2026
jontsai
commented
Feb 25, 2026
jontsai
commented
Feb 25, 2026
jontsai
commented
Feb 25, 2026
jontsai
commented
Feb 25, 2026
jontsai
commented
Feb 25, 2026
- GoogleAnalytics: validate measurement ID format before rendering - ScrollToTop: replace deprecated window.pageYOffset with window.scrollY, fix stale closure with useCallback, add passive scroll listener - ThemeContext: add missing 'use client' directive - urls: accept optional countryCode param in createPhoneUrl (default '1') - email: make entity encoding deterministic (index-based) to avoid SSR hydration mismatches - sitemap: support per-page lastmod overrides - Makefile template: remove --no-verify, use HEAD instead of master - types: replace icon: any with React.ReactNode - generate_sitemap template: fix package name, fix ESM/CJS mix - package.json: remove src from published files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the packages/core workspace to support React 19 and expands it into a more complete “core” package by adding shared components, a theme context, utility helpers, and a small CLI + templates meant to standardize consuming Next.js projects.
Changes:
- Rename/publish the core package as
@hacktoolkit/nextjs-htkand add CLI binaries (htk,nextjs-htk) plus template assets (Makefile, Next config template, sitemap script). - Add new shared React components (GA, ScrollToTop, BasicPageLayout) and a
ThemeContextwithuseTheme. - Add utilities (URLs, email validation/obfuscation, sitemap generation, address formatting, shuffle) and expand type definitions.
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/tsconfig.json | Replaces root extends with standalone TS config for the core package build. |
| packages/core/templates/scripts/generate_sitemap.ts | Adds a template script to generate sitemap.xml from htk.config. |
| packages/core/templates/next.config.mjs.template | Adds a Next.js config template aimed at React 19 + static export. |
| packages/core/templates/Makefile | Adds a standardized Makefile template for dev/build/deploy workflows. |
| packages/core/src/utils/urls.ts | Adds URL helper utilities (tel/mailto/maps + query params). |
| packages/core/src/utils/sitemap.ts | Adds sitemap XML generator utility. |
| packages/core/src/utils/index.ts | Barrel export for the new utils module. |
| packages/core/src/utils/email.ts | Adds email validation + obfuscation utilities. |
| packages/core/src/utils/algo.ts | Adds Fisher–Yates shuffle utility. |
| packages/core/src/utils/address.ts | Adds address formatting helper. |
| packages/core/src/types/index.ts | Expands site/config types and adds Page, social media link types, SEO config additions, etc. |
| packages/core/src/index.ts | Re-exports components, context, and utils from the package entrypoint. |
| packages/core/src/context/index.ts | Barrel export for context module(s). |
| packages/core/src/context/ThemeContext.tsx | Adds Theme provider and useTheme hook. |
| packages/core/src/components/index.ts | Barrel export for shared components. |
| packages/core/src/components/ScrollToTop.tsx | Adds a client component to show a scroll-to-top button. |
| packages/core/src/components/GoogleAnalytics.tsx | Adds a client component to load GA via next/script. |
| packages/core/src/components/BasicPageLayout.tsx | Adds a reusable basic layout component for simple content pages. |
| packages/core/package.json | Renames the package, adds bin entries, and updates exports. |
| packages/core/bin/htk.js | Adds CLI implementation for syncing template files. |
| packages/core/README.md | Documents CLI usage and utility examples. |
| packages/core/CLI_README.md | Adds standalone CLI documentation. |
| package-lock.json | Adds/updates lockfile content for the workspace dependency graph. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Export Location interface from address.ts - Use <div> instead of <p> for intro in BasicPageLayout (accepts ReactNode) - Fix unsafe localStorage cast in ThemeContext with proper validation - Make SEOConfig fields (formatTitle, description) optional - Add "type": "module" to package.json and remove require entries (output is ESM) - Extend root tsconfig.json in packages/core for consistent compiler options - Update CLI_README.md and README.md: replace old package name and npx commands - Add missing ESLint dev dependencies to root package.json to fix CI Co-Authored-By: Claude Opus 4.6 <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.
Uh oh!
There was an error while loading. Please reload this page.