buninu 0.1.1
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/.bashrc +11 -0
- package/ARCHITECTURE.md +452 -0
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/apps/bun/make-bunBin.sh +84 -0
- package/apps/jsgotty/LICENSE +23 -0
- package/apps/jsgotty/LICENSES/Apache-2.0-zmodem.js.txt +201 -0
- package/apps/jsgotty/NOTICE +21 -0
- package/apps/jsgotty/README.en.md +290 -0
- package/apps/jsgotty/README.md +292 -0
- package/apps/jsgotty/client.mjs +700 -0
- package/apps/jsgotty/env.sh +2 -0
- package/apps/jsgotty/gotty.js +3325 -0
- package/apps/jsgotty/node_modules/.package-lock.json +35 -0
- package/apps/jsgotty/node_modules/node-addon-api/LICENSE.md +9 -0
- package/apps/jsgotty/node_modules/node-addon-api/README.md +319 -0
- package/apps/jsgotty/node_modules/node-addon-api/common.gypi +20 -0
- package/apps/jsgotty/node_modules/node-addon-api/except.gypi +25 -0
- package/apps/jsgotty/node_modules/node-addon-api/index.js +12 -0
- package/apps/jsgotty/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
- package/apps/jsgotty/node_modules/node-addon-api/napi-inl.h +6607 -0
- package/apps/jsgotty/node_modules/node-addon-api/napi.h +3201 -0
- package/apps/jsgotty/node_modules/node-addon-api/node_addon_api.gyp +32 -0
- package/apps/jsgotty/node_modules/node-addon-api/node_api.gyp +9 -0
- package/apps/jsgotty/node_modules/node-addon-api/noexcept.gypi +26 -0
- package/apps/jsgotty/node_modules/node-addon-api/nothing.c +0 -0
- package/apps/jsgotty/node_modules/node-addon-api/package-support.json +21 -0
- package/apps/jsgotty/node_modules/node-addon-api/package.json +480 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/README.md +73 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/check-napi.js +99 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/clang-format.js +71 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/conversion.js +301 -0
- package/apps/jsgotty/node_modules/node-addon-api/tools/eslint-format.js +79 -0
- package/apps/jsgotty/node_modules/ws/LICENSE +20 -0
- package/apps/jsgotty/node_modules/ws/README.md +548 -0
- package/apps/jsgotty/node_modules/ws/browser.js +8 -0
- package/apps/jsgotty/node_modules/ws/index.js +22 -0
- package/apps/jsgotty/node_modules/ws/lib/buffer-util.js +131 -0
- package/apps/jsgotty/node_modules/ws/lib/constants.js +19 -0
- package/apps/jsgotty/node_modules/ws/lib/event-target.js +292 -0
- package/apps/jsgotty/node_modules/ws/lib/extension.js +203 -0
- package/apps/jsgotty/node_modules/ws/lib/limiter.js +55 -0
- package/apps/jsgotty/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/apps/jsgotty/node_modules/ws/lib/receiver.js +760 -0
- package/apps/jsgotty/node_modules/ws/lib/sender.js +607 -0
- package/apps/jsgotty/node_modules/ws/lib/stream.js +161 -0
- package/apps/jsgotty/node_modules/ws/lib/subprotocol.js +62 -0
- package/apps/jsgotty/node_modules/ws/lib/validation.js +152 -0
- package/apps/jsgotty/node_modules/ws/lib/websocket-server.js +562 -0
- package/apps/jsgotty/node_modules/ws/lib/websocket.js +1407 -0
- package/apps/jsgotty/node_modules/ws/package.json +70 -0
- package/apps/jsgotty/node_modules/ws/wrapper.mjs +21 -0
- package/apps/jsgotty/package-lock.json +46 -0
- package/apps/jsgotty/package.json +13 -0
- package/apps/jsgotty/patches/windowsPtyAgent.js +326 -0
- package/apps/jsgotty/patches/windowsTerminal.js +204 -0
- package/apps/jsgotty/rz.js +199 -0
- package/apps/jsgotty/single-exe/README.md +80 -0
- package/apps/jsgotty/single-exe/assetsHelper.js +90 -0
- package/apps/jsgotty/single-exe/assetsLoader.mjs +85 -0
- package/apps/jsgotty/single-exe/compiled.js +138 -0
- package/apps/jsgotty/single-exe/entry.mjs +9 -0
- package/apps/jsgotty/single-exe/packAssets.sh +7 -0
- package/apps/jsgotty/static/css/index.css +13 -0
- package/apps/jsgotty/static/css/kitty.css +61 -0
- package/apps/jsgotty/static/css/xterm.css +218 -0
- package/apps/jsgotty/static/css/xterm_customize.css +32 -0
- package/apps/jsgotty/static/favicon.ico +0 -0
- package/apps/jsgotty/static/help.md +125 -0
- package/apps/jsgotty/static/icon.svg +66 -0
- package/apps/jsgotty/static/icon_192.png +0 -0
- package/apps/jsgotty/static/index.html +164 -0
- package/apps/jsgotty/static/js/gotty.js +31537 -0
- package/apps/jsgotty/static/js/gotty.js.LICENSE.txt +7 -0
- package/apps/jsgotty/static/js/gotty.js.map +1 -0
- package/apps/jsgotty/static/js/gotty.licenses.txt +650 -0
- package/apps/jsgotty/static/js/kitty.js +1045 -0
- package/apps/jsgotty/static/js/windows_bridge.js +194 -0
- package/apps/jsgotty/static/js/xterm-addon-unicode11.js +2 -0
- package/apps/jsgotty/static/js/zmodem.js +1 -0
- package/apps/jsgotty/static/manifest.json +15 -0
- package/apps/jsgotty/sz.js +273 -0
- package/apps/jsgotty/tests/kitty-order.test.js +58 -0
- package/apps/jsgotty/viu.mjs +393 -0
- package/apps/jsgotty/wgotty +62 -0
- package/apps/jsgotty/windows-bridge-node.js +60 -0
- package/apps/jsgotty/zmodem-node.js +260 -0
- package/apps/jsmdcui/CHANGELOG.md +1048 -0
- package/apps/jsmdcui/LICENSE +22 -0
- package/apps/jsmdcui/README.md +1269 -0
- package/apps/jsmdcui/cdp-maze.js +141 -0
- package/apps/jsmdcui/clean.sh +9 -0
- package/apps/jsmdcui/demos/basic.jpg +0 -0
- package/apps/jsmdcui/demos/chinese.md +32 -0
- package/apps/jsmdcui/demos/event.md +170 -0
- package/apps/jsmdcui/demos/good.jpg +0 -0
- package/apps/jsmdcui/demos/image-processor.md +366 -0
- package/apps/jsmdcui/demos/image-processor.zh-TW.md +366 -0
- package/apps/jsmdcui/demos/img-change.md +73 -0
- package/apps/jsmdcui/demos/imgtool-zh.md +298 -0
- package/apps/jsmdcui/demos/imgtool.md +298 -0
- package/apps/jsmdcui/demos/maze.md +149 -0
- package/apps/jsmdcui/demos/reactive.md +40 -0
- package/apps/jsmdcui/demos/reader.md +513 -0
- package/apps/jsmdcui/demos/select.md +63 -0
- package/apps/jsmdcui/demos/todo-zh.md +190 -0
- package/apps/jsmdcui/demos/todo.md +191 -0
- package/apps/jsmdcui/edit +9 -0
- package/apps/jsmdcui/jsmdcui.sh +5 -0
- package/apps/jsmdcui/llm-maze.txt +94 -0
- package/apps/jsmdcui/package.json +19 -0
- package/apps/jsmdcui/project_structure.txt +35 -0
- package/apps/jsmdcui/runmd.mjs +1140 -0
- package/apps/jsmdcui/runtime/colorschemes/atom-dark.micro +33 -0
- package/apps/jsmdcui/runtime/colorschemes/bubblegum.micro +31 -0
- package/apps/jsmdcui/runtime/colorschemes/cmc-16.micro +47 -0
- package/apps/jsmdcui/runtime/colorschemes/cmc-tc.micro +43 -0
- package/apps/jsmdcui/runtime/colorschemes/darcula.micro +34 -0
- package/apps/jsmdcui/runtime/colorschemes/default.micro +1 -0
- package/apps/jsmdcui/runtime/colorschemes/dracula-tc.micro +49 -0
- package/apps/jsmdcui/runtime/colorschemes/dukedark-tc.micro +38 -0
- package/apps/jsmdcui/runtime/colorschemes/dukelight-tc.micro +38 -0
- package/apps/jsmdcui/runtime/colorschemes/dukeubuntu-tc.micro +38 -0
- package/apps/jsmdcui/runtime/colorschemes/geany.micro +29 -0
- package/apps/jsmdcui/runtime/colorschemes/gotham.micro +29 -0
- package/apps/jsmdcui/runtime/colorschemes/gruvbox-tc.micro +29 -0
- package/apps/jsmdcui/runtime/colorschemes/gruvbox.micro +26 -0
- package/apps/jsmdcui/runtime/colorschemes/material-tc.micro +36 -0
- package/apps/jsmdcui/runtime/colorschemes/monokai-dark.micro +28 -0
- package/apps/jsmdcui/runtime/colorschemes/monokai.micro +34 -0
- package/apps/jsmdcui/runtime/colorschemes/one-dark.micro +39 -0
- package/apps/jsmdcui/runtime/colorschemes/railscast.micro +37 -0
- package/apps/jsmdcui/runtime/colorschemes/simple.micro +33 -0
- package/apps/jsmdcui/runtime/colorschemes/solarized-tc.micro +31 -0
- package/apps/jsmdcui/runtime/colorschemes/solarized.micro +30 -0
- package/apps/jsmdcui/runtime/colorschemes/sunny-day.micro +29 -0
- package/apps/jsmdcui/runtime/colorschemes/twilight.micro +40 -0
- package/apps/jsmdcui/runtime/colorschemes/zenburn.micro +30 -0
- package/apps/jsmdcui/runtime/help/actions.md +161 -0
- package/apps/jsmdcui/runtime/help/cdp.md +124 -0
- package/apps/jsmdcui/runtime/help/colors.md +421 -0
- package/apps/jsmdcui/runtime/help/commands.md +161 -0
- package/apps/jsmdcui/runtime/help/copypaste.md +149 -0
- package/apps/jsmdcui/runtime/help/defaultkeys.md +148 -0
- package/apps/jsmdcui/runtime/help/help.md +1269 -0
- package/apps/jsmdcui/runtime/help/keybindings.md +355 -0
- package/apps/jsmdcui/runtime/help/linter.md +90 -0
- package/apps/jsmdcui/runtime/help/options.md +709 -0
- package/apps/jsmdcui/runtime/help/plugins.md +544 -0
- package/apps/jsmdcui/runtime/help/tutorial.md +112 -0
- package/apps/jsmdcui/runtime/jsplugins/cdp/cdp-server.js +1185 -0
- package/apps/jsmdcui/runtime/jsplugins/cdp/cdp.js +201 -0
- package/apps/jsmdcui/runtime/jsplugins/chapter/chapter.js +111 -0
- package/apps/jsmdcui/runtime/jsplugins/diff/diff.js +46 -0
- package/apps/jsmdcui/runtime/jsplugins/example/example.js +117 -0
- package/apps/jsmdcui/runtime/jsplugins/linter/linter.js +281 -0
- package/apps/jsmdcui/runtime/plugins/autoclose/autoclose.lua +75 -0
- package/apps/jsmdcui/runtime/plugins/ftoptions/ftoptions.lua +17 -0
- package/apps/jsmdcui/runtime/plugins/literate/README.md +5 -0
- package/apps/jsmdcui/runtime/plugins/literate/literate.lua +55 -0
- package/apps/jsmdcui/runtime/plugins/status/help/status.md +21 -0
- package/apps/jsmdcui/runtime/plugins/status/status.lua +62 -0
- package/apps/jsmdcui/runtime/syntax/LICENSE +22 -0
- package/apps/jsmdcui/runtime/syntax/PowerShell.yaml +128 -0
- package/apps/jsmdcui/runtime/syntax/README.md +63 -0
- package/apps/jsmdcui/runtime/syntax/ada.yaml +43 -0
- package/apps/jsmdcui/runtime/syntax/apacheconf.yaml +59 -0
- package/apps/jsmdcui/runtime/syntax/arduino.yaml +101 -0
- package/apps/jsmdcui/runtime/syntax/asciidoc.yaml +51 -0
- package/apps/jsmdcui/runtime/syntax/asm.yaml +123 -0
- package/apps/jsmdcui/runtime/syntax/ats.yaml +99 -0
- package/apps/jsmdcui/runtime/syntax/awk.yaml +44 -0
- package/apps/jsmdcui/runtime/syntax/b.yaml +87 -0
- package/apps/jsmdcui/runtime/syntax/bat.yaml +57 -0
- package/apps/jsmdcui/runtime/syntax/c.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/caddyfile.yaml +23 -0
- package/apps/jsmdcui/runtime/syntax/cake.yaml +7 -0
- package/apps/jsmdcui/runtime/syntax/clojure.yaml +38 -0
- package/apps/jsmdcui/runtime/syntax/cmake.yaml +42 -0
- package/apps/jsmdcui/runtime/syntax/coffeescript.yaml +56 -0
- package/apps/jsmdcui/runtime/syntax/colortest.yaml +19 -0
- package/apps/jsmdcui/runtime/syntax/conky.yaml +17 -0
- package/apps/jsmdcui/runtime/syntax/cpp.yaml +91 -0
- package/apps/jsmdcui/runtime/syntax/crontab.yaml +36 -0
- package/apps/jsmdcui/runtime/syntax/crystal.yaml +72 -0
- package/apps/jsmdcui/runtime/syntax/csharp.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/css.yaml +44 -0
- package/apps/jsmdcui/runtime/syntax/csx.yaml +8 -0
- package/apps/jsmdcui/runtime/syntax/cuda.yaml +68 -0
- package/apps/jsmdcui/runtime/syntax/cython.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/d.yaml +121 -0
- package/apps/jsmdcui/runtime/syntax/dart.yaml +46 -0
- package/apps/jsmdcui/runtime/syntax/default.yaml +10 -0
- package/apps/jsmdcui/runtime/syntax/dockerfile.yaml +36 -0
- package/apps/jsmdcui/runtime/syntax/dot.yaml +29 -0
- package/apps/jsmdcui/runtime/syntax/elixir.yaml +30 -0
- package/apps/jsmdcui/runtime/syntax/elm.yaml +38 -0
- package/apps/jsmdcui/runtime/syntax/erb.yaml +42 -0
- package/apps/jsmdcui/runtime/syntax/erlang.yaml +45 -0
- package/apps/jsmdcui/runtime/syntax/fish.yaml +48 -0
- package/apps/jsmdcui/runtime/syntax/forth.yaml +34 -0
- package/apps/jsmdcui/runtime/syntax/fortran.yaml +64 -0
- package/apps/jsmdcui/runtime/syntax/freebsd-kernel.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/fsharp.yaml +48 -0
- package/apps/jsmdcui/runtime/syntax/gdscript.yaml +61 -0
- package/apps/jsmdcui/runtime/syntax/gemini.yaml +19 -0
- package/apps/jsmdcui/runtime/syntax/gentoo-ebuild.yaml +48 -0
- package/apps/jsmdcui/runtime/syntax/gentoo-etc-portage.yaml +23 -0
- package/apps/jsmdcui/runtime/syntax/git-commit.yaml +35 -0
- package/apps/jsmdcui/runtime/syntax/git-config.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/git-rebase-todo.yaml +19 -0
- package/apps/jsmdcui/runtime/syntax/gleam.yaml +69 -0
- package/apps/jsmdcui/runtime/syntax/glsl.yaml +26 -0
- package/apps/jsmdcui/runtime/syntax/gnuplot.yaml +15 -0
- package/apps/jsmdcui/runtime/syntax/go.yaml +62 -0
- package/apps/jsmdcui/runtime/syntax/godoc.yaml +17 -0
- package/apps/jsmdcui/runtime/syntax/golo.yaml +73 -0
- package/apps/jsmdcui/runtime/syntax/gomod.yaml +31 -0
- package/apps/jsmdcui/runtime/syntax/graphql.yaml +47 -0
- package/apps/jsmdcui/runtime/syntax/groff.yaml +30 -0
- package/apps/jsmdcui/runtime/syntax/groovy.yaml +111 -0
- package/apps/jsmdcui/runtime/syntax/haml.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/hare.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/haskell.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/hc.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/html.yaml +70 -0
- package/apps/jsmdcui/runtime/syntax/html4.yaml +25 -0
- package/apps/jsmdcui/runtime/syntax/html5.yaml +25 -0
- package/apps/jsmdcui/runtime/syntax/ini.yaml +23 -0
- package/apps/jsmdcui/runtime/syntax/inputrc.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/java.yaml +37 -0
- package/apps/jsmdcui/runtime/syntax/javascript.yaml +124 -0
- package/apps/jsmdcui/runtime/syntax/jinja2.yaml +19 -0
- package/apps/jsmdcui/runtime/syntax/json.yaml +39 -0
- package/apps/jsmdcui/runtime/syntax/jsonnet.yaml +92 -0
- package/apps/jsmdcui/runtime/syntax/julia.yaml +57 -0
- package/apps/jsmdcui/runtime/syntax/justfile.yaml +40 -0
- package/apps/jsmdcui/runtime/syntax/keymap.yaml +27 -0
- package/apps/jsmdcui/runtime/syntax/kickstart.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/kotlin.yaml +66 -0
- package/apps/jsmdcui/runtime/syntax/kvlang.yaml +67 -0
- package/apps/jsmdcui/runtime/syntax/ledger.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/lfe.yaml +17 -0
- package/apps/jsmdcui/runtime/syntax/lilypond.yaml +26 -0
- package/apps/jsmdcui/runtime/syntax/lisp.yaml +17 -0
- package/apps/jsmdcui/runtime/syntax/log.yaml +92 -0
- package/apps/jsmdcui/runtime/syntax/lua.yaml +111 -0
- package/apps/jsmdcui/runtime/syntax/mail.yaml +25 -0
- package/apps/jsmdcui/runtime/syntax/makefile.yaml +38 -0
- package/apps/jsmdcui/runtime/syntax/man.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/markdown.yaml +64 -0
- package/apps/jsmdcui/runtime/syntax/mc.yaml +23 -0
- package/apps/jsmdcui/runtime/syntax/meson.yaml +51 -0
- package/apps/jsmdcui/runtime/syntax/micro.yaml +34 -0
- package/apps/jsmdcui/runtime/syntax/mpdconf.yaml +13 -0
- package/apps/jsmdcui/runtime/syntax/msbuild.yaml +6 -0
- package/apps/jsmdcui/runtime/syntax/nanorc.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/nftables.yaml +30 -0
- package/apps/jsmdcui/runtime/syntax/nginx.yaml +22 -0
- package/apps/jsmdcui/runtime/syntax/nim.yaml +27 -0
- package/apps/jsmdcui/runtime/syntax/nix.yaml +32 -0
- package/apps/jsmdcui/runtime/syntax/nu.yaml +114 -0
- package/apps/jsmdcui/runtime/syntax/objc.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/ocaml.yaml +43 -0
- package/apps/jsmdcui/runtime/syntax/octave.yaml +83 -0
- package/apps/jsmdcui/runtime/syntax/odin.yaml +64 -0
- package/apps/jsmdcui/runtime/syntax/pascal.yaml +45 -0
- package/apps/jsmdcui/runtime/syntax/patch.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/peg.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/perl.yaml +58 -0
- package/apps/jsmdcui/runtime/syntax/php.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/pkg-config.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/po.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/pony.yaml +37 -0
- package/apps/jsmdcui/runtime/syntax/pov.yaml +21 -0
- package/apps/jsmdcui/runtime/syntax/privoxy-action.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/privoxy-config.yaml +10 -0
- package/apps/jsmdcui/runtime/syntax/privoxy-filter.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/proto.yaml +40 -0
- package/apps/jsmdcui/runtime/syntax/prql.yaml +84 -0
- package/apps/jsmdcui/runtime/syntax/puppet.yaml +22 -0
- package/apps/jsmdcui/runtime/syntax/python2.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/python3.yaml +80 -0
- package/apps/jsmdcui/runtime/syntax/r.yaml +32 -0
- package/apps/jsmdcui/runtime/syntax/raku.yaml +42 -0
- package/apps/jsmdcui/runtime/syntax/reST.yaml +18 -0
- package/apps/jsmdcui/runtime/syntax/renpy.yaml +15 -0
- package/apps/jsmdcui/runtime/syntax/rpmspec.yaml +43 -0
- package/apps/jsmdcui/runtime/syntax/ruby.yaml +73 -0
- package/apps/jsmdcui/runtime/syntax/rust.yaml +78 -0
- package/apps/jsmdcui/runtime/syntax/sage.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/scad.yaml +53 -0
- package/apps/jsmdcui/runtime/syntax/scala.yaml +33 -0
- package/apps/jsmdcui/runtime/syntax/sed.yaml +13 -0
- package/apps/jsmdcui/runtime/syntax/sh.yaml +69 -0
- package/apps/jsmdcui/runtime/syntax/sls.yaml +15 -0
- package/apps/jsmdcui/runtime/syntax/smalltalk.yaml +55 -0
- package/apps/jsmdcui/runtime/syntax/solidity.yaml +41 -0
- package/apps/jsmdcui/runtime/syntax/sql.yaml +35 -0
- package/apps/jsmdcui/runtime/syntax/stata.yaml +67 -0
- package/apps/jsmdcui/runtime/syntax/svelte.yaml +27 -0
- package/apps/jsmdcui/runtime/syntax/swift.yaml +103 -0
- package/apps/jsmdcui/runtime/syntax/systemd.yaml +16 -0
- package/apps/jsmdcui/runtime/syntax/tcl.yaml +18 -0
- package/apps/jsmdcui/runtime/syntax/terraform.yaml +87 -0
- package/apps/jsmdcui/runtime/syntax/tex.yaml +32 -0
- package/apps/jsmdcui/runtime/syntax/toml.yaml +56 -0
- package/apps/jsmdcui/runtime/syntax/twig.yaml +55 -0
- package/apps/jsmdcui/runtime/syntax/typescript.yaml +49 -0
- package/apps/jsmdcui/runtime/syntax/v.yaml +80 -0
- package/apps/jsmdcui/runtime/syntax/vala.yaml +26 -0
- package/apps/jsmdcui/runtime/syntax/verilog.yaml +60 -0
- package/apps/jsmdcui/runtime/syntax/vhdl.yaml +37 -0
- package/apps/jsmdcui/runtime/syntax/vi.yaml +31 -0
- package/apps/jsmdcui/runtime/syntax/vue.yaml +64 -0
- package/apps/jsmdcui/runtime/syntax/xml.yaml +37 -0
- package/apps/jsmdcui/runtime/syntax/xresources.yaml +14 -0
- package/apps/jsmdcui/runtime/syntax/yaml.yaml +34 -0
- package/apps/jsmdcui/runtime/syntax/yum.yaml +12 -0
- package/apps/jsmdcui/runtime/syntax/zig.yaml +52 -0
- package/apps/jsmdcui/runtime/syntax/zscript.yaml +72 -0
- package/apps/jsmdcui/runtime/syntax/zsh.yaml +52 -0
- package/apps/jsmdcui/single-exe/README.md +473 -0
- package/apps/jsmdcui/single-exe/assetsHelper.js +191 -0
- package/apps/jsmdcui/single-exe/assetsLoader.mjs +85 -0
- package/apps/jsmdcui/single-exe/compiled.js +212 -0
- package/apps/jsmdcui/single-exe/entry.mjs +10 -0
- package/apps/jsmdcui/single-exe/packAssets.sh +7 -0
- package/apps/jsmdcui/src/MDCUI_DEFAULT_EDIT +0 -0
- package/apps/jsmdcui/src/buffer/backup.js +165 -0
- package/apps/jsmdcui/src/buffer/buffer.js +126 -0
- package/apps/jsmdcui/src/buffer/fixed3-codec.js +140 -0
- package/apps/jsmdcui/src/buffer/loc.js +38 -0
- package/apps/jsmdcui/src/buffer/message.js +29 -0
- package/apps/jsmdcui/src/build-args.js +40 -0
- package/apps/jsmdcui/src/config/clean.js +172 -0
- package/apps/jsmdcui/src/config/colorscheme.js +99 -0
- package/apps/jsmdcui/src/config/config.js +125 -0
- package/apps/jsmdcui/src/config/defaults.js +109 -0
- package/apps/jsmdcui/src/cui/fence-events.mjs +144 -0
- package/apps/jsmdcui/src/cui/heading-ids.mjs +1568 -0
- package/apps/jsmdcui/src/cui/id-collision.mjs +111 -0
- package/apps/jsmdcui/src/cui/identity.mjs +26 -0
- package/apps/jsmdcui/src/cui/kitty-debug.mjs +25 -0
- package/apps/jsmdcui/src/cui/kitty-images.mjs +280 -0
- package/apps/jsmdcui/src/cui/kitty-mode.mjs +6 -0
- package/apps/jsmdcui/src/cui/rerender-queue.mjs +66 -0
- package/apps/jsmdcui/src/cui/rpc.mjs +1525 -0
- package/apps/jsmdcui/src/cui/server.mjs +128 -0
- package/apps/jsmdcui/src/cui/table-render.mjs +286 -0
- package/apps/jsmdcui/src/cui/table-row-edit.mjs +226 -0
- package/apps/jsmdcui/src/cui/task-checkbox.mjs +60 -0
- package/apps/jsmdcui/src/cui/template-components.mjs +253 -0
- package/apps/jsmdcui/src/cui/text-block-resize.mjs +177 -0
- package/apps/jsmdcui/src/cui/tui-links.mjs +560 -0
- package/apps/jsmdcui/src/display/ansi-style.js +60 -0
- package/apps/jsmdcui/src/highlight/highlighter.js +243 -0
- package/apps/jsmdcui/src/highlight/parser.js +225 -0
- package/apps/jsmdcui/src/index.js +9573 -0
- package/apps/jsmdcui/src/lua/engine.js +68 -0
- package/apps/jsmdcui/src/platform/archive.js +50 -0
- package/apps/jsmdcui/src/platform/clipboard.js +278 -0
- package/apps/jsmdcui/src/platform/commands.js +221 -0
- package/apps/jsmdcui/src/platform/terminal.js +5 -0
- package/apps/jsmdcui/src/plugins/js-bridge.js +3377 -0
- package/apps/jsmdcui/src/plugins/manager.js +674 -0
- package/apps/jsmdcui/src/runtime/encodings.js +10 -0
- package/apps/jsmdcui/src/runtime/registry.js +134 -0
- package/apps/jsmdcui/src/screen/cell-buffer.js +81 -0
- package/apps/jsmdcui/src/screen/events.js +263 -0
- package/apps/jsmdcui/src/screen/screen.js +249 -0
- package/apps/jsmdcui/src/screen/vt100.js +571 -0
- package/apps/jsmdcui/src/shell/shell.js +70 -0
- package/apps/jsmdcui/testapp.md +78 -0
- package/apps/jsmdcui/tests/assets-helper.test.js +150 -0
- package/apps/jsmdcui/tests/backup.test.js +158 -0
- package/apps/jsmdcui/tests/cat-markdown.test.js +139 -0
- package/apps/jsmdcui/tests/cmphex3b64.js +95 -0
- package/apps/jsmdcui/tests/compiled-runtime.test.js +139 -0
- package/apps/jsmdcui/tests/config-settings.test.js +52 -0
- package/apps/jsmdcui/tests/demo.test.js +447 -0
- package/apps/jsmdcui/tests/docs-sync.test.js +14 -0
- package/apps/jsmdcui/tests/fence-events.test.js +1293 -0
- package/apps/jsmdcui/tests/heading-ids.test.js +559 -0
- package/apps/jsmdcui/tests/heading-list-selector.test.js +2393 -0
- package/apps/jsmdcui/tests/id-collision.test.js +514 -0
- package/apps/jsmdcui/tests/js-plugin-prompts.test.js +110 -0
- package/apps/jsmdcui/tests/key-event.md +10 -0
- package/apps/jsmdcui/tests/kitty-demo.md +184 -0
- package/apps/jsmdcui/tests/kitty-images.test.js +288 -0
- package/apps/jsmdcui/tests/kitty-mode.test.js +14 -0
- package/apps/jsmdcui/tests/platform-commands.test.js +18 -0
- package/apps/jsmdcui/tests/platform-terminal.test.js +8 -0
- package/apps/jsmdcui/tests/pty-demo.js +492 -0
- package/apps/jsmdcui/tests/rerender-queue.test.js +130 -0
- package/apps/jsmdcui/tests/table-render.test.js +150 -0
- package/apps/jsmdcui/tests/table-row-edit.test.js +138 -0
- package/apps/jsmdcui/tests/task-checkbox.test.js +33 -0
- package/apps/jsmdcui/tests/template-components.test.js +422 -0
- package/apps/jsmdcui/tests/text-block-resize.test.js +222 -0
- package/apps/jsmdcui/tests/textarea.md +8 -0
- package/apps/jsmdcui/tests/tui-links.test.js +298 -0
- package/apps/jsmdcui/tests/wui-responsive-images.test.js +60 -0
- package/apps/jsmdcui/tests/wui.test.js +108 -0
- package/apps/jsmdcui/tests/wv-client.js +96 -0
- package/apps/jsmdcui/tui +7 -0
- package/apps/jsmdcui/wui +9 -0
- package/apps/musl-la/LICENSES/Apache-2.0_LLVM_Exceptions_license.txt +311 -0
- package/apps/musl-la/LICENSES/Apache-2.0_license.txt +177 -0
- package/apps/musl-la/LICENSES/BSD-3-Clause_license.txt +43 -0
- package/apps/musl-la/LICENSES/GPL-3.0.txt +674 -0
- package/apps/musl-la/LICENSES/LGPL-3.0.txt +165 -0
- package/apps/musl-la/LICENSES/MIT.txt +21 -0
- package/apps/musl-la/LICENSES/curl_license.txt +22 -0
- package/apps/musl-la/LICENSES/gcc_runtime_exception.txt +73 -0
- package/apps/musl-la/LICENSES/zlib_license.txt +22 -0
- package/apps/musl-la/LICENSE_musl.txt +193 -0
- package/apps/musl-la/NOTICE +56 -0
- package/apps/musl-la/ldmusl +0 -0
- package/apps/musl-la/libgcc_s.so.1 +0 -0
- package/apps/musl-la/libstdc++.so.6 +0 -0
- package/apps/musl-la/musl-la.sh +5 -0
- package/bin/bun.sh +57 -0
- package/bin/glow.sh +5 -0
- package/bin/init.js +395 -0
- package/bin/jmi.sh +5 -0
- package/bin/jsgotty.sh +5 -0
- package/bin/libsh-loader.c +135 -0
- package/bin/libsh-loader.so +0 -0
- package/bin/multicall.sh +90 -0
- package/bin/shc.js +5 -0
- package/bin/switch_to_android.sh +9 -0
- package/bin/switch_to_linux.sh +7 -0
- package/icon.png +0 -0
- package/package.json +31 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
filetype: yaml
|
|
2
|
+
|
|
3
|
+
detect:
|
|
4
|
+
filename: "\\.ya?ml$"
|
|
5
|
+
header: "%YAML"
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
- type: "(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) "
|
|
9
|
+
- constant: "\\b(YES|yes|Y|y|ON|on|TRUE|True|true|NO|no|N|n|OFF|off|FALSE|False|false)\\b"
|
|
10
|
+
- statement: "(:[[:space:]]|\\[|\\]|:[[:space:]]+[|>]|^[[:space:]]*- )"
|
|
11
|
+
- identifier: "[[:space:]][\\*&][A-Za-z0-9]+"
|
|
12
|
+
- type: "[-.\\w]+:"
|
|
13
|
+
- statement: ":"
|
|
14
|
+
- special: "(^---|^\\.\\.\\.|^%YAML|^%TAG)"
|
|
15
|
+
|
|
16
|
+
- constant.string:
|
|
17
|
+
start: "(^| )\""
|
|
18
|
+
end: "\""
|
|
19
|
+
skip: "\\\\."
|
|
20
|
+
rules:
|
|
21
|
+
- constant.specialChar: "\\\\."
|
|
22
|
+
|
|
23
|
+
- constant.string:
|
|
24
|
+
start: "(^| )'"
|
|
25
|
+
end: "'"
|
|
26
|
+
skip: "(\\\\.)|('')"
|
|
27
|
+
rules:
|
|
28
|
+
- constant.specialChar: "\\\\."
|
|
29
|
+
|
|
30
|
+
- comment:
|
|
31
|
+
start: "#"
|
|
32
|
+
end: "$"
|
|
33
|
+
rules:
|
|
34
|
+
- todo: "(TODO|XXX|FIXME):?"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
filetype: yum
|
|
2
|
+
|
|
3
|
+
detect:
|
|
4
|
+
filename: "\\.repo$|yum.*\\.conf$"
|
|
5
|
+
|
|
6
|
+
rules:
|
|
7
|
+
- identifier: "^[[:space:]]*[^=]*="
|
|
8
|
+
- constant.specialChar: "^[[:space:]]*\\[.*\\]$"
|
|
9
|
+
- statement: "\\$(releasever|arch|basearch|uuid|YUM[0-9])"
|
|
10
|
+
- comment: "(^|[[:space:]])#([^{].*)?$"
|
|
11
|
+
- indent-char.whitespace: "[[:space:]]+$"
|
|
12
|
+
- indent-char: " + +| + +"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
filetype: zig
|
|
2
|
+
|
|
3
|
+
detect:
|
|
4
|
+
filename: "\\.z(ig|on)$"
|
|
5
|
+
|
|
6
|
+
rules:
|
|
7
|
+
# Reserved words
|
|
8
|
+
- statement: "\\b(addrspace|align|allowzero|and|asm|async|await|break|callconv|catch|comptime|const|continue|defer|else|errdefer|error|export|extern|fn|for|if|inline|noalias|noinline|nosuspend|or|orelse|packed|pub|resume|return|linksection|suspend|switch|test|threadlocal|try|unreachable|usingnamespace|var|volatile|while)\\b"
|
|
9
|
+
# builtin functions
|
|
10
|
+
- special: "@[a-zA-Z_]+"
|
|
11
|
+
# Primitive Types
|
|
12
|
+
- type: "\\b(anyframe|anytype|anyerror|anyopaque|bool|comptime_int|comptime_float|enum|f(16|32|64|80|128)|i(8|16|32|64|128)|isize|noreturn|opaque|struct|type|union|u(8|16|32|64|128)|usize|void)\\b"
|
|
13
|
+
- type: "\\b(c_u?(short|int|long(long)?)|c_longdouble|c_void)\\b"
|
|
14
|
+
|
|
15
|
+
# Operators
|
|
16
|
+
- symbol.operator: "[-!|=;%.+^*:&?<>~]"
|
|
17
|
+
|
|
18
|
+
# Parenthesis
|
|
19
|
+
- symbol.brackets: "[(){}]|\\[|\\]"
|
|
20
|
+
|
|
21
|
+
# Constants
|
|
22
|
+
- constant: "\\b(null|undefined)\\b"
|
|
23
|
+
- constant.number: "\\b(0b[01_]+|0o[0-7_]+|[0-9_]+|0x[a-fA-F0-9_]+)\\b"
|
|
24
|
+
- constant.bool: "\\b(true|false)\\b"
|
|
25
|
+
|
|
26
|
+
- constant.string:
|
|
27
|
+
start: "\""
|
|
28
|
+
end: "\""
|
|
29
|
+
skip: "\\\\."
|
|
30
|
+
rules:
|
|
31
|
+
- constant.specialChar: "\\\\([nrt\\\\'\"]|x[a-fA-F0-9]{2}|u{[a-fA-F0-9]+})"
|
|
32
|
+
|
|
33
|
+
- constant.string:
|
|
34
|
+
start: "'"
|
|
35
|
+
end: "'"
|
|
36
|
+
skip: "\\\\."
|
|
37
|
+
rules:
|
|
38
|
+
- error: "..+"
|
|
39
|
+
- constant.specialChar: "\\\\([nrt\\\\'\"]|x[a-fA-F0-9]{2}|u{[a-fA-F0-9]+})"
|
|
40
|
+
|
|
41
|
+
- constant.string:
|
|
42
|
+
start: "\\\\\\\\"
|
|
43
|
+
end: "$"
|
|
44
|
+
skip: "\\\\."
|
|
45
|
+
rules:
|
|
46
|
+
- constant.specialChar: "\\\\([nrt\\\\'\"]|x[a-fA-F0-9]{2}|u{[a-fA-F0-9]+})"
|
|
47
|
+
|
|
48
|
+
- comment:
|
|
49
|
+
start: "//"
|
|
50
|
+
end: "$"
|
|
51
|
+
rules:
|
|
52
|
+
- todo: "(TODO|XXX|FIXME):?"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
filetype: zscript
|
|
2
|
+
# Loosely based on the csharp.yaml definition
|
|
3
|
+
# (?i) on everything because ZScript isn't case sensitive
|
|
4
|
+
|
|
5
|
+
detect:
|
|
6
|
+
filename: "(?i)\\.z(c|sc)$"
|
|
7
|
+
|
|
8
|
+
rules:
|
|
9
|
+
|
|
10
|
+
# ZScript only has one preprocessor directive and a required engine version declaration
|
|
11
|
+
- preproc: "(?i)#include"
|
|
12
|
+
- preproc: "(?i)version"
|
|
13
|
+
|
|
14
|
+
# State labels ("goto" word overridden by state logic rule below)
|
|
15
|
+
- symbol.tag: "(?i)[a-z0-9.]+:"
|
|
16
|
+
- symbol.tag: "(?i)goto [a-z0-9]+[\\+0-9]*"
|
|
17
|
+
|
|
18
|
+
# Classes
|
|
19
|
+
- identifier.class: "(?i)class +[a-z0-9_]+ *((:) +[a-z0-9.]+)?"
|
|
20
|
+
|
|
21
|
+
# Functions (open paren overridden by symbol.brackets rule because perl regex apparently doesn't support postive lookahead)
|
|
22
|
+
- identifier: "(?i)[\\.]*[a-z0-9_]+[ ]*[(]+"
|
|
23
|
+
|
|
24
|
+
# Variable types
|
|
25
|
+
- type: "(?i)\\b(actor|object|vector2|vector3|name|string|color|sound|void|double|bool|int|float|float64|uint8|uint16|uint|int8|int16|TextureID|SpriteID|Array|voidptr|short|action|state|statelabel)\\b"
|
|
26
|
+
|
|
27
|
+
# Keywords
|
|
28
|
+
- statement: "(?i)\\b(class|default|private|static|native|return|if|else|for|while|do|deprecated|null|readonly|true|false|struct|extend|clearscope|vararg|ui|play|virtual|virtualscope|meta|Property|in|out|states|override|super|is|let|const|replaces|protected|self|abstract|enum|switch|case)\\b"
|
|
29
|
+
|
|
30
|
+
# State logic keywords
|
|
31
|
+
- special: "(?i)\\b(goto|loop|stop|break|continue|fail)\\b"
|
|
32
|
+
|
|
33
|
+
# Symbols
|
|
34
|
+
- symbol.operator: "[\\-+/*=<>?:!~%&|]"
|
|
35
|
+
- symbol.brackets: "[(){}]|\\[|\\]"
|
|
36
|
+
|
|
37
|
+
# Constants
|
|
38
|
+
- constant.bool: "(?i)(\\b(true|false)\\b|NULL)"
|
|
39
|
+
- constant.number: "(?i)\\b([0-9][.]*[0-9]*)+?\\b"
|
|
40
|
+
- constant.number: "(?i)\\b(0x[A-Fa-f0-9_]+)?\\b"
|
|
41
|
+
- constant.number: "(?i)\\b(0b[0-1_]+)[FL]?\\b"
|
|
42
|
+
#- constant.number: "(?i)\\b(([0-9][.]*[0-9]*)+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\\b"
|
|
43
|
+
|
|
44
|
+
# Strings
|
|
45
|
+
- constant.string:
|
|
46
|
+
start: "\""
|
|
47
|
+
end: "\""
|
|
48
|
+
skip: "\\\\."
|
|
49
|
+
rules:
|
|
50
|
+
- constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
|
|
51
|
+
- constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
|
|
52
|
+
|
|
53
|
+
- constant.string:
|
|
54
|
+
start: "'"
|
|
55
|
+
end: "'"
|
|
56
|
+
skip: "\\\\."
|
|
57
|
+
rules:
|
|
58
|
+
- constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
|
|
59
|
+
- constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
|
|
60
|
+
|
|
61
|
+
# Comments
|
|
62
|
+
- comment:
|
|
63
|
+
start: "//"
|
|
64
|
+
end: "$"
|
|
65
|
+
rules:
|
|
66
|
+
- todo: "(TODO|XXX|FIXME):?"
|
|
67
|
+
|
|
68
|
+
- comment:
|
|
69
|
+
start: "/\\*"
|
|
70
|
+
end: "\\*/"
|
|
71
|
+
rules:
|
|
72
|
+
- todo: "(TODO|XXX|FIXME):?"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
filetype: zsh
|
|
2
|
+
|
|
3
|
+
detect:
|
|
4
|
+
filename: "(\\.zsh$|\\.?(zshenv|zprofile|zshrc|zlogin|zlogout)$)"
|
|
5
|
+
header: "^#!.*/(env +)?zsh( |$)"
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
## Numbers
|
|
9
|
+
- constant.number: "\\b[0-9]+\\b"
|
|
10
|
+
|
|
11
|
+
## Conditionals and control flow
|
|
12
|
+
- statement: "\\b(always|break|bye|case|continue|disown|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\\b"
|
|
13
|
+
|
|
14
|
+
- statement: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)"
|
|
15
|
+
## Conditional flags
|
|
16
|
+
- special: "-[Ldefgruwx]\\b"
|
|
17
|
+
- special: "-(eq|ne|gt|lt|ge|le|s|n|z)\\b"
|
|
18
|
+
|
|
19
|
+
## Bash-inherited
|
|
20
|
+
- statement: "\\b((un)?alias|bindkey|builtin|cd|declare|eval|exec|export|jobs|let|popd|pushd|set|source|typeset|umask|unset)\\b"
|
|
21
|
+
## ZSH-specific
|
|
22
|
+
- type: "\\b(add-zsh-hook|autoload|chdir|compinit|dirs|(dis|en)able|echotc|emulate|print|prompt(init)?|(un)?setopt|zle|zmodload|zstyle|whence)\\b"
|
|
23
|
+
|
|
24
|
+
## Common linux commands
|
|
25
|
+
- statement: "\\b((g|ig)?awk|find|\\w{0,4}grep|kill|killall|\\w{0,4}less|make|pkill|sed|tar)\\b"
|
|
26
|
+
|
|
27
|
+
## Coreutils commands
|
|
28
|
+
- statement: "\\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|echo|env|expand|expr|factor|false|fmt|fold|head|hostid|id|install|join|link|ln|logname|ls|md5sum|mkdir|mkfifo|mknod|mktemp|mv|nice|nl|nohup|nproc|numfmt|od|paste|pathchk|pinky|pr|printenv|printf|ptx|pwd|readlink|realpath|rm|rmdir|runcon|seq|(sha1|sha224|sha256|sha384|sha512)sum|shred|shuf|sleep|sort|split|stat|stdbuf|stty|sum|sync|tac|tail|tee|test|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\\b"
|
|
29
|
+
|
|
30
|
+
## Function definition
|
|
31
|
+
- identifier: "^\\s+(function\\s+)[0-9A-Z_]+\\s+\\(\\)" # (i)
|
|
32
|
+
|
|
33
|
+
## Variables
|
|
34
|
+
- identifier: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?" #(i)
|
|
35
|
+
|
|
36
|
+
- constant.string:
|
|
37
|
+
start: "\""
|
|
38
|
+
end: "\""
|
|
39
|
+
skip: "\\\\."
|
|
40
|
+
rules:
|
|
41
|
+
- constant.specialChar: "\\\\."
|
|
42
|
+
|
|
43
|
+
- constant.string:
|
|
44
|
+
start: "'"
|
|
45
|
+
end: "'"
|
|
46
|
+
rules: []
|
|
47
|
+
|
|
48
|
+
- comment:
|
|
49
|
+
start: "(^|\\s)#"
|
|
50
|
+
end: "$"
|
|
51
|
+
rules: []
|
|
52
|
+
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
# Bun Single-File Executable Bootstrap
|
|
2
|
+
|
|
3
|
+
Build a Bun application and its runtime assets into one executable while
|
|
4
|
+
keeping the regular main module free of Bun-specific asset imports.
|
|
5
|
+
|
|
6
|
+
You can copy and adapt this build setup for your own project by changing its
|
|
7
|
+
main-module path and asset list as described below.
|
|
8
|
+
|
|
9
|
+
- Bundle an asset tree alongside the application code in one executable.
|
|
10
|
+
- Keep the regular main module available to the Node.js ESM execution path.
|
|
11
|
+
- Read embedded resources first with an optional external-file fallback.
|
|
12
|
+
- List, extract, or bypass embedded assets with built-in CLI flags.
|
|
13
|
+
- Build for the current platform or pass a Bun cross-compilation target.
|
|
14
|
+
|
|
15
|
+
> This workflow is optional; the standard methods in the root README remain
|
|
16
|
+
> available. Bun's Android build is currently not supported.
|
|
17
|
+
|
|
18
|
+
## Quick start for jsmdcui
|
|
19
|
+
|
|
20
|
+
From the repository root, build for the current platform:
|
|
21
|
+
|
|
22
|
+
```shell
|
|
23
|
+
bun ./src/index.js --build-exe
|
|
24
|
+
./mdcui --version
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`--build-exe` runs `packAssets.sh` automatically and writes the `mdcui`
|
|
28
|
+
executable to the current directory. To pass a Bun compilation target, use:
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
bun ./src/index.js --build-for <target>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Any additional arguments after `--build-exe`, or after the target passed to
|
|
35
|
+
`--build-for`, are forwarded to the `bun build` command:
|
|
36
|
+
|
|
37
|
+
```shell
|
|
38
|
+
bun ./src/index.js --build-exe --sourcemap
|
|
39
|
+
bun ./src/index.js --build-for <target> --sourcemap
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Bun expects `--define` values to be JSON-style literals, so strings normally
|
|
43
|
+
need quotes. `stringifyNonPrimitiveDefineValues()` converts a bare value with
|
|
44
|
+
`JSON.stringify()` before it reaches Bun. jsmdcui uses it for
|
|
45
|
+
`global.MDCUI_MAIN`.
|
|
46
|
+
|
|
47
|
+
`global.MDCUI_MAIN` is a jsmdcui application convention, not a name reserved by
|
|
48
|
+
the single-executable helpers. An adopting project can use
|
|
49
|
+
`global.MY_EMBEDDED_APP`, or any other build expression, as long as it updates
|
|
50
|
+
its own call sites and passes the same name to
|
|
51
|
+
`stringifyNonPrimitiveDefineValues()`.
|
|
52
|
+
|
|
53
|
+
The jsmdcui switch defines below are presence-based: `=0` and `=false` still
|
|
54
|
+
enable them. Omit a switch define to disable it; examples consistently use
|
|
55
|
+
`=1`.
|
|
56
|
+
|
|
57
|
+
- `MDCUI_DEFAULT_EDIT=1`: editable-text default.
|
|
58
|
+
- `MDCUI_DEFAULT_DEMO=1`: no-argument `testapp.md` TUI.
|
|
59
|
+
- `MDCUI_DEFAULT_DEMO_WUI=1`: no-argument `testapp.md` WUI.
|
|
60
|
+
- `MDCUI_OVERWRITE_DEMO=1`: overwrite modifier; it does not select a demo.
|
|
61
|
+
- `global.MDCUI_MAIN=<path>.md`: embed a custom Markdown app and its generated
|
|
62
|
+
front, RPC, back, HTML, and server modules.
|
|
63
|
+
- `global.MDCUI_MAIN_BASE`: generated internally from `MDCUI_MAIN`; do not pass
|
|
64
|
+
it manually.
|
|
65
|
+
|
|
66
|
+
Put defines after `--build-exe` (or after the `--build-for` target), and choose
|
|
67
|
+
at most one `MDCUI_DEFAULT_*` mode.
|
|
68
|
+
|
|
69
|
+
| Build defines | No-argument launch | Switch UI |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| `MDCUI_DEFAULT_EDIT=1` | text editor | `./mdcui --tui app.md` |
|
|
72
|
+
| `MDCUI_DEFAULT_DEMO=1` | `testapp.md` TUI | `./mdcui --wui --demo` |
|
|
73
|
+
| `MDCUI_DEFAULT_DEMO_WUI=1` | `testapp.md` WUI | `./mdcui --tui --demo` |
|
|
74
|
+
| `global.MDCUI_MAIN=../中文工具.md` | custom TUI | `./mdcui --wui --demo-中文工具` |
|
|
75
|
+
| MAIN plus `MDCUI_DEFAULT_DEMO_WUI=1` | custom WUI | `./mdcui --tui --demo-中文工具` |
|
|
76
|
+
|
|
77
|
+
For a custom TUI-default executable:
|
|
78
|
+
|
|
79
|
+
```shell
|
|
80
|
+
bun ./src/index.js --build-exe \
|
|
81
|
+
--define global.MDCUI_MAIN=../中文工具.md
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
For a custom WUI-default executable:
|
|
85
|
+
|
|
86
|
+
```shell
|
|
87
|
+
bun ./src/index.js --build-exe \
|
|
88
|
+
--define global.MDCUI_MAIN=../中文工具.md \
|
|
89
|
+
--define MDCUI_DEFAULT_DEMO_WUI=1
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Explicit runtime arguments suppress automatic demo/WUI selection, so switching
|
|
93
|
+
UI must repeat `--demo` or `--demo-中文工具`. The main basename must end in
|
|
94
|
+
lowercase `.md`; its demo name allows Unicode letters/numbers (including
|
|
95
|
+
Chinese), dots, underscores, and hyphens, but no whitespace.
|
|
96
|
+
|
|
97
|
+
The custom demo uses embedded TUI front/RPC or the embedded WUI server when its
|
|
98
|
+
local Markdown byte length matches the embedded asset. Missing or overwritten
|
|
99
|
+
demos use embedded modules after the asset is written. A differing byte length
|
|
100
|
+
warns and selects filesystem companion modules.
|
|
101
|
+
|
|
102
|
+
To perform the same steps manually, run these commands from `single-exe/`:
|
|
103
|
+
|
|
104
|
+
```shell
|
|
105
|
+
bun ./packAssets.sh
|
|
106
|
+
bun build --format=esm --compile --minify --bytecode ./entry.mjs --outfile=mdcui
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Adapting this folder to another project
|
|
110
|
+
|
|
111
|
+
This folder is a reusable starting point, not a drop-in package. The current
|
|
112
|
+
`entry.mjs` and `packAssets.sh` contain jsmdcui paths, so another project must
|
|
113
|
+
complete the following integration steps.
|
|
114
|
+
|
|
115
|
+
The adopting project needs Bun for packing and compiling, a `tar` command for
|
|
116
|
+
`packAssets.sh`, and an ES-module setup. Keep `"type": "module"` in
|
|
117
|
+
`package.json`, or rename the copied `.js` modules to `.mjs` and update their
|
|
118
|
+
imports. The supported uncompiled Node path requires Node.js 20.11 or newer
|
|
119
|
+
because `compiled.js` uses `import.meta.dirname`.
|
|
120
|
+
|
|
121
|
+
`assetsHelper.js` and `compiled.js` are Node-compatible under those conditions.
|
|
122
|
+
`assetsLoader.mjs` and `entry.mjs` are Bun-only and must not be imported by the
|
|
123
|
+
regular Node entry path.
|
|
124
|
+
|
|
125
|
+
### 1. Copy the bootstrap directory
|
|
126
|
+
|
|
127
|
+
Copy the entire `single-exe/` directory to the root of the other project and
|
|
128
|
+
keep its name and relative position unless you also update the paths in
|
|
129
|
+
`compiled.js` and `packAssets.sh`. A typical layout is:
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
my-project/
|
|
133
|
+
├── single-exe/
|
|
134
|
+
│ ├── assetsHelper.js
|
|
135
|
+
│ ├── assetsLoader.mjs
|
|
136
|
+
│ ├── compiled.js
|
|
137
|
+
│ ├── entry.mjs
|
|
138
|
+
│ └── packAssets.sh
|
|
139
|
+
└── src/
|
|
140
|
+
└── index.js
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`assets.tar` is generated by `packAssets.sh`; it does not need to exist before
|
|
144
|
+
the first packing step.
|
|
145
|
+
|
|
146
|
+
### 2. Point `entry.mjs` at the main program
|
|
147
|
+
|
|
148
|
+
Keep the asset loader as the first import and change the path passed to the
|
|
149
|
+
final `await import()` so it points to the other project's real entry module:
|
|
150
|
+
|
|
151
|
+
```js
|
|
152
|
+
#!/usr/bin/env bun
|
|
153
|
+
|
|
154
|
+
import "./assetsLoader.mjs";
|
|
155
|
+
await globalThis.assetsLoaderPromise;
|
|
156
|
+
await import("../src/index.js");
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
> **Important:** Keep the final import dynamic. Do not replace it with a static
|
|
160
|
+
> `import "../src/index.js"`, because static dependencies are evaluated before
|
|
161
|
+
> the asset Promise is awaited.
|
|
162
|
+
|
|
163
|
+
Only the Bun single-file executable build should use this bootstrap entry.
|
|
164
|
+
Continue to run the regular main module directly when using Node:
|
|
165
|
+
|
|
166
|
+
```shell
|
|
167
|
+
node ./src/index.js
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 3. Choose which files to embed
|
|
171
|
+
|
|
172
|
+
Edit the resource list in `packAssets.sh`; the script runs `tar` for you. It
|
|
173
|
+
changes to the project root, writes `single-exe/assets.tar`, and packs every
|
|
174
|
+
listed runtime resource required by the compiled program. Paths stored in the
|
|
175
|
+
archive become the lookup keys used by `assetsHelper.js`; use keys such as
|
|
176
|
+
`public/app.css`, without a leading `./`. The normal `--build-exe` and
|
|
177
|
+
`--build-for` flows invoke this script automatically, so you do not need to run
|
|
178
|
+
`tar` yourself.
|
|
179
|
+
|
|
180
|
+
For example:
|
|
181
|
+
|
|
182
|
+
```sh
|
|
183
|
+
#!/bin/sh
|
|
184
|
+
|
|
185
|
+
script_dir=$(dirname "$0")
|
|
186
|
+
cd "$script_dir/.." || exit 1
|
|
187
|
+
|
|
188
|
+
tar -cvf single-exe/assets.tar public templates README.md
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Do not retain jsmdcui's `demos`, `runtime`, `src/cui`, or `testapp.md` entries
|
|
192
|
+
unless the adopting project actually contains and needs them.
|
|
193
|
+
|
|
194
|
+
### 4. Read embedded assets with an external fallback
|
|
195
|
+
|
|
196
|
+
Import `readAssetText()` or `readAssetBytes()` from `assetsHelper.js`. They
|
|
197
|
+
first read the embedded asset and automatically fall back to the same path
|
|
198
|
+
under `REPO_ROOT` when the asset is not embedded:
|
|
199
|
+
|
|
200
|
+
```js
|
|
201
|
+
import {
|
|
202
|
+
readAssetBytes,
|
|
203
|
+
readAssetText,
|
|
204
|
+
} from "../single-exe/assetsHelper.js";
|
|
205
|
+
|
|
206
|
+
// Embedded asset first; external REPO_ROOT/templates/page.html fallback.
|
|
207
|
+
const source = await readAssetText("templates/page.html");
|
|
208
|
+
|
|
209
|
+
// The same fallback behavior, returned as Uint8Array.
|
|
210
|
+
const image = await readAssetBytes("images/photo.png");
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
In the source tree, `REPO_ROOT` is the project root. In a compiled executable,
|
|
214
|
+
it is the executable's directory, which is also where `--assets-extract`
|
|
215
|
+
places the external resource tree. Use `readInternalAssetBytes()` when a
|
|
216
|
+
resource should be returned as embedded bytes without the fallback.
|
|
217
|
+
Use `listInternalAssetPaths()` to list embedded asset paths and
|
|
218
|
+
`listInternalAssetDirs()` to list embedded directories.
|
|
219
|
+
|
|
220
|
+
#### Reuse images from a compiled HTML bundle
|
|
221
|
+
|
|
222
|
+
Bun exposes an imported HTML entry as a `homepage` object in a compiled
|
|
223
|
+
executable. Its `index` points to the compiled HTML and its `files` array lists
|
|
224
|
+
the content-hashed assets under Bun's compiled virtual filesystem: paths
|
|
225
|
+
normally begin with `/$bunfs/root/` on POSIX systems and `B:/~BUN/` on
|
|
226
|
+
Windows. The helpers can turn image references preserved in that HTML into a
|
|
227
|
+
lazy path map without copying the image bytes into `internalAssets`. Always use
|
|
228
|
+
the path returned by `homepage.files`; do not hard-code either platform prefix.
|
|
229
|
+
|
|
230
|
+
Before compiling, preserve each original image reference in a custom
|
|
231
|
+
attribute. Its name belongs to the adopting project; it is not fixed by the
|
|
232
|
+
helper. This example chooses `data-original-image`. Bun rewrites `src` but
|
|
233
|
+
leaves the custom attribute intact:
|
|
234
|
+
|
|
235
|
+
```html
|
|
236
|
+
<!-- Input -->
|
|
237
|
+
<img src="./images/photo.jpg" data-original-image="./images/photo.jpg">
|
|
238
|
+
|
|
239
|
+
<!-- Compiled HTML -->
|
|
240
|
+
<img src="/photo-abcd1234.jpg" data-original-image="./images/photo.jpg">
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Export the imported HTML bundle from a module that both the web server and
|
|
244
|
+
terminal runtime can load:
|
|
245
|
+
|
|
246
|
+
```js
|
|
247
|
+
import homepage from "./index.html";
|
|
248
|
+
|
|
249
|
+
export { homepage };
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Build and cache the map only in a compiled executable. Guard the import first:
|
|
253
|
+
a source-tree launch does not necessarily have the generated server or HTML
|
|
254
|
+
module.
|
|
255
|
+
|
|
256
|
+
```js
|
|
257
|
+
import {
|
|
258
|
+
buildHtmlBundleImageMap,
|
|
259
|
+
canonicalHtmlBundleImageHref,
|
|
260
|
+
} from "../single-exe/assetsHelper.js";
|
|
261
|
+
import { IS_COMPILED } from "../single-exe/compiled.js";
|
|
262
|
+
|
|
263
|
+
let imageMapPromise = null;
|
|
264
|
+
const imageSourceAttribute = "data-original-image";
|
|
265
|
+
|
|
266
|
+
function getBundledImageMap() {
|
|
267
|
+
if (!IS_COMPILED || !global.MY_EMBEDDED_APP) return null;
|
|
268
|
+
|
|
269
|
+
imageMapPromise ??= import(global.MY_EMBEDDED_APP + "-server.js")
|
|
270
|
+
.then(module => buildHtmlBundleImageMap(
|
|
271
|
+
module.homepage,
|
|
272
|
+
imageSourceAttribute,
|
|
273
|
+
));
|
|
274
|
+
|
|
275
|
+
return imageMapPromise;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const images = await getBundledImageMap();
|
|
279
|
+
const key = canonicalHtmlBundleImageHref(originalImageHref);
|
|
280
|
+
const bundledPath = images?.get(key);
|
|
281
|
+
const bytes = bundledPath ? await Bun.file(bundledPath).bytes() : null;
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
`global.MY_EMBEDDED_APP` is only an example build-time module selector. Name it
|
|
285
|
+
to match the adopting application, replace it with a direct static import, or
|
|
286
|
+
use another compiled-only condition. The helper does not inspect or require
|
|
287
|
+
`global.MDCUI_MAIN`; that is jsmdcui's own convention. When using a Bun
|
|
288
|
+
`--define`, use the same expression at the call site, for example
|
|
289
|
+
`--define global.MY_EMBEDDED_APP=...`.
|
|
290
|
+
|
|
291
|
+
`buildHtmlBundleImageMap(homepage, sourceAttribute)` reads the compiled HTML
|
|
292
|
+
once and returns a `Map<string, string>` from canonical original image
|
|
293
|
+
references to Bun compiled virtual paths on either platform. The second
|
|
294
|
+
argument is the custom attribute name. It defaults to `"data-mdcui-src"` only
|
|
295
|
+
for jsmdcui's convenience:
|
|
296
|
+
|
|
297
|
+
```js
|
|
298
|
+
const images = await buildHtmlBundleImageMap(homepage);
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Adopting projects can choose any valid HTML attribute name and pass it
|
|
302
|
+
explicitly:
|
|
303
|
+
|
|
304
|
+
```html
|
|
305
|
+
<img src="./photo.jpg" data-original-image="./photo.jpg">
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
```js
|
|
309
|
+
const images = await buildHtmlBundleImageMap(
|
|
310
|
+
homepage,
|
|
311
|
+
"data-original-image",
|
|
312
|
+
);
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
The helper decodes HTML attribute entities and percent encoding so the HTML
|
|
316
|
+
reference can match the equivalent original caller reference. Image bytes
|
|
317
|
+
remain lazy and are read only when the caller uses the returned path.
|
|
318
|
+
|
|
319
|
+
For lower-level lookup, `findHtmlBundleAsset(homepage, publicPath, options)`
|
|
320
|
+
matches a rewritten public path such as `/photo-abcd1234.jpg` to its
|
|
321
|
+
`homepage.files` entry. `findHtmlBundleImageAsset()` restricts the lookup to
|
|
322
|
+
`image/*`, and `htmlBundleImageAssetPath()` returns only the corresponding
|
|
323
|
+
Bun compiled virtual path.
|
|
324
|
+
|
|
325
|
+
### 5. Add the optional build commands to the regular CLI
|
|
326
|
+
|
|
327
|
+
Before normal argument parsing, call `buildEarlyExit` from the regular main
|
|
328
|
+
module:
|
|
329
|
+
|
|
330
|
+
```js
|
|
331
|
+
const compiledHelper = await import("../single-exe/compiled.js").catch(() => null);
|
|
332
|
+
await compiledHelper?.buildEarlyExit?.(process.argv, "my-bin");
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
The second argument is the output filename; it defaults to `single.exe` when
|
|
336
|
+
omitted. This enables:
|
|
337
|
+
|
|
338
|
+
```shell
|
|
339
|
+
bun ./src/index.js --build-exe
|
|
340
|
+
bun ./src/index.js --build-for <target>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Both commands run `packAssets.sh` before `bun build`. The second form passes
|
|
344
|
+
`<target>` through as Bun's `--target=<target>` value.
|
|
345
|
+
|
|
346
|
+
Alternatively, build manually from inside `single-exe/`:
|
|
347
|
+
|
|
348
|
+
```shell
|
|
349
|
+
bun ./packAssets.sh
|
|
350
|
+
bun build --format=esm --compile --minify --bytecode ./entry.mjs --outfile=my-bin
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
#### Passing --define to bun build
|
|
354
|
+
|
|
355
|
+
`buildEarlyExit()` forwards build arguments to Bun, whose define parser expects
|
|
356
|
+
strings to be quoted literals. To accept a bare value such as a path, call the below
|
|
357
|
+
helper to normalize it before `buildEarlyExit()`:
|
|
358
|
+
|
|
359
|
+
```js
|
|
360
|
+
import {
|
|
361
|
+
buildEarlyExit,
|
|
362
|
+
stringifyNonPrimitiveDefineValues,
|
|
363
|
+
} from "../single-exe/compiled.js";
|
|
364
|
+
|
|
365
|
+
stringifyNonPrimitiveDefineValues(process.argv, "MY_STRING_DEFINE");
|
|
366
|
+
await buildEarlyExit(process.argv, "my-bin");
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
```shell
|
|
370
|
+
# Wrong: Bun parses the define before the helper runs.
|
|
371
|
+
bun --define MY_STRING_DEFINE=../app.md ./src/index.js --build-exe
|
|
372
|
+
|
|
373
|
+
# Correct
|
|
374
|
+
bun ./src/index.js --build-exe --define MY_STRING_DEFINE=../app.md
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Before normalization:
|
|
378
|
+
|
|
379
|
+
```js
|
|
380
|
+
["--define", "MY_STRING_DEFINE=../app.md"]
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
After normalization:
|
|
384
|
+
|
|
385
|
+
```js
|
|
386
|
+
["--define", 'MY_STRING_DEFINE="../app.md"']
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
The inline form works too:
|
|
390
|
+
`--define=MY_STRING_DEFINE=../app.md` becomes
|
|
391
|
+
`--define=MY_STRING_DEFINE="../app.md"`.
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
### 6. Verify both execution paths
|
|
395
|
+
|
|
396
|
+
Verify the compiled asset archive and then run the program normally:
|
|
397
|
+
|
|
398
|
+
```shell
|
|
399
|
+
./my-bin --assets-list
|
|
400
|
+
./my-bin
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
Also run the uncompiled main module with Node.js 20.11 or newer to verify that
|
|
404
|
+
all required files have a working external fallback:
|
|
405
|
+
|
|
406
|
+
```shell
|
|
407
|
+
node ./src/index.js
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
Use `./my-bin --assets-extract` to write the packed tree beside the executable.
|
|
411
|
+
After extraction, `./my-bin --assets-external` skips the embedded store and is
|
|
412
|
+
useful for testing the external-resource path.
|
|
413
|
+
|
|
414
|
+
### Why `assetsLoaderPromise` is used
|
|
415
|
+
|
|
416
|
+
A more tightly coupled ESM design could export the assets with top-level
|
|
417
|
+
`await`, then make the main module import `assetsLoader.mjs` directly. This
|
|
418
|
+
project deliberately does not do that because `assetsLoader.mjs` contains
|
|
419
|
+
Bun's compiled-file import:
|
|
420
|
+
|
|
421
|
+
```js
|
|
422
|
+
import assets from "./assets.tar" with { type: "file" };
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
If the regular main module imported `assetsLoader.mjs`, that Bun-specific
|
|
426
|
+
`type: "file"` dependency would enter the main module graph. Node would then be
|
|
427
|
+
unable to load the program before it could select an external-file fallback.
|
|
428
|
+
|
|
429
|
+
Instead, only Bun's `entry.mjs` imports the Bun-specific loader, awaits its
|
|
430
|
+
Promise, and then dynamically imports the regular main module. The main module
|
|
431
|
+
does not import the loader, inspect the Promise, or contain Bun bootstrap code.
|
|
432
|
+
Under the supported Node.js 20.11+ ESM path, Node runs that clean main module
|
|
433
|
+
directly with external files. The Promise is therefore an intentional
|
|
434
|
+
Node-compatibility boundary inside the Bun-only bootstrap, not a failure to use
|
|
435
|
+
a more modern dependency or top-level-`await` design.
|
|
436
|
+
|
|
437
|
+
## Entry Flow
|
|
438
|
+
|
|
439
|
+
- `entry.mjs` imports `assetsLoader.mjs` first
|
|
440
|
+
- `assetsLoader.mjs` loads `assets.tar` with `Bun.Archive` and mounts it as `globalThis.internalAssets`
|
|
441
|
+
- `assetsLoaderPromise` is exposed on `globalThis`
|
|
442
|
+
- `entry.mjs` awaits `assetsLoaderPromise`
|
|
443
|
+
- `entry.mjs` dynamically imports the main program after the assets are ready
|
|
444
|
+
|
|
445
|
+
That keeps the main program bootable even if asset loading reports errors.
|
|
446
|
+
|
|
447
|
+
## Assets Loading
|
|
448
|
+
|
|
449
|
+
- Bundled assets are loaded sequentially with `await file.bytes()`
|
|
450
|
+
- Load failures are collected and printed to `stderr`
|
|
451
|
+
- Asset loading never rejects the bootstrap promise
|
|
452
|
+
- When loading succeeds, the archive is available through `globalThis.internalAssets`
|
|
453
|
+
|
|
454
|
+
This loader is not zero-copy: it materializes every bundled file in memory and
|
|
455
|
+
keeps the resulting bytes in `globalThis.internalAssets`. Large asset archives
|
|
456
|
+
can therefore increase startup and ongoing RAM usage. For workloads where that
|
|
457
|
+
matters, I also wrote an experimental Linux-only zero-copy hack:
|
|
458
|
+
[bun-assets-zerocopy](https://github.com/jjtseng93/bun-assets-zerocopy).
|
|
459
|
+
|
|
460
|
+
## CLI Flags
|
|
461
|
+
|
|
462
|
+
- `--assets-list`
|
|
463
|
+
- Lists all entries inside bundled `assets.tar`
|
|
464
|
+
- Exits early before the main program starts
|
|
465
|
+
|
|
466
|
+
- `--assets-extract`
|
|
467
|
+
- Extracts bundled assets to the same directory as the executable
|
|
468
|
+
- Exits early before the main program starts
|
|
469
|
+
|
|
470
|
+
- `--assets-external`
|
|
471
|
+
- Skips loading bundled assets into `globalThis.internalAssets`
|
|
472
|
+
- Forces the main program and runtime helpers to use the external file tree
|
|
473
|
+
- Keeps the bootstrap alive while leaving `internalAssets` falsy
|