build: depend on @apexdevtools/apex-log-parser - #1068
Open
lukecotter wants to merge 2 commits into
Open
lukecotter wants to merge 2 commits into
lukecotter wants to merge 2 commits into
Conversation
Delete the in-repo apex-log-parser and depend on the published package. Runtime comes from the root export, types and consts from the /types subpath. GovernorLimits no longer carries the metrics flat, so the reads move under final, and heapSize under peak to mirror what the old flat field meant. Every one of them takes the ceiling, and nothing reads used. The parser folds the same snapshots into both sides with Math.max, so the two state the same ceiling and no displayed number moves. ApexLog.debugLevels is a record now, so LogLevels carries the key-to-token map the parser keeps private and the chips read as before. Jest maps the package to its files: it is ESM-only and publishes no require condition, and widening the export conditions pulls every other dependency's ESM build in with it. The jsdom setup lends the parser a TextEncoder.
limitValue stood in three places after the parser swap. logOverviewMetrics exports it now, and limitTotals and the test helper both call it. governorLimits takes peak as a second argument, defaulting to final, so a test that needs them to differ is not locked out of the helper. AGENTS.md pointed at a pnpm link:parser script that does not exist yet. Two doc comments had ended up above the wrong declaration.
15 tasks
lcottercertinia
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 PR Overview
The parser now ships as
@apexdevtools/apex-log-parser,released from apex-dev-tools/apex-log-parser.
This deletes the in-repo copy and depends on
0.1.1, so one parser serves every consumer and itsfixes arrive by version bump.
Adoption only — no behaviour change, and no new parser capability is used yet. The published API
had moved on from the local copy, so absorbing that drift is most of the diff.
🛠️ Changes made
apex-log-parser/and depend on@apexdevtools/apex-log-parser@0.1.1fromlana/,log-viewer/and the root (scripts/measureresolves from there).consts on
/types.GovernorLimitsno longer carries the metrics flat, so reads move underfinal, andheapSizeunder
peakto mirror what the old flat field meant. Every one takes the ceiling and nothingreads
used. See the correction below on what this does and does not preserve.ApexLog.debugLevelsis a record now, soLogLevelsmaps its keys back to the log's own tokensand the chips read as before.
pathsin threeconfigs, a jest project and two
moduleNameMapperentries, a rolldown alias, fourallowDefaultProjectentries, and the CI matrix entry.requirecondition, which iswhat jest's CJS runtime asks for; widening the export conditions instead pulls every other
dependency's ESM build in with it. The jsdom setup lends the parser a
TextEncoder.limitValuestood in three places after the swap —logOverviewMetricsexportsit now and both production and the test helper call it.
🧩 Type of change (check all applicable)
📷 Screenshots / gifs / video [optional]
None — nothing user-visible changes.
🔗 Related Issues
None.
✅ Tests added?
No behaviour changes, so no new tests. The parser's own four test files leave with it; all four
exist upstream in
src/__tests__/, alongside six more. The suites that cover the consumers allstill run: 2479 tests across 184 suites.
📚 Docs updated?
No user-visible change, so no CHANGELOG entry.
AGENTS.mdand.claude/rules/log-viewer.mdareupdated, since both described the deleted package.
Anything else we need to know? [optional]
Verified:
pnpm lintclean · 2479 tests in 184 suites ·pnpm buildemits all three bundles ·pnpm run measureparses a 19MB log in 260ms ·pnpm run ci:installvalidates the lockfile from anempty
node_modules.Lockfile churn is larger than the change. Only
@apexdevtools/apex-log-parser@0.1.1is a realaddition; the rest is pnpm 10.34.5 rewriting peer-dependency hashes against a lockfile written by an
older pnpm.
lockfileVersionis unchanged and--frozen-lockfilepasses, so anyone's next installwould produce the same.
Two things seen in passing, not fixed here.
Timeline.tsdivides SOSL rows by the SOSL querylimit —
eventText.tsanddatabase/limits.tsboth do it correctly. And the version is pinned inthree manifests with no pnpm catalog, so bumping two of the three would leave
scripts/measurebenchmarking a different parser than the extension ships, silently.
Correction to an earlier claim in this PR. It previously said the reshape moves no displayed
number, because "the parser folds the same snapshots into both sides with
Math.max, so the twostate the same ceiling". Both halves are wrong, verified against the published parser:
final.X.limit === peak.X.limitis not an invariant.byNamespacetakes each namespace'slast snapshot as its
finalwith no max-fold, whilepeakaccumulates the highest ceilingseen. A
LIMIT_USAGE_FOR_NSblock cut short by truncation makes them diverge — reproduced witha truncated second block:
On such a log Heap keeps a denominator while SOQL/DML/CPU lose theirs. Not a regression —
mainalso took the last block's value and showed 0 for all four — but the stated reason was wrong,
and it matters if anything later moves a read between
finalandpeak.One displayed number does move. The old ceiling was the last namespace in iteration order;
the new one is
Math.maxacross namespaces. On a log where a managed package has a higherceiling than
(default), the Heap denominator changes. Reproduced:(default)6000000 plus(mypkg)12000000 now yields 12000000 in either block order, where the old value depended onwhich came last. The new value is at least order-independent, but it is still the wrong ceiling
for default-namespace rows — the known ✨ feat(database): per-namespace governor limits / overall limit view (certified managed packages) #862, whose explanatory comment left with the deleted
file.
Nothing reads
.usedoff aGovernorLimitsanywhere inlog-viewer/srcorscripts, which waschecked by grep over every read site and is the part of the original claim that holds.
scripts/measurenow benchmarks the published parser, not parser source — the rolldown aliasthat pointed at
apex-log-parser/srcis gone. Parse numbers either side of this PR are notstrictly comparable, and a parser-side change can no longer be measured locally without publishing.
Known upstream behaviour change. The published parser validates debug categories against a fixed
map and reports an unknown one through
parsingErrors, which we surface as a notification. WhenSalesforce adds a category, a log that opens cleanly today will lose that chip and show an error.
Raised upstream.