Skip to content

Commit d0445c3

Browse files
authored
chore: release 0.33.1 (#773)
* fix: cbor-web imports do not work in esm (#772) * chore: set release version 0.33.1
1 parent e9fb6ee commit d0445c3

File tree

21 files changed

+36
-30
lines changed

21 files changed

+36
-30
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@
7070
"typedoc": "^0.22.15",
7171
"typescript": "^4.8.3"
7272
},
73-
"version": "0.33.0",
73+
"version": "0.33.1",
7474
"packageManager": "[email protected]"
7575
}

packages/asset-did/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/asset-did",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",

packages/augment-api/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/augment-api",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"types": "./lib/index.d.ts",
66
"type": "module",

packages/chain-helpers/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/chain-helpers",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",

packages/config/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/config",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"type": "commonjs",
66
"main": "./lib/index.js",

packages/core/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/core",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",
@@ -49,7 +49,6 @@
4949
"@polkadot/keyring": "^12.0.0",
5050
"@polkadot/types": "^10.4.0",
5151
"@polkadot/util": "^12.0.0",
52-
"@polkadot/util-crypto": "^12.0.0",
53-
"cbor-web": "^8.0.0"
52+
"@polkadot/util-crypto": "^12.0.0"
5453
}
5554
}

packages/core/src/publicCredential/PublicCredential.chain.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ import type {
2222
PublicCredentialsCredentialsCredentialEntry,
2323
} from '@kiltprotocol/augment-api'
2424

25-
import { encode as cborEncode, decode as cborDecode } from 'cbor-web'
26-
2725
import { HexString } from '@polkadot/util/types'
2826
import { ConfigService } from '@kiltprotocol/config'
2927
import { fromChain as didFromChain } from '@kiltprotocol/did'
3028
import { validateUri } from '@kiltprotocol/asset-did'
31-
import { SDKErrors } from '@kiltprotocol/utils'
29+
import { SDKErrors, cbor } from '@kiltprotocol/utils'
3230

3331
import { getIdForCredential } from './PublicCredential.js'
3432
import { flattenCalls, isBatch, retrieveExtrinsicFromBlock } from '../utils.js'
@@ -51,7 +49,7 @@ export function toChain(
5149
): EncodedPublicCredential {
5250
const { cTypeHash, claims, subject, delegationId } = publicCredential
5351

54-
const cborSerializedClaims = cborEncode(claims)
52+
const cborSerializedClaims = cbor.encode(claims)
5553

5654
return {
5755
ctypeHash: cTypeHash,
@@ -72,7 +70,7 @@ function credentialInputFromChain({
7270
const credentialSubject = subject.toUtf8()
7371
validateUri(credentialSubject)
7472
return {
75-
claims: cborDecode(claims),
73+
claims: cbor.decode(claims),
7674
cTypeHash: ctypeHash.toHex(),
7775
delegationId: authorization.unwrapOr(undefined)?.toHex() ?? null,
7876
subject: credentialSubject as AssetDidUri,

packages/did/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/did",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",
@@ -44,7 +44,6 @@
4444
"@polkadot/types": "^10.4.0",
4545
"@polkadot/types-codec": "^10.4.0",
4646
"@polkadot/util": "^12.0.0",
47-
"@polkadot/util-crypto": "^12.0.0",
48-
"cbor-web": "^8.0.0"
47+
"@polkadot/util-crypto": "^12.0.0"
4948
}
5049
}

packages/did/src/DidDetails/LightDidDetails.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* found in the LICENSE file in the root directory of this source tree.
66
*/
77

8-
import { decode as cborDecode, encode as cborEncode } from 'cbor-web'
98
import {
109
base58Decode,
1110
base58Encode,
@@ -22,7 +21,7 @@ import type {
2221
} from '@kiltprotocol/types'
2322
import { encryptionKeyTypes } from '@kiltprotocol/types'
2423

25-
import { SDKErrors, ss58Format } from '@kiltprotocol/utils'
24+
import { SDKErrors, ss58Format, cbor } from '@kiltprotocol/utils'
2625

2726
import { getAddressByKey, parse } from '../Did.utils.js'
2827
import { resourceIdToChain, validateService } from '../Did.chain.js'
@@ -147,7 +146,7 @@ function serializeAdditionalLightDidDetails({
147146
}
148147

149148
const serializationVersion = 0x0
150-
const serialized = cborEncode(objectToSerialize)
149+
const serialized = cbor.encode(objectToSerialize)
151150
return base58Encode([serializationVersion, ...serialized], true)
152151
}
153152

@@ -166,7 +165,7 @@ function deserializeAdditionalLightDidDetails(
166165
if (serializationVersion !== 0x0) {
167166
throw new SDKErrors.DidError('Serialization algorithm not supported')
168167
}
169-
const deserialized: SerializableStructure = cborDecode(serialized)
168+
const deserialized: SerializableStructure = cbor.decode(serialized)
170169

171170
const keyAgreement = deserialized[KEY_AGREEMENT_MAP_KEY]
172171
return {

packages/did/src/cbor-web.d.ts

-1
This file was deleted.

packages/messaging/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/messaging",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",

packages/sdk-js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/sdk-js",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",

packages/testing/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@kiltprotocol/testing",
33
"private": true,
4-
"version": "0.33.0",
4+
"version": "0.33.1",
55
"description": "",
66
"main": "./lib/cjs/index.js",
77
"module": "./lib/esm/index.js",

packages/type-definitions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/type-definitions",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",

packages/types/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/types",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",

packages/utils/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/utils",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",
@@ -39,6 +39,7 @@
3939
"@polkadot/keyring": "^12.0.0",
4040
"@polkadot/util": "^12.0.0",
4141
"@polkadot/util-crypto": "^12.0.0",
42+
"cbor-web": "^8.0.0",
4243
"tweetnacl": "^1.0.3",
4344
"uuid": "^9.0.0"
4445
}
File renamed without changes.

packages/utils/src/cbor.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright (c) 2018-2023, BOTLabs GmbH.
3+
*
4+
* This source code is licensed under the BSD 4-Clause "Original" license
5+
* found in the LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
// special import syntax as this is a pure cjs import
9+
import * as cborImp from 'cbor-web'
10+
// this is horrible but the only way to make this import work in both cjs & esm builds
11+
export const cbor = cborImp?.default ?? cborImp

packages/utils/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export * as DataUtils from './DataUtils.js'
1717
export * as SDKErrors from './SDKErrors.js'
1818
export * as JsonSchema from './json-schema/index.js'
1919
export { ss58Format } from './ss58Format.js'
20+
export { cbor } from './cbor.js'
2021
export { Keyring } from '@polkadot/keyring'

packages/vc-export/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kiltprotocol/vc-export",
3-
"version": "0.33.0",
3+
"version": "0.33.1",
44
"description": "",
55
"main": "./lib/cjs/index.js",
66
"module": "./lib/esm/index.js",

yarn.lock

+1-2
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,6 @@ __metadata:
18991899
"@polkadot/util": ^12.0.0
19001900
"@polkadot/util-crypto": ^12.0.0
19011901
"@types/uuid": ^8.0.0
1902-
cbor-web: ^8.0.0
19031902
rimraf: ^3.0.2
19041903
testcontainers: ^9.0.0
19051904
typescript: ^4.8.3
@@ -1921,7 +1920,6 @@ __metadata:
19211920
"@polkadot/types-codec": ^10.4.0
19221921
"@polkadot/util": ^12.0.0
19231922
"@polkadot/util-crypto": ^12.0.0
1924-
cbor-web: ^8.0.0
19251923
rimraf: ^3.0.2
19261924
typescript: ^4.8.3
19271925
languageName: unknown
@@ -2016,6 +2014,7 @@ __metadata:
20162014
"@polkadot/keyring": ^12.0.0
20172015
"@polkadot/util": ^12.0.0
20182016
"@polkadot/util-crypto": ^12.0.0
2017+
cbor-web: ^8.0.0
20192018
rimraf: ^3.0.2
20202019
tweetnacl: ^1.0.3
20212020
typescript: ^4.8.3

0 commit comments

Comments
 (0)