refactor: single parse/scan, shared CI setup, integration matrix, typecheck tests - #91
Merged
Merged
Conversation
- getPackagesWithInfo is the single Package.resolved parser; toVersionMap projects it for comparePackages (getPackages removed) - scanProject walks the project once and feeds both detectDevPackages and buildDependencyGraph; main.ts runs it lazily, at most once - readTextOrNull replaces five copies of the read-or-skip try/catch - __PACKAGE_VERSION__ comes from vitest's define in tests, dropping the runtime package.json fallback that only existed for tests - tsconfig now typechecks tests/ and vitest.config.ts - drop config that restates defaults (vitest clearMocks, eslint rules already in typescript-eslint recommended) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KSejUgQivg9155whMyU9i5
- new .github/actions/setup (setup-node + npm ci) used by test, lint, release and the build composite action; also aligns the build action on setup-node v7.0.0 - integration + integration-workspace become one matrix job reporting "integration (project)" and "integration (workspace)" Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KSejUgQivg9155whMyU9i5
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #91 +/- ##
==========================================
- Coverage 99.75% 99.73% -0.03%
==========================================
Files 3 3
Lines 408 377 -31
Branches 102 98 -4
==========================================
- Hits 407 376 -31
Partials 1 1 🚀 New features to boost your workflow:
|
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.
Summary
Cleanup from a project-wide
/simplifyreview (reuse, simplification, efficiency, altitude), plus CI consolidation.Code (
src/)Package.resolvedis parsed once (it was parsed up to 5×).getPackagesWithInfois the only parser;toVersionMap()projects it forcomparePackages.getPackagesis removed, anddetectDevPackagesnow takes the resolved identity set instead of a file path (same asbuildDependencyGraph).scanProject()collectsPackage.swiftmanifests andproject.pbxprojclassifications in one pass, and bothdetectDevPackagesandbuildDependencyGraphuse its result.main.tsruns the scan lazily and at most once, so it is skipped entirely when only the SBOM is requested anddevelopment_packagesis given.readTextOrNull()replaces five copies of the read-or-skiptry/catch.__PACKAGE_VERSION__is now set by vitest'sdefinein tests, mirroring esbuild's--define, so the runtimepackage.jsonfallback that only existed for tests is gone.has()+get()!, a redundantSet.addguard, and?? undefined.Config
tsconfig.jsonnow typecheckstests/andvitest.config.ts. They were not checked before; the only error that turned up was a missingDirentimport.clearMocks(default since vitest 5) and ESLint rules already covered bytypescript-eslintrecommended. I diffedeslint --print-configbefore and after, and the effective rules are identical.eslint.config.jsnow usesdefineConfigfromeslint/config.CI
.github/actions/setupcomposite action (setup-node +npm ci), used bytest,lint,releaseand thebuildaction. This also fixes thebuildaction pinning setup-node v6.2.0 while the workflows used v7.0.0.integrationandintegration-workspaceare now a single matrix job. It reportsintegration (project)andintegration (workspace).Intentionally not changed
mainandpost. Removing it frommainwould delay freeing disk space until the end of the job.packageRefs, theplugins:list, brace counting in pbxproj) is a correctness topic for a separate/code-review.withTimeoutgives up waiting after 15s but does not kill thegit ls-remoteprocess. Switching toexecFilewith a timeout needs its own verification on a real runner.Test plan
npm run lint: effective ESLint rules unchangednpm run typecheck: now includestests/npm test: 172 tests pass (3 new: single parse, single scan, no scan for SBOM with an explicit dev list), 100% coveragenpm run buildactionlint: no findings in the changed workflows or actions🤖 Generated with Claude Code
https://claude.ai/code/session_01KSejUgQivg9155whMyU9i5