generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change wasm bundler to directly output to src/wasm * Add dist/esm output, add dist/types output * Add cjs build, add browser build * Add single index.ts entrypoint * Add package.json entry points, fix cjs type * Rename scripts to bundle-wasm * Fix tests * Change bundle to single entrypoint * Add starter hosted-wallet-ts * Add src/tbdex.ts * Remove ts-node * Add sed hack
- Loading branch information
1 parent
51cb75f
commit ee2994a
Showing
22 changed files
with
445 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import esbuild from "esbuild"; | ||
|
||
const browserConfig = { | ||
entryPoints : ["./src/index.ts"], | ||
bundle : true, | ||
format : "esm", | ||
sourcemap : true, | ||
minify : true, | ||
platform : "browser", | ||
target : ["chrome101", "firefox108", "safari16"], | ||
define : { | ||
"global": "globalThis", | ||
}, | ||
}; | ||
|
||
// esm polyfilled bundle for browser | ||
esbuild.build({ | ||
...browserConfig, | ||
outfile: "dist/browser.mjs", | ||
}); | ||
|
||
// iife polyfilled bundle for browser | ||
esbuild.build({ | ||
...browserConfig, | ||
format : "iife", | ||
globalName : "tbDEX", | ||
outfile : "dist/browser.js", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import esbuild from "esbuild"; | ||
|
||
esbuild.build({ | ||
entryPoints: ["./src/index.ts"], | ||
bundle: true, | ||
format: "cjs", | ||
sourcemap: true, | ||
minify: true, | ||
platform: "node", | ||
outfile: "dist/index.cjs", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import esbuild from "esbuild"; | ||
|
||
esbuild.build({ | ||
entryPoints: ["./src/index.ts"], | ||
bundle: true, | ||
format: "esm", | ||
sourcemap: true, | ||
minify: true, | ||
platform: "node", | ||
outfile: "dist/index.mjs", | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
sed -i '' "/export { default } from \"\.\/generated\";/r src/wasm/generated.d.ts" dist/index.d.ts && \ | ||
sed -i '' "/export { default } from \"\.\/generated\";/d" dist/index.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// credentials | ||
export * from "./credentials/presentation-definition"; | ||
|
||
// crypto | ||
export * from "./crypto/in-memory-key-manager"; | ||
export * from "./crypto/jwk"; | ||
export * from "./crypto/key-manager"; | ||
export * from "./crypto/signer"; | ||
|
||
// dids | ||
export * from "./dids/bearer-did"; | ||
export * from "./dids/did"; | ||
export * from "./dids/document"; | ||
export * from "./dids/portable-did"; | ||
|
||
// http | ||
export * from "./http/exchanges"; | ||
export * from "./http/balances"; | ||
export * from "./http/offerings"; | ||
|
||
// http-client | ||
export * from "./http-client/balances"; | ||
export * from "./http-client/exchanges"; | ||
export * from "./http-client/offerings"; | ||
|
||
// messages | ||
export * from "./messages"; | ||
|
||
// resources | ||
export * from "./resources"; | ||
|
||
// errors | ||
export * from "./errors"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./index" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"strict": true, | ||
"useUnknownInCatchVariables": false, | ||
"outDir": "compiled", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"declarationDir": "compiled/types", | ||
"sourceMap": true, | ||
}, | ||
"include": [ | ||
"../src", | ||
".", | ||
], | ||
"exclude": [ | ||
"./compiled" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"lib": [ | ||
"DOM", | ||
"ES2015", | ||
], | ||
"target": "ES5", | ||
"outDir": "dist/cjs" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.