create-zenbu-app 0.0.24 → 0.0.26
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/dist/index.mjs
CHANGED
|
@@ -1313,7 +1313,13 @@ async function runDesktopMode() {
|
|
|
1313
1313
|
if (desktopDryRun) log.info(`[dry-run] would scaffold template into ${appsDir}`);
|
|
1314
1314
|
else {
|
|
1315
1315
|
fs.mkdirSync(appsDir, { recursive: true });
|
|
1316
|
-
|
|
1316
|
+
const ctx = {
|
|
1317
|
+
projectName: slug,
|
|
1318
|
+
displayName
|
|
1319
|
+
};
|
|
1320
|
+
copyDirSync(templateDir, appsDir, ctx);
|
|
1321
|
+
const overlayDir = path.join(TEMPLATES_DIR, "desktop-overlay");
|
|
1322
|
+
if (fs.existsSync(overlayDir)) copyDirSync(overlayDir, appsDir, ctx);
|
|
1317
1323
|
const gi = path.join(appsDir, "_gitignore");
|
|
1318
1324
|
if (fs.existsSync(gi)) fs.renameSync(gi, path.join(appsDir, ".gitignore"));
|
|
1319
1325
|
seedPackageManager(appsDir, pm);
|
package/package.json
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useRpc } from "@zenbujs/core/react"
|
|
2
|
+
import { useEffect, useState } from "react"
|
|
3
|
+
|
|
4
|
+
export function Home() {
|
|
5
|
+
const rpc = useRpc()
|
|
6
|
+
const [cwd, setCwd] = useState<string | null>(null)
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
rpc.app.cwd.get().then(setCwd)
|
|
10
|
+
}, [rpc])
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<main className="flex-1 flex flex-col px-8 pt-6 pb-4 font-sans text-zinc-900 dark:text-zinc-100">
|
|
14
|
+
<div className="flex-1 max-w-prose">
|
|
15
|
+
<h1 className="text-2xl font-semibold mb-2">{{displayName}}</h1>
|
|
16
|
+
<p className="text-zinc-500 dark:text-zinc-400 text-sm leading-relaxed mb-6">
|
|
17
|
+
This app is yours to edit. The source lives on your machine and any
|
|
18
|
+
change you save reloads instantly.
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<div className="text-xs uppercase tracking-wide text-zinc-400 dark:text-zinc-500 mb-1.5">
|
|
22
|
+
Source
|
|
23
|
+
</div>
|
|
24
|
+
<code className="block p-2 rounded bg-zinc-100 dark:bg-zinc-900 text-zinc-700 dark:text-zinc-300 text-xs truncate">
|
|
25
|
+
{cwd ?? "\u00a0"}
|
|
26
|
+
</code>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<footer className="mt-6 text-xs text-zinc-400 dark:text-zinc-600">
|
|
30
|
+
Built with{" "}
|
|
31
|
+
<a
|
|
32
|
+
href="https://github.com/zenbu-labs/zenbu.js"
|
|
33
|
+
onClick={(e) => {
|
|
34
|
+
e.preventDefault()
|
|
35
|
+
rpc.core.window.openExternal(
|
|
36
|
+
"https://github.com/zenbu-labs/zenbu.js",
|
|
37
|
+
)
|
|
38
|
+
}}
|
|
39
|
+
className="underline underline-offset-2 hover:text-zinc-600 dark:hover:text-zinc-400 transition-colors"
|
|
40
|
+
>
|
|
41
|
+
zenbu.js
|
|
42
|
+
</a>
|
|
43
|
+
</footer>
|
|
44
|
+
</main>
|
|
45
|
+
)
|
|
46
|
+
}
|