Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): declarative deployment #1702

Merged
merged 59 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
310b30b
add sendTransaction helper
holic Oct 4, 2023
e815a7a
start new deploy command with deployment proxy
holic Oct 4, 2023
68fcad3
deterministic world factory
holic Oct 4, 2023
f7ff52d
deploy world
holic Oct 4, 2023
72c893b
register tables
holic Oct 4, 2023
52394a3
this is no longer the case with resource types
holic Oct 4, 2023
e79e718
register systems
holic Oct 4, 2023
dff6637
improve logs
holic Oct 4, 2023
9df0429
rename create2 dir
holic Oct 4, 2023
681e2af
get world deploy and resource IDs
holic Oct 4, 2023
f26472c
refactor world deploy handling
holic Oct 5, 2023
cf60adb
clarify resourceId (hex) from resource (object)
holic Oct 5, 2023
3aef65e
wip
holic Oct 5, 2023
bcb3cbd
resolve custom types
holic Oct 5, 2023
f374af9
upgrade systems
holic Oct 5, 2023
43949a6
register system functions
holic Oct 5, 2023
5a897fb
wip system functions
holic Oct 5, 2023
29e0506
small clean up
holic Oct 6, 2023
862eb42
register functions
holic Oct 6, 2023
ba64b40
grant/revoke access
holic Oct 6, 2023
d017e9f
install modules
holic Oct 6, 2023
2e3d242
install modules
holic Oct 6, 2023
2e952b4
make sure to pass toBlock into getters
holic Oct 6, 2023
e2d0052
Merge remote-tracking branch 'origin/main' into holic/declarative-dep…
holic Oct 9, 2023
bfe7ec6
revert example change
holic Oct 9, 2023
4abb58f
migrate deploy command
holic Oct 9, 2023
bc5b45e
replace deploy, test, dev-contracts with new deploy internals
holic Oct 10, 2023
f271c13
more clean up
holic Oct 10, 2023
2d4b602
Merge remote-tracking branch 'origin/main' into holic/declarative-dep…
holic Oct 10, 2023
bdcce1d
revert as const for now, remove invalid test
holic Oct 10, 2023
edf84df
only run postdeploy for fresh worlds
holic Oct 10, 2023
839e665
opts -> options
holic Oct 10, 2023
3fce375
remove comment
holic Oct 10, 2023
9c6f04f
bump debounce time, add comment
holic Oct 10, 2023
d0fe353
Merge remote-tracking branch 'origin/main' into holic/declarative-dep…
holic Oct 10, 2023
71a106d
use hello events from store/world
holic Oct 10, 2023
8d1acd5
clarify comment
holic Oct 10, 2023
ad4efd8
add store/world version check
holic Oct 10, 2023
ac664d1
assert namespace owner
holic Oct 10, 2023
130d661
update comment
holic Oct 10, 2023
c11956b
rename to/from block
holic Oct 10, 2023
96f9769
update comments
holic Oct 10, 2023
f0ce45d
consistency
holic Oct 10, 2023
bed3180
clarify vars
holic Oct 10, 2023
6d385fb
Update packages/cli/src/deploy/resolveConfig.ts
holic Oct 10, 2023
7028e31
Update packages/cli/src/runDeploy.ts
holic Oct 10, 2023
534eb96
Update packages/cli/src/runDeploy.ts
holic Oct 10, 2023
9c35a5a
Update packages/cli/src/deploy/deploy.ts
holic Oct 10, 2023
745b883
fix/remove TODOs
holic Oct 10, 2023
9419c02
fix test data script, update test data
holic Oct 11, 2023
6d28203
fix e2e
holic Oct 11, 2023
5857688
fix user types internal type
holic Oct 11, 2023
37fd725
update snapshots
holic Oct 11, 2023
bc2c714
no longer a constraint
holic Oct 11, 2023
5c3b409
Create wicked-pens-promise.md
holic Oct 11, 2023
4c7e7ff
Create poor-bags-stare.md
holic Oct 11, 2023
1791c65
Update poor-bags-stare.md
holic Oct 11, 2023
360009d
simplify function sig usage, remove unused utils
holic Oct 11, 2023
339ffd1
Update poor-bags-stare.md
holic Oct 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/main' into holic/declarative-dep…
…loyment
  • Loading branch information
holic committed Oct 10, 2023
commit d0fe3539f4da362cdcdca501a6a40ca8860c4736
2 changes: 2 additions & 0 deletions next-docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.next
node_modules
23 changes: 23 additions & 0 deletions next-docs/components/Aside.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ReactNode } from "react";

type Props = {
emoji?: string;
children: ReactNode;
};

export function Aside({ emoji, children }: Props) {
return (
<aside
style={{ padding: "1em", border: "2px dashed rgba(128, 128, 128, .3)", borderRadius: "1em", margin: "1em 0" }}
>
{emoji ? (
<div style={{ display: "grid", gridTemplateColumns: "max-content 1fr", gap: "0.75em" }}>
<div style={{ fontSize: "1.5em", marginLeft: "-.25em" }}>{emoji}</div>
<div>{children}</div>
</div>
) : (
<>{children}</>
)}
</aside>
);
}
59 changes: 59 additions & 0 deletions next-docs/components/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from "react";
import { useState } from "react";

const Card = ({ title, text, iconSVG }) => {
const [hover, setHover] = useState(false);

const styles = {
cardBackground: {
display: "flex",
padding: "16px",
alignItems: "center",
gap: "12px",
flex: "1 0 0",
borderRadius: "4px",
border: "1px solid rgba(0, 0, 0, 0.08)",
transition: "background-color 0.3s, color 0.3s",
backgroundColor: hover ? "#F2F0EE" : "#FAFAF9",
},
cardContent: {
display: "flex",
flexDirection: "column",
alignItems: "flex-start",
gap: "4px",
flex: "1 0 0",
},
icon: {
display: "flex",
padding: "4px",
alignItems: "center",
},
header: {
color: "#000",
fontSize: "18px",
fontStyle: "normal",
fontWeight: "600",
lineHeight: "24px",
},
text: {
color: "rgba(0, 0, 0, 0.70)",
fontSize: "15px",
fontStyle: "normal",
fontWeight: "400",
lineHeight: "20px",
},
} as const;

return (
<div style={styles.cardBackground} onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)}>
<div style={styles.icon}>{iconSVG}</div>

<div style={styles.cardContent}>
<div style={styles.header}>{title}</div>
<div style={styles.text}>{text}</div>
</div>
</div>
);
};

export default Card;
12 changes: 12 additions & 0 deletions next-docs/components/CardGrid.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* CardGrid.css */

.cardGrid {
display: grid;
gap: 16px;
}

@media (min-width: 1024px) {
.cardGrid {
grid-template-columns: repeat(2, 1fr);
}
}
8 changes: 8 additions & 0 deletions next-docs/components/CardGrid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";
import styles from "./CardGrid.module.css"; // Import the CSS module

const CardGrid = ({ children }) => {
return <div className={styles.cardGrid}>{children}</div>;
};

export default CardGrid;
36 changes: 36 additions & 0 deletions next-docs/components/CollapseCode.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* Show zoom cursor if we have collapsible lines */
.collapsed:has(:global(.line[data-highlight-distance="4"])) {
cursor: zoom-in;
}
.expanded:has(:global(.line[data-highlight-distance="4"])) {
cursor: zoom-out;
}

/* Hide any lines that are 4+ lines away from a highlighted one */
.collapsed :global(.line[data-highlight-distance="4"]) {
opacity: 0;
position: absolute;
pointer-events: none;
}

/* Add a border between the lines hidden above */
.collapsed
:global(
.line[data-highlight-distance="3"] ~ .line[data-highlight-distance="4"] + .line[data-highlight-distance="3"]
) {
border-top: 1px dashed rgba(107, 114, 128, 0.5);
margin-top: 0.5ex;
padding-top: 0.5ex;
}

/* Fade out lines based on distance, but fade in on hover */
.collapsed :global(.line[data-highlight-distance="3"]),
.collapsed :global(.line[data-highlight-distance="2"]) {
transition: opacity 0.2s ease-in-out;
}
.collapsed:not(:hover) :global(.line[data-highlight-distance="3"]) {
opacity: 0.3;
}
.collapsed:not(:hover) :global(.line[data-highlight-distance="2"]) {
opacity: 0.6;
}
45 changes: 45 additions & 0 deletions next-docs/components/CollapseCode.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { ReactNode, useRef, useEffect, useState } from "react";
import styles from "./CollapseCode.module.css";

type Props = {
children: ReactNode;
};

export function CollapseCode({ children }: Props) {
const ref = useRef<HTMLDivElement>();
const [collapsed, setCollapsed] = useState(true);

useEffect(() => {
if (!ref.current) return;
const lines = Array.from(ref.current.querySelectorAll(".line"));
const highlightedPositions = [];
lines.forEach((line, i) => {
if (line.matches(".highlighted")) {
highlightedPositions.push(i);
}
if (/^\s+$/g.test(line.innerHTML)) {
line.setAttribute("data-empty", "");
}
});
if (!highlightedPositions.length) return;
lines.forEach((line, i) => {
const distance = highlightedPositions.reduce((min, pos) => Math.min(min, Math.abs(pos - i)), Infinity);
line.setAttribute("data-highlight-distance", Math.min(distance, 4).toString());
});
}, [collapsed]);

return (
<div
ref={ref}
style={{ marginTop: "1.5rem" }}
className={collapsed ? styles.collapsed : styles.expanded}
onClick={(event) => {
if (event.target instanceof Element && event.target.closest(".line")) {
setCollapsed(!collapsed);
}
}}
>
{children}
</div>
);
}
5 changes: 5 additions & 0 deletions next-docs/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from "react";

export default function Logo() {
return <img src="/mud-cover-photo.png" alt="MUD logo" />;
}
16 changes: 16 additions & 0 deletions next-docs/components/NavLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { useTheme } from "nextra-theme-docs";

export default function NavLogo() {
const { resolvedTheme } = useTheme();
return (
<div style={{ display: "grid", gridAutoFlow: "column", alignItems: "center" }}>
{/* TODO: figure out how to size Logo and use that here instead */}
<img
src={resolvedTheme === "light" ? "/logo512-black.png" : "/logo512-white.png"}
style={{ height: "calc(var(--nextra-navbar-height) - 25px)" }}
alt="MUD logo"
/>
<p style={{ fontWeight: "bold", fontSize: "25px", marginTop: "6px", paddingLeft: "4px" }}>MUD</p>
</div>
);
}
91 changes: 91 additions & 0 deletions next-docs/components/Splash.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.splashOverlay {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.4);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
backdrop-filter: blur(10px);
}

.splashContent {
background: #715845;
color: white;
padding: 20px;
max-width: 80vw;
max-height: 80vh;
overflow: auto;
position: relative;
}

.splashClose {
position: absolute;
top: 0px;
right: 10px;
border: none;
background: transparent;
font-size: 1.5em;
cursor: pointer;
}

.content {
text-align: center;
}

.logo {
width: 200px;
margin: 0 auto;
}

.date {
margin-top: 10px;
font-size: 15px;
color: white;
}

.title {
font-size: 20px;
color: white;
font-weight: bold;
}

.signupButton {
display: inline-block;
color: white;
background-color: #7d7373;
border: none;
border-radius: 0;
padding: 5px 70px;
margin-top: 20px;
cursor: pointer;
font-weight: bold;
}

.separator {
border: 1px solid rgba(0, 0, 0, 0.25);
margin: 20px 0;
margin-top: 25px;
}

.info {
font-size: 15px;
color: white;
display: flex;
align-items: center;
padding: 0px 20px;
text-align: left;
}

.info span {
margin-right: 10px;
font-size: 25px;
}

.info a {
color: white;
text-decoration: underline;
}
44 changes: 44 additions & 0 deletions next-docs/components/WarningBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React from "react";

const WarningBox = ({ title, message }) => {
const styles = {
container: {
backgroundColor: "#FDF2F3",
borderRadius: "4px",
border: "1px solid #E8D9DA",
padding: "12px 20px",
margin: "16px 0",
color: "#7D221C",
},
header: {
display: "flex",
alignItems: "center",
fontSize: "1rem",
fontWeight: "bold",
lineHeight: "1.43",
},
icon: {
marginRight: "12px",
fontSize: "22px",
},
message: {
fontSize: "1rem",
fontWeight: "400",
lineHeight: "1.43",
paddingLeft: "34px",
color: "#995A56",
},
};

return (
<div style={styles.container}>
<div style={styles.header}>
<span style={styles.icon}>⚠</span>
{title}
</div>
<div style={styles.message}>{message}</div>
</div>
);
};

export default WarningBox;
5 changes: 5 additions & 0 deletions next-docs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
8 changes: 8 additions & 0 deletions next-docs/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import nextra from "nextra";

const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});

export default withNextra();
27 changes: 27 additions & 0 deletions next-docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "docs",
"version": "1.0.0",
"private": true,
"description": "mud.dev docs",
"license": "",
"type": "module",
"main": "index.js",
"scripts": {
"build": "next build",
"dev": "next dev",
"start": "next start"
},
"dependencies": {
"next": "^13.3.0",
"nextra": "^2.10.0",
"nextra-theme-docs": "^2.10.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "18.11.10",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"typescript": "5.1.6"
}
}
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.