From 964a41ce42c88e425206d389097d0aa28b8c1c2e Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 12 Apr 2021 15:37:27 +0100 Subject: [PATCH 1/3] chore: update deps Updates to latest interface-datastore. Not techincally breaking but should probably got out as a major due to potential incompatibilities in the dep tree with the new versions. --- package.json | 16 +++++++++------- src/index.js | 10 +++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 7862e7e..325de9a 100644 --- a/package.json +++ b/package.json @@ -35,21 +35,23 @@ }, "homepage": "https://github.com/ipfs/js-datastore-s3#readme", "dependencies": { - "buffer": "^5.6.0", - "datastore-core": "^2.0.0", - "interface-datastore": "^2.0.0" + "buffer": "^6.0.3", + "datastore-core": "^3.0.0", + "interface-datastore": "^3.0.5" }, "devDependencies": { - "aegir": "^26.0.0", + "aegir": "^33.0.0", + "assert": "^2.0.0", "aws-sdk": "^2.579.0", "chai": "^4.2.0", "dirty-chai": "^2.0.1", - "ipfs-repo": "^6.0.3", - "stand-in": "^4.2.0" + "ipfs-repo": "9.0.0", + "stand-in": "^4.2.0", + "util": "^0.12.3" }, "peerDependencies": { "aws-sdk": "2.x", - "ipfs-repo": "^6.0.3" + "ipfs-repo": "^9.0.0" }, "contributors": [ "Jacob Heun ", diff --git a/src/index.js b/src/index.js index 76917c8..0265a64 100644 --- a/src/index.js +++ b/src/index.js @@ -184,7 +184,7 @@ class S3Datastore extends Adapter { yield new Key(d.Key.slice(this.path.length), false) } - // If we didnt get all records, recursively query + // If we didn't get all records, recursively query if (data.isTruncated) { // If NextMarker is absent, use the key from the last result params.StartAfter = data.Contents[data.Contents.length - 1].Key @@ -242,13 +242,13 @@ class S3Datastore extends Adapter { Key: this.path }).promise() } catch (err) { - if (err.statusCode === 404) { - return this.put(new Key('/', false), Uint8Array.from('')) + if (err.statusCode !== 404) { + throw Errors.dbOpenFailedError(err) } - - throw Errors.dbOpenFailedError(err) } } + + close () {} } module.exports = S3Datastore From 339251deca3c789355376c48bef0201c9bb698a9 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 12 Apr 2021 15:57:05 +0100 Subject: [PATCH 2/3] chore: update travis --- .travis.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ef3e9a..4308ace 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,12 @@ language: node_js cache: npm +dist: bionic + +branches: + only: + - master + - /^release\/.*$/ + stages: - check - test @@ -14,7 +21,7 @@ os: - osx - windows -script: npx nyc -s npm run test:node -- --bail +script: npx aegir test -t node --cov --bail after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov jobs: @@ -34,8 +41,7 @@ jobs: name: firefox addons: firefox: latest - script: npx aegir test -t browser -- --browsers FirefoxHeadless + script: npx aegir test -t browser -- --browser firefox notifications: email: false - From 59f7ad3bc0090995b84e15bb010ce857b4fec11b Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 12 Apr 2021 15:58:19 +0100 Subject: [PATCH 3/3] chore: fix linting --- src/index.js | 4 +++- src/s3-repo.js | 1 + test/utils/s3-mock.js | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 0265a64..160a87a 100644 --- a/src/index.js +++ b/src/index.js @@ -47,8 +47,9 @@ class S3Datastore extends Adapter { /** * Returns the full key which includes the path to the ipfs store + * * @param {Key} key - * @returns {String} + * @returns {string} */ _getFullKey (key) { // Avoid absolute paths with s3 @@ -168,6 +169,7 @@ class S3Datastore extends Adapter { /** * Recursively fetches all keys from s3 + * * @param {Object} params * @returns {Iterator} */ diff --git a/src/s3-repo.js b/src/s3-repo.js index f782ff4..3013fde 100644 --- a/src/s3-repo.js +++ b/src/s3-repo.js @@ -15,6 +15,7 @@ const notALock = { /** * A convenience method for creating an S3 backed IPFS repo + * * @param {Object} S3Store * @param {Object} options * @param {Object} s3Options diff --git a/test/utils/s3-mock.js b/test/utils/s3-mock.js index b9cbb0b..d756690 100644 --- a/test/utils/s3-mock.js +++ b/test/utils/s3-mock.js @@ -20,6 +20,7 @@ const s3Reject = (err) => ({ promise: () => Promise.reject(err) }) /** * Mocks out the s3 calls made by datastore-s3 + * * @param {S3Instance} s3 * @returns {void} */