fix: detect configFiles in subdirectories with deep scan fallback#98
Open
vishalpatel1994 wants to merge 1 commit into
Open
fix: detect configFiles in subdirectories with deep scan fallback#98vishalpatel1994 wants to merge 1 commit into
vishalpatel1994 wants to merge 1 commit into
Conversation
6ee833b to
1f975db
Compare
Previously, configFiles detection only checked the project root using existsSync(join(dir, fileName)). This silently missed Apple platform projects where Package.swift or Podfile live in a subdirectory (e.g. ios/Podfile in React Native, or Packages/DesignSystem/Package.swift in SPM-based projects). Changes: - Add existsDeep() helper that recursively scans subdirectories up to depth 3, skipping SCAN_SKIP_DIRS (node_modules, .git, Pods, etc.) - Wire it into detectTechnologiesInDir() as an automatic fallback: root check runs first (fast), deep scan only runs if root check misses - No API or config changes — existing skills-map.ts entries work as-is - Add 11 new tests (existsDeep unit tests + SwiftUI deep-detection tests) Verified against real CocoaPods projects (SkillCare, Jumper) at all nesting depths — all correctly detected as swiftui without any changes to the calling code.
1f975db to
8d70f43
Compare
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.
What Changed
Added
existsDeep()tolib.ts— a recursive directory scanner that serves as an automatic fallback when the root-levelconfigFilescheck misses.Updated
detectTechnologiesInDir()so thatconfigFilesdetection now:node_modules,.git,Pods, etc.No changes to
skills-map.tsentries or the public API — existing config just works.Why This Change
configFilesdetection previously calledexistsSync(join(dir, fileName)), which only checks the project root. This silently missed real-world Apple platform projects wherePackage.swiftorPodfilelive in a subdirectory:ProjectName/Podfileios/PodfilePackages/DesignSystem/Package.swiftPackage.swift(root)Testing Done
node --test 'tests/*.test.ts')existsDeepunit tests + SwiftUI deep-detection integration testsType of Change
fix:Bug fix (non-breaking — no API or config changes)Security & Quality Checklist
Documentation
No documentation changes needed — this is an internal detection improvement with no public API changes.