Skip to content

refactor: move leaf utilities under internal/ - #650

Merged
moonD4rk merged 1 commit into
refactor/main-v2from
refactor/v2-02-leaf-packages
Oct 26, 2026
Merged

moonD4rk merged 1 commit into
refactor/main-v2from
refactor/v2-02-leaf-packages

Conversation

@moonD4rk

Copy link
Copy Markdown
Owner

Summary

Phase 1 of the internal restructuring: the three packages with no project dependencies move under internal/. Mechanical only — no behavior changes, and the Phase 0 goldens pass unchanged.

  • log → internal/log: moved as is; the name and API stay. 26 files change their import.
  • utils/sqliteutil → internal/sqlitex: moved; the exported API is now CountRows and QueryRows. The row-callback helper behind them (QuerySQLite) had no other caller and becomes the unexported eachRow.
  • internal/timeconv (new): the five timestamp helpers that lived in the browser packages, with their bodies and tests moved verbatim — Chromium (was chromium.timeEpoch), UnixMicro, UnixMilli, Unix (were firefoxMicros/firefoxMillis/firefoxSeconds), and CoreData (was safari.coredataTimestamp). Every conversion keeps today's rule: zero time for non-positive input or a year outside [1, 9999].
  • RFCs: RFC-004 records the timeconv and sqlitex names; RFC-012 Phase 8 and RFC-011 record that, after the switch-over, the compatibility tests move out of cmd/hack-browser-data into the packages they cover, leaving cmd with only the flag-surface test.

The ABE unit is untouched; none of its packages imports the moved code.

Verification

  • go build ./... for darwin, windows, and linux; go vet with the test files for windows and linux; go test ./... on Go 1.20.14, including the compatibility goldens.
  • golangci-lint v2.10.1 reports 0 issues under GOOS=darwin, windows, and linux; gofumpt and goimports are clean.

Checklist

  • Pull request targets the refactor/main-v2 integration branch (main is frozen during the refactor)
  • All CI checks pass (lint, test, build)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • go.mod directive remains go 1.20 (do not bump)

Phase 1: the packages with no project dependencies move first, so every
later phase builds on finished leaves; the goldens pin the behavior.
@moonD4rk
moonD4rk merged commit 9937dbf into refactor/main-v2 Oct 26, 2026
9 checks passed
@moonD4rk
moonD4rk deleted the refactor/v2-02-leaf-packages branch October 26, 2026 08:41
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