Skip to content

feat: add React 19 support, shared components, utilities, and CLI tooling#1

Merged
jontsai merged 3 commits intomasterfrom
feat/react-19-support
Feb 25, 2026
Merged

feat: add React 19 support, shared components, utilities, and CLI tooling#1
jontsai merged 3 commits intomasterfrom
feat/react-19-support

Conversation

@jontsai
Copy link
Member

@jontsai jontsai commented Feb 25, 2026

  • 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

…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>
@jontsai jontsai force-pushed the feat/react-19-support branch from 6c17af1 to 68acf11 Compare February 25, 2026 06:32
- 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>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-htk and 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 ThemeContext with useTheme.
  • 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>
@jontsai jontsai merged commit 4a428be into master Feb 25, 2026
1 check passed
@jontsai jontsai deleted the feat/react-19-support branch February 25, 2026 07:35
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.

2 participants