This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into joaquim/use_isbrowser
- Loading branch information
Showing
17 changed files
with
366 additions
and
139 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# folders | ||
|
||
dist/ | ||
.swc/ | ||
abis/ | ||
|
||
# files |
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
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,2 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
window.Buffer = require("buffer/").Buffer; |
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,24 @@ | ||
diff --git a/node_modules/util/util.js b/node_modules/util/util.js | ||
index 6eea657..eaa0226 100644 | ||
--- a/node_modules/util/util.js | ||
+++ b/node_modules/util/util.js | ||
@@ -614,14 +614,14 @@ exports.promisify = function promisify(original) { | ||
throw new TypeError('The "original" argument must be of type Function'); | ||
|
||
if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { | ||
- var fn = original[kCustomPromisifiedSymbol]; | ||
- if (typeof fn !== 'function') { | ||
+ var _fn = original[kCustomPromisifiedSymbol]; | ||
+ if (typeof _fn !== 'function') { | ||
throw new TypeError('The "util.promisify.custom" argument must be of type Function'); | ||
} | ||
- Object.defineProperty(fn, kCustomPromisifiedSymbol, { | ||
- value: fn, enumerable: false, writable: false, configurable: true | ||
+ Object.defineProperty(_fn, kCustomPromisifiedSymbol, { | ||
+ value: _fn, enumerable: false, writable: false, configurable: true | ||
}); | ||
- return fn; | ||
+ return _fn; | ||
} | ||
|
||
function fn() { |
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
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
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 |
---|---|---|
@@ -1,9 +1,49 @@ | ||
import alias from "esbuild-plugin-alias"; | ||
import path from "path"; | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
entry: ["src/index.ts"], | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
format: ["cjs", "esm"], | ||
}); | ||
export default defineConfig([ | ||
// build normal build | ||
{ | ||
name: "package", | ||
entry: ["src/index.ts"], | ||
sourcemap: true, | ||
// we'll just manually "clean" the dist dir before running this (to avoid potential race conditions) | ||
clean: false, | ||
minify: true, | ||
platform: "node", | ||
replaceNodeEnv: true, | ||
globalName: "ThirdwebSDK", | ||
format: ["cjs", "esm"], | ||
}, | ||
// also build iife (UMD build for <script> tag use) | ||
{ | ||
name: "script", | ||
entry: ["src/index.ts"], | ||
sourcemap: true, | ||
// we'll just manually "clean" the dist dir before running this (to avoid potential race conditions | ||
clean: false, | ||
minify: true, | ||
platform: "browser", | ||
replaceNodeEnv: true, | ||
shims: true, | ||
globalName: "_thirdweb", | ||
format: ["iife"], | ||
keepNames: true, | ||
inject: ["./injected-shims/iife-shims.js"], | ||
// inject globals onto window | ||
banner: { | ||
js: 'window.global=window;window.globalThis=window;window.process={env:{NODE_ENV:"production"}};', | ||
}, | ||
// inject ThirdwebSDK into window | ||
footer: { js: "window.ThirdwebSDK = window._thirdweb.ThirdwebSDK;" }, | ||
esbuildPlugins: [ | ||
alias({ | ||
stream: path.resolve( | ||
__dirname, | ||
`node_modules/stream-browserify/index.js`, | ||
), | ||
}), | ||
], | ||
}, | ||
]); |
Oops, something went wrong.