Skip to content

Commit 6cdd3cd

Browse files
committed
feat: wasm webcontainer
1 parent 3202ad7 commit 6cdd3cd

30 files changed

+3464
-202
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,16 @@ The upgradability of contracts on other chains, connections, token configuration
3838
| [`evm`](./evm) | [EVM] smart contract stack | [Solidity] |
3939
| [`app`](./app) | [app.union.build] | [TypeScript] [Svelte] |
4040
| [`site`](./site) | [union.build] | [TypeScript] [Astro] |
41+
| [`TypeScript SDK`](./typescript-sdk) | TypeScript SDK for interacting with Union | [TypeScript] |
4142

4243
## Quickstart
4344

4445
Install [Nix] to _[reproducibly build](https://en.wikipedia.org/wiki/Reproducible_builds) any component_, and to enter a dev shell with _all dependencies_:
45-
```
46+
47+
```sh
4648
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
4749
```
50+
4851
_(Note that some components can only be built on Linux. If you are using macOS, we recommend using [OrbStack] to easily set up a [NixOS] VM within two minutes. Most Union developers use macOS with [OrbStack], and there is no need to install Nix inside of the [NixOS] VM.)_
4952

5053
You can now _reproducibly_ build any of Union's components from source:
@@ -60,7 +63,7 @@ nix flake show
6063

6164
The result of whatever you build will be in `result/`
6265

63-
You can now also enter our dev shell, which has all of the dependencies (`cargo`, `rustc`, `node`, `go`, etc.) you need to work on any component:
66+
You can now also enter our dev shell, which has all of the dependencies (`cargo`, `rustc`, `node`, `go`, etc.) you need to work on any component:
6467
_(Don't worry, this will not affect your system outside of this repo)_
6568

6669
```sh

biome.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"*.ts",
1212
"*.mts",
1313
"*.js",
14+
"*.mjs",
1415
"*.cjs",
1516
"*.jsx",
1617
"*.tsx",
1718
"*.vue",
19+
"*.css",
1820
"*.d.ts",
1921
"*.json",
2022
"*.jsonc",
@@ -64,6 +66,7 @@
6466
"*.tsx",
6567
"*.d.ts",
6668
"*.vue",
69+
"*.css",
6770
"*.json",
6871
"*.jsonc",
6972
"*.astro",
@@ -110,6 +113,7 @@
110113
"*.ts",
111114
"*.mts",
112115
"*.js",
116+
"*.mjs",
113117
"*.cjs",
114118
"*.jsx",
115119
"*.tsx",
@@ -215,6 +219,7 @@
215219
"*.ts",
216220
"*.mts",
217221
"*.js",
222+
"*.mjs",
218223
"*.cjs",
219224
"*.jsx",
220225
"*.tsx",

docs/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ auto-install-peers=true
33
enable-pre-post-scripts=true
44
strict-peer-dependencies=false
55
node-options="--no-warnings"
6+
@jsr:registry=https://npm.jsr.io

docs/_headers

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/*
2+
Cross-Origin-Embedder-Policy: require-corp
3+
Cross-Origin-Opener-Policy: same-origin

docs/astro.config.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { loadEnv } from "vite"
2+
import vue from "@astrojs/vue"
23
import svelte from "@astrojs/svelte"
34
import sitemap from "@astrojs/sitemap"
45
import tailwind from "@astrojs/tailwind"
@@ -27,7 +28,17 @@ export default defineConfig({
2728
},
2829
trailingSlash: "ignore",
2930
markdown: markdownConfiguration,
30-
server: _ => ({ port: Number(PORT) }),
31+
server: _ => ({
32+
port: Number(PORT),
33+
/**
34+
* required for webcointainer
35+
* @see https://webcontainers.io/guides/quickstart
36+
*/
37+
headers: {
38+
"Cross-Origin-Embedder-Policy": "require-corp",
39+
"Cross-Origin-Opener-Policy": "same-origin"
40+
}
41+
}),
3142
devToolbar: { enabled: ENABLE_DEV_TOOLBAR === "true" },
3243
prefetch: { prefetchAll: true, defaultStrategy: "viewport" },
3344
redirects: { "/logo": "/union-logo.zip" },
@@ -115,7 +126,7 @@ export default defineConfig({
115126
},
116127
{
117128
label: "API",
118-
collapsed: true,
129+
collapsed: false,
119130
autogenerate: {
120131
directory: "/integrations/api"
121132
}
@@ -139,17 +150,19 @@ export default defineConfig({
139150
],
140151
plugins: [starlightLinksValidator(), starlightHeadingBadges()],
141152
customCss: [
153+
"./src/styles/index.css",
142154
"./src/styles/fonts.css",
143155
"./src/styles/tailwind.css",
144156
"./src/styles/starlight.css",
145157
"./node_modules/katex/dist/katex.min.css"
146158
]
147159
}),
160+
sitemap(),
148161
tailwind({
149162
applyBaseStyles: false,
150163
configFile: "tailwind.config.ts"
151164
}),
152165
svelte(),
153-
sitemap()
166+
vue({ jsx: true, devtools: true })
154167
]
155168
})

docs/docs.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
packages = {
1111
docs = mkCi false (unstablePkgs.buildNpmPackage {
12-
npmDepsHash = "sha256-qpW7fsNOEi/dnb9QdXgIrhZguy4xgFGScLgp4cPJQls=";
12+
npmDepsHash = "sha256-3Ip3T+Kfc5X2gZ/KzgLWTtfnQf7lCK+CsoTKwAB9ynw=";
1313
src = ./.;
1414
srcs = [ ./. ./../evm/. ./../networks/genesis/. ./../versions/. ];
1515
sourceRoot = "docs";

docs/ec.config.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
12
import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections";
23

34
/** @type {import('@astrojs/starlight/expressive-code').StarlightExpressiveCodeOptions} */
@@ -8,9 +9,11 @@ export default {
89
showCopyToClipboardButton: true,
910
removeCommentsWhenCopyingTerminalFrames: true,
1011
},
11-
styleOverrides: {},
12+
defaultProps: {
13+
showLineNumbers: false,
14+
},
1215
useStarlightUiThemeColors: true,
1316
useStarlightDarkModeSwitch: true,
14-
themes: ["starlight-dark", "starlight-light"],
15-
plugins: [pluginCollapsibleSections()],
17+
themes: ["houston", "starlight-light"],
18+
plugins: [pluginCollapsibleSections(), pluginLineNumbers()],
1619
};

0 commit comments

Comments
 (0)