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