From 2cc982452273098a9c3d8255c9639246e00ce0a8 Mon Sep 17 00:00:00 2001 From: Lukas Weiss Date: Wed, 29 Jan 2025 15:36:27 +0100 Subject: [PATCH 1/6] remove not-stringifyable params from query (e.g. null) --- src/engine/query.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/engine/query.ts b/src/engine/query.ts index 3958bcf..23999c4 100644 --- a/src/engine/query.ts +++ b/src/engine/query.ts @@ -9,10 +9,7 @@ export type AbstractQueryValueElement = | Date | bigint -export type AbstractQuery = Record< - string, - AbstractQueryValueElement | AbstractQueryValueElement[] -> +export type AbstractQuery = Record /** * Parses the query. @@ -59,7 +56,7 @@ export type AbstractQueryOptions = { /** * How the abstract query is converted to an actual query. * - * @default Each value that is not undefined is converted to a string by calling `.toString()`. + * @default Each value that is not undefined is converted to a string by calling `.toString()` or removed if not stringifyable. */ convertToQuery: (abstractQuery: Partial) => Query } @@ -69,10 +66,19 @@ const DEFAULT_ABSTRACT_QUERY_OPTIONS: AbstractQueryOptions = { const query: Query = {} for (const [key, value] of Object.entries(abstractQuery)) { if (Array.isArray(value)) { - query[key] = value.map((v) => v.toString()) + query[key] = value.map((v: unknown) => + typeof v?.toString === 'function' + ? // eslint-disable-next-line @typescript-eslint/no-base-to-string + v.toString() + : '', + ) } else { if (value !== undefined) { - query[key] = value.toString() + query[key] = + typeof value?.toString === 'function' + ? // eslint-disable-next-line @typescript-eslint/no-base-to-string + value.toString() + : '' } } } From 6c5b80b420ea712f26d7f902e18c2e37cf6068df Mon Sep 17 00:00:00 2001 From: Lukas Weiss Date: Wed, 29 Jan 2025 15:44:36 +0100 Subject: [PATCH 2/6] 3.1.3-beta.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 095b06b..66fdb93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aboutbits/react-pagination", - "version": "3.1.2", + "version": "3.1.3-beta.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@aboutbits/react-pagination", - "version": "3.1.2", + "version": "3.1.3-beta.0", "license": "MIT", "devDependencies": { "@aboutbits/eslint-config": "^2.2.4", diff --git a/package.json b/package.json index 3d4e6b0..8c3218b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aboutbits/react-pagination", - "version": "3.1.2", + "version": "3.1.3-beta.0", "description": "Pagination hooks for React", "author": "About Bits", "license": "MIT", From 2e7f24651baf1c42756f7f7048cad04d127b4157 Mon Sep 17 00:00:00 2001 From: Alex Lanz Date: Thu, 20 Mar 2025 11:06:08 +0100 Subject: [PATCH 3/6] add automatic prerelase flagging --- .github/workflows/main.yml | 24 ++++++++++++++++++++++-- .github/workflows/release.yml | 3 ++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 110ef3f..f9f16ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,9 +7,27 @@ concurrency: cancel-in-progress: true jobs: + checks: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + strategy: + matrix: + node_version: [16, 18, 20] + steps: + - uses: actions/checkout@v4 + - uses: aboutbits/github-actions-node/setup-and-install@v2 + with: + node-version: ${{ matrix.node_version }} + - name: Lint + run: npm run lint + shell: bash + - name: Typecheck + run: npm run typecheck + shell: bash + test: runs-on: ubuntu-22.04 - timeout-minutes: 15 + timeout-minutes: 10 strategy: matrix: node_version: [16, 18, 20] @@ -18,4 +36,6 @@ jobs: - uses: aboutbits/github-actions-node/setup-and-install@v2 with: node-version: ${{ matrix.node_version }} - - run: npm run checks + - name: Test + run: npm run test + shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 419d92a..122bd18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,8 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, tag_name: '${{ github.ref }}', - name: 'Release ${{ github.ref_name }}' + name: 'Release ${{ github.ref_name }}', + prerelease: '${{ github.ref_name }}'.includes('-') }) - uses: aboutbits/github-actions-node/setup-and-install@v2 with: From 3ab64460fed2f0781c9d6c11babc2898aae545f9 Mon Sep 17 00:00:00 2001 From: Lukas Weiss Date: Wed, 23 Jul 2025 08:49:51 +0200 Subject: [PATCH 4/6] add next 15 support --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8c3218b..a297b20 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "vitest": "^1.4.0" }, "peerDependencies": { - "next": "^12.0.0 || ^13.0.0 || ^14.0.0", + "next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0", "react": "^16.0.0 || ^17.0.0 || ^18.0.0", "react-router-dom": "^6.0.0", "zod": "^3.0.0" From e6188cd21906760a84f92f6f46dc434643f354a4 Mon Sep 17 00:00:00 2001 From: Lukas Weiss Date: Mon, 25 Aug 2025 14:18:18 +0200 Subject: [PATCH 5/6] 3.1.3-beta.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 66fdb93..d07f27b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aboutbits/react-pagination", - "version": "3.1.3-beta.0", + "version": "3.1.3-beta.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@aboutbits/react-pagination", - "version": "3.1.3-beta.0", + "version": "3.1.3-beta.1", "license": "MIT", "devDependencies": { "@aboutbits/eslint-config": "^2.2.4", diff --git a/package.json b/package.json index a297b20..4366295 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aboutbits/react-pagination", - "version": "3.1.3-beta.0", + "version": "3.1.3-beta.1", "description": "Pagination hooks for React", "author": "About Bits", "license": "MIT", From 411fc07bf2a0071b46cac4fd44f5164bec99bb18 Mon Sep 17 00:00:00 2001 From: Lukas Weiss Date: Wed, 26 Nov 2025 09:41:30 +0100 Subject: [PATCH 6/6] remove obsolete AbstractQueryValueElement --- src/engine/query.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/engine/query.ts b/src/engine/query.ts index 23999c4..5897f67 100644 --- a/src/engine/query.ts +++ b/src/engine/query.ts @@ -2,13 +2,6 @@ import { useCallback, useMemo } from 'react' export type Query = Record -export type AbstractQueryValueElement = - | string - | number - | boolean - | Date - | bigint - export type AbstractQuery = Record /**