From 21e54645fadb26c61f80dd26df3762f29ef6d0da Mon Sep 17 00:00:00 2001 From: Andrew Ghostuhin Date: Tue, 13 Oct 2026 03:19:06 +0300 Subject: [PATCH 1/3] refactor(nextjs)!: retire Helmet document workspace --- .pnp.cjs | 43 ------------ ...in-react-helmet-npm-3.3.2-c27db9f3f4.patch | 60 ----------------- .yarn/versions/e8bfa597.yml | 1 - README.md | 4 -- package.json | 3 - .../next-document-with-helmet/package.json | 33 ---------- .../src/helmet-state.context.ts | 7 -- .../next-document-with-helmet/src/index.ts | 2 - .../src/with-helmet-app.provider.tsx | 32 --------- .../src/with-helmet.provider.tsx | 66 ------------------- yarn.lock | 36 ---------- 11 files changed, 287 deletions(-) delete mode 100644 .yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch delete mode 100644 packages/next-document-with-helmet/package.json delete mode 100644 packages/next-document-with-helmet/src/helmet-state.context.ts delete mode 100644 packages/next-document-with-helmet/src/index.ts delete mode 100644 packages/next-document-with-helmet/src/with-helmet-app.provider.tsx delete mode 100644 packages/next-document-with-helmet/src/with-helmet.provider.tsx diff --git a/.pnp.cjs b/.pnp.cjs index 39fa7067..8c475cac 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -22,10 +22,6 @@ const RAW_RUNTIME_STATE = "name": "@atls/next-document-with-gtag",\ "reference": "workspace:packages/next-document-with-gtag"\ },\ - {\ - "name": "@atls/next-document-with-helmet",\ - "reference": "workspace:packages/next-document-with-helmet"\ - },\ {\ "name": "@atls/next-document-with-icons",\ "reference": "workspace:packages/next-document-with-icons"\ @@ -44,7 +40,6 @@ const RAW_RUNTIME_STATE = "pnpZipBackend": "libzip",\ "fallbackExclusionList": [\ ["@atls/next-document-with-gtag", ["workspace:packages/next-document-with-gtag"]],\ - ["@atls/next-document-with-helmet", ["workspace:packages/next-document-with-helmet"]],\ ["@atls/next-document-with-icons", ["workspace:packages/next-document-with-icons"]],\ ["@atls/next-document-with-opengraph", ["workspace:packages/next-document-with-opengraph"]],\ ["@atls/next-identity-integration", ["workspace:packages/identity-integration"]],\ @@ -152,22 +147,6 @@ const RAW_RUNTIME_STATE = "linkType": "SOFT"\ }]\ ]],\ - ["@atls/next-document-with-helmet", [\ - ["workspace:packages/next-document-with-helmet", {\ - "packageLocation": "./packages/next-document-with-helmet/",\ - "packageDependencies": [\ - ["@atls/next-document-with-helmet", "workspace:packages/next-document-with-helmet"],\ - ["@dr.pogodin/react-helmet", "virtual:bf8a1598fa6a66838edf04cd1858984042966b4dcd6467a6373e96df1c74a52c69bba5507bf11b15cc923202e7da164deec40286571ad0c3340926914fe509d0#patch:@dr.pogodin/react-helmet@npm%3A3.3.2#~/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch::version=3.3.2&hash=b2334b"],\ - ["@types/node", "npm:24.19.1"],\ - ["@types/react", "npm:19.3.0"],\ - ["@types/react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:19.3.0"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:16.4.0"],\ - ["react", "npm:19.3.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:19.3.0"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ ["@atls/next-document-with-icons", [\ ["workspace:packages/next-document-with-icons", {\ "packageLocation": "./packages/next-document-with-icons/",\ @@ -624,28 +603,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["@dr.pogodin/react-helmet", [\ - ["patch:@dr.pogodin/react-helmet@npm%3A3.3.2#~/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch::version=3.3.2&hash=b2334b", {\ - "packageLocation": "../.yarn/berry/cache/@dr.pogodin-react-helmet-patch-fecd1f971f-10.zip/node_modules/@dr.pogodin/react-helmet/",\ - "packageDependencies": [\ - ["@dr.pogodin/react-helmet", "patch:@dr.pogodin/react-helmet@npm%3A3.3.2#~/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch::version=3.3.2&hash=b2334b"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["virtual:bf8a1598fa6a66838edf04cd1858984042966b4dcd6467a6373e96df1c74a52c69bba5507bf11b15cc923202e7da164deec40286571ad0c3340926914fe509d0#patch:@dr.pogodin/react-helmet@npm%3A3.3.2#~/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch::version=3.3.2&hash=b2334b", {\ - "packageLocation": "./.yarn/__virtual__/@dr.pogodin-react-helmet-virtual-6ba2383e91/2/.yarn/berry/cache/@dr.pogodin-react-helmet-patch-fecd1f971f-10.zip/node_modules/@dr.pogodin/react-helmet/",\ - "packageDependencies": [\ - ["@dr.pogodin/react-helmet", "virtual:bf8a1598fa6a66838edf04cd1858984042966b4dcd6467a6373e96df1c74a52c69bba5507bf11b15cc923202e7da164deec40286571ad0c3340926914fe509d0#patch:@dr.pogodin/react-helmet@npm%3A3.3.2#~/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch::version=3.3.2&hash=b2334b"],\ - ["@types/react", "npm:19.3.0"],\ - ["react", "npm:19.3.0"]\ - ],\ - "packagePeers": [\ - "@types/react",\ - "react"\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["@emnapi/runtime", [\ ["npm:1.11.3", {\ "packageLocation": "../.yarn/berry/cache/@emnapi-runtime-npm-1.11.3-92f9e84cee-10.zip/node_modules/@emnapi/runtime/",\ diff --git a/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch b/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch deleted file mode 100644 index 323e84a6..00000000 --- a/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/build/types/Helmet.d.ts b/build/types/Helmet.d.ts -index acf8e34d008be053fdecb85fc62b2b0b6cae5fee..73b372f98cfbfadfc2563f44de2a558f265ee787 100644 ---- a/build/types/Helmet.d.ts -+++ b/build/types/Helmet.d.ts -@@ -1,4 +1,4 @@ - import { type FunctionComponent } from 'react'; --import type { HelmetProps } from './types'; -+import type { HelmetProps } from './types.js'; - declare const Helmet: FunctionComponent; - export default Helmet; -diff --git a/build/types/Provider.d.ts b/build/types/Provider.d.ts -index fea729bf8a7dbf106503e7c745af2d9d560dc798..71b34b08159eaac833eee719b7bd2dcec6818859 100644 ---- a/build/types/Provider.d.ts -+++ b/build/types/Provider.d.ts -@@ -1,5 +1,5 @@ - import { type FunctionComponent, type ReactNode } from 'react'; --import type { ContextValue, HelmetServerState } from './types'; -+import type { ContextValue, HelmetServerState } from './types.js'; - export declare const Context: import("react").Context; - type ProviderProps = { - children?: ReactNode; -diff --git a/build/types/client.d.ts b/build/types/client.d.ts -index 8338f3dc91451674afeee656e96fa0f004df77ae..104cc4ac9a072ee199314ec846d76286832f7e09 100644 ---- a/build/types/client.d.ts -+++ b/build/types/client.d.ts -@@ -1,2 +1,2 @@ --import type { AggregatedState } from './types'; -+import type { AggregatedState } from './types.js'; - export declare function commitTagChanges(newState: AggregatedState, firstRender: boolean): void; -diff --git a/build/types/index.d.ts b/build/types/index.d.ts -index bc260a94cb5973fc75b904ad7a3761e4ae86defc..8e609c50d8b176d8897b007663fdd89b3baf517c 100644 ---- a/build/types/index.d.ts -+++ b/build/types/index.d.ts -@@ -1,4 +1,4 @@ --export type * from './types'; --export { default as Helmet } from './Helmet'; --export { default as MetaTags } from './MetaTags'; --export { default as HelmetProvider } from './Provider'; -+export type * from './types.js'; -+export { default as Helmet } from './Helmet.js'; -+export { default as MetaTags } from './MetaTags.js'; -+export { default as HelmetProvider } from './Provider.js'; -diff --git a/build/types/server.d.ts b/build/types/server.d.ts -index c47d631dab13248745dc712fb1acc6d248afd2ba..c2d0cbe2772cee536ca369038fd0c10e4793a7f5 100644 ---- a/build/types/server.d.ts -+++ b/build/types/server.d.ts -@@ -1,2 +1,2 @@ --import type { HelmetProviderHeap, HelmetServerState } from './types'; -+import type { HelmetProviderHeap, HelmetServerState } from './types.js'; - export declare function newServerState(heap: HelmetProviderHeap): HelmetServerState; -diff --git a/build/types/utils.d.ts b/build/types/utils.d.ts -index b6421a1784e040e8fd4e72cf422bd36fb8ec648a..f4a28f18585375a25c53758136ec7a910e9df425 100644 ---- a/build/types/utils.d.ts -+++ b/build/types/utils.d.ts -@@ -1,4 +1,4 @@ --import type { AggregatedState, BaseProps, HelmetPropArrays, HelmetPropObjects, HelmetProps, PropArrayItem, RegisteredHelmetPropsArray } from './types'; -+import type { AggregatedState, BaseProps, HelmetPropArrays, HelmetPropObjects, HelmetProps, PropArrayItem, RegisteredHelmetPropsArray } from './types.js'; - type PropList = Record; - type AttributeList = string[]; - type MatchProps = Record; diff --git a/.yarn/versions/e8bfa597.yml b/.yarn/versions/e8bfa597.yml index 4b38b699..358c0eed 100644 --- a/.yarn/versions/e8bfa597.yml +++ b/.yarn/versions/e8bfa597.yml @@ -1,6 +1,5 @@ releases: "@atls/next-document-with-gtag": major - "@atls/next-document-with-helmet": major "@atls/next-document-with-icons": major "@atls/next-document-with-opengraph": major "@atls/next-identity-integration": patch diff --git a/README.md b/README.md index 1def88d5..fc0764b8 100755 --- a/README.md +++ b/README.md @@ -22,10 +22,6 @@ Интеграция Google Analytics с помощью `gtag.js` для отслеживания пользовательских событий и метрик. -### 🎩  `next-document-with-helmet` - -Поддержка react-helmet для управления динамическими мета-тегами и другими элементами заголовка. - ### 🌟  `next-document-with-icons` Поддержка кастомных иконок для веб-приложений, включая favicon и другие варианты. diff --git a/package.json b/package.json index da89ef17..e707b61c 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,6 @@ ], "*.{test,spec}.{ts,tsx}": "yarn test unit" }, - "resolutions": { - "@dr.pogodin/react-helmet": "patch:@dr.pogodin/react-helmet@npm%3A3.3.2#~/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch" - }, "devDependencies": { "@atls/raijin": "latest", "@types/node": "24.19.1" diff --git a/packages/next-document-with-helmet/package.json b/packages/next-document-with-helmet/package.json deleted file mode 100644 index cf712f5b..00000000 --- a/packages/next-document-with-helmet/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@atls/next-document-with-helmet", - "version": "0.3.1", - "license": "BSD-3 Clause", - "main": "src/index.ts", - "files": [ - "dist" - ], - "scripts": { - "build": "yarn library build", - "prepack": "yarn run build", - "postpack": "rm -rf dist" - }, - "devDependencies": { - "@dr.pogodin/react-helmet": "3.3.2", - "@types/node": "24.19.1", - "@types/react": "19.3.0", - "@types/react-dom": "19.3.0", - "next": "16.4.0", - "react": "19.3.0", - "react-dom": "19.3.0" - }, - "peerDependencies": { - "@dr.pogodin/react-helmet": "^3.3.2", - "next": "^16.0.0", - "react": "^19.0.0" - }, - "publishConfig": { - "main": "dist/index.js", - "typings": "dist/index.d.ts" - }, - "typecheckSkipLibCheck": true -} diff --git a/packages/next-document-with-helmet/src/helmet-state.context.ts b/packages/next-document-with-helmet/src/helmet-state.context.ts deleted file mode 100644 index b838ee7a..00000000 --- a/packages/next-document-with-helmet/src/helmet-state.context.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { HelmetServerState } from '@dr.pogodin/react-helmet' - -import { createContext } from 'react' - -export const HelmetStateContext = createContext<((state: HelmetServerState) => void) | undefined>( - undefined -) diff --git a/packages/next-document-with-helmet/src/index.ts b/packages/next-document-with-helmet/src/index.ts deleted file mode 100644 index 613f0594..00000000 --- a/packages/next-document-with-helmet/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { withHelmet } from './with-helmet.provider' -export { withHelmetApp } from './with-helmet-app.provider' diff --git a/packages/next-document-with-helmet/src/with-helmet-app.provider.tsx b/packages/next-document-with-helmet/src/with-helmet-app.provider.tsx deleted file mode 100644 index bc636148..00000000 --- a/packages/next-document-with-helmet/src/with-helmet-app.provider.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import type { AppContext } from 'next/app' -import type { AppInitialProps } from 'next/app' -import type { AppProps } from 'next/app' -import type { AppType } from 'next/app' -import type { PropsWithChildren } from 'react' - -import { HelmetProvider } from '@dr.pogodin/react-helmet' -import { useContext } from 'react' -import React from 'react' - -import { HelmetStateContext } from './helmet-state.context.js' - -const HelmetAppProvider = ({ children }: PropsWithChildren) => { - const onServerState = useContext(HelmetStateContext) - - return {children} -} - -export const withHelmetApp = () => (AppComponent: AppType) => - class WithHelmetApp extends React.Component { - static async getInitialProps(context: AppContext): Promise> { - return AppComponent.getInitialProps?.(context) ?? {} - } - - render() { - return ( - - - - ) - } - } diff --git a/packages/next-document-with-helmet/src/with-helmet.provider.tsx b/packages/next-document-with-helmet/src/with-helmet.provider.tsx deleted file mode 100644 index 5e600b17..00000000 --- a/packages/next-document-with-helmet/src/with-helmet.provider.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint-disable @next/next/no-document-import-in-page */ - -import type { DocumentContext, DocumentInitialProps } from 'next/document' -import type { HelmetServerState } from '@dr.pogodin/react-helmet' -import type Document from 'next/document' - -import { Head } from 'next/document' -import { Html } from 'next/document' -import { Main } from 'next/document' -import { NextScript } from 'next/document' -import React from 'react' - -import { HelmetStateContext } from './helmet-state.context.js' - -export const withHelmet = () => (TargetComponent: typeof Document) => - class WithHelmet extends TargetComponent { - static override async getInitialProps( - context: DocumentContext - ): Promise { - let helmet: HelmetServerState | undefined - const { renderPage } = context - - context.renderPage = async () => - renderPage({ - enhanceApp: (App) => (props) => ( - { - helmet = state - }} - > - - - ), - }) - - const props = await super.getInitialProps(context) - - const helmetHead = helmet - ? (Object.keys(helmet) as Array) - .filter( - (key): key is Exclude => - key !== 'htmlAttributes' && key !== 'bodyAttributes' - ) - .flatMap((key) => React.Children.toArray(helmet?.[key]?.toComponent())) - .filter(React.isValidElement) - : [] - - props.head = [...(props.head ?? []), ...helmetHead] - - return { ...props, helmet } - } - - render() { - const { helmet } = this.props as typeof this.props & { helmet?: HelmetServerState } - - return ( - - - -
- - - - ) - } - } diff --git a/yarn.lock b/yarn.lock index 97984f00..8422eb4d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -80,24 +80,6 @@ __metadata: languageName: unknown linkType: soft -"@atls/next-document-with-helmet@workspace:packages/next-document-with-helmet": - version: 0.0.0-use.local - resolution: "@atls/next-document-with-helmet@workspace:packages/next-document-with-helmet" - dependencies: - "@dr.pogodin/react-helmet": "npm:3.3.2" - "@types/node": "npm:24.19.1" - "@types/react": "npm:19.3.0" - "@types/react-dom": "npm:19.3.0" - next: "npm:16.4.0" - react: "npm:19.3.0" - react-dom: "npm:19.3.0" - peerDependencies: - "@dr.pogodin/react-helmet": ^3.3.2 - next: ^16.0.0 - react: ^19.0.0 - languageName: unknown - linkType: soft - "@atls/next-document-with-icons@workspace:packages/next-document-with-icons": version: 0.0.0-use.local resolution: "@atls/next-document-with-icons@workspace:packages/next-document-with-icons" @@ -488,24 +470,6 @@ __metadata: languageName: node linkType: hard -"@dr.pogodin/react-helmet@npm:3.3.2": - version: 3.3.2 - resolution: "@dr.pogodin/react-helmet@npm:3.3.2" - peerDependencies: - react: 19 - checksum: 10/00209b8270cfa13022078a778385438c9eb76d748df75ac296a52b4fc29bd54d8fd10ef215d1d2b0a1ce44aef33a85282a95673a71a1f52ea795aa634f5a3413 - languageName: node - linkType: hard - -"@dr.pogodin/react-helmet@patch:@dr.pogodin/react-helmet@npm%3A3.3.2#~/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch": - version: 3.3.2 - resolution: "@dr.pogodin/react-helmet@patch:@dr.pogodin/react-helmet@npm%3A3.3.2#~/.yarn/patches/@dr.pogodin-react-helmet-npm-3.3.2-c27db9f3f4.patch::version=3.3.2&hash=b2334b" - peerDependencies: - react: 19 - checksum: 10/3efcbcc0eb208ca5bfbf102e751515b1c730f3c4857e772ce2aa2b290dd63305930d8c53b6203bcb368266fa18d0482504a6acda90cc2d39ca0df7e9fae56ad5 - languageName: node - linkType: hard - "@emnapi/runtime@npm:^1.11.3": version: 1.11.3 resolution: "@emnapi/runtime@npm:1.11.3" From 8fb013b86ecdfb3599f7123106c1d1e21c169121 Mon Sep 17 00:00:00 2001 From: Andrew Ghostuhin Date: Tue, 13 Oct 2026 03:36:48 +0300 Subject: [PATCH 2/3] refactor(nextjs)!: retire remaining Document plugins --- .pnp.cjs | 60 ------------------- .yarn/versions/e8bfa597.yml | 3 - README.md | 14 +---- packages/next-document-with-gtag/package.json | 33 ---------- packages/next-document-with-gtag/src/index.ts | 1 - .../src/with-gtag.provider.tsx | 33 ---------- .../next-document-with-icons/package.json | 32 ---------- .../next-document-with-icons/src/index.ts | 1 - .../src/with-icons.provider.tsx | 33 ---------- .../next-document-with-opengraph/package.json | 32 ---------- .../next-document-with-opengraph/src/index.ts | 2 - .../src/with-opengraph.provider.tsx | 28 --------- yarn.lock | 49 --------------- 13 files changed, 2 insertions(+), 319 deletions(-) delete mode 100644 packages/next-document-with-gtag/package.json delete mode 100644 packages/next-document-with-gtag/src/index.ts delete mode 100644 packages/next-document-with-gtag/src/with-gtag.provider.tsx delete mode 100644 packages/next-document-with-icons/package.json delete mode 100644 packages/next-document-with-icons/src/index.ts delete mode 100644 packages/next-document-with-icons/src/with-icons.provider.tsx delete mode 100644 packages/next-document-with-opengraph/package.json delete mode 100644 packages/next-document-with-opengraph/src/index.ts delete mode 100644 packages/next-document-with-opengraph/src/with-opengraph.provider.tsx diff --git a/.pnp.cjs b/.pnp.cjs index 8c475cac..d94a8e9d 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -18,18 +18,6 @@ const RAW_RUNTIME_STATE = "name": "@atls/next-identity-integration",\ "reference": "workspace:packages/identity-integration"\ },\ - {\ - "name": "@atls/next-document-with-gtag",\ - "reference": "workspace:packages/next-document-with-gtag"\ - },\ - {\ - "name": "@atls/next-document-with-icons",\ - "reference": "workspace:packages/next-document-with-icons"\ - },\ - {\ - "name": "@atls/next-document-with-opengraph",\ - "reference": "workspace:packages/next-document-with-opengraph"\ - },\ {\ "name": "@atls/next-sitemap-generator",\ "reference": "workspace:packages/next-sitemap-generator"\ @@ -39,9 +27,6 @@ const RAW_RUNTIME_STATE = "ignorePatternData": "(^(?:\\\\.yarn\\\\/sdks(?:\\\\/(?!\\\\.{1,2}(?:\\\\/|$))(?:(?:(?!(?:^|\\\\/)\\\\.{1,2}(?:\\\\/|$)).)*?)|$))$)",\ "pnpZipBackend": "libzip",\ "fallbackExclusionList": [\ - ["@atls/next-document-with-gtag", ["workspace:packages/next-document-with-gtag"]],\ - ["@atls/next-document-with-icons", ["workspace:packages/next-document-with-icons"]],\ - ["@atls/next-document-with-opengraph", ["workspace:packages/next-document-with-opengraph"]],\ ["@atls/next-identity-integration", ["workspace:packages/identity-integration"]],\ ["@atls/next-sitemap-generator", ["workspace:packages/next-sitemap-generator"]],\ ["nextjs", ["workspace:."]]\ @@ -132,51 +117,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["@atls/next-document-with-gtag", [\ - ["workspace:packages/next-document-with-gtag", {\ - "packageLocation": "./packages/next-document-with-gtag/",\ - "packageDependencies": [\ - ["@atls/next-document-with-gtag", "workspace:packages/next-document-with-gtag"],\ - ["@types/node", "npm:24.19.1"],\ - ["@types/react", "npm:19.3.0"],\ - ["@types/react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:19.3.0"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:16.4.0"],\ - ["react", "npm:19.3.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:19.3.0"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@atls/next-document-with-icons", [\ - ["workspace:packages/next-document-with-icons", {\ - "packageLocation": "./packages/next-document-with-icons/",\ - "packageDependencies": [\ - ["@atls/next-document-with-icons", "workspace:packages/next-document-with-icons"],\ - ["@types/node", "npm:24.19.1"],\ - ["@types/react", "npm:19.3.0"],\ - ["@types/react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:19.3.0"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:16.4.0"],\ - ["react", "npm:19.3.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:19.3.0"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ - ["@atls/next-document-with-opengraph", [\ - ["workspace:packages/next-document-with-opengraph", {\ - "packageLocation": "./packages/next-document-with-opengraph/",\ - "packageDependencies": [\ - ["@atls/next-document-with-opengraph", "workspace:packages/next-document-with-opengraph"],\ - ["@types/node", "npm:24.19.1"],\ - ["@types/react", "npm:19.3.0"],\ - ["@types/react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:19.3.0"],\ - ["next", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:16.4.0"],\ - ["react", "npm:19.3.0"],\ - ["react-dom", "virtual:a29650b7eaad3692d1139d6ca50163f9c611de4f12c1b46473850e285251c23b9c7999b6fe9d59b5db61d9d37958f2e8c07243c0c5bbcd15ae669fb338f0d523#npm:19.3.0"]\ - ],\ - "linkType": "SOFT"\ - }]\ - ]],\ ["@atls/next-identity-integration", [\ ["workspace:packages/identity-integration", {\ "packageLocation": "./packages/identity-integration/",\ diff --git a/.yarn/versions/e8bfa597.yml b/.yarn/versions/e8bfa597.yml index 358c0eed..d0fb2449 100644 --- a/.yarn/versions/e8bfa597.yml +++ b/.yarn/versions/e8bfa597.yml @@ -1,6 +1,3 @@ releases: - "@atls/next-document-with-gtag": major - "@atls/next-document-with-icons": major - "@atls/next-document-with-opengraph": major "@atls/next-identity-integration": patch "@atls/next-sitemap-generator": patch diff --git a/README.md b/README.md index fc0764b8..2bfbaa25 100755 --- a/README.md +++ b/README.md @@ -18,18 +18,8 @@ Подключение к identity-сервисам, управление потоками аутентификации, восстановления и регистрации, а также настройка их пользовательского интерфейса. -### 📊  `next-document-with-gtag` - -Интеграция Google Analytics с помощью `gtag.js` для отслеживания пользовательских событий и метрик. - -### 🌟  `next-document-with-icons` - -Поддержка кастомных иконок для веб-приложений, включая favicon и другие варианты. - -### 🌐  `next-document-with-opengraph` - -Поддержка Open Graph мета-тегов для предпросмотра ссылок в социальных сетях и мессенджерах. - ### 🗺️  `next-sitemap-generator` Генератор карты сайта для Next.js приложений, обеспечивающий индексацию и оптимизацию SEO. + +Для метатегов и иконок в Pages Router используйте [`next/head`](https://nextjs.org/docs/pages/api-reference/components/head), для сторонних скриптов — [`next/script`](https://nextjs.org/docs/pages/api-reference/components/script). Атрибуты `html` задавайте в [Custom Document](https://nextjs.org/docs/pages/building-your-application/routing/custom-document). diff --git a/packages/next-document-with-gtag/package.json b/packages/next-document-with-gtag/package.json deleted file mode 100644 index 94c29f8e..00000000 --- a/packages/next-document-with-gtag/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@atls/next-document-with-gtag", - "version": "0.1.1", - "license": "BSD-3-Clause", - "main": "src/index.ts", - "files": [ - "dist" - ], - "scripts": { - "build": "yarn library build", - "prepack": "yarn run build", - "postpack": "rm -rf dist" - }, - "devDependencies": { - "@types/node": "24.19.1", - "@types/react": "19.3.0", - "@types/react-dom": "19.3.0", - "next": "16.4.0", - "react": "19.3.0", - "react-dom": "19.3.0" - }, - "peerDependencies": { - "next": "^16.0.0", - "react": "^19.0.0", - "react-dom": "^19.0.0" - }, - "publishConfig": { - "access": "public", - "main": "dist/index.js", - "typings": "dist/index.d.ts" - }, - "typecheckSkipLibCheck": true -} diff --git a/packages/next-document-with-gtag/src/index.ts b/packages/next-document-with-gtag/src/index.ts deleted file mode 100644 index 2d6afc79..00000000 --- a/packages/next-document-with-gtag/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { withGtag } from './with-gtag.provider' diff --git a/packages/next-document-with-gtag/src/with-gtag.provider.tsx b/packages/next-document-with-gtag/src/with-gtag.provider.tsx deleted file mode 100644 index 62585048..00000000 --- a/packages/next-document-with-gtag/src/with-gtag.provider.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/* eslint-disable @next/next/no-document-import-in-page, @next/next/next-script-for-ga */ - -import type { DocumentContext, DocumentInitialProps } from 'next/document' - -import type Document from 'next/document' - -import React from 'react' - -export const withGtag = (gaTrackingId?: string) => (TargetComponent: typeof Document) => - class WithGtag extends TargetComponent { - static override async getInitialProps(context: DocumentContext): Promise { - const props = await super.getInitialProps(context) - - if (gaTrackingId) { - props.head ??= [] - props.head.push( -