Skip to content

Release/v0.1.0 readme changeset#1

Merged
Omaiiima merged 9 commits intodevelopfrom
release/v0.1.0-readme-changeset
Apr 14, 2026
Merged

Release/v0.1.0 readme changeset#1
Omaiiima merged 9 commits intodevelopfrom
release/v0.1.0-readme-changeset

Conversation

@Omaiiima
Copy link
Copy Markdown
Contributor

@Omaiiima Omaiiima commented Apr 8, 2026

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

Copilot AI review requested due to automatic review settings April 8, 2026 14:55
@Omaiiima Omaiiima requested a review from a team as a code owner April 8, 2026 14:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces the initial public API for @ciscode/api-kit, a typed Axios-backed HTTP client, and updates package metadata/docs for the v0.1.0 release.

Changes:

  • Add createApiClient + ApiError implementation with typed request/response/error interceptor support and retry/backoff behavior.
  • Add Vitest coverage for the API client and error class.
  • Update README/package metadata and add a Changesets entry for the initial release.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/index.ts Exposes the new api surface from the package root exports.
src/api/index.ts Defines the public exports for the new API module.
src/api/createApiClient.types.ts Introduces the public types for the API client and interceptors.
src/api/createApiClient.ts Implements the Axios wrapper, normalization to ApiError, interceptors, and retry logic.
src/api/createApiClient.test.ts Adds unit tests for HTTP methods, interceptors, error mapping, and retry behavior.
src/api/ApiError.ts Adds the ApiError class used as the normalized error type.
src/api/ApiError.test.ts Adds unit tests for the ApiError class.
README.md Replaces template README with package documentation and usage examples.
package.json Bumps version/description and adds Axios as a dependency.
package-lock.json Updates lockfile to include Axios and related dependencies.
.changeset/release-v0.1.0.md Adds a changeset describing the initial minor release.

Comment on lines 2 to +4
"name": "@ciscode/api-kit",
"version": "0.0.0",
"description": "Typed HTTP client factory on Axios.",
"version": "0.1.0",
"description": "Typed HTTP client for TypeScript — wraps Axios with zero leaky abstractions.",
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json version is bumped to 0.1.0 while a changeset in this PR also declares a minor release. With the documented Changesets flow (run changeset version to update versions), keeping both will cause the next versioning step to bump again (e.g., to 0.2.0) or create inconsistent release state. Consider either (a) reverting the manual version change and relying on the changeset + version-packages, or (b) if this is the post-versioning release PR, remove the changeset file (it should have been consumed by changeset version).

Copilot uses AI. Check for mistakes.
for (const interceptor of responseInterceptors) {
intercepted = interceptor(intercepted);
}

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResponseInterceptor returns an InterceptedResponse (including status and headers), but the implementation only applies intercepted.data back onto the Axios response. This means any interceptor changes to status/headers are silently ignored by the underlying response object, which is surprising given the type signature. Either apply status/headers back onto axiosResponse, or narrow the interceptor contract/docs to indicate that only data mutations are honored.

Suggested change
axiosResponse.status = intercepted.status;
axiosResponse.headers = intercepted.headers;

Copilot uses AI. Check for mistakes.
Comment on lines +496 to +500
await tokenClient.get('/secure');

const requestCall = mockState.instance.get.mock.calls[0];
expect(requestCall).toBeDefined();
});
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This token-injection test doesn’t assert the expected behavior: it only checks that the request call exists. To meaningfully cover getToken, assert that the request interceptor actually injects Authorization: Bearer <token> into the outgoing request config/headers (and ideally also verify it’s absent when getToken returns null).

Copilot generated this review using guidance from repository custom instructions.
@Omaiiima Omaiiima merged commit c4c1e36 into develop Apr 14, 2026
2 checks passed
Zaiidmo added a commit that referenced this pull request Apr 14, 2026
* chore: scaffolding the repo

* Release/v0.1.0 readme changeset (#1)

* feat: add createApiClient factory with typed HTTP methods wrapping axios

* feat: add composable interceptor system and built-in auth token injector to ApiClient

* feat: add ApiError class and configurable retry with exponential backoff

* Revert "feat: add ApiError class and configurable retry with exponential backoff"

This reverts commit 2d7c8f3.

* Reapply "feat: add ApiError class and configurable retry with exponential backoff"

This reverts commit db3568d.

* feat: add ApiError class and configurable retry with exponential backoff

* test: add comprehensive test suite for ApiClient with ApiError, retry backoff, and interceptor coverag

* docs: add README with full API documentation and changeset for v0.1.0

* fix(api-kit): resolve CI failures and sonar issues in develop→master PR (#3)

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants