Skip to content

chore: one declaration per module, one source of defaults - #34

Merged
skjnldsv merged 1 commit into
mainfrom
chore/dead-code
Sep 10, 2026
Merged

skjnldsv merged 1 commit into
mainfrom
chore/dead-code

Conversation

@skjnldsv

Copy link
Copy Markdown
Contributor

lib/custom.d.ts declared a module for every .vue file, which answers for this library's own components too: a component whose real types stop resolving quietly becomes any instead of failing the type check. It also declared *.svg?raw a second time, beside the one in shims.d.ts.

Deleting it outright does not work, and that is the interesting part: what it was actually holding up is vue-material-design-icons, whose types sit beside each component at a path its exports map does not offer, so nothing resolves them under bundler resolution.

lib/views/Viewer.vue(226,24): error TS7016: Could not find a declaration file for module 'vue-material-design-icons/Pencil.vue'

So that package is what is declared now, in the one shims file. Two tests keep it that way: no blanket *.vue, and no module declared in two places.

The rest is smaller. The viewer kept a second set of option defaults that open() replaced with the caller's options anyway, while every read already falls back per option. Both media components reloaded on the file's display name, where two files can carry one name (a version of a file reads as a date, a rename keeps the same node) and the source is what says which bytes to fetch. The empty jsdoc blocks that existed to satisfy jsdoc/require-jsdoc say something now, and the duplicated comment above modalElement() is gone.

Four tests fail without the changes: the two declaration guards and one per media component for the same-name reload. The defaults collapse and the comments are covered by the suite staying green.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

@skjnldsv skjnldsv added status: review Waiting for reviews type: refactor ♻️ Refactor code (not a bug fix, not a feature just refactoring) AI assisted labels Sep 10, 2026
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.65%. Comparing base (4e7c229) to head (e1bdc29).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
lib/components/Images.vue 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   83.34%   84.65%   +1.31%     
==========================================
  Files          36       36              
  Lines        2420     2425       +5     
  Branches      476      491      +15     
==========================================
+ Hits         2017     2053      +36     
+ Misses        399      369      -30     
+ Partials        4        3       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

`custom.d.ts` declared a module for every `.vue` file, which answers for
this library's own components as well: a component whose real types stop
resolving becomes `any` rather than a failed type check. It also
declared `*.svg?raw` a second time, beside the one in `shims.d.ts`. What
it was actually holding up is the icon package, whose types sit at a path
its `exports` map does not offer, so that is what is declared now, in the
one shims file. Two tests keep it that way.

The viewer kept a second set of option defaults, which `open()` then
replaced with whatever the caller passed anyway; the reads already fall
back per option, and the service fills in the rest.

Both media components reloaded on the file's display name. Two files can
carry one name (a version reads as a date, a rename keeps the node) and
the source is what says which bytes to fetch.

The empty jsdoc blocks that were there to satisfy the linter say
something now, and the duplicated comment above `modalElement()` is
gone.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsv merged commit adfc42f into main Sep 10, 2026
17 of 18 checks passed
@skjnldsv
skjnldsv deleted the chore/dead-code branch September 10, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted status: review Waiting for reviews type: refactor ♻️ Refactor code (not a bug fix, not a feature just refactoring)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant