@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,411 @@
|
|
|
1
|
+
import { Button, Input, ProgressBar, Select, component, defineApp, signal } from "@sigx/terminal";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "fs";
|
|
3
|
+
import { dirname, join, resolve } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { jsx, jsxs } from "@sigx/terminal/jsx-runtime";
|
|
6
|
+
//#region src/commands/create.tsx
|
|
7
|
+
/** @jsxImportSource @sigx/terminal */
|
|
8
|
+
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
var rawArgs = process.argv.slice(2);
|
|
10
|
+
function getFlag(name) {
|
|
11
|
+
const eq = rawArgs.find((a) => a.startsWith(`--${name}=`));
|
|
12
|
+
if (eq) return eq.slice(name.length + 3);
|
|
13
|
+
const idx = rawArgs.indexOf(`--${name}`);
|
|
14
|
+
if (idx !== -1 && rawArgs[idx + 1] && !rawArgs[idx + 1].startsWith("-")) return rawArgs[idx + 1];
|
|
15
|
+
}
|
|
16
|
+
function hasFlag(name, short) {
|
|
17
|
+
return rawArgs.includes(`--${name}`) || (short ? rawArgs.includes(`-${short}`) : false);
|
|
18
|
+
}
|
|
19
|
+
var argProjectName = rawArgs.filter((a) => !a.startsWith("-") && a !== "create")[0] || "";
|
|
20
|
+
var argType = getFlag("type");
|
|
21
|
+
var argStyling = getFlag("styling");
|
|
22
|
+
var flagYes = hasFlag("yes", "y");
|
|
23
|
+
var isNonInteractive = !process.stdout.isTTY || !process.stdin.isTTY || flagYes || Boolean(argType && argProjectName);
|
|
24
|
+
var projectTypeOptions = [
|
|
25
|
+
{
|
|
26
|
+
value: "basic",
|
|
27
|
+
label: "Basic SPA",
|
|
28
|
+
description: "Simple single-page application (web)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: "ssr",
|
|
32
|
+
label: "SSR",
|
|
33
|
+
description: "Server-side rendering with Express (web)"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: "ssg",
|
|
37
|
+
label: "SSG",
|
|
38
|
+
description: "Static site with file-based routing & MDX (web)"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: "lynx",
|
|
42
|
+
label: "Lynx",
|
|
43
|
+
description: "Native mobile app with Lynx runtime"
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
var webStylingOptions = [
|
|
47
|
+
{
|
|
48
|
+
value: "none",
|
|
49
|
+
label: "None",
|
|
50
|
+
description: "No CSS framework"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
value: "tailwind",
|
|
54
|
+
label: "Tailwind CSS",
|
|
55
|
+
description: "Utility-first CSS framework"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: "daisyui",
|
|
59
|
+
label: "Tailwind + Daisy UI",
|
|
60
|
+
description: "Tailwind with component library"
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
var lynxStylingOptions = [{
|
|
64
|
+
value: "none",
|
|
65
|
+
label: "None",
|
|
66
|
+
description: "No CSS framework"
|
|
67
|
+
}, {
|
|
68
|
+
value: "tailwind",
|
|
69
|
+
label: "Tailwind CSS",
|
|
70
|
+
description: "Tailwind with Lynx preset"
|
|
71
|
+
}];
|
|
72
|
+
function copyDirectory(src, dest, projectName) {
|
|
73
|
+
if (!existsSync(dest)) mkdirSync(dest, { recursive: true });
|
|
74
|
+
const entries = readdirSync(src);
|
|
75
|
+
for (const entry of entries) {
|
|
76
|
+
const srcPath = join(src, entry);
|
|
77
|
+
const destPath = join(dest, entry);
|
|
78
|
+
if (statSync(srcPath).isDirectory()) copyDirectory(srcPath, destPath, projectName);
|
|
79
|
+
else {
|
|
80
|
+
let content = readFileSync(srcPath, "utf-8");
|
|
81
|
+
content = content.replace(/\{\{projectName\}\}/g, projectName);
|
|
82
|
+
writeFileSync(destPath, content);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Detect if the target directory is inside a pnpm workspace that includes @sigx packages.
|
|
88
|
+
* If so, rewrite @sigx/* dependency versions to workspace:* in package.json.
|
|
89
|
+
*/
|
|
90
|
+
function patchWorkspaceDeps(targetDir) {
|
|
91
|
+
const pkgPath = join(targetDir, "package.json");
|
|
92
|
+
if (!existsSync(pkgPath)) return;
|
|
93
|
+
let dir = dirname(targetDir);
|
|
94
|
+
let isWorkspace = false;
|
|
95
|
+
for (let i = 0; i < 10; i++) {
|
|
96
|
+
if (existsSync(join(dir, "pnpm-workspace.yaml"))) {
|
|
97
|
+
isWorkspace = true;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
const parent = dirname(dir);
|
|
101
|
+
if (parent === dir) break;
|
|
102
|
+
dir = parent;
|
|
103
|
+
}
|
|
104
|
+
if (!isWorkspace) return;
|
|
105
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
106
|
+
for (const section of ["dependencies", "devDependencies"]) {
|
|
107
|
+
if (!pkg[section]) continue;
|
|
108
|
+
for (const dep of Object.keys(pkg[section])) if (dep.startsWith("@sigx/")) pkg[section][dep] = "workspace:*";
|
|
109
|
+
}
|
|
110
|
+
writeFileSync(pkgPath, JSON.stringify(pkg, null, 4) + "\n");
|
|
111
|
+
}
|
|
112
|
+
function scaffoldProject(opts) {
|
|
113
|
+
const targetDir = resolve(process.cwd(), opts.projectName);
|
|
114
|
+
let templateName;
|
|
115
|
+
if (opts.projectType === "lynx") templateName = opts.styling === "tailwind" ? "lynx-tailwind" : "lynx";
|
|
116
|
+
else templateName = opts.styling !== "none" ? `${opts.projectType}-${opts.styling}` : opts.projectType;
|
|
117
|
+
const templateDir = resolve(__dirname, "..", "templates", templateName);
|
|
118
|
+
if (existsSync(targetDir)) return {
|
|
119
|
+
ok: false,
|
|
120
|
+
error: `Directory "${opts.projectName}" already exists!`
|
|
121
|
+
};
|
|
122
|
+
if (!existsSync(templateDir)) return {
|
|
123
|
+
ok: false,
|
|
124
|
+
error: `Template "${templateName}" not found at ${templateDir}`
|
|
125
|
+
};
|
|
126
|
+
copyDirectory(templateDir, targetDir, opts.projectName);
|
|
127
|
+
patchWorkspaceDeps(targetDir);
|
|
128
|
+
return { ok: true };
|
|
129
|
+
}
|
|
130
|
+
var CreateSigx = component(() => {
|
|
131
|
+
const state = signal({
|
|
132
|
+
step: "name",
|
|
133
|
+
projectName: argProjectName || "my-sigx-app",
|
|
134
|
+
projectType: "basic",
|
|
135
|
+
styling: "none",
|
|
136
|
+
progress: 0,
|
|
137
|
+
error: ""
|
|
138
|
+
});
|
|
139
|
+
const createProject = () => {
|
|
140
|
+
state.step = "creating";
|
|
141
|
+
state.progress = 30;
|
|
142
|
+
const result = scaffoldProject({
|
|
143
|
+
projectName: state.projectName,
|
|
144
|
+
projectType: state.projectType,
|
|
145
|
+
styling: state.styling
|
|
146
|
+
});
|
|
147
|
+
if (!result.ok) {
|
|
148
|
+
state.error = result.error;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
state.progress = 100;
|
|
152
|
+
state.step = "done";
|
|
153
|
+
};
|
|
154
|
+
const handleNameSubmit = () => {
|
|
155
|
+
if (state.projectName.trim()) state.step = "type";
|
|
156
|
+
};
|
|
157
|
+
const handleTypeSubmit = () => {
|
|
158
|
+
state.step = "styling";
|
|
159
|
+
};
|
|
160
|
+
const handleStylingSubmit = () => {
|
|
161
|
+
createProject();
|
|
162
|
+
};
|
|
163
|
+
const handleExit = () => {
|
|
164
|
+
process.exit(0);
|
|
165
|
+
};
|
|
166
|
+
return () => {
|
|
167
|
+
if (state.error) return /* @__PURE__ */ jsxs("box", {
|
|
168
|
+
border: "double",
|
|
169
|
+
borderColor: "red",
|
|
170
|
+
label: " Error ",
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ jsxs("text", {
|
|
173
|
+
color: "red",
|
|
174
|
+
children: [" ", state.error]
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
177
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
178
|
+
/* @__PURE__ */ jsx(Button, {
|
|
179
|
+
label: "Exit",
|
|
180
|
+
onClick: handleExit
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
});
|
|
184
|
+
const projectTypeLabel = (t) => {
|
|
185
|
+
switch (t) {
|
|
186
|
+
case "basic": return "Basic SPA";
|
|
187
|
+
case "ssr": return "SSR";
|
|
188
|
+
case "ssg": return "SSG";
|
|
189
|
+
case "lynx": return "Lynx (Native)";
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
const stylingLabel = (s) => {
|
|
193
|
+
switch (s) {
|
|
194
|
+
case "none": return "None";
|
|
195
|
+
case "tailwind": return "Tailwind CSS";
|
|
196
|
+
case "daisyui": return "Tailwind + Daisy UI";
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
const stepContent = (() => {
|
|
200
|
+
switch (state.step) {
|
|
201
|
+
case "name": return /* @__PURE__ */ jsxs("box", { children: [
|
|
202
|
+
/* @__PURE__ */ jsx("text", {
|
|
203
|
+
color: "gray",
|
|
204
|
+
children: " Step 1 of 3"
|
|
205
|
+
}),
|
|
206
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
207
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
208
|
+
/* @__PURE__ */ jsx("text", {
|
|
209
|
+
color: "white",
|
|
210
|
+
children: " What is your project called?"
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
213
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
214
|
+
/* @__PURE__ */ jsx(Input, {
|
|
215
|
+
model: () => state.projectName,
|
|
216
|
+
label: " Project Name ",
|
|
217
|
+
placeholder: "my-sigx-app",
|
|
218
|
+
autofocus: true,
|
|
219
|
+
onSubmit: handleNameSubmit
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
222
|
+
/* @__PURE__ */ jsx("text", {
|
|
223
|
+
color: "gray",
|
|
224
|
+
children: " Press Enter to continue"
|
|
225
|
+
})
|
|
226
|
+
] });
|
|
227
|
+
case "type": return /* @__PURE__ */ jsxs("box", { children: [
|
|
228
|
+
/* @__PURE__ */ jsx("text", {
|
|
229
|
+
color: "gray",
|
|
230
|
+
children: " Step 2 of 3"
|
|
231
|
+
}),
|
|
232
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
233
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
234
|
+
/* @__PURE__ */ jsx("text", {
|
|
235
|
+
color: "white",
|
|
236
|
+
children: " What type of project?"
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
239
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
240
|
+
/* @__PURE__ */ jsx(Select, {
|
|
241
|
+
model: () => state.projectType,
|
|
242
|
+
label: " Project Type ",
|
|
243
|
+
options: projectTypeOptions,
|
|
244
|
+
showDescription: true,
|
|
245
|
+
autofocus: true,
|
|
246
|
+
onSubmit: handleTypeSubmit
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
249
|
+
/* @__PURE__ */ jsx("text", {
|
|
250
|
+
color: "gray",
|
|
251
|
+
children: " ↑/↓ navigate · Enter select"
|
|
252
|
+
})
|
|
253
|
+
] });
|
|
254
|
+
case "styling": return /* @__PURE__ */ jsxs("box", { children: [
|
|
255
|
+
/* @__PURE__ */ jsx("text", {
|
|
256
|
+
color: "gray",
|
|
257
|
+
children: " Step 3 of 3"
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
260
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
261
|
+
/* @__PURE__ */ jsx("text", {
|
|
262
|
+
color: "white",
|
|
263
|
+
children: " Choose a styling approach:"
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
266
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
267
|
+
/* @__PURE__ */ jsx(Select, {
|
|
268
|
+
model: () => state.styling,
|
|
269
|
+
label: " Styling ",
|
|
270
|
+
options: state.projectType === "lynx" ? lynxStylingOptions : webStylingOptions,
|
|
271
|
+
showDescription: true,
|
|
272
|
+
autofocus: true,
|
|
273
|
+
onSubmit: handleStylingSubmit
|
|
274
|
+
}),
|
|
275
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
276
|
+
/* @__PURE__ */ jsx("text", {
|
|
277
|
+
color: "gray",
|
|
278
|
+
children: " ↑/↓ navigate · Enter select"
|
|
279
|
+
})
|
|
280
|
+
] });
|
|
281
|
+
case "creating": return /* @__PURE__ */ jsxs("box", { children: [
|
|
282
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
283
|
+
/* @__PURE__ */ jsx("text", {
|
|
284
|
+
color: "yellow",
|
|
285
|
+
children: " Creating project..."
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
288
|
+
/* @__PURE__ */ jsx(ProgressBar, {
|
|
289
|
+
value: state.progress,
|
|
290
|
+
max: 100,
|
|
291
|
+
width: 40,
|
|
292
|
+
color: "green"
|
|
293
|
+
})
|
|
294
|
+
] });
|
|
295
|
+
case "done": return /* @__PURE__ */ jsxs("box", { children: [
|
|
296
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
297
|
+
/* @__PURE__ */ jsxs("text", {
|
|
298
|
+
color: "green",
|
|
299
|
+
children: [
|
|
300
|
+
" ✓ Project \"",
|
|
301
|
+
state.projectName,
|
|
302
|
+
"\" created!"
|
|
303
|
+
]
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
306
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
307
|
+
/* @__PURE__ */ jsxs("text", {
|
|
308
|
+
color: "gray",
|
|
309
|
+
children: [" Type: ", projectTypeLabel(state.projectType)]
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
312
|
+
/* @__PURE__ */ jsxs("text", {
|
|
313
|
+
color: "gray",
|
|
314
|
+
children: [" Styling: ", stylingLabel(state.styling)]
|
|
315
|
+
}),
|
|
316
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
317
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
318
|
+
/* @__PURE__ */ jsx("text", {
|
|
319
|
+
color: "white",
|
|
320
|
+
children: " Next steps:"
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
323
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
324
|
+
/* @__PURE__ */ jsxs("text", {
|
|
325
|
+
color: "cyan",
|
|
326
|
+
children: [" cd ", state.projectName]
|
|
327
|
+
}),
|
|
328
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
329
|
+
/* @__PURE__ */ jsx("text", {
|
|
330
|
+
color: "cyan",
|
|
331
|
+
children: " pnpm install"
|
|
332
|
+
}),
|
|
333
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
334
|
+
/* @__PURE__ */ jsxs("text", {
|
|
335
|
+
color: "cyan",
|
|
336
|
+
children: [" ", state.projectType === "lynx" ? "sigx dev" : "pnpm dev"]
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
339
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
340
|
+
/* @__PURE__ */ jsx(Button, {
|
|
341
|
+
label: "Exit",
|
|
342
|
+
onClick: handleExit
|
|
343
|
+
})
|
|
344
|
+
] });
|
|
345
|
+
}
|
|
346
|
+
})();
|
|
347
|
+
return /* @__PURE__ */ jsxs("box", { children: [
|
|
348
|
+
/* @__PURE__ */ jsx("text", {
|
|
349
|
+
color: "cyan",
|
|
350
|
+
children: " âš¡ Create SignalX App"
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
353
|
+
stepContent
|
|
354
|
+
] });
|
|
355
|
+
};
|
|
356
|
+
});
|
|
357
|
+
function runHeadless() {
|
|
358
|
+
const validTypes = [
|
|
359
|
+
"basic",
|
|
360
|
+
"ssr",
|
|
361
|
+
"ssg",
|
|
362
|
+
"lynx"
|
|
363
|
+
];
|
|
364
|
+
const validStyling = [
|
|
365
|
+
"none",
|
|
366
|
+
"tailwind",
|
|
367
|
+
"daisyui"
|
|
368
|
+
];
|
|
369
|
+
const projectName = argProjectName || "my-sigx-app";
|
|
370
|
+
const projectType = argType ?? "basic";
|
|
371
|
+
const styling = argStyling ?? "none";
|
|
372
|
+
if (!validTypes.includes(projectType)) {
|
|
373
|
+
console.error(`Error: --type must be one of ${validTypes.join(", ")}`);
|
|
374
|
+
return 2;
|
|
375
|
+
}
|
|
376
|
+
if (!validStyling.includes(styling)) {
|
|
377
|
+
console.error(`Error: --styling must be one of ${validStyling.join(", ")}`);
|
|
378
|
+
return 2;
|
|
379
|
+
}
|
|
380
|
+
if (projectType === "lynx" && styling === "daisyui") {
|
|
381
|
+
console.error("Error: --styling=daisyui is not supported for Lynx projects (use none or tailwind)");
|
|
382
|
+
return 2;
|
|
383
|
+
}
|
|
384
|
+
console.log(`\n âš¡ Creating SignalX app "${projectName}"`);
|
|
385
|
+
console.log(` type: ${projectType}`);
|
|
386
|
+
console.log(` styling: ${styling}\n`);
|
|
387
|
+
const result = scaffoldProject({
|
|
388
|
+
projectName,
|
|
389
|
+
projectType,
|
|
390
|
+
styling
|
|
391
|
+
});
|
|
392
|
+
if (!result.ok) {
|
|
393
|
+
console.error(`Error: ${result.error}`);
|
|
394
|
+
return 1;
|
|
395
|
+
}
|
|
396
|
+
console.log(` ✓ Project created\n`);
|
|
397
|
+
console.log(` Next steps:`);
|
|
398
|
+
console.log(` cd ${projectName}`);
|
|
399
|
+
console.log(` pnpm install`);
|
|
400
|
+
console.log(` ${projectType === "lynx" ? "sigx dev" : "pnpm dev"}\n`);
|
|
401
|
+
return 0;
|
|
402
|
+
}
|
|
403
|
+
function runCreate() {
|
|
404
|
+
if (isNonInteractive) process.exit(runHeadless());
|
|
405
|
+
defineApp(/* @__PURE__ */ jsx(CreateSigx, {})).mount({ clearConsole: true });
|
|
406
|
+
setInterval(() => {}, 1e4);
|
|
407
|
+
}
|
|
408
|
+
//#endregion
|
|
409
|
+
export { runCreate };
|
|
410
|
+
|
|
411
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","names":[],"sources":["../../src/commands/create.tsx"],"sourcesContent":["/** @jsxImportSource @sigx/terminal */\nimport { signal, component, defineApp, Input, Button, ProgressBar, Select } from '@sigx/terminal';\nimport { existsSync, mkdirSync, readdirSync, statSync, writeFileSync, readFileSync } from 'fs';\nimport { dirname, resolve, join } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\ntype Step = 'name' | 'type' | 'styling' | 'creating' | 'done';\ntype ProjectType = 'basic' | 'ssr' | 'ssg' | 'lynx';\ntype Styling = 'none' | 'tailwind' | 'daisyui';\n\n// Parse CLI args (supports both interactive default and --flag headless mode).\nconst rawArgs = process.argv.slice(2);\nfunction getFlag(name: string): string | undefined {\n const eq = rawArgs.find(a => a.startsWith(`--${name}=`));\n if (eq) return eq.slice(name.length + 3);\n const idx = rawArgs.indexOf(`--${name}`);\n if (idx !== -1 && rawArgs[idx + 1] && !rawArgs[idx + 1].startsWith('-')) return rawArgs[idx + 1];\n return undefined;\n}\nfunction hasFlag(name: string, short?: string): boolean {\n return rawArgs.includes(`--${name}`) || (short ? rawArgs.includes(`-${short}`) : false);\n}\nconst positionalArgs = rawArgs.filter(a => !a.startsWith('-') && a !== 'create');\nconst argProjectName = positionalArgs[0] || '';\nconst argType = getFlag('type') as ProjectType | undefined;\nconst argStyling = getFlag('styling') as Styling | undefined;\nconst flagYes = hasFlag('yes', 'y');\nconst isNonInteractive = !process.stdout.isTTY || !process.stdin.isTTY || flagYes\n || Boolean(argType && argProjectName);\n\nconst projectTypeOptions = [\n { value: 'basic' as ProjectType, label: 'Basic SPA', description: 'Simple single-page application (web)' },\n { value: 'ssr' as ProjectType, label: 'SSR', description: 'Server-side rendering with Express (web)' },\n { value: 'ssg' as ProjectType, label: 'SSG', description: 'Static site with file-based routing & MDX (web)' },\n { value: 'lynx' as ProjectType, label: 'Lynx', description: 'Native mobile app with Lynx runtime' },\n];\n\nconst webStylingOptions = [\n { value: 'none' as Styling, label: 'None', description: 'No CSS framework' },\n { value: 'tailwind' as Styling, label: 'Tailwind CSS', description: 'Utility-first CSS framework' },\n { value: 'daisyui' as Styling, label: 'Tailwind + Daisy UI', description: 'Tailwind with component library' },\n];\n\nconst lynxStylingOptions = [\n { value: 'none' as Styling, label: 'None', description: 'No CSS framework' },\n { value: 'tailwind' as Styling, label: 'Tailwind CSS', description: 'Tailwind with Lynx preset' },\n];\n\nfunction copyDirectory(src: string, dest: string, projectName: string) {\n if (!existsSync(dest)) {\n mkdirSync(dest, { recursive: true });\n }\n\n const entries = readdirSync(src);\n for (const entry of entries) {\n const srcPath = join(src, entry);\n const destPath = join(dest, entry);\n const stat = statSync(srcPath);\n\n if (stat.isDirectory()) {\n copyDirectory(srcPath, destPath, projectName);\n } else {\n let content = readFileSync(srcPath, 'utf-8');\n content = content.replace(/\\{\\{projectName\\}\\}/g, projectName);\n writeFileSync(destPath, content);\n }\n }\n}\n\n/**\n * Detect if the target directory is inside a pnpm workspace that includes @sigx packages.\n * If so, rewrite @sigx/* dependency versions to workspace:* in package.json.\n */\nfunction patchWorkspaceDeps(targetDir: string) {\n const pkgPath = join(targetDir, 'package.json');\n if (!existsSync(pkgPath)) return;\n\n // Walk up to find pnpm-workspace.yaml\n let dir = dirname(targetDir);\n let isWorkspace = false;\n for (let i = 0; i < 10; i++) {\n if (existsSync(join(dir, 'pnpm-workspace.yaml'))) {\n isWorkspace = true;\n break;\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n if (!isWorkspace) return;\n\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n for (const section of ['dependencies', 'devDependencies'] as const) {\n if (!pkg[section]) continue;\n for (const dep of Object.keys(pkg[section])) {\n if (dep.startsWith('@sigx/')) {\n pkg[section][dep] = 'workspace:*';\n }\n }\n }\n writeFileSync(pkgPath, JSON.stringify(pkg, null, 4) + '\\n');\n}\n\nfunction scaffoldProject(opts: {\n projectName: string;\n projectType: ProjectType;\n styling: Styling;\n}): { ok: true } | { ok: false; error: string } {\n const targetDir = resolve(process.cwd(), opts.projectName);\n let templateName: string;\n if (opts.projectType === 'lynx') {\n templateName = opts.styling === 'tailwind' ? 'lynx-tailwind' : 'lynx';\n } else {\n templateName = opts.styling !== 'none' ? `${opts.projectType}-${opts.styling}` : opts.projectType;\n }\n const templateDir = resolve(__dirname, '..', 'templates', templateName);\n if (existsSync(targetDir)) return { ok: false, error: `Directory \"${opts.projectName}\" already exists!` };\n if (!existsSync(templateDir)) return { ok: false, error: `Template \"${templateName}\" not found at ${templateDir}` };\n copyDirectory(templateDir, targetDir, opts.projectName);\n patchWorkspaceDeps(targetDir);\n return { ok: true };\n}\n\nconst CreateSigx = component(() => {\n const state = signal({\n step: 'name' as Step,\n projectName: argProjectName || 'my-sigx-app',\n projectType: 'basic' as ProjectType,\n styling: 'none' as Styling,\n progress: 0,\n error: '',\n });\n\n const createProject = () => {\n state.step = 'creating';\n state.progress = 30;\n const result = scaffoldProject({\n projectName: state.projectName,\n projectType: state.projectType,\n styling: state.styling,\n });\n if (!result.ok) {\n state.error = result.error;\n return;\n }\n state.progress = 100;\n state.step = 'done';\n };\n\n const handleNameSubmit = () => {\n if (state.projectName.trim()) {\n state.step = 'type';\n }\n };\n\n const handleTypeSubmit = () => {\n state.step = 'styling';\n };\n\n const handleStylingSubmit = () => {\n createProject();\n };\n\n const handleExit = () => {\n process.exit(0);\n };\n\n return () => {\n if (state.error) {\n return (\n <box border=\"double\" borderColor=\"red\" label=\" Error \">\n <text color=\"red\"> {state.error}</text>\n <br />\n <br />\n <Button label=\"Exit\" onClick={handleExit} />\n </box>\n );\n }\n\n const projectTypeLabel = (t: ProjectType) => {\n switch (t) {\n case 'basic': return 'Basic SPA';\n case 'ssr': return 'SSR';\n case 'ssg': return 'SSG';\n case 'lynx': return 'Lynx (Native)';\n }\n };\n\n const stylingLabel = (s: Styling) => {\n switch (s) {\n case 'none': return 'None';\n case 'tailwind': return 'Tailwind CSS';\n case 'daisyui': return 'Tailwind + Daisy UI';\n }\n };\n\n // Render step-specific content as a single element to avoid\n // multiple conditional children causing duplicate nodes\n const stepContent = (() => {\n switch (state.step) {\n case 'name':\n return (\n <box>\n <text color=\"gray\"> Step 1 of 3</text>\n <br />\n <br />\n <text color=\"white\"> What is your project called?</text>\n <br />\n <br />\n <Input\n model={() => state.projectName}\n label=\" Project Name \"\n placeholder=\"my-sigx-app\"\n autofocus\n onSubmit={handleNameSubmit}\n />\n <br />\n <text color=\"gray\"> Press Enter to continue</text>\n </box>\n );\n case 'type':\n return (\n <box>\n <text color=\"gray\"> Step 2 of 3</text>\n <br />\n <br />\n <text color=\"white\"> What type of project?</text>\n <br />\n <br />\n <Select\n model={() => state.projectType}\n label=\" Project Type \"\n options={projectTypeOptions}\n showDescription\n autofocus\n onSubmit={handleTypeSubmit}\n />\n <br />\n <text color=\"gray\"> ↑/↓ navigate · Enter select</text>\n </box>\n );\n case 'styling':\n return (\n <box>\n <text color=\"gray\"> Step 3 of 3</text>\n <br />\n <br />\n <text color=\"white\"> Choose a styling approach:</text>\n <br />\n <br />\n <Select\n model={() => state.styling}\n label=\" Styling \"\n options={state.projectType === 'lynx' ? lynxStylingOptions : webStylingOptions}\n showDescription\n autofocus\n onSubmit={handleStylingSubmit}\n />\n <br />\n <text color=\"gray\"> ↑/↓ navigate · Enter select</text>\n </box>\n );\n case 'creating':\n return (\n <box>\n <br />\n <text color=\"yellow\"> Creating project...</text>\n <br />\n <ProgressBar value={state.progress} max={100} width={40} color=\"green\" />\n </box>\n );\n case 'done':\n return (\n <box>\n <br />\n <text color=\"green\"> ✓ Project \"{state.projectName}\" created!</text>\n <br />\n <br />\n <text color=\"gray\"> Type: {projectTypeLabel(state.projectType)}</text>\n <br />\n <text color=\"gray\"> Styling: {stylingLabel(state.styling)}</text>\n <br />\n <br />\n <text color=\"white\"> Next steps:</text>\n <br />\n <br />\n <text color=\"cyan\"> cd {state.projectName}</text>\n <br />\n <text color=\"cyan\"> pnpm install</text>\n <br />\n <text color=\"cyan\"> {state.projectType === 'lynx' ? 'sigx dev' : 'pnpm dev'}</text>\n <br />\n <br />\n <Button label=\"Exit\" onClick={handleExit} />\n </box>\n );\n }\n })();\n\n return (\n <box>\n <text color=\"cyan\"> ⚡ Create SignalX App</text>\n <br />\n {stepContent}\n </box>\n );\n };\n});\n\nfunction runHeadless(): number {\n const validTypes: ProjectType[] = ['basic', 'ssr', 'ssg', 'lynx'];\n const validStyling: Styling[] = ['none', 'tailwind', 'daisyui'];\n\n const projectName = argProjectName || 'my-sigx-app';\n const projectType: ProjectType = argType ?? 'basic';\n const styling: Styling = argStyling ?? 'none';\n\n if (!validTypes.includes(projectType)) {\n console.error(`Error: --type must be one of ${validTypes.join(', ')}`);\n return 2;\n }\n if (!validStyling.includes(styling)) {\n console.error(`Error: --styling must be one of ${validStyling.join(', ')}`);\n return 2;\n }\n if (projectType === 'lynx' && styling === 'daisyui') {\n console.error('Error: --styling=daisyui is not supported for Lynx projects (use none or tailwind)');\n return 2;\n }\n\n console.log(`\\n ⚡ Creating SignalX app \"${projectName}\"`);\n console.log(` type: ${projectType}`);\n console.log(` styling: ${styling}\\n`);\n\n const result = scaffoldProject({ projectName, projectType, styling });\n if (!result.ok) {\n console.error(`Error: ${result.error}`);\n return 1;\n }\n\n console.log(` ✓ Project created\\n`);\n console.log(` Next steps:`);\n console.log(` cd ${projectName}`);\n console.log(` pnpm install`);\n console.log(` ${projectType === 'lynx' ? 'sigx dev' : 'pnpm dev'}\\n`);\n return 0;\n}\n\nexport function runCreate() {\n if (isNonInteractive) {\n process.exit(runHeadless());\n }\n defineApp(<CreateSigx />).mount({ clearConsole: true });\n // Keep process alive for TUI\n setInterval(() => { }, 10000);\n}\n"],"mappings":";;;;;;;AAMA,IAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAOzD,IAAM,UAAU,QAAQ,KAAK,MAAM,EAAE;AACrC,SAAS,QAAQ,MAAkC;CAC/C,MAAM,KAAK,QAAQ,MAAK,MAAK,EAAE,WAAW,KAAK,KAAK,GAAG,CAAC;CACxD,IAAI,IAAI,OAAO,GAAG,MAAM,KAAK,SAAS,EAAE;CACxC,MAAM,MAAM,QAAQ,QAAQ,KAAK,OAAO;CACxC,IAAI,QAAQ,MAAM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CACrE,IAAI,CAAC,OAAO,IAAI;EACZ,QAAQ,MAAM,UAAU,OAAO,QAAQ;EACvC,OAAO;;CAGX,QAAQ,IAAI,wBAAwB;CACpC,QAAQ,IAAI,gBAAgB;CAC5B,QAAQ,IAAI,UAAU,cAAc;CACpC,QAAQ,IAAI,mBAAmB;CAC/B,QAAQ,IAAI,OAAO,gBAAgB,SAAS,aAAa,WAAW,IAAI;CACxE,OAAO;;AAGX,SAAgB,YAAY;CACxB,IAAI,kBACA,QAAQ,KAAK,aAAa,CAAC;CAE/B,UAAU,oBAAC,YAAD,EAAc,CAAA,CAAC,CAAC,MAAM,EAAE,cAAc,MAAM,CAAC;CAEvD,kBAAkB,IAAK,IAAM"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface ArgDef {
|
|
2
|
+
type: 'string' | 'boolean';
|
|
3
|
+
description?: string;
|
|
4
|
+
default?: string | boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface CommandContext {
|
|
7
|
+
cwd: string;
|
|
8
|
+
args: Record<string, unknown>;
|
|
9
|
+
logger: Logger;
|
|
10
|
+
}
|
|
11
|
+
export interface Logger {
|
|
12
|
+
log: (msg: string) => void;
|
|
13
|
+
warn: (msg: string) => void;
|
|
14
|
+
error: (msg: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface PluginCommand {
|
|
17
|
+
description: string;
|
|
18
|
+
args?: Record<string, ArgDef>;
|
|
19
|
+
run: (ctx: CommandContext) => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export interface SigxPlugin {
|
|
22
|
+
name: string;
|
|
23
|
+
detect: (cwd: string) => boolean;
|
|
24
|
+
commands: Record<string, PluginCommand>;
|
|
25
|
+
}
|
|
26
|
+
export declare function definePlugin(plugin: SigxPlugin): SigxPlugin;
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["/**\n * Plugin interface for the sigx CLI.\n *\n * Packages that want to extend the CLI declare a `\"sigx-cli\"` field\n * in their package.json pointing to a module that default-exports\n * a SigxPlugin created with `definePlugin()`.\n */\n\nexport interface ArgDef {\n type: 'string' | 'boolean';\n description?: string;\n default?: string | boolean;\n}\n\nexport interface CommandContext {\n cwd: string;\n args: Record<string, unknown>;\n logger: Logger;\n}\n\nexport interface Logger {\n log: (msg: string) => void;\n warn: (msg: string) => void;\n error: (msg: string) => void;\n}\n\nexport interface PluginCommand {\n description: string;\n args?: Record<string, ArgDef>;\n run: (ctx: CommandContext) => Promise<void>;\n}\n\nexport interface SigxPlugin {\n /** Unique plugin name (e.g. 'ssg', 'lynx') */\n name: string;\n /** Return true if this plugin handles the current project */\n detect: (cwd: string) => boolean;\n /** Commands this plugin provides */\n commands: Record<string, PluginCommand>;\n}\n\n/**\n * Define a sigx CLI plugin. Identity function for type safety.\n */\nexport function definePlugin(plugin: SigxPlugin): SigxPlugin {\n return plugin;\n}\n"],"mappings":";;;;AA4CA,SAAgB,aAAa,QAAgC;CACzD,OAAO"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
<style>
|
|
8
|
+
* {
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
16
|
+
line-height: 1.6;
|
|
17
|
+
color: #333;
|
|
18
|
+
background: #f5f5f5;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#app {
|
|
22
|
+
max-width: 800px;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
padding: 40px 20px;
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<div id="app"></div>
|
|
30
|
+
<script type="module" src="/src/App.tsx"></script>
|
|
31
|
+
</body>
|
|
32
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { component, defineApp } from "sigx";
|
|
2
|
+
|
|
3
|
+
const Counter = component(({ signal }) => {
|
|
4
|
+
const state = signal({ count: 0 });
|
|
5
|
+
|
|
6
|
+
return () => (
|
|
7
|
+
<div style="text-align: center; padding: 40px;">
|
|
8
|
+
<h1 style="color: #2c3e50; margin-bottom: 20px;">
|
|
9
|
+
🚀 Welcome to sigx!
|
|
10
|
+
</h1>
|
|
11
|
+
<p style="color: #666; margin-bottom: 30px;">
|
|
12
|
+
Edit <code>src/App.tsx</code> to get started
|
|
13
|
+
</p>
|
|
14
|
+
<div style="background: white; padding: 30px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
|
|
15
|
+
<p style="font-size: 48px; margin-bottom: 20px;">
|
|
16
|
+
{state.count}
|
|
17
|
+
</p>
|
|
18
|
+
<button
|
|
19
|
+
onClick={() => state.count++}
|
|
20
|
+
style="padding: 12px 24px; font-size: 16px; background: #3498db; color: white; border: none; border-radius: 6px; cursor: pointer; margin: 0 8px;"
|
|
21
|
+
>
|
|
22
|
+
Increment
|
|
23
|
+
</button>
|
|
24
|
+
<button
|
|
25
|
+
onClick={() => state.count--}
|
|
26
|
+
style="padding: 12px 24px; font-size: 16px; background: #e74c3c; color: white; border: none; border-radius: 6px; cursor: pointer; margin: 0 8px;"
|
|
27
|
+
>
|
|
28
|
+
Decrement
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
defineApp(Counter).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,15 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import { sigxPlugin } from '@sigx/vite';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [
|
|
6
|
+
sigxPlugin()
|
|
7
|
+
],
|
|
8
|
+
// Vite 8 uses oxc instead of esbuild for JSX transforms
|
|
9
|
+
oxc: {
|
|
10
|
+
jsx: {
|
|
11
|
+
runtime: 'automatic',
|
|
12
|
+
importSource: 'sigx'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" data-theme="light">
|
|
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
|
+
<script>(function(){try{var t=localStorage.getItem('daisy-theme');if(!t&&window.matchMedia('(prefers-color-scheme:dark)').matches)t='dark';if(t)document.documentElement.setAttribute('data-theme',t);}catch(e){}})()</script>
|
|
9
|
+
</head>
|
|
10
|
+
<body class="bg-base-200 min-h-screen">
|
|
11
|
+
<div id="app"></div>
|
|
12
|
+
<script type="module" src="/src/App.tsx"></script>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
"@sigx/daisyui": "^0.3.2"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@sigx/vite": "^0.4.1",
|
|
17
|
+
"vite": "^8.0.3",
|
|
18
|
+
"typescript": "^5.9.3",
|
|
19
|
+
"tailwindcss": "^4.1.0",
|
|
20
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
21
|
+
"daisyui": "^5.0.0"
|
|
22
|
+
}
|
|
23
|
+
}
|