@roottale/cms-renderer-next 0.68.0 → 0.69.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @roottale/cms-renderer-next
2
2
 
3
+ ## 0.69.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 30b830f: 분류 기반 경로에서 선언한 첫 분류 선택, 미분류 대체 경로와 예약 경로를 공통 계산기로 처리합니다. 기존 분류 하나 필수 규칙은 그대로 유지합니다.
8
+
9
+ 공개 필드와 본문에 기반한 콘텐츠 공개·검색 색인 정책 및 목록 선택 계약을 추가합니다. FRONT의 본문, 목록, sitemap과 관리자 메타데이터가 같은 평가기를 사용하며 강제 검색 제외 사유와 정책 전용 웹훅 캐시 무효화를 제공합니다. 정책을 선언하지 않은 연동의 동작은 유지됩니다.
10
+
11
+ 글 조회에 캐시 태그 옵션을 공개하고 RootTaleBlogPost에 독립 categoryHref 속성을 추가해 별도 breadcrumb가 있는 사이트도 분류 링크를 정확히 연결할 수 있습니다. 정책 적용 예제와 공개 문서를 함께 제공합니다.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [30b830f]
16
+ - @roottale/cms-core@0.69.0
17
+ - @roottale/cms-client@0.69.0
18
+
3
19
  ## 0.68.0
4
20
 
5
21
  ### Patch Changes
package/dist/routes.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CmsPostContent, RootTaleRedirect, CmsPostTranslationRef } from '@roottale/cms-client/server';
2
- import { RouteCollection, MetadataRobotsPolicy, MetadataValues, MetadataResolutionInput, RoutablePost } from '@roottale/cms-core';
2
+ import { RouteCollection, ContentPolicy, MetadataRobotsPolicy, MetadataValues, MetadataResolutionInput, RoutablePost } from '@roottale/cms-core';
3
3
  export { RouteCollection, normalizeRedirectPath, resolvePostCollection, resolvePostUrl } from '@roottale/cms-core';
4
4
  import { B as BlogCategoryWithCount } from './blog-filter-CS4GZws8.js';
5
5
  export { m as makeCategoryHref } from './blog-filter-CS4GZws8.js';
@@ -230,6 +230,11 @@ interface RevalidateRouteConfig {
230
230
  * 한다 — 쓰지 마라.
231
231
  */
232
232
  revalidateTag?: (tag: string) => void | Promise<void>;
233
+ /**
234
+ * The same metadata.posts.contentPolicies declaration used to evaluate public content.
235
+ * Requires revalidateTag with immediate expiry; tag policy fact fetches with CONTENT_POLICY_CACHE_TAG.
236
+ */
237
+ contentPolicies?: Readonly<Record<string, ContentPolicy>>;
233
238
  /** 테마 fetch 캐시 tag 이름. 기본 "rt-theme"(cms-client `THEME_CACHE_TAG`). */
234
239
  themeTag?: string;
235
240
  /** 블로그 base path. 기본 "/blog". */
package/dist/routes.js CHANGED
@@ -585,6 +585,8 @@ function createLlmsTxtRoute(config) {
585
585
 
586
586
  // src/routes-revalidate.ts
587
587
  import {
588
+ CONTENT_POLICY_CACHE_TAG,
589
+ METADATA_CACHE_TAG,
588
590
  SETTINGS_CACHE_TAGS,
589
591
  THEME_CACHE_TAG
590
592
  } from "@roottale/cms-client/server";
@@ -640,6 +642,10 @@ function modelPathMismatch(body, collections) {
640
642
  return !body.paths.some((p) => p === base || p.startsWith(`${base}/`));
641
643
  }
642
644
  function createRevalidateRoute(config) {
645
+ const hasContentPolicies = config.contentPolicies !== void 0;
646
+ if (hasContentPolicies && !config.revalidateTag) {
647
+ throw new Error("contentPolicies requires revalidateTag with immediate expiry");
648
+ }
643
649
  const blogBase = config.blogBasePath ?? "/blog";
644
650
  const maxBodyBytes = config.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES;
645
651
  const INVARIANTS = [
@@ -686,7 +692,8 @@ function createRevalidateRoute(config) {
686
692
  const requestedTags = [
687
693
  .../* @__PURE__ */ new Set([
688
694
  themeTag,
689
- ...SETTINGS_CACHE_TAGS.filter((t) => t !== THEME_CACHE_TAG)
695
+ ...SETTINGS_CACHE_TAGS.filter((t) => t !== THEME_CACHE_TAG),
696
+ ...hasContentPolicies ? [CONTENT_POLICY_CACHE_TAG] : []
690
697
  ])
691
698
  ];
692
699
  const paths2 = result.event === "taxonomy.updated" ? [.../* @__PURE__ */ new Set([...parsed.paths, ...INVARIANTS, ...config.alsoRevalidate ?? []])] : parsed.paths;
@@ -765,6 +772,10 @@ function createRevalidateRoute(config) {
765
772
  pathCount: parsed.paths.length
766
773
  });
767
774
  }
775
+ if (hasContentPolicies && config.revalidateTag && (isPostEvent(result.event) || result.event.startsWith("media.") || result.event === "metadata.updated")) {
776
+ await config.revalidateTag(CONTENT_POLICY_CACHE_TAG);
777
+ await config.revalidateTag(METADATA_CACHE_TAG);
778
+ }
768
779
  let related = [];
769
780
  if (config.relatedPaths && isPostEvent(result.event)) {
770
781
  try {
@@ -1136,7 +1147,7 @@ function createFleetInfoRoute(config = {}) {
1136
1147
  site: config.site ?? env.VERCEL_PROJECT_PRODUCTION_URL ?? null,
1137
1148
  framework: "next",
1138
1149
  cms_client: CMS_CLIENT_VERSION,
1139
- cms_renderer: true ? "0.68.0" : "dev",
1150
+ cms_renderer: true ? "0.69.0" : "dev",
1140
1151
  build_sha: env.VERCEL_GIT_COMMIT_SHA?.slice(0, 7) ?? null,
1141
1152
  ...config.exposures ? { exposures: config.exposures } : {}
1142
1153
  },