From 7e6ae8ad66df47d0ba9c6777701228f30f9299b0 Mon Sep 17 00:00:00 2001 From: Satnam Singh Brar Date: Tue, 2 Sep 2025 14:23:24 -0700 Subject: [PATCH 1/5] make the `SwampyerError` class extend `Error` class - This will allow users to generically handle the errors without having to care about whether it is specifically a `SwampyerError`. They can just check if an error is an instance of the `Error` class --- src/errors.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/errors.ts b/src/errors.ts index 16c6ecc..cbb10f1 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,10 +1,4 @@ -export class SwampyerError { - constructor(public readonly message?: string) {} - - toString() { - return this.message; - } -} +export class SwampyerError extends Error {} export class SwampyerOperationError extends SwampyerError { constructor( From e399975cebde5dc4ebd1fcc58e4f40b618a77ffc Mon Sep 17 00:00:00 2001 From: Satnam Singh Brar Date: Tue, 2 Sep 2025 14:24:09 -0700 Subject: [PATCH 2/5] bump up the package's patch version --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 428bc6c..8b3a443 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "swampyer", - "version": "1.4.3", + "version": "1.5.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "swampyer", - "version": "1.4.3", + "version": "1.5.2", "license": "MIT", "devDependencies": { "@types/jest": "^27.0.2", diff --git a/package.json b/package.json index 66ac583..1957755 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "swampyer", - "version": "1.5.1", + "version": "1.5.2", "description": "A lightweight WAMP client implementing the WAMP v2 basic profile", "main": "lib/index.js", "module": "lib/index.js", @@ -41,4 +41,4 @@ "typedoc": "^0.22.10", "typescript": "^4.4.3" } -} +} \ No newline at end of file From b810251fe8fa8c1d24a68ce54fd89863cbb76ffc Mon Sep 17 00:00:00 2001 From: Satnam Singh Brar Date: Tue, 2 Sep 2025 14:28:15 -0700 Subject: [PATCH 3/5] run CI checks on node 24, 22 and 20 --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d75ad4e..0e24f5e 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [24.x, 22.x, 20.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From 4af655665a6e5c362705cff8f31d41dc00f639d4 Mon Sep 17 00:00:00 2001 From: Satnam Singh Brar Date: Tue, 2 Sep 2025 14:29:17 -0700 Subject: [PATCH 4/5] update node version for the `publish-npm` CI job --- .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 2ed902b..3d6e79f 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 22 registry-url: https://registry.npmjs.org/ - name: Restore build cache uses: actions/cache@v2 From 05dfc1cc79666cf31628b7852f5ccdd4b1c8baa4 Mon Sep 17 00:00:00 2001 From: Satnam Singh Brar Date: Tue, 2 Sep 2025 14:44:23 -0700 Subject: [PATCH 5/5] update the CI jobs --- .github/workflows/node.js.yml | 4 ++-- .github/workflows/npm-publish.yml | 15 ++++++++------- .github/workflows/typedoc-gh-pages.yml | 13 +++++++++---- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 0e24f5e..91cc311 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -19,9 +19,9 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 3d6e79f..2656ac2 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -11,16 +11,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 22 + cache: 'npm' - run: npm ci - run: npm run lint - run: npm run test - run: npm run build - name: Cache build - uses: actions/cache@v2 + uses: actions/cache@v4 id: restore-build with: path: ./lib @@ -30,13 +31,13 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 22 registry-url: https://registry.npmjs.org/ - name: Restore build cache - uses: actions/cache@v2 + uses: actions/cache@v4 id: restore-build with: path: ./lib diff --git a/.github/workflows/typedoc-gh-pages.yml b/.github/workflows/typedoc-gh-pages.yml index 4653e02..173c103 100644 --- a/.github/workflows/typedoc-gh-pages.yml +++ b/.github/workflows/typedoc-gh-pages.yml @@ -25,15 +25,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Pages - uses: actions/configure-pages@v2 + uses: actions/configure-pages@v5 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' - name: Build with typedoc run: | npm ci npm run gen-docs - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v3 # Deployment job deploy: @@ -45,4 +50,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4