-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2815338
Showing
11 changed files
with
697 additions
and
0 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 @@ | ||
node_modules |
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 @@ | ||
src/ | ||
esbuild.config.mjs | ||
*.ts | ||
*.tsx |
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,41 @@ | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
|
||
// src/index.tsx | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
MyComponent: () => MyComponent | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
function MyComponent({ | ||
children, | ||
person | ||
}) { | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ | ||
children, | ||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [ | ||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { children: person.name }), | ||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: person.age }) | ||
] }) | ||
] }); | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
MyComponent | ||
}); |
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,9 @@ | ||
import * as React from "react"; | ||
export interface Person { | ||
name: string; | ||
age: number; | ||
} | ||
export declare function MyComponent({ children, person, }: { | ||
children: React.ReactNode; | ||
person: Person; | ||
}): any; |
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,17 @@ | ||
// src/index.tsx | ||
import { Fragment, jsx, jsxs } from "react/jsx-runtime"; | ||
function MyComponent({ | ||
children, | ||
person | ||
}) { | ||
return /* @__PURE__ */ jsxs(Fragment, { children: [ | ||
children, | ||
/* @__PURE__ */ jsxs("div", { children: [ | ||
/* @__PURE__ */ jsx("h1", { children: person.name }), | ||
/* @__PURE__ */ jsx("h2", { children: person.age }) | ||
] }) | ||
] }); | ||
} | ||
export { | ||
MyComponent | ||
}; |
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,27 @@ | ||
import { build } from "esbuild"; | ||
|
||
const isProduction = process.env.NODE_ENV === "production"; | ||
|
||
// Build for CommonJS | ||
build({ | ||
entryPoints: ["src/index.tsx"], // or 'src/index.jsx' if not using TypeScript | ||
bundle: true, | ||
outfile: "dist/index.cjs.js", | ||
platform: "node", | ||
target: ["es6"], // Target ECMAScript 6 | ||
format: "cjs", // CommonJS format | ||
external: ["react", "react-dom"], // Don't bundle React and ReactDOM | ||
sourcemap: !isProduction, | ||
}).catch(() => process.exit(1)); | ||
|
||
// Build for ESModule | ||
build({ | ||
entryPoints: ["src/index.tsx"], | ||
bundle: true, | ||
outfile: "dist/index.esm.js", | ||
platform: "neutral", | ||
target: ["es6"], | ||
format: "esm", // ESModule format | ||
external: ["react", "react-dom"], | ||
sourcemap: !isProduction, | ||
}).catch(() => process.exit(1)); |
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,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>0x-parser</title> | ||
<link href="./favicon.png" rel="shortcut icon" type="image/x-icon" /> | ||
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> | ||
<script type="module"> | ||
async function example() { | ||
console.log("hello"); | ||
} | ||
|
||
example(); | ||
</script> | ||
</head> | ||
<body | ||
style=" | ||
font-family: monospace; | ||
font-size: 20px; | ||
padding: 0 24px; | ||
background: #222; | ||
color: #fff; | ||
" | ||
> | ||
<h1>0x-parser</h1> | ||
<p>Open the JavaScript console to see the parsed swap data.</p> | ||
<p> | ||
For more info, see the blog post | ||
<a | ||
style="font-weight: semi-bold; font-size: 24px; color: goldenrod" | ||
href="https://medium.com/@henballs/0x-parser-parsing-dex-transactions-9f9a6579d489" | ||
>0x-parser: Parsing DEX Transactions</a | ||
>. | ||
</p> | ||
</body> | ||
</html> |
Oops, something went wrong.