@duffcloudservices/cms 0.13.15 → 0.14.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.
@@ -1,4 +1,4 @@
1
- import { a as BreadcrumbCrumb, g as ReviewSource, F as FaqSource, B as BlogMeta, f as ResolvedPageSeo, j as SeoConfiguration, o as SeoSchemaConfig, G as GlobalSeoConfig, l as SeoOpenGraphConfig, q as SeoTwitterConfig } from './vitepressTransform-BJrpGbVT.js';
1
+ import { d as BreadcrumbCrumb, k as ReviewSource, i as FaqSource, B as BlogMeta, j as ResolvedPageSeo, p as SeoConfiguration, u as SeoSchemaConfig, G as GlobalSeoConfig, r as SeoOpenGraphConfig, w as SeoTwitterConfig } from './vitepressTransform-CQXBpYEC.js';
2
2
 
3
3
  /**
4
4
  * Framework-agnostic SEO head-tag resolution.
@@ -1,6 +1,6 @@
1
1
  import { Plugin, HtmlTagDescriptor } from 'vite';
2
- import { D as DcsRobotsOptions, Y as SeoHonestyBlock, Z as PageRouteEntry, j as SeoConfiguration, C as ContentConfig } from '../vitepressTransform-BJrpGbVT.js';
3
- export { e as CreateSeoTransformPageDataOptions, R as ResolvedPageOverrides, m as SeoPageContext, n as SeoPageTypeRule, V as VitePressHeadConfig, t as VitePressPageData, L as buildVitePressSeoHead, M as createSeoTransformPageData, N as defaultRelativePathToRoute } from '../vitepressTransform-BJrpGbVT.js';
2
+ import { a7 as PageRouteEntry, D as DcsRobotsOptions, a8 as SeoHonestyBlock, p as SeoConfiguration, C as ContentConfig } from '../vitepressTransform-CQXBpYEC.js';
3
+ export { h as CreateSeoTransformPageDataOptions, R as ResolvedPageOverrides, s as SeoPageContext, t as SeoPageTypeRule, V as VitePressHeadConfig, z as VitePressPageData, Y as buildVitePressSeoHead, Z as createSeoTransformPageData, $ as defaultRelativePathToRoute } from '../vitepressTransform-CQXBpYEC.js';
4
4
  import { H as HonestyMode } from '../headHonesty-k1IhGblP.js';
5
5
  import { Component, Plugin as Plugin$1 } from 'vue';
6
6
  import MarkdownIt from 'markdown-it';
@@ -53,6 +53,126 @@ interface DcsContentPluginOptions {
53
53
  */
54
54
  declare function dcsContentPlugin(options?: DcsContentPluginOptions): Plugin;
55
55
 
56
+ /**
57
+ * Per-route sitemap `<lastmod>` derived from git (RFQ-002427 L1a, cms 0.14.0).
58
+ *
59
+ * OPT-IN AND BEST-EFFORT. The factory never infers a lastmod by default: a URL
60
+ * carries its per-route `.dcs/pages.yaml` date or no `<lastmod>`. This walk
61
+ * runs only for a site that sets `.dcs/seo.yaml` `sitemap.lastmodFromGit:
62
+ * true` (or the `gitLastmod` option). Known gaps the opt-in accepts:
63
+ * composables/stores/lib/utils are excluded, not inspected (content a page
64
+ * reads through them is not dated unless re-included via `lastmodExclude`
65
+ * `!glob`); markdown includes (`<!--@include:-->`) are not traced; a VitePress
66
+ * page with a custom frontmatter `layout:` is omitted, not traced; runtime
67
+ * data (API fetches, live artifacts) is never dated.
68
+ *
69
+ * The sitemap rule: a `<lastmod>` is accurate for its URL, or it is omitted.
70
+ * Never a build-time stamp, and never one site-wide date on every URL (the
71
+ * kineticenergypt F4 defect: all 52 URLs carried seo.yaml `lastUpdated`, stale
72
+ * on 100 % of them).
73
+ *
74
+ * INVARIANT: a route gets a git-derived lastmod only when EVERY material
75
+ * content source of that route is tracked and dated; otherwise that route's
76
+ * lastmod is omitted.
77
+ *
78
+ * Precedence, applied by `buildSitemapXml`:
79
+ * 1. a per-route `lastmod` / `lastUpdated` / `dateModified` on the
80
+ * `.dcs/pages.yaml` entry (validated);
81
+ * 2. the git-derived date from here = the NEWEST of
82
+ * (a) the route's view or markdown file,
83
+ * (b) every local module reachable from it through other content modules
84
+ * (transitive, shared or not), never counting or walking into the
85
+ * non-content exclusions ({@link DEFAULT_LASTMOD_EXCLUDE} plus
86
+ * `.dcs/seo.yaml` `sitemap.lastmodExclude`),
87
+ * (c) the route's own content in `.dcs/content.yaml`: the newest commit
88
+ * that changed `pages.<slug>` or a `global` key the route's sources
89
+ * reference by name (parsed-subtree diff, commit by commit, capped at
90
+ * {@link CONTENT_WALK_LIMIT} commits);
91
+ * 3. nothing: `<lastmod>` is omitted.
92
+ *
93
+ * A route is omitted (no git date) when any material source cannot be
94
+ * accounted for: no resolvable view, an import that resolves to no file and is
95
+ * not an installed package (virtual modules, unknown aliases), a VitePress
96
+ * markdown component tag with no theme registration, a VitePress data loader
97
+ * whose inputs are not literal globs, an untracked or locally modified source,
98
+ * or a content.yaml walk that hit the cap without finding the change.
99
+ *
100
+ * Git-derived dates are withheld for ALL routes when git is unavailable, the
101
+ * clone is shallow (`git rev-parse --is-shallow-repository`), or 3+ dated
102
+ * routes ALL share one single date (the uniform-stamp signature). A partial
103
+ * overlap from a real bulk commit is accurate and kept.
104
+ *
105
+ * Modelled on lane L3's web/scripts/generate-sitemap.mjs (169eb73f8,
106
+ * acebc7a75: transitive content-module walk, NON_CONTENT_SOURCES, one
107
+ * `git log --name-only --cc` prime walk so merge resolutions count).
108
+ */
109
+
110
+ /** Runs `git <args>` in `cwd` and returns stdout; throws on any failure. */
111
+ type GitRunner = (args: string[], cwd: string) => string;
112
+ /** Why git-derived dates were withheld for the whole site (undefined = used). */
113
+ type RouteLastmodWithheld = 'git-unavailable' | 'shallow' | 'identical-dates';
114
+ /** Why ONE route got no git-derived date. */
115
+ type RouteLastmodOmitted = 'no-source' | 'unresolved-import' | 'unresolved-component' | 'untracked-source' | 'data-loader' | 'undated-source' | 'content-walk-cap' | 'content-untracked' | 'custom-layout';
116
+ /** With this many or more dated routes all on ONE date, every git date is withheld. */
117
+ declare const IDENTICAL_LASTMOD_ROUTE_LIMIT = 3;
118
+ /** content.yaml commits walked per site before an unanswered route is omitted. */
119
+ declare const CONTENT_WALK_LIMIT = 300;
120
+ /**
121
+ * Local modules that never count toward a page's lastmod and are not walked
122
+ * into: app shell and chrome, non-content code, styles, tests, and the `.dcs`
123
+ * metadata files (content.yaml is dated per route by (c) instead). Globs are
124
+ * matched against the path relative to `projectRoot`; a glob without `/`
125
+ * matches the basename. A site extends this with `.dcs/seo.yaml`
126
+ * `sitemap.lastmodExclude`, where a `!glob` entry re-includes.
127
+ */
128
+ declare const DEFAULT_LASTMOD_EXCLUDE: readonly string[];
129
+ interface DeriveRouteLastmodsOptions {
130
+ routes: PageRouteEntry[];
131
+ /** Directory the source paths resolve against. */
132
+ projectRoot: string;
133
+ /**
134
+ * Site override for a route's ENTRY files (absolute, or relative to
135
+ * `projectRoot`); the content-module walk still runs from them. Return
136
+ * `undefined` for the default mapping, `[]` to give the route no git date.
137
+ */
138
+ sourcesForRoute?: (route: PageRouteEntry) => string[] | undefined;
139
+ /** `.dcs/content.yaml` path (absolute or projectRoot-relative). Default: searched. */
140
+ contentPath?: string;
141
+ /** Extra exclusion globs (`.dcs/seo.yaml` `sitemap.lastmodExclude`); `!glob` re-includes. */
142
+ exclude?: string[];
143
+ /** content.yaml commits to walk (default {@link CONTENT_WALK_LIMIT}). */
144
+ contentWalkLimit?: number;
145
+ /** Injectable git runner (tests). Defaults to a real `git` subprocess. */
146
+ git?: GitRunner;
147
+ debug?: boolean;
148
+ }
149
+ interface DeriveRouteLastmodsResult {
150
+ /** route.path → ISO-8601 committer date of the newest change to its material sources. */
151
+ lastmods: Map<string, string>;
152
+ /** Set when every git-derived date was withheld, with the reason. */
153
+ withheld?: RouteLastmodWithheld;
154
+ /** route.path → why that route got no date (only routes the walk reached). */
155
+ omitted: Map<string, RouteLastmodOmitted>;
156
+ /** route.path → the material source files that were dated (absolute). */
157
+ sources: Map<string, string[]>;
158
+ }
159
+ /**
160
+ * The conventional entry files for a route, relative to `projectRoot`, in
161
+ * priority order. Covers the SPA layout (`src/views/<Name>View.vue`,
162
+ * `src/pages/<Name>.vue`) and the VitePress layout (`<path>.md`,
163
+ * `<path>/index.md`, under the root or `docs/`). The FIRST that exists is the
164
+ * route's entry.
165
+ */
166
+ declare function defaultRouteSourceCandidates(route: PageRouteEntry): string[];
167
+ /** Minimal glob → RegExp: `**`, `*`, `?`, `{a,b}` (alternatives literal or wildcard). */
168
+ declare function lastmodGlobToRegExp(glob: string): RegExp;
169
+ /**
170
+ * Derive per-route `<lastmod>` values from git. Never throws: any git failure
171
+ * withholds the git-derived dates (the sitemap then omits `<lastmod>` for
172
+ * routes without a pages.yaml date).
173
+ */
174
+ declare function deriveRouteLastmods(options: DeriveRouteLastmodsOptions): DeriveRouteLastmodsResult;
175
+
56
176
  /**
57
177
  * DCS SEO Plugin for Vite
58
178
  *
@@ -186,6 +306,21 @@ interface DcsSeoPluginOptions {
186
306
  preview?: boolean;
187
307
  /** Emit `dist/llms.txt` (default `true`; always off in preview mode). */
188
308
  llms?: boolean;
309
+ /**
310
+ * Opt in to git-derived sitemap `<lastmod>` (BEST-EFFORT; default OFF).
311
+ * Without it the factory never infers a date: a URL carries its per-route
312
+ * `.dcs/pages.yaml` `lastmod`, or no `<lastmod>`. The site-level switch is
313
+ * `.dcs/seo.yaml` `sitemap.lastmodFromGit: true`; this option, when set,
314
+ * overrides it for one build. See `deriveRouteLastmods` for what the walk
315
+ * does and does not see.
316
+ */
317
+ gitLastmod?: boolean;
318
+ /**
319
+ * Override a route's source files (absolute or project-root relative) for
320
+ * the git-derived `<lastmod>`. Return `undefined` for the default mapping
321
+ * (`src/views/<Name>View.vue`, `src/pages/<Name>.vue`, `<path>.md`, ...).
322
+ */
323
+ lastmodSources?: (route: PageRouteEntry) => string[] | undefined;
189
324
  /**
190
325
  * P1 — assert that each route's BAKED `<title>`/description equals what the
191
326
  * app leaves in the `<head>` after it mounts. Rides the prerender browser, so
@@ -267,7 +402,10 @@ declare class NoindexOrphanError extends Error {
267
402
  * - `llms.txt` (skipped in preview, or when nothing indexable)
268
403
  *
269
404
  * Returns the list of relative filenames written. Pure aside from `fs` writes —
270
- * deterministic + idempotent. Never throws (the caller also wraps in try/catch).
405
+ * deterministic + idempotent. Throws only {@link RobotsAiTrainingConflictError}
406
+ * (a hand-authored robots.txt that contradicts `robots.aiTraining: false`),
407
+ * which the plugin's emit catch re-throws so the build fails; nothing else is
408
+ * thrown.
271
409
  */
272
410
  declare function emitSiteFiles(params: {
273
411
  outDir: string;
@@ -281,6 +419,24 @@ declare function emitSiteFiles(params: {
281
419
  preview?: boolean;
282
420
  robots?: DcsRobotsOptions;
283
421
  llms?: boolean;
422
+ /**
423
+ * Opt in to git-derived sitemap `<lastmod>` (BEST-EFFORT; default OFF).
424
+ * Without it the factory never infers a date: a URL carries its per-route
425
+ * `.dcs/pages.yaml` `lastmod`, or no `<lastmod>`. The site-level switch is
426
+ * `.dcs/seo.yaml` `sitemap.lastmodFromGit: true`; this option, when set,
427
+ * overrides it for one build. See `deriveRouteLastmods` for what the walk
428
+ * does and does not see.
429
+ */
430
+ gitLastmod?: boolean;
431
+ /** Override a route's ENTRY files for the git-derived `<lastmod>` (the content walk still runs). */
432
+ lastmodSources?: (route: PageRouteEntry) => string[] | undefined;
433
+ /**
434
+ * `.dcs/content.yaml` path (projectRoot-relative or absolute), used to date
435
+ * each route's own content subtree. Default: searched like pages.yaml.
436
+ */
437
+ contentPath?: string;
438
+ /** Injectable git runner (tests only). */
439
+ git?: GitRunner;
284
440
  debug?: boolean;
285
441
  }): string[];
286
442
  /**
@@ -964,4 +1120,4 @@ interface DcsAgentWidgetTagOptions {
964
1120
  */
965
1121
  declare function dcsAgentWidgetLoaderTag(options: DcsAgentWidgetTagOptions): HtmlTagDescriptor | null;
966
1122
 
967
- export { AGENT_CONFIG_ORIGINS, type AgentConfigOrigin, DCS_MOTION_TOKENS_CSS, DEFAULT_AGENT_API_BASE_URL, DEFAULT_AGENT_WIDGET_SCRIPT_URL, DIR_INDEX_INSTALLED, DIR_INDEX_MANIFEST_ENV, DIR_INDEX_MANIFEST_SCHEMA, type DcsAgentWidgetLoaderOptions, type DcsAgentWidgetTagOptions, type DcsCdnBuildEndOptions, type DcsCdnImagePluginOptions, type DcsContentPluginOptions, type DcsEditorPluginOptions, type DcsPreviewPluginOptions, type DcsResponsiveImageLintOptions, type DcsSeoPluginOptions, DirIndexError, type DirIndexManifest, type DirIndexManifestEntry, type DirIndexResult, type DirIndexSiteConfig, type EmitDirectoryIndexesOptions, NoindexOrphanError, type ResponsiveImageLintReport, type ResponsiveImageViolation, buildAgentWidgetLoaderScript, chainBuildEnd, clearDirIndexManifest, collectNoindexMatchKeys, dcsAgentWidgetLoaderTag, dcsCdnBuildEnd, dcsCdnImagePlugin, dcsContentPlugin, dcsDirIndexBuildEnd, dcsEditorPlugin, dcsMotionTokensStyleTag, dcsPreviewPlugin, dcsResponsiveImageLint, dcsSeoPlugin, dirIndexCandidates, emitDirectoryIndexes, emitSiteFiles, emitStaticSeoHtml, findFullSizeCdnImages, findOrphanNoindexEntries, installDirIndex, isFullSizeCdnUrl, readAgentConfigOrigin, readSiteSlug, responsiveImagePlugin };
1123
+ export { AGENT_CONFIG_ORIGINS, type AgentConfigOrigin, CONTENT_WALK_LIMIT, DCS_MOTION_TOKENS_CSS, DEFAULT_AGENT_API_BASE_URL, DEFAULT_AGENT_WIDGET_SCRIPT_URL, DEFAULT_LASTMOD_EXCLUDE, DIR_INDEX_INSTALLED, DIR_INDEX_MANIFEST_ENV, DIR_INDEX_MANIFEST_SCHEMA, type DcsAgentWidgetLoaderOptions, type DcsAgentWidgetTagOptions, type DcsCdnBuildEndOptions, type DcsCdnImagePluginOptions, type DcsContentPluginOptions, type DcsEditorPluginOptions, type DcsPreviewPluginOptions, type DcsResponsiveImageLintOptions, type DcsSeoPluginOptions, type DeriveRouteLastmodsOptions, type DeriveRouteLastmodsResult, DirIndexError, type DirIndexManifest, type DirIndexManifestEntry, type DirIndexResult, type DirIndexSiteConfig, type EmitDirectoryIndexesOptions, type GitRunner, IDENTICAL_LASTMOD_ROUTE_LIMIT, NoindexOrphanError, type ResponsiveImageLintReport, type ResponsiveImageViolation, type RouteLastmodOmitted, type RouteLastmodWithheld, buildAgentWidgetLoaderScript, chainBuildEnd, clearDirIndexManifest, collectNoindexMatchKeys, dcsAgentWidgetLoaderTag, dcsCdnBuildEnd, dcsCdnImagePlugin, dcsContentPlugin, dcsDirIndexBuildEnd, dcsEditorPlugin, dcsMotionTokensStyleTag, dcsPreviewPlugin, dcsResponsiveImageLint, dcsSeoPlugin, defaultRouteSourceCandidates, deriveRouteLastmods, dirIndexCandidates, emitDirectoryIndexes, emitSiteFiles, emitStaticSeoHtml, findFullSizeCdnImages, findOrphanNoindexEntries, installDirIndex, isFullSizeCdnUrl, lastmodGlobToRegExp, readAgentConfigOrigin, readSiteSlug, responsiveImagePlugin };