Skip to content

refactor(core): demote unused pub items to pub(crate)#42

Merged
lostmygithubaccount merged 1 commit into
mainfrom
agent3/pub-audit
Apr 13, 2026
Merged

refactor(core): demote unused pub items to pub(crate)#42
lostmygithubaccount merged 1 commit into
mainfrom
agent3/pub-audit

Conversation

@lostmygithubaccount
Copy link
Copy Markdown
Member

Summary

Tightens the draw-core public surface. Demotes items that no workspace consumer (draw-cli, draw-app, draw-webapp, draw-wasm, draw-py), integration test, or example references.

Demoted to `pub(crate)`

  • geometry::ARROWHEAD_LENGTH, ARROWHEAD_ANGLE, HACHURE_LINE_WIDTH
  • geometry::normalize_bounds, compute_arrowhead, generate_hachure_lines
  • geometry::ArrowheadPoints, HachureLine (structs + fields)
  • point::Bounds::from_points (used by hit_test, element only)

Intentionally kept `pub`

  • Point::distance_to, Bounds::intersects — natural geometry-vocabulary helpers on already-public structs; unused in-workspace but plausibly useful to external consumers.
  • geometry::ConnectionPoint, connection_points, find_nearest_snap_point — consumed by draw-wasm (snap-to-shape arrow binding).
  • storage::storage_dir — consumed by draw-webapp.
  • All DEFAULT_* style constants — re-exported by draw-cli on crates.io.

Note on semver

This tightens the public API, which under semver is a breaking change for any third-party crate using the demoted items directly. For a 0.x.y crate the convention is to bump the minor (0.2.1 → 0.3.0) at the next release; the [Unreleased] section of CHANGELOG.md will accumulate this change alongside clippy/gallery work until a version bump PR lands.

Test plan

  • rg -l <symbol> across consumer crates + tests + examples for every demoted item: zero references.
  • bin/check green (rust + python + clippy + wasm-pack build all pass).

🤖 Generated with Claude Code

…rate)

Demotes items in draw-core that are not referenced by any workspace
consumer (draw-cli, draw-app, draw-webapp, draw-wasm, draw-py),
integration tests, or examples:

  geometry.rs:
    ARROWHEAD_LENGTH, ARROWHEAD_ANGLE, HACHURE_LINE_WIDTH  (constants)
    normalize_bounds, compute_arrowhead, generate_hachure_lines
    ArrowheadPoints, HachureLine  (helper structs + fields)

  point.rs:
    Bounds::from_points  (used internally by hit_test/element only)

Intentionally kept pub despite being unused internally: Point::distance_to
and Bounds::intersects — these are natural public-surface helpers on
already-public structs; the compiler dead-code lint is satisfied by their
cfg(test) call sites and we'd rather keep a reasonable geometry vocabulary
available to external consumers than drop useful primitives.

Intentionally kept pub because they are used externally:
  geometry::ConnectionPoint, connection_points, find_nearest_snap_point
    (draw-wasm)
  storage::storage_dir (draw-webapp)
  all DEFAULT_* style constants (re-exported by draw-cli)

No behavior change; API-surface tightening only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount merged commit 9052f0a into main Apr 13, 2026
1 check passed
@lostmygithubaccount lostmygithubaccount deleted the agent3/pub-audit branch April 13, 2026 05:17
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Bumps all Rust crates and the Python package from 0.2.1 to 0.3.0. This
minor bump reflects one breaking change in the dkdc-draw-core public API
surface (pub -> pub(crate) demotions in #42), accumulated with the
non-breaking work from this cycle:

  - #35: arrow snap-to-shape connection points
  - #36: CONTRIBUTING.md + README badges
  - #37: integration tests for draw-core public API
  - #38: Rust + Python hello-world examples
  - #39: CHANGELOG.md scaffolding
  - #40: surgical clippy opt-ins workspace-wide
  - #41: sample gallery (5 drawings × json/svg/png)
  - #42: pub -> pub(crate) demotions (BREAKING)
  - #43: Python test coverage 5 -> 27

See CHANGELOG.md for the 0.3.0 section and migration notes for the
demoted symbols.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount mentioned this pull request Apr 13, 2026
4 tasks
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Bumps all Rust crates and the Python package from 0.2.1 to 0.3.0. This
minor bump reflects one breaking change in the dkdc-draw-core public API
surface (pub -> pub(crate) demotions in #42), accumulated with the
non-breaking work from this cycle:

  - #35: arrow snap-to-shape connection points
  - #36: CONTRIBUTING.md + README badges
  - #37: integration tests for draw-core public API
  - #38: Rust + Python hello-world examples
  - #39: CHANGELOG.md scaffolding
  - #40: surgical clippy opt-ins workspace-wide
  - #41: sample gallery (5 drawings × json/svg/png)
  - #42: pub -> pub(crate) demotions (BREAKING)
  - #43: Python test coverage 5 -> 27

See CHANGELOG.md for the 0.3.0 section and migration notes for the
demoted symbols.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant