From 13f5a1dc9f732550042d6a374e34a462f1cd8096 Mon Sep 17 00:00:00 2001 From: Isha Sharma Date: Fri, 28 Nov 2025 13:58:40 +0530 Subject: [PATCH 1/8] update(major): publish package to github --- .github/workflows/npm-publish.yml | 15 ++++++++++----- package.json | 10 +++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8a0568e..5ec2b22 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -57,6 +57,12 @@ jobs: skip-push: "true" skip-commit: "true" bump-policy: "ignore" + + - name: Setup .npmrc + run: | + echo "@fundwave:registry=https://npm.pkg.github.com" >> ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc + echo "ignore-scripts=true" >> ~/.npmrc - name: Install dependencies run: npm ci @@ -72,12 +78,11 @@ jobs: git config user.name "fundabot" git commit -a -m "CI: bumps @fundwave/fetch-queue to $VERSION" -m "[skip ci]" - - name: Publish package to gitlab - env: - GITLAB_TOKEN: ${{secrets.GITLAB_TOKEN}} + - name: Build package + run: npm run build + + - name: Publish package to github run: | - echo @fundwave:registry=https://gitlab.com/api/v4/projects/24877554/packages/npm/ > ~/.npmrc - echo //gitlab.com/api/v4/projects/24877554/packages/npm/:_authToken=$GITLAB_TOKEN >> ~/.npmrc npm publish --tag $BRANCH_TAG - name: Publish package to npm diff --git a/package.json b/package.json index fde8bf9..c59dab7 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ }, "scripts": { "build:esm": "tsc --module NodeNext --outDir ./dist/esm", - "build": "tsc --module commonjs --outDir ./dist/cjs", - "prepare": "npm run build && npm run build:esm", + "build:cjs": "tsc --module commonjs --outDir ./dist/cjs", + "build": "npm run build:cjs && npm run build:esm", "pretest": "jest --clearCache", "test": "jest --detectOpenHandles", "lint": "npx eslint src/index.ts", @@ -20,7 +20,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/getfundwave/fetch-queue.git" + "url": "git+https://github.com/fundwave/fetch-queue.git" }, "keywords": [ "js", @@ -30,9 +30,9 @@ "author": "The Fundwave Authors", "license": "MIT", "bugs": { - "url": "https://github.com/getfundwave/fetch-queue/issues" + "url": "https://github.com/fundwave/fetch-queue/issues" }, - "homepage": "https://github.com/getfundwave/fetch-queue#readme", + "homepage": "https://github.com/fundwave/fetch-queue#readme", "devDependencies": { "@babel/cli": "^7.23.0", "@babel/core": "^7.23.2", From ccd2cc9e9b430b6b7c8423a642c63fa5c157f521 Mon Sep 17 00:00:00 2001 From: Isha Sharma Date: Fri, 31 Jul 2026 17:06:33 +0530 Subject: [PATCH 2/8] chore: remove NPMJS_TOKEN from action --- .github/workflows/npm-publish.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 5ec2b22..37c781d 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -2,6 +2,11 @@ name: Release and Publish on: [push] +permissions: + id-token: write + contents: write + packages: write + env: BRANCH_TAG: "${{ github.ref_name == 'main' && 'latest' || github.ref_name }}" BRANCH: ${{ github.ref_name }} @@ -88,11 +93,8 @@ jobs: - name: Publish package to npm if: ${{ github.ref_name == 'main'}} run: | - echo //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} > ~/.npmrc echo registry=https://registry.npmjs.org/ >> ~/.npmrc npm publish --tag $BRANCH_TAG --access public - env: - NODE_AUTH_TOKEN: ${{secrets.NPMJS_TOKEN}} - name: Push changes uses: ad-m/github-push-action@master From d4c099880b7975bd6aefc1ab5fc12a5df1bdf0fe Mon Sep 17 00:00:00 2001 From: Isha Sharma Date: Fri, 31 Jul 2026 17:06:50 +0530 Subject: [PATCH 3/8] chore: dev scaffolding --- .github/workflows/npm-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 37c781d..b1f354b 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -91,7 +91,7 @@ jobs: npm publish --tag $BRANCH_TAG - name: Publish package to npm - if: ${{ github.ref_name == 'main'}} + # if: ${{ github.ref_name == 'main'}} run: | echo registry=https://registry.npmjs.org/ >> ~/.npmrc npm publish --tag $BRANCH_TAG --access public From 8a76c55eb3c50dbe01b33d0365fe39c286fca1f5 Mon Sep 17 00:00:00 2001 From: Isha Sharma Date: Fri, 31 Jul 2026 17:32:02 +0530 Subject: [PATCH 4/8] fix: use sandbox urls for testing --- tests/index.test.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/index.test.ts b/tests/index.test.ts index dcc6b83..6b1af79 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,7 +1,7 @@ import { FetchQueue } from "../src/index"; import { PreHook } from "../src/interfaces"; -const urls = ["https://httpstat.us/500", "https://dummyjson.com/products/1", "https://dummyjson.com/products/2", "https://dummyjson.com/products/3"]; +const urls = ["https://sandbox.fundwave.com/api/activity/healthchecks", "https://sandbox.fundwave.com/api/user/healthcheck", "https://sandbox.fundwave.com/api/activity/healthcheck", "https://sandbox.fundwave.com/services/api/instance/ssoconfig"]; async function wait(time: number = 1200) { return new Promise((resolve) => { @@ -201,7 +201,7 @@ describe("test case with start and pause queue", () => { expect(fetchQueue.getActiveRequests()).toBe(0); break; case 2: - const regExp = /https:\/\/dummyjson\.com.*/g; + const regExp = /https:\/\/sandbox\.fundwave\.com\/api\/.*\/healthcheck$/g; fetchQueue.emptyQueue(regExp); expect(fetchQueue.getQueueLength()).toBe(0); expect(fetchQueue.getActiveRequests()).toBe(0); @@ -230,15 +230,15 @@ describe("test case with start and pause queue", () => { const fetchQueue = new FetchQueue({ concurrent: 1, - pre: [{ pattern: new RegExp("https://dummyjson.com/products/\\d+"), hook }] + pre: [{ pattern: new RegExp("https://sandbox.fundwave.com/api/user/.*"), hook }] }); fetchQueue.startQueue(); const fetch = fetchQueue.getFetchMethod(); await Promise.allSettled([ - fetch("https://dummyjson.com/products/1"), - fetch("https://dummyjson.com/test"), + fetch("https://sandbox.fundwave.com/api/user/healthcheck"), + fetch("https://sandbox.fundwave.com/api/activity/healthcheck"), ]); expect(hook).toHaveBeenCalledTimes(1); @@ -253,10 +253,10 @@ describe("test case with start and pause queue", () => { const fetchQueue = new FetchQueue({ concurrent: 1, - queuingPatterns: [ new RegExp("https://dummyjson.com/products/*") ], + queuingPatterns: [ new RegExp("https://sandbox.fundwave.com/api/user/.*") ], pre: [ - { pattern: new RegExp("https://dummyjson.com/products/\\d+"), hook: notToBeCalled }, - { pattern: new RegExp("https://dummyjson.com/test"), hook: toBeCalled }, + { pattern: new RegExp("https://sandbox.fundwave.com/api/user/.*"), hook: notToBeCalled }, + { pattern: new RegExp("https://sandbox.fundwave.com/api/activity/healthcheck"), hook: toBeCalled }, ] }); @@ -264,8 +264,8 @@ describe("test case with start and pause queue", () => { fetchQueue.pauseQueue(); const fetch = fetchQueue.getFetchMethod(); - fetch("https://dummyjson.com/products/1"), - await fetch("https://dummyjson.com/test"), + fetch("https://sandbox.fundwave.com/api/user/healthcheck"), + await fetch("https://sandbox.fundwave.com/api/activity/healthcheck"), expect(notToBeCalled).toHaveBeenCalledTimes(0); expect(toBeCalled).toHaveBeenCalled(); @@ -298,7 +298,7 @@ describe("test case with start and pause queue", () => { expect(responses.length).toBe(8); responses.forEach((resp) => { - if (resp.ok) expect(resp.json()).resolves.not.toBeNull(); + if (resp.ok) expect(resp.text()).resolves.not.toBeNull(); }) }, TEST_TIMEOUT); }); From 3e8133d8b0583b2c5d1c7f730c1fd088104ec279 Mon Sep 17 00:00:00 2001 From: Isha Sharma Date: Fri, 31 Jul 2026 17:43:43 +0530 Subject: [PATCH 5/8] chore: bump package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c59dab7..4be718b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fundwave/fetchq", - "version": "1.2.2", + "version": "1.2.3", "description": "Queue for fetch requests", "main": "dist/esm/index.js", "types": "dist/esm/index.d.ts", From 34939101d7a992485e3cae115f39e447ffa89baf Mon Sep 17 00:00:00 2001 From: Isha Sharma Date: Fri, 31 Jul 2026 18:05:40 +0530 Subject: [PATCH 6/8] fix: registry for npm --- .github/workflows/npm-publish.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index b1f354b..420efc1 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -93,7 +93,7 @@ jobs: - name: Publish package to npm # if: ${{ github.ref_name == 'main'}} run: | - echo registry=https://registry.npmjs.org/ >> ~/.npmrc + echo "@fundwave:registry=https://registry.npmjs.org/" >> ~/.npmrc npm publish --tag $BRANCH_TAG --access public - name: Push changes diff --git a/package.json b/package.json index 4be718b..f95f190 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fundwave/fetchq", - "version": "1.2.3", + "version": "1.2.4-github-package.0", "description": "Queue for fetch requests", "main": "dist/esm/index.js", "types": "dist/esm/index.d.ts", From 1d1f3c21101bffe3986aeee9fd1f16f0eb88367a Mon Sep 17 00:00:00 2001 From: Isha Sharma Date: Fri, 31 Jul 2026 18:14:19 +0530 Subject: [PATCH 7/8] chore: bump node version to 24 --- .github/workflows/npm-publish.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 420efc1..f996842 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 24 - name: Install dependencies run: npm ci - name: Run lint @@ -42,7 +42,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 24 - uses: actions/checkout@v3 with: @@ -62,12 +62,6 @@ jobs: skip-push: "true" skip-commit: "true" bump-policy: "ignore" - - - name: Setup .npmrc - run: | - echo "@fundwave:registry=https://npm.pkg.github.com" >> ~/.npmrc - echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc - echo "ignore-scripts=true" >> ~/.npmrc - name: Install dependencies run: npm ci @@ -88,6 +82,8 @@ jobs: - name: Publish package to github run: | + echo "@fundwave:registry=https://npm.pkg.github.com" >> ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc npm publish --tag $BRANCH_TAG - name: Publish package to npm From 798cbb6df29defdc56498678dd3ae656edfb61c0 Mon Sep 17 00:00:00 2001 From: Isha Sharma Date: Fri, 31 Jul 2026 18:15:02 +0530 Subject: [PATCH 8/8] chore: bump package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f95f190..240f933 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fundwave/fetchq", - "version": "1.2.4-github-package.0", + "version": "1.2.4-github-package.1", "description": "Queue for fetch requests", "main": "dist/esm/index.js", "types": "dist/esm/index.d.ts",