Introduce pkl-doc model version 2 (#1169)

Currently, in order to update a pkl-doc documentation site,
almost the entire existing site is read in order to update metadata
like known versions, known subtypes, and more.

For example, adding a new version of a package requires that the
existing runtime data of all existing versions be updated.
Eventually, this causes the required storage size to balloon
exponentially to the number of versions.

This addresses these limitations by:

1. Updating the runtime data structure to move "known versions" metadata
   to the package level (the same JSON file is used for all versions).
2. Eliminating known subtype and known usage information at a
   cross-package level.
3. Generating the search index by consuming the previously generated
   search index.
4. Generating the main page by consuming the search index.

Because this changes how runtime data is stored, an existing docsite
needs to be migrated.

This also introduces a new migration command, `pkl-doc --migrate`,
which transforms an older version of the website into a newer version.
This commit is contained in:
Daniel Chao
2025-09-29 16:10:44 -07:00
committed by GitHub
parent 63f89fb679
commit 5d90cf8f4e
1599 changed files with 129992 additions and 581 deletions

View File

@@ -60,6 +60,7 @@ val relocations =
// pkl-doc dependencies
"org.commonmark." to "org.pkl.thirdparty.commonmark.",
"org.jetbrains." to "org.pkl.thirdparty.jetbrains.",
"_COROUTINE." to "org.pkl.thirdparty.kotlinx._COROUTINE.",
// pkl-config-java dependencies
"io.leangen.geantyref." to "org.pkl.thirdparty.geantyref.",
@@ -99,6 +100,8 @@ tasks.shadowJar {
exclude("META-INF/maven/**")
exclude("META-INF/upgrade/**")
exclude("DebugProbesKt.bin")
val info = project.extensions.getByType<BuildInfo>()
val minimumJvmTarget = JavaVersion.toVersion(info.jvmTarget)