Skip to content

Commit 94c67b5

Browse files
committed
fix(ts): strictness improvements + CI timeouts
- src/stdio/prompts.ts: replace the forbidden `as any` on the selectModule destructure with a scoped `as unknown as {...}` that narrows to the two properties we actually use (default + Separator). Keeps CLAUDE.md's no-any rule satisfied. - src/dlx/package.ts: tighten dlxPackage() signature — options was declared optional but then immediately `options!`-asserted. Since DlxPackageOptions.package is required, calling dlxPackage() without options is nonsense; make options required at the type level instead of hiding the requirement behind a non-null assertion. - .github/workflows/weekly-update.yml: add job-level timeout-minutes (15 for check-updates, 30 for apply-updates). The apply-updates job invokes Claude Code in automation which could hang; step-level timeouts (10–15m) were insufficient without a job-level ceiling.
1 parent 05fb4b8 commit 94c67b5

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/weekly-update.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
check-updates:
2424
name: Check for dependency updates
2525
runs-on: ubuntu-latest
26+
timeout-minutes: 15
2627
permissions:
2728
contents: read
2829
outputs:
@@ -48,6 +49,7 @@ jobs:
4849
needs: check-updates
4950
if: needs.check-updates.outputs.has-updates == 'true' && inputs.dry-run != true
5051
runs-on: ubuntu-latest
52+
timeout-minutes: 30
5153
permissions:
5254
contents: write
5355
pull-requests: write

src/dlx/package.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,17 +307,17 @@ function getPath() {
307307
*/
308308
export async function dlxPackage(
309309
args: readonly string[] | string[],
310-
options?: DlxPackageOptions | undefined,
310+
options: DlxPackageOptions,
311311
spawnExtra?: SpawnExtra | undefined,
312312
): Promise<DlxPackageResult> {
313313
// Download the package.
314-
const downloadResult = await downloadPackage(options!)
314+
const downloadResult = await downloadPackage(options)
315315

316316
// Execute the binary.
317317
const spawnPromise = executePackage(
318318
downloadResult.binaryPath,
319319
args,
320-
options?.spawnOptions,
320+
options.spawnOptions,
321321
spawnExtra,
322322
)
323323

src/stdio/prompts.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ import { resolveColor } from '../themes/utils'
2929
const abortSignal = getAbortSignal()
3030
const spinner = getDefaultSpinner()
3131

32-
// Modules imported at the top - extract default and Separator
32+
// Modules imported at the top - extract default and Separator.
33+
// The @inquirer/select shim exposes the namespaced CJS module, so we
34+
// narrow instead of `as any` to stay within CLAUDE.md's no-any rule.
3335
const searchRaw = searchModule.default
34-
const selectModule = selectModuleImport as any
36+
const selectModule = selectModuleImport as unknown as {
37+
default: typeof selectModuleImport.default
38+
Separator: typeof selectModuleImport.Separator
39+
}
3540
const selectRaw = selectModule.default
3641
const ActualSeparator = selectModule.Separator
3742

0 commit comments

Comments
 (0)