@riebeckite/plugin-rename 0.0.14 → 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
@@ -120,4 +120,5 @@ Types:
120
120
  ## See also
121
121
 
122
122
  - [Permalink plugin](../permalink/README.md) — stable URLs and `redirect_from`
123
- - [Plugin guide](../../../docs/en/reference/plugin-api.md)
123
+ - [Plugin guide](../../../docs/en/docs/reference/plugin-api.md)
124
+
package/README_ja.md CHANGED
@@ -100,4 +100,5 @@ buildRouteLock ──► 現在の RouteLock
100
100
  ## 関連
101
101
 
102
102
  - [Permalink プラグイン](../permalink/README_ja.md) — 安定した URL と `redirect_from`
103
- - [プラグインガイド](../../../docs/ja/reference/plugin-api.md)
103
+ - [プラグインガイド](../../../docs/ja/docs/reference/plugin-api.md)
104
+
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  // index.ts
2
2
  import {
3
- definePlugin,
4
- isPublished
3
+ definePlugin
5
4
  } from "@riebeckite/core";
6
5
 
7
6
  // src/lock.ts
@@ -16,10 +15,9 @@ function emptyRouteLock() {
16
15
  function isRedirectStatus(value) {
17
16
  return value === 301 || value === 302 || value === 307 || value === 308;
18
17
  }
19
- function buildRouteLock(entries, isPublished2) {
18
+ function buildRouteLock(entries) {
20
19
  const routes = {};
21
20
  for (const entry of entries) {
22
- if (!isPublished2(entry.frontmatter)) continue;
23
21
  const id = readId(entry.frontmatter);
24
22
  routes[entry.slug] = id ? { permalink: entry.permalink, contentHash: hashContent(entry.html), id } : { permalink: entry.permalink, contentHash: hashContent(entry.html) };
25
23
  }
@@ -243,10 +241,7 @@ function renamePlugin(options = {}) {
243
241
  return;
244
242
  }
245
243
  const previous = await readLock(cache, logger);
246
- const current = buildRouteLock(
247
- manifest.entries,
248
- (frontmatter) => isPublished(config, frontmatter)
249
- );
244
+ const current = buildRouteLock(manifest.publicEntries);
250
245
  const result = diffRoutes(previous, current, {
251
246
  status,
252
247
  onUnexpectedRemoval
@@ -34,8 +34,8 @@ export type DiffRoutesOptions = {
34
34
  };
35
35
  /**
36
36
  * Minimal shape `buildRouteLock` reads from a content manifest entry. Only
37
- * published entries should reach this function; the caller supplies the
38
- * publish predicate so this module stays free of any runtime Core import.
37
+ * routable entries should reach this function so this module stays free of any
38
+ * runtime Core import.
39
39
  */
40
40
  export type RouteLockSourceEntry = {
41
41
  slug: string;
@@ -47,11 +47,11 @@ export declare function hashContent(html: string): string;
47
47
  export declare function emptyRouteLock(): RouteLock;
48
48
  export declare function isRedirectStatus(value: unknown): value is RedirectStatus;
49
49
  /**
50
- * Builds the current route lock from manifest entries. Entries are keyed by
51
- * slug and only published entries are considered. Output is deterministic:
50
+ * Builds the current route lock from the routed manifest view. Entries are keyed by
51
+ * slug and only routable entries are considered. Output is deterministic:
52
52
  * route keys are sorted and redirects (always empty here) stay sorted.
53
53
  */
54
- export declare function buildRouteLock(entries: readonly RouteLockSourceEntry[], isPublished: (frontmatter: Record<string, unknown>) => boolean): RouteLock;
54
+ export declare function buildRouteLock(entries: readonly RouteLockSourceEntry[]): RouteLock;
55
55
  /**
56
56
  * Parses a persisted lock. Returns `undefined` when the value is corrupt or
57
57
  * uses an unknown format, so callers can fall back to an empty lock.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-rename",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -14,7 +14,7 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@riebeckite/core": "0.0.14"
17
+ "@riebeckite/core": "0.0.15"
18
18
  },
19
19
  "devDependencies": {
20
20
  "tsx": "^4.22.4"