From 51cd422ef8dd84d54f83a38eb545138c5eecb199 Mon Sep 17 00:00:00 2001 From: umsungjun <99730910+umsungjun@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:25:28 +0900 Subject: [PATCH 1/2] feat: add and export ReactHeadSafeProps type definitions - Define ReactHeadSafeProps in src/types.ts with JSDoc comments - Update ReactHeadSafe to use the new type - Export ReactHeadSafeProps from index.ts for external use - Configure TypeScript to emit declaration files for consumers --- src/ReactHeadSafe.tsx | 20 +++----------------- src/index.ts | 2 +- src/types.ts | 14 ++++++++++++++ tsconfig.json | 1 + 4 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 src/types.ts diff --git a/src/ReactHeadSafe.tsx b/src/ReactHeadSafe.tsx index d1fbe4d..d3b0933 100644 --- a/src/ReactHeadSafe.tsx +++ b/src/ReactHeadSafe.tsx @@ -1,19 +1,5 @@ -import React, { useLayoutEffect } from 'react'; - -export interface ReactHeadSafeProps { - /** The page title that will be set in the document.title */ - title?: string; - /** The meta description tag content for SEO */ - description?: string; - /** The meta keywords tag content for SEO */ - keywords?: string; - /** The Open Graph title (og:title) for social media sharing */ - ogTitle?: string; - /** The Open Graph description (og:description) for social media sharing */ - ogDescription?: string; - /** The Open Graph image URL (og:image) for social media sharing */ - ogImage?: string; -} +import { FC, useLayoutEffect } from 'react'; +import { type ReactHeadSafeProps } from './types'; /** * @description @@ -30,7 +16,7 @@ export interface ReactHeadSafeProps { * ogImage="https://example.com/image.jpg" * /> */ -export const ReactHeadSafe: React.FC = ({ +export const ReactHeadSafe: FC = ({ title, description, keywords, diff --git a/src/index.ts b/src/index.ts index 6c9aaeb..68c285c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,2 @@ export { ReactHeadSafe } from './ReactHeadSafe'; -export type { ReactHeadSafeProps } from './ReactHeadSafe'; +export type { ReactHeadSafeProps } from './types'; diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..0da63d2 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,14 @@ +export interface ReactHeadSafeProps { + /** The page title that will be set in the document.title */ + title?: string; + /** The meta description tag content for SEO */ + description?: string; + /** The meta keywords tag content for SEO */ + keywords?: string; + /** The Open Graph title (og:title) for social media sharing */ + ogTitle?: string; + /** The Open Graph description (og:description) for social media sharing */ + ogDescription?: string; + /** The Open Graph image URL (og:image) for social media sharing */ + ogImage?: string; +} diff --git a/tsconfig.json b/tsconfig.json index ad4da12..72d2465 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "lib": ["ES2020", "DOM"], "jsx": "react", "declaration": true, + "declarationMap": true, "outDir": "./dist", "rootDir": "./src", "strict": true, From c81456f072ecbdbc15ca55e42fea161444351b17 Mon Sep 17 00:00:00 2001 From: umsungjun <99730910+umsungjun@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:27:13 +0900 Subject: [PATCH 2/2] 1.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d827f3a..38adf38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-head-safe", - "version": "1.0.1", + "version": "1.0.2", "description": "A lightweight React head manager for CSR apps. Safely manage document title, meta tags, Open Graph, and SEO metadata without duplicates. TypeScript support included.", "author": "umsungjun", "license": "MIT",