Skip to content

fix: stabilize python module order in typedoc snapshots#75

Merged
vdusek merged 1 commit into
masterfrom
vdusek/stable-typedoc-snapshots
May 26, 2026
Merged

fix: stabilize python module order in typedoc snapshots#75
vdusek merged 1 commit into
masterfrom
vdusek/stable-typedoc-snapshots

Conversation

@vdusek
Copy link
Copy Markdown

@vdusek vdusek commented May 26, 2026

Summary

In DocspecTransformer.transform() the sequential IDs assigned by SymbolIdTracker depend on the order pydoc-markdown's PythonLoader yields modules. That order is filesystem-walk-dependent, so different CI machines produce different module orders and reshuffle every id and target reference in the generated JSON.

Sort the docspec modules by name once at the start of transform() so IDs are assigned deterministically. Per-module member order (which already follows source-code declaration order) is unchanged.

In consumer projects that commit versioned typedoc snapshots (e.g. crawlee-python's website/versioned_docs/version-*/api-typedoc.json), this was producing ~100k-line no-op diffs in every release commit.

Verification

Linked the local plugin into crawlee-python/website and ran pnpm exec docusaurus api:version 99.1 twice on the same HEAD — output is byte-identical. yarn build, yarn type, and yarn lint are clean.

@vdusek vdusek added enhancement New feature or request claude-code-assisted labels May 26, 2026
@vdusek vdusek self-assigned this May 26, 2026
@vdusek vdusek marked this pull request as draft May 26, 2026 08:09
@vdusek vdusek force-pushed the vdusek/stable-typedoc-snapshots branch from d06af53 to 2493802 Compare May 26, 2026 09:16
@vdusek vdusek changed the title fix: shrink versioned typedoc snapshots fix: stabilize python module order in typedoc snapshots May 26, 2026
@vdusek vdusek force-pushed the vdusek/stable-typedoc-snapshots branch from 2493802 to 068dd5d Compare May 26, 2026 09:18
@vdusek vdusek marked this pull request as ready for review May 26, 2026 09:19
@vdusek vdusek requested a review from barjin May 26, 2026 09:19
Copy link
Copy Markdown
Member

@barjin barjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thank you!

@vdusek vdusek merged commit f409bc1 into master May 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants