IAPL rename, scripted: preferred names in src, bin, scripts, services, tests; bin files and skill folders moved
Replaced by an explicit list of forms only (ten exported names, runtime env names, project file names and marks, commands, skill names, the log prefix, the brand in prose). Package name, import paths, routes, CSS tokens, data attributes, custom keys, context flags, the cookie and kv keys are not touched. package.json keeps the five old bin names beside the five new ones. The old names stop working in this commit and come back as aliases in the next; docs follow. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
414a4702df
commit
0a4f001797
@@ -2,7 +2,7 @@
|
||||
import { useConfig, useFormFields, useTranslation } from '@payloadcms/ui'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
import { ipalT } from '../admin-i18n/t.js'
|
||||
import { iaplT } from '../admin-i18n/t.js'
|
||||
import { faviconProblems } from './faviconProblems.js'
|
||||
|
||||
export type FaviconCheckProps = {
|
||||
@@ -48,7 +48,7 @@ export function FaviconCheck({ fieldPath, mediaSlug = 'media', path }: FaviconCh
|
||||
})
|
||||
const media = res.ok ? ((await res.json()) as { height?: number; mimeType?: string; width?: number }) : null
|
||||
const found = media ? faviconProblems(media) : []
|
||||
setProblems(found.map((p) => ipalT(t, p.key, { height: p.height, width: p.width })))
|
||||
setProblems(found.map((p) => iaplT(t, p.key, { height: p.height, width: p.width })))
|
||||
} catch {
|
||||
// aborted or offline — a hint is not worth an error
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { useConfig, useDocumentInfo, useFormFields, useLocale, useTranslation } from '@payloadcms/ui'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
import { ipalT } from '../admin-i18n/t.js'
|
||||
import { iaplT } from '../admin-i18n/t.js'
|
||||
|
||||
export type MetaDescriptionCheckProps = {
|
||||
/** An empty description is filled from the page content on save (autoFill). */
|
||||
@@ -48,8 +48,8 @@ export function MetaDescriptionCheck({
|
||||
if (!description) {
|
||||
setWarning(
|
||||
autoFill
|
||||
? { text: ipalT(t, 'seoDescEmptyAutoFill'), tone: 'info' }
|
||||
: { text: ipalT(t, 'seoDescEmpty'), tone: 'warn' },
|
||||
? { text: iaplT(t, 'seoDescEmptyAutoFill'), tone: 'info' }
|
||||
: { text: iaplT(t, 'seoDescEmpty'), tone: 'warn' },
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export function MetaDescriptionCheck({
|
||||
try {
|
||||
const settings = await get(`${base}/globals/${settingsSlug}?depth=0&locale=${locale}`)
|
||||
if (settings && norm(settings[siteDescriptionField]) === description) {
|
||||
setWarning({ text: ipalT(t, 'seoDescSameAsSite'), tone: 'warn' })
|
||||
setWarning({ text: iaplT(t, 'seoDescSameAsSite'), tone: 'warn' })
|
||||
return
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ export function MetaDescriptionCheck({
|
||||
const twin = (found?.docs as Record<string, unknown>[] | undefined)?.[0]
|
||||
if (twin) {
|
||||
const name = norm(twin[titleField]) || String(twin.id)
|
||||
setWarning({ text: ipalT(t, 'seoDescSameAs', { name }), tone: 'warn' })
|
||||
setWarning({ text: iaplT(t, 'seoDescSameAs', { name }), tone: 'warn' })
|
||||
return
|
||||
}
|
||||
setWarning(null)
|
||||
|
||||
@@ -77,7 +77,7 @@ export function createManifestHandler(opts: {
|
||||
.catch(() => null)) as null | SettingsShape
|
||||
} catch (err) {
|
||||
console.warn(
|
||||
'[ipal] createManifestHandler: database not reachable during build (Docker/CI) — returning minimal manifest; it fills in at runtime:',
|
||||
'[iapl] createManifestHandler: database not reachable during build (Docker/CI) — returning minimal manifest; it fills in at runtime:',
|
||||
err,
|
||||
)
|
||||
return fallback
|
||||
|
||||
@@ -41,7 +41,7 @@ export type AiBotRule = { access: 'allow' | 'disallow'; userAgent: string }
|
||||
export type RobotsOptions = {
|
||||
/**
|
||||
* Admin path to disallow. Default '/admin'. With a hidden panel
|
||||
* (ipalKit adminRoute) pass `false`: robots.txt is public, so listing the
|
||||
* (iapl adminRoute) pass `false`: robots.txt is public, so listing the
|
||||
* path would reveal it — the admin is noindex anyway.
|
||||
*/
|
||||
adminRoute?: false | string
|
||||
@@ -140,7 +140,7 @@ export function buildRobots({
|
||||
sitemap = true,
|
||||
}: BuildRobotsArgs): RobotsRules {
|
||||
const origin = baseUrl.replace(/\/$/, '')
|
||||
// Staging / preview (IPAL_NOINDEX=1): nothing may be crawled.
|
||||
// Staging / preview (IAPL_NOINDEX=1): nothing may be crawled.
|
||||
if (isSiteNoindex()) {return { rules: { disallow: ['/'], userAgent: '*' } }}
|
||||
|
||||
const defaults = [...(adminRoute ? [adminRoute] : []), '/api']
|
||||
|
||||
@@ -51,7 +51,7 @@ type BuildNavigationJsonLdArgs = {
|
||||
config: I18nConfig
|
||||
/** Child items. Default `item.subItems`. Return [] to list top level only. */
|
||||
getChildren?: (item: NavSource) => unknown
|
||||
/** Link of an item. Default `item.link` (ipal-nav template, buildLinkField). */
|
||||
/** Link of an item. Default `item.link` (iapl-nav template, buildLinkField). */
|
||||
getLink?: (item: NavSource) => LinkValue | null | undefined
|
||||
/** Homepage slug(s) so the home link collapses to /{locale}. */
|
||||
homeSlug?: Record<string, string> | string
|
||||
|
||||
@@ -12,7 +12,7 @@ import { isSiteNoindex } from './siteNoindex.js'
|
||||
* Search and Copilot, so new content reaches AI answers in minutes instead of
|
||||
* waiting for a crawl. Google doesn't use IndexNow (it reads the sitemap).
|
||||
*
|
||||
* Opt-in: `ipalKit({ indexNow: true })` adds the hook to the pages and content
|
||||
* Opt-in: `iapl({ indexNow: true })` adds the hook to the pages and content
|
||||
* collections; or add `buildIndexNowHook(…)` yourself. Needs the key file route
|
||||
* (createIndexNowKeyRoute) and a key: Site Integrations → IndexNow (generated on
|
||||
* the first save) or the INDEXNOW_KEY env var. Sends only from production with
|
||||
@@ -82,7 +82,7 @@ export function createIndexNowKeyRoute({ getCachedPayload }: { getCachedPayload:
|
||||
|
||||
/**
|
||||
* True when submissions may leave this machine: production + a public https
|
||||
* origin, and not a staging copy (IPAL_NOINDEX) — a staging build runs with
|
||||
* origin, and not a staging copy (IAPL_NOINDEX) — a staging build runs with
|
||||
* NODE_ENV=production too, and its URLs must not reach Bing.
|
||||
*/
|
||||
function publicOrigin(baseUrl?: string): null | string {
|
||||
@@ -116,12 +116,12 @@ export async function submitToIndexNow({
|
||||
})
|
||||
// 200 = accepted, 202 = accepted, key validation pending.
|
||||
if (res.status !== 200 && res.status !== 202) {
|
||||
console.warn(`[ipal] IndexNow: ${res.status} for ${urls.length} URL(s) — check the key file at ${origin}${INDEXNOW_KEY_PATH}`)
|
||||
console.warn(`[iapl] IndexNow: ${res.status} for ${urls.length} URL(s) — check the key file at ${origin}${INDEXNOW_KEY_PATH}`)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
} catch (err) {
|
||||
console.warn('[ipal] IndexNow: request failed:', err instanceof Error ? err.message : err)
|
||||
console.warn('[iapl] IndexNow: request failed:', err instanceof Error ? err.message : err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,7 @@ export function buildIndexNowHook({
|
||||
await submitToIndexNow({ baseUrl: origin, payload: req.payload, urls })
|
||||
}
|
||||
// Background: never block or fail the save.
|
||||
void run().catch((err: unknown) => console.warn('[ipal] IndexNow hook failed:', err instanceof Error ? err.message : err))
|
||||
void run().catch((err: unknown) => console.warn('[iapl] IndexNow hook failed:', err instanceof Error ? err.message : err))
|
||||
return doc
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ export function createLlmsTxtRoute(opts: {
|
||||
} catch (err) {
|
||||
// DB unreachable at build (container) — return a minimal valid file so the
|
||||
// route doesn't 500; it fills in at runtime. No per-project try/catch.
|
||||
console.warn('[ipal] createLlmsTxtRoute: could not build llms.txt:', err)
|
||||
console.warn('[iapl] createLlmsTxtRoute: could not build llms.txt:', err)
|
||||
return new Response('# llms.txt\n', {
|
||||
headers: { 'Cache-Control': 'no-store', 'Content-Type': 'text/plain; charset=utf-8', 'X-Robots-Tag': 'noindex' },
|
||||
})
|
||||
@@ -215,7 +215,7 @@ export function createSitemapRouteHandler(
|
||||
const headers = all.length ? xmlHeaders : { ...xmlHeaders, 'Cache-Control': 'no-store' }
|
||||
return new Response(buildSitemapXml(all, { cssUrl }), { headers })
|
||||
} catch (err) {
|
||||
console.warn('[ipal] createSitemapRouteHandler: could not build sitemap:', err)
|
||||
console.warn('[iapl] createSitemapRouteHandler: could not build sitemap:', err)
|
||||
// At runtime: 503 + Retry-After — crawlers come back later, while an empty
|
||||
// sitemap with 200 would tell them the site has no pages.
|
||||
if (process.env.NEXT_PHASE !== 'phase-production-build') {
|
||||
|
||||
@@ -91,7 +91,7 @@ function afterDescription(fields: Field[], extra: Field | null): Field[] {
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures @payloadcms/plugin-seo from IPAL's SeoOption.
|
||||
* Configures @payloadcms/plugin-seo from IAPL's SeoOption.
|
||||
*
|
||||
* Adds the `meta` field group (title, description, image) to the client's
|
||||
* chosen collections. tabbedUI is intentionally NOT used — it merges tabs by
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* Whole-site noindex for staging, previews and test copies: set IPAL_NOINDEX=1
|
||||
* Whole-site noindex for staging, previews and test copies: set IAPL_NOINDEX=1
|
||||
* in that environment's env. Then robots.txt disallows everything, every page
|
||||
* gets `robots: noindex, nofollow`, and buildSecurityHeaders adds
|
||||
* `X-Robots-Tag: noindex, nofollow` to every response (files and API too).
|
||||
* Production never sets it — a forgotten staging copy indexed by Google is a
|
||||
* duplicate of the real site.
|
||||
*/
|
||||
export const SITE_NOINDEX_ENV = 'IPAL_NOINDEX'
|
||||
export const SITE_NOINDEX_ENV = 'IAPL_NOINDEX'
|
||||
|
||||
export function isSiteNoindex(): boolean {
|
||||
const v = process.env[SITE_NOINDEX_ENV]?.trim().toLowerCase()
|
||||
|
||||
@@ -60,11 +60,11 @@ export async function migrateTitleSeparator(payload: BasePayload, settingsSlug =
|
||||
for (const [char, name] of Object.entries(NAME_OF_CHAR)) {
|
||||
const result = await globals.collection.updateOne({ globalType: settingsSlug, titleSeparator: char }, { $set: { titleSeparator: name } })
|
||||
if (result.modifiedCount) {
|
||||
payload.logger.info(`[ipal] Site Settings: title separator '${char}' stored as '${name}' (GraphQL-safe value).`)
|
||||
payload.logger.info(`[iapl] Site Settings: title separator '${char}' stored as '${name}' (GraphQL-safe value).`)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
payload.logger.error({ err: error, msg: '[ipal] Site Settings: could not migrate the title separator' })
|
||||
payload.logger.error({ err: error, msg: '[iapl] Site Settings: could not migrate the title separator' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ export const validateFaviconField: FieldHook = async ({ req, value }) => {
|
||||
for (const { height, key, width } of faviconProblems(media as { height?: number; mimeType?: string; width?: number })) {
|
||||
req.payload.logger.warn(
|
||||
key === 'faviconTooSmall'
|
||||
? `[ipal] Favicon is ${width}×${height}px. Google requires ≥48×48 to display it in search results. Upload a larger square icon (96 or 192px).`
|
||||
: `[ipal] Favicon is not square (${width}×${height}). Use a square icon so it isn't cropped in the browser tab or search results.`,
|
||||
? `[iapl] Favicon is ${width}×${height}px. Google requires ≥48×48 to display it in search results. Upload a larger square icon (96 or 192px).`
|
||||
: `[iapl] Favicon is not square (${width}×${height}). Use a square icon so it isn't cropped in the browser tab or search results.`,
|
||||
)
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user