create-microact-app 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +95 -0
- package/package.json +21 -0
- package/templates/vanilla/.github/workflows/deploy.yml +38 -0
- package/templates/vanilla/index.html +13 -0
- package/templates/vanilla/node_modules/.package-lock.json +207 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/README.md +3 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/package.json +17 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/README.md +154 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js +1749 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js +1743 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js +2 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js.map +1 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.html +13 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.js +63 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/package.json +38 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/rollup.config.cjs +30 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Component.js +831 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/DOMUpdater.js +320 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/EventBus.js +123 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Router.js +253 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/UpdateScheduler.js +218 -0
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/index.js +6 -0
- package/templates/vanilla/node_modules/esbuild/LICENSE.md +21 -0
- package/templates/vanilla/node_modules/esbuild/README.md +3 -0
- package/templates/vanilla/node_modules/esbuild/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/esbuild/install.js +287 -0
- package/templates/vanilla/node_modules/esbuild/lib/main.d.ts +660 -0
- package/templates/vanilla/node_modules/esbuild/lib/main.js +2393 -0
- package/templates/vanilla/node_modules/esbuild/package.json +42 -0
- package/templates/vanilla/node_modules/nanoid/LICENSE +20 -0
- package/templates/vanilla/node_modules/nanoid/README.md +39 -0
- package/templates/vanilla/node_modules/nanoid/async/index.browser.cjs +69 -0
- package/templates/vanilla/node_modules/nanoid/async/index.browser.js +34 -0
- package/templates/vanilla/node_modules/nanoid/async/index.cjs +71 -0
- package/templates/vanilla/node_modules/nanoid/async/index.d.ts +56 -0
- package/templates/vanilla/node_modules/nanoid/async/index.js +35 -0
- package/templates/vanilla/node_modules/nanoid/async/index.native.js +26 -0
- package/templates/vanilla/node_modules/nanoid/async/package.json +12 -0
- package/templates/vanilla/node_modules/nanoid/bin/nanoid.cjs +55 -0
- package/templates/vanilla/node_modules/nanoid/index.browser.cjs +72 -0
- package/templates/vanilla/node_modules/nanoid/index.browser.js +34 -0
- package/templates/vanilla/node_modules/nanoid/index.cjs +85 -0
- package/templates/vanilla/node_modules/nanoid/index.d.cts +91 -0
- package/templates/vanilla/node_modules/nanoid/index.d.ts +91 -0
- package/templates/vanilla/node_modules/nanoid/index.js +45 -0
- package/templates/vanilla/node_modules/nanoid/nanoid.js +1 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.cjs +34 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.d.ts +33 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/index.js +21 -0
- package/templates/vanilla/node_modules/nanoid/non-secure/package.json +6 -0
- package/templates/vanilla/node_modules/nanoid/package.json +89 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.cjs +7 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.js +3 -0
- package/templates/vanilla/node_modules/nanoid/url-alphabet/package.json +6 -0
- package/templates/vanilla/node_modules/picocolors/LICENSE +15 -0
- package/templates/vanilla/node_modules/picocolors/README.md +21 -0
- package/templates/vanilla/node_modules/picocolors/package.json +25 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.browser.js +4 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.d.ts +5 -0
- package/templates/vanilla/node_modules/picocolors/picocolors.js +75 -0
- package/templates/vanilla/node_modules/picocolors/types.d.ts +51 -0
- package/templates/vanilla/node_modules/postcss/LICENSE +20 -0
- package/templates/vanilla/node_modules/postcss/README.md +29 -0
- package/templates/vanilla/node_modules/postcss/lib/at-rule.d.ts +140 -0
- package/templates/vanilla/node_modules/postcss/lib/at-rule.js +25 -0
- package/templates/vanilla/node_modules/postcss/lib/comment.d.ts +68 -0
- package/templates/vanilla/node_modules/postcss/lib/comment.js +13 -0
- package/templates/vanilla/node_modules/postcss/lib/container.d.ts +483 -0
- package/templates/vanilla/node_modules/postcss/lib/container.js +447 -0
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.d.ts +248 -0
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.js +133 -0
- package/templates/vanilla/node_modules/postcss/lib/declaration.d.ts +151 -0
- package/templates/vanilla/node_modules/postcss/lib/declaration.js +24 -0
- package/templates/vanilla/node_modules/postcss/lib/document.d.ts +69 -0
- package/templates/vanilla/node_modules/postcss/lib/document.js +33 -0
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.js +54 -0
- package/templates/vanilla/node_modules/postcss/lib/input.d.ts +227 -0
- package/templates/vanilla/node_modules/postcss/lib/input.js +265 -0
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.d.ts +190 -0
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.js +550 -0
- package/templates/vanilla/node_modules/postcss/lib/list.d.ts +60 -0
- package/templates/vanilla/node_modules/postcss/lib/list.js +58 -0
- package/templates/vanilla/node_modules/postcss/lib/map-generator.js +368 -0
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.d.ts +46 -0
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.js +138 -0
- package/templates/vanilla/node_modules/postcss/lib/node.d.ts +556 -0
- package/templates/vanilla/node_modules/postcss/lib/node.js +449 -0
- package/templates/vanilla/node_modules/postcss/lib/parse.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/parse.js +42 -0
- package/templates/vanilla/node_modules/postcss/lib/parser.js +611 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.mts +69 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.ts +458 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.js +101 -0
- package/templates/vanilla/node_modules/postcss/lib/postcss.mjs +30 -0
- package/templates/vanilla/node_modules/postcss/lib/previous-map.d.ts +81 -0
- package/templates/vanilla/node_modules/postcss/lib/previous-map.js +144 -0
- package/templates/vanilla/node_modules/postcss/lib/processor.d.ts +115 -0
- package/templates/vanilla/node_modules/postcss/lib/processor.js +67 -0
- package/templates/vanilla/node_modules/postcss/lib/result.d.ts +205 -0
- package/templates/vanilla/node_modules/postcss/lib/result.js +42 -0
- package/templates/vanilla/node_modules/postcss/lib/root.d.ts +87 -0
- package/templates/vanilla/node_modules/postcss/lib/root.js +61 -0
- package/templates/vanilla/node_modules/postcss/lib/rule.d.ts +126 -0
- package/templates/vanilla/node_modules/postcss/lib/rule.js +27 -0
- package/templates/vanilla/node_modules/postcss/lib/stringifier.d.ts +46 -0
- package/templates/vanilla/node_modules/postcss/lib/stringifier.js +353 -0
- package/templates/vanilla/node_modules/postcss/lib/stringify.d.ts +9 -0
- package/templates/vanilla/node_modules/postcss/lib/stringify.js +11 -0
- package/templates/vanilla/node_modules/postcss/lib/symbols.js +5 -0
- package/templates/vanilla/node_modules/postcss/lib/terminal-highlight.js +70 -0
- package/templates/vanilla/node_modules/postcss/lib/tokenize.js +266 -0
- package/templates/vanilla/node_modules/postcss/lib/warn-once.js +13 -0
- package/templates/vanilla/node_modules/postcss/lib/warning.d.ts +147 -0
- package/templates/vanilla/node_modules/postcss/lib/warning.js +37 -0
- package/templates/vanilla/node_modules/postcss/package.json +88 -0
- package/templates/vanilla/node_modules/rollup/LICENSE.md +695 -0
- package/templates/vanilla/node_modules/rollup/README.md +125 -0
- package/templates/vanilla/node_modules/rollup/dist/bin/rollup +1715 -0
- package/templates/vanilla/node_modules/rollup/dist/es/getLogFilter.js +64 -0
- package/templates/vanilla/node_modules/rollup/dist/es/package.json +1 -0
- package/templates/vanilla/node_modules/rollup/dist/es/rollup.js +17 -0
- package/templates/vanilla/node_modules/rollup/dist/es/shared/node-entry.js +27273 -0
- package/templates/vanilla/node_modules/rollup/dist/es/shared/watch.js +4857 -0
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.d.ts +5 -0
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.js +69 -0
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.d.ts +20 -0
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.js +29 -0
- package/templates/vanilla/node_modules/rollup/dist/rollup.d.ts +1012 -0
- package/templates/vanilla/node_modules/rollup/dist/rollup.js +31 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/fsevents-importer.js +37 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/index.js +4571 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/loadConfigFile.js +546 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/rollup.js +27351 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-cli.js +561 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-proxy.js +87 -0
- package/templates/vanilla/node_modules/rollup/dist/shared/watch.js +316 -0
- package/templates/vanilla/node_modules/rollup/package.json +181 -0
- package/templates/vanilla/node_modules/source-map-js/LICENSE +28 -0
- package/templates/vanilla/node_modules/source-map-js/README.md +765 -0
- package/templates/vanilla/node_modules/source-map-js/lib/array-set.js +121 -0
- package/templates/vanilla/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/templates/vanilla/node_modules/source-map-js/lib/base64.js +67 -0
- package/templates/vanilla/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/templates/vanilla/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/templates/vanilla/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.d.ts +1 -0
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.js +413 -0
- package/templates/vanilla/node_modules/source-map-js/lib/util.js +594 -0
- package/templates/vanilla/node_modules/source-map-js/package.json +71 -0
- package/templates/vanilla/node_modules/source-map-js/source-map.d.ts +104 -0
- package/templates/vanilla/node_modules/source-map-js/source-map.js +8 -0
- package/templates/vanilla/node_modules/vite/LICENSE.md +3396 -0
- package/templates/vanilla/node_modules/vite/README.md +20 -0
- package/templates/vanilla/node_modules/vite/bin/openChrome.applescript +95 -0
- package/templates/vanilla/node_modules/vite/bin/vite.js +61 -0
- package/templates/vanilla/node_modules/vite/client.d.ts +281 -0
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs +725 -0
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs.map +1 -0
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs +30 -0
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs.map +1 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-7ec6f216.js +914 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-827b23df.js +66713 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-c423598f.js +561 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f0c7dae0.js +7930 -0
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f1e8587f.js +7646 -0
- package/templates/vanilla/node_modules/vite/dist/node/cli.js +929 -0
- package/templates/vanilla/node_modules/vite/dist/node/constants.js +130 -0
- package/templates/vanilla/node_modules/vite/dist/node/index.d.ts +3548 -0
- package/templates/vanilla/node_modules/vite/dist/node/index.js +158 -0
- package/templates/vanilla/node_modules/vite/dist/node-cjs/publicUtils.cjs +4555 -0
- package/templates/vanilla/node_modules/vite/index.cjs +34 -0
- package/templates/vanilla/node_modules/vite/package.json +173 -0
- package/templates/vanilla/node_modules/vite/types/customEvent.d.ts +35 -0
- package/templates/vanilla/node_modules/vite/types/hmrPayload.d.ts +61 -0
- package/templates/vanilla/node_modules/vite/types/hot.d.ts +32 -0
- package/templates/vanilla/node_modules/vite/types/importGlob.d.ts +97 -0
- package/templates/vanilla/node_modules/vite/types/importMeta.d.ts +26 -0
- package/templates/vanilla/node_modules/vite/types/metadata.d.ts +10 -0
- package/templates/vanilla/node_modules/vite/types/package.json +4 -0
- package/templates/vanilla/package-lock.json +589 -0
- package/templates/vanilla/package.json +17 -0
- package/templates/vanilla/src/components/App.js +60 -0
- package/templates/vanilla/src/components/Card.js +21 -0
- package/templates/vanilla/src/components/Hero.js +15 -0
- package/templates/vanilla/src/components/InteractiveDemo.js +59 -0
- package/templates/vanilla/src/main.js +9 -0
- package/templates/vanilla/src/style/main.css +172 -0
- package/templates/vanilla/vite.config.js +8 -0
- package/templates/web3/.env.example +15 -0
- package/templates/web3/.github/workflows/deploy.yml +38 -0
- package/templates/web3/README.md +33 -0
- package/templates/web3/contracts/foundry.toml +11 -0
- package/templates/web3/contracts/script/Deploy.s.sol +13 -0
- package/templates/web3/contracts/src/Counter.sol +21 -0
- package/templates/web3/index.html +13 -0
- package/templates/web3/package.json +25 -0
- package/templates/web3/scripts/chain-start.mjs +305 -0
- package/templates/web3/scripts/chain-stop.mjs +34 -0
- package/templates/web3/scripts/deploy.mjs +155 -0
- package/templates/web3/scripts/setup.mjs +42 -0
- package/templates/web3/src/components/App.js +49 -0
- package/templates/web3/src/components/CounterCard.js +111 -0
- package/templates/web3/src/main.js +54 -0
- package/templates/web3/src/style/main.css +345 -0
- package/templates/web3/vite.config.js +29 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component } from '@monygroupcorp/microact';
|
|
2
|
+
|
|
3
|
+
class Hero extends Component {
|
|
4
|
+
render() {
|
|
5
|
+
return `
|
|
6
|
+
<section class="hero">
|
|
7
|
+
<h1>Microact</h1>
|
|
8
|
+
<p>A lean, minimal React-like framework for client-side applications.</p>
|
|
9
|
+
<a href="https://github.com/Monygroup/microact" class="button">Learn More</a>
|
|
10
|
+
</section>
|
|
11
|
+
`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default Hero;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Component } from '@monygroupcorp/microact';
|
|
2
|
+
|
|
3
|
+
class InteractiveDemo extends Component {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.state = {
|
|
7
|
+
count: 0,
|
|
8
|
+
isHighlighted: false,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
events() {
|
|
13
|
+
return {
|
|
14
|
+
'click .demo__increment': 'handleIncrement',
|
|
15
|
+
'click .demo__reset': () => this.resetCount(),
|
|
16
|
+
'click .demo__toggle': (event) => {
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
this.toggleHighlight();
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
handleIncrement() {
|
|
24
|
+
this.setState({ count: this.state.count + 1 });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
resetCount() {
|
|
28
|
+
this.setState({ count: 0, isHighlighted: false });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
toggleHighlight() {
|
|
32
|
+
this.setState({ isHighlighted: !this.state.isHighlighted });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
const { count, isHighlighted } = this.state;
|
|
37
|
+
|
|
38
|
+
return `
|
|
39
|
+
<section class="interactive-demo ${isHighlighted ? 'interactive-demo--active' : ''}">
|
|
40
|
+
<div class="demo__copy">
|
|
41
|
+
<p>This widget exercises Microact's event system using both method references and inline functions.</p>
|
|
42
|
+
<p>Try clicking the buttons to update state and see the DOM update without a full re-render.</p>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="demo__controls">
|
|
45
|
+
<p class="demo__count" aria-live="polite">
|
|
46
|
+
Button clicked <strong>${count}</strong> ${count === 1 ? 'time' : 'times'}
|
|
47
|
+
</p>
|
|
48
|
+
<div class="demo__buttons">
|
|
49
|
+
<button class="demo__increment">Increment</button>
|
|
50
|
+
<button class="demo__toggle">${isHighlighted ? 'Disable' : 'Enable'} Highlight</button>
|
|
51
|
+
<button class="demo__reset" type="reset">Reset</button>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</section>
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export default InteractiveDemo;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--background-color: #ffffff;
|
|
3
|
+
--text-color: #212529;
|
|
4
|
+
--primary-font: 'Helvetica Neue', Arial, sans-serif;
|
|
5
|
+
--secondary-font: 'Georgia', serif;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
body {
|
|
9
|
+
font-family: var(--primary-font);
|
|
10
|
+
background-color: var(--background-color);
|
|
11
|
+
color: var(--text-color);
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
line-height: 1.6;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.app-container {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
min-height: 100vh;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.main-content {
|
|
24
|
+
flex: 1;
|
|
25
|
+
padding: 4rem 2rem;
|
|
26
|
+
max-width: 960px;
|
|
27
|
+
margin: 0 auto;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.hero {
|
|
31
|
+
text-align: center;
|
|
32
|
+
padding: 4rem 2rem;
|
|
33
|
+
border-bottom: 1px solid #dee2e6;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.hero h1 {
|
|
37
|
+
font-size: 3.5rem;
|
|
38
|
+
font-weight: 300;
|
|
39
|
+
margin-bottom: 1rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.hero p {
|
|
43
|
+
font-size: 1.25rem;
|
|
44
|
+
color: #6c757d;
|
|
45
|
+
margin-bottom: 2rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.hero .button {
|
|
49
|
+
background-color: #007bff;
|
|
50
|
+
color: #ffffff;
|
|
51
|
+
padding: 0.75rem 1.5rem;
|
|
52
|
+
text-decoration: none;
|
|
53
|
+
border-radius: 2rem;
|
|
54
|
+
font-weight: 500;
|
|
55
|
+
transition: background-color 0.2s;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.hero .button:hover {
|
|
59
|
+
background-color: #0056b3;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.card-container {
|
|
63
|
+
display: grid;
|
|
64
|
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
65
|
+
gap: 2rem;
|
|
66
|
+
margin-top: 4rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.card {
|
|
70
|
+
background-color: transparent;
|
|
71
|
+
border: 1px solid #dee2e6;
|
|
72
|
+
border-radius: 0.25rem;
|
|
73
|
+
padding: 2rem;
|
|
74
|
+
text-align: left;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.card h3 {
|
|
78
|
+
font-family: var(--secondary-font);
|
|
79
|
+
font-size: 1.5rem;
|
|
80
|
+
margin-bottom: 1rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.footer {
|
|
84
|
+
text-align: center;
|
|
85
|
+
padding: 2rem;
|
|
86
|
+
font-size: 0.9rem;
|
|
87
|
+
color: #6c757d;
|
|
88
|
+
border-top: 1px solid #dee2e6;
|
|
89
|
+
position: relative;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.footer p::before {
|
|
93
|
+
content: "©"; /* Standard copyright symbol */
|
|
94
|
+
display: inline-block;
|
|
95
|
+
transform: scaleX(-1); /* Flip horizontally */
|
|
96
|
+
margin-right: 0.25rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.interactive-section {
|
|
100
|
+
padding: 3rem 2rem 4rem;
|
|
101
|
+
border-top: 1px solid #dee2e6;
|
|
102
|
+
border-bottom: 1px solid #dee2e6;
|
|
103
|
+
background-color: #f8f9fa;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.interactive-section__copy {
|
|
107
|
+
max-width: 640px;
|
|
108
|
+
margin: 0 auto 2rem;
|
|
109
|
+
text-align: center;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.interactive-section__copy h2 {
|
|
113
|
+
margin-bottom: 0.5rem;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
#interactive-demo {
|
|
117
|
+
max-width: 720px;
|
|
118
|
+
margin: 0 auto;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.interactive-demo {
|
|
122
|
+
border: 1px solid #dee2e6;
|
|
123
|
+
border-radius: 0.5rem;
|
|
124
|
+
padding: 1.5rem;
|
|
125
|
+
background-color: #ffffff;
|
|
126
|
+
display: grid;
|
|
127
|
+
gap: 1.5rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.interactive-demo--active {
|
|
131
|
+
border-color: #007bff;
|
|
132
|
+
box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.demo__copy p {
|
|
136
|
+
margin: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.demo__controls {
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
gap: 1rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.demo__buttons {
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-wrap: wrap;
|
|
148
|
+
gap: 0.75rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.demo__buttons button {
|
|
152
|
+
border: none;
|
|
153
|
+
border-radius: 999px;
|
|
154
|
+
padding: 0.65rem 1.5rem;
|
|
155
|
+
background-color: #007bff;
|
|
156
|
+
color: #ffffff;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
font-size: 0.95rem;
|
|
159
|
+
transition: background-color 0.2s ease;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.demo__buttons button:nth-child(2) {
|
|
163
|
+
background-color: #6610f2;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.demo__buttons button:nth-child(3) {
|
|
167
|
+
background-color: #343a40;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.demo__buttons button:hover {
|
|
171
|
+
opacity: 0.9;
|
|
172
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# RPC that Anvil should fork from (optional)
|
|
2
|
+
FORK_RPC_URL=https://eth.llamarpc.com
|
|
3
|
+
|
|
4
|
+
# Local JSON-RPC endpoint exposed by Anvil
|
|
5
|
+
RPC_URL=http://127.0.0.1:8545
|
|
6
|
+
|
|
7
|
+
# Chain id to advertise to wallets
|
|
8
|
+
CHAIN_ID=31337
|
|
9
|
+
|
|
10
|
+
# Optional: override the default Anvil deployer key
|
|
11
|
+
# DEPLOYER_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
|
|
12
|
+
|
|
13
|
+
# Fund this address with fork ETH after deployment (set to your wallet address)
|
|
14
|
+
# USER_ADDRESS=0xabc123...
|
|
15
|
+
# USER_FUNDING_ETH=2.0
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Deploy to GitHub Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v3
|
|
15
|
+
|
|
16
|
+
- name: Setup Node.js
|
|
17
|
+
uses: actions/setup-node@v3
|
|
18
|
+
with:
|
|
19
|
+
node-version: '18'
|
|
20
|
+
cache: 'npm'
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: npm install
|
|
24
|
+
|
|
25
|
+
- name: Build
|
|
26
|
+
run: npm run build
|
|
27
|
+
|
|
28
|
+
- name: Deploy
|
|
29
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
30
|
+
with:
|
|
31
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
32
|
+
publish_dir: ./dist
|
|
33
|
+
# This is important for single-page applications that use client-side routing
|
|
34
|
+
# This ensures that all requests are routed to index.html
|
|
35
|
+
# enabling proper routing after refresh or direct URL access
|
|
36
|
+
keep_files: false # Ensure existing files are overwritten
|
|
37
|
+
force_orphan: true # Create a fresh gh-pages branch each time
|
|
38
|
+
enable_jekyll: false # Disable Jekyll processing
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Micro Web3 + Anvil Starter
|
|
2
|
+
|
|
3
|
+
This template wires Microact, Micro Web3, and a simple Foundry project so you can build dApps against a forked mainnet without leaving your laptop.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- [Foundry](https://book.getfoundry.sh/getting-started/installation) (`foundryup` + `anvil` + `forge`)
|
|
8
|
+
- Node.js 18+
|
|
9
|
+
- A browser wallet capable of connecting to a custom RPC (Rabby, MetaMask, etc.)
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
1. Copy `.env.example` to `.env.local` and set `USER_ADDRESS` to your wallet (optional but recommended).
|
|
14
|
+
2. Run the setup helper once to install Foundry stdlib dependencies:
|
|
15
|
+
```bash
|
|
16
|
+
npm run setup
|
|
17
|
+
```
|
|
18
|
+
3. Start the local chain, deploy Counter.sol, and fund your wallet. You can customize the port/RPC, or send Anvil to the background with `--background`:
|
|
19
|
+
```bash
|
|
20
|
+
npm run chain:start
|
|
21
|
+
npm run chain:start -- --port 8550 # example overriding the RPC port
|
|
22
|
+
npm run chain:start -- --rpc-url http://127.0.0.1:9000
|
|
23
|
+
npm run chain:start -- --port 8551 --background
|
|
24
|
+
npm run chain:stop # cleanly shuts down the tracked Anvil instance
|
|
25
|
+
```
|
|
26
|
+
This launches `anvil --fork-url $FORK_RPC_URL`, waits for the JSON-RPC endpoint, runs `forge build`, deploys `Counter.sol` via ethers, and funds `USER_ADDRESS` with fork ETH.
|
|
27
|
+
4. In another terminal, run the front-end:
|
|
28
|
+
```bash
|
|
29
|
+
npm run dev
|
|
30
|
+
```
|
|
31
|
+
5. Point your wallet at `http://127.0.0.1:8545` (Chain ID 31337), connect through the floating wallet button, and interact with the Counter component.
|
|
32
|
+
|
|
33
|
+
Restart `npm run chain:start` any time you want a fresh fork. The deployment script always writes the current ABI/address to `src/generated/contract.json`, so Vite can import it during builds and deploys to static hosts like GitHub Pages.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.23;
|
|
3
|
+
|
|
4
|
+
import "forge-std/Script.sol";
|
|
5
|
+
import { Counter } from "../src/Counter.sol";
|
|
6
|
+
|
|
7
|
+
contract DeployCounter is Script {
|
|
8
|
+
function run() external {
|
|
9
|
+
vm.startBroadcast();
|
|
10
|
+
new Counter();
|
|
11
|
+
vm.stopBroadcast();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.23;
|
|
3
|
+
|
|
4
|
+
/// @title Counter - simple contract for local testing
|
|
5
|
+
contract Counter {
|
|
6
|
+
uint256 public value;
|
|
7
|
+
|
|
8
|
+
event Incremented(address indexed sender, uint256 newValue);
|
|
9
|
+
event Decremented(address indexed sender, uint256 newValue);
|
|
10
|
+
|
|
11
|
+
function increment() external {
|
|
12
|
+
value += 1;
|
|
13
|
+
emit Incremented(msg.sender, value);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function decrement() external {
|
|
17
|
+
require(value > 0, "Counter: cannot go below zero");
|
|
18
|
+
value -= 1;
|
|
19
|
+
emit Decremented(msg.sender, value);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + Microact</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.js"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"setup": "node scripts/setup.mjs",
|
|
11
|
+
"chain:start": "node scripts/chain-start.mjs",
|
|
12
|
+
"chain:deploy": "node scripts/deploy.mjs",
|
|
13
|
+
"chain:stop": "node scripts/chain-stop.mjs"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@monygroupcorp/microact": "latest",
|
|
17
|
+
"@monygroupcorp/micro-web3": "0.1.3",
|
|
18
|
+
"ethers": "^5.7.2"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"buffer": "^6.0.3",
|
|
22
|
+
"util": "^0.12.5",
|
|
23
|
+
"vite": "^4.4.5"
|
|
24
|
+
}
|
|
25
|
+
}
|