@lexibase/rdx-core 1.3.0 → 1.4.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.
@@ -441,9 +441,21 @@ async function createRdxProject(input, {
441
441
  }
442
442
  if (source.badge !== void 0)
443
443
  text(source.badge, `content source ${id}.badge`);
444
+ if (source.redirectTo !== void 0)
445
+ text(source.redirectTo, `content source ${id}.redirectTo`);
444
446
  sources.push(source);
445
447
  }
446
448
  }
449
+ for (const source of sources) {
450
+ if (source.redirectTo === void 0) continue;
451
+ const target = sources.find(
452
+ (entry) => entry.routePrefix === source.redirectTo
453
+ );
454
+ if (!target || target === source || target.redirectTo !== void 0 || target.docsDir !== source.docsDir)
455
+ throw new RdxConfigError(
456
+ `content source ${source.id}.redirectTo must reference a canonical source with the same docsDir.`
457
+ );
458
+ }
447
459
  return { rootDir, config, sources, commands, runtimeFiles: [...runtimeFiles] };
448
460
  }
449
461
 
@@ -172,7 +172,12 @@ function remarkDocumentationComponents() {
172
172
  throw new Error("[RDX] Write keyboard keys as :kbd[Ctrl].");
173
173
  const key = label(node.children ?? []);
174
174
  if (!key) throw new Error("[RDX] :kbd[...] requires a key name.");
175
- return component("Kbd", {}, [{ type: "text", value: key }], true);
175
+ return component(
176
+ /\s+\+\s+/.test(key) ? "KeyboardShortcut" : "Kbd",
177
+ {},
178
+ [{ type: "text", value: key }],
179
+ true
180
+ );
176
181
  }
177
182
  if (node.type !== "containerDirective")
178
183
  throw new Error(
@@ -4,7 +4,7 @@ import {
4
4
  defineConfig,
5
5
  resolveConfig,
6
6
  resolveProjectPath
7
- } from "../chunk-ZX6IDGQW.js";
7
+ } from "../chunk-75BDBF5N.js";
8
8
  export {
9
9
  RdxConfigError,
10
10
  createRdxProject,
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  defineConfig,
5
5
  resolveConfig,
6
6
  resolveProjectPath
7
- } from "./chunk-ZX6IDGQW.js";
7
+ } from "./chunk-75BDBF5N.js";
8
8
  import {
9
9
  RdxDocumentLinkError,
10
10
  createDocumentLinkResolver
@@ -159,6 +159,7 @@ function resolveDocsRoute(project, segments = []) {
159
159
  function getProjectDocsPaths(project) {
160
160
  const paths = /* @__PURE__ */ new Set();
161
161
  for (const source of project.sources) {
162
+ if (source.redirectTo !== void 0) continue;
162
163
  for (const slug of getDocsPaths(getSourceOptions(project, source))) {
163
164
  const route = [source.routePrefix, slug].filter(Boolean).join("/");
164
165
  if (paths.has(route))
package/dist/mdx/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-Z6GCGXVC.js";
4
4
  import {
5
5
  remarkDocumentationComponents
6
- } from "../chunk-H2E5IS4E.js";
6
+ } from "../chunk-J7VCQHSL.js";
7
7
 
8
8
  // src/mdx/index.ts
9
9
  import { default as default2 } from "rehype-slug";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  remarkDocumentationComponents
3
- } from "../chunk-H2E5IS4E.js";
3
+ } from "../chunk-J7VCQHSL.js";
4
4
 
5
5
  // src/search/index.ts
6
6
  import GithubSlugger from "github-slugger";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexibase/rdx-core",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Content indexing and document utilities for RDX documentation projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -50,7 +50,7 @@
50
50
  "remark-mdx": "^3.1.1",
51
51
  "remark-parse": "^11.0.0",
52
52
  "unified": "^11.0.5",
53
- "@lexibase/rdx-types": "1.1.1"
53
+ "@lexibase/rdx-types": "1.2.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^22.15.3",