@getvitops/utils 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +117 -0
- package/dist/index.d.mts +90 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +96 -1
- package/dist/index.mjs.map +1 -1
- package/dist/indexing/index.d.mts +25 -4
- package/dist/indexing/index.d.mts.map +1 -1
- package/dist/indexing/index.mjs +49 -9
- package/dist/indexing/index.mjs.map +1 -1
- package/dist/onboarding/index.d.mts +7 -7
- package/dist/onboarding/index.d.mts.map +1 -1
- package/dist/onboarding/index.mjs +13 -22
- package/dist/onboarding/index.mjs.map +1 -1
- package/dist/{token--18wN9UR.d.mts → token-BlShEM6J.d.mts} +29 -2
- package/dist/{token--18wN9UR.d.mts.map → token-BlShEM6J.d.mts.map} +1 -1
- package/dist/{token-BV7tPHh2.mjs → token-CuyjDo6I.mjs} +11 -2
- package/dist/{token-BV7tPHh2.mjs.map → token-CuyjDo6I.mjs.map} +1 -1
- package/package.json +1 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["s"],"sources":["../src/content.ts","../src/html.ts","../src/schema/article.ts","../src/schema/breadcrumb.ts","../src/schema/faq.ts","../src/schema/organization.ts","../src/icons.ts","../src/scan.ts","../src/icons-scan.ts"],"sourcesContent":["/**\n * Framework-agnostic content-model types, guards, i18n, and part-attr resolution.\n *\n * Extracted from @getvitops/astro so the pure-TS helpers live in one place (no\n * Astro dependency). The Astro-typed element tag was `astro/types`' `HTMLTag`;\n * here it's a plain `string` (any tag name), keeping these fully framework-neutral.\n */\n\n// ── content-model types ──────────────────────────────────────────────────────\n\n/** A translatable value: a plain string, or a locale → string map. */\nexport type Localizable = string | Record<string, string>;\n\n/**\n * An HTML attribute bag. `class` may be a string or a class:list-style array\n * (falsy entries dropped); everything else is passed through to the element.\n */\nexport interface Attrs {\n class?: string | (string | false | null | undefined)[];\n [attr: string]: unknown;\n}\n\n/** An image reference used by image links. */\nexport interface ImageRef {\n src: string;\n alt?: Localizable;\n [key: string]: unknown;\n}\n\n/** A link with a text label. */\nexport interface TextLink {\n label: Localizable;\n href: string;\n attrs?: Attrs;\n [key: string]: unknown;\n}\n\n/** A link whose content is an image. */\nexport interface ImageLink {\n image: ImageRef;\n href: string;\n attrs?: Attrs;\n [key: string]: unknown;\n}\n\n/** Any link — text or image. */\nexport type Link = TextLink | ImageLink;\n\n/**\n * A generic content element wrapper (discriminated by `type: 'element'`),\n * carrying a payload `T` rendered as `Tag` (any HTML tag name).\n */\nexport interface Elmnt<T = unknown, Tag extends string = 'div'> {\n type: 'element';\n tag?: Tag;\n attrs?: Attrs;\n content?: T;\n [key: string]: unknown;\n}\n\n/**\n * A renderable node tree — a text string (Localizable) or an element with\n * optional attrs and either `text` shorthand or `children`.\n */\nexport type ContentNode =\n | string\n | {\n tag: string;\n attrs?: Attrs;\n text?: Localizable;\n children?: ContentNode[];\n };\n\n// ── type guards ──────────────────────────────────────────────────────────────\n\nexport function isElmnt<T, Tag extends string = 'div'>(item: any): item is Elmnt<T, Tag> {\n return item && item.type === 'element';\n}\n\nexport function isLink(item: any): item is Link {\n return item && ('label' in item || 'image' in item) && 'href' in item;\n}\n\nexport function isTextLink(item: any): item is TextLink {\n return item && 'label' in item && 'href' in item;\n}\n\nexport function isImageLink(item: any): item is ImageLink {\n return item && 'image' in item && 'href' in item;\n}\n\n// ── i18n ─────────────────────────────────────────────────────────────────────\n\n/**\n * Resolve a Localizable value to a string for the given locale. A plain string\n * is returned as-is; a locale map returns the best match (locale → default → '').\n */\nexport function t(value: Localizable | undefined, locale: string, defaultLocale: string): string {\n if (value == null) return '';\n if (typeof value === 'string') return value;\n return value[locale] ?? value[defaultLocale] ?? '';\n}\n\n// ── part-attr resolution ─────────────────────────────────────────────────────\n\n/**\n * Resolve per-part attrs from a presentation-type config. For the `root` part,\n * merges legacy `attrs` with `parts.root` (backward compat).\n */\nexport function partAttrs(\n present: { attrs?: Attrs; parts?: Record<string, Attrs> } | undefined,\n part: string,\n): Attrs {\n const fromParts = present?.parts?.[part];\n if (part === 'root') {\n const legacy = present?.attrs;\n if (!legacy && !fromParts) return {};\n const { class: lc, ...lr } = legacy ?? {};\n const { class: pc, ...pr } = fromParts ?? {};\n const classes = [lc, pc].flat().filter((c): c is string => typeof c === 'string' && c !== '');\n return {\n ...(classes.length ? { class: classes } : {}),\n ...lr,\n ...pr,\n };\n }\n return fromParts ?? {};\n}\n","/**\n * Framework-agnostic HTML/markup helpers (parse5-based). Extracted from\n * @getvitops/astro — no Astro runtime dependency; the Astro-typed `HTMLTag` /\n * `HTMLAttributes` are generalized to `string` / `Record<string, unknown>`.\n */\nimport { parseFragment, serialize as s, type DefaultTreeAdapterTypes } from 'parse5';\nimport type { Localizable, ContentNode } from './content.ts';\n\nexport type ChildNode = DefaultTreeAdapterTypes.ChildNode;\n\nexport function parseRenderedSlots(html: string): ChildNode[] {\n return parseFragment(html).childNodes;\n}\n\nexport function getAttribute(node: ChildNode, attrName: string): string | null {\n if ('attrs' in node) {\n const attr = node.attrs.find((a) => a.name === attrName);\n return attr ? attr.value : null;\n }\n return null;\n}\n\nexport function serialize(nodes: ChildNode | ChildNode[]): string[] {\n return (Array.isArray(nodes) ? nodes : [nodes]).map((node) =>\n s(node as DefaultTreeAdapterTypes.ParentNode),\n );\n}\n\n/** Style value types that can be combined (camelCase or --custom-prop keys). */\ntype StyleObject = Record<string, string | number | null | undefined>;\nexport type StyleValue = string | StyleObject | null | undefined;\nexport type StyleList = StyleValue | StyleValue[];\n\n/** camelCase → kebab-case, preserving CSS custom properties (`--var-name`). */\nfunction toKebabCase(str: string): string {\n if (str.startsWith('--')) return str;\n return str.replace(/([A-Z])/g, '-$1').toLowerCase();\n}\nfunction styleObjectToString(obj: StyleObject): string {\n return Object.entries(obj)\n .filter(([, value]) => value != null)\n .map(([key, value]) => `${toKebabCase(key)}: ${value}`)\n .join('; ');\n}\n\n/** Combine multiple style formats into one CSS string (like `class:list` for styles). */\nexport function styleList(...styles: StyleList[]): string {\n const result: string[] = [];\n const process = (item: StyleList): void => {\n if (item == null) return;\n if (Array.isArray(item)) {\n item.forEach(process);\n } else if (typeof item === 'string') {\n const trimmed = item.trim();\n if (trimmed) result.push(trimmed);\n } else {\n const str = styleObjectToString(item as StyleObject);\n if (str) result.push(str);\n }\n };\n styles.forEach(process);\n return result.join('; ');\n}\n\n/** Element descriptor: a tag name, text content, and optional attributes. */\nexport interface El<Tag extends string = string> {\n text: string;\n tag: Tag;\n attributes?: Record<string, unknown>;\n}\n\nfunction isEl(value: string | El): value is El {\n return typeof value === 'object' && value !== null && 'tag' in value && 'text' in value;\n}\n\nfunction attributesToString(attrs: Record<string, unknown>): string {\n const parts: string[] = [];\n for (const [key, value] of Object.entries(attrs)) {\n if (value == null || value === false) continue;\n if (value === true) {\n parts.push(key);\n } else if (key === 'style' && typeof value === 'object') {\n parts.push(`style=\"${styleList(value as StyleValue)}\"`);\n } else {\n const text = Array.isArray(value)\n ? value.filter((v): v is string => typeof v === 'string' && v !== '').join(' ')\n : typeof value === 'object'\n ? JSON.stringify(value)\n : String(value as string | number | boolean);\n parts.push(`${key}=\"${text.replace(/\"/g, '"')}\"`);\n }\n }\n return parts.join(' ');\n}\n\n/** Normalize a string or `El` object into an HTML string (for `set:html`). */\nexport function toHtml<Tag extends string>(content: string | El<Tag>): string {\n if (!isEl(content)) return content;\n const { tag, text, attributes } = content;\n const attrStr = attributes ? attributesToString(attributes) : '';\n const t = String(tag);\n return attrStr ? `<${t} ${attrStr}>${text}</${t}>` : `<${t}>${text}</${t}>`;\n}\n\n// ── node-tree renderer — { tag, attrs, children } ────────────────────────────\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\nfunction defaultResolveText(value: Localizable): string {\n if (typeof value === 'string') return value;\n const values = Object.values(value);\n return values[0] ?? '';\n}\n\nfunction escapeHtml(text: string): string {\n return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n}\n\nfunction nodeToHtml(node: ContentNode, resolveText: (value: Localizable) => string): string {\n if (typeof node === 'string') return escapeHtml(resolveText(node));\n const { tag, attrs, text, children } = node;\n const attrStr = attrs ? attributesToString(attrs) : '';\n const open = attrStr ? `<${tag} ${attrStr}>` : `<${tag}>`;\n if (VOID_ELEMENTS.has(tag)) return open;\n let inner = '';\n if (text != null) inner = escapeHtml(resolveText(text));\n else if (children?.length)\n inner = children.map((child) => nodeToHtml(child, resolveText)).join('');\n return `${open}${inner}</${tag}>`;\n}\n\n/** Render an array of `ContentNode`s to an HTML string. */\nexport function nodesToHtml(\n nodes: ContentNode[],\n resolveText: (value: Localizable) => string = defaultResolveText,\n): string {\n return nodes.map((node) => nodeToHtml(node, resolveText)).join('');\n}\n","export interface ArticleAuthor {\n name: string;\n url?: string;\n}\n\nexport interface ArticleGraphOptions {\n headline: string;\n description?: string;\n image?: string | string[];\n datePublished: string;\n dateModified?: string;\n author: ArticleAuthor | ArticleAuthor[];\n publisher?: {\n name: string;\n logo?: string;\n };\n mainEntityOfPage?: string;\n articleSection?: string;\n wordCount?: number;\n keywords?: string[];\n}\n\n/** Build a schema.org Article JSON-LD graph. */\nexport function articleGraph(options: ArticleGraphOptions): Record<string, unknown> {\n const {\n headline,\n description,\n image,\n datePublished,\n dateModified,\n author,\n publisher,\n mainEntityOfPage,\n articleSection,\n wordCount,\n keywords,\n } = options;\n\n const authors = Array.isArray(author) ? author : [author];\n\n return {\n '@context': 'https://schema.org',\n '@type': 'Article',\n headline,\n ...(description && { description }),\n ...(image && { image: Array.isArray(image) ? image : [image] }),\n datePublished,\n ...(dateModified && { dateModified }),\n author: authors.map((a) => ({\n '@type': 'Person',\n name: a.name,\n ...(a.url && { url: a.url }),\n })),\n ...(publisher && {\n publisher: {\n '@type': 'Organization',\n name: publisher.name,\n ...(publisher.logo && { logo: { '@type': 'ImageObject', url: publisher.logo } }),\n },\n }),\n ...(mainEntityOfPage && { mainEntityOfPage: { '@type': 'WebPage', '@id': mainEntityOfPage } }),\n ...(articleSection && { articleSection }),\n ...(wordCount && { wordCount }),\n ...(keywords && { keywords: keywords.join(', ') }),\n };\n}\n","export interface BreadcrumbItem {\n name: string;\n url: string;\n}\n\nexport interface BreadcrumbGraphOptions {\n items: BreadcrumbItem[];\n}\n\n/** Build a schema.org BreadcrumbList JSON-LD graph. */\nexport function breadcrumbGraph(options: BreadcrumbGraphOptions): Record<string, unknown> {\n return {\n '@context': 'https://schema.org',\n '@type': 'BreadcrumbList',\n itemListElement: options.items.map((item, index) => ({\n '@type': 'ListItem',\n position: index + 1,\n name: item.name,\n item: item.url,\n })),\n };\n}\n","export interface FAQItem {\n question: string;\n answer: string;\n}\n\nexport interface FAQGraphOptions {\n items: FAQItem[];\n}\n\n/**\n * Build a schema.org FAQPage JSON-LD graph.\n *\n * NOTE: Google recommends FAQ markup only for authoritative government\n * and health sites. For other sites, consider using QAPage schema instead.\n */\nexport function faqGraph(options: FAQGraphOptions): Record<string, unknown> {\n return {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n mainEntity: options.items.map((item) => ({\n '@type': 'Question',\n name: item.question,\n acceptedAnswer: {\n '@type': 'Answer',\n text: item.answer,\n },\n })),\n };\n}\n","export interface OrganizationGraphOptions {\n name: string;\n url?: string;\n logo?: string;\n description?: string;\n email?: string;\n telephone?: string;\n address?: {\n streetAddress?: string;\n addressLocality?: string;\n addressRegion?: string;\n postalCode?: string;\n addressCountry?: string;\n };\n sameAs?: string[];\n foundingDate?: string;\n founders?: string[];\n numberOfEmployees?: number | { minValue: number; maxValue: number };\n parentOrganization?: {\n name: string;\n url?: string;\n };\n subOrganization?: {\n name: string;\n url?: string;\n }[];\n contactPoint?: {\n type?: 'customer service' | 'technical support' | 'sales' | 'billing support' | 'reservations';\n telephone: string;\n email?: string;\n contactType: string;\n availableLanguage?: string[];\n areaServed?: string[];\n }[];\n areaServed?: string[];\n brand?: string;\n award?: string[];\n memberOf?: {\n name: string;\n url?: string;\n }[];\n}\n\n/** Build a schema.org Organization JSON-LD graph. */\nexport function organizationGraph(options: OrganizationGraphOptions): Record<string, unknown> {\n const {\n name,\n url,\n logo,\n description,\n email,\n telephone,\n address,\n sameAs,\n foundingDate,\n founders,\n numberOfEmployees,\n parentOrganization,\n subOrganization,\n contactPoint,\n areaServed,\n brand,\n award,\n memberOf,\n } = options;\n\n return {\n '@context': 'https://schema.org',\n '@type': 'Organization',\n name,\n ...(url && { url }),\n ...(logo && { logo }),\n ...(description && { description }),\n ...(email && { email }),\n ...(telephone && { telephone }),\n ...(address && {\n address: {\n '@type': 'PostalAddress',\n ...(address.streetAddress && { streetAddress: address.streetAddress }),\n ...(address.addressLocality && { addressLocality: address.addressLocality }),\n ...(address.addressRegion && { addressRegion: address.addressRegion }),\n ...(address.postalCode && { postalCode: address.postalCode }),\n ...(address.addressCountry && { addressCountry: address.addressCountry }),\n },\n }),\n ...(sameAs && { sameAs }),\n ...(foundingDate && { foundingDate }),\n ...(founders && {\n founders: founders.map((f) => ({\n '@type': 'Person',\n name: f,\n })),\n }),\n ...(numberOfEmployees && {\n numberOfEmployees:\n typeof numberOfEmployees === 'number'\n ? { '@type': 'QuantitativeValue', value: numberOfEmployees }\n : {\n '@type': 'QuantitativeValue',\n minValue: numberOfEmployees.minValue,\n maxValue: numberOfEmployees.maxValue,\n },\n }),\n ...(parentOrganization && {\n parentOrganization: {\n '@type': 'Organization',\n name: parentOrganization.name,\n ...(parentOrganization.url && { url: parentOrganization.url }),\n },\n }),\n ...(subOrganization && {\n subOrganization: subOrganization.map((sub) => ({\n '@type': 'Organization',\n name: sub.name,\n ...(sub.url && { url: sub.url }),\n })),\n }),\n ...(contactPoint && {\n contactPoint: contactPoint.map((cp) => ({\n '@type': 'ContactPoint',\n telephone: cp.telephone,\n contactType: cp.contactType,\n ...(cp.email && { email: cp.email }),\n ...(cp.availableLanguage && { availableLanguage: cp.availableLanguage }),\n ...(cp.areaServed && { areaServed: cp.areaServed }),\n })),\n }),\n ...(areaServed && { areaServed }),\n ...(brand && { brand: { '@type': 'Brand', name: brand } }),\n ...(award && { award }),\n ...(memberOf && {\n memberOf: memberOf.map((m) => ({\n '@type': 'Organization',\n name: m.name,\n ...(m.url && { url: m.url }),\n })),\n }),\n };\n}\n","/**\n * Semantic icon name mapping across icon sets.\n *\n * Keys are functional/semantic names (what the icon means).\n * Values are the actual icon names in each set.\n *\n * Two consumers:\n * - `generateIconInclude()` (below) — build time. Turns the semantic names a project\n * declares into the `include` map astro-icon needs, so the icon set can be swapped\n * without touching call sites.\n * - `<wc-icon-picker>` (@getvitops/core) — browser. Its `semantic` mode lists these\n * keys so an icon can be chosen by meaning rather than by set-specific name.\n *\n * `resolveIcon`/`resolveBrandIcon` map one semantic name to a fully-qualified\n * `prefix:name` string for a given set.\n */\n\n/**\n * Maps astro-icon prefixes to iconMap lookup keys.\n * FA7 variants (fa7-solid, fa7-regular, etc.) all share the same icon names\n * and map to the 'fa7' key. Other sets map to themselves.\n */\nexport const prefixToMapKey: Record<string, string> = {\n 'fa7-solid': 'fa7',\n 'fa7-regular': 'fa7',\n 'fa7-light': 'fa7',\n 'fa7-thin': 'fa7',\n 'fa7-brands': 'fa7-brands',\n 'simple-icons': 'simple-icons',\n 'material-symbols': 'material-symbols',\n lucide: 'lucide',\n ph: 'ph',\n};\n\n/**\n * Sets whose weights are a name SUFFIX inside one collection rather than\n * separate prefixed collections. Phosphor is the case that forced this:\n * `ph:lightning`, `ph:lightning-bold`, `ph:lightning-fill` all live in `ph`,\n * whereas Font Awesome splits the same idea across `fa7-solid`/`fa7-regular`/…\n * (which is what `prefixToMapKey` collapses).\n *\n * The first entry is the unsuffixed default — asking for it adds nothing.\n */\nexport const WEIGHTED_SETS: Record<string, readonly string[]> = {\n ph: ['regular', 'bold', 'duotone', 'fill', 'light', 'thin'],\n};\n\nexport const iconMap = {\n fa7: {\n // Navigation / UI\n menu: 'bars',\n close: 'xmark',\n home: 'home',\n settings: 'gear',\n search: 'magnifying-glass',\n 'chevron-left': 'chevron-left',\n 'chevron-right': 'chevron-right',\n 'chevron-up': 'chevron-up',\n 'chevron-down': 'chevron-down',\n 'arrow-left': 'arrow-left',\n 'arrow-right': 'arrow-right',\n 'arrow-up': 'arrow-up',\n 'arrow-down': 'arrow-down',\n 'external-link': 'arrow-up-right-from-square',\n 'more-vert': 'ellipsis-vertical',\n 'more-horiz': 'ellipsis',\n\n // Actions\n add: 'plus',\n remove: 'minus',\n delete: 'trash',\n edit: 'pen',\n save: 'floppy-disk',\n copy: 'copy',\n paste: 'paste',\n attach: 'paperclip',\n upload: 'upload',\n download: 'download',\n share: 'share',\n bookmark: 'bookmark',\n favorite: 'heart',\n star: 'star',\n login: 'right-to-bracket',\n logout: 'right-from-bracket',\n\n // Communication\n email: 'envelope',\n phone: 'phone',\n location: 'location-dot',\n globe: 'globe',\n link: 'link',\n\n // Time\n clock: 'clock',\n calendar: 'calendar',\n schedule: 'calendar-days',\n\n // People\n person: 'user',\n group: 'users',\n\n // Content / Files\n file: 'file',\n 'file-add': 'file-circle-plus',\n folder: 'folder',\n 'folder-open': 'folder-open',\n 'folder-add': 'folder-plus',\n image: 'image',\n export: 'file-export',\n import: 'file-import',\n backup: 'cloud-arrow-up',\n compress: 'compress',\n\n // Status / Feedback\n check: 'check',\n error: 'circle-exclamation',\n warning: 'triangle-exclamation',\n info: 'circle-info',\n help: 'circle-question',\n\n // Commerce\n cart: 'cart-shopping',\n tag: 'tag',\n 'credit-card': 'credit-card',\n receipt: 'receipt',\n\n // Nature (landscaping context)\n leaf: 'leaf',\n tree: 'tree',\n seedling: 'seedling',\n trowel: 'trowel',\n droplet: 'droplet',\n snowflake: 'snowflake',\n sun: 'sun',\n cloud: 'cloud',\n\n // Layout / View\n grid: 'table-cells',\n list: 'list',\n filter: 'filter',\n sort: 'sort',\n fullscreen: 'expand',\n collapse: 'compress',\n\n // Misc\n building: 'building',\n video: 'video',\n lock: 'lock',\n unlock: 'lock-open',\n eye: 'eye',\n 'eye-off': 'eye-slash',\n print: 'print',\n code: 'code',\n palette: 'palette',\n lightbulb: 'lightbulb',\n lightning: 'bolt',\n },\n\n 'fa7-brands': {\n // Social Media\n facebook: 'facebook',\n instagram: 'instagram',\n x: 'x-twitter',\n bluesky: 'bluesky',\n threads: 'threads',\n mastodon: 'mastodon',\n linkedin: 'linkedin',\n youtube: 'youtube',\n tiktok: 'tiktok',\n pinterest: 'pinterest-p',\n reddit: 'reddit',\n snapchat: 'snapchat',\n github: 'github',\n\n // Messaging\n whatsapp: 'whatsapp',\n telegram: 'telegram',\n discord: 'discord',\n\n // Payment\n stripe: 'stripe',\n paypal: 'paypal',\n visa: 'cc-visa',\n mastercard: 'cc-mastercard',\n amex: 'cc-amex',\n discover: 'cc-discover',\n 'apple-pay': 'apple-pay',\n 'google-pay': 'google-pay',\n 'amazon-pay': 'amazon-pay',\n\n // Review / Directory\n yelp: 'yelp',\n google: 'google',\n\n // Platforms\n apple: 'apple',\n microsoft: 'microsoft',\n amazon: 'amazon',\n shopify: 'shopify',\n wordpress: 'wordpress',\n cloudflare: 'cloudflare',\n },\n\n 'simple-icons': {\n // Social Media\n facebook: 'facebook',\n instagram: 'instagram',\n x: 'x',\n bluesky: 'bluesky',\n threads: 'threads',\n mastodon: 'mastodon',\n linkedin: 'linkedin',\n youtube: 'youtube',\n tiktok: 'tiktok',\n pinterest: 'pinterest',\n reddit: 'reddit',\n snapchat: 'snapchat',\n github: 'github',\n\n // Messaging\n whatsapp: 'whatsapp',\n telegram: 'telegram',\n discord: 'discord',\n\n // Payment\n stripe: 'stripe',\n paypal: 'paypal',\n visa: 'visa',\n mastercard: 'mastercard',\n amex: 'americanexpress',\n discover: 'discover',\n 'apple-pay': 'applepay',\n 'google-pay': 'googlepay',\n 'amazon-pay': 'amazonpay',\n klarna: 'klarna',\n afterpay: 'afterpay',\n square: 'square',\n cashapp: 'cashapp',\n interac: 'interac',\n\n // Review / Directory\n yelp: 'yelp',\n google: 'google',\n tripadvisor: 'tripadvisor',\n trustpilot: 'trustpilot',\n 'google-maps': 'googlemaps',\n homeadvisor: 'homeadvisor',\n houzz: 'houzz',\n nextdoor: 'nextdoor',\n bbb: 'bbb',\n\n // Platforms\n apple: 'apple',\n microsoft: 'microsoft',\n amazon: 'amazon',\n shopify: 'shopify',\n wordpress: 'wordpress',\n cloudflare: 'cloudflare',\n waze: 'waze',\n },\n\n 'material-symbols': {\n // Navigation / UI\n menu: 'menu',\n close: 'close',\n home: 'home',\n settings: 'settings',\n search: 'search',\n 'chevron-left': 'chevron-left',\n 'chevron-right': 'chevron-right',\n // Material Symbols' chevrons are only named `chevron-*` on the horizontal\n // axis; the vertical pair is `expand-more`/`expand-less`, same glyph.\n 'chevron-up': 'expand-less',\n 'chevron-down': 'expand-more',\n 'arrow-left': 'arrow-back',\n 'arrow-right': 'arrow-forward',\n 'arrow-up': 'arrow-upward',\n 'arrow-down': 'arrow-downward',\n 'external-link': 'open-in-new',\n 'more-vert': 'more-vert',\n 'more-horiz': 'more-horiz',\n\n // Actions\n add: 'add',\n remove: 'remove',\n delete: 'delete',\n edit: 'edit',\n save: 'save',\n copy: 'content-copy',\n paste: 'content-paste',\n attach: 'attach-file',\n upload: 'upload',\n download: 'download',\n share: 'share',\n bookmark: 'bookmark',\n favorite: 'favorite',\n star: 'star',\n login: 'login',\n logout: 'logout',\n\n // Communication\n email: 'mail',\n phone: 'call',\n location: 'location-on',\n globe: 'language',\n link: 'link',\n\n // Time\n clock: 'schedule',\n calendar: 'calendar-today',\n schedule: 'calendar-month',\n\n // People\n person: 'person',\n group: 'group',\n\n // Content / Files\n file: 'description',\n 'file-add': 'note-add',\n folder: 'folder',\n 'folder-open': 'folder-open',\n 'folder-add': 'create-new-folder',\n image: 'image',\n export: 'upload-file',\n import: 'download',\n backup: 'backup',\n compress: 'compress',\n\n // Status / Feedback\n check: 'check-circle',\n error: 'error',\n warning: 'warning',\n info: 'info',\n help: 'help',\n\n // Commerce\n cart: 'shopping-cart',\n tag: 'sell',\n 'credit-card': 'credit-card',\n receipt: 'receipt-long',\n\n // Nature (landscaping context)\n leaf: 'eco',\n tree: 'forest',\n seedling: 'potted-plant',\n trowel: 'construction',\n droplet: 'water-drop',\n snowflake: 'ac-unit',\n sun: 'light-mode',\n cloud: 'cloud',\n\n // Layout / View\n grid: 'grid-view',\n list: 'list',\n filter: 'filter-list',\n sort: 'sort',\n fullscreen: 'fullscreen',\n collapse: 'fullscreen-exit',\n\n // Misc\n building: 'domain',\n video: 'videocam',\n lock: 'lock',\n unlock: 'lock-open',\n eye: 'visibility',\n 'eye-off': 'visibility-off',\n print: 'print',\n code: 'code',\n palette: 'palette',\n lightbulb: 'lightbulb',\n lightning: 'bolt',\n },\n lucide: {\n // Navigation / UI\n menu: 'menu',\n close: 'x',\n home: 'house',\n settings: 'settings',\n search: 'search',\n 'chevron-left': 'chevron-left',\n 'chevron-right': 'chevron-right',\n 'chevron-up': 'chevron-up',\n 'chevron-down': 'chevron-down',\n 'arrow-left': 'arrow-left',\n 'arrow-right': 'arrow-right',\n 'arrow-up': 'arrow-up',\n 'arrow-down': 'arrow-down',\n 'external-link': 'external-link',\n 'more-vert': 'ellipsis-vertical',\n 'more-horiz': 'ellipsis',\n\n // Actions\n add: 'plus',\n remove: 'minus',\n delete: 'trash-2',\n edit: 'pencil',\n save: 'save',\n copy: 'copy',\n paste: 'clipboard-paste',\n attach: 'paperclip',\n upload: 'upload',\n download: 'download',\n share: 'share-2',\n bookmark: 'bookmark',\n favorite: 'heart',\n star: 'star',\n login: 'log-in',\n logout: 'log-out',\n\n // Communication\n email: 'mail',\n phone: 'phone',\n location: 'map-pin',\n globe: 'globe',\n link: 'link',\n\n // Time\n clock: 'clock',\n calendar: 'calendar',\n schedule: 'calendar-days',\n\n // People\n person: 'user',\n group: 'users',\n\n // Content / Files\n file: 'file',\n 'file-add': 'file-plus',\n folder: 'folder',\n 'folder-open': 'folder-open',\n 'folder-add': 'folder-plus',\n image: 'image',\n export: 'file-output',\n import: 'file-input',\n backup: 'hard-drive-upload',\n compress: 'minimize-2',\n\n // Status / Feedback\n check: 'check-circle',\n error: 'circle-alert',\n warning: 'triangle-alert',\n info: 'info',\n help: 'circle-help',\n\n // Commerce\n cart: 'shopping-cart',\n tag: 'tag',\n 'credit-card': 'credit-card',\n receipt: 'receipt',\n\n // Nature (landscaping context)\n leaf: 'leaf',\n tree: 'tree-pine',\n seedling: 'sprout',\n trowel: 'shovel',\n droplet: 'droplet',\n snowflake: 'snowflake',\n sun: 'sun',\n cloud: 'cloud',\n\n // Layout / View\n grid: 'layout-grid',\n list: 'list',\n filter: 'filter',\n sort: 'arrow-up-down',\n fullscreen: 'maximize',\n collapse: 'minimize',\n\n // Misc\n building: 'building-2',\n video: 'video',\n lock: 'lock',\n unlock: 'lock-open',\n eye: 'eye',\n 'eye-off': 'eye-off',\n print: 'printer',\n code: 'code',\n palette: 'palette',\n lightbulb: 'lightbulb',\n lightning: 'zap',\n },\n // Phosphor. Unlike fa7, the weights are NOT separate collections — `ph` is one\n // collection and the weight is a name SUFFIX (`lightning`, `lightning-bold`,\n // `lightning-fill`, …), which is why `prefixToMapKey` maps `ph` to itself with\n // nothing to collapse. See WEIGHTED_SETS / resolveIcon's `weight` option.\n ph: {\n // Navigation / UI\n menu: 'list',\n close: 'x',\n home: 'house',\n settings: 'gear',\n search: 'magnifying-glass',\n // Phosphor's chevron is the `caret` family; `ph:chevron-*` doesn't exist.\n 'chevron-left': 'caret-left',\n 'chevron-right': 'caret-right',\n 'chevron-up': 'caret-up',\n 'chevron-down': 'caret-down',\n 'arrow-left': 'arrow-left',\n 'arrow-right': 'arrow-right',\n 'arrow-up': 'arrow-up',\n 'arrow-down': 'arrow-down',\n 'external-link': 'arrow-square-out',\n 'more-vert': 'dots-three-vertical',\n 'more-horiz': 'dots-three',\n // Actions\n add: 'plus',\n remove: 'minus',\n delete: 'trash',\n edit: 'pencil',\n save: 'floppy-disk',\n copy: 'copy',\n paste: 'clipboard',\n attach: 'paperclip',\n upload: 'upload',\n download: 'download',\n share: 'share',\n bookmark: 'bookmark',\n favorite: 'heart',\n star: 'star',\n login: 'sign-in',\n logout: 'sign-out',\n // Communication\n email: 'envelope',\n phone: 'phone',\n location: 'map-pin',\n globe: 'globe',\n link: 'link',\n // Time\n clock: 'clock',\n calendar: 'calendar',\n schedule: 'calendar-dots',\n // People\n person: 'person',\n group: 'users',\n // Content / files\n file: 'file',\n 'file-add': 'file-plus',\n folder: 'folder',\n 'folder-open': 'folder-open',\n 'folder-add': 'folder-plus',\n image: 'image',\n export: 'upload-simple',\n import: 'download-simple',\n backup: 'cloud-arrow-up',\n compress: 'arrows-in',\n // Status / feedback\n check: 'check',\n error: 'warning-circle',\n warning: 'warning',\n info: 'info',\n help: 'question',\n // Commerce\n cart: 'shopping-cart',\n tag: 'tag',\n 'credit-card': 'credit-card',\n receipt: 'receipt',\n // Nature (landscaping)\n leaf: 'leaf',\n tree: 'tree',\n seedling: 'plant',\n trowel: 'shovel',\n droplet: 'drop',\n snowflake: 'snowflake',\n sun: 'sun',\n cloud: 'cloud',\n // Layout / view\n grid: 'squares-four',\n list: 'list',\n filter: 'funnel',\n sort: 'arrows-down-up',\n fullscreen: 'corners-out',\n collapse: 'corners-in',\n // Misc\n building: 'building',\n video: 'video',\n lock: 'lock',\n unlock: 'lock-open',\n eye: 'eye',\n 'eye-off': 'eye-slash',\n print: 'printer',\n code: 'code',\n palette: 'palette',\n lightbulb: 'lightbulb',\n lightning: 'lightning',\n },\n} as const satisfies Record<string, Record<string, string>>;\n\nexport type IconSet = keyof typeof iconMap;\nexport type SemanticIcon = keyof (typeof iconMap)['fa7'];\nexport type BrandIcon = keyof (typeof iconMap)['simple-icons'];\n\n/**\n * Resolve a semantic icon name to a fully-qualified astro-icon string.\n * Names containing ':' are returned as-is (pass-through for fully-qualified names).\n *\n * @param name - Semantic name ('email') or fully-qualified ('fa7-solid:envelope')\n * @param prefix - astro-icon prefix, e.g. 'fa7-solid', 'material-symbols', 'lucide', 'ph'\n * @param opts.weight - Weight for suffix-weighted sets (see `WEIGHTED_SETS`), e.g.\n * `resolveIcon('menu', 'ph', { weight: 'bold' })` → `'ph:list-bold'`. Ignored for\n * sets that aren't suffix-weighted; an unknown weight throws rather than silently\n * resolving to the regular glyph, which would be indistinguishable from a typo.\n */\nexport function resolveIcon(name: string, prefix: string, opts?: { weight?: string }): string {\n if (name.includes(':')) return name;\n const mapKey = prefixToMapKey[prefix] as IconSet | undefined;\n if (!mapKey)\n throw new Error(\n `Unknown icon prefix \"${prefix}\". Valid: ${Object.keys(prefixToMapKey).join(', ')}`,\n );\n const map = iconMap[mapKey];\n const resolved = map[name as keyof typeof map];\n if (!resolved)\n throw new Error(`Icon \"${name}\" not found in set \"${prefix}\" (map key: \"${mapKey}\")`);\n return `${prefix}:${applyWeight(resolved, prefix, opts?.weight)}`;\n}\n\n/** Append a weight suffix for suffix-weighted sets. The first weight is the bare default. */\nfunction applyWeight(name: string, prefix: string, weight?: string): string {\n if (!weight) return name;\n const weights = WEIGHTED_SETS[prefix];\n if (!weights) return name;\n if (!weights.includes(weight))\n throw new Error(\n `Unknown weight \"${weight}\" for icon set \"${prefix}\". Valid: ${weights.join(', ')}.`,\n );\n return weight === weights[0] ? name : `${name}-${weight}`;\n}\n\n/**\n * Resolve a brand icon name to a fully-qualified astro-icon string.\n * Names containing ':' are returned as-is (pass-through).\n *\n * @param name - Semantic brand name ('facebook') or fully-qualified ('simple-icons:facebook')\n * @param prefix - astro-icon prefix, e.g. 'simple-icons', 'fa7-brands'\n */\nexport function resolveBrandIcon(name: string, prefix: string): string {\n if (name.includes(':')) return name;\n const mapKey = prefixToMapKey[prefix] as IconSet | undefined;\n if (!mapKey) throw new Error(`Unknown brand icon prefix \"${prefix}\"`);\n const map = iconMap[mapKey];\n const resolved = map[name as keyof typeof map];\n if (!resolved)\n throw new Error(`Brand icon \"${name}\" not found in set \"${prefix}\" (map key: \"${mapKey}\")`);\n return `${prefix}:${resolved}`;\n}\n\n/**\n * Generate the astro-icon `include` map from configured icon sets.\n *\n * Resolves two kinds of entries from the `icons` section of `site.config.yaml`:\n * - Per-set lists (e.g. `'fa7-solid': ['bars', 'plus']`) are passed through as-is.\n * - `semantic` names are looked up in the configured `ui` and `brand` prefix maps,\n * and the resolved icon names are merged into those sets' lists.\n *\n * Only explicitly configured icons are included — there is no fallback to all icons.\n *\n * @param iconsConfig - Icons config from site.config.yaml (icons section)\n * @returns Record<string, string[]> for astro-icon's `include` option\n */\nexport function generateIconInclude(iconsConfig?: {\n ui?: string;\n brand?: string;\n weight?: string;\n semantic?: string[];\n [prefix: string]: string | string[] | undefined;\n}): Record<string, string[]> {\n const uiPrefix = iconsConfig?.ui ?? 'fa7-solid';\n const brandPrefix = iconsConfig?.brand ?? 'simple-icons';\n const include: Record<string, string[]> = {};\n\n const addToInclude = (prefix: string, names: string[]) => {\n include[prefix] = [...new Set([...(include[prefix] ?? []), ...names])];\n };\n\n // Pass through per-set explicit lists directly\n for (const [key, val] of Object.entries(iconsConfig ?? {})) {\n if (\n key !== 'ui' &&\n key !== 'brand' &&\n key !== 'weight' &&\n key !== 'semantic' &&\n Array.isArray(val)\n ) {\n addToInclude(key, val as string[]);\n }\n }\n\n // Resolve semantic names through ui and brand prefix maps.\n const uiMapKey = prefixToMapKey[uiPrefix] as IconSet | undefined;\n const brandMapKey = prefixToMapKey[brandPrefix] as IconSet | undefined;\n const unknownPrefix: string[] = [];\n if (!uiMapKey) unknownPrefix.push(`ui: '${uiPrefix}'`);\n if (!brandMapKey) unknownPrefix.push(`brand: '${brandPrefix}'`);\n if (unknownPrefix.length)\n throw new Error(\n `[vitops icons] Unknown icon set ${unknownPrefix.join(' and ')}. ` +\n `Known sets: ${Object.keys(prefixToMapKey).join(', ')}.`,\n );\n\n const unresolved: string[] = [];\n for (const name of iconsConfig?.semantic ?? []) {\n const ui = (iconMap[uiMapKey!] as Record<string, string>)[name];\n const brand = (iconMap[brandMapKey!] as Record<string, string>)[name];\n // The weight is part of the icon NAME for suffix-weighted sets, so the\n // bundled name has to carry it — including `ph:list-bold` but not\n // `ph:list` would ship the wrong glyph (or nothing) under output: 'server'.\n if (ui) addToInclude(uiPrefix, [applyWeight(ui, uiPrefix, iconsConfig?.weight)]);\n if (brand) addToInclude(brandPrefix, [applyWeight(brand, brandPrefix, iconsConfig?.weight)]);\n if (!ui && !brand) unresolved.push(name);\n }\n\n // Fail the build rather than silently omitting the icon. Skipping quietly is\n // what makes swapping icon sets frightening: the swap \"succeeds\" and the gaps\n // only show up as missing glyphs in production.\n if (unresolved.length)\n throw new Error(\n `[vitops icons] ${unresolved.length} semantic icon name(s) not found in ` +\n `ui set '${uiPrefix}' or brand set '${brandPrefix}': ${unresolved.join(', ')}.\\n` +\n `Either add them to iconMap in @getvitops/core, or drop them from the ` +\n `\\`semantic\\` list. Available in '${uiPrefix}': ` +\n `${Object.keys(iconMap[uiMapKey!]).slice(0, 12).join(', ')}…`,\n );\n\n return include;\n}\n","/**\n * Consumer source discovery.\n *\n * Lifted verbatim out of `@getvitops/cli`, where it was a private helper behind\n * `vitops lint`. It lives here now because a second caller needs it: the Astro\n * integration scans for icon usage during `astro:config:setup`, and it cannot\n * import the CLI — `@getvitops/cli` exposes only a `bin`, and its entry calls\n * `main()` at module scope, so importing it would run the CLI.\n *\n * Deliberately hand-rolled rather than a glob dependency: the whole job is one\n * `readdirSync` recursion with two allow/deny sets, and it runs synchronously\n * inside a config hook where an async glob would have to be awaited anyway.\n */\nimport { readFileSync, readdirSync } from 'node:fs';\nimport { extname, join } from 'node:path';\n\n/** A file the scanner found, with its contents already read. */\nexport interface SourceFile {\n path: string;\n text: string;\n}\n\nexport interface ScanOptions {\n /** File extensions to read. Defaults to `SCAN_EXT`. */\n exts?: Iterable<string>;\n /** Directory names to skip entirely. Defaults to `SCAN_SKIP`. */\n skipDirs?: Iterable<string>;\n}\n\n/**\n * Extensions worth scanning: every template language the framework's classes\n * and icon names can appear in, plus the markdown that can embed them.\n */\nexport const SCAN_EXT: ReadonlySet<string> = new Set([\n '.astro',\n '.html',\n '.htm',\n '.js',\n '.jsx',\n '.ts',\n '.tsx',\n '.vue',\n '.svelte',\n '.php',\n '.md',\n '.mdx',\n]);\n\n/** Directories that only ever hold dependencies or build output. */\nexport const SCAN_SKIP: ReadonlySet<string> = new Set([\n 'node_modules',\n 'dist',\n '.git',\n '.astro',\n 'build',\n 'coverage',\n]);\n\n/**\n * Recursively read every scannable file under `dir`.\n *\n * Dotfiles and dot-directories are skipped wholesale — they hold tooling config,\n * not templates, and `.astro`/`.git` would otherwise be walked twice over.\n */\nexport function scanFiles(dir: string, opts?: ScanOptions): SourceFile[] {\n const exts = opts?.exts ? new Set(opts.exts) : SCAN_EXT;\n const skip = opts?.skipDirs ? new Set(opts.skipDirs) : SCAN_SKIP;\n const acc: SourceFile[] = [];\n walk(dir, exts, skip, acc);\n return acc;\n}\n\nfunction walk(\n dir: string,\n exts: ReadonlySet<string>,\n skip: ReadonlySet<string>,\n acc: SourceFile[],\n): void {\n for (const e of readdirSync(dir, { withFileTypes: true })) {\n if (e.name.startsWith('.') && e.name !== '.') continue;\n const p = join(dir, e.name);\n if (e.isDirectory()) {\n if (!skip.has(e.name)) walk(p, exts, skip, acc);\n } else if (exts.has(extname(e.name))) {\n acc.push({ path: p, text: readFileSync(p, 'utf8') });\n }\n }\n}\n","/**\n * Find the icons a consumer's source actually uses.\n *\n * This exists for one reason: bundle size under `output: 'server'`. astro-icon\n * is zero-config for static builds, but on a server/hybrid build it bundles\n * EVERY icon in a set unless given an `include` map — so consumers hand-maintain\n * a list, and hand-maintained lists rot. Scanning derives it instead.\n *\n * The judgement call throughout is the same one `vitops lint`'s `extractClasses`\n * makes, and for the same reason: a template hole (`name={expr}`) is not a typo\n * and must not be guessed at. An unresolvable reference is REPORTED, never\n * invented — the caller warns and asks the author to declare it. Quietly\n * inferring would produce an `include` that is confidently wrong, which is worse\n * than one that is honestly incomplete.\n */\n\n/** How an icon reference was written. Useful for phrasing the warning. */\nexport type IconRefKind = 'component' | 'prop' | 'object' | 'sprite';\n\n/** A statically resolvable icon name. */\nexport interface IconRef {\n name: string;\n kind: IconRefKind;\n attr: string;\n file: string;\n line: number;\n}\n\n/** A reference whose name is computed at runtime and cannot be read statically. */\nexport interface DynamicIconRef {\n expr: string;\n attr: string;\n file: string;\n line: number;\n}\n\nexport interface IconScanResult {\n refs: IconRef[];\n dynamic: DynamicIconRef[];\n /** Unique static names, in first-seen order. */\n names: string[];\n}\n\nexport interface IconScanOptions {\n /** Extra prop names to treat as icon-bearing, beyond the defaults. */\n props?: string[];\n}\n\n/**\n * Props that carry an icon name. `icon` covers the component convention\n * (`Popover`/`Drawer`/`Details` triggers); the start/end pair covers adornments\n * on links and buttons.\n */\nconst DEFAULT_PROPS = ['icon', 'startIcon', 'endIcon', 'leadingIcon', 'trailingIcon'];\n\n/**\n * `<Icon …>` and any capitalised component whose name ends in `Icon`.\n * Requires a capital or the literal `Icon`, so `<iconButton>` and plain HTML\n * never match.\n */\nconst COMPONENT = /<([A-Z][\\w.]*Icon|Icon)\\b([^>]*?)\\/?>/g;\n\n/** Sprite references: `<use href=\"…/icons.svg#menu\">`, incl. legacy `xlink:href`. */\nconst SPRITE_USE = /<use\\b[^>]*?\\b(?:xlink:)?href\\s*=\\s*(?:\"([^\"#]*)#([^\"]*)\"|'([^'#]*)#([^']*)')/g;\n\n/**\n * An attribute value: a quoted literal, a braced single literal, or a braced\n * expression. The final alternative is what marks a value as dynamic — it is\n * matched on purpose so the reference can be REPORTED rather than skipped.\n *\n * That last alternative stops at the first `}`, so a reported expression\n * containing its own braces (`{\\`a:${b}\\`}`) is truncated in the warning text.\n * Deliberate: balancing braces with a regex buys nothing here, because the\n * actionable part of the report is the file and line, not the expression.\n */\nconst VALUE = String.raw`(?:\"([^\"]*)\"|'([^']*)'|\\{\\s*(?:\"([^\"]*)\"|'([^']*)'|\\`([^\\`$]*)\\`)\\s*\\}|(\\{[^}]*\\}))`;\n\n/**\n * `\\b` is not enough of a left boundary here: `-` is a non-word character, so\n * `\\bicon` happily matches inside `data-icon=` and `aria-icon=`. Requiring that\n * the previous character be neither a word character nor a hyphen keeps the\n * match to a genuine standalone prop.\n */\nconst LEFT = String.raw`(?<![\\w-])`;\n\nconst nameAttr = () => new RegExp(String.raw`${LEFT}name\\s*=\\s*${VALUE}`);\nconst iconProp = (props: string[]) =>\n new RegExp(String.raw`${LEFT}(${props.join('|')})\\s*=\\s*${VALUE}`, 'g');\n/** Object-literal form: `trigger={{ icon: 'bars' }}`, or a data array of `{ icon: '…' }`. */\nconst iconKey = (props: string[]) =>\n new RegExp(\n String.raw`${LEFT}(${props.join('|')})\\s*:\\s*(?:\"([^\"]*)\"|'([^']*)'|\\`([^\\`$]*)\\`)`,\n 'g',\n );\n\nconst lineOf = (src: string, index: number) => src.slice(0, index).split('\\n').length;\n\n/**\n * Pull the literal out of a VALUE match, or report it as dynamic.\n * Groups run: \"double\", 'single', {\"double\"}, {'single'}, {`template`}, {expr}.\n */\nfunction readValue(groups: (string | undefined)[]): { literal?: string; expr?: string } {\n const [dq, sq, bdq, bsq, btpl, expr] = groups;\n if (expr !== undefined) return { expr };\n const literal = dq ?? sq ?? bdq ?? bsq ?? btpl;\n if (literal === undefined) return {};\n // A template literal with an interpolation is dynamic even inside quotes.\n if (literal.includes('${')) return { expr: literal };\n return { literal };\n}\n\n/** Extract every icon reference from one file's text. */\nexport function extractIconRefs(\n src: string,\n file = '<source>',\n opts?: IconScanOptions,\n): { refs: IconRef[]; dynamic: DynamicIconRef[] } {\n const props = [...new Set([...DEFAULT_PROPS, ...(opts?.props ?? [])])];\n const refs: IconRef[] = [];\n const dynamic: DynamicIconRef[] = [];\n\n // 1. <Icon name=\"…\" /> — the name attribute inside an icon component tag.\n const NAME = nameAttr();\n for (const m of src.matchAll(COMPONENT)) {\n const attrs = m[2] ?? '';\n const hit = NAME.exec(attrs);\n if (!hit) continue;\n const line = lineOf(src, m.index!);\n const { literal, expr } = readValue(hit.slice(1));\n if (literal) refs.push({ name: literal, kind: 'component', attr: 'name', file, line });\n else if (expr) dynamic.push({ expr, attr: 'name', file, line });\n }\n\n // 2. icon= / startIcon= / endIcon= on any tag.\n for (const m of src.matchAll(iconProp(props))) {\n const line = lineOf(src, m.index!);\n const { literal, expr } = readValue(m.slice(2));\n if (literal) refs.push({ name: literal, kind: 'prop', attr: m[1]!, file, line });\n else if (expr) dynamic.push({ expr, attr: m[1]!, file, line });\n }\n\n // 3. `icon: '…'` inside an object literal or data array.\n for (const m of src.matchAll(iconKey(props))) {\n const literal = m[2] ?? m[3] ?? m[4];\n if (!literal || literal.includes('${')) continue;\n refs.push({ name: literal, kind: 'object', attr: m[1]!, file, line: lineOf(src, m.index!) });\n }\n\n // 4. Sprite <use href=\"…#id\">.\n for (const m of src.matchAll(SPRITE_USE)) {\n const id = m[2] ?? m[4];\n if (!id) continue;\n refs.push({ name: id, kind: 'sprite', attr: 'href', file, line: lineOf(src, m.index!) });\n }\n\n return { refs, dynamic };\n}\n\n/** Run `extractIconRefs` across a file set and collect unique names. */\nexport function collectIconRefs(\n files: readonly { path: string; text: string }[],\n opts?: IconScanOptions,\n): IconScanResult {\n const refs: IconRef[] = [];\n const dynamic: DynamicIconRef[] = [];\n for (const f of files) {\n const r = extractIconRefs(f.text, f.path, opts);\n refs.push(...r.refs);\n dynamic.push(...r.dynamic);\n }\n return { refs, dynamic, names: [...new Set(refs.map((r) => r.name))] };\n}\n"],"mappings":";;;;;;AA2EA,SAAgB,QAAuC,MAAkC;CACvF,OAAO,QAAQ,KAAK,SAAS;AAC/B;AAEA,SAAgB,OAAO,MAAyB;CAC9C,OAAO,SAAS,WAAW,QAAQ,WAAW,SAAS,UAAU;AACnE;AAEA,SAAgB,WAAW,MAA6B;CACtD,OAAO,QAAQ,WAAW,QAAQ,UAAU;AAC9C;AAEA,SAAgB,YAAY,MAA8B;CACx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AC;CAC/D;CAGA,KAAK,MAAM,KAAK,IAAI,SAAS,QAAQ,KAAK,CAAC,GAAG;EAC5C,MAAM,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE;EAClC,IAAI,CAAC,WAAW,QAAQ,SAAS,IAAI,GAAG;EACxC,KAAK,KAAK;GAAE,MAAM;GAAS,MAAM;GAAU,MAAM,EAAE;GAAK;GAAM,MAAM,OAAO,KAAK,EAAE,KAAM;EAAE,CAAC;CAC7F;CAGA,KAAK,MAAM,KAAK,IAAI,SAAS,UAAU,GAAG;EACxC,MAAM,KAAK,EAAE,MAAM,EAAE;EACrB,IAAI,CAAC,IAAI;EACT,KAAK,KAAK;GAAE,MAAM;GAAI,MAAM;GAAU,MAAM;GAAQ;GAAM,MAAM,OAAO,KAAK,EAAE,KAAM;EAAE,CAAC;CACzF;CAEA,OAAO;EAAE;EAAM;CAAQ;AACzB;;AAGA,SAAgB,gBACd,OACA,MACgB;CAChB,MAAM,OAAkB,CAAC;CACzB,MAAM,UAA4B,CAAC;CACnC,KAAK,MAAM,KAAK,OAAO;EACrB,MAAM,IAAI,gBAAgB,EAAE,MAAM,EAAE,MAAM,IAAI;EAC9C,KAAK,KAAK,GAAG,EAAE,IAAI;EACnB,QAAQ,KAAK,GAAG,EAAE,OAAO;CAC3B;CACA,OAAO;EAAE;EAAM;EAAS,OAAO,CAAC,GAAG,IAAI,IAAI,KAAK,KAAK,MAAM,EAAE,IAAI,CAAC,CAAC;CAAE;AACvE"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["s"],"sources":["../src/content.ts","../src/html.ts","../src/schema/article.ts","../src/schema/breadcrumb.ts","../src/schema/faq.ts","../src/schema/itemList.ts","../src/schema/localBusiness.ts","../src/schema/organization.ts","../src/icons.ts","../src/scan.ts","../src/icons-scan.ts"],"sourcesContent":["/**\n * Framework-agnostic content-model types, guards, i18n, and part-attr resolution.\n *\n * Extracted from @getvitops/astro so the pure-TS helpers live in one place (no\n * Astro dependency). The Astro-typed element tag was `astro/types`' `HTMLTag`;\n * here it's a plain `string` (any tag name), keeping these fully framework-neutral.\n */\n\n// ── content-model types ──────────────────────────────────────────────────────\n\n/** A translatable value: a plain string, or a locale → string map. */\nexport type Localizable = string | Record<string, string>;\n\n/**\n * An HTML attribute bag. `class` may be a string or a class:list-style array\n * (falsy entries dropped); everything else is passed through to the element.\n */\nexport interface Attrs {\n class?: string | (string | false | null | undefined)[];\n [attr: string]: unknown;\n}\n\n/** An image reference used by image links. */\nexport interface ImageRef {\n src: string;\n alt?: Localizable;\n [key: string]: unknown;\n}\n\n/** A link with a text label. */\nexport interface TextLink {\n label: Localizable;\n href: string;\n attrs?: Attrs;\n [key: string]: unknown;\n}\n\n/** A link whose content is an image. */\nexport interface ImageLink {\n image: ImageRef;\n href: string;\n attrs?: Attrs;\n [key: string]: unknown;\n}\n\n/** Any link — text or image. */\nexport type Link = TextLink | ImageLink;\n\n/**\n * A generic content element wrapper (discriminated by `type: 'element'`),\n * carrying a payload `T` rendered as `Tag` (any HTML tag name).\n */\nexport interface Elmnt<T = unknown, Tag extends string = 'div'> {\n type: 'element';\n tag?: Tag;\n attrs?: Attrs;\n content?: T;\n [key: string]: unknown;\n}\n\n/**\n * A renderable node tree — a text string (Localizable) or an element with\n * optional attrs and either `text` shorthand or `children`.\n */\nexport type ContentNode =\n | string\n | {\n tag: string;\n attrs?: Attrs;\n text?: Localizable;\n children?: ContentNode[];\n };\n\n// ── type guards ──────────────────────────────────────────────────────────────\n\nexport function isElmnt<T, Tag extends string = 'div'>(item: any): item is Elmnt<T, Tag> {\n return item && item.type === 'element';\n}\n\nexport function isLink(item: any): item is Link {\n return item && ('label' in item || 'image' in item) && 'href' in item;\n}\n\nexport function isTextLink(item: any): item is TextLink {\n return item && 'label' in item && 'href' in item;\n}\n\nexport function isImageLink(item: any): item is ImageLink {\n return item && 'image' in item && 'href' in item;\n}\n\n// ── i18n ─────────────────────────────────────────────────────────────────────\n\n/**\n * Resolve a Localizable value to a string for the given locale. A plain string\n * is returned as-is; a locale map returns the best match (locale → default → '').\n */\nexport function t(value: Localizable | undefined, locale: string, defaultLocale: string): string {\n if (value == null) return '';\n if (typeof value === 'string') return value;\n return value[locale] ?? value[defaultLocale] ?? '';\n}\n\n// ── part-attr resolution ─────────────────────────────────────────────────────\n\n/**\n * Resolve per-part attrs from a presentation-type config. For the `root` part,\n * merges legacy `attrs` with `parts.root` (backward compat).\n */\nexport function partAttrs(\n present: { attrs?: Attrs; parts?: Record<string, Attrs> } | undefined,\n part: string,\n): Attrs {\n const fromParts = present?.parts?.[part];\n if (part === 'root') {\n const legacy = present?.attrs;\n if (!legacy && !fromParts) return {};\n const { class: lc, ...lr } = legacy ?? {};\n const { class: pc, ...pr } = fromParts ?? {};\n const classes = [lc, pc].flat().filter((c): c is string => typeof c === 'string' && c !== '');\n return {\n ...(classes.length ? { class: classes } : {}),\n ...lr,\n ...pr,\n };\n }\n return fromParts ?? {};\n}\n","/**\n * Framework-agnostic HTML/markup helpers (parse5-based). Extracted from\n * @getvitops/astro — no Astro runtime dependency; the Astro-typed `HTMLTag` /\n * `HTMLAttributes` are generalized to `string` / `Record<string, unknown>`.\n */\nimport { parseFragment, serialize as s, type DefaultTreeAdapterTypes } from 'parse5';\nimport type { Localizable, ContentNode } from './content.ts';\n\nexport type ChildNode = DefaultTreeAdapterTypes.ChildNode;\n\nexport function parseRenderedSlots(html: string): ChildNode[] {\n return parseFragment(html).childNodes;\n}\n\nexport function getAttribute(node: ChildNode, attrName: string): string | null {\n if ('attrs' in node) {\n const attr = node.attrs.find((a) => a.name === attrName);\n return attr ? attr.value : null;\n }\n return null;\n}\n\nexport function serialize(nodes: ChildNode | ChildNode[]): string[] {\n return (Array.isArray(nodes) ? nodes : [nodes]).map((node) =>\n s(node as DefaultTreeAdapterTypes.ParentNode),\n );\n}\n\n/** Style value types that can be combined (camelCase or --custom-prop keys). */\ntype StyleObject = Record<string, string | number | null | undefined>;\nexport type StyleValue = string | StyleObject | null | undefined;\nexport type StyleList = StyleValue | StyleValue[];\n\n/** camelCase → kebab-case, preserving CSS custom properties (`--var-name`). */\nfunction toKebabCase(str: string): string {\n if (str.startsWith('--')) return str;\n return str.replace(/([A-Z])/g, '-$1').toLowerCase();\n}\nfunction styleObjectToString(obj: StyleObject): string {\n return Object.entries(obj)\n .filter(([, value]) => value != null)\n .map(([key, value]) => `${toKebabCase(key)}: ${value}`)\n .join('; ');\n}\n\n/** Combine multiple style formats into one CSS string (like `class:list` for styles). */\nexport function styleList(...styles: StyleList[]): string {\n const result: string[] = [];\n const process = (item: StyleList): void => {\n if (item == null) return;\n if (Array.isArray(item)) {\n item.forEach(process);\n } else if (typeof item === 'string') {\n const trimmed = item.trim();\n if (trimmed) result.push(trimmed);\n } else {\n const str = styleObjectToString(item as StyleObject);\n if (str) result.push(str);\n }\n };\n styles.forEach(process);\n return result.join('; ');\n}\n\n/** Element descriptor: a tag name, text content, and optional attributes. */\nexport interface El<Tag extends string = string> {\n text: string;\n tag: Tag;\n attributes?: Record<string, unknown>;\n}\n\nfunction isEl(value: string | El): value is El {\n return typeof value === 'object' && value !== null && 'tag' in value && 'text' in value;\n}\n\nfunction attributesToString(attrs: Record<string, unknown>): string {\n const parts: string[] = [];\n for (const [key, value] of Object.entries(attrs)) {\n if (value == null || value === false) continue;\n if (value === true) {\n parts.push(key);\n } else if (key === 'style' && typeof value === 'object') {\n parts.push(`style=\"${styleList(value as StyleValue)}\"`);\n } else {\n const text = Array.isArray(value)\n ? value.filter((v): v is string => typeof v === 'string' && v !== '').join(' ')\n : typeof value === 'object'\n ? JSON.stringify(value)\n : String(value as string | number | boolean);\n parts.push(`${key}=\"${text.replace(/\"/g, '"')}\"`);\n }\n }\n return parts.join(' ');\n}\n\n/** Normalize a string or `El` object into an HTML string (for `set:html`). */\nexport function toHtml<Tag extends string>(content: string | El<Tag>): string {\n if (!isEl(content)) return content;\n const { tag, text, attributes } = content;\n const attrStr = attributes ? attributesToString(attributes) : '';\n const t = String(tag);\n return attrStr ? `<${t} ${attrStr}>${text}</${t}>` : `<${t}>${text}</${t}>`;\n}\n\n// ── node-tree renderer — { tag, attrs, children } ────────────────────────────\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\nfunction defaultResolveText(value: Localizable): string {\n if (typeof value === 'string') return value;\n const values = Object.values(value);\n return values[0] ?? '';\n}\n\nfunction escapeHtml(text: string): string {\n return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n}\n\nfunction nodeToHtml(node: ContentNode, resolveText: (value: Localizable) => string): string {\n if (typeof node === 'string') return escapeHtml(resolveText(node));\n const { tag, attrs, text, children } = node;\n const attrStr = attrs ? attributesToString(attrs) : '';\n const open = attrStr ? `<${tag} ${attrStr}>` : `<${tag}>`;\n if (VOID_ELEMENTS.has(tag)) return open;\n let inner = '';\n if (text != null) inner = escapeHtml(resolveText(text));\n else if (children?.length)\n inner = children.map((child) => nodeToHtml(child, resolveText)).join('');\n return `${open}${inner}</${tag}>`;\n}\n\n/** Render an array of `ContentNode`s to an HTML string. */\nexport function nodesToHtml(\n nodes: ContentNode[],\n resolveText: (value: Localizable) => string = defaultResolveText,\n): string {\n return nodes.map((node) => nodeToHtml(node, resolveText)).join('');\n}\n","export interface ArticleAuthor {\n name: string;\n url?: string;\n}\n\nexport interface ArticleGraphOptions {\n headline: string;\n description?: string;\n image?: string | string[];\n datePublished: string;\n dateModified?: string;\n author: ArticleAuthor | ArticleAuthor[];\n publisher?: {\n name: string;\n logo?: string;\n };\n mainEntityOfPage?: string;\n articleSection?: string;\n wordCount?: number;\n keywords?: string[];\n}\n\n/** Build a schema.org Article JSON-LD graph. */\nexport function articleGraph(options: ArticleGraphOptions): Record<string, unknown> {\n const {\n headline,\n description,\n image,\n datePublished,\n dateModified,\n author,\n publisher,\n mainEntityOfPage,\n articleSection,\n wordCount,\n keywords,\n } = options;\n\n const authors = Array.isArray(author) ? author : [author];\n\n return {\n '@context': 'https://schema.org',\n '@type': 'Article',\n headline,\n ...(description && { description }),\n ...(image && { image: Array.isArray(image) ? image : [image] }),\n datePublished,\n ...(dateModified && { dateModified }),\n author: authors.map((a) => ({\n '@type': 'Person',\n name: a.name,\n ...(a.url && { url: a.url }),\n })),\n ...(publisher && {\n publisher: {\n '@type': 'Organization',\n name: publisher.name,\n ...(publisher.logo && { logo: { '@type': 'ImageObject', url: publisher.logo } }),\n },\n }),\n ...(mainEntityOfPage && { mainEntityOfPage: { '@type': 'WebPage', '@id': mainEntityOfPage } }),\n ...(articleSection && { articleSection }),\n ...(wordCount && { wordCount }),\n ...(keywords && { keywords: keywords.join(', ') }),\n };\n}\n","export interface BreadcrumbItem {\n name: string;\n url: string;\n}\n\nexport interface BreadcrumbGraphOptions {\n items: BreadcrumbItem[];\n}\n\n/** Build a schema.org BreadcrumbList JSON-LD graph. */\nexport function breadcrumbGraph(options: BreadcrumbGraphOptions): Record<string, unknown> {\n return {\n '@context': 'https://schema.org',\n '@type': 'BreadcrumbList',\n itemListElement: options.items.map((item, index) => ({\n '@type': 'ListItem',\n position: index + 1,\n name: item.name,\n item: item.url,\n })),\n };\n}\n","export interface FAQItem {\n question: string;\n answer: string;\n}\n\nexport interface FAQGraphOptions {\n items: FAQItem[];\n}\n\n/**\n * Build a schema.org FAQPage JSON-LD graph.\n *\n * NOTE: Google recommends FAQ markup only for authoritative government\n * and health sites. For other sites, consider using QAPage schema instead.\n */\nexport function faqGraph(options: FAQGraphOptions): Record<string, unknown> {\n return {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n mainEntity: options.items.map((item) => ({\n '@type': 'Question',\n name: item.question,\n acceptedAnswer: {\n '@type': 'Answer',\n text: item.answer,\n },\n })),\n };\n}\n","export type ItemListEntryType =\n | 'Article'\n | 'Recipe'\n | 'Movie'\n | 'Course'\n | 'Restaurant'\n | 'Product'\n // Anything else is still valid ItemList markup, just not a Google\n // carousel rich-result candidate — those six are the full supported set.\n | (string & {});\n\nexport interface ItemListEntry {\n type: ItemListEntryType;\n name: string;\n /**\n * Summary-page format: the item's own detail page (unique, same domain).\n * All-in-one-page format: this page's URL plus an HTML anchor pointing at\n * the item on it.\n */\n url: string;\n image?: string;\n description?: string;\n}\n\nexport interface ItemListGraphOptions {\n items: ItemListEntry[];\n /** Recommended, not required by the spec — names the list itself. */\n name?: string;\n}\n\n/** Build a schema.org ItemList JSON-LD graph (e.g. for a carousel rich result). */\nexport function itemListGraph(options: ItemListGraphOptions): Record<string, unknown> {\n const { items, name } = options;\n\n return {\n '@context': 'https://schema.org',\n '@type': 'ItemList',\n ...(name && { name }),\n itemListElement: items.map((item, index) => ({\n '@type': 'ListItem',\n position: index + 1,\n item: {\n '@type': item.type,\n name: item.name,\n url: item.url,\n ...(item.image && { image: item.image }),\n ...(item.description && { description: item.description }),\n },\n })),\n };\n}\n","export interface OpeningHoursSpecification {\n dayOfWeek: ('Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday')[];\n opens: string;\n closes: string;\n}\n\n/**\n * A dated deviation from the recurring `openingHoursSpecification` — holiday\n * hours, a one-off closure, a temporary schedule. Same schema.org shape\n * (`OpeningHoursSpecification`), distinguished by carrying `validFrom`. A full\n * closure omits `opens`/`closes` rather than encoding it as an open interval.\n */\nexport interface SpecialHoursSpecification {\n validFrom: string;\n validThrough?: string;\n opens?: string;\n closes?: string;\n}\n\nexport interface LocalBusinessGraphOptions {\n /** schema.org `LocalBusiness` subtype, e.g. `'Restaurant'`, `'ProfessionalService'`. Defaults to `'LocalBusiness'`. */\n type?: string;\n name: string;\n description?: string;\n url?: string;\n telephone?: string;\n email?: string;\n image?: string | string[];\n priceRange?: string;\n address?: {\n streetAddress?: string;\n addressLocality?: string;\n addressRegion?: string;\n postalCode?: string;\n addressCountry?: string;\n };\n geo?: {\n latitude: number;\n longitude: number;\n };\n openingHoursSpecification?: OpeningHoursSpecification[];\n specialOpeningHoursSpecification?: SpecialHoursSpecification[];\n aggregateRating?: {\n ratingValue: number;\n reviewCount?: number;\n ratingCount?: number;\n bestRating?: number;\n worstRating?: number;\n };\n review?: {\n author: string;\n datePublished: string;\n reviewBody: string;\n reviewRating?: {\n ratingValue: number;\n bestRating?: number;\n worstRating?: number;\n };\n }[];\n paymentAccepted?: string[];\n currenciesAccepted?: string;\n areaServed?: string[];\n sameAs?: string[];\n knowsLanguage?: string[];\n}\n\n/** Build a schema.org LocalBusiness (or subtype) JSON-LD graph. */\nexport function localBusinessGraph(options: LocalBusinessGraphOptions): Record<string, unknown> {\n const {\n type = 'LocalBusiness',\n name,\n description,\n url,\n telephone,\n email,\n image,\n priceRange,\n address,\n geo,\n openingHoursSpecification,\n specialOpeningHoursSpecification,\n aggregateRating,\n review,\n paymentAccepted,\n currenciesAccepted,\n areaServed,\n sameAs,\n knowsLanguage,\n } = options;\n\n const hours = [\n ...(openingHoursSpecification ?? []).map((spec) => ({\n '@type': 'OpeningHoursSpecification',\n dayOfWeek: spec.dayOfWeek,\n opens: spec.opens,\n closes: spec.closes,\n })),\n ...(specialOpeningHoursSpecification ?? []).map((spec) => ({\n '@type': 'OpeningHoursSpecification',\n validFrom: spec.validFrom,\n ...(spec.validThrough && { validThrough: spec.validThrough }),\n ...(spec.opens && { opens: spec.opens }),\n ...(spec.closes && { closes: spec.closes }),\n })),\n ];\n\n return {\n '@context': 'https://schema.org',\n '@type': type,\n name,\n ...(description && { description }),\n ...(url && { url }),\n ...(telephone && { telephone }),\n ...(email && { email }),\n ...(image && { image: Array.isArray(image) ? image : [image] }),\n ...(priceRange && { priceRange }),\n ...(address && {\n address: {\n '@type': 'PostalAddress',\n ...(address.streetAddress && { streetAddress: address.streetAddress }),\n ...(address.addressLocality && { addressLocality: address.addressLocality }),\n ...(address.addressRegion && { addressRegion: address.addressRegion }),\n ...(address.postalCode && { postalCode: address.postalCode }),\n ...(address.addressCountry && { addressCountry: address.addressCountry }),\n },\n }),\n ...(geo && {\n geo: {\n '@type': 'GeoCoordinates',\n latitude: geo.latitude,\n longitude: geo.longitude,\n },\n }),\n ...(hours.length > 0 && { openingHoursSpecification: hours }),\n ...(aggregateRating && {\n aggregateRating: {\n '@type': 'AggregateRating',\n ratingValue: aggregateRating.ratingValue,\n ...(aggregateRating.reviewCount && { reviewCount: aggregateRating.reviewCount }),\n ...(aggregateRating.ratingCount && { ratingCount: aggregateRating.ratingCount }),\n bestRating: aggregateRating.bestRating ?? 5,\n worstRating: aggregateRating.worstRating ?? 1,\n },\n }),\n ...(review && {\n review: review.map((r) => ({\n '@type': 'Review',\n author: { '@type': 'Person', name: r.author },\n datePublished: r.datePublished,\n reviewBody: r.reviewBody,\n ...(r.reviewRating && {\n reviewRating: {\n '@type': 'Rating',\n ratingValue: r.reviewRating.ratingValue,\n bestRating: r.reviewRating.bestRating ?? 5,\n worstRating: r.reviewRating.worstRating ?? 1,\n },\n }),\n })),\n }),\n ...(paymentAccepted && { paymentAccepted }),\n ...(currenciesAccepted && { currenciesAccepted }),\n ...(areaServed && { areaServed }),\n ...(sameAs && { sameAs }),\n ...(knowsLanguage && { knowsLanguage }),\n };\n}\n","export interface OrganizationGraphOptions {\n name: string;\n url?: string;\n logo?: string;\n description?: string;\n email?: string;\n telephone?: string;\n address?: {\n streetAddress?: string;\n addressLocality?: string;\n addressRegion?: string;\n postalCode?: string;\n addressCountry?: string;\n };\n sameAs?: string[];\n foundingDate?: string;\n founders?: string[];\n numberOfEmployees?: number | { minValue: number; maxValue: number };\n parentOrganization?: {\n name: string;\n url?: string;\n };\n subOrganization?: {\n name: string;\n url?: string;\n }[];\n contactPoint?: {\n type?: 'customer service' | 'technical support' | 'sales' | 'billing support' | 'reservations';\n telephone: string;\n email?: string;\n contactType: string;\n availableLanguage?: string[];\n areaServed?: string[];\n }[];\n areaServed?: string[];\n brand?: string;\n award?: string[];\n memberOf?: {\n name: string;\n url?: string;\n }[];\n}\n\n/** Build a schema.org Organization JSON-LD graph. */\nexport function organizationGraph(options: OrganizationGraphOptions): Record<string, unknown> {\n const {\n name,\n url,\n logo,\n description,\n email,\n telephone,\n address,\n sameAs,\n foundingDate,\n founders,\n numberOfEmployees,\n parentOrganization,\n subOrganization,\n contactPoint,\n areaServed,\n brand,\n award,\n memberOf,\n } = options;\n\n return {\n '@context': 'https://schema.org',\n '@type': 'Organization',\n name,\n ...(url && { url }),\n ...(logo && { logo }),\n ...(description && { description }),\n ...(email && { email }),\n ...(telephone && { telephone }),\n ...(address && {\n address: {\n '@type': 'PostalAddress',\n ...(address.streetAddress && { streetAddress: address.streetAddress }),\n ...(address.addressLocality && { addressLocality: address.addressLocality }),\n ...(address.addressRegion && { addressRegion: address.addressRegion }),\n ...(address.postalCode && { postalCode: address.postalCode }),\n ...(address.addressCountry && { addressCountry: address.addressCountry }),\n },\n }),\n ...(sameAs && { sameAs }),\n ...(foundingDate && { foundingDate }),\n ...(founders && {\n founders: founders.map((f) => ({\n '@type': 'Person',\n name: f,\n })),\n }),\n ...(numberOfEmployees && {\n numberOfEmployees:\n typeof numberOfEmployees === 'number'\n ? { '@type': 'QuantitativeValue', value: numberOfEmployees }\n : {\n '@type': 'QuantitativeValue',\n minValue: numberOfEmployees.minValue,\n maxValue: numberOfEmployees.maxValue,\n },\n }),\n ...(parentOrganization && {\n parentOrganization: {\n '@type': 'Organization',\n name: parentOrganization.name,\n ...(parentOrganization.url && { url: parentOrganization.url }),\n },\n }),\n ...(subOrganization && {\n subOrganization: subOrganization.map((sub) => ({\n '@type': 'Organization',\n name: sub.name,\n ...(sub.url && { url: sub.url }),\n })),\n }),\n ...(contactPoint && {\n contactPoint: contactPoint.map((cp) => ({\n '@type': 'ContactPoint',\n telephone: cp.telephone,\n contactType: cp.contactType,\n ...(cp.email && { email: cp.email }),\n ...(cp.availableLanguage && { availableLanguage: cp.availableLanguage }),\n ...(cp.areaServed && { areaServed: cp.areaServed }),\n })),\n }),\n ...(areaServed && { areaServed }),\n ...(brand && { brand: { '@type': 'Brand', name: brand } }),\n ...(award && { award }),\n ...(memberOf && {\n memberOf: memberOf.map((m) => ({\n '@type': 'Organization',\n name: m.name,\n ...(m.url && { url: m.url }),\n })),\n }),\n };\n}\n","/**\n * Semantic icon name mapping across icon sets.\n *\n * Keys are functional/semantic names (what the icon means).\n * Values are the actual icon names in each set.\n *\n * Two consumers:\n * - `generateIconInclude()` (below) — build time. Turns the semantic names a project\n * declares into the `include` map astro-icon needs, so the icon set can be swapped\n * without touching call sites.\n * - `<wc-icon-picker>` (@getvitops/core) — browser. Its `semantic` mode lists these\n * keys so an icon can be chosen by meaning rather than by set-specific name.\n *\n * `resolveIcon`/`resolveBrandIcon` map one semantic name to a fully-qualified\n * `prefix:name` string for a given set.\n */\n\n/**\n * Maps astro-icon prefixes to iconMap lookup keys.\n * FA7 variants (fa7-solid, fa7-regular, etc.) all share the same icon names\n * and map to the 'fa7' key. Other sets map to themselves.\n */\nexport const prefixToMapKey: Record<string, string> = {\n 'fa7-solid': 'fa7',\n 'fa7-regular': 'fa7',\n 'fa7-light': 'fa7',\n 'fa7-thin': 'fa7',\n 'fa7-brands': 'fa7-brands',\n 'simple-icons': 'simple-icons',\n 'material-symbols': 'material-symbols',\n lucide: 'lucide',\n ph: 'ph',\n};\n\n/**\n * Sets whose weights are a name SUFFIX inside one collection rather than\n * separate prefixed collections. Phosphor is the case that forced this:\n * `ph:lightning`, `ph:lightning-bold`, `ph:lightning-fill` all live in `ph`,\n * whereas Font Awesome splits the same idea across `fa7-solid`/`fa7-regular`/…\n * (which is what `prefixToMapKey` collapses).\n *\n * The first entry is the unsuffixed default — asking for it adds nothing.\n */\nexport const WEIGHTED_SETS: Record<string, readonly string[]> = {\n ph: ['regular', 'bold', 'duotone', 'fill', 'light', 'thin'],\n};\n\nexport const iconMap = {\n fa7: {\n // Navigation / UI\n menu: 'bars',\n close: 'xmark',\n home: 'home',\n settings: 'gear',\n search: 'magnifying-glass',\n 'chevron-left': 'chevron-left',\n 'chevron-right': 'chevron-right',\n 'chevron-up': 'chevron-up',\n 'chevron-down': 'chevron-down',\n 'arrow-left': 'arrow-left',\n 'arrow-right': 'arrow-right',\n 'arrow-up': 'arrow-up',\n 'arrow-down': 'arrow-down',\n 'external-link': 'arrow-up-right-from-square',\n 'more-vert': 'ellipsis-vertical',\n 'more-horiz': 'ellipsis',\n\n // Actions\n add: 'plus',\n remove: 'minus',\n delete: 'trash',\n edit: 'pen',\n save: 'floppy-disk',\n copy: 'copy',\n paste: 'paste',\n attach: 'paperclip',\n upload: 'upload',\n download: 'download',\n share: 'share',\n bookmark: 'bookmark',\n favorite: 'heart',\n star: 'star',\n login: 'right-to-bracket',\n logout: 'right-from-bracket',\n\n // Communication\n email: 'envelope',\n phone: 'phone',\n location: 'location-dot',\n globe: 'globe',\n link: 'link',\n\n // Time\n clock: 'clock',\n calendar: 'calendar',\n schedule: 'calendar-days',\n\n // People\n person: 'user',\n group: 'users',\n\n // Content / Files\n file: 'file',\n 'file-add': 'file-circle-plus',\n folder: 'folder',\n 'folder-open': 'folder-open',\n 'folder-add': 'folder-plus',\n image: 'image',\n export: 'file-export',\n import: 'file-import',\n backup: 'cloud-arrow-up',\n compress: 'compress',\n\n // Status / Feedback\n check: 'check',\n error: 'circle-exclamation',\n warning: 'triangle-exclamation',\n info: 'circle-info',\n help: 'circle-question',\n\n // Commerce\n cart: 'cart-shopping',\n tag: 'tag',\n 'credit-card': 'credit-card',\n receipt: 'receipt',\n\n // Nature (landscaping context)\n leaf: 'leaf',\n tree: 'tree',\n seedling: 'seedling',\n trowel: 'trowel',\n droplet: 'droplet',\n snowflake: 'snowflake',\n sun: 'sun',\n cloud: 'cloud',\n\n // Layout / View\n grid: 'table-cells',\n list: 'list',\n filter: 'filter',\n sort: 'sort',\n fullscreen: 'expand',\n collapse: 'compress',\n\n // Misc\n building: 'building',\n video: 'video',\n lock: 'lock',\n unlock: 'lock-open',\n eye: 'eye',\n 'eye-off': 'eye-slash',\n print: 'print',\n code: 'code',\n palette: 'palette',\n lightbulb: 'lightbulb',\n lightning: 'bolt',\n },\n\n 'fa7-brands': {\n // Social Media\n facebook: 'facebook',\n instagram: 'instagram',\n x: 'x-twitter',\n bluesky: 'bluesky',\n threads: 'threads',\n mastodon: 'mastodon',\n linkedin: 'linkedin',\n youtube: 'youtube',\n tiktok: 'tiktok',\n pinterest: 'pinterest-p',\n reddit: 'reddit',\n snapchat: 'snapchat',\n github: 'github',\n\n // Messaging\n whatsapp: 'whatsapp',\n telegram: 'telegram',\n discord: 'discord',\n\n // Payment\n stripe: 'stripe',\n paypal: 'paypal',\n visa: 'cc-visa',\n mastercard: 'cc-mastercard',\n amex: 'cc-amex',\n discover: 'cc-discover',\n 'apple-pay': 'apple-pay',\n 'google-pay': 'google-pay',\n 'amazon-pay': 'amazon-pay',\n\n // Review / Directory\n yelp: 'yelp',\n google: 'google',\n\n // Platforms\n apple: 'apple',\n microsoft: 'microsoft',\n amazon: 'amazon',\n shopify: 'shopify',\n wordpress: 'wordpress',\n cloudflare: 'cloudflare',\n },\n\n 'simple-icons': {\n // Social Media\n facebook: 'facebook',\n instagram: 'instagram',\n x: 'x',\n bluesky: 'bluesky',\n threads: 'threads',\n mastodon: 'mastodon',\n linkedin: 'linkedin',\n youtube: 'youtube',\n tiktok: 'tiktok',\n pinterest: 'pinterest',\n reddit: 'reddit',\n snapchat: 'snapchat',\n github: 'github',\n\n // Messaging\n whatsapp: 'whatsapp',\n telegram: 'telegram',\n discord: 'discord',\n\n // Payment\n stripe: 'stripe',\n paypal: 'paypal',\n visa: 'visa',\n mastercard: 'mastercard',\n amex: 'americanexpress',\n discover: 'discover',\n 'apple-pay': 'applepay',\n 'google-pay': 'googlepay',\n 'amazon-pay': 'amazonpay',\n klarna: 'klarna',\n afterpay: 'afterpay',\n square: 'square',\n cashapp: 'cashapp',\n interac: 'interac',\n\n // Review / Directory\n yelp: 'yelp',\n google: 'google',\n tripadvisor: 'tripadvisor',\n trustpilot: 'trustpilot',\n 'google-maps': 'googlemaps',\n homeadvisor: 'homeadvisor',\n houzz: 'houzz',\n nextdoor: 'nextdoor',\n bbb: 'bbb',\n\n // Platforms\n apple: 'apple',\n microsoft: 'microsoft',\n amazon: 'amazon',\n shopify: 'shopify',\n wordpress: 'wordpress',\n cloudflare: 'cloudflare',\n waze: 'waze',\n },\n\n 'material-symbols': {\n // Navigation / UI\n menu: 'menu',\n close: 'close',\n home: 'home',\n settings: 'settings',\n search: 'search',\n 'chevron-left': 'chevron-left',\n 'chevron-right': 'chevron-right',\n // Material Symbols' chevrons are only named `chevron-*` on the horizontal\n // axis; the vertical pair is `expand-more`/`expand-less`, same glyph.\n 'chevron-up': 'expand-less',\n 'chevron-down': 'expand-more',\n 'arrow-left': 'arrow-back',\n 'arrow-right': 'arrow-forward',\n 'arrow-up': 'arrow-upward',\n 'arrow-down': 'arrow-downward',\n 'external-link': 'open-in-new',\n 'more-vert': 'more-vert',\n 'more-horiz': 'more-horiz',\n\n // Actions\n add: 'add',\n remove: 'remove',\n delete: 'delete',\n edit: 'edit',\n save: 'save',\n copy: 'content-copy',\n paste: 'content-paste',\n attach: 'attach-file',\n upload: 'upload',\n download: 'download',\n share: 'share',\n bookmark: 'bookmark',\n favorite: 'favorite',\n star: 'star',\n login: 'login',\n logout: 'logout',\n\n // Communication\n email: 'mail',\n phone: 'call',\n location: 'location-on',\n globe: 'language',\n link: 'link',\n\n // Time\n clock: 'schedule',\n calendar: 'calendar-today',\n schedule: 'calendar-month',\n\n // People\n person: 'person',\n group: 'group',\n\n // Content / Files\n file: 'description',\n 'file-add': 'note-add',\n folder: 'folder',\n 'folder-open': 'folder-open',\n 'folder-add': 'create-new-folder',\n image: 'image',\n export: 'upload-file',\n import: 'download',\n backup: 'backup',\n compress: 'compress',\n\n // Status / Feedback\n check: 'check-circle',\n error: 'error',\n warning: 'warning',\n info: 'info',\n help: 'help',\n\n // Commerce\n cart: 'shopping-cart',\n tag: 'sell',\n 'credit-card': 'credit-card',\n receipt: 'receipt-long',\n\n // Nature (landscaping context)\n leaf: 'eco',\n tree: 'forest',\n seedling: 'potted-plant',\n trowel: 'construction',\n droplet: 'water-drop',\n snowflake: 'ac-unit',\n sun: 'light-mode',\n cloud: 'cloud',\n\n // Layout / View\n grid: 'grid-view',\n list: 'list',\n filter: 'filter-list',\n sort: 'sort',\n fullscreen: 'fullscreen',\n collapse: 'fullscreen-exit',\n\n // Misc\n building: 'domain',\n video: 'videocam',\n lock: 'lock',\n unlock: 'lock-open',\n eye: 'visibility',\n 'eye-off': 'visibility-off',\n print: 'print',\n code: 'code',\n palette: 'palette',\n lightbulb: 'lightbulb',\n lightning: 'bolt',\n },\n lucide: {\n // Navigation / UI\n menu: 'menu',\n close: 'x',\n home: 'house',\n settings: 'settings',\n search: 'search',\n 'chevron-left': 'chevron-left',\n 'chevron-right': 'chevron-right',\n 'chevron-up': 'chevron-up',\n 'chevron-down': 'chevron-down',\n 'arrow-left': 'arrow-left',\n 'arrow-right': 'arrow-right',\n 'arrow-up': 'arrow-up',\n 'arrow-down': 'arrow-down',\n 'external-link': 'external-link',\n 'more-vert': 'ellipsis-vertical',\n 'more-horiz': 'ellipsis',\n\n // Actions\n add: 'plus',\n remove: 'minus',\n delete: 'trash-2',\n edit: 'pencil',\n save: 'save',\n copy: 'copy',\n paste: 'clipboard-paste',\n attach: 'paperclip',\n upload: 'upload',\n download: 'download',\n share: 'share-2',\n bookmark: 'bookmark',\n favorite: 'heart',\n star: 'star',\n login: 'log-in',\n logout: 'log-out',\n\n // Communication\n email: 'mail',\n phone: 'phone',\n location: 'map-pin',\n globe: 'globe',\n link: 'link',\n\n // Time\n clock: 'clock',\n calendar: 'calendar',\n schedule: 'calendar-days',\n\n // People\n person: 'user',\n group: 'users',\n\n // Content / Files\n file: 'file',\n 'file-add': 'file-plus',\n folder: 'folder',\n 'folder-open': 'folder-open',\n 'folder-add': 'folder-plus',\n image: 'image',\n export: 'file-output',\n import: 'file-input',\n backup: 'hard-drive-upload',\n compress: 'minimize-2',\n\n // Status / Feedback\n check: 'check-circle',\n error: 'circle-alert',\n warning: 'triangle-alert',\n info: 'info',\n help: 'circle-help',\n\n // Commerce\n cart: 'shopping-cart',\n tag: 'tag',\n 'credit-card': 'credit-card',\n receipt: 'receipt',\n\n // Nature (landscaping context)\n leaf: 'leaf',\n tree: 'tree-pine',\n seedling: 'sprout',\n trowel: 'shovel',\n droplet: 'droplet',\n snowflake: 'snowflake',\n sun: 'sun',\n cloud: 'cloud',\n\n // Layout / View\n grid: 'layout-grid',\n list: 'list',\n filter: 'filter',\n sort: 'arrow-up-down',\n fullscreen: 'maximize',\n collapse: 'minimize',\n\n // Misc\n building: 'building-2',\n video: 'video',\n lock: 'lock',\n unlock: 'lock-open',\n eye: 'eye',\n 'eye-off': 'eye-off',\n print: 'printer',\n code: 'code',\n palette: 'palette',\n lightbulb: 'lightbulb',\n lightning: 'zap',\n },\n // Phosphor. Unlike fa7, the weights are NOT separate collections — `ph` is one\n // collection and the weight is a name SUFFIX (`lightning`, `lightning-bold`,\n // `lightning-fill`, …), which is why `prefixToMapKey` maps `ph` to itself with\n // nothing to collapse. See WEIGHTED_SETS / resolveIcon's `weight` option.\n ph: {\n // Navigation / UI\n menu: 'list',\n close: 'x',\n home: 'house',\n settings: 'gear',\n search: 'magnifying-glass',\n // Phosphor's chevron is the `caret` family; `ph:chevron-*` doesn't exist.\n 'chevron-left': 'caret-left',\n 'chevron-right': 'caret-right',\n 'chevron-up': 'caret-up',\n 'chevron-down': 'caret-down',\n 'arrow-left': 'arrow-left',\n 'arrow-right': 'arrow-right',\n 'arrow-up': 'arrow-up',\n 'arrow-down': 'arrow-down',\n 'external-link': 'arrow-square-out',\n 'more-vert': 'dots-three-vertical',\n 'more-horiz': 'dots-three',\n // Actions\n add: 'plus',\n remove: 'minus',\n delete: 'trash',\n edit: 'pencil',\n save: 'floppy-disk',\n copy: 'copy',\n paste: 'clipboard',\n attach: 'paperclip',\n upload: 'upload',\n download: 'download',\n share: 'share',\n bookmark: 'bookmark',\n favorite: 'heart',\n star: 'star',\n login: 'sign-in',\n logout: 'sign-out',\n // Communication\n email: 'envelope',\n phone: 'phone',\n location: 'map-pin',\n globe: 'globe',\n link: 'link',\n // Time\n clock: 'clock',\n calendar: 'calendar',\n schedule: 'calendar-dots',\n // People\n person: 'person',\n group: 'users',\n // Content / files\n file: 'file',\n 'file-add': 'file-plus',\n folder: 'folder',\n 'folder-open': 'folder-open',\n 'folder-add': 'folder-plus',\n image: 'image',\n export: 'upload-simple',\n import: 'download-simple',\n backup: 'cloud-arrow-up',\n compress: 'arrows-in',\n // Status / feedback\n check: 'check',\n error: 'warning-circle',\n warning: 'warning',\n info: 'info',\n help: 'question',\n // Commerce\n cart: 'shopping-cart',\n tag: 'tag',\n 'credit-card': 'credit-card',\n receipt: 'receipt',\n // Nature (landscaping)\n leaf: 'leaf',\n tree: 'tree',\n seedling: 'plant',\n trowel: 'shovel',\n droplet: 'drop',\n snowflake: 'snowflake',\n sun: 'sun',\n cloud: 'cloud',\n // Layout / view\n grid: 'squares-four',\n list: 'list',\n filter: 'funnel',\n sort: 'arrows-down-up',\n fullscreen: 'corners-out',\n collapse: 'corners-in',\n // Misc\n building: 'building',\n video: 'video',\n lock: 'lock',\n unlock: 'lock-open',\n eye: 'eye',\n 'eye-off': 'eye-slash',\n print: 'printer',\n code: 'code',\n palette: 'palette',\n lightbulb: 'lightbulb',\n lightning: 'lightning',\n },\n} as const satisfies Record<string, Record<string, string>>;\n\nexport type IconSet = keyof typeof iconMap;\nexport type SemanticIcon = keyof (typeof iconMap)['fa7'];\nexport type BrandIcon = keyof (typeof iconMap)['simple-icons'];\n\n/**\n * Resolve a semantic icon name to a fully-qualified astro-icon string.\n * Names containing ':' are returned as-is (pass-through for fully-qualified names).\n *\n * @param name - Semantic name ('email') or fully-qualified ('fa7-solid:envelope')\n * @param prefix - astro-icon prefix, e.g. 'fa7-solid', 'material-symbols', 'lucide', 'ph'\n * @param opts.weight - Weight for suffix-weighted sets (see `WEIGHTED_SETS`), e.g.\n * `resolveIcon('menu', 'ph', { weight: 'bold' })` → `'ph:list-bold'`. Ignored for\n * sets that aren't suffix-weighted; an unknown weight throws rather than silently\n * resolving to the regular glyph, which would be indistinguishable from a typo.\n */\nexport function resolveIcon(name: string, prefix: string, opts?: { weight?: string }): string {\n if (name.includes(':')) return name;\n const mapKey = prefixToMapKey[prefix] as IconSet | undefined;\n if (!mapKey)\n throw new Error(\n `Unknown icon prefix \"${prefix}\". Valid: ${Object.keys(prefixToMapKey).join(', ')}`,\n );\n const map = iconMap[mapKey];\n const resolved = map[name as keyof typeof map];\n if (!resolved)\n throw new Error(`Icon \"${name}\" not found in set \"${prefix}\" (map key: \"${mapKey}\")`);\n return `${prefix}:${applyWeight(resolved, prefix, opts?.weight)}`;\n}\n\n/** Append a weight suffix for suffix-weighted sets. The first weight is the bare default. */\nfunction applyWeight(name: string, prefix: string, weight?: string): string {\n if (!weight) return name;\n const weights = WEIGHTED_SETS[prefix];\n if (!weights) return name;\n if (!weights.includes(weight))\n throw new Error(\n `Unknown weight \"${weight}\" for icon set \"${prefix}\". Valid: ${weights.join(', ')}.`,\n );\n return weight === weights[0] ? name : `${name}-${weight}`;\n}\n\n/**\n * Resolve a brand icon name to a fully-qualified astro-icon string.\n * Names containing ':' are returned as-is (pass-through).\n *\n * @param name - Semantic brand name ('facebook') or fully-qualified ('simple-icons:facebook')\n * @param prefix - astro-icon prefix, e.g. 'simple-icons', 'fa7-brands'\n */\nexport function resolveBrandIcon(name: string, prefix: string): string {\n if (name.includes(':')) return name;\n const mapKey = prefixToMapKey[prefix] as IconSet | undefined;\n if (!mapKey) throw new Error(`Unknown brand icon prefix \"${prefix}\"`);\n const map = iconMap[mapKey];\n const resolved = map[name as keyof typeof map];\n if (!resolved)\n throw new Error(`Brand icon \"${name}\" not found in set \"${prefix}\" (map key: \"${mapKey}\")`);\n return `${prefix}:${resolved}`;\n}\n\n/**\n * Generate the astro-icon `include` map from configured icon sets.\n *\n * Resolves two kinds of entries from the `icons` section of `site.config.yaml`:\n * - Per-set lists (e.g. `'fa7-solid': ['bars', 'plus']`) are passed through as-is.\n * - `semantic` names are looked up in the configured `ui` and `brand` prefix maps,\n * and the resolved icon names are merged into those sets' lists.\n *\n * Only explicitly configured icons are included — there is no fallback to all icons.\n *\n * @param iconsConfig - Icons config from site.config.yaml (icons section)\n * @returns Record<string, string[]> for astro-icon's `include` option\n */\nexport function generateIconInclude(iconsConfig?: {\n ui?: string;\n brand?: string;\n weight?: string;\n semantic?: string[];\n [prefix: string]: string | string[] | undefined;\n}): Record<string, string[]> {\n const uiPrefix = iconsConfig?.ui ?? 'fa7-solid';\n const brandPrefix = iconsConfig?.brand ?? 'simple-icons';\n const include: Record<string, string[]> = {};\n\n const addToInclude = (prefix: string, names: string[]) => {\n include[prefix] = [...new Set([...(include[prefix] ?? []), ...names])];\n };\n\n // Pass through per-set explicit lists directly\n for (const [key, val] of Object.entries(iconsConfig ?? {})) {\n if (\n key !== 'ui' &&\n key !== 'brand' &&\n key !== 'weight' &&\n key !== 'semantic' &&\n Array.isArray(val)\n ) {\n addToInclude(key, val as string[]);\n }\n }\n\n // Resolve semantic names through ui and brand prefix maps.\n const uiMapKey = prefixToMapKey[uiPrefix] as IconSet | undefined;\n const brandMapKey = prefixToMapKey[brandPrefix] as IconSet | undefined;\n const unknownPrefix: string[] = [];\n if (!uiMapKey) unknownPrefix.push(`ui: '${uiPrefix}'`);\n if (!brandMapKey) unknownPrefix.push(`brand: '${brandPrefix}'`);\n if (unknownPrefix.length)\n throw new Error(\n `[vitops icons] Unknown icon set ${unknownPrefix.join(' and ')}. ` +\n `Known sets: ${Object.keys(prefixToMapKey).join(', ')}.`,\n );\n\n const unresolved: string[] = [];\n for (const name of iconsConfig?.semantic ?? []) {\n const ui = (iconMap[uiMapKey!] as Record<string, string>)[name];\n const brand = (iconMap[brandMapKey!] as Record<string, string>)[name];\n // The weight is part of the icon NAME for suffix-weighted sets, so the\n // bundled name has to carry it — including `ph:list-bold` but not\n // `ph:list` would ship the wrong glyph (or nothing) under output: 'server'.\n if (ui) addToInclude(uiPrefix, [applyWeight(ui, uiPrefix, iconsConfig?.weight)]);\n if (brand) addToInclude(brandPrefix, [applyWeight(brand, brandPrefix, iconsConfig?.weight)]);\n if (!ui && !brand) unresolved.push(name);\n }\n\n // Fail the build rather than silently omitting the icon. Skipping quietly is\n // what makes swapping icon sets frightening: the swap \"succeeds\" and the gaps\n // only show up as missing glyphs in production.\n if (unresolved.length)\n throw new Error(\n `[vitops icons] ${unresolved.length} semantic icon name(s) not found in ` +\n `ui set '${uiPrefix}' or brand set '${brandPrefix}': ${unresolved.join(', ')}.\\n` +\n `Either add them to iconMap in @getvitops/core, or drop them from the ` +\n `\\`semantic\\` list. Available in '${uiPrefix}': ` +\n `${Object.keys(iconMap[uiMapKey!]).slice(0, 12).join(', ')}…`,\n );\n\n return include;\n}\n","/**\n * Consumer source discovery.\n *\n * Lifted verbatim out of `@getvitops/cli`, where it was a private helper behind\n * `vitops lint`. It lives here now because a second caller needs it: the Astro\n * integration scans for icon usage during `astro:config:setup`, and it cannot\n * import the CLI — `@getvitops/cli` exposes only a `bin`, and its entry calls\n * `main()` at module scope, so importing it would run the CLI.\n *\n * Deliberately hand-rolled rather than a glob dependency: the whole job is one\n * `readdirSync` recursion with two allow/deny sets, and it runs synchronously\n * inside a config hook where an async glob would have to be awaited anyway.\n */\nimport { readFileSync, readdirSync } from 'node:fs';\nimport { extname, join } from 'node:path';\n\n/** A file the scanner found, with its contents already read. */\nexport interface SourceFile {\n path: string;\n text: string;\n}\n\nexport interface ScanOptions {\n /** File extensions to read. Defaults to `SCAN_EXT`. */\n exts?: Iterable<string>;\n /** Directory names to skip entirely. Defaults to `SCAN_SKIP`. */\n skipDirs?: Iterable<string>;\n}\n\n/**\n * Extensions worth scanning: every template language the framework's classes\n * and icon names can appear in, plus the markdown that can embed them.\n */\nexport const SCAN_EXT: ReadonlySet<string> = new Set([\n '.astro',\n '.html',\n '.htm',\n '.js',\n '.jsx',\n '.ts',\n '.tsx',\n '.vue',\n '.svelte',\n '.php',\n '.md',\n '.mdx',\n]);\n\n/** Directories that only ever hold dependencies or build output. */\nexport const SCAN_SKIP: ReadonlySet<string> = new Set([\n 'node_modules',\n 'dist',\n '.git',\n '.astro',\n 'build',\n 'coverage',\n]);\n\n/**\n * Recursively read every scannable file under `dir`.\n *\n * Dotfiles and dot-directories are skipped wholesale — they hold tooling config,\n * not templates, and `.astro`/`.git` would otherwise be walked twice over.\n */\nexport function scanFiles(dir: string, opts?: ScanOptions): SourceFile[] {\n const exts = opts?.exts ? new Set(opts.exts) : SCAN_EXT;\n const skip = opts?.skipDirs ? new Set(opts.skipDirs) : SCAN_SKIP;\n const acc: SourceFile[] = [];\n walk(dir, exts, skip, acc);\n return acc;\n}\n\nfunction walk(\n dir: string,\n exts: ReadonlySet<string>,\n skip: ReadonlySet<string>,\n acc: SourceFile[],\n): void {\n for (const e of readdirSync(dir, { withFileTypes: true })) {\n if (e.name.startsWith('.') && e.name !== '.') continue;\n const p = join(dir, e.name);\n if (e.isDirectory()) {\n if (!skip.has(e.name)) walk(p, exts, skip, acc);\n } else if (exts.has(extname(e.name))) {\n acc.push({ path: p, text: readFileSync(p, 'utf8') });\n }\n }\n}\n","/**\n * Find the icons a consumer's source actually uses.\n *\n * This exists for one reason: bundle size under `output: 'server'`. astro-icon\n * is zero-config for static builds, but on a server/hybrid build it bundles\n * EVERY icon in a set unless given an `include` map — so consumers hand-maintain\n * a list, and hand-maintained lists rot. Scanning derives it instead.\n *\n * The judgement call throughout is the same one `vitops lint`'s `extractClasses`\n * makes, and for the same reason: a template hole (`name={expr}`) is not a typo\n * and must not be guessed at. An unresolvable reference is REPORTED, never\n * invented — the caller warns and asks the author to declare it. Quietly\n * inferring would produce an `include` that is confidently wrong, which is worse\n * than one that is honestly incomplete.\n */\n\n/** How an icon reference was written. Useful for phrasing the warning. */\nexport type IconRefKind = 'component' | 'prop' | 'object' | 'sprite';\n\n/** A statically resolvable icon name. */\nexport interface IconRef {\n name: string;\n kind: IconRefKind;\n attr: string;\n file: string;\n line: number;\n}\n\n/** A reference whose name is computed at runtime and cannot be read statically. */\nexport interface DynamicIconRef {\n expr: string;\n attr: string;\n file: string;\n line: number;\n}\n\nexport interface IconScanResult {\n refs: IconRef[];\n dynamic: DynamicIconRef[];\n /** Unique static names, in first-seen order. */\n names: string[];\n}\n\nexport interface IconScanOptions {\n /** Extra prop names to treat as icon-bearing, beyond the defaults. */\n props?: string[];\n}\n\n/**\n * Props that carry an icon name. `icon` covers the component convention\n * (`Popover`/`Drawer`/`Details` triggers); the start/end pair covers adornments\n * on links and buttons.\n */\nconst DEFAULT_PROPS = ['icon', 'startIcon', 'endIcon', 'leadingIcon', 'trailingIcon'];\n\n/**\n * `<Icon …>` and any capitalised component whose name ends in `Icon`.\n * Requires a capital or the literal `Icon`, so `<iconButton>` and plain HTML\n * never match.\n */\nconst COMPONENT = /<([A-Z][\\w.]*Icon|Icon)\\b([^>]*?)\\/?>/g;\n\n/** Sprite references: `<use href=\"…/icons.svg#menu\">`, incl. legacy `xlink:href`. */\nconst SPRITE_USE = /<use\\b[^>]*?\\b(?:xlink:)?href\\s*=\\s*(?:\"([^\"#]*)#([^\"]*)\"|'([^'#]*)#([^']*)')/g;\n\n/**\n * An attribute value: a quoted literal, a braced single literal, or a braced\n * expression. The final alternative is what marks a value as dynamic — it is\n * matched on purpose so the reference can be REPORTED rather than skipped.\n *\n * That last alternative stops at the first `}`, so a reported expression\n * containing its own braces (`{\\`a:${b}\\`}`) is truncated in the warning text.\n * Deliberate: balancing braces with a regex buys nothing here, because the\n * actionable part of the report is the file and line, not the expression.\n */\nconst VALUE = String.raw`(?:\"([^\"]*)\"|'([^']*)'|\\{\\s*(?:\"([^\"]*)\"|'([^']*)'|\\`([^\\`$]*)\\`)\\s*\\}|(\\{[^}]*\\}))`;\n\n/**\n * `\\b` is not enough of a left boundary here: `-` is a non-word character, so\n * `\\bicon` happily matches inside `data-icon=` and `aria-icon=`. Requiring that\n * the previous character be neither a word character nor a hyphen keeps the\n * match to a genuine standalone prop.\n */\nconst LEFT = String.raw`(?<![\\w-])`;\n\nconst nameAttr = () => new RegExp(String.raw`${LEFT}name\\s*=\\s*${VALUE}`);\nconst iconProp = (props: string[]) =>\n new RegExp(String.raw`${LEFT}(${props.join('|')})\\s*=\\s*${VALUE}`, 'g');\n/** Object-literal form: `trigger={{ icon: 'bars' }}`, or a data array of `{ icon: '…' }`. */\nconst iconKey = (props: string[]) =>\n new RegExp(\n String.raw`${LEFT}(${props.join('|')})\\s*:\\s*(?:\"([^\"]*)\"|'([^']*)'|\\`([^\\`$]*)\\`)`,\n 'g',\n );\n\nconst lineOf = (src: string, index: number) => src.slice(0, index).split('\\n').length;\n\n/**\n * Pull the literal out of a VALUE match, or report it as dynamic.\n * Groups run: \"double\", 'single', {\"double\"}, {'single'}, {`template`}, {expr}.\n */\nfunction readValue(groups: (string | undefined)[]): { literal?: string; expr?: string } {\n const [dq, sq, bdq, bsq, btpl, expr] = groups;\n if (expr !== undefined) return { expr };\n const literal = dq ?? sq ?? bdq ?? bsq ?? btpl;\n if (literal === undefined) return {};\n // A template literal with an interpolation is dynamic even inside quotes.\n if (literal.includes('${')) return { expr: literal };\n return { literal };\n}\n\n/** Extract every icon reference from one file's text. */\nexport function extractIconRefs(\n src: string,\n file = '<source>',\n opts?: IconScanOptions,\n): { refs: IconRef[]; dynamic: DynamicIconRef[] } {\n const props = [...new Set([...DEFAULT_PROPS, ...(opts?.props ?? [])])];\n const refs: IconRef[] = [];\n const dynamic: DynamicIconRef[] = [];\n\n // 1. <Icon name=\"…\" /> — the name attribute inside an icon component tag.\n const NAME = nameAttr();\n for (const m of src.matchAll(COMPONENT)) {\n const attrs = m[2] ?? '';\n const hit = NAME.exec(attrs);\n if (!hit) continue;\n const line = lineOf(src, m.index!);\n const { literal, expr } = readValue(hit.slice(1));\n if (literal) refs.push({ name: literal, kind: 'component', attr: 'name', file, line });\n else if (expr) dynamic.push({ expr, attr: 'name', file, line });\n }\n\n // 2. icon= / startIcon= / endIcon= on any tag.\n for (const m of src.matchAll(iconProp(props))) {\n const line = lineOf(src, m.index!);\n const { literal, expr } = readValue(m.slice(2));\n if (literal) refs.push({ name: literal, kind: 'prop', attr: m[1]!, file, line });\n else if (expr) dynamic.push({ expr, attr: m[1]!, file, line });\n }\n\n // 3. `icon: '…'` inside an object literal or data array.\n for (const m of src.matchAll(iconKey(props))) {\n const literal = m[2] ?? m[3] ?? m[4];\n if (!literal || literal.includes('${')) continue;\n refs.push({ name: literal, kind: 'object', attr: m[1]!, file, line: lineOf(src, m.index!) });\n }\n\n // 4. Sprite <use href=\"…#id\">.\n for (const m of src.matchAll(SPRITE_USE)) {\n const id = m[2] ?? m[4];\n if (!id) continue;\n refs.push({ name: id, kind: 'sprite', attr: 'href', file, line: lineOf(src, m.index!) });\n }\n\n return { refs, dynamic };\n}\n\n/** Run `extractIconRefs` across a file set and collect unique names. */\nexport function collectIconRefs(\n files: readonly { path: string; text: string }[],\n opts?: IconScanOptions,\n): IconScanResult {\n const refs: IconRef[] = [];\n const dynamic: DynamicIconRef[] = [];\n for (const f of files) {\n const r = extractIconRefs(f.text, f.path, opts);\n refs.push(...r.refs);\n dynamic.push(...r.dynamic);\n }\n return { refs, dynamic, names: [...new Set(refs.map((r) => r.name))] };\n}\n"],"mappings":";;;;;;AA2EA,SAAgB,QAAuC,MAAkC;CACvF,OAAO,QAAQ,KAAK,SAAS;AAC/B;AAEA,SAAgB,OAAO,MAAyB;CAC9C,OAAO,SAAS,WAAW,QAAQ,WAAW,SAAS,UAAU;AACnE;AAEA,SAAgB,WAAW,MAA6B;CACtD,OAAO,QAAQ,WAAW,QAAQ,UAAU;AAC9C;AAEA,SAAgB,YAAY,MAA8B;CACxD,OAAO,QAAQ,WAAW,QAAQ,UAAU;AAC9C;;;;;AAQA,SAAgB,EAAE,OAAgC,QAAgB,eAA+B;CAC/F,IAAI,SAAS,MAAM,OAAO;CAC1B,IAAI,OAAO,UAAU,UAAU,OAAO;CAC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AK;GAAM,MAAM,OAAO,KAAK,EAAE,KAAM;EAAE,CAAC;CAC7F;CAGA,KAAK,MAAM,KAAK,IAAI,SAAS,UAAU,GAAG;EACxC,MAAM,KAAK,EAAE,MAAM,EAAE;EACrB,IAAI,CAAC,IAAI;EACT,KAAK,KAAK;GAAE,MAAM;GAAI,MAAM;GAAU,MAAM;GAAQ;GAAM,MAAM,OAAO,KAAK,EAAE,KAAM;EAAE,CAAC;CACzF;CAEA,OAAO;EAAE;EAAM;CAAQ;AACzB;;AAGA,SAAgB,gBACd,OACA,MACgB;CAChB,MAAM,OAAkB,CAAC;CACzB,MAAM,UAA4B,CAAC;CACnC,KAAK,MAAM,KAAK,OAAO;EACrB,MAAM,IAAI,gBAAgB,EAAE,MAAM,EAAE,MAAM,IAAI;EAC9C,KAAK,KAAK,GAAG,EAAE,IAAI;EACnB,QAAQ,KAAK,GAAG,EAAE,OAAO;CAC3B;CACA,OAAO;EAAE;EAAM;EAAS,OAAO,CAAC,GAAG,IAAI,IAAI,KAAK,KAAK,MAAM,EAAE,IAAI,CAAC,CAAC;CAAE;AACvE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as SCOPES, c as googleHeaders, i as GoogleOAuth, n as GoogleAuthLike, o as ServiceAccount, r as GoogleCredential, s as googleAccessToken, t as GoogleAuth } from "../token-BlShEM6J.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/indexing/types.d.ts
|
|
4
4
|
/**
|
|
@@ -246,7 +246,7 @@ declare function serviceAccountToken(account: ServiceAccount, fetchImpl?: typeof
|
|
|
246
246
|
* (`sc-domain:acme.ca` vs `https://acme.ca/`) or the service account isn't an
|
|
247
247
|
* owner of it, rather than that the sitemap is bad.
|
|
248
248
|
*/
|
|
249
|
-
declare function submitSitemap(
|
|
249
|
+
declare function submitSitemap(auth: GoogleAuthLike, siteUrl: string, sitemapUrl: string, fetchImpl?: typeof fetch): Promise<{
|
|
250
250
|
ok: boolean;
|
|
251
251
|
status: number;
|
|
252
252
|
message?: string;
|
|
@@ -268,7 +268,28 @@ interface InspectionResult {
|
|
|
268
268
|
* anything. Quota is 2000 queries/day per property, which is why the caller works
|
|
269
269
|
* from an explicit `priorityUrls` list rather than the whole sitemap.
|
|
270
270
|
*/
|
|
271
|
-
declare function inspectUrl(
|
|
271
|
+
declare function inspectUrl(auth: GoogleAuthLike, siteUrl: string, inspectionUrl: string, fetchImpl?: typeof fetch): Promise<InspectionResult>;
|
|
272
272
|
//#endregion
|
|
273
|
-
|
|
273
|
+
//#region src/google/adc.d.ts
|
|
274
|
+
/** A parsed ADC user credential, or `undefined` if `raw` is not one. */
|
|
275
|
+
declare function parseAdcUser(raw: string): GoogleOAuth | undefined;
|
|
276
|
+
/** The quota project gcloud recorded with an ADC credential, if any. */
|
|
277
|
+
declare function adcQuotaProject(raw: string): string | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* Where gcloud keeps ADC when nothing points at it explicitly.
|
|
280
|
+
*
|
|
281
|
+
* Reading the well-known path is what makes "I'm logged in" mean something, instead
|
|
282
|
+
* of asking the user to export a variable at a file gcloud already wrote.
|
|
283
|
+
* `CLOUDSDK_CONFIG` wins if set, as it does for gcloud itself.
|
|
284
|
+
*
|
|
285
|
+
* Every input is a parameter so the platform branches are testable on one machine.
|
|
286
|
+
*/
|
|
287
|
+
declare function adcCredentialsPath(opts: {
|
|
288
|
+
env: Record<string, string | undefined>;
|
|
289
|
+
platform: string;
|
|
290
|
+
home: string | undefined;
|
|
291
|
+
join: (...parts: string[]) => string;
|
|
292
|
+
}): string | undefined;
|
|
293
|
+
//#endregion
|
|
294
|
+
export { type ChannelPlan, type GoogleAuth, type GoogleAuthLike, type GoogleCredential, type GoogleOAuth, INDEXNOW_BATCH, INDEXNOW_ENDPOINT, type IndexNowConfig, type IndexNowPlan, type IndexingConfig, type IndexingPlan, type InspectionResult, type ParsedSitemap, type PlanInput, SCOPES, SNAPSHOT_PATH, type SearchConsoleConfig, type SearchConsolePlan, type ServiceAccount, type SitemapEntry, type SitemapReader, type Snapshot, type SubmitResult, type UrlReason, adcCredentialsPath, adcQuotaProject, collectEntries, formatPlan, googleAccessToken, googleHeaders, inspectUrl, keyFileContents, newKey, parseAdcUser, parseServiceAccount, parseSitemap, plan, readSnapshot, resolveKeyLocation, resolveSitemapUrl, serviceAccountToken, submitBatch, submitSitemap, toSnapshot, verifyKeyFile, writeSnapshot };
|
|
274
295
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/indexing/types.ts","../../src/indexing/plan.ts","../../src/indexing/sitemap.ts","../../src/indexing/snapshot.ts","../../src/indexing/indexnow.ts","../../src/indexing/gsc.ts"],"mappings":";;;;;;AAoBA;;;;;;;UAAiB,cAAA;EASP;AAIV;;;EARE,GAAA;EAYe;EAVf,WAAA;EAc6B;EAZ7B,QAAA;AAAA;;UAIe,mBAAA;EAaf;EAXA,OAAA;EAYA;EAVA,eAAe;AAAA;;UAIA,cAAA;EAaT;EAXN,SAAA;EAe2B;EAb3B,UAAA;EACA,QAAA,GAAW,cAAA;EACX,aAAA,GAAgB,mBAAmB;EAiBpB;EAff,YAAA;;;;;EAKA,MAAA;AAAA;;UAIe,YAAA;EACf,GAAA;EACA,OAAO;AAAA;;UAIQ,QAAA;EACf,OAAA;EACA,UAAA;EACA,OAAA;ECpD4B;EDsD5B,OAAA,EAAS,MAAM;AAAA;;;cCtDJ,iBAAA;;ADsBI;AAIjB;;;cCnBa,cAAA;;KAGD,SAAA;;UAGK,WAAA;EACf,OAAA;EDkBgB;EChBhB,IAAI;AAAA;AAAA,UAGW,YAAA,SAAqB,WAAW;EAC/C,QAAA;EACA,WAAA;EACA,GAAA;EACA,IAAA;EDqBA;ECnBA,OAAA;AAAA;AAAA,UAGe,iBAAA,SAA0B,WAAW;EACpD,OAAO;AAAA;AAAA,UAGQ,YAAA;EDmBf;ECjBA,OAAA;EDoBA;EClBA,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MF;;;;AAIiB;AAIjB;;;AARA,iBI6BsB,aAAA,CACpB,WAAA,UACA,GAAA,UACA,SAAA,UAAkB,KAAA,GACjB,OAAO;EAAG,EAAA;EAAa,MAAA;AAAA;;;;;iBAqBJ,WAAA,CACpB,IAAA,EAAM,YAAA,EACN,IAAA,YACA,SAAA,UAAkB,KAAA,GACjB,OAAA,CAAQ,YAAA;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/indexing/types.ts","../../src/indexing/plan.ts","../../src/indexing/sitemap.ts","../../src/indexing/snapshot.ts","../../src/indexing/indexnow.ts","../../src/indexing/gsc.ts","../../src/google/adc.ts"],"mappings":";;;;;;AAoBA;;;;;;;UAAiB,cAAA;EASP;AAIV;;;EARE,GAAA;EAYe;EAVf,WAAA;EAc6B;EAZ7B,QAAA;AAAA;;UAIe,mBAAA;EAaf;EAXA,OAAA;EAYA;EAVA,eAAe;AAAA;;UAIA,cAAA;EAaT;EAXN,SAAA;EAe2B;EAb3B,UAAA;EACA,QAAA,GAAW,cAAA;EACX,aAAA,GAAgB,mBAAmB;EAiBpB;EAff,YAAA;;;;;EAKA,MAAA;AAAA;;UAIe,YAAA;EACf,GAAA;EACA,OAAO;AAAA;;UAIQ,QAAA;EACf,OAAA;EACA,UAAA;EACA,OAAA;ECpD4B;EDsD5B,OAAA,EAAS,MAAM;AAAA;;;cCtDJ,iBAAA;;ADsBI;AAIjB;;;cCnBa,cAAA;;KAGD,SAAA;;UAGK,WAAA;EACf,OAAA;EDkBgB;EChBhB,IAAI;AAAA;AAAA,UAGW,YAAA,SAAqB,WAAW;EAC/C,QAAA;EACA,WAAA;EACA,GAAA;EACA,IAAA;EDqBA;ECnBA,OAAA;AAAA;AAAA,UAGe,iBAAA,SAA0B,WAAW;EACpD,OAAO;AAAA;AAAA,UAGQ,YAAA;EDmBf;ECjBA,OAAA;EDoBA;EClBA,UAAA;EDkBe;EChBf,IAAA;EACA,MAAA,EAAQ,SAAA;;EA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AA,UACA,GAAA,UACA,SAAA,UAAkB,KAAA,GACjB,OAAO;EAAG,EAAA;EAAa,MAAA;AAAA;;;;;iBAqBJ,WAAA,CACpB,IAAA,EAAM,YAAA,EACN,IAAA,YACA,SAAA,UAAkB,KAAA,GACjB,OAAA,CAAQ,YAAA;;;;;;;;;;;iBCtDK,mBAAA,CAAoB,GAAA,WAAc,cAAc;ALiBxD;AAIR;;;;AAJQ,iBKAQ,mBAAA,CACd,OAAA,EAAS,cAAA,EACT,SAAA,UAAkB,KAAA,EAClB,GAAA,YACC,OAAA;ALMH;;;;;;;AAAA,iBKWsB,aAAA,CACpB,IAAA,EAAM,cAAA,EACN,OAAA,UACA,UAAA,UACA,SAAA,UAAkB,KAAA,GACjB,OAAA;EAAU,EAAA;EAAa,MAAA;EAAgB,OAAA;AAAA;;UAezB,gBAAA;EACf,GAAA;EJjF4B;EImF5B,OAAA;EJnF4B;EIqF5B,aAAA;EACA,aAAA;EJ/EyB;EIiFzB,OAAA;EACA,KAAA;AAAA;AJ/EF;;;;AAAqB;AAArB,iBIuFsB,UAAA,CACpB,IAAA,EAAM,cAAA,EACN,OAAA,UACA,aAAA,UACA,SAAA,UAAkB,KAAA,GACjB,OAAA,CAAQ,gBAAA;;;ALhFM;AAAA,iBMnBD,YAAA,CAAa,GAAA,WAAc,WAAW;;iBAwBtC,eAAA,CAAgB,GAAW;;;;;;;;;;iBAiB3B,kBAAA,CAAmB,IAAA;EACjC,GAAA,EAAK,MAAM;EACX,QAAA;EACA,IAAA;EACA,IAAA,MAAU,KAAA;AAAA"}
|
package/dist/indexing/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as googleAccessToken, t as SCOPES } from "../token-
|
|
1
|
+
import { n as googleAccessToken, r as googleHeaders, t as SCOPES } from "../token-CuyjDo6I.mjs";
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
4
|
import { randomBytes } from "node:crypto";
|
|
@@ -475,10 +475,10 @@ const encodeSite = (siteUrl) => encodeURIComponent(siteUrl);
|
|
|
475
475
|
* (`sc-domain:acme.ca` vs `https://acme.ca/`) or the service account isn't an
|
|
476
476
|
* owner of it, rather than that the sitemap is bad.
|
|
477
477
|
*/
|
|
478
|
-
async function submitSitemap(
|
|
478
|
+
async function submitSitemap(auth, siteUrl, sitemapUrl, fetchImpl = fetch) {
|
|
479
479
|
const res = await fetchImpl(`https://www.googleapis.com/webmasters/v3/sites/${encodeSite(siteUrl)}/sitemaps/${encodeURIComponent(sitemapUrl)}`, {
|
|
480
480
|
method: "PUT",
|
|
481
|
-
headers:
|
|
481
|
+
headers: googleHeaders(auth)
|
|
482
482
|
});
|
|
483
483
|
if (res.ok) return {
|
|
484
484
|
ok: true,
|
|
@@ -496,13 +496,10 @@ async function submitSitemap(token, siteUrl, sitemapUrl, fetchImpl = fetch) {
|
|
|
496
496
|
* anything. Quota is 2000 queries/day per property, which is why the caller works
|
|
497
497
|
* from an explicit `priorityUrls` list rather than the whole sitemap.
|
|
498
498
|
*/
|
|
499
|
-
async function inspectUrl(
|
|
499
|
+
async function inspectUrl(auth, siteUrl, inspectionUrl, fetchImpl = fetch) {
|
|
500
500
|
const res = await fetchImpl("https://searchconsole.googleapis.com/v1/urlInspection/index:inspect", {
|
|
501
501
|
method: "POST",
|
|
502
|
-
headers: {
|
|
503
|
-
authorization: `Bearer ${token}`,
|
|
504
|
-
"content-type": "application/json"
|
|
505
|
-
},
|
|
502
|
+
headers: googleHeaders(auth, { "content-type": "application/json" }),
|
|
506
503
|
body: JSON.stringify({
|
|
507
504
|
inspectionUrl,
|
|
508
505
|
siteUrl
|
|
@@ -524,5 +521,48 @@ async function inspectUrl(token, siteUrl, inspectionUrl, fetchImpl = fetch) {
|
|
|
524
521
|
}
|
|
525
522
|
|
|
526
523
|
//#endregion
|
|
527
|
-
|
|
524
|
+
//#region src/google/adc.ts
|
|
525
|
+
/** A parsed ADC user credential, or `undefined` if `raw` is not one. */
|
|
526
|
+
function parseAdcUser(raw) {
|
|
527
|
+
let parsed;
|
|
528
|
+
try {
|
|
529
|
+
parsed = JSON.parse(raw);
|
|
530
|
+
} catch {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (parsed.type !== "authorized_user") return void 0;
|
|
534
|
+
if (!parsed.client_id || !parsed.client_secret || !parsed.refresh_token) return void 0;
|
|
535
|
+
return {
|
|
536
|
+
clientId: parsed.client_id,
|
|
537
|
+
clientSecret: parsed.client_secret,
|
|
538
|
+
refreshToken: parsed.refresh_token
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
/** The quota project gcloud recorded with an ADC credential, if any. */
|
|
542
|
+
function adcQuotaProject(raw) {
|
|
543
|
+
try {
|
|
544
|
+
return JSON.parse(raw).quota_project_id || void 0;
|
|
545
|
+
} catch {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Where gcloud keeps ADC when nothing points at it explicitly.
|
|
551
|
+
*
|
|
552
|
+
* Reading the well-known path is what makes "I'm logged in" mean something, instead
|
|
553
|
+
* of asking the user to export a variable at a file gcloud already wrote.
|
|
554
|
+
* `CLOUDSDK_CONFIG` wins if set, as it does for gcloud itself.
|
|
555
|
+
*
|
|
556
|
+
* Every input is a parameter so the platform branches are testable on one machine.
|
|
557
|
+
*/
|
|
558
|
+
function adcCredentialsPath(opts) {
|
|
559
|
+
const { env, platform, home, join } = opts;
|
|
560
|
+
const sdk = env.CLOUDSDK_CONFIG;
|
|
561
|
+
if (sdk) return join(sdk, "application_default_credentials.json");
|
|
562
|
+
if (platform === "win32") return env.APPDATA ? join(env.APPDATA, "gcloud", "application_default_credentials.json") : void 0;
|
|
563
|
+
return home ? join(home, ".config", "gcloud", "application_default_credentials.json") : void 0;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
//#endregion
|
|
567
|
+
export { INDEXNOW_BATCH, INDEXNOW_ENDPOINT, SCOPES, SNAPSHOT_PATH, adcCredentialsPath, adcQuotaProject, collectEntries, formatPlan, googleAccessToken, googleHeaders, inspectUrl, keyFileContents, newKey, parseAdcUser, parseServiceAccount, parseSitemap, plan, readSnapshot, resolveKeyLocation, resolveSitemapUrl, serviceAccountToken, submitBatch, submitSitemap, toSnapshot, verifyKeyFile, writeSnapshot };
|
|
528
568
|
//# sourceMappingURL=index.mjs.map
|