Skip to content

Latest commit

 

History

History
141 lines (84 loc) · 3.86 KB

File metadata and controls

141 lines (84 loc) · 3.86 KB

First Tasks: sindresorhus/ky

Suggested starter tasks for new contributors, organized by difficulty.

Beginner Tasks (Safe Small Wins)

Document Node.js version requirement

Difficulty: beginner | Category: docs

Add a short prerequisite note in the Install section that Node.js >=18 is required, matching package.json engines.

Why this matters: Keeps contributor setup instructions aligned with the supported runtime.

Files to look at:

  • readme.md
  • package.json

Document ky.stop and ky.retry helpers

Difficulty: beginner | Category: docs

Add a brief README snippet showing how to stop retries in beforeRetry and how to trigger retries from afterResponse.

Why this matters: These helpers are part of the public API but are easy to miss without explicit docs.

Files to look at:

  • readme.md
  • source/index.ts
  • source/core/Ky.ts

Test prefixUrl leading-slash validation

Difficulty: beginner | Category: test

Add an AVA test that asserts ky throws when prefixUrl is used with an input starting with '/'.

Why this matters: Guards against regressions in URL normalization behavior.

Files to look at:

  • source/core/Ky.ts
  • test/fetch.ts

Test searchParams undefined filtering

Difficulty: beginner | Category: test

Verify that undefined values are removed while null values are preserved when building search params.

Why this matters: Confirms documented query normalization behavior.

Files to look at:

  • source/core/Ky.ts
  • test/fetch.ts

Intermediate Tasks

Test beforeError hook mutation

Difficulty: intermediate | Category: test

Add a test to ensure beforeError can change error name/message and is invoked before throwing.

Why this matters: Improves coverage of hook customization logic.

Files to look at:

  • source/core/Ky.ts
  • test/hooks.ts

Test shouldRetry precedence

Difficulty: intermediate | Category: test

Create a test showing that retry.shouldRetry overrides status code and timeout checks.

Why this matters: Ensures custom retry logic remains the top-priority decision point.

Files to look at:

  • source/core/Ky.ts
  • test/hooks.ts

Refactor Retry-After parsing into a utility

Difficulty: intermediate | Category: refactor

Extract the Retry-After/RateLimit parsing logic from Ky.#calculateRetryDelay into a helper in source/utils and add focused tests.

Why this matters: Simplifies the retry flow and makes header parsing easier to test.

Files to look at:

  • source/core/Ky.ts
  • source/utils/normalize.ts
  • test/fetch.ts

Advanced Tasks

Improve KyInstance typing for create/extend

Difficulty: advanced | Category: feature

Tighten TypeScript overloads so defaults passed to ky.create/ky.extend are reflected in the returned instance types.

Why this matters: Enhances developer experience for advanced TypeScript consumers.

Files to look at:

  • source/types/ky.ts
  • source/index.ts

Add progress hook streaming tests

Difficulty: advanced | Category: test

Use a large payload helper to test onDownloadProgress/onUploadProgress streaming behavior and error handling.

Why this matters: Validates stream-based progress support across environments.

Files to look at:

  • source/core/Ky.ts
  • source/utils/body.ts
  • test/helpers/create-large-file.ts
  • test/fetch.ts

How to Pick a Task

  1. New to the codebase? Start with a beginner task
  2. Want to learn the architecture? Pick an intermediate refactor
  3. Ready for a challenge? Try an advanced feature task

Before You Start

  1. Read ARCHITECTURE.md to understand the system
  2. Check if there's an existing issue for the task
  3. Create a feature branch
  4. Write tests for your changes
  5. Submit a PR referencing this task

Generated by Repo Bootcamp