create-lunet 0.0.0 → 0.0.2
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/bun/build.ts +9 -0
- package/bun/src/App.tsx +15 -0
- package/bun/src/main.tsx +4 -0
- package/dist/index.mjs +2 -2
- package/node/src/App.jsx +15 -0
- package/node/src/main.jsx +4 -0
- package/package.json +1 -1
package/bun/build.ts
ADDED
package/bun/src/App.tsx
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createComponent, h } from "lunet";
|
|
2
|
+
import { effect, signal } from "alien-signals";
|
|
3
|
+
|
|
4
|
+
export const App = createComponent<{}>((render, init) => {
|
|
5
|
+
const counter = signal(0);
|
|
6
|
+
|
|
7
|
+
effect(() => {
|
|
8
|
+
render(<div class="app">
|
|
9
|
+
<h1>Hello, lunet!</h1>
|
|
10
|
+
<button $click={() => counter(counter() + 1)}>Count: {counter().toString()}</button>
|
|
11
|
+
</div>);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return init;
|
|
15
|
+
});
|
package/bun/src/main.tsx
ADDED
package/dist/index.mjs
CHANGED
package/node/src/App.jsx
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createComponent } from "lunet";
|
|
2
|
+
import { effect, signal } from "alien-signals";
|
|
3
|
+
|
|
4
|
+
export const App = createComponent((render, init) => {
|
|
5
|
+
const counter = signal(0);
|
|
6
|
+
|
|
7
|
+
effect(() => {
|
|
8
|
+
render(<div>
|
|
9
|
+
<h1>Hello, lunet!</h1>
|
|
10
|
+
<button $click={() => counter(counter() + 1)}>Count: {counter().toString()}</button>
|
|
11
|
+
</div>);
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
return init;
|
|
15
|
+
});
|