@buntui/cli 0.1.0-alpha.3

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.
@@ -0,0 +1,8 @@
1
+ [2026-06-03 10:37:39] info: Console switched to mouse mode
2
+ [2026-06-03 10:37:39] info: TuiApp created
3
+ [2026-06-03 10:37:39] info: input listener starting...
4
+ [2026-06-03 10:37:39] info: Console switched to mouse mode
5
+ [2026-06-03 10:37:39] info: detected console dwSize info [X: 104 Y: 46]
6
+ [2026-06-03 10:37:39] info: detected console srWindow info [Top: 0 Right: 103 Bottom: 45 Left: 0]
7
+ [2026-06-03 10:37:39] info: detected console dwSize info [X: 104 Y: 46]
8
+ [2026-06-03 10:37:40] warning: TuiApp destroyed
@@ -0,0 +1,7 @@
1
+ [2026-06-03 18:37:39] info: TUI_CONTEXT_INSTANCE.scale: 46 104
2
+ [2026-06-03 18:37:39] info: Watching: F:\vscode_projects\buntui\packages\create-buntui\src\apps\main\App.vue
3
+
4
+ [2026-06-03 18:37:39] info:
5
+ Dev server started for "main"
6
+ [2026-06-03 18:37:39] info: Terminal resized: 46x104
7
+ [2026-06-03 18:37:40] info: TUI application stopped
Binary file
package/dist/buntui.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ import H from"process";import J from"path";import{Command as Q}from"commander";import"@buntui/compiler/vue-plugin";import I from"path";import F from"fs";import{createDevServer as L}from"@buntui/compiler";import{createApp as T}from"@buntui/core";import{mountHmrErrorOverlay as z}from"@buntui/extensions/hmr-error-overlay";import m from"path";import d from"fs";import h from"process";import{CORE_REGISTRY as E}from"@buntui/compiler";var j="src/apps",x={registry:E,codegen:{coreModuleId:"@buntui/core",reactivityModuleId:"@vue/reactivity"}};function g(){return h.cwd()}function V(t){return m.join(t??g(),j)}function $(t){let n=V(t);if(!d.existsSync(n))return[];let i=[];for(let e of d.readdirSync(n)){let r=m.join(n,e);if(!d.statSync(r).isDirectory())continue;let s=m.join(r,"main.ts"),c=m.join(r,"App.vue");if(!d.existsSync(s)&&!d.existsSync(c))continue;i.push({name:e,dir:r,mainPath:s,entryVue:c,hasCustomMain:d.existsSync(s)})}return i}function A(t,n){let i=$(n);if(i.length===0)console.error("No apps found in src/apps/"),console.error("Create an app at src/apps/<name>/App.vue"),h.exit(1);if(t){let e=i.find((r)=>r.name===t);if(!e){console.error(`App not found: ${t}`),console.error("Available apps:");for(let r of i)console.error(` - ${r.name}`);h.exit(1)}return e}if(i.length===1)return i[0];console.error("Multiple apps found. Specify an app name:");for(let e of i)console.error(` - ${e.name}`);h.exit(1)}function B(t){return m.join(t??g(),"public")}function C(t){return m.join(t??g(),"dist")}function v(t){return m.join(t??g(),"src",".dev")}async function M(t){let n=A(t),i=v(),e=I.join(i,n.name);F.mkdirSync(e,{recursive:!0});let r,s;if(n.hasCustomMain){let o=await import(n.mainPath),p=o.ENTRY??"App.vue";r=I.join(n.dir,p),s=o.run({logFilePath:e}).scene}else{r=n.entryVue;let o=T({logLevel:"debug",clearLog:!0,debugMode:!0,tickRate:60,renderRate:48,logFilePath:e}),p=await import(n.entryVue);s=o.createScene(p,{visible:!0})}let c;L({file:r,tempDir:e,compileOptions:x,onClear(){c?.dismiss(),c=void 0,s.clearWidgets()},onReload(o){c?.dismiss(),c=void 0,o(s)},onError(o){c?.dismiss(),c=z(s,o)}}),console.log(`
4
+ Dev server started for "${n.name}"`),console.log(` Watching: ${r}
5
+ `)}import N from"process";import l from"path";import a from"fs";import{compile as K}from"@buntui/compiler";function _(){return{name:"buntui-vue",setup(t){t.onLoad({filter:/\.vue$/v},async(n)=>{let i=await Bun.file(n.path).text();return{contents:K(i,{filename:n.path,...x}).code,loader:"ts"}})}}}import w from"process";import S from"path";import k from"fs";import{getBinaryPath as U}from"@buntui/native";function W(){if(w.platform==="win32")return"dll";if(w.platform==="darwin")return"dylib";return"so"}function G(){return w.platform==="win32"?"":"lib"}function D(t,n){let i=W(),e=`${G()}buntui.${i}`,r=U(),s=[...r?[r]:[],S.join(n,"node_modules","@buntui","core",e),S.join(n,"node_modules","@buntui","core","src","utils",`buntui.${i}`),S.join(n,e)];for(let c of s)if(k.existsSync(c)){let o=S.join(t,`buntui.${i}`);k.copyFileSync(c,o),console.log(` ${`buntui.${i}`} (copied)`);return}console.warn(" Warning: native binary not found")}function Y(t,n,i){let e=l.dirname(n);for(let[r,s]of i){if(r===n)continue;let o=l.relative(e,r).replaceAll("\\","/").replaceAll(/[.*+?^${}()|[\]\\]/gu,String.raw`\$&`);t=t.replaceAll(new RegExp(String.raw`from\s*(["'])${o}\1`,"gu"),`from $1./${s}$1`),t=t.replaceAll(new RegExp(String.raw`import\s*\(\s*(["'])${o}\1\s*\)`,"gu"),`import("./${s}")`)}return t}function q(t,n){let i=B(n);if(!a.existsSync(i))return;let e=l.join(t,"public");a.mkdirSync(e,{recursive:!0});for(let r of a.readdirSync(i)){let s=l.join(i,r);if(a.statSync(s).isFile())a.copyFileSync(s,l.join(e,r)),console.log(` public/${r}`)}}async function R(){let t=g(),n=C(t),i=$(t);if(i.length===0)console.error("No apps found in src/apps/"),N.exit(1);console.log(`Building ${i.length} app(s): ${i.map((o)=>o.name).join(", ")}
6
+ `),a.mkdirSync(n,{recursive:!0});let e=i.map((o)=>o.hasCustomMain?o.mainPath:o.entryVue),r=_(),s=await Bun.build({entrypoints:e,outdir:n,target:"bun",minify:!0,splitting:i.length>1,naming:"[dir]/[name].[ext]",plugins:[r]});if(!s.success){for(let o of s.logs)console.error(o);N.exit(1)}let c=new Set;if(i.length>1){let o=new Map,p=0;for(let u of s.outputs){let f=l.relative(n,u.path).replaceAll("\\","/"),y=/^(.+?)[\\/]main\.js$/u.exec(f);if(y)o.set(u.path,`${y[1]}.js`);else if(f.endsWith(".js"))o.set(u.path,p===0?"__common.js":`__common-${p}.js`),p++}for(let[u,f]of o){let y=Y(a.readFileSync(u,"utf-8"),u,o);a.writeFileSync(l.join(n,f),y),c.add(f)}for(let u of a.readdirSync(n)){let f=l.join(n,u);if(a.statSync(f).isDirectory())a.rmSync(f,{recursive:!0,force:!0})}let P=[...o.keys()].filter((u)=>!l.relative(n,u).replaceAll("\\","/").includes("/"));for(let u of P){let f=o.get(u);if(l.basename(u)!==f&&a.existsSync(u))a.unlinkSync(u)}for(let[,u]of o)console.log(` ${u} (${(a.statSync(l.join(n,u)).size/1024).toFixed(1)} KB)`)}else for(let o of s.outputs){let p=l.relative(n,o.path).replaceAll("\\","/");c.add(p.split("/")[0]),console.log(` ${p} (${(o.size/1024).toFixed(1)} KB)`)}c.add("public"),q(n,t),D(n,t);for(let o of a.readdirSync(n)){if(c.has(o))continue;let p=l.join(n,o);if(a.statSync(p).isDirectory())a.rmSync(p,{recursive:!0,force:!0});else a.unlinkSync(p)}console.log(`
7
+ Build complete!`)}var b=new Q;b.name("buntui").description("BunTUI framework CLI").version("0.1.0-alpha.3").option("--cwd <dir>","set working directory",(t)=>{H.chdir(J.resolve(t))});b.command("dev").description("start dev server with HMR").argument("[app]","app name (auto-detected if only one exists)").action(async(t)=>{await M(t)});b.command("build").description("production build").action(async()=>{await R()});b.parse();
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@buntui/cli",
3
+ "version": "0.1.0-alpha.3",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/AlphaFoxz/buntui.git",
7
+ "directory": "packages/cli"
8
+ },
9
+ "bin": {
10
+ "buntui": "./dist/buntui.js"
11
+ },
12
+ "files": [
13
+ "dist/"
14
+ ],
15
+ "dependencies": {
16
+ "@vue/reactivity": "^3.5.35",
17
+ "commander": "^15.0.0",
18
+ "@buntui/extensions": "0.1.0-alpha.3",
19
+ "@buntui/compiler": "0.1.0-alpha.3",
20
+ "@buntui/core": "0.1.0-alpha.3"
21
+ },
22
+ "devDependencies": {
23
+ "@types/bun": "^1.3.14",
24
+ "vue": "^3.5.35",
25
+ "vue-tsc": "^3.3.3",
26
+ "@buntui/native": "0.1.0-alpha.3"
27
+ },
28
+ "scripts": {
29
+ "build": "bun run ./scripts/build.ts"
30
+ }
31
+ }