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 ADDED
@@ -0,0 +1,9 @@
1
+ import { build } from "bun";
2
+ import { bun_lunet } from "lunet-transpiler";
3
+
4
+ await build({
5
+ entrypoints: ["./index.html"],
6
+ minify: true,
7
+ plugins: [bun_lunet()],
8
+ outdir: "./dist",
9
+ });
@@ -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
+ });
@@ -0,0 +1,4 @@
1
+ import { render, h } from "lunet";
2
+ import { App } from "./App";
3
+
4
+ render(document.getElementById("root")!, <App />);
package/dist/index.mjs CHANGED
@@ -39,10 +39,10 @@ switch (template) {
39
39
  });
40
40
  console.log(`
41
41
  To start development server:
42
- npm run dev
42
+ bun dev
43
43
 
44
44
  To build page:
45
- npm run build
45
+ bun run build
46
46
 
47
47
  Happy bunning! \uD83D\uDC07`);
48
48
  break;
@@ -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
+ });
@@ -0,0 +1,4 @@
1
+ import { render } from "lunet";
2
+ import { App } from "./App";
3
+
4
+ render(document.getElementById("app"), <App />);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lunet",
3
- "version": "0.0.0",
3
+ "version": "0.0.2",
4
4
  "author": "TNTSuperMan",
5
5
  "license": "MIT",
6
6
  "description": "瞬時にlunetプロジェクトを立ち上げます。",