Skip to content

Commit

Permalink
Fix Browser Exports (#68)
Browse files Browse the repository at this point in the history
* Bump dwn-sdk-js to 0.0.32
* fix bundler browser directives in `package.json`
* Bump Web5 JS package versions for 0.7.1 release


Co-authored-by: Frank Hinek <[email protected]>
Co-authored-by: Moe Jangda <[email protected]>
  • Loading branch information
frankhinek and mistermoe authored May 18, 2023
1 parent bbbf2b0 commit 8710760
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 79 deletions.
72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/crypto/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"enable-source-maps": true
}
8 changes: 4 additions & 4 deletions packages/crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tbd54566975/crypto",
"version": "0.1.0",
"version": "0.1.1",
"description": "TBD crypto library",
"type": "module",
"main": "./dist/cjs/main.cjs",
Expand Down Expand Up @@ -52,8 +52,8 @@
}
},
"browser": {
"./dist/esm/index.js": "./dist/browser.mjs",
"./dist/cjs/index.js": "./dist/browser.js",
"./dist/esm/main.mjs": "./dist/browser.mjs",
"./dist/cjs/main.cjs": "./dist/browser.js",
"types": "./dist/types/main.d.ts"
},
"keywords": [
Expand Down Expand Up @@ -96,4 +96,4 @@
"rimraf": "4.4.0",
"typescript": "5.0.4"
}
}
}
3 changes: 3 additions & 0 deletions packages/dids/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"enable-source-maps": true
}
10 changes: 5 additions & 5 deletions packages/dids/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tbd54566975/dids",
"version": "0.1.0",
"version": "0.1.1",
"description": "TBD DIDs library",
"type": "module",
"main": "./dist/cjs/main.cjs",
Expand Down Expand Up @@ -52,8 +52,8 @@
}
},
"browser": {
"./dist/esm/index.js": "./dist/browser.mjs",
"./dist/cjs/index.js": "./dist/browser.js",
"./dist/esm/main.mjs": "./dist/browser.mjs",
"./dist/cjs/main.cjs": "./dist/browser.js",
"types": "./dist/types/main.d.ts"
},
"keywords": [
Expand All @@ -74,8 +74,8 @@
},
"dependencies": {
"@decentralized-identity/ion-tools": "1.0.7",
"@tbd54566975/crypto": "0.1.0",
"@tbd54566975/dwn-sdk-js": "0.0.32-unstable-2023-05-15-1350300",
"@tbd54566975/crypto": "0.1.1",
"@tbd54566975/dwn-sdk-js": "0.0.32",
"cross-fetch": "3.1.5"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions packages/web5-agent/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"enable-source-maps": true
}
8 changes: 4 additions & 4 deletions packages/web5-agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tbd54566975/web5-agent",
"version": "0.1.0",
"version": "0.1.1",
"description": "Web5 Agent",
"type": "module",
"main": "./dist/cjs/main.cjs",
Expand Down Expand Up @@ -52,8 +52,8 @@
}
},
"browser": {
"./dist/esm/index.js": "./dist/browser.mjs",
"./dist/cjs/index.js": "./dist/browser.js",
"./dist/esm/main.mjs": "./dist/browser.mjs",
"./dist/cjs/main.cjs": "./dist/browser.js",
"types": "./dist/types/main.d.ts"
},
"keywords": [
Expand All @@ -71,7 +71,7 @@
},
"dependencies": {
"readable-stream": "4.4.0",
"@tbd54566975/dwn-sdk-js": "0.0.32-unstable-2023-05-15-1350300"
"@tbd54566975/dwn-sdk-js": "0.0.32"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "5.59.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/web5-proxy-agent/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"enable-source-maps": true
}
8 changes: 4 additions & 4 deletions packages/web5-proxy-agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tbd54566975/web5-proxy-agent",
"version": "0.1.0",
"version": "0.1.1",
"description": "Web5 Proxy Agent",
"type": "module",
"main": "./dist/cjs/main.cjs",
Expand Down Expand Up @@ -52,8 +52,8 @@
}
},
"browser": {
"./dist/esm/index.js": "./dist/browser.mjs",
"./dist/cjs/index.js": "./dist/browser.js",
"./dist/esm/main.mjs": "./dist/browser.mjs",
"./dist/cjs/main.cjs": "./dist/browser.js",
"types": "./dist/types/main.d.ts"
},
"keywords": [
Expand All @@ -70,7 +70,7 @@
"node": ">=18.0.0"
},
"dependencies": {
"@tbd54566975/web5-agent": "0.1.0"
"@tbd54566975/web5-agent": "0.1.1"
},
"devDependencies": {
"@types/chai": "4.3.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/web5-user-agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tbd54566975/web5-user-agent",
"version": "0.1.0",
"version": "0.1.1",
"description": "Web5 User Agent",
"type": "module",
"main": "./dist/cjs/main.cjs",
Expand Down Expand Up @@ -52,8 +52,8 @@
}
},
"browser": {
"./dist/esm/index.js": "./dist/browser.mjs",
"./dist/cjs/index.js": "./dist/browser.js",
"./dist/esm/main.mjs": "./dist/browser.mjs",
"./dist/cjs/main.cjs": "./dist/browser.js",
"types": "./dist/types/main.d.ts"
},
"keywords": [
Expand All @@ -71,8 +71,8 @@
},
"dependencies": {
"@decentralized-identity/ion-tools": "1.0.7",
"@tbd54566975/dids": "0.1.0",
"@tbd54566975/dwn-sdk-js": "0.0.32-unstable-2023-05-15-1350300",
"@tbd54566975/dids": "0.1.1",
"@tbd54566975/dwn-sdk-js": "0.0.32",
"abstract-level": "1.0.3",
"cross-fetch": "3.1.5",
"flat": "5.0.2",
Expand Down
18 changes: 9 additions & 9 deletions packages/web5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tbd54566975/web5",
"version": "0.7.0",
"version": "0.7.1",
"description": "SDK for accessing the features and capabilities of Web5",
"type": "module",
"main": "./dist/cjs/main.cjs",
Expand Down Expand Up @@ -52,8 +52,8 @@
}
},
"browser": {
"./dist/esm/index.js": "./dist/browser.mjs",
"./dist/cjs/index.js": "./dist/browser.js",
"./dist/esm/main.mjs": "./dist/browser.mjs",
"./dist/cjs/main.cjs": "./dist/browser.js",
"types": "./dist/types/main.d.ts"
},
"keywords": [
Expand All @@ -75,12 +75,12 @@
},
"dependencies": {
"@decentralized-identity/ion-tools": "1.0.7",
"@tbd54566975/crypto": "0.1.0",
"@tbd54566975/dids": "0.1.0",
"@tbd54566975/dwn-sdk-js": "0.0.32-unstable-2023-05-15-1350300",
"@tbd54566975/web5-agent": "0.1.0",
"@tbd54566975/web5-proxy-agent": "0.1.0",
"@tbd54566975/web5-user-agent": "0.1.0",
"@tbd54566975/crypto": "0.1.1",
"@tbd54566975/dids": "0.1.1",
"@tbd54566975/dwn-sdk-js": "0.0.32",
"@tbd54566975/web5-agent": "0.1.1",
"@tbd54566975/web5-proxy-agent": "0.1.1",
"@tbd54566975/web5-user-agent": "0.1.1",
"cross-fetch": "3.1.5",
"level": "8.0.0",
"ms": "2.1.3",
Expand Down
10 changes: 8 additions & 2 deletions packages/web5/src/dwn-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export type ProtocolsQueryRequest = {
}

export type ProtocolsQueryResponse = {
protocols: ProtocolsQueryReplyEntry[];
protocols: Protocol[];
status: MessageReply['status'];
}

Expand Down Expand Up @@ -158,7 +158,13 @@ export class DwnApi {
});

const { reply: { entries, status } } = agentResponse;
const protocols = entries as ProtocolsQueryReplyEntry[];
// const protocols = entries as ProtocolsQueryReplyEntry[];

const protocols = entries.map((entry: ProtocolsQueryReplyEntry) => {
const metadata = { author: this.connectedDid, };

return new Protocol(this.web5Agent, entry, metadata);
});

return { protocols, status };
}
Expand Down
Loading

0 comments on commit 8710760

Please sign in to comment.