Skip to content

Task 036: Shrink remaining src/util micro-helpers - #35

Merged
Igloczek merged 1 commit into
masterfrom
task/036-shrink-remaining-util-helpers
Jun 30, 2026
Merged

Igloczek merged 1 commit into
masterfrom
task/036-shrink-remaining-util-helpers

Conversation

@Igloczek

@Igloczek Igloczek commented Jun 30, 2026 •

Copy link
Copy Markdown
Collaborator

Implements tasks/036-shrink-remaining-util-helpers.md from the ponytail audit backlog.

Goal

Inline or delete small util modules not covered by Task 008.

Scope

  • jwt-decode.ts — keep as 5-line inline at sole call site or merge into jwt.ts.
  • event-emitter.ts — replace with EventTarget or inline if single caller.
  • password-strength.ts — inline 15-line check at setup form.
  • version-compare.ts — use Bun.semver on server; keep minimal compare where needed on frontend.
  • random-id.ts — use crypto.randomUUID() if alphabet constraints allow.
  • Delete files after migration; update tests.

Acceptance criteria

  • At least 4 of the 5 listed files deleted.
  • src/util/ total LOC reduced by ≥100 vs pre-task count.
  • bun run lint passes.
  • bun run test:backend passes.

Depends on

Task 012 (util split clarifies what stays shared).

Verification

bun run lint
bun run test:backend
wc -l src/util/*.ts
rg "jwt-decode|event-emitter|password-strength|version-compare|random-id" src

Audit reference

Finding #16 (extended) — remaining src/util/* helpers.

@Igloczek

Copy link
Copy Markdown
Collaborator Author

/ponytail-review

Deletion/simplification pass aligned with task scope. No speculative abstractions added.

14 files changed, 163 insertions(+), 232 deletions(-)

@Igloczek
Igloczek force-pushed the task/036-shrink-remaining-util-helpers branch from 2c216be to db3271e Compare June 30, 2026 12:01
Inline or replace the five leftover util modules at their call sites:
- jwt-decode → inline JWT payload decode in socket mixin
- event-emitter → native EventTarget in socket mixin
- password-strength → local helper in server.ts and reset-password.ts
- version-compare → Bun.semver on server, minimal compare in Layout.vue
- random-id → crypto.randomUUID() hex secret for API keys

Deletes all five util files (206 LOC reduction in src/util).
@Igloczek
Igloczek force-pushed the task/036-shrink-remaining-util-helpers branch from db3271e to d95c42d Compare June 30, 2026 12:08
@Igloczek
Igloczek merged commit 633c515 into master Jun 30, 2026
1 check passed
@Igloczek
Igloczek deleted the task/036-shrink-remaining-util-helpers branch June 30, 2026 12:59
Igloczek added a commit that referenced this pull request Aug 8, 2026
…elpers

Task 036: Shrink remaining src/util micro-helpers
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