Uh oh!
There was an error while loading. Please reload this page.
feat(lib): add NonEmptyArray helper, tighten preferredRunner - #125
Conversation
Stack: init-skills Part of a stacked PR chain. Do not merge manually. |
47dc327 to
21072f9Compare26405f7 to
1e94859Compare21072f9 to
d52abd4Compare670617f to
10da1dbCompare133bd4a to
ecae3c7Comparea4185bb to
a45b262Compareecae3c7 to
3f687c8Comparea45b262 to
c95a429Compare207adbd to
dcb4afaComparec95a429 to
79d474fComparedcb4afa to
d700db1Compare08653a1 to
a8903e7Compare0262797 to
523c58aComparea8903e7 to
190c5d5Compare523c58a to
3a3375eCompare190c5d5 to
09c9f9bCompare3a3375e to
f7ab840Compare09c9f9b to
59ca3dbCompare59ca3db to
5f34cb8Compare5f34cb8 to
b30a809CompareNo actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughAdds a Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
b30a809 to
6e469c7Comparec7f94fa to
78613e5Compare🦋 Changeset detectedLatest commit: f9c2e28 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
78613e5 to
5ae8ed6CompareAdds `lib/helpers/arrays.ts` with a NonEmptyArray<T> type alias and an isNonEmpty<T> type-guard predicate. Tightens preferredRunner to require a NonEmptyArray<Runner> input and return Runner (no longer | undefined). Updates the two call sites (init/skills.ts, init/format.ts) to use isNonEmpty for the non-empty check, and drops the now-provably-unreachable defensive `if (!preferred)` branch in skills.ts. The type system enforces the invariant that runtime code previously checked.
5ae8ed6 to
f9c2e28CompareUh oh!
There was an error while loading. Please reload this page.
Summary
lib/helpers/arrays.tswith aNonEmptyArray<T>type alias and anisNonEmpty<T>type-guard predicate.preferredRunnerto require aNonEmptyArray<Runner>input and returnRunner(no longer| undefined).init/skills.ts,init/format.ts) to useisNonEmptyfor the non-empty check, and drops the now-provably-unreachable defensiveif (!preferred)branch inskills.ts. The type system enforces the invariant that runtime code previously checked.Stacked on #124.
Test plan
bun run testpasses (60 passed)bun test packages/cli-core/src/lib/helpers/arrays.test.tscovers the type guard