@uniweb/unipress 0.2.6 → 0.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/unipress",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Compile a content directory into a document (PDF, EPUB, Paged.js HTML, Typst source bundle, DOCX, XLSX) using a Uniweb foundation. Five built-in templates: book, monograph, report, data-report, directory.",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -49,14 +49,15 @@
49
49
  "prompts": "^2.4.2",
50
50
  "react": "^18.0.0 || ^19.0.0",
51
51
  "react-dom": "^18.0.0 || ^19.0.0",
52
- "@uniweb/build": "0.11.5",
53
- "@uniweb/content-reader": "1.1.7",
54
- "@uniweb/runtime": "0.8.7",
55
- "@uniweb/semantic-parser": "1.1.14",
56
- "@uniweb/core": "0.7.6"
52
+ "@uniweb/content-reader": "1.1.8",
53
+ "@uniweb/runtime": "0.8.9",
54
+ "@uniweb/core": "0.7.8",
55
+ "@uniweb/semantic-parser": "1.1.15",
56
+ "@uniweb/build": "0.11.7"
57
57
  },
58
58
  "scripts": {
59
59
  "test": "echo \"no tests yet\" && exit 0",
60
- "lint": "echo \"no lint yet\" && exit 0"
60
+ "lint": "echo \"no lint yet\" && exit 0",
61
+ "audit:docs": "node scripts/audit-documents.js"
61
62
  }
62
63
  }
@@ -30,26 +30,6 @@ import { readFile } from 'node:fs/promises'
30
30
  import { initPrerender } from '@uniweb/runtime/ssr'
31
31
  import { FoundationResolutionError, CompileError } from './errors.js'
32
32
 
33
- // `buildXrefRegistry` is a recent addition to @uniweb/build/content
34
- // (cross-references milestone). Older published versions don't expose
35
- // it; the dynamic resolver below falls back to a no-op registry so the
36
- // pipeline keeps working against any installed version. Once the build
37
- // package republishes with the new export, the real registry kicks in
38
- // automatically — no code change required.
39
- let _buildXrefRegistry = null
40
- async function getBuildXrefRegistry() {
41
- if (_buildXrefRegistry !== null) return _buildXrefRegistry
42
- try {
43
- const mod = await import('@uniweb/build/content')
44
- _buildXrefRegistry = typeof mod.buildXrefRegistry === 'function'
45
- ? mod.buildXrefRegistry
46
- : () => ({ entries: {} })
47
- } catch {
48
- _buildXrefRegistry = () => ({ entries: {} })
49
- }
50
- return _buildXrefRegistry
51
- }
52
-
53
33
  export async function importFoundation(resolvedPath) {
54
34
  try {
55
35
  return await import(pathToFileURL(resolvedPath).href)
@@ -70,21 +50,13 @@ export function initOrchestrator({ content, foundation, extensions = [], onProgr
70
50
  // or throws (the caller decides whether to surface as fatal or attached
71
51
  // to the inspect dump).
72
52
  //
73
- // Cross-reference registry is built here, after the foundation imports
74
- // so any foundation-declared `xref.kinds` participate in id-collection.
75
- // Built-in kinds (figure / equation / section / table) work without
76
- // foundation cooperation; foundation extensions land alongside.
53
+ // Cross-reference registry construction is no longer driven from here.
54
+ // The runtime's `initPrerender` calls `foundation.xref.build(website)`
55
+ // when the foundation declares the build hook (see runtime/src/ssr-
56
+ // renderer.js). Foundations that don't declare `xref:` get nothing
57
+ // extra — kit's xref module is tree-shaken out of their bundle.
77
58
  export async function loadAndInit({ content, resolvedPath, extensions = [], onProgress } = {}) {
78
59
  const foundation = await importFoundation(resolvedPath)
79
-
80
- const foundationKinds =
81
- foundation?.default?.capabilities?.xref?.kinds ||
82
- foundation?.default?.xref?.kinds ||
83
- foundation?.xref?.kinds ||
84
- {}
85
- const buildXrefRegistry = await getBuildXrefRegistry()
86
- content.xref = buildXrefRegistry(content, { foundationKinds })
87
-
88
60
  const uniweb = initOrchestrator({ content, foundation, extensions, onProgress })
89
61
  return { foundation, uniweb }
90
62
  }