feat(lib): add NonEmptyArray helper, tighten preferredRunner#125
feat(lib): add NonEmptyArray helper, tighten preferredRunner#125
Conversation
|
Stack: init-skills Part of a stacked PR chain. Do not merge manually. |
47dc327 to
21072f9
Compare
26405f7 to
1e94859
Compare
21072f9 to
d52abd4
Compare
670617f to
10da1db
Compare
133bd4a to
ecae3c7
Compare
a4185bb to
a45b262
Compare
ecae3c7 to
3f687c8
Compare
a45b262 to
c95a429
Compare
207adbd to
dcb4afa
Compare
c95a429 to
79d474f
Compare
dcb4afa to
d700db1
Compare
08653a1 to
a8903e7
Compare
0262797 to
523c58a
Compare
a8903e7 to
190c5d5
Compare
523c58a to
3a3375e
Compare
190c5d5 to
09c9f9b
Compare
3a3375e to
f7ab840
Compare
09c9f9b to
59ca3db
Compare
59ca3db to
5f34cb8
Compare
5f34cb8 to
b30a809
Compare
|
No 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
6e469c7
Compare
c7f94fa to
78613e5
Compare
🦋 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
5ae8ed6
Compare
Adds `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
f9c2e28
Compare
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