From 0a362f992795c0db19e382def95445ec010b411e Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 15 Nov 2023 15:45:53 -0500 Subject: [PATCH 1/4] Update dev deps and fix linting errors. --- lib/Compressor.js | 8 ++++---- lib/Decompressor.js | 6 +++--- lib/codecs/Base58DidUrlEncoder.js | 4 ++-- lib/codecs/ContextEncoder.js | 4 ++-- lib/codecs/HttpUrlEncoder.js | 4 ++-- lib/codecs/MultibaseDecoder.js | 4 ++-- lib/codecs/MultibaseEncoder.js | 4 ++-- lib/codecs/UriDecoder.js | 4 ++-- lib/codecs/UriEncoder.js | 4 ++-- lib/codecs/UuidUrnEncoder.js | 4 ++-- lib/codecs/VocabTermEncoder.js | 4 ++-- lib/codecs/XsdDateEncoder.js | 4 ++-- lib/codecs/XsdDateTimeEncoder.js | 4 ++-- lib/encode.js | 4 ++-- package.json | 12 ++++++------ 15 files changed, 37 insertions(+), 37 deletions(-) diff --git a/lib/Compressor.js b/lib/Compressor.js index f6c33b64..bc00a75d 100644 --- a/lib/Compressor.js +++ b/lib/Compressor.js @@ -1,18 +1,18 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ import * as cborg from 'cborg'; -import {CborldError} from './CborldError.js'; +import {FIRST_CUSTOM_TERM_ID, KEYWORDS} from './keywords.js'; import {CborldEncoder} from './codecs/CborldEncoder.js'; +import {CborldError} from './CborldError.js'; import {ContextEncoder} from './codecs/ContextEncoder.js'; +import {inspect} from './util.js'; import {MultibaseEncoder} from './codecs/MultibaseEncoder.js'; import {Transformer} from './Transformer.js'; import {UriEncoder} from './codecs/UriEncoder.js'; import {VocabTermEncoder} from './codecs/VocabTermEncoder.js'; import {XsdDateEncoder} from './codecs/XsdDateEncoder.js'; import {XsdDateTimeEncoder} from './codecs/XsdDateTimeEncoder.js'; -import {inspect} from './util.js'; -import {FIRST_CUSTOM_TERM_ID, KEYWORDS} from './keywords.js'; export const TYPE_ENCODERS = new Map([ ['@id', UriEncoder], diff --git a/lib/Decompressor.js b/lib/Decompressor.js index 60dc43b2..90144545 100644 --- a/lib/Decompressor.js +++ b/lib/Decompressor.js @@ -1,17 +1,17 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ import * as cborg from 'cborg'; +import {FIRST_CUSTOM_TERM_ID, KEYWORDS} from './keywords.js'; import {CborldError} from './CborldError.js'; import {ContextDecoder} from './codecs/ContextDecoder.js'; +import {inspect} from './util.js'; import {MultibaseDecoder} from './codecs/MultibaseDecoder.js'; import {Transformer} from './Transformer.js'; import {UriDecoder} from './codecs/UriDecoder.js'; import {VocabTermDecoder} from './codecs/VocabTermDecoder.js'; import {XsdDateDecoder} from './codecs/XsdDateDecoder.js'; import {XsdDateTimeDecoder} from './codecs/XsdDateTimeDecoder.js'; -import {inspect} from './util.js'; -import {FIRST_CUSTOM_TERM_ID, KEYWORDS} from './keywords.js'; export const TYPE_DECODERS = new Map([ ['@id', UriDecoder], diff --git a/lib/codecs/Base58DidUrlEncoder.js b/lib/codecs/Base58DidUrlEncoder.js index a8143f3f..eee19d92 100644 --- a/lib/codecs/Base58DidUrlEncoder.js +++ b/lib/codecs/Base58DidUrlEncoder.js @@ -1,8 +1,8 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ -import {CborldEncoder} from './CborldEncoder.js'; import {Token, Type} from 'cborg'; +import {CborldEncoder} from './CborldEncoder.js'; import {decode as decodeBase58} from 'base58-universal'; const SCHEME_TO_ID = new Map([ diff --git a/lib/codecs/ContextEncoder.js b/lib/codecs/ContextEncoder.js index afe10502..5fd1582a 100644 --- a/lib/codecs/ContextEncoder.js +++ b/lib/codecs/ContextEncoder.js @@ -1,9 +1,9 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ +import {Token, Type} from 'cborg'; import {CborldEncoder} from './CborldEncoder.js'; import {URL_TO_ID} from './registeredContexts.js'; -import {Token, Type} from 'cborg'; export class ContextEncoder extends CborldEncoder { constructor({context, appContextMap} = {}) { diff --git a/lib/codecs/HttpUrlEncoder.js b/lib/codecs/HttpUrlEncoder.js index dca3670c..02758d10 100644 --- a/lib/codecs/HttpUrlEncoder.js +++ b/lib/codecs/HttpUrlEncoder.js @@ -1,8 +1,8 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ -import {CborldEncoder} from './CborldEncoder.js'; import {Token, Type} from 'cborg'; +import {CborldEncoder} from './CborldEncoder.js'; export class HttpUrlEncoder extends CborldEncoder { constructor({value, secure} = {}) { diff --git a/lib/codecs/MultibaseDecoder.js b/lib/codecs/MultibaseDecoder.js index 6f99ed84..7f43a6c1 100644 --- a/lib/codecs/MultibaseDecoder.js +++ b/lib/codecs/MultibaseDecoder.js @@ -1,8 +1,8 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ -import {CborldDecoder} from './CborldDecoder.js'; import {Base64} from 'js-base64'; +import {CborldDecoder} from './CborldDecoder.js'; import {encode as encodeBase58} from 'base58-universal'; // this class is used to encode a multibase encoded value in CBOR-LD, which diff --git a/lib/codecs/MultibaseEncoder.js b/lib/codecs/MultibaseEncoder.js index 4426c16b..a90ac8ef 100644 --- a/lib/codecs/MultibaseEncoder.js +++ b/lib/codecs/MultibaseEncoder.js @@ -1,10 +1,10 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ +import {Token, Type} from 'cborg'; import {Base64} from 'js-base64'; import {CborldEncoder} from './CborldEncoder.js'; import {decode as decodeBase58} from 'base58-universal'; -import {Token, Type} from 'cborg'; // this class is used to encode a multibase encoded value in CBOR-LD, which // actually means transforming a multibase-encoded string to bytes diff --git a/lib/codecs/UriDecoder.js b/lib/codecs/UriDecoder.js index d9ac9f78..c7b5a1b5 100644 --- a/lib/codecs/UriDecoder.js +++ b/lib/codecs/UriDecoder.js @@ -1,8 +1,8 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ -import {CborldDecoder} from './CborldDecoder.js'; import {Base58DidUrlDecoder} from './Base58DidUrlDecoder.js'; +import {CborldDecoder} from './CborldDecoder.js'; import {HttpUrlDecoder} from './HttpUrlDecoder.js'; import {UuidUrnDecoder} from './UuidUrnDecoder.js'; diff --git a/lib/codecs/UriEncoder.js b/lib/codecs/UriEncoder.js index 5cb835f1..1c023e01 100644 --- a/lib/codecs/UriEncoder.js +++ b/lib/codecs/UriEncoder.js @@ -1,8 +1,8 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ -import {CborldEncoder} from './CborldEncoder.js'; import {Base58DidUrlEncoder} from './Base58DidUrlEncoder.js'; +import {CborldEncoder} from './CborldEncoder.js'; import {HttpUrlEncoder} from './HttpUrlEncoder.js'; import {UuidUrnEncoder} from './UuidUrnEncoder.js'; diff --git a/lib/codecs/UuidUrnEncoder.js b/lib/codecs/UuidUrnEncoder.js index 273f6135..60b2f2c7 100644 --- a/lib/codecs/UuidUrnEncoder.js +++ b/lib/codecs/UuidUrnEncoder.js @@ -1,8 +1,8 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ -import {CborldEncoder} from './CborldEncoder.js'; import {Token, Type} from 'cborg'; +import {CborldEncoder} from './CborldEncoder.js'; import {parse} from 'uuid'; export class UuidUrnEncoder extends CborldEncoder { diff --git a/lib/codecs/VocabTermEncoder.js b/lib/codecs/VocabTermEncoder.js index f7bc05dd..2ec2864e 100644 --- a/lib/codecs/VocabTermEncoder.js +++ b/lib/codecs/VocabTermEncoder.js @@ -1,8 +1,8 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ -import {CborldEncoder} from './CborldEncoder.js'; import {Token, Type} from 'cborg'; +import {CborldEncoder} from './CborldEncoder.js'; import {UriEncoder} from './UriEncoder.js'; export class VocabTermEncoder extends CborldEncoder { diff --git a/lib/codecs/XsdDateEncoder.js b/lib/codecs/XsdDateEncoder.js index e0a56b5f..60d17c2b 100644 --- a/lib/codecs/XsdDateEncoder.js +++ b/lib/codecs/XsdDateEncoder.js @@ -1,8 +1,8 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ -import {CborldEncoder} from './CborldEncoder.js'; import {Token, Type} from 'cborg'; +import {CborldEncoder} from './CborldEncoder.js'; export class XsdDateEncoder extends CborldEncoder { constructor({value, parsed} = {}) { diff --git a/lib/codecs/XsdDateTimeEncoder.js b/lib/codecs/XsdDateTimeEncoder.js index 9629db79..649f1f6d 100644 --- a/lib/codecs/XsdDateTimeEncoder.js +++ b/lib/codecs/XsdDateTimeEncoder.js @@ -1,8 +1,8 @@ /*! - * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2021-2023 Digital Bazaar, Inc. All rights reserved. */ -import {CborldEncoder} from './CborldEncoder.js'; import {Token, Type} from 'cborg'; +import {CborldEncoder} from './CborldEncoder.js'; export class XsdDateTimeEncoder extends CborldEncoder { constructor({value, parsed} = {}) { diff --git a/lib/encode.js b/lib/encode.js index c06cb25b..7c14662f 100644 --- a/lib/encode.js +++ b/lib/encode.js @@ -1,9 +1,9 @@ /*! - * Copyright (c) 2020-2021 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2020-2023 Digital Bazaar, Inc. All rights reserved. */ import * as cborg from 'cborg'; -import {inspect} from './util.js'; import {Compressor} from './Compressor.js'; +import {inspect} from './util.js'; /** * Encodes a given JSON-LD document into a CBOR-LD byte array. diff --git a/package.json b/package.json index 27141e00..a02b26ba 100644 --- a/package.json +++ b/package.json @@ -47,23 +47,23 @@ "base58-universal": "^2.0.0", "cborg": "^1.9.4", "js-base64": "^3.7.2", - "uuid": "^8.3.2" + "uuid": "^9.0.1" }, "devDependencies": { - "c8": "^7.11.3", + "c8": "^8.0.1", "chai": "^4.3.6", "chai-bytes": "^0.1.2", "cross-env": "^7.0.3", "eslint": "^8.17.0", - "eslint-config-digitalbazaar": "^3.0.0", - "eslint-plugin-jsdoc": "^39.3.2", - "eslint-plugin-unicorn": "^42.0.0", + "eslint-config-digitalbazaar": "^5.0.1", + "eslint-plugin-jsdoc": "^46.9.0", + "eslint-plugin-unicorn": "^49.0.0", "karma": "^6.3.20", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^3.1.1", "karma-mocha": "^2.0.1", "karma-mocha-reporter": "^2.2.5", - "karma-sourcemap-loader": "^0.3.8", + "karma-sourcemap-loader": "^0.4.0", "karma-webpack": "^5.0.0", "mocha": "^10.0.0", "mocha-lcov-reporter": "^1.3.0", From bf5740c326728013d3347f8d44e81f9419f6d2ca Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 15 Nov 2023 15:46:37 -0500 Subject: [PATCH 2/4] Use `cborg@4`. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a02b26ba..00dea845 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "dependencies": { "base58-universal": "^2.0.0", - "cborg": "^1.9.4", + "cborg": "^4.0.5", "js-base64": "^3.7.2", "uuid": "^9.0.1" }, From d6bda04445b7c0f6673968317189ca342d40bf80 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 15 Nov 2023 15:48:22 -0500 Subject: [PATCH 3/4] Update changelog. --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8be4873..14e1e9ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # @digitalbazaar/cborld ChangeLog +## 5.2.0 - 2023-11-dd + +### Changed +- Update dependencies: + - Use `cborg@4`. + - Use `uuid@9`. + ## 5.1.0 - 2023-11-15 ### Added From 141db6fa59be93ebd03954928782274721384f5b Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 15 Nov 2023 15:48:51 -0500 Subject: [PATCH 4/4] Fix linting error. --- tests/test.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test.spec.js b/tests/test.spec.js index 165a764e..fb18653d 100644 --- a/tests/test.spec.js +++ b/tests/test.spec.js @@ -1,5 +1,5 @@ /*! -* Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved. +* Copyright (c) 2020-2023 Digital Bazaar, Inc. All rights reserved. */ import { default as chai, @@ -8,7 +8,7 @@ import { import {default as chaiBytes} from 'chai-bytes'; chai.use(chaiBytes); -import {encode, decode} from '../lib/index.js'; +import {decode, encode} from '../lib/index.js'; describe('cborld', () => { describe('encode', () => {