@riebeckite/plugin-local-graph 0.0.13 → 0.0.15

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/README.md CHANGED
@@ -81,6 +81,6 @@ internal selection key `/explore?note=<slug>`.
81
81
 
82
82
  ## See also
83
83
 
84
- - [Plugin guide](../../../docs/en/reference/plugin-api.md)
84
+ - [Plugin guide](../../../docs/en/docs/reference/plugin-api.md)
85
85
  - [`@riebeckite/plugin-backlinks`](../backlinks/README.md)
86
- - [`@riebeckite/plugin-garden-explorer`](../garden-explorer/README.md)
86
+ - [`@riebeckite/plugin-garden-explorer`](../garden-explorer/README.md)
package/README_ja.md CHANGED
@@ -37,6 +37,7 @@ return <Article footerContent={graph && <LocalGraph graph={graph} />} />;
37
37
 
38
38
  ## 関連資料
39
39
 
40
- - [プラグインシステム](../../../docs/ja/reference/plugin-api.md)
40
+ - [プラグインシステム](../../../docs/ja/docs/reference/plugin-api.md)
41
41
  - [`@riebeckite/plugin-backlinks`](../backlinks/README_ja.md)
42
42
  - [`@riebeckite/plugin-garden-explorer`](../garden-explorer/README_ja.md)
43
+
package/dist/index.js CHANGED
@@ -129,14 +129,14 @@ function LocalGraph(props) {
129
129
  }
130
130
 
131
131
  // src/local-graph.server.ts
132
- import {
133
- isPublished
134
- } from "@riebeckite/core";
135
132
  var MAX_NEIGHBORS_PER_DIRECTION = 10;
136
133
  function getLocalGraph(args) {
137
134
  const graph = args.manifest.graph;
138
135
  const current = graph.get(args.slug);
139
- if (!current || !isPublished(args.config, current.frontmatter)) return null;
136
+ const discoverableSlugs = new Set(
137
+ args.manifest.discoverableEntries.map((entry) => entry.slug)
138
+ );
139
+ if (!current || !discoverableSlugs.has(current.slug)) return null;
140
140
  const { outgoingSlugs, incomingSlugs } = graph.filterNeighbors(
141
141
  args.slug,
142
142
  isPublishedSlug
@@ -154,7 +154,7 @@ function getLocalGraph(args) {
154
154
  return { currentSlug: args.slug, nodes };
155
155
  function isPublishedSlug(nodeSlug) {
156
156
  const entry = graph.get(nodeSlug);
157
- return entry !== null && isPublished(args.config, entry.frontmatter);
157
+ return entry !== null && discoverableSlugs.has(entry.slug);
158
158
  }
159
159
  function toLocalGraphNode(nodeSlug, currentSlug, outgoingSlugs2, backlinkSlugs) {
160
160
  const entry = graph.get(nodeSlug);
@@ -1,4 +1,4 @@
1
- import { type ContentManifest, type ResolvedRiebeckiteConfig } from "@riebeckite/core";
1
+ import type { ContentManifest, ResolvedRiebeckiteConfig } from "@riebeckite/core";
2
2
  import type { LocalGraphData } from "./local-graph.js";
3
3
  type TitleResolver = (slug: string, title: unknown) => string;
4
4
  export declare function getLocalGraph(args: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-local-graph",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "hono": "^4.12.25",
25
- "@riebeckite/core": "0.0.13"
25
+ "@riebeckite/core": "0.0.15"
26
26
  },
27
27
  "devDependencies": {
28
28
  "tsx": "^4.22.4",
29
- "@riebeckite/test": "0.0.13"
29
+ "@riebeckite/test": "0.0.15"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"