Skip to content

Fix/merge master conflict#14

Merged
Zaiidmo merged 10 commits intomasterfrom
fix/merge-master-conflict
Apr 10, 2026
Merged

Fix/merge master conflict#14
Zaiidmo merged 10 commits intomasterfrom
fix/merge-master-conflict

Conversation

@a-elkhiraooui-ciscode
Copy link
Copy Markdown
Contributor

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?

Zaiidmo and others added 10 commits April 1, 2026 21:01
* feat(COMPT-40): implement createQuery factory

- Add createQuery(keyFn, fetcher) returning QueryDefinition<TParams, TData>
- TData and TParams fully inferred from fetcher signature, zero manual annotation
- queryKey returns stable readonly tuple via keyFn
- useQuery shorthand hook wraps useTanstackQuery with typed params
- Export from src/index.ts
- Add @tanstack/react-query as peerDependency (>=5) and devDependency
- Add pnpm cssstyle override to fix Node.js v22 + jsdom@28 ESM compat issue
- Fix duplicate import in vitest.config.ts
- 9 tests, 100% coverage on createQuery.ts, 88.6% overall

Closes COMPT-40

* chore: sync package-lock.json with @tanstack/react-query addition

* chore: switch from pnpm to npm, sync lockfile

* chore: fix prettier formatting across all files
- usePaginatedQuery(queryDef, params, options) supports mode: 'offset' | 'cursor'
- Offset mode: page/pageSize (default 20)/nextPage/prevPage/totalPages
- Cursor mode: fetchNextPage/hasNextPage/nextCursor via useInfiniteQuery
- Both expose data as flat T[] array, isLoading, isFetching, isError, error
- Offset uses useQuery with page in queryKey; cursor uses useInfiniteQuery
- getCursor option required for cursor mode
- Typed overloads: full inference, no TanStack internals exposed
- 15 tests, 100% coverage on usePaginatedQuery.ts, 95.62% overall

Closes COMPT-41
* feat(COMPT-42): implement createMutation and typed cache helpers

- createMutation(fn) returns MutationDefinition with mutationFn and useMutation shorthand
- useMutation exposes mutate/mutateAsync/isPending/isError/error/data/reset
- invalidateQueries(client, queryDef, params?) uses queryDef key — no raw strings
- setQueryData typed updater — wrong shape is TypeScript compile error
- All exported from src/index.ts via src/query/index.ts
- 18 tests (10 mutation + 8 cache), 100% coverage on both src files, 95.94% overall

Closes COMPT-42

* chore: fix prettier formatting

* fix: suppress eslint no-unused-vars on intentionally unused mutation param
- createQuery.test.tsx: queryKey shape, queryFn call, useQuery loading/success/error/enabled/rerender
- usePaginatedQuery.test.tsx: offset page navigation, data shape, cursor fetchNextPage/hasNextPage/nextCursor
- createMutation.test.tsx: idle state, mutate, isPending, data, isError, reset, mutateAsync
- cacheHelpers.test.tsx: invalidateQueries marks stale + refetch, setQueryData direct/updater/hook reflect

All 84 tests pass, 97.35% stmt coverage (target: 85%)
- Moved all co-located tests (src/query/*.test.tsx, src/index.test.ts) into src/__tests__/
- Merged unique tests from co-located files: definition shape, stable key, TData inference,
  mode assertions, initialPage, mutationFn direct call
- Deleted: src/query/createQuery.test.tsx, cacheHelpers.test.tsx, createMutation.test.tsx,
  usePaginatedQuery.test.tsx, src/index.test.ts
- 51 tests, all passing, no test files outside src/__tests__/
- Rewrote README as an end-to-end usage guide for @ciscode/query-kit
- createQuery: key builder, fetcher, useQuery shorthand, direct key/fn access
- usePaginatedQuery: offset mode (nextPage/prevPage) and cursor mode (fetchNextPage/hasNextPage)
- createMutation + invalidateQueries full lifecycle example
- setQueryData typed updater example
- API reference table covering all exports
- Peer dep @tanstack/react-query >=5 clearly stated
- Changeset: minor bump to v0.1.0 (initial public release)
* feat(COMPT-44): README guide + changeset for v0.1.0

- Rewrote README as an end-to-end usage guide for @ciscode/query-kit
- createQuery: key builder, fetcher, useQuery shorthand, direct key/fn access
- usePaginatedQuery: offset mode (nextPage/prevPage) and cursor mode (fetchNextPage/hasNextPage)
- createMutation + invalidateQueries full lifecycle example
- setQueryData typed updater example
- API reference table covering all exports
- Peer dep @tanstack/react-query >=5 clearly stated
- Changeset: minor bump to v0.1.0 (initial public release)

* fix(ci): correct sonar.tests path from 'test' to 'src/__tests__'

Tests live in src/__tests__/, not test/. Also add sonar.exclusions and
sonar.test.inclusions so source files and test files are correctly separated
in SonarCloud analysis.
* feat(COMPT-44): README guide + changeset for v0.1.0

- Rewrote README as an end-to-end usage guide for @ciscode/query-kit
- createQuery: key builder, fetcher, useQuery shorthand, direct key/fn access
- usePaginatedQuery: offset mode (nextPage/prevPage) and cursor mode (fetchNextPage/hasNextPage)
- createMutation + invalidateQueries full lifecycle example
- setQueryData typed updater example
- API reference table covering all exports
- Peer dep @tanstack/react-query >=5 clearly stated
- Changeset: minor bump to v0.1.0 (initial public release)

* fix(ci): correct sonar.tests path from 'test' to 'src/__tests__'

Tests live in src/__tests__/, not test/. Also add sonar.exclusions and
sonar.test.inclusions so source files and test files are correctly separated
in SonarCloud analysis.

* 0.0.1
@sonarqubecloud
Copy link
Copy Markdown

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

Resolves a merge conflict by updating the package version metadata.

Changes:

  • Bump @ciscode/query-kit version from 0.0.0 to 0.0.1 in package.json
  • Sync the same version bump into package-lock.json

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
package.json Updates the published package version field.
package-lock.json Updates lockfile metadata to match the package version bump.

{
"name": "@ciscode/query-kit",
"version": "0.0.0",
"version": "0.0.1",
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This repo’s documented release flow uses Changesets to manage package versions (see INSTRUCTIONS.md:151-156). Manually bumping package.json to 0.0.1 in a “merge conflict” PR can put the repo in a state that doesn’t match the existing changeset release plan (e.g., .changeset/v0-1-0-initial-release.md indicates a minor bump for the next release). Consider reverting this manual version change and letting pnpm run version-packages (changeset version) update it, or explicitly align the version with the intended release version.

Suggested change
"version": "0.0.1",
"version": "0.1.0",

Copilot uses AI. Check for mistakes.
@Zaiidmo Zaiidmo merged commit 6e91354 into master Apr 10, 2026
6 checks passed
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