Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit ed183a5

Browse files
authored
chore: update deps (#32)
* 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. * chore: update travis * chore: fix linting
1 parent 5aac8e4 commit ed183a5

File tree

5 files changed

+28
-16
lines changed

5 files changed

+28
-16
lines changed

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
language: node_js
22
cache: npm
3+
dist: bionic
4+
5+
branches:
6+
only:
7+
- master
8+
- /^release\/.*$/
9+
310
stages:
411
- check
512
- test
@@ -14,7 +21,7 @@ os:
1421
- osx
1522
- windows
1623

17-
script: npx nyc -s npm run test:node -- --bail
24+
script: npx aegir test -t node --cov --bail
1825
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
1926

2027
jobs:
@@ -34,8 +41,7 @@ jobs:
3441
name: firefox
3542
addons:
3643
firefox: latest
37-
script: npx aegir test -t browser -- --browsers FirefoxHeadless
44+
script: npx aegir test -t browser -- --browser firefox
3845

3946
notifications:
4047
email: false
41-

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,23 @@
3535
},
3636
"homepage": "https://github.com/ipfs/js-datastore-s3#readme",
3737
"dependencies": {
38-
"buffer": "^5.6.0",
39-
"datastore-core": "^2.0.0",
40-
"interface-datastore": "^2.0.0"
38+
"buffer": "^6.0.3",
39+
"datastore-core": "^3.0.0",
40+
"interface-datastore": "^3.0.5"
4141
},
4242
"devDependencies": {
43-
"aegir": "^26.0.0",
43+
"aegir": "^33.0.0",
44+
"assert": "^2.0.0",
4445
"aws-sdk": "^2.579.0",
4546
"chai": "^4.2.0",
4647
"dirty-chai": "^2.0.1",
47-
"ipfs-repo": "^6.0.3",
48-
"stand-in": "^4.2.0"
48+
"ipfs-repo": "9.0.0",
49+
"stand-in": "^4.2.0",
50+
"util": "^0.12.3"
4951
},
5052
"peerDependencies": {
5153
"aws-sdk": "2.x",
52-
"ipfs-repo": "^6.0.3"
54+
"ipfs-repo": "^9.0.0"
5355
},
5456
"contributors": [
5557
"Jacob Heun <[email protected]>",

src/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ class S3Datastore extends Adapter {
4747

4848
/**
4949
* Returns the full key which includes the path to the ipfs store
50+
*
5051
* @param {Key} key
51-
* @returns {String}
52+
* @returns {string}
5253
*/
5354
_getFullKey (key) {
5455
// Avoid absolute paths with s3
@@ -168,6 +169,7 @@ class S3Datastore extends Adapter {
168169

169170
/**
170171
* Recursively fetches all keys from s3
172+
*
171173
* @param {Object} params
172174
* @returns {Iterator<Key>}
173175
*/
@@ -184,7 +186,7 @@ class S3Datastore extends Adapter {
184186
yield new Key(d.Key.slice(this.path.length), false)
185187
}
186188

187-
// If we didnt get all records, recursively query
189+
// If we didn't get all records, recursively query
188190
if (data.isTruncated) {
189191
// If NextMarker is absent, use the key from the last result
190192
params.StartAfter = data.Contents[data.Contents.length - 1].Key
@@ -242,13 +244,13 @@ class S3Datastore extends Adapter {
242244
Key: this.path
243245
}).promise()
244246
} catch (err) {
245-
if (err.statusCode === 404) {
246-
return this.put(new Key('/', false), Uint8Array.from(''))
247+
if (err.statusCode !== 404) {
248+
throw Errors.dbOpenFailedError(err)
247249
}
248-
249-
throw Errors.dbOpenFailedError(err)
250250
}
251251
}
252+
253+
close () {}
252254
}
253255

254256
module.exports = S3Datastore

src/s3-repo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const notALock = {
1515

1616
/**
1717
* A convenience method for creating an S3 backed IPFS repo
18+
*
1819
* @param {Object} S3Store
1920
* @param {Object} options
2021
* @param {Object} s3Options

test/utils/s3-mock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const s3Reject = (err) => ({ promise: () => Promise.reject(err) })
2020

2121
/**
2222
* Mocks out the s3 calls made by datastore-s3
23+
*
2324
* @param {S3Instance} s3
2425
* @returns {void}
2526
*/

0 commit comments

Comments
 (0)