From 8d683ecd22dc60b3df66239f27877d0685dee7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 27 Jul 2026 07:13:22 +0000 Subject: [PATCH] Fix repository typos --- .typos.toml | 17 +++++++++++++++ .../01-Getting Started/headless-config.md | 3 +-- docs/src/pages/index.js | 2 +- ...iples-sketch.png => principles-sketch.png} | Bin .../01-Getting Started/headless-config.md | 2 +- .../02-Data Fetching/useSearchNative.md | 3 +-- .../06-WordPress Integration/revalidate.md | 4 ++-- .../08-Guides/typescript.md | 2 +- packages/block-primitives/src/shared/types.ts | 2 +- packages/core/src/dom/__tests__/wpKsesPost.ts | 2 +- ...ormatedBlock.tsx => PreformattedBlock.tsx} | 0 packages/core/src/react/blocks/index.ts | 2 +- .../hooks/__tests__/useFetchPostOrPosts.tsx | 4 ++-- packages/core/src/react/hooks/useFetch.ts | 2 +- .../provider/__tests__/useThemeSetting.tsx | 12 +++++------ packages/core/src/types.ts | 6 +++--- .../core/test/__fixtures__/posts/pages.json | 10 ++++----- packages/epio-search/src/types.ts | 2 +- .../next-redis-cache-provider/CHANGELOG.md | 8 +++---- .../next/src/config/withHeadstartWPConfig.ts | 2 +- packages/next/src/handlers/previewHandler.ts | 2 +- .../middlewares/__tests__/appMiddleware.ts | 4 ++-- .../{appMidleware.ts => appMiddleware.ts} | 4 ++-- packages/next/src/middlewares/index.ts | 2 +- .../src/rsc/blocks/__tests__/LinkBlock.tsx | 2 +- .../__snapshots__/LinkBlock.tsx.snap | 2 +- .../src/rsc/components/__tests__/Link.tsx | 2 +- .../__tests__/__snapshots__/Link.tsx.snap | 2 +- .../data/queries/__tests__/prepareQuery.ts | 4 ++-- .../next/src/rsc/data/queries/prepareQuery.ts | 2 +- packages/next/src/rsc/data/seo.ts | 17 +++++++++------ .../src/rsc/handlers/previewRouteHandler.ts | 2 +- .../next/src/utils/__tests__/convertUrl.tsx | 2 +- .../src/hero/Hero.stories.tsx | 2 +- wp/10up-theme/README.md | 2 +- .../assets/css/frontend/global/reset.css | 2 +- wp/10up-theme/assets/css/frontend/style.css | 2 +- .../assets/css/styleguide/styleguide.css | 4 ++-- wp/10up-theme/includes/core.php | 6 +++--- wp/10up-theme/includes/overrides.php | 2 +- .../classes/Integrations/YoastSEO.php | 20 ++++++++++++------ .../tests/php/includes/PLLUnitTestCase.php | 2 +- .../php/tests/TestPolylangIntegration.php | 4 ++-- .../tests/php/tests/TestPreview.php | 2 +- 44 files changed, 104 insertions(+), 76 deletions(-) create mode 100644 .typos.toml rename docs/static/img/{priciples-sketch.png => principles-sketch.png} (100%) rename packages/core/src/react/blocks/{PreformatedBlock.tsx => PreformattedBlock.tsx} (100%) rename packages/next/src/middlewares/{appMidleware.ts => appMiddleware.ts} (98%) diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 000000000..9fe508c9e --- /dev/null +++ b/.typos.toml @@ -0,0 +1,17 @@ +[default.extend-identifiers] +"1beed833" = "1beed833" +"8ba6de7" = "8ba6de7" +"ba952037" = "ba952037" +"metatada" = "metatada" +"tenup_headless_wp_search_title_variables_replacments" = "tenup_headless_wp_search_title_variables_replacments" + +[default.extend-words] +"automattic" = "automattic" +"Bui" = "Bui" +"conveniant" = "conveniant" +"convenit" = "convenit" +"littel" = "littel" +"MILION" = "MILION" +"nam" = "nam" +"optio" = "optio" +"varius" = "varius" diff --git a/docs/documentation/01-Getting Started/headless-config.md b/docs/documentation/01-Getting Started/headless-config.md index d0e9ebae4..a19048284 100644 --- a/docs/documentation/01-Getting Started/headless-config.md +++ b/docs/documentation/01-Getting Started/headless-config.md @@ -111,7 +111,7 @@ module.exports = { } ``` -Another use case is if you want your posts to sit at a different prefix (e.g: `/blog`), you can change your permalinks in WordPress (e.g: `/blog/%postname/`) and update the default `post` post type so that its `sigle` property is equal to `/blog`. +Another use case is if you want your posts to sit at a different prefix (e.g: `/blog`), you can change your permalinks in WordPress (e.g: `/blog/%postname/`) and update the default `post` post type so that its `single` property is equal to `/blog`. ```js title="headstartwp.config.js" module.exports = { @@ -275,4 +275,3 @@ module.exports = { ``` More for info check out the [preview docs](/learn/wordpress-integration/previews#the-usepostlinkforredirect-setting). - diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index 96c306cf8..e8a5ccd96 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -7,7 +7,7 @@ import SearchBar from '@theme/SearchBar'; import guideSketch from '@site/static/img/guides-sketch.png'; import referenceSketch from '@site/static/img/reference-sketch.png'; -import principlesSketch from '@site/static/img/priciples-sketch.png'; +import principlesSketch from '@site/static/img/principles-sketch.png'; import styles from './index.module.css'; diff --git a/docs/static/img/priciples-sketch.png b/docs/static/img/principles-sketch.png similarity index 100% rename from docs/static/img/priciples-sketch.png rename to docs/static/img/principles-sketch.png diff --git a/docs/versioned_docs/version-pages-router/01-Getting Started/headless-config.md b/docs/versioned_docs/version-pages-router/01-Getting Started/headless-config.md index 7ec31818d..f624bf48c 100644 --- a/docs/versioned_docs/version-pages-router/01-Getting Started/headless-config.md +++ b/docs/versioned_docs/version-pages-router/01-Getting Started/headless-config.md @@ -111,7 +111,7 @@ module.exports = { } ``` -Another use case is if you want your posts to sit at a different prefix (e.g: `/blog`), you can change your permalinks in WordPress (e.g: `/blog/%postname/`) and update the default `post` post type so that its `sigle` property is equal to `/blog`. +Another use case is if you want your posts to sit at a different prefix (e.g: `/blog`), you can change your permalinks in WordPress (e.g: `/blog/%postname/`) and update the default `post` post type so that its `single` property is equal to `/blog`. ```js title="headstartwp.config.js" module.exports = { diff --git a/docs/versioned_docs/version-pages-router/02-Data Fetching/useSearchNative.md b/docs/versioned_docs/version-pages-router/02-Data Fetching/useSearchNative.md index 0dc5bf1c2..7b91623e1 100644 --- a/docs/versioned_docs/version-pages-router/02-Data Fetching/useSearchNative.md +++ b/docs/versioned_docs/version-pages-router/02-Data Fetching/useSearchNative.md @@ -153,11 +153,10 @@ const ArchivePage = () => { ## Accessing embeddable data By default, the Search Results endpoints only return the object of the associated search results but do not return embeddable data of the search results entities themselves. For instance, when searching for posts, even if you pass the `_embed` parameter, WordPress won't return the associated term objects, author objects etc. -HeadstartWP plugin extends the core endpoint so that it returns these embedded objects to avoid the need for additional queries. Check the [PostSearchEntity](/api/@headstartwp/core/interfaces/PostSearchEntity/) and [TermSearcheEntity](/api/@headstartwp/core/interfaces/TermSearchEntity/). +HeadstartWP plugin extends the core endpoint so that it returns these embedded objects to avoid the need for additional queries. Check the [PostSearchEntity](/api/@headstartwp/core/interfaces/PostSearchEntity/) and [TermSearchEntity](/api/@headstartwp/core/interfaces/TermSearchEntity/). ## QueriedObject The `useNativeSearch` hook also exposes a `queriedObject`. The queried object for this hook is an object of type [SearchEntity](/api/@headstartwp/core/interfaces/SearchEntity/). - diff --git a/docs/versioned_docs/version-pages-router/06-WordPress Integration/revalidate.md b/docs/versioned_docs/version-pages-router/06-WordPress Integration/revalidate.md index 3f6552161..25bef6168 100644 --- a/docs/versioned_docs/version-pages-router/06-WordPress Integration/revalidate.md +++ b/docs/versioned_docs/version-pages-router/06-WordPress Integration/revalidate.md @@ -133,7 +133,7 @@ Another thing you want to consider is flushing the CDN cache **after** you reval ```php add_filter( 'tenup_headless_wp_revalidate', function( $post, $front_end_post_url ) { - // $front_end_psot_url is the URL for the post with the front-end/headless url. + // $front_end_post_url is the URL for the post with the front-end/headless url. function_to_clear_my_favorite_cdn_cache( $front_end_post_url ); }, 10, 2 ); ``` @@ -155,4 +155,4 @@ If you prefer to run the revalidation logic in the background, you can tell the add_filter( 'tenup_headless_wp_revalidate_on_cron', '___return_true' ); ``` -This can be useful when the revalidation or the CDN cache purge is slow sp this can be used to speed up the post saving process. \ No newline at end of file +This can be useful when the revalidation or the CDN cache purge is slow sp this can be used to speed up the post saving process. diff --git a/docs/versioned_docs/version-pages-router/08-Guides/typescript.md b/docs/versioned_docs/version-pages-router/08-Guides/typescript.md index e8951a111..1ae3f306b 100644 --- a/docs/versioned_docs/version-pages-router/08-Guides/typescript.md +++ b/docs/versioned_docs/version-pages-router/08-Guides/typescript.md @@ -152,4 +152,4 @@ interface Window { ## Running the typecheck -By default Next.js will run `tsc` to validate your types. If type checking fails your build will fail. Therefore we recommend running `tsc --noEmit` before commiting and/or on your CI prior to merging PRs. \ No newline at end of file +By default Next.js will run `tsc` to validate your types. If type checking fails your build will fail. Therefore we recommend running `tsc --noEmit` before committing and/or on your CI prior to merging PRs. diff --git a/packages/block-primitives/src/shared/types.ts b/packages/block-primitives/src/shared/types.ts index 0ccaa1d98..68ba9eab7 100644 --- a/packages/block-primitives/src/shared/types.ts +++ b/packages/block-primitives/src/shared/types.ts @@ -61,7 +61,7 @@ export type ImagePrimitiveValue = { */ height: number; - sizes: Record; + sizes: Record; }; /** diff --git a/packages/core/src/dom/__tests__/wpKsesPost.ts b/packages/core/src/dom/__tests__/wpKsesPost.ts index 6d2e9eea7..fa88d25f7 100644 --- a/packages/core/src/dom/__tests__/wpKsesPost.ts +++ b/packages/core/src/dom/__tests__/wpKsesPost.ts @@ -68,7 +68,7 @@ describe('wp_kses_post', () => { ).toBe(``); }); - it('allows whiltelisted css properties', () => { + it('allows whitelisted css properties', () => { expect( wpKsesPost('
'), ).toBe('
'); diff --git a/packages/core/src/react/blocks/PreformatedBlock.tsx b/packages/core/src/react/blocks/PreformattedBlock.tsx similarity index 100% rename from packages/core/src/react/blocks/PreformatedBlock.tsx rename to packages/core/src/react/blocks/PreformattedBlock.tsx diff --git a/packages/core/src/react/blocks/index.ts b/packages/core/src/react/blocks/index.ts index 7a7287e0f..53e3ed971 100644 --- a/packages/core/src/react/blocks/index.ts +++ b/packages/core/src/react/blocks/index.ts @@ -10,7 +10,7 @@ export * from './DebugBlock'; export * from './HeadingBlock'; export * from './QuoteBlock'; export * from './PullQuote'; -export * from './PreformatedBlock'; +export * from './PreformattedBlock'; export * from './VerseBlock'; export * from './TableBlock'; export * from './GroupBlock'; diff --git a/packages/core/src/react/hooks/__tests__/useFetchPostOrPosts.tsx b/packages/core/src/react/hooks/__tests__/useFetchPostOrPosts.tsx index 9ba95bec6..303aa0fe3 100644 --- a/packages/core/src/react/hooks/__tests__/useFetchPostOrPosts.tsx +++ b/packages/core/src/react/hooks/__tests__/useFetchPostOrPosts.tsx @@ -162,7 +162,7 @@ describe('useFetchPostOrPosts', () => { }, ); - // the data for useFetchPost should be avaliable immediatelly without a fetch + // the data for useFetchPost should be available immediately without a fetch // so this test should pass without waitFor expect(result2.current.data?.post.slug).toBe( 'distinctio-rerum-ratione-maxime-repudiandae-laboriosam-quam', @@ -195,7 +195,7 @@ describe('useFetchPostOrPosts', () => { }, ); - // the data for useFetchPosts should be avaliable immediatelly without a fetch + // the data for useFetchPosts should be available immediately without a fetch // so this test should pass without waitFor expect(result2.current.data?.posts?.length).toBeGreaterThan(0); (result.current.data?.posts as PostEntity[]).forEach((post) => { diff --git a/packages/core/src/react/hooks/useFetch.ts b/packages/core/src/react/hooks/useFetch.ts index 7f451b5c3..407b8a25e 100644 --- a/packages/core/src/react/hooks/useFetch.ts +++ b/packages/core/src/react/hooks/useFetch.ts @@ -77,7 +77,7 @@ export function useFetch( finalParams, ); - // mutate additiional cache objects + // mutate additional cache objects if (additionalCacheObjects) { additionalCacheObjects.forEach(({ key, data }) => { mutate(key, data); diff --git a/packages/core/src/react/provider/__tests__/useThemeSetting.tsx b/packages/core/src/react/provider/__tests__/useThemeSetting.tsx index 669849c05..6840f4825 100644 --- a/packages/core/src/react/provider/__tests__/useThemeSetting.tsx +++ b/packages/core/src/react/provider/__tests__/useThemeSetting.tsx @@ -43,7 +43,7 @@ describe('useThemeSetting', () => { }); test('it returns values from settings', () => { - const defaultPallete = [ + const defaultPalette = [ { name: 'Black', slug: 'black', @@ -56,7 +56,7 @@ describe('useThemeSetting', () => { }, ]; - const blockPallete = [ + const blockPalette = [ { name: 'white', slug: 'white', @@ -69,7 +69,7 @@ describe('useThemeSetting', () => { settings: { color: { palette: { - default: defaultPallete, + default: defaultPalette, }, }, @@ -77,7 +77,7 @@ describe('useThemeSetting', () => { 'core/button': { color: { palette: { - theme: blockPallete, + theme: blockPalette, }, }, }, @@ -95,7 +95,7 @@ describe('useThemeSetting', () => { }, ); - expect(result1.current).toMatchObject(defaultPallete); + expect(result1.current).toMatchObject(defaultPalette); const { result: result2 } = renderHook( () => useThemeSetting('color.palette.theme', 'core/button', []), @@ -104,6 +104,6 @@ describe('useThemeSetting', () => { }, ); - expect(result2.current).toMatchObject(blockPallete); + expect(result2.current).toMatchObject(blockPalette); }); }); diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index ed2f8145c..438d6c967 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -33,9 +33,9 @@ export type CustomTaxonomy = { /** * Whether this custom taxonomy should match the archive path * - * If set to true, then when querying a taxonomy archive page such as `/[taxonmy-slug]/[term-slug]` the + * If set to true, then when querying a taxonomy archive page such as `/[taxonomy-slug]/[term-slug]` the * `term.link` property should match the current path. This will avoid matching nested categories that doesn't exist for instance: - * `/[taxonmy-slug]/fake-parent-term/[term-slug]` will not match if this option is set to true even though `term-slug` exists. + * `/[taxonomy-slug]/fake-parent-term/[term-slug]` will not match if this option is set to true even though `term-slug` exists. * * @default false */ @@ -123,7 +123,7 @@ export type FetchStrategyCacheConfig = { * If set, this function will be executed after restoring data from cache (cache.get) and can be used * to reconstruct things that were removed in beforeSet. * - * @param fetcbStrategy The fetch strategy instnace + * @param fetcbStrategy The fetch strategy instance * @returns */ afterGet?: ( diff --git a/packages/core/test/__fixtures__/posts/pages.json b/packages/core/test/__fixtures__/posts/pages.json index 2acc0ca4f..73bb98d58 100644 --- a/packages/core/test/__fixtures__/posts/pages.json +++ b/packages/core/test/__fixtures__/posts/pages.json @@ -16,11 +16,11 @@ "rendered": "Debug Blocks" }, "content": { - "rendered": "

Colum 1<\/p>\n<\/div>\n\n\n

Column 1<\/p>\n<\/div>\n<\/div>\n", + "rendered": "

Column 1<\/p>\n<\/div>\n\n\n

Column 1<\/p>\n<\/div>\n<\/div>\n", "protected": false }, "excerpt": { - "rendered": "

Colum 1 Column 1<\/p>\n", + "rendered": "

Column 1 Column 1<\/p>\n", "protected": false }, "author": 2, @@ -31,7 +31,7 @@ "ping_status": "closed", "template": "", "meta": [], - "yoast_head": "\nDebug Blocks - HeadstartWP<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/js1.10up.com\/debug-blocks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debug Blocks - HeadstartWP\" \/>\n<meta property=\"og:description\" content=\"Colum 1 Column 1\" \/>\n<meta property=\"og:url\" content=\"https:\/\/js1.10up.com\/debug-blocks\/\" \/>\n<meta property=\"og:site_name\" content=\"HeadstartWP\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-24T17:07:43+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/js1.10up.com\/debug-blocks\/\",\"url\":\"https:\/\/js1.10up.com\/debug-blocks\/\",\"name\":\"Debug Blocks - HeadstartWP\",\"isPartOf\":{\"@id\":\"https:\/\/js1.10up.com\/#website\"},\"datePublished\":\"2022-10-24T17:07:42+00:00\",\"dateModified\":\"2022-10-24T17:07:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/js1.10up.com\/debug-blocks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/js1.10up.com\/debug-blocks\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/js1.10up.com\/debug-blocks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/js1.10up.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Debug Blocks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/js1.10up.com\/#website\",\"url\":\"https:\/\/js1.10up.com\/\",\"name\":\"HeadstartWP\",\"description\":\"HeadstartWP Demo Site\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/js1.10up.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->", + "yoast_head": "<!-- This site is optimized with the Yoast SEO plugin v21.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Debug Blocks - HeadstartWP<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/js1.10up.com\/debug-blocks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debug Blocks - HeadstartWP\" \/>\n<meta property=\"og:description\" content=\"Column 1 Column 1\" \/>\n<meta property=\"og:url\" content=\"https:\/\/js1.10up.com\/debug-blocks\/\" \/>\n<meta property=\"og:site_name\" content=\"HeadstartWP\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-24T17:07:43+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/js1.10up.com\/debug-blocks\/\",\"url\":\"https:\/\/js1.10up.com\/debug-blocks\/\",\"name\":\"Debug Blocks - HeadstartWP\",\"isPartOf\":{\"@id\":\"https:\/\/js1.10up.com\/#website\"},\"datePublished\":\"2022-10-24T17:07:42+00:00\",\"dateModified\":\"2022-10-24T17:07:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/js1.10up.com\/debug-blocks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/js1.10up.com\/debug-blocks\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/js1.10up.com\/debug-blocks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/js1.10up.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Debug Blocks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/js1.10up.com\/#website\",\"url\":\"https:\/\/js1.10up.com\/\",\"name\":\"HeadstartWP\",\"description\":\"HeadstartWP Demo Site\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/js1.10up.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->", "yoast_head_json": { "title": "Debug Blocks - HeadstartWP", "robots": { @@ -45,7 +45,7 @@ "og_locale": "en_US", "og_type": "article", "og_title": "Debug Blocks - HeadstartWP", - "og_description": "Colum 1 Column 1", + "og_description": "Column 1 Column 1", "og_url": "https:\/\/js1.10up.com\/debug-blocks\/", "og_site_name": "HeadstartWP", "article_modified_time": "2022-10-24T17:07:43+00:00", @@ -1806,4 +1806,4 @@ ] } } -] \ No newline at end of file +] diff --git a/packages/epio-search/src/types.ts b/packages/epio-search/src/types.ts index 52fda637a..6e943c2d0 100644 --- a/packages/epio-search/src/types.ts +++ b/packages/epio-search/src/types.ts @@ -27,7 +27,7 @@ export type EPHit = _id: string; _score: number; _source: EPPost; - hightlight: + highlight: | { post_title?: string[]; post_content_plain?: string[]; diff --git a/packages/next-redis-cache-provider/CHANGELOG.md b/packages/next-redis-cache-provider/CHANGELOG.md index 6a2aec0d6..d1a917746 100644 --- a/packages/next-redis-cache-provider/CHANGELOG.md +++ b/packages/next-redis-cache-provider/CHANGELOG.md @@ -26,19 +26,19 @@ ### Major Changes -- 6956fbb8: Suport for >= Next.js 13.5 +- 6956fbb8: Support for >= Next.js 13.5 ## 1.0.0-next.0 ### Major Changes -- 6956fbb8: Suport for >= Next.js 13.5 +- 6956fbb8: Support for >= Next.js 13.5 ## 0.2.0 ### Minor Changes -- 3e73ab7a: Add suport for redis sentinel +- 3e73ab7a: Add support for redis sentinel ### Patch Changes @@ -54,7 +54,7 @@ ### Minor Changes -- 3e73ab7a: Add suport for redis sentinel +- 3e73ab7a: Add support for redis sentinel ## 0.1.5 diff --git a/packages/next/src/config/withHeadstartWPConfig.ts b/packages/next/src/config/withHeadstartWPConfig.ts index f1080c190..19877bec8 100644 --- a/packages/next/src/config/withHeadstartWPConfig.ts +++ b/packages/next/src/config/withHeadstartWPConfig.ts @@ -141,7 +141,7 @@ export function withHeadstartWPConfig( if (!clientConfigPath && !serverConfigPath) { throw new ConfigError( - 'Missing config, when spliting config between server and client you need to specify both headstartwp.config.client.js and headstartwp.server.config.js', + 'Missing config, when splitting config between server and client you need to specify both headstartwp.config.client.js and headstartwp.server.config.js', ); } diff --git a/packages/next/src/handlers/previewHandler.ts b/packages/next/src/handlers/previewHandler.ts index 7aeff016d..b454b99d7 100644 --- a/packages/next/src/handlers/previewHandler.ts +++ b/packages/next/src/handlers/previewHandler.ts @@ -196,7 +196,7 @@ export async function previewHandler( /** * Builds the default redirect path * - * @returns the default redirec tpath + * @returns the default redirect path */ const getDefaultRedirectPath = () => { if (preview?.usePostLinkForRedirect) { diff --git a/packages/next/src/middlewares/__tests__/appMiddleware.ts b/packages/next/src/middlewares/__tests__/appMiddleware.ts index 8afc5d0a2..faa274f8b 100644 --- a/packages/next/src/middlewares/__tests__/appMiddleware.ts +++ b/packages/next/src/middlewares/__tests__/appMiddleware.ts @@ -1,6 +1,6 @@ import { NextRequest } from 'next/server'; import { setHeadstartWPConfig } from '@headstartwp/core/utils'; -import { AppMiddleware, getAppRouterLocale } from '../appMidleware'; +import { AppMiddleware, getAppRouterLocale } from '../appMiddleware'; describe('appMiddleware', () => { it('adds headers', async () => { @@ -669,7 +669,7 @@ describe('appMiddleware', () => { expect(res.status).toBe(307); expect(res.headers.get('Location')).toBe('http://test2.com/post-name'); - // es is an unsuported but valid locale + // es is an unsupported but valid locale req = new NextRequest('http://test2.com/es/post-name', { method: 'GET', }); diff --git a/packages/next/src/middlewares/appMidleware.ts b/packages/next/src/middlewares/appMiddleware.ts similarity index 98% rename from packages/next/src/middlewares/appMidleware.ts rename to packages/next/src/middlewares/appMiddleware.ts index 94effaebf..d1c0f8927 100644 --- a/packages/next/src/middlewares/appMidleware.ts +++ b/packages/next/src/middlewares/appMiddleware.ts @@ -84,13 +84,13 @@ export function getAppRouterLocale(request: NextRequest): [string, string] | und return [defaultLocale, defaultLocale]; } -type AppMidlewareOptions = { +type AppMiddlewareOptions = { appRouter: boolean; }; export async function AppMiddleware( req: NextRequest, - options: AppMidlewareOptions = { appRouter: false }, + options: AppMiddlewareOptions = { appRouter: false }, ) { let response = NextResponse.next(); const { pathname, searchParams } = req.nextUrl; diff --git a/packages/next/src/middlewares/index.ts b/packages/next/src/middlewares/index.ts index 17d8bb780..532ab8782 100644 --- a/packages/next/src/middlewares/index.ts +++ b/packages/next/src/middlewares/index.ts @@ -1 +1 @@ -export * from './appMidleware'; +export * from './appMiddleware'; diff --git a/packages/next/src/rsc/blocks/__tests__/LinkBlock.tsx b/packages/next/src/rsc/blocks/__tests__/LinkBlock.tsx index a4b927f54..8df0e1072 100644 --- a/packages/next/src/rsc/blocks/__tests__/LinkBlock.tsx +++ b/packages/next/src/rsc/blocks/__tests__/LinkBlock.tsx @@ -5,7 +5,7 @@ import { getHeadstartWPConfig, setHeadstartWPConfig } from '@headstartwp/core'; import { LinkBlock } from '../LinkBlock'; describe('LinkBlock', () => { - it('shound replace internal links with next/link', () => { + it('should replace internal links with next/link', () => { setHeadstartWPConfig({ sourceUrl: 'http://wpadmin.com', hostUrl: 'http://domain.com', diff --git a/packages/next/src/rsc/blocks/__tests__/__snapshots__/LinkBlock.tsx.snap b/packages/next/src/rsc/blocks/__tests__/__snapshots__/LinkBlock.tsx.snap index e2759896e..195c040f3 100644 --- a/packages/next/src/rsc/blocks/__tests__/__snapshots__/LinkBlock.tsx.snap +++ b/packages/next/src/rsc/blocks/__tests__/__snapshots__/LinkBlock.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`LinkBlock shound replace internal links with next/link 1`] = ` +exports[`LinkBlock should replace internal links with next/link 1`] = ` <div> <div class="content" diff --git a/packages/next/src/rsc/components/__tests__/Link.tsx b/packages/next/src/rsc/components/__tests__/Link.tsx index 8e3d7c792..cec7d7efe 100644 --- a/packages/next/src/rsc/components/__tests__/Link.tsx +++ b/packages/next/src/rsc/components/__tests__/Link.tsx @@ -4,7 +4,7 @@ import { SettingsProvider } from '@headstartwp/core/react'; import { Link } from '../Link'; describe('Link', () => { - it('shound replace internal links with next/link', () => { + it('should replace internal links with next/link', () => { const { container } = render( <SettingsProvider settings={{ diff --git a/packages/next/src/rsc/components/__tests__/__snapshots__/Link.tsx.snap b/packages/next/src/rsc/components/__tests__/__snapshots__/Link.tsx.snap index 589660b0c..c23804ca5 100644 --- a/packages/next/src/rsc/components/__tests__/__snapshots__/Link.tsx.snap +++ b/packages/next/src/rsc/components/__tests__/__snapshots__/Link.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Link shound replace internal links with next/link 1`] = ` +exports[`Link should replace internal links with next/link 1`] = ` <div> <a href="/post-name" diff --git a/packages/next/src/rsc/data/queries/__tests__/prepareQuery.ts b/packages/next/src/rsc/data/queries/__tests__/prepareQuery.ts index f7c379037..cb1c110a4 100644 --- a/packages/next/src/rsc/data/queries/__tests__/prepareQuery.ts +++ b/packages/next/src/rsc/data/queries/__tests__/prepareQuery.ts @@ -160,7 +160,7 @@ describe('prepareQuery with lang and polylang', () => { }); }); - it('throws for unsuported locales', () => { + it('throws for unsupported locales', () => { expect(() => prepareQuery( { @@ -169,7 +169,7 @@ describe('prepareQuery with lang and polylang', () => { getHeadstartWPConfig(), ), ).toThrow( - 'Unsuported lang (br), make sure you add all desired locales to "config.i18n.locales"', + 'Unsupported lang (br), make sure you add all desired locales to "config.i18n.locales"', ); }); }); diff --git a/packages/next/src/rsc/data/queries/prepareQuery.ts b/packages/next/src/rsc/data/queries/prepareQuery.ts index 528f46ca5..9c6a5c53c 100644 --- a/packages/next/src/rsc/data/queries/prepareQuery.ts +++ b/packages/next/src/rsc/data/queries/prepareQuery.ts @@ -54,7 +54,7 @@ export function prepareQuery<P extends EndpointParams>( const supportedLocales = rootConfig.i18n?.locales ?? []; if (!supportedLocales.includes(routeParams.lang)) { throw new FrameworkError( - `Unsuported lang (${routeParams.lang}), make sure you add all desired locales to "config.i18n.locales"`, + `Unsupported lang (${routeParams.lang}), make sure you add all desired locales to "config.i18n.locales"`, ); } params.lang = routeParams.lang; diff --git a/packages/next/src/rsc/data/seo.ts b/packages/next/src/rsc/data/seo.ts index 18aa37729..b1b7e5839 100644 --- a/packages/next/src/rsc/data/seo.ts +++ b/packages/next/src/rsc/data/seo.ts @@ -83,13 +83,13 @@ function getMetadataForAuthorEntity(author: AuthorEntity, config: HeadlessConfig } // eslint-disable-next-line @typescript-eslint/no-unused-vars -function getMetatadataForSearchEntity(search: SearchEntity, config: HeadlessConfig): Metadata { +function getMetadataForSearchEntity(search: SearchEntity, config: HeadlessConfig): Metadata { return { title: `Searching for ${search.searchedValue}`, }; } -function getMetatadataForTermEntity(term: TermEntity, config: HeadlessConfig): Metadata { +function getMetadataForTermEntity(term: TermEntity, config: HeadlessConfig): Metadata { const { hostUrl = '', sourceUrl = '' } = config; return { @@ -103,7 +103,12 @@ function getMetatadataForTermEntity(term: TermEntity, config: HeadlessConfig): M export function prepareSEOMetadata( data: PostEntity | QueriedObject, _config: HeadlessConfig = {}, -): { metadata: Metadata; schema?: string } { +): { + metadata: Metadata; + /** @deprecated Use `metadata` instead. */ + metatada: Metadata; + schema?: string; +} { const config = _config ?? getHeadstartWPConfig(); const { integrations } = config; const isYoastIntegrationEnabled = !!integrations?.yoastSEO?.enable; @@ -132,14 +137,14 @@ export function prepareSEOMetadata( yoastMetadata = fromYoastToMetadata(data.search.yoast_head_json, config); jsonLd = data.search.yoast_head_json.schema; } else { - metadata = getMetatadataForSearchEntity(data.search, config); + metadata = getMetadataForSearchEntity(data.search, config); } } else if (data.term) { if (data.term.yoast_head_json && isYoastIntegrationEnabled) { yoastMetadata = fromYoastToMetadata(data.term.yoast_head_json, config); jsonLd = data.term.yoast_head_json.schema; } else { - metadata = getMetatadataForTermEntity(data.term, config); + metadata = getMetadataForTermEntity(data.term, config); } } @@ -147,7 +152,7 @@ export function prepareSEOMetadata( return { metadata: _metadata, - // @ts-expect-error - previous version had a typo to keeping it for backwards compatibility, users with TS will still see an error during build + // Retained as a deprecated alias for backwards compatibility. metatada: _metadata, schema: jsonLd ? JSON.stringify(jsonLd).replace(new RegExp(sourceUrl, 'g'), hostUrl) diff --git a/packages/next/src/rsc/handlers/previewRouteHandler.ts b/packages/next/src/rsc/handlers/previewRouteHandler.ts index 76cdba70f..49eef2f40 100644 --- a/packages/next/src/rsc/handlers/previewRouteHandler.ts +++ b/packages/next/src/rsc/handlers/previewRouteHandler.ts @@ -178,7 +178,7 @@ export async function previewRouteHandler( /** * Builds the default redirect path * - * @returns the default redirec tpath + * @returns the default redirect path */ const getDefaultRedirectPath = () => { if (preview?.usePostLinkForRedirect) { diff --git a/packages/next/src/utils/__tests__/convertUrl.tsx b/packages/next/src/utils/__tests__/convertUrl.tsx index fb1cc6f97..fb6c2eba4 100644 --- a/packages/next/src/utils/__tests__/convertUrl.tsx +++ b/packages/next/src/utils/__tests__/convertUrl.tsx @@ -1,7 +1,7 @@ import { convertUrl } from '../convertUrl'; describe('convertUrl', () => { - it('works without trainling slash', () => { + it('works without trailing slash', () => { expect( convertUrl( 'https://backendurl.com/test', diff --git a/test-projects/component-library/src/hero/Hero.stories.tsx b/test-projects/component-library/src/hero/Hero.stories.tsx index eafda393f..685fe490f 100644 --- a/test-projects/component-library/src/hero/Hero.stories.tsx +++ b/test-projects/component-library/src/hero/Hero.stories.tsx @@ -43,7 +43,7 @@ export const Primary: Story = { // inner blocks must be passed as children children: ( <ul> - <li>Itme 1</li> + <li>Item 1</li> <li>item 2</li> </ul> ), diff --git a/wp/10up-theme/README.md b/wp/10up-theme/README.md index 8fdf464ff..2041c6313 100644 --- a/wp/10up-theme/README.md +++ b/wp/10up-theme/README.md @@ -103,6 +103,6 @@ The theme now supports `ct.css`. Uh what? You can activate `ct.css` on any page load by including `?debug_perf=1` in the URL. -Considering we do not want to load script everywhere throughout the theme, we have provided engineeers with a way to trigger the `ct.css` output by using a query param. +Considering we do not want to load script everywhere throughout the theme, we have provided engineers with a way to trigger the `ct.css` output by using a query param. <sub>* for 10uppers, reach out to Daine for any questions / guidance / support in regards to `ct.css`</sub> diff --git a/wp/10up-theme/assets/css/frontend/global/reset.css b/wp/10up-theme/assets/css/frontend/global/reset.css index b93aa3f47..9412f2ea6 100644 --- a/wp/10up-theme/assets/css/frontend/global/reset.css +++ b/wp/10up-theme/assets/css/frontend/global/reset.css @@ -1,6 +1,6 @@ /** * Reset.css -* Custom reset enhancments. +* Custom reset enhancements. * Primary reset is modern-normalize (by default) * imported in ../style.css */ diff --git a/wp/10up-theme/assets/css/frontend/style.css b/wp/10up-theme/assets/css/frontend/style.css index 5748d1b18..58db557d9 100755 --- a/wp/10up-theme/assets/css/frontend/style.css +++ b/wp/10up-theme/assets/css/frontend/style.css @@ -14,7 +14,7 @@ */ @import url("modern-normalize/modern-normalize.css"); -/* Global - global pieces like media queries, mixins and placholders */ +/* Global - global pieces like media queries, mixins and placeholders */ @import url("global/index.css"); /* Base - base styles such as fonts, typography, and wordpress overrides */ diff --git a/wp/10up-theme/assets/css/styleguide/styleguide.css b/wp/10up-theme/assets/css/styleguide/styleguide.css index 68212ff59..3550a327d 100644 --- a/wp/10up-theme/assets/css/styleguide/styleguide.css +++ b/wp/10up-theme/assets/css/styleguide/styleguide.css @@ -1,7 +1,7 @@ :root { --c-uikit-base: #fff; --c-uikit-accent: #767676; - --c-uikit-hightlight: #f6f6f6; + --c-uikit-highlight: #f6f6f6; --c-uikit-border: #ccc; --c-uikit-primary: #000; --c-uikit-color-label: #000; @@ -97,7 +97,7 @@ .uikit__icon { align-items: center; - background: var(--c-uikit-hightlight); + background: var(--c-uikit-highlight); display: flex; float: left; height: 62px; diff --git a/wp/10up-theme/includes/core.php b/wp/10up-theme/includes/core.php index 2660d2602..f0228e425 100755 --- a/wp/10up-theme/includes/core.php +++ b/wp/10up-theme/includes/core.php @@ -143,7 +143,7 @@ function scripts() { */ /* - * Uncoment this to use the shared.js file. + * Uncomment this to use the shared.js file. wp_enqueue_script( 'shared', TENUP_THEME_TEMPLATE_URL . '/dist/js/shared.js', @@ -170,7 +170,7 @@ function admin_scripts() { ); /* - * Uncoment this to use the shared.js file. + * Uncomment this to use the shared.js file. wp_enqueue_script( 'shared', TENUP_THEME_TEMPLATE_URL . '/dist/js/shared.js', @@ -211,7 +211,7 @@ function admin_styles() { ); /* - * Uncoment this to use the shared.css file. + * Uncomment this to use the shared.css file. wp_enqueue_style( 'shared-style', TENUP_THEME_TEMPLATE_URL . '/dist/css/shared.css', diff --git a/wp/10up-theme/includes/overrides.php b/wp/10up-theme/includes/overrides.php index 0edf99702..806b1db75 100644 --- a/wp/10up-theme/includes/overrides.php +++ b/wp/10up-theme/includes/overrides.php @@ -71,7 +71,7 @@ function disable_emojis_tinymce( $plugins ) { * * @param array $urls URLs to print for resource hints. * @param string $relation_type The relation type the URLs are printed for. - * @return array Difference betwen the two arrays. + * @return array Difference between the two arrays. */ function disable_emoji_dns_prefetch( $urls, $relation_type ) { if ( 'dns-prefetch' === $relation_type ) { diff --git a/wp/headless-wp/includes/classes/Integrations/YoastSEO.php b/wp/headless-wp/includes/classes/Integrations/YoastSEO.php index 6d9acd9ab..9f5c2610b 100644 --- a/wp/headless-wp/includes/classes/Integrations/YoastSEO.php +++ b/wp/headless-wp/includes/classes/Integrations/YoastSEO.php @@ -228,14 +228,22 @@ public function get_yoast_search_query_vars() { public function replace_yoast_search_title_placeholders( $title, $query_vars ) { $separator = \YoastSEO()->helpers->options->get_title_separator(); + $str_replace_mapping = [ + '%%sitename%%' => get_bloginfo( 'name' ), + '%%searchphrase%%' => $query_vars['s'] ?? '', + '%%page%%' => ! empty( $query_vars['page'] ) ? sprintf( '%s %d', __( 'Page', 'headless-wp' ), $query_vars['page'] ) : '', + '%%sep%%' => $separator ?? ' ', + ]; + + $str_replace_mapping = apply_filters( + 'tenup_headless_wp_search_title_variables_replacements', + $str_replace_mapping + ); + + // Retain the misspelled filter name for backwards compatibility. $str_replace_mapping = apply_filters( 'tenup_headless_wp_search_title_variables_replacments', - [ - '%%sitename%%' => get_bloginfo( 'name' ), - '%%searchphrase%%' => $query_vars['s'] ?? '', - '%%page%%' => ! empty( $query_vars['page'] ) ? sprintf( '%s %d', __( 'Page', 'headless-wp' ), $query_vars['page'] ) : '', - '%%sep%%' => $separator ?? ' ', - ] + $str_replace_mapping ); $title = str_replace( array_keys( $str_replace_mapping ), array_values( $str_replace_mapping ), $title ); diff --git a/wp/headless-wp/tests/php/includes/PLLUnitTestCase.php b/wp/headless-wp/tests/php/includes/PLLUnitTestCase.php index eefc6ac0c..e61e1c813 100644 --- a/wp/headless-wp/tests/php/includes/PLLUnitTestCase.php +++ b/wp/headless-wp/tests/php/includes/PLLUnitTestCase.php @@ -72,7 +72,7 @@ public function tearDown(): void { parent::tearDown(); unset( $GLOBALS['wp_settings_errors'] ); - self::$polylang->model->clean_languages_cache(); // We must do it before database ROLLBACK otherwhise it is impossible to delete the transient + self::$polylang->model->clean_languages_cache(); // We must do it before database ROLLBACK otherwise it is impossible to delete the transient } /** diff --git a/wp/headless-wp/tests/php/tests/TestPolylangIntegration.php b/wp/headless-wp/tests/php/tests/TestPolylangIntegration.php index 8fa7b18d8..e4011aa08 100644 --- a/wp/headless-wp/tests/php/tests/TestPolylangIntegration.php +++ b/wp/headless-wp/tests/php/tests/TestPolylangIntegration.php @@ -108,7 +108,7 @@ public function test_hreflang_on_single_posts() { [ 'post_title' => '[PT_BR] Post', 'post_status' => 'publish', - 'post_content' => 'portugese post', + 'post_content' => 'Portuguese post', 'post_type' => 'post', ] ); @@ -156,7 +156,7 @@ public function test_hreflang_on_homepage() { [ 'post_title' => '[PT_BR] home Page', 'post_status' => 'publish', - 'post_content' => 'portugese page', + 'post_content' => 'Portuguese page', 'post_type' => 'page', ] ); diff --git a/wp/headless-wp/tests/php/tests/TestPreview.php b/wp/headless-wp/tests/php/tests/TestPreview.php index b3df8c22a..22bca7b64 100644 --- a/wp/headless-wp/tests/php/tests/TestPreview.php +++ b/wp/headless-wp/tests/php/tests/TestPreview.php @@ -58,7 +58,7 @@ public function set_up() { } /** - * Tests if previwes handling can be disable + * Tests if previews handling can be disabled * * @return void */