@lexibase/rdx-next 5.0.0 → 5.0.1

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/config.mjs CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  createRdxProject,
7
7
  resolveProjectPath,
8
8
  getContentSources,
9
+ snapshotDatesFilename,
9
10
  } from '@lexibase/rdx-core/config'
10
11
  import { createJiti } from 'jiti'
11
12
 
@@ -49,7 +50,9 @@ async function contentFiles(directory) {
49
50
  const filename = path.join(directory, entry.name)
50
51
  if (entry.isDirectory()) return contentFiles(filename)
51
52
  return entry.isFile() &&
52
- (/\.mdx?$/.test(entry.name) || entry.name === '_category.json')
53
+ (/\.mdx?$/.test(entry.name) ||
54
+ entry.name === '_category.json' ||
55
+ entry.name === snapshotDatesFilename)
53
56
  ? [filename]
54
57
  : []
55
58
  })
@@ -75,6 +75,10 @@ import {
75
75
  isFallbackPage
76
76
  } from "@lexibase/rdx-core";
77
77
  import { exportMarkdownBody } from "@lexibase/rdx-core/mdx";
78
+ import {
79
+ createDocumentDateReader,
80
+ getSnapshotDocumentDate
81
+ } from "@lexibase/rdx-core/config";
78
82
  function publicUrl(project, path) {
79
83
  const base = project.config.metadata.metadataBase;
80
84
  return base ? new URL(path, base).href : path;
@@ -186,11 +190,13 @@ function getDocumentMarkdownResponse(project, source, slug, documentPath) {
186
190
  documentPath?.(source, page2) ?? getDocsHref(project, source, page2.slug)
187
191
  );
188
192
  const page = bySlug.get(document.slug);
193
+ const lastUpdated = source.version ? getSnapshotDocumentDate(options.docsDir, document.sourcePath) : createDocumentDateReader(project.rootDir)(document.sourcePath);
189
194
  const frontmatter = {
190
195
  title: page.title,
191
196
  ...page.description ? { description: page.description } : {},
192
197
  url: href(document),
193
- docs_index: publicUrl(project, indexPath(project))
198
+ docs_index: publicUrl(project, indexPath(project)),
199
+ ...lastUpdated ? { lastUpdated } : {}
194
200
  };
195
201
  const fields = Object.entries(frontmatter).map(
196
202
  ([key, value]) => `${key}: ${JSON.stringify(value)}`
@@ -689,7 +695,7 @@ async function DocsPage({
689
695
  /* @__PURE__ */ jsx("h1", { className: "min-w-0 max-w-full break-words text-4xl font-bold uppercase", children: title }),
690
696
  markdownHref && /* @__PURE__ */ jsx(CopyPage, { href: markdownHref }, markdownHref)
691
697
  ] }),
692
- description && /* @__PURE__ */ jsx("p", { className: "text-sm text-ring max-w-[726px]", children: description })
698
+ description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground max-w-[726px]", children: description })
693
699
  ] }),
694
700
  /* @__PURE__ */ jsx("div", { className: "h-full w-full flex-1 max-w-[960px]", children: content })
695
701
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexibase/rdx-next",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "The Next.js runtime for RDX documentation projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -52,8 +52,8 @@
52
52
  "next-mdx-remote": "^6.0.0",
53
53
  "remark-gfm": "^4",
54
54
  "typescript": "6.0.3",
55
- "@lexibase/rdx-types": "2.3.0",
56
- "@lexibase/rdx-core": "3.0.0"
55
+ "@lexibase/rdx-core": "3.0.1",
56
+ "@lexibase/rdx-types": "2.3.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "@lexibase/rdx-ui": "^3.5.0",
@@ -81,7 +81,7 @@
81
81
  "next": "^16.4.2",
82
82
  "react": "19.3.1",
83
83
  "react-dom": "19.3.1",
84
- "@lexibase/rdx-ui": "3.5.0",
84
+ "@lexibase/rdx-ui": "3.5.1",
85
85
  "@rdx/eslint-config": "1.0.0",
86
86
  "@rdx/typescript-config": "1.0.0"
87
87
  },