@sigx/cli 0.1.0
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/LICENSE +21 -0
- package/README.md +78 -0
- package/dist/cli.js +230 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/create.d.ts +1 -0
- package/dist/commands/create.js +411 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/plugin.d.ts +26 -0
- package/dist/plugin.js +11 -0
- package/dist/plugin.js.map +1 -0
- package/dist/templates/basic/index.html +32 -0
- package/dist/templates/basic/package.json +19 -0
- package/dist/templates/basic/src/App.tsx +35 -0
- package/dist/templates/basic/tsconfig.json +13 -0
- package/dist/templates/basic/vite.config.ts +15 -0
- package/dist/templates/basic-daisyui/index.html +14 -0
- package/dist/templates/basic-daisyui/package.json +23 -0
- package/dist/templates/basic-daisyui/src/App.tsx +165 -0
- package/dist/templates/basic-daisyui/src/style.css +5 -0
- package/dist/templates/basic-daisyui/tsconfig.json +13 -0
- package/dist/templates/basic-daisyui/vite.config.ts +17 -0
- package/dist/templates/basic-tailwind/index.html +13 -0
- package/dist/templates/basic-tailwind/package.json +21 -0
- package/dist/templates/basic-tailwind/src/App.tsx +37 -0
- package/dist/templates/basic-tailwind/src/style.css +1 -0
- package/dist/templates/basic-tailwind/tsconfig.json +13 -0
- package/dist/templates/basic-tailwind/vite.config.ts +17 -0
- package/dist/templates/lynx/README.md +57 -0
- package/dist/templates/lynx/assets/adaptive-foreground.png +0 -0
- package/dist/templates/lynx/assets/icon.png +0 -0
- package/dist/templates/lynx/assets/splash.png +0 -0
- package/dist/templates/lynx/lynx.config.ts +17 -0
- package/dist/templates/lynx/package.json +28 -0
- package/dist/templates/lynx/sigx.lynx.config.ts +46 -0
- package/dist/templates/lynx/src/App.tsx +103 -0
- package/dist/templates/lynx/src/main.thread.tsx +2 -0
- package/dist/templates/lynx/src/main.tsx +8 -0
- package/dist/templates/lynx/tsconfig.json +19 -0
- package/dist/templates/lynx-tailwind/README.md +61 -0
- package/dist/templates/lynx-tailwind/assets/adaptive-foreground.png +0 -0
- package/dist/templates/lynx-tailwind/assets/icon.png +0 -0
- package/dist/templates/lynx-tailwind/assets/splash.png +0 -0
- package/dist/templates/lynx-tailwind/lynx.config.ts +20 -0
- package/dist/templates/lynx-tailwind/package.json +32 -0
- package/dist/templates/lynx-tailwind/postcss.config.js +5 -0
- package/dist/templates/lynx-tailwind/sigx.lynx.config.ts +44 -0
- package/dist/templates/lynx-tailwind/src/App.tsx +52 -0
- package/dist/templates/lynx-tailwind/src/main.thread.tsx +2 -0
- package/dist/templates/lynx-tailwind/src/main.tsx +9 -0
- package/dist/templates/lynx-tailwind/src/styles.css +3 -0
- package/dist/templates/lynx-tailwind/tailwind.config.ts +9 -0
- package/dist/templates/lynx-tailwind/tsconfig.json +19 -0
- package/dist/templates/ssg/index.html +25 -0
- package/dist/templates/ssg/package.json +22 -0
- package/dist/templates/ssg/src/layouts/default.tsx +27 -0
- package/dist/templates/ssg/src/pages/about.mdx +15 -0
- package/dist/templates/ssg/src/pages/index.mdx +37 -0
- package/dist/templates/ssg/ssg.config.ts +20 -0
- package/dist/templates/ssg/tsconfig.json +14 -0
- package/dist/templates/ssg/vite.config.ts +16 -0
- package/dist/templates/ssg-daisyui/index.html +13 -0
- package/dist/templates/ssg-daisyui/package.json +26 -0
- package/dist/templates/ssg-daisyui/src/layouts/default.tsx +39 -0
- package/dist/templates/ssg-daisyui/src/pages/about.mdx +17 -0
- package/dist/templates/ssg-daisyui/src/pages/index.mdx +34 -0
- package/dist/templates/ssg-daisyui/src/style.css +5 -0
- package/dist/templates/ssg-daisyui/ssg.config.ts +20 -0
- package/dist/templates/ssg-daisyui/tsconfig.json +14 -0
- package/dist/templates/ssg-daisyui/vite.config.ts +18 -0
- package/dist/templates/ssg-tailwind/index.html +12 -0
- package/dist/templates/ssg-tailwind/package.json +24 -0
- package/dist/templates/ssg-tailwind/src/layouts/default.tsx +29 -0
- package/dist/templates/ssg-tailwind/src/pages/about.mdx +16 -0
- package/dist/templates/ssg-tailwind/src/pages/index.mdx +37 -0
- package/dist/templates/ssg-tailwind/src/style.css +1 -0
- package/dist/templates/ssg-tailwind/ssg.config.ts +20 -0
- package/dist/templates/ssg-tailwind/tsconfig.json +14 -0
- package/dist/templates/ssg-tailwind/vite.config.ts +18 -0
- package/dist/templates/ssr/index.html +12 -0
- package/dist/templates/ssr/package.json +24 -0
- package/dist/templates/ssr/src/App.tsx +32 -0
- package/dist/templates/ssr/src/entry-client.tsx +25 -0
- package/dist/templates/ssr/src/entry-server.tsx +24 -0
- package/dist/templates/ssr/src/pages/About.tsx +20 -0
- package/dist/templates/ssr/src/pages/Home.tsx +31 -0
- package/dist/templates/ssr/src/router.ts +27 -0
- package/dist/templates/ssr/tsconfig.json +13 -0
- package/dist/templates/ssr/vite.config.ts +18 -0
- package/dist/templates/ssr-daisyui/index.html +14 -0
- package/dist/templates/ssr-daisyui/package.json +28 -0
- package/dist/templates/ssr-daisyui/src/App.tsx +55 -0
- package/dist/templates/ssr-daisyui/src/entry-client.tsx +25 -0
- package/dist/templates/ssr-daisyui/src/entry-server.tsx +24 -0
- package/dist/templates/ssr-daisyui/src/pages/About.tsx +104 -0
- package/dist/templates/ssr-daisyui/src/pages/Home.tsx +133 -0
- package/dist/templates/ssr-daisyui/src/router.ts +27 -0
- package/dist/templates/ssr-daisyui/src/style.css +5 -0
- package/dist/templates/ssr-daisyui/tsconfig.json +13 -0
- package/dist/templates/ssr-daisyui/vite.config.ts +20 -0
- package/dist/templates/ssr-tailwind/index.html +13 -0
- package/dist/templates/ssr-tailwind/package.json +26 -0
- package/dist/templates/ssr-tailwind/src/App.tsx +32 -0
- package/dist/templates/ssr-tailwind/src/entry-client.tsx +25 -0
- package/dist/templates/ssr-tailwind/src/entry-server.tsx +24 -0
- package/dist/templates/ssr-tailwind/src/pages/About.tsx +21 -0
- package/dist/templates/ssr-tailwind/src/pages/Home.tsx +31 -0
- package/dist/templates/ssr-tailwind/src/router.ts +27 -0
- package/dist/templates/ssr-tailwind/src/style.css +1 -0
- package/dist/templates/ssr-tailwind/tsconfig.json +13 -0
- package/dist/templates/ssr-tailwind/vite.config.ts +20 -0
- package/package.json +65 -0
- package/templates/basic/index.html +32 -0
- package/templates/basic/package.json +19 -0
- package/templates/basic/src/App.tsx +35 -0
- package/templates/basic/tsconfig.json +13 -0
- package/templates/basic/vite.config.ts +15 -0
- package/templates/basic-daisyui/index.html +14 -0
- package/templates/basic-daisyui/package.json +23 -0
- package/templates/basic-daisyui/src/App.tsx +165 -0
- package/templates/basic-daisyui/src/style.css +5 -0
- package/templates/basic-daisyui/tsconfig.json +13 -0
- package/templates/basic-daisyui/vite.config.ts +17 -0
- package/templates/basic-tailwind/index.html +13 -0
- package/templates/basic-tailwind/package.json +21 -0
- package/templates/basic-tailwind/src/App.tsx +37 -0
- package/templates/basic-tailwind/src/style.css +1 -0
- package/templates/basic-tailwind/tsconfig.json +13 -0
- package/templates/basic-tailwind/vite.config.ts +17 -0
- package/templates/lynx/README.md +57 -0
- package/templates/lynx/assets/adaptive-foreground.png +0 -0
- package/templates/lynx/assets/icon.png +0 -0
- package/templates/lynx/assets/splash.png +0 -0
- package/templates/lynx/lynx.config.ts +17 -0
- package/templates/lynx/package.json +28 -0
- package/templates/lynx/sigx.lynx.config.ts +46 -0
- package/templates/lynx/src/App.tsx +103 -0
- package/templates/lynx/src/main.thread.tsx +2 -0
- package/templates/lynx/src/main.tsx +8 -0
- package/templates/lynx/tsconfig.json +19 -0
- package/templates/lynx-tailwind/README.md +61 -0
- package/templates/lynx-tailwind/assets/adaptive-foreground.png +0 -0
- package/templates/lynx-tailwind/assets/icon.png +0 -0
- package/templates/lynx-tailwind/assets/splash.png +0 -0
- package/templates/lynx-tailwind/lynx.config.ts +20 -0
- package/templates/lynx-tailwind/package.json +32 -0
- package/templates/lynx-tailwind/postcss.config.js +5 -0
- package/templates/lynx-tailwind/sigx.lynx.config.ts +44 -0
- package/templates/lynx-tailwind/src/App.tsx +52 -0
- package/templates/lynx-tailwind/src/main.thread.tsx +2 -0
- package/templates/lynx-tailwind/src/main.tsx +9 -0
- package/templates/lynx-tailwind/src/styles.css +3 -0
- package/templates/lynx-tailwind/tailwind.config.ts +9 -0
- package/templates/lynx-tailwind/tsconfig.json +19 -0
- package/templates/ssg/index.html +25 -0
- package/templates/ssg/package.json +22 -0
- package/templates/ssg/src/layouts/default.tsx +27 -0
- package/templates/ssg/src/pages/about.mdx +15 -0
- package/templates/ssg/src/pages/index.mdx +37 -0
- package/templates/ssg/ssg.config.ts +20 -0
- package/templates/ssg/tsconfig.json +14 -0
- package/templates/ssg/vite.config.ts +16 -0
- package/templates/ssg-daisyui/index.html +13 -0
- package/templates/ssg-daisyui/package.json +26 -0
- package/templates/ssg-daisyui/src/layouts/default.tsx +39 -0
- package/templates/ssg-daisyui/src/pages/about.mdx +17 -0
- package/templates/ssg-daisyui/src/pages/index.mdx +34 -0
- package/templates/ssg-daisyui/src/style.css +5 -0
- package/templates/ssg-daisyui/ssg.config.ts +20 -0
- package/templates/ssg-daisyui/tsconfig.json +14 -0
- package/templates/ssg-daisyui/vite.config.ts +18 -0
- package/templates/ssg-tailwind/index.html +12 -0
- package/templates/ssg-tailwind/package.json +24 -0
- package/templates/ssg-tailwind/src/layouts/default.tsx +29 -0
- package/templates/ssg-tailwind/src/pages/about.mdx +16 -0
- package/templates/ssg-tailwind/src/pages/index.mdx +37 -0
- package/templates/ssg-tailwind/src/style.css +1 -0
- package/templates/ssg-tailwind/ssg.config.ts +20 -0
- package/templates/ssg-tailwind/tsconfig.json +14 -0
- package/templates/ssg-tailwind/vite.config.ts +18 -0
- package/templates/ssr/index.html +12 -0
- package/templates/ssr/package.json +24 -0
- package/templates/ssr/src/App.tsx +32 -0
- package/templates/ssr/src/entry-client.tsx +25 -0
- package/templates/ssr/src/entry-server.tsx +24 -0
- package/templates/ssr/src/pages/About.tsx +20 -0
- package/templates/ssr/src/pages/Home.tsx +31 -0
- package/templates/ssr/src/router.ts +27 -0
- package/templates/ssr/tsconfig.json +13 -0
- package/templates/ssr/vite.config.ts +18 -0
- package/templates/ssr-daisyui/index.html +14 -0
- package/templates/ssr-daisyui/package.json +28 -0
- package/templates/ssr-daisyui/src/App.tsx +55 -0
- package/templates/ssr-daisyui/src/entry-client.tsx +25 -0
- package/templates/ssr-daisyui/src/entry-server.tsx +24 -0
- package/templates/ssr-daisyui/src/pages/About.tsx +104 -0
- package/templates/ssr-daisyui/src/pages/Home.tsx +133 -0
- package/templates/ssr-daisyui/src/router.ts +27 -0
- package/templates/ssr-daisyui/src/style.css +5 -0
- package/templates/ssr-daisyui/tsconfig.json +13 -0
- package/templates/ssr-daisyui/vite.config.ts +20 -0
- package/templates/ssr-tailwind/index.html +13 -0
- package/templates/ssr-tailwind/package.json +26 -0
- package/templates/ssr-tailwind/src/App.tsx +32 -0
- package/templates/ssr-tailwind/src/entry-client.tsx +25 -0
- package/templates/ssr-tailwind/src/entry-server.tsx +24 -0
- package/templates/ssr-tailwind/src/pages/About.tsx +21 -0
- package/templates/ssr-tailwind/src/pages/Home.tsx +31 -0
- package/templates/ssr-tailwind/src/router.ts +27 -0
- package/templates/ssr-tailwind/src/style.css +1 -0
- package/templates/ssr-tailwind/tsconfig.json +13 -0
- package/templates/ssr-tailwind/vite.config.ts +20 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { component, defineApp, effect } from "sigx";
|
|
2
|
+
import {
|
|
3
|
+
ThemeProvider,
|
|
4
|
+
ThemeSelector,
|
|
5
|
+
Card,
|
|
6
|
+
Button,
|
|
7
|
+
Badge,
|
|
8
|
+
Toggle,
|
|
9
|
+
Stats,
|
|
10
|
+
Stat,
|
|
11
|
+
Hero,
|
|
12
|
+
Footer,
|
|
13
|
+
} from "@sigx/daisyui";
|
|
14
|
+
|
|
15
|
+
const themes = ['light', 'dark', 'cupcake', 'synthwave', 'cyberpunk', 'dracula', 'nord', 'autumn'] as const;
|
|
16
|
+
|
|
17
|
+
const App = component(({ signal }) => {
|
|
18
|
+
const state = signal({
|
|
19
|
+
count: 0,
|
|
20
|
+
autoIncrement: false,
|
|
21
|
+
elapsed: 0,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
effect(() => {
|
|
25
|
+
if (!state.autoIncrement) return;
|
|
26
|
+
const timer = setInterval(() => state.count++, 800);
|
|
27
|
+
return () => clearInterval(timer);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
effect(() => {
|
|
31
|
+
const timer = setInterval(() => state.elapsed++, 1000);
|
|
32
|
+
return () => clearInterval(timer);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const formatTime = (s: number) => {
|
|
36
|
+
const m = Math.floor(s / 60);
|
|
37
|
+
const sec = s % 60;
|
|
38
|
+
return `${m}:${sec.toString().padStart(2, '0')}`;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return () => (
|
|
42
|
+
<ThemeProvider defaultTheme="light" darkMode>
|
|
43
|
+
<div class="min-h-screen flex flex-col bg-base-200">
|
|
44
|
+
{/* Navbar */}
|
|
45
|
+
<header class="navbar bg-base-100 shadow-sm sticky top-0 z-50">
|
|
46
|
+
<div class="navbar-start">
|
|
47
|
+
<span class="btn btn-ghost text-xl font-bold">🚀 {{projectName}}</span>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="navbar-end">
|
|
50
|
+
<ThemeSelector themes={[...themes]} />
|
|
51
|
+
</div>
|
|
52
|
+
</header>
|
|
53
|
+
|
|
54
|
+
{/* Main */}
|
|
55
|
+
<main class="flex-1">
|
|
56
|
+
{/* Hero */}
|
|
57
|
+
<Hero class="bg-base-100 py-20">
|
|
58
|
+
<Hero.Content>
|
|
59
|
+
<div class="max-w-2xl">
|
|
60
|
+
<h1 class="text-5xl font-bold leading-tight">
|
|
61
|
+
Build Reactive Apps<br />
|
|
62
|
+
<span class="text-primary">with SignalX</span>
|
|
63
|
+
</h1>
|
|
64
|
+
<p class="py-6 text-lg text-base-content/70">
|
|
65
|
+
Fine-grained reactivity, SSR streaming, and a beautiful component library —
|
|
66
|
+
everything you need to build modern web applications.
|
|
67
|
+
</p>
|
|
68
|
+
<Button variant="primary" size="lg">Get Started</Button>
|
|
69
|
+
</div>
|
|
70
|
+
</Hero.Content>
|
|
71
|
+
</Hero>
|
|
72
|
+
|
|
73
|
+
{/* Stats */}
|
|
74
|
+
<div class="px-6 -mt-8 relative z-10 flex justify-center">
|
|
75
|
+
<Stats class="w-full max-w-3xl bg-base-100">
|
|
76
|
+
<Stat title="Counter" value={state.count} description="Reactive signal" />
|
|
77
|
+
<Stat title="Doubled" value={state.count * 2} description="Computed value" />
|
|
78
|
+
<Stat title="Uptime" value={formatTime(state.elapsed)} description="Live timer" />
|
|
79
|
+
</Stats>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
{/* Features */}
|
|
83
|
+
<section class="py-16 px-6">
|
|
84
|
+
<div class="max-w-5xl mx-auto">
|
|
85
|
+
<h2 class="text-3xl font-bold text-center mb-12">Why SignalX?</h2>
|
|
86
|
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
87
|
+
<Card bordered>
|
|
88
|
+
<Card.Body>
|
|
89
|
+
<Card.Title>⚡ Fine-grained Reactivity</Card.Title>
|
|
90
|
+
<p class="text-base-content/70">
|
|
91
|
+
Signals update only what changed — no virtual DOM diffing,
|
|
92
|
+
no unnecessary re-renders.
|
|
93
|
+
</p>
|
|
94
|
+
</Card.Body>
|
|
95
|
+
</Card>
|
|
96
|
+
<Card bordered>
|
|
97
|
+
<Card.Body>
|
|
98
|
+
<Card.Title>🧩 Component Model</Card.Title>
|
|
99
|
+
<p class="text-base-content/70">
|
|
100
|
+
Composable components with JSX, compound patterns,
|
|
101
|
+
and full TypeScript support.
|
|
102
|
+
</p>
|
|
103
|
+
</Card.Body>
|
|
104
|
+
</Card>
|
|
105
|
+
<Card bordered>
|
|
106
|
+
<Card.Body>
|
|
107
|
+
<Card.Title>🎨 DaisyUI Themes</Card.Title>
|
|
108
|
+
<p class="text-base-content/70">
|
|
109
|
+
30+ built-in themes, dark mode, and full component library.
|
|
110
|
+
Switch the theme above!
|
|
111
|
+
</p>
|
|
112
|
+
</Card.Body>
|
|
113
|
+
</Card>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</section>
|
|
117
|
+
|
|
118
|
+
{/* Interactive Demo */}
|
|
119
|
+
<section class="py-16 px-6 bg-base-100">
|
|
120
|
+
<div class="max-w-xl mx-auto">
|
|
121
|
+
<h2 class="text-3xl font-bold text-center mb-2">Try It Live</h2>
|
|
122
|
+
<p class="text-center text-base-content/60 mb-8">Interact with reactive signals right here</p>
|
|
123
|
+
|
|
124
|
+
<Card shadow="lg" bordered>
|
|
125
|
+
<Card.Body center>
|
|
126
|
+
<div class="flex items-center gap-4 mb-6">
|
|
127
|
+
<Badge variant="primary" size="lg">{state.count}</Badge>
|
|
128
|
+
<span class="text-base-content/60">×2 =</span>
|
|
129
|
+
<Badge variant="secondary" size="lg">{state.count * 2}</Badge>
|
|
130
|
+
</div>
|
|
131
|
+
<Card.Actions justify="center">
|
|
132
|
+
<Button variant="primary" onClick={() => state.count++}>
|
|
133
|
+
+ Increment
|
|
134
|
+
</Button>
|
|
135
|
+
<Button variant="error" outline onClick={() => state.count--}>
|
|
136
|
+
− Decrement
|
|
137
|
+
</Button>
|
|
138
|
+
<Button variant="ghost" onClick={() => (state.count = 0)}>
|
|
139
|
+
Reset
|
|
140
|
+
</Button>
|
|
141
|
+
</Card.Actions>
|
|
142
|
+
<div class="divider">AUTO MODE</div>
|
|
143
|
+
<Toggle
|
|
144
|
+
onChange={(val: boolean) => (state.autoIncrement = val)}
|
|
145
|
+
label="Auto-increment every 800ms"
|
|
146
|
+
color="success"
|
|
147
|
+
/>
|
|
148
|
+
</Card.Body>
|
|
149
|
+
</Card>
|
|
150
|
+
</div>
|
|
151
|
+
</section>
|
|
152
|
+
</main>
|
|
153
|
+
|
|
154
|
+
{/* Footer */}
|
|
155
|
+
<Footer center class="bg-base-100 text-base-content border-t border-base-300">
|
|
156
|
+
<aside>
|
|
157
|
+
<p>Built with 💜 using <strong>SignalX</strong> & <strong>DaisyUI</strong></p>
|
|
158
|
+
</aside>
|
|
159
|
+
</Footer>
|
|
160
|
+
</div>
|
|
161
|
+
</ThemeProvider>
|
|
162
|
+
);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
defineApp(App).mount('#app');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"jsxImportSource": "sigx",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"skipLibCheck": true
|
|
11
|
+
},
|
|
12
|
+
"include": ["src/**/*.ts", "src/**/*.tsx"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import { sigxPlugin } from '@sigx/vite';
|
|
3
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [
|
|
7
|
+
sigxPlugin(),
|
|
8
|
+
tailwindcss()
|
|
9
|
+
],
|
|
10
|
+
// Vite 8 uses oxc instead of esbuild for JSX transforms
|
|
11
|
+
oxc: {
|
|
12
|
+
jsx: {
|
|
13
|
+
runtime: 'automatic',
|
|
14
|
+
importSource: 'sigx'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>{{projectName}}</title>
|
|
7
|
+
<link rel="stylesheet" href="/src/style.css" />
|
|
8
|
+
</head>
|
|
9
|
+
<body class="bg-gray-100 text-gray-900">
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/App.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"sigx": "^0.4.1"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@sigx/vite": "^0.4.1",
|
|
16
|
+
"vite": "^8.0.3",
|
|
17
|
+
"typescript": "^5.9.3",
|
|
18
|
+
"tailwindcss": "^4.1.0",
|
|
19
|
+
"@tailwindcss/vite": "^4.2.2"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { component, defineApp } from "sigx";
|
|
2
|
+
|
|
3
|
+
const Counter = component(({ signal }) => {
|
|
4
|
+
const state = signal({ count: 0 });
|
|
5
|
+
|
|
6
|
+
return () => (
|
|
7
|
+
<div class="max-w-2xl mx-auto p-10 text-center">
|
|
8
|
+
<h1 class="text-3xl font-bold text-gray-800 mb-4">
|
|
9
|
+
🚀 Welcome to SignalX!
|
|
10
|
+
</h1>
|
|
11
|
+
<p class="text-gray-600 mb-8">
|
|
12
|
+
Edit <code class="bg-gray-200 px-2 py-1 rounded">src/App.tsx</code> to get started
|
|
13
|
+
</p>
|
|
14
|
+
<div class="bg-white p-8 rounded-xl shadow-lg">
|
|
15
|
+
<p class="text-6xl font-bold mb-6">
|
|
16
|
+
{state.count}
|
|
17
|
+
</p>
|
|
18
|
+
<div class="flex gap-4 justify-center">
|
|
19
|
+
<button
|
|
20
|
+
onClick={() => state.count++}
|
|
21
|
+
class="px-6 py-3 text-lg font-medium bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors cursor-pointer"
|
|
22
|
+
>
|
|
23
|
+
Increment
|
|
24
|
+
</button>
|
|
25
|
+
<button
|
|
26
|
+
onClick={() => state.count--}
|
|
27
|
+
class="px-6 py-3 text-lg font-medium bg-red-500 text-white rounded-lg hover:bg-red-600 transition-colors cursor-pointer"
|
|
28
|
+
>
|
|
29
|
+
Decrement
|
|
30
|
+
</button>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
defineApp(Counter).mount('#app');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"jsxImportSource": "sigx",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"skipLibCheck": true
|
|
11
|
+
},
|
|
12
|
+
"include": ["src/**/*.ts", "src/**/*.tsx"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import { sigxPlugin } from '@sigx/vite';
|
|
3
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [
|
|
7
|
+
sigxPlugin(),
|
|
8
|
+
tailwindcss()
|
|
9
|
+
],
|
|
10
|
+
// Vite 8 uses oxc instead of esbuild for JSX transforms
|
|
11
|
+
oxc: {
|
|
12
|
+
jsx: {
|
|
13
|
+
runtime: 'automatic',
|
|
14
|
+
importSource: 'sigx'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
A native mobile app built with [sigx-lynx](https://github.com/signalxjs/core).
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js 18+
|
|
10
|
+
- pnpm (recommended) or npm
|
|
11
|
+
- [sigx-lynx-go](https://github.com/signalxjs/core/tree/main/go) app on your device/emulator
|
|
12
|
+
|
|
13
|
+
### Development
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Install dependencies
|
|
17
|
+
pnpm install
|
|
18
|
+
|
|
19
|
+
# Start the dev server
|
|
20
|
+
sigx dev
|
|
21
|
+
|
|
22
|
+
# Or use npx
|
|
23
|
+
npx sigx dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Scan the QR code shown in the terminal with sigx-lynx-go, or enter the URL manually.
|
|
27
|
+
|
|
28
|
+
### Building
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
sigx build
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Environment Check
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
sigx doctor
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Project Structure
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
{{projectName}}/
|
|
44
|
+
├── src/
|
|
45
|
+
│ ├── App.tsx # Root component
|
|
46
|
+
│ ├── main.tsx # BG-thread entry point
|
|
47
|
+
│ └── main.thread.tsx # Main-thread entry point
|
|
48
|
+
├── lynx.config.ts # rspeedy build config
|
|
49
|
+
├── sigx.lynx.config.ts # sigx-lynx native config
|
|
50
|
+
├── tsconfig.json
|
|
51
|
+
└── package.json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Learn More
|
|
55
|
+
|
|
56
|
+
- [sigx-lynx Documentation](https://github.com/signalxjs/core)
|
|
57
|
+
- [Lynx Runtime](https://lynxjs.org)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from '@lynx-js/rspeedy';
|
|
2
|
+
import { pluginSigxLynx } from '@sigx/lynx-plugin';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
source: {
|
|
6
|
+
entry: {
|
|
7
|
+
main: './src/main.tsx',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
server: {
|
|
11
|
+
host: '0.0.0.0',
|
|
12
|
+
port: 3000,
|
|
13
|
+
},
|
|
14
|
+
plugins: [
|
|
15
|
+
pluginSigxLynx(),
|
|
16
|
+
],
|
|
17
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "sigx dev",
|
|
8
|
+
"build": "sigx build",
|
|
9
|
+
"doctor": "sigx doctor",
|
|
10
|
+
"prebuild": "sigx prebuild"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@sigx/lynx": "^0.1.0",
|
|
14
|
+
"@sigx/lynx-runtime-main": "^0.1.0",
|
|
15
|
+
"@sigx/lynx-core": "^0.1.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@sigx/cli": "^0.1.0",
|
|
19
|
+
"@sigx/lynx-cli": "^0.1.0",
|
|
20
|
+
"@sigx/lynx-plugin": "^0.1.0",
|
|
21
|
+
"@lynx-js/rspeedy": ">=0.1.0",
|
|
22
|
+
"@lynx-js/css-extract-webpack-plugin": ">=0.1.0",
|
|
23
|
+
"@lynx-js/template-webpack-plugin": ">=0.1.0",
|
|
24
|
+
"@lynx-js/runtime-wrapper-webpack-plugin": ">=0.1.0",
|
|
25
|
+
"@lynx-js/webpack-dev-transport": ">=0.1.0",
|
|
26
|
+
"typescript": "^5.9.3"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineLynxConfig } from '@sigx/lynx-cli/config';
|
|
2
|
+
|
|
3
|
+
export default defineLynxConfig({
|
|
4
|
+
name: '{{projectName}}',
|
|
5
|
+
version: '0.1.0',
|
|
6
|
+
buildNumber: '1',
|
|
7
|
+
|
|
8
|
+
// App-shell assets — sigx ships sensible defaults in ./assets/.
|
|
9
|
+
// Swap these PNGs to rebrand without touching native code.
|
|
10
|
+
icon: 'assets/icon.png',
|
|
11
|
+
splash: {
|
|
12
|
+
image: 'assets/splash.png',
|
|
13
|
+
backgroundColor: '#FFFFFF',
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
// Custom URL scheme for deep linking ({{projectName}}://...).
|
|
17
|
+
// Comment out if you don't need deep links.
|
|
18
|
+
scheme: '{{projectName}}',
|
|
19
|
+
|
|
20
|
+
// 'portrait' | 'landscape' | 'default'
|
|
21
|
+
orientation: 'portrait',
|
|
22
|
+
|
|
23
|
+
// Native modules — these are auto-linked into the native project.
|
|
24
|
+
// Built-in modules available in sigx-lynx-go (dev client) without prebuild.
|
|
25
|
+
modules: [
|
|
26
|
+
'@sigx/lynx-storage',
|
|
27
|
+
'@sigx/lynx-clipboard',
|
|
28
|
+
'@sigx/lynx-haptics',
|
|
29
|
+
'@sigx/lynx-device-info',
|
|
30
|
+
'@sigx/lynx-network',
|
|
31
|
+
],
|
|
32
|
+
android: {
|
|
33
|
+
applicationId: 'com.example.{{projectName}}',
|
|
34
|
+
versionCode: 1,
|
|
35
|
+
minSdk: 24,
|
|
36
|
+
targetSdk: 35,
|
|
37
|
+
adaptiveIcon: {
|
|
38
|
+
foreground: 'assets/adaptive-foreground.png',
|
|
39
|
+
backgroundColor: '#0D9488',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
ios: {
|
|
43
|
+
bundleIdentifier: 'com.example.{{projectName}}',
|
|
44
|
+
deploymentTarget: '15.0',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { signal, component } from '@sigx/lynx';
|
|
2
|
+
|
|
3
|
+
const App = component(() => {
|
|
4
|
+
const count = signal(0);
|
|
5
|
+
|
|
6
|
+
return () => (
|
|
7
|
+
<scroll-view scroll-orientation="vertical" style={{ height: '100vh' }}>
|
|
8
|
+
<view style={{
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
height: '100vh',
|
|
14
|
+
gap: '20px',
|
|
15
|
+
backgroundColor: '#0f172a',
|
|
16
|
+
}}>
|
|
17
|
+
{/* Logo area */}
|
|
18
|
+
<view style={{
|
|
19
|
+
width: '80px',
|
|
20
|
+
height: '80px',
|
|
21
|
+
borderRadius: '20px',
|
|
22
|
+
backgroundColor: '#3b82f6',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
}}>
|
|
27
|
+
<text style={{ fontSize: '36px', color: '#fff' }}>⚡</text>
|
|
28
|
+
</view>
|
|
29
|
+
|
|
30
|
+
<text style={{
|
|
31
|
+
fontSize: '28px',
|
|
32
|
+
fontWeight: 'bold',
|
|
33
|
+
color: '#f1f5f9',
|
|
34
|
+
}}>
|
|
35
|
+
{{projectName}}
|
|
36
|
+
</text>
|
|
37
|
+
|
|
38
|
+
<text style={{
|
|
39
|
+
fontSize: '14px',
|
|
40
|
+
color: '#94a3b8',
|
|
41
|
+
textAlign: 'center',
|
|
42
|
+
maxWidth: '280px',
|
|
43
|
+
}}>
|
|
44
|
+
Built with sigx-lynx — signal-based native apps
|
|
45
|
+
</text>
|
|
46
|
+
|
|
47
|
+
{/* Counter card */}
|
|
48
|
+
<view style={{
|
|
49
|
+
display: 'flex',
|
|
50
|
+
flexDirection: 'column',
|
|
51
|
+
marginTop: '20px',
|
|
52
|
+
padding: '24px',
|
|
53
|
+
backgroundColor: '#1e293b',
|
|
54
|
+
borderRadius: '16px',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
gap: '16px',
|
|
57
|
+
width: '280px',
|
|
58
|
+
}}>
|
|
59
|
+
<text style={{ fontSize: '48px', fontWeight: 'bold', color: '#e2e8f0' }}>
|
|
60
|
+
{count.value}
|
|
61
|
+
</text>
|
|
62
|
+
|
|
63
|
+
<view style={{
|
|
64
|
+
display: 'flex',
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
gap: '12px',
|
|
67
|
+
}}>
|
|
68
|
+
<view
|
|
69
|
+
bindtap={() => count.value > 0 && count.value--}
|
|
70
|
+
style={{
|
|
71
|
+
padding: '12px 24px',
|
|
72
|
+
backgroundColor: '#334155',
|
|
73
|
+
borderRadius: '10px',
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<text style={{ color: '#e2e8f0', fontSize: '18px' }}>−</text>
|
|
77
|
+
</view>
|
|
78
|
+
<view
|
|
79
|
+
bindtap={() => count.value++}
|
|
80
|
+
style={{
|
|
81
|
+
padding: '12px 24px',
|
|
82
|
+
backgroundColor: '#3b82f6',
|
|
83
|
+
borderRadius: '10px',
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
<text style={{ color: '#fff', fontSize: '18px' }}>+</text>
|
|
87
|
+
</view>
|
|
88
|
+
</view>
|
|
89
|
+
</view>
|
|
90
|
+
|
|
91
|
+
<text style={{
|
|
92
|
+
fontSize: '12px',
|
|
93
|
+
color: '#64748b',
|
|
94
|
+
marginTop: '16px',
|
|
95
|
+
}}>
|
|
96
|
+
Edit src/App.tsx to get started
|
|
97
|
+
</text>
|
|
98
|
+
</view>
|
|
99
|
+
</scroll-view>
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export default App;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"jsx": "react-jsx",
|
|
14
|
+
"jsxImportSource": "@sigx/lynx",
|
|
15
|
+
"types": []
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*.ts", "src/**/*.tsx"],
|
|
18
|
+
"exclude": ["node_modules", "dist"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
A native mobile app built with [sigx-lynx](https://github.com/signalxjs/core) and Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js 18+
|
|
10
|
+
- pnpm (recommended) or npm
|
|
11
|
+
- [sigx-lynx-go](https://github.com/signalxjs/core/tree/main/go) app on your device/emulator
|
|
12
|
+
|
|
13
|
+
### Development
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Install dependencies
|
|
17
|
+
pnpm install
|
|
18
|
+
|
|
19
|
+
# Start the dev server
|
|
20
|
+
sigx dev
|
|
21
|
+
|
|
22
|
+
# Or use npx
|
|
23
|
+
npx sigx dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Scan the QR code shown in the terminal with sigx-lynx-go, or enter the URL manually.
|
|
27
|
+
|
|
28
|
+
### Building
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
sigx build
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Environment Check
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
sigx doctor
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Project Structure
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
{{projectName}}/
|
|
44
|
+
├── src/
|
|
45
|
+
│ ├── App.tsx # Root component
|
|
46
|
+
│ ├── styles.css # Tailwind entry point
|
|
47
|
+
│ ├── main.tsx # BG-thread entry point
|
|
48
|
+
│ └── main.thread.tsx # Main-thread entry point
|
|
49
|
+
├── lynx.config.ts # rspeedy build config
|
|
50
|
+
├── sigx.lynx.config.ts # sigx-lynx native config
|
|
51
|
+
├── tailwind.config.ts # Tailwind CSS config
|
|
52
|
+
├── postcss.config.js # PostCSS config
|
|
53
|
+
├── tsconfig.json
|
|
54
|
+
└── package.json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Learn More
|
|
58
|
+
|
|
59
|
+
- [sigx-lynx Documentation](https://github.com/signalxjs/core)
|
|
60
|
+
- [Lynx Runtime](https://lynxjs.org)
|
|
61
|
+
- [Tailwind CSS](https://tailwindcss.com)
|