Skip to content

Task 012: Split util.ts into frontend and backend modules - #22

Merged
Igloczek merged 2 commits into
masterfrom
task/012-split-util-ts
Jun 30, 2026
Merged

Igloczek merged 2 commits into
masterfrom
task/012-split-util-ts

Conversation

@Igloczek

@Igloczek Igloczek commented Jun 30, 2026 •

Copy link
Copy Markdown
Collaborator

Implements tasks/012-split-util-ts.md from the ponytail audit backlog.

Goal

Stop shipping backend-only code (Logger, jsonata, ANSI colors) in the frontend bundle.

Scope

  • Extract shared constants (monitor status codes, limits) to src/constants.ts or src/util-shared.ts.
  • Move backend-only helpers (Logger, evaluateJsonQuery/jsonata, crypto helpers) to src/util-backend.ts.
  • Keep thin src/util.ts re-exporting shared pieces for backward compatibility, or update imports across backend/frontend.
  • Frontend files import only shared/constants modules.

Acceptance criteria

  • jsonata is not imported from any file under src/components, src/pages, or src/mixins.
  • Logger class is not imported by frontend Vue files.
  • bun run lint passes.
  • bun run build:frontend succeeds.
  • bun run test:backend passes.
  • Frontend bundle size does not increase (optional: compare tmp/dist-stats.html before/after).

Depends on

Task 003 (polyfill() removed).

Verification

bun run lint
bun run build:frontend
bun run test:backend
rg "from \"@/util\"|from '@/util'" src/components src/pages src/mixins
rg "jsonata|class Logger" src/components src/pages src/mixins

Audit reference

Finding #6 — shared util.ts monolith.

@Igloczek

Copy link
Copy Markdown
Collaborator Author

/ponytail-review

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

21 files changed, 816 insertions(+), 811 deletions(-)

@Igloczek
Igloczek force-pushed the task/012-split-util-ts branch from 92c3c00 to 83c04eb Compare June 30, 2026 11:55
Igloczek added 2 commits June 30, 2026 14:04
… modules

Extract monitor status codes and limits to constants.ts, cross-platform
helpers to util-shared.ts, and Logger/jsonata/ANSI colors to util-backend.ts.
Keep util.ts as a thin re-export barrel for backend backward compatibility.
Update frontend imports to use constants and util-shared only.
@Igloczek
Igloczek force-pushed the task/012-split-util-ts branch from 83c04eb to 484d955 Compare June 30, 2026 12:05
@Igloczek
Igloczek merged commit 619ebb5 into master Jun 30, 2026
1 check passed
@Igloczek
Igloczek deleted the task/012-split-util-ts branch June 30, 2026 12:58
Igloczek added a commit that referenced this pull request Aug 8, 2026
Task 012: Split util.ts into frontend and backend modules
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