@duffcloudservices/cms 0.15.0 → 0.16.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 { config } from '../chunk-ZGVP7AKD.js';
1
+ import { config } from '../chunk-KD2HFSIZ.js';
2
2
  import { buildSitemapXml, isHandAuthoredRobotsAcceptable, findAiTrainingRobotsConflicts, RobotsAiTrainingConflictError, appendAiTrainingOptOut, buildRobotsTxt, buildLlmsTxt, routeExclusionReason, breadcrumbTrailFromRoute, findReviewItemsForPage, findBusinessLicense, buildHeadTags, spliceHeadHtml, routeToOutputFile, loadPagesManifest, hoistCharsetMeta, checkCharsetBudget, findPostalAddressGaps, formatPostalAddressGapReport, isBodyPrerenderEnabled, resolveHonestyMode, assertHeadHonestyExecuted, findHeadHonestyViolations, assertHeadHonesty, isRouteEmitted, findDuplicateNormalizedPaths, formatDuplicateNormalizedPaths, prerenderBodies, CharsetBudgetError, formatCharsetHeadroomWarning, dedupeUrls, collectEmittedUrlsFromFiles, classifyUrl, auditSameOriginAssets, checkRemoteAssets, auditCheckedTotal, EmittedUrlNotRunError, formatEmittedUrlAudit, formatEmittedUrlReport, EmittedUrlError } from '../chunk-CJATCOZJ.js';
3
3
  export { buildVitePressSeoHead, createSeoTransformPageData, defaultRelativePathToRoute } from '../chunk-CJATCOZJ.js';
4
4
  import fs8 from 'fs';
@@ -2301,8 +2301,6 @@ function dcsSeoPlugin(options = {}) {
2301
2301
  }
2302
2302
  };
2303
2303
  }
2304
-
2305
- // src/plugins/dcsEditorPlugin.ts
2306
2304
  var PORTAL_ORIGIN_ENV = "VITE_DCS_PORTAL_ORIGIN";
2307
2305
  function editorBridgeModuleSource(portalOrigin) {
2308
2306
  const literal = portalOrigin === void 0 ? "undefined" : JSON.stringify(String(portalOrigin));
@@ -2319,6 +2317,34 @@ if (window.parent !== window) {
2319
2317
  }
2320
2318
  `;
2321
2319
  }
2320
+ var CONTENT_LOADER_ID = /\.data\.[cm]?[jt]s(?:$|\?)/;
2321
+ function isContentLoaderId(id) {
2322
+ return CONTENT_LOADER_ID.test(id);
2323
+ }
2324
+ function isInside(dir, file) {
2325
+ const rel = path7.relative(dir, file);
2326
+ return rel !== "" && !rel.startsWith("..") && !path7.isAbsolute(rel);
2327
+ }
2328
+ function invalidateContentLoadersOnChange(server) {
2329
+ const root = path7.resolve(server.config.root || process.cwd());
2330
+ const dcsDirs = [.../* @__PURE__ */ new Set([
2331
+ path7.resolve(root, ".dcs"),
2332
+ path7.resolve(root, "..", ".dcs"),
2333
+ path7.resolve(process.cwd(), ".dcs")
2334
+ ])].filter((dir) => fs8.existsSync(dir));
2335
+ for (const dir of dcsDirs) {
2336
+ if (!isInside(root, dir)) server.watcher.add(dir);
2337
+ }
2338
+ const scopes = [root, ...dcsDirs];
2339
+ const onFile = (file) => {
2340
+ const abs = path7.resolve(file);
2341
+ if (!scopes.some((dir) => isInside(dir, abs))) return;
2342
+ for (const [id, mod] of server.moduleGraph.idToModuleMap) {
2343
+ if (isContentLoaderId(id)) server.moduleGraph.invalidateModule(mod);
2344
+ }
2345
+ };
2346
+ for (const event of ["change", "add", "unlink"]) server.watcher.on(event, onFile);
2347
+ }
2322
2348
  function dcsEditorPlugin(options = {}) {
2323
2349
  const { debug = false } = options;
2324
2350
  const VIRTUAL_PATH = "/__dcs-editor-bridge.js";
@@ -2346,6 +2372,13 @@ function dcsEditorPlugin(options = {}) {
2346
2372
  isPreview = process.env.DCS_PREVIEW === "true";
2347
2373
  portalOrigin = config2.env?.[PORTAL_ORIGIN_ENV];
2348
2374
  },
2375
+ // Dev server only (Vite never calls configureServer for a build or for
2376
+ // `vite preview`). Active only in the DCS preview with HMR off; with HMR on,
2377
+ // VitePress refreshes its loaders from handleHotUpdate itself.
2378
+ configureServer(server) {
2379
+ if (process.env.DCS_PREVIEW !== "true" || server.config.server.hmr !== false) return;
2380
+ invalidateContentLoadersOnChange(server);
2381
+ },
2349
2382
  resolveId(id) {
2350
2383
  if (id === VIRTUAL_PATH || id === RIBBON_VIRTUAL_PATH) {
2351
2384
  return id;