chore: remove commitlint

chore: update deps

chore: add bundlesize to ci
This commit is contained in:
Jacob Heun 2019-10-24 18:16:41 +02:00
parent a008bc2fcb
commit e1c48b903d
No known key found for this signature in database
GPG Key ID: CA5A94C15809879F
9 changed files with 18 additions and 16 deletions

3
.aegir.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
bundlesize: { maxSize: '139kB' }
}

View File

@ -23,7 +23,7 @@ jobs:
include:
- stage: check
script:
- npx aegir commitlint --travis
- npx aegir build --bundlesize
- npx aegir dep-check
- npm run lint

View File

@ -25,7 +25,7 @@
"release-minor": "aegir release --type minor",
"release-major": "aegir release --type major",
"coverage": "aegir coverage --ignore src/keys/keys.proto.js",
"size": "bundlesize -f dist/index.min.js -s 139kB"
"size": "aegir build --bundlesize"
},
"keywords": [
"IPFS",
@ -36,7 +36,7 @@
"license": "MIT",
"dependencies": {
"asmcrypto.js": "^2.3.2",
"asn1.js": "^5.0.1",
"asn1.js": "^5.2.0",
"bn.js": "^5.0.0",
"browserify-aes": "^1.2.0",
"bs58": "^4.0.1",
@ -44,22 +44,21 @@
"iso-random-stream": "^1.1.0",
"keypair": "^1.0.1",
"libp2p-crypto-secp256k1": "~0.4.0",
"multihashing-async": "~0.7.0",
"node-forge": "~0.8.5",
"multihashing-async": "~0.8.0",
"node-forge": "~0.9.1",
"pem-jwk": "^2.0.0",
"protons": "^1.0.1",
"rsa-pem-to-jwk": "^1.1.3",
"tweetnacl": "^1.0.1",
"ursa-optional": "~0.10.0"
"ursa-optional": "~0.10.1"
},
"devDependencies": {
"aegir": "^19.0.5",
"aegir": "^20.4.1",
"benchmark": "^2.1.4",
"bundlesize": "~0.18.0",
"chai": "^4.2.0",
"chai-string": "^1.5.0",
"dirty-chai": "^2.0.1",
"sinon": "^7.3.2"
"sinon": "^7.5.0"
},
"engines": {
"node": ">=10.0.0",

View File

@ -25,7 +25,7 @@ const ErrMissingSecp256K1 = {
}
function typeToKey (type) {
let key = supportedKeys[type.toLowerCase()]
const key = supportedKeys[type.toLowerCase()]
if (!key) {
const supported = Object.keys(supportedKeys).join(' / ')
throw errcode(new Error(`invalid or unsupported key type ${type}. Must be ${supported}`), 'ERR_UNSUPPORTED_KEY_TYPE')

View File

@ -29,7 +29,7 @@ module.exports = async (cipherType, hash, secret) => {
}
if (!hash) {
throw errcode(new Error(`missing hash type`), 'ERR_MISSING_HASH_TYPE')
throw errcode(new Error('missing hash type'), 'ERR_MISSING_HASH_TYPE')
}
const cipherKeySize = cipher.keySize
@ -41,7 +41,7 @@ module.exports = async (cipherType, hash, secret) => {
const m = await hmac.create(hash, secret)
let a = await m.digest(seed)
let result = []
const result = []
let j = 0
while (j < resultLength) {

View File

@ -6,7 +6,7 @@ const BN = require('asn1.js').bignum
// Adapted from https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41#appendix-C
exports.toBase64 = function toBase64 (bn, len) {
// if len is defined then the bytes are leading-0 padded to the length
let s = bn.toArrayLike(Buffer, 'be', len).toString('base64')
const s = bn.toArrayLike(Buffer, 'be', len).toString('base64')
return s
.replace(/(=*)$/, '') // Remove any trailing '='s

View File

@ -14,7 +14,7 @@ function doTests (fncName, fnc, num, skipBuffersAndStrings) {
// skip this garbage because it's a buffer or a string and we were told do do that
return
}
let args = []
const args = []
for (let i = 0; i < num; i++) {
args.push(garbage)
}

View File

@ -61,7 +61,7 @@ describe('generateEphemeralKeyPair', () => {
})
})
it(`handles bad curve name`, async () => {
it('handles bad curve name', async () => {
try {
await crypto.keys.generateEphemeralKeyPair('bad name')
} catch (err) {

View File

@ -24,7 +24,7 @@ describe('Util', () => {
})
it('toBase64 zero padding', (done) => {
let bnpad = new BN('ff', 16)
const bnpad = new BN('ff', 16)
expect(util.toBase64(bnpad, 2)).to.eql('AP8')
done()
})