From 66425302a3ba4576ebdfccb325b222b9b629b5de Mon Sep 17 00:00:00 2001 From: Derek Scruggs Date: Fri, 12 Jun 2026 11:45:46 -0500 Subject: [PATCH 1/3] Update dependencies and GitHub Actions. - Replace `eslint-config-digitalbazaar` with `@digitalbazaar/eslint-config@8` using eslint 9 flat config; remove now-redundant `/* global */` comments and plugin devDependencies provided by the shared config. - Update `webpack` and `webpack-cli`. - Use Node.js 22.x and current action versions in CI; set empty workflow permissions. Addresses #53. Co-Authored-By: Claude Fable 5 --- .eslintrc.cjs | 13 ------------- .github/workflows/main.yaml | 13 ++++++------- .gitignore | 1 + CHANGELOG.md | 9 +++++++++ eslint.config.js | 17 +++++++++++++++++ lib/CredentialHandler.js | 3 +-- lib/CredentialHints.js | 3 +-- lib/CredentialManager.js | 3 +-- lib/CredentialsContainer.js | 5 ++--- lib/index.js | 7 ++++--- package.json | 12 +++++------- 11 files changed, 47 insertions(+), 39 deletions(-) delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index cddff0b..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - browser: true - }, - extends: [ - 'digitalbazaar', - 'digitalbazaar/jsdoc', - 'digitalbazaar/module' - ], - ignorePatterns: ['dist/'] -}; diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4d7e05b..1db0508 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,19 +2,18 @@ name: Main CI on: [push] +permissions: {} + jobs: lint: runs-on: ubuntu-latest timeout-minutes: 10 - strategy: - matrix: - node-version: [20.x] steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + - uses: actions/checkout@v6 + - name: Use Node.js 22.x + uses: actions/setup-node@v6 with: - node-version: ${{ matrix.node-version }} + node-version: 22.x - name: Install run: npm install - name: Lint diff --git a/.gitignore b/.gitignore index 9a4fe4d..010f201 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ coverage dist node_modules npm-debug.log +package-lock.json reports diff --git a/CHANGELOG.md b/CHANGELOG.md index 0057ecb..4809342 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # credential-handler-polyfill ChangeLog +## 4.0.3 - 2026-06-dd + +### Changed +- Update dev dependencies: + - Use `@digitalbazaar/eslint-config@8` with eslint 9 flat config, + replacing `eslint-config-digitalbazaar`. + - Use `webpack-cli@7`. +- Update GitHub Actions to use Node.js 22.x and current action versions. + ## 4.0.2 - 2026-06-12 ### Fixed diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..55497cb --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,17 @@ +/*! + * Copyright (c) 2026 Digital Bazaar, Inc. All rights reserved. + */ +import config from '@digitalbazaar/eslint-config/browser-recommended'; +import globals from 'globals'; + +export default [ + ...config, + { + files: ['webpack.config.js'], + languageOptions: { + globals: { + ...globals.node + } + } + } +]; diff --git a/lib/CredentialHandler.js b/lib/CredentialHandler.js index 39378d0..671c7df 100644 --- a/lib/CredentialHandler.js +++ b/lib/CredentialHandler.js @@ -1,9 +1,8 @@ /*! * The core CredentialHandler class. * - * Copyright (c) 2017-2024 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. All rights reserved. */ -/* global DOMException */ import {EventEmitter, WebApp} from 'web-request-rpc'; import {CredentialHandlerService} from './CredentialHandlerService.js'; diff --git a/lib/CredentialHints.js b/lib/CredentialHints.js index c9c3613..96373d3 100644 --- a/lib/CredentialHints.js +++ b/lib/CredentialHints.js @@ -1,7 +1,6 @@ /*! - * Copyright (c) 2017-2024 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. All rights reserved. */ -/* global Image */ export class CredentialHints { constructor(url, injector) { const remote = injector.get('credentialHints', { diff --git a/lib/CredentialManager.js b/lib/CredentialManager.js index 376c935..49b002a 100644 --- a/lib/CredentialManager.js +++ b/lib/CredentialManager.js @@ -1,7 +1,6 @@ /*! - * Copyright (c) 2017-2024 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. All rights reserved. */ -/* global navigator */ import {CredentialHints} from './CredentialHints.js'; /* A CredentialManager for a Web Credential Mediator. */ diff --git a/lib/CredentialsContainer.js b/lib/CredentialsContainer.js index 47d226e..89a19a7 100644 --- a/lib/CredentialsContainer.js +++ b/lib/CredentialsContainer.js @@ -2,9 +2,8 @@ * Wrapper for native CredentialsContainer that uses remote Credential Mediator * for WebCredential-related operations. * - * Copyright (c) 2017-2024 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. All rights reserved. */ -/* global navigator, DOMException */ import {WebCredential} from './WebCredential.js'; // RPC timeouts, 0 = indefinite @@ -17,7 +16,7 @@ export class CredentialsContainer { get: navigator.credentials && navigator.credentials.get && navigator.credentials.get.bind(navigator.credentials), store: navigator.credentials && navigator.credentials.store && - navigator.credentials.store.bind(navigator.credentials), + navigator.credentials.store.bind(navigator.credentials) }; this._init = (async () => { diff --git a/lib/index.js b/lib/index.js index 62be7eb..eb0662d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,6 @@ /*! * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ -/* global navigator, window */ import {WebAppContext} from 'web-request-rpc'; import {CredentialHandler} from './CredentialHandler.js'; @@ -109,7 +108,7 @@ export async function load(options = { value: navCredentialsProxy, writable: true }); - } catch(e) { + } catch { // on WebKit, `navigator.credentials` is a non-configurable property // that cannot be redefined as a data property; fall back to plain // assignment and, if that also fails, continue without the proxy -- @@ -118,7 +117,9 @@ export async function load(options = { // subsequent overwrites of `navigator.credentials` itself is lost try { navigator.credentials = navCredentialsProxy; - } catch(e2) {} + } catch { + // ignore; continue without overwrite protection + } } window.CredentialManager = CredentialManager; diff --git a/package.json b/package.json index 1b14cb3..9d88118 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "prepublish": "npm run build", "build": "webpack", - "lint": "eslint --ext .cjs,.js ." + "lint": "eslint --no-warn-ignored ." }, "repository": { "type": "git", @@ -33,12 +33,10 @@ "web-request-rpc": "^3.0.1" }, "devDependencies": { - "eslint": "^8.57.0", - "eslint-config-digitalbazaar": "^5.2.0", - "eslint-plugin-jsdoc": "^48.4.0", - "eslint-plugin-unicorn": "^54.0.0", - "webpack": "^5.92.1", - "webpack-cli": "^5.1.4" + "@digitalbazaar/eslint-config": "^8.0.1", + "eslint": "^9.39.4", + "webpack": "^5.107.2", + "webpack-cli": "^7.0.3" }, "bedrock": { "browserDependencies": [ From da2d7035388fff1d114cb61f1aba573077823e17 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Fri, 12 Jun 2026 13:01:32 -0400 Subject: [PATCH 2/3] Update file headers. Co-authored-by: Dave Longley --- eslint.config.js | 2 +- lib/CredentialHints.js | 2 +- lib/CredentialManager.js | 2 +- lib/CredentialsContainer.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 55497cb..e99859f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,5 +1,5 @@ /*! - * Copyright (c) 2026 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2026 Digital Bazaar, Inc. */ import config from '@digitalbazaar/eslint-config/browser-recommended'; import globals from 'globals'; diff --git a/lib/CredentialHints.js b/lib/CredentialHints.js index 96373d3..7f329a6 100644 --- a/lib/CredentialHints.js +++ b/lib/CredentialHints.js @@ -1,5 +1,5 @@ /*! - * Copyright (c) 2017-2026 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ export class CredentialHints { constructor(url, injector) { diff --git a/lib/CredentialManager.js b/lib/CredentialManager.js index 49b002a..e69b7c6 100644 --- a/lib/CredentialManager.js +++ b/lib/CredentialManager.js @@ -1,5 +1,5 @@ /*! - * Copyright (c) 2017-2026 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ import {CredentialHints} from './CredentialHints.js'; diff --git a/lib/CredentialsContainer.js b/lib/CredentialsContainer.js index 89a19a7..7222a14 100644 --- a/lib/CredentialsContainer.js +++ b/lib/CredentialsContainer.js @@ -2,7 +2,7 @@ * Wrapper for native CredentialsContainer that uses remote Credential Mediator * for WebCredential-related operations. * - * Copyright (c) 2017-2026 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ import {WebCredential} from './WebCredential.js'; From 5fefa896152fd99d7464135e6cc068756ffd5841 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Fri, 12 Jun 2026 13:04:18 -0400 Subject: [PATCH 3/3] Update file header. --- lib/CredentialHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CredentialHandler.js b/lib/CredentialHandler.js index 671c7df..751712f 100644 --- a/lib/CredentialHandler.js +++ b/lib/CredentialHandler.js @@ -1,7 +1,7 @@ /*! * The core CredentialHandler class. * - * Copyright (c) 2017-2026 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ import {EventEmitter, WebApp} from 'web-request-rpc';