@fairyhunter13/opentui-core 0.1.114 → 0.1.116
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/3d/SpriteResourceManager.d.ts +74 -0
- package/3d/SpriteUtils.d.ts +13 -0
- package/3d/TextureUtils.d.ts +24 -0
- package/3d/ThreeRenderable.d.ts +40 -0
- package/3d/WGPURenderer.d.ts +61 -0
- package/3d/animation/ExplodingSpriteEffect.d.ts +71 -0
- package/3d/animation/PhysicsExplodingSpriteEffect.d.ts +76 -0
- package/3d/animation/SpriteAnimator.d.ts +124 -0
- package/3d/animation/SpriteParticleGenerator.d.ts +62 -0
- package/3d/canvas.d.ts +44 -0
- package/3d/index.d.ts +12 -0
- package/3d/physics/PlanckPhysicsAdapter.d.ts +19 -0
- package/3d/physics/RapierPhysicsAdapter.d.ts +19 -0
- package/3d/physics/physics-interface.d.ts +27 -0
- package/3d.d.ts +2 -0
- package/3d.js +34041 -0
- package/3d.js.map +155 -0
- package/LICENSE +21 -0
- package/NativeSpanFeed.d.ts +41 -0
- package/Renderable.d.ts +334 -0
- package/animation/Timeline.d.ts +126 -0
- package/ansi.d.ts +13 -0
- package/buffer.d.ts +111 -0
- package/console.d.ts +144 -0
- package/edit-buffer.d.ts +98 -0
- package/editor-view.d.ts +73 -0
- package/index-dcj62y8t.js +20614 -0
- package/index-dcj62y8t.js.map +67 -0
- package/index-jyrhjc34.js +411 -0
- package/index-jyrhjc34.js.map +10 -0
- package/index-wc7ae60z.js +12299 -0
- package/index-wc7ae60z.js.map +42 -0
- package/index.d.ts +23 -0
- package/index.js +478 -0
- package/index.js.map +9 -0
- package/lib/KeyHandler.d.ts +61 -0
- package/lib/RGBA.d.ts +25 -0
- package/lib/ascii.font.d.ts +508 -0
- package/lib/border.d.ts +51 -0
- package/lib/bunfs.d.ts +7 -0
- package/lib/clipboard.d.ts +17 -0
- package/lib/clock.d.ts +15 -0
- package/lib/data-paths.d.ts +26 -0
- package/lib/debounce.d.ts +42 -0
- package/lib/detect-links.d.ts +6 -0
- package/lib/env.d.ts +42 -0
- package/lib/extmarks-history.d.ts +17 -0
- package/lib/extmarks.d.ts +89 -0
- package/lib/hast-styled-text.d.ts +17 -0
- package/lib/index.d.ts +21 -0
- package/lib/keymapping.d.ts +25 -0
- package/lib/objects-in-viewport.d.ts +24 -0
- package/lib/output.capture.d.ts +24 -0
- package/lib/parse.keypress-kitty.d.ts +2 -0
- package/lib/parse.keypress.d.ts +26 -0
- package/lib/parse.mouse.d.ts +30 -0
- package/lib/paste.d.ts +7 -0
- package/lib/queue.d.ts +15 -0
- package/lib/renderable.validations.d.ts +12 -0
- package/lib/scroll-acceleration.d.ts +43 -0
- package/lib/selection.d.ts +63 -0
- package/lib/singleton.d.ts +7 -0
- package/lib/stdin-parser.d.ts +87 -0
- package/lib/styled-text.d.ts +63 -0
- package/lib/terminal-capability-detection.d.ts +30 -0
- package/lib/terminal-palette.d.ts +50 -0
- package/lib/tree-sitter/assets/update.d.ts +11 -0
- package/lib/tree-sitter/client.d.ts +47 -0
- package/lib/tree-sitter/default-parsers.d.ts +2 -0
- package/lib/tree-sitter/download-utils.d.ts +21 -0
- package/lib/tree-sitter/index.d.ts +8 -0
- package/lib/tree-sitter/parser.worker.d.ts +1 -0
- package/lib/tree-sitter/parsers-config.d.ts +53 -0
- package/lib/tree-sitter/resolve-ft.d.ts +5 -0
- package/lib/tree-sitter/types.d.ts +82 -0
- package/lib/tree-sitter-styled-text.d.ts +14 -0
- package/lib/validate-dir-name.d.ts +1 -0
- package/lib/yoga.options.d.ts +32 -0
- package/package.json +53 -62
- package/parser.worker.js +899 -0
- package/parser.worker.js.map +12 -0
- package/plugins/core-slot.d.ts +72 -0
- package/plugins/registry.d.ts +42 -0
- package/plugins/types.d.ts +34 -0
- package/post/effects.d.ts +147 -0
- package/post/filters.d.ts +65 -0
- package/post/matrices.d.ts +20 -0
- package/renderables/ASCIIFont.d.ts +52 -0
- package/renderables/Box.d.ts +81 -0
- package/renderables/Code.d.ts +78 -0
- package/renderables/Diff.d.ts +142 -0
- package/renderables/EditBufferRenderable.d.ts +237 -0
- package/renderables/FrameBuffer.d.ts +16 -0
- package/renderables/Input.d.ts +67 -0
- package/renderables/LineNumberRenderable.d.ts +78 -0
- package/renderables/Markdown.d.ts +185 -0
- package/renderables/ScrollBar.d.ts +77 -0
- package/renderables/ScrollBox.d.ts +124 -0
- package/renderables/Select.d.ts +115 -0
- package/renderables/Slider.d.ts +47 -0
- package/renderables/TabSelect.d.ts +96 -0
- package/renderables/Text.d.ts +36 -0
- package/renderables/TextBufferRenderable.d.ts +105 -0
- package/renderables/TextNode.d.ts +91 -0
- package/renderables/TextTable.d.ts +140 -0
- package/renderables/Textarea.d.ts +63 -0
- package/renderables/TimeToFirstDraw.d.ts +24 -0
- package/renderables/__tests__/renderable-test-utils.d.ts +12 -0
- package/renderables/composition/VRenderable.d.ts +16 -0
- package/renderables/composition/constructs.d.ts +35 -0
- package/renderables/composition/vnode.d.ts +46 -0
- package/renderables/index.d.ts +23 -0
- package/renderables/markdown-parser.d.ts +10 -0
- package/renderer.d.ts +419 -0
- package/runtime-plugin-support.d.ts +3 -0
- package/runtime-plugin-support.js +29 -0
- package/runtime-plugin-support.js.map +10 -0
- package/runtime-plugin.d.ts +16 -0
- package/runtime-plugin.js +16 -0
- package/runtime-plugin.js.map +9 -0
- package/syntax-style.d.ts +54 -0
- package/testing/manual-clock.d.ts +17 -0
- package/testing/mock-keys.d.ts +81 -0
- package/testing/mock-mouse.d.ts +38 -0
- package/testing/mock-tree-sitter-client.d.ts +23 -0
- package/testing/spy.d.ts +7 -0
- package/testing/test-recorder.d.ts +61 -0
- package/testing/test-renderer.d.ts +23 -0
- package/testing.d.ts +6 -0
- package/testing.js +697 -0
- package/testing.js.map +15 -0
- package/text-buffer-view.d.ts +42 -0
- package/text-buffer.d.ts +67 -0
- package/types.d.ts +139 -0
- package/utils.d.ts +14 -0
- package/zig-structs.d.ts +155 -0
- package/zig.d.ts +353 -0
- package/dev/keypress-debug-renderer.ts +0 -148
- package/dev/keypress-debug.ts +0 -43
- package/dev/print-env-vars.ts +0 -32
- package/dev/test-tmux-graphics-334.sh +0 -68
- package/dev/thai-debug-test.ts +0 -68
- package/docs/development.md +0 -144
- package/scripts/build.ts +0 -400
- package/scripts/publish.ts +0 -60
- package/src/3d/SpriteResourceManager.ts +0 -286
- package/src/3d/SpriteUtils.ts +0 -70
- package/src/3d/TextureUtils.ts +0 -196
- package/src/3d/ThreeRenderable.ts +0 -197
- package/src/3d/WGPURenderer.ts +0 -294
- package/src/3d/animation/ExplodingSpriteEffect.ts +0 -513
- package/src/3d/animation/PhysicsExplodingSpriteEffect.ts +0 -429
- package/src/3d/animation/SpriteAnimator.ts +0 -633
- package/src/3d/animation/SpriteParticleGenerator.ts +0 -435
- package/src/3d/canvas.ts +0 -464
- package/src/3d/index.ts +0 -12
- package/src/3d/physics/PlanckPhysicsAdapter.ts +0 -72
- package/src/3d/physics/RapierPhysicsAdapter.ts +0 -66
- package/src/3d/physics/physics-interface.ts +0 -31
- package/src/3d/shaders/supersampling.wgsl +0 -201
- package/src/3d.ts +0 -3
- package/src/NativeSpanFeed.ts +0 -300
- package/src/Renderable.ts +0 -1704
- package/src/__snapshots__/buffer.test.ts.snap +0 -28
- package/src/animation/Timeline.test.ts +0 -2709
- package/src/animation/Timeline.ts +0 -598
- package/src/ansi.ts +0 -18
- package/src/benchmark/attenuation-benchmark.ts +0 -81
- package/src/benchmark/colormatrix-benchmark.ts +0 -128
- package/src/benchmark/gain-benchmark.ts +0 -80
- package/src/benchmark/latest-all-bench-run.json +0 -707
- package/src/benchmark/latest-async-bench-run.json +0 -336
- package/src/benchmark/latest-default-bench-run.json +0 -657
- package/src/benchmark/latest-large-bench-run.json +0 -707
- package/src/benchmark/latest-quick-bench-run.json +0 -207
- package/src/benchmark/markdown-benchmark.ts +0 -1796
- package/src/benchmark/native-span-feed-async-benchmark.ts +0 -355
- package/src/benchmark/native-span-feed-benchmark.md +0 -56
- package/src/benchmark/native-span-feed-benchmark.ts +0 -596
- package/src/benchmark/native-span-feed-compare.ts +0 -280
- package/src/benchmark/renderer-benchmark.ts +0 -754
- package/src/benchmark/text-table-benchmark.ts +0 -948
- package/src/buffer.test.ts +0 -291
- package/src/buffer.ts +0 -554
- package/src/console.test.ts +0 -612
- package/src/console.ts +0 -1254
- package/src/edit-buffer.test.ts +0 -1769
- package/src/edit-buffer.ts +0 -411
- package/src/editor-view.test.ts +0 -1032
- package/src/editor-view.ts +0 -284
- package/src/examples/ascii-font-selection-demo.ts +0 -245
- package/src/examples/assets/Water_2_M_Normal.jpg +0 -0
- package/src/examples/assets/concrete.png +0 -0
- package/src/examples/assets/crate.png +0 -0
- package/src/examples/assets/crate_emissive.png +0 -0
- package/src/examples/assets/forrest_background.png +0 -0
- package/src/examples/assets/hast-example.json +0 -1018
- package/src/examples/assets/heart.png +0 -0
- package/src/examples/assets/main_char_heavy_attack.png +0 -0
- package/src/examples/assets/main_char_idle.png +0 -0
- package/src/examples/assets/main_char_jump_end.png +0 -0
- package/src/examples/assets/main_char_jump_landing.png +0 -0
- package/src/examples/assets/main_char_jump_start.png +0 -0
- package/src/examples/assets/main_char_run_loop.png +0 -0
- package/src/examples/assets/roughness_map.jpg +0 -0
- package/src/examples/build.ts +0 -115
- package/src/examples/code-demo.ts +0 -924
- package/src/examples/console-demo.ts +0 -358
- package/src/examples/core-plugin-slots-demo.ts +0 -759
- package/src/examples/diff-demo.ts +0 -701
- package/src/examples/draggable-three-demo.ts +0 -259
- package/src/examples/editor-demo.ts +0 -322
- package/src/examples/extmarks-demo.ts +0 -196
- package/src/examples/focus-restore-demo.ts +0 -310
- package/src/examples/fonts.ts +0 -245
- package/src/examples/fractal-shader-demo.ts +0 -268
- package/src/examples/framebuffer-demo.ts +0 -674
- package/src/examples/full-unicode-demo.ts +0 -241
- package/src/examples/golden-star-demo.ts +0 -933
- package/src/examples/grayscale-buffer-demo.ts +0 -249
- package/src/examples/hast-syntax-highlighting-demo.ts +0 -129
- package/src/examples/index.ts +0 -926
- package/src/examples/input-demo.ts +0 -377
- package/src/examples/input-select-layout-demo.ts +0 -425
- package/src/examples/install.sh +0 -143
- package/src/examples/keypress-debug-demo.ts +0 -452
- package/src/examples/lib/HexList.ts +0 -122
- package/src/examples/lib/PaletteGrid.ts +0 -125
- package/src/examples/lib/standalone-keys.ts +0 -25
- package/src/examples/lib/tab-controller.ts +0 -243
- package/src/examples/lights-phong-demo.ts +0 -290
- package/src/examples/link-demo.ts +0 -220
- package/src/examples/live-state-demo.ts +0 -480
- package/src/examples/markdown-demo.ts +0 -725
- package/src/examples/mouse-interaction-demo.ts +0 -428
- package/src/examples/nested-zindex-demo.ts +0 -357
- package/src/examples/opacity-example.ts +0 -235
- package/src/examples/opentui-demo.ts +0 -1057
- package/src/examples/physx-planck-2d-demo.ts +0 -623
- package/src/examples/physx-rapier-2d-demo.ts +0 -655
- package/src/examples/relative-positioning-demo.ts +0 -323
- package/src/examples/scroll-example.ts +0 -214
- package/src/examples/scrollbox-mouse-test.ts +0 -112
- package/src/examples/scrollbox-overlay-hit-test.ts +0 -206
- package/src/examples/select-demo.ts +0 -237
- package/src/examples/shader-cube-demo.ts +0 -1015
- package/src/examples/simple-layout-example.ts +0 -591
- package/src/examples/slider-demo.ts +0 -617
- package/src/examples/split-mode-demo.ts +0 -453
- package/src/examples/sprite-animation-demo.ts +0 -443
- package/src/examples/sprite-particle-generator-demo.ts +0 -486
- package/src/examples/static-sprite-demo.ts +0 -193
- package/src/examples/sticky-scroll-example.ts +0 -308
- package/src/examples/styled-text-demo.ts +0 -282
- package/src/examples/tab-select-demo.ts +0 -219
- package/src/examples/terminal-title.ts +0 -29
- package/src/examples/terminal.ts +0 -305
- package/src/examples/text-node-demo.ts +0 -416
- package/src/examples/text-selection-demo.ts +0 -377
- package/src/examples/text-table-demo.ts +0 -503
- package/src/examples/text-truncation-demo.ts +0 -481
- package/src/examples/text-wrap.ts +0 -757
- package/src/examples/texture-loading-demo.ts +0 -259
- package/src/examples/timeline-example.ts +0 -670
- package/src/examples/transparency-demo.ts +0 -400
- package/src/examples/vnode-composition-demo.ts +0 -404
- package/src/examples/wide-grapheme-overlay-demo.ts +0 -280
- package/src/index.ts +0 -24
- package/src/lib/KeyHandler.integration.test.ts +0 -292
- package/src/lib/KeyHandler.stopPropagation.test.ts +0 -289
- package/src/lib/KeyHandler.test.ts +0 -662
- package/src/lib/KeyHandler.ts +0 -222
- package/src/lib/RGBA.test.ts +0 -984
- package/src/lib/RGBA.ts +0 -204
- package/src/lib/ascii.font.ts +0 -330
- package/src/lib/border.test.ts +0 -83
- package/src/lib/border.ts +0 -170
- package/src/lib/bunfs.test.ts +0 -27
- package/src/lib/bunfs.ts +0 -18
- package/src/lib/clipboard.test.ts +0 -41
- package/src/lib/clipboard.ts +0 -47
- package/src/lib/clock.ts +0 -35
- package/src/lib/data-paths.test.ts +0 -133
- package/src/lib/data-paths.ts +0 -109
- package/src/lib/debounce.ts +0 -106
- package/src/lib/detect-links.test.ts +0 -98
- package/src/lib/detect-links.ts +0 -56
- package/src/lib/env.test.ts +0 -228
- package/src/lib/env.ts +0 -209
- package/src/lib/extmarks-history.ts +0 -51
- package/src/lib/extmarks-multiwidth.test.ts +0 -322
- package/src/lib/extmarks.test.ts +0 -3457
- package/src/lib/extmarks.ts +0 -843
- package/src/lib/fonts/block.json +0 -405
- package/src/lib/fonts/grid.json +0 -265
- package/src/lib/fonts/huge.json +0 -741
- package/src/lib/fonts/pallet.json +0 -314
- package/src/lib/fonts/shade.json +0 -591
- package/src/lib/fonts/slick.json +0 -321
- package/src/lib/fonts/tiny.json +0 -69
- package/src/lib/hast-styled-text.ts +0 -59
- package/src/lib/index.ts +0 -21
- package/src/lib/keymapping.test.ts +0 -317
- package/src/lib/keymapping.ts +0 -115
- package/src/lib/objects-in-viewport.test.ts +0 -787
- package/src/lib/objects-in-viewport.ts +0 -153
- package/src/lib/output.capture.ts +0 -58
- package/src/lib/parse.keypress-kitty.protocol.test.ts +0 -340
- package/src/lib/parse.keypress-kitty.test.ts +0 -663
- package/src/lib/parse.keypress-kitty.ts +0 -439
- package/src/lib/parse.keypress.test.ts +0 -1849
- package/src/lib/parse.keypress.ts +0 -397
- package/src/lib/parse.mouse.test.ts +0 -552
- package/src/lib/parse.mouse.ts +0 -232
- package/src/lib/paste.ts +0 -16
- package/src/lib/queue.ts +0 -65
- package/src/lib/renderable.validations.test.ts +0 -87
- package/src/lib/renderable.validations.ts +0 -83
- package/src/lib/scroll-acceleration.ts +0 -98
- package/src/lib/selection.ts +0 -240
- package/src/lib/singleton.ts +0 -28
- package/src/lib/stdin-parser.test.ts +0 -2290
- package/src/lib/stdin-parser.ts +0 -1810
- package/src/lib/styled-text.ts +0 -178
- package/src/lib/terminal-capability-detection.test.ts +0 -202
- package/src/lib/terminal-capability-detection.ts +0 -79
- package/src/lib/terminal-palette.test.ts +0 -878
- package/src/lib/terminal-palette.ts +0 -383
- package/src/lib/tree-sitter/assets/README.md +0 -118
- package/src/lib/tree-sitter/assets/update.ts +0 -334
- package/src/lib/tree-sitter/assets.d.ts +0 -9
- package/src/lib/tree-sitter/cache.test.ts +0 -273
- package/src/lib/tree-sitter/client.test.ts +0 -1165
- package/src/lib/tree-sitter/client.ts +0 -607
- package/src/lib/tree-sitter/default-parsers.ts +0 -86
- package/src/lib/tree-sitter/download-utils.ts +0 -148
- package/src/lib/tree-sitter/index.ts +0 -28
- package/src/lib/tree-sitter/parser.worker.ts +0 -1042
- package/src/lib/tree-sitter/parsers-config.ts +0 -81
- package/src/lib/tree-sitter/resolve-ft.test.ts +0 -55
- package/src/lib/tree-sitter/resolve-ft.ts +0 -189
- package/src/lib/tree-sitter/types.ts +0 -82
- package/src/lib/tree-sitter-styled-text.test.ts +0 -1253
- package/src/lib/tree-sitter-styled-text.ts +0 -306
- package/src/lib/validate-dir-name.ts +0 -55
- package/src/lib/yoga.options.test.ts +0 -628
- package/src/lib/yoga.options.ts +0 -346
- package/src/plugins/core-slot.ts +0 -579
- package/src/plugins/registry.ts +0 -402
- package/src/plugins/types.ts +0 -46
- package/src/post/effects.ts +0 -930
- package/src/post/filters.ts +0 -489
- package/src/post/matrices.ts +0 -288
- package/src/renderables/ASCIIFont.ts +0 -219
- package/src/renderables/Box.test.ts +0 -205
- package/src/renderables/Box.ts +0 -326
- package/src/renderables/Code.test.ts +0 -2062
- package/src/renderables/Code.ts +0 -357
- package/src/renderables/Diff.regression.test.ts +0 -226
- package/src/renderables/Diff.test.ts +0 -3101
- package/src/renderables/Diff.ts +0 -1211
- package/src/renderables/EditBufferRenderable.test.ts +0 -288
- package/src/renderables/EditBufferRenderable.ts +0 -1166
- package/src/renderables/FrameBuffer.ts +0 -47
- package/src/renderables/Input.test.ts +0 -1228
- package/src/renderables/Input.ts +0 -247
- package/src/renderables/LineNumberRenderable.ts +0 -724
- package/src/renderables/Markdown.ts +0 -1393
- package/src/renderables/ScrollBar.ts +0 -422
- package/src/renderables/ScrollBox.ts +0 -883
- package/src/renderables/Select.test.ts +0 -1033
- package/src/renderables/Select.ts +0 -524
- package/src/renderables/Slider.test.ts +0 -456
- package/src/renderables/Slider.ts +0 -342
- package/src/renderables/TabSelect.test.ts +0 -197
- package/src/renderables/TabSelect.ts +0 -455
- package/src/renderables/Text.selection-buffer.test.ts +0 -123
- package/src/renderables/Text.test.ts +0 -2660
- package/src/renderables/Text.ts +0 -147
- package/src/renderables/TextBufferRenderable.ts +0 -518
- package/src/renderables/TextNode.test.ts +0 -1058
- package/src/renderables/TextNode.ts +0 -325
- package/src/renderables/TextTable.test.ts +0 -1421
- package/src/renderables/TextTable.ts +0 -1344
- package/src/renderables/Textarea.ts +0 -430
- package/src/renderables/TimeToFirstDraw.ts +0 -89
- package/src/renderables/__snapshots__/Code.test.ts.snap +0 -13
- package/src/renderables/__snapshots__/Diff.test.ts.snap +0 -785
- package/src/renderables/__snapshots__/Text.test.ts.snap +0 -421
- package/src/renderables/__snapshots__/TextTable.test.ts.snap +0 -215
- package/src/renderables/__tests__/LineNumberRenderable.scrollbox-simple.test.ts +0 -144
- package/src/renderables/__tests__/LineNumberRenderable.scrollbox.test.ts +0 -816
- package/src/renderables/__tests__/LineNumberRenderable.test.ts +0 -1865
- package/src/renderables/__tests__/LineNumberRenderable.wrapping.test.ts +0 -85
- package/src/renderables/__tests__/Markdown.code-colors.test.ts +0 -242
- package/src/renderables/__tests__/Markdown.test.ts +0 -2518
- package/src/renderables/__tests__/MultiRenderable.selection.test.ts +0 -87
- package/src/renderables/__tests__/Textarea.buffer.test.ts +0 -682
- package/src/renderables/__tests__/Textarea.destroyed-events.test.ts +0 -675
- package/src/renderables/__tests__/Textarea.editing.test.ts +0 -2041
- package/src/renderables/__tests__/Textarea.error-handling.test.ts +0 -35
- package/src/renderables/__tests__/Textarea.events.test.ts +0 -738
- package/src/renderables/__tests__/Textarea.highlights.test.ts +0 -590
- package/src/renderables/__tests__/Textarea.keybinding.test.ts +0 -3149
- package/src/renderables/__tests__/Textarea.paste.test.ts +0 -357
- package/src/renderables/__tests__/Textarea.rendering.test.ts +0 -1866
- package/src/renderables/__tests__/Textarea.scroll.test.ts +0 -733
- package/src/renderables/__tests__/Textarea.selection.test.ts +0 -1590
- package/src/renderables/__tests__/Textarea.stress.test.ts +0 -670
- package/src/renderables/__tests__/Textarea.undo-redo.test.ts +0 -383
- package/src/renderables/__tests__/Textarea.visual-lines.test.ts +0 -310
- package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.code.test.ts.snap +0 -221
- package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.scrollbox-simple.test.ts.snap +0 -89
- package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.scrollbox.test.ts.snap +0 -457
- package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.test.ts.snap +0 -158
- package/src/renderables/__tests__/__snapshots__/Textarea.rendering.test.ts.snap +0 -387
- package/src/renderables/__tests__/markdown-parser.test.ts +0 -217
- package/src/renderables/__tests__/renderable-test-utils.ts +0 -60
- package/src/renderables/composition/README.md +0 -8
- package/src/renderables/composition/VRenderable.ts +0 -32
- package/src/renderables/composition/constructs.ts +0 -127
- package/src/renderables/composition/vnode.ts +0 -289
- package/src/renderables/index.ts +0 -23
- package/src/renderables/markdown-parser.ts +0 -66
- package/src/renderer.ts +0 -2681
- package/src/runtime-plugin-support.ts +0 -39
- package/src/runtime-plugin.ts +0 -615
- package/src/syntax-style.test.ts +0 -841
- package/src/syntax-style.ts +0 -257
- package/src/testing/README.md +0 -210
- package/src/testing/capture-spans.test.ts +0 -194
- package/src/testing/integration.test.ts +0 -276
- package/src/testing/manual-clock.ts +0 -117
- package/src/testing/mock-keys.test.ts +0 -1378
- package/src/testing/mock-keys.ts +0 -457
- package/src/testing/mock-mouse.test.ts +0 -218
- package/src/testing/mock-mouse.ts +0 -247
- package/src/testing/mock-tree-sitter-client.ts +0 -73
- package/src/testing/spy.ts +0 -13
- package/src/testing/test-recorder.test.ts +0 -415
- package/src/testing/test-recorder.ts +0 -145
- package/src/testing/test-renderer.ts +0 -132
- package/src/testing.ts +0 -7
- package/src/tests/__snapshots__/absolute-positioning.snapshot.test.ts.snap +0 -481
- package/src/tests/__snapshots__/renderable.snapshot.test.ts.snap +0 -19
- package/src/tests/__snapshots__/scrollbox.test.ts.snap +0 -29
- package/src/tests/absolute-positioning.snapshot.test.ts +0 -638
- package/src/tests/allocator-stats.test.ts +0 -38
- package/src/tests/destroy-during-render.test.ts +0 -200
- package/src/tests/destroy-on-exit.fixture.ts +0 -36
- package/src/tests/destroy-on-exit.test.ts +0 -41
- package/src/tests/hover-cursor.test.ts +0 -98
- package/src/tests/native-span-feed-async.test.ts +0 -173
- package/src/tests/native-span-feed-close.test.ts +0 -120
- package/src/tests/native-span-feed-coverage.test.ts +0 -227
- package/src/tests/native-span-feed-edge-cases.test.ts +0 -352
- package/src/tests/native-span-feed-use-after-free.test.ts +0 -45
- package/src/tests/opacity.test.ts +0 -123
- package/src/tests/renderable.snapshot.test.ts +0 -524
- package/src/tests/renderable.test.ts +0 -1281
- package/src/tests/renderer.clock.test.ts +0 -158
- package/src/tests/renderer.console-startup.test.ts +0 -185
- package/src/tests/renderer.control.test.ts +0 -425
- package/src/tests/renderer.core-slot-binding.test.ts +0 -952
- package/src/tests/renderer.cursor.test.ts +0 -26
- package/src/tests/renderer.destroy-during-render.test.ts +0 -147
- package/src/tests/renderer.focus-restore.test.ts +0 -257
- package/src/tests/renderer.focus.test.ts +0 -294
- package/src/tests/renderer.idle.test.ts +0 -219
- package/src/tests/renderer.input.test.ts +0 -2237
- package/src/tests/renderer.kitty-flags.test.ts +0 -195
- package/src/tests/renderer.mouse.test.ts +0 -1274
- package/src/tests/renderer.palette.test.ts +0 -629
- package/src/tests/renderer.selection.test.ts +0 -49
- package/src/tests/renderer.slot-registry.test.ts +0 -684
- package/src/tests/renderer.useMouse.test.ts +0 -47
- package/src/tests/runtime-plugin-node-modules-cycle.fixture.ts +0 -76
- package/src/tests/runtime-plugin-node-modules-mjs.fixture.ts +0 -43
- package/src/tests/runtime-plugin-node-modules-no-bare-rewrite.fixture.ts +0 -67
- package/src/tests/runtime-plugin-node-modules-package-type-cache.fixture.ts +0 -72
- package/src/tests/runtime-plugin-node-modules-runtime-specifier.fixture.ts +0 -44
- package/src/tests/runtime-plugin-node-modules-scoped-package-bare-rewrite.fixture.ts +0 -85
- package/src/tests/runtime-plugin-path-alias.fixture.ts +0 -43
- package/src/tests/runtime-plugin-resolve-roots.fixture.ts +0 -65
- package/src/tests/runtime-plugin-support.fixture.ts +0 -11
- package/src/tests/runtime-plugin-support.test.ts +0 -19
- package/src/tests/runtime-plugin-windows-file-url.fixture.ts +0 -30
- package/src/tests/runtime-plugin.fixture.ts +0 -40
- package/src/tests/runtime-plugin.test.ts +0 -354
- package/src/tests/scrollbox-culling-bug.test.ts +0 -114
- package/src/tests/scrollbox-hitgrid-resize.test.ts +0 -136
- package/src/tests/scrollbox-hitgrid.test.ts +0 -909
- package/src/tests/scrollbox.test.ts +0 -1530
- package/src/tests/wrap-resize-perf.test.ts +0 -276
- package/src/tests/yoga-setters.test.ts +0 -921
- package/src/text-buffer-view.test.ts +0 -705
- package/src/text-buffer-view.ts +0 -189
- package/src/text-buffer.test.ts +0 -347
- package/src/text-buffer.ts +0 -250
- package/src/types.ts +0 -161
- package/src/utils.ts +0 -88
- package/src/zig/ansi.zig +0 -268
- package/src/zig/bench/README.md +0 -50
- package/src/zig/bench/buffer-draw-text-buffer_bench.zig +0 -887
- package/src/zig/bench/edit-buffer_bench.zig +0 -476
- package/src/zig/bench/native-span-feed_bench.zig +0 -100
- package/src/zig/bench/rope-markers_bench.zig +0 -713
- package/src/zig/bench/rope_bench.zig +0 -514
- package/src/zig/bench/styled-text_bench.zig +0 -470
- package/src/zig/bench/text-buffer-coords_bench.zig +0 -362
- package/src/zig/bench/text-buffer-view_bench.zig +0 -459
- package/src/zig/bench/text-chunk-graphemes_bench.zig +0 -273
- package/src/zig/bench/utf8_bench.zig +0 -799
- package/src/zig/bench-utils.zig +0 -431
- package/src/zig/bench.zig +0 -217
- package/src/zig/buffer-methods.zig +0 -211
- package/src/zig/buffer.zig +0 -2281
- package/src/zig/build.zig +0 -289
- package/src/zig/build.zig.zon +0 -16
- package/src/zig/edit-buffer.zig +0 -825
- package/src/zig/editor-view.zig +0 -802
- package/src/zig/event-bus.zig +0 -13
- package/src/zig/event-emitter.zig +0 -65
- package/src/zig/file-logger.zig +0 -92
- package/src/zig/grapheme.zig +0 -599
- package/src/zig/lib.zig +0 -1854
- package/src/zig/link.zig +0 -333
- package/src/zig/logger.zig +0 -43
- package/src/zig/mem-registry.zig +0 -125
- package/src/zig/native-span-feed-bench-lib.zig +0 -7
- package/src/zig/native-span-feed.zig +0 -708
- package/src/zig/renderer.zig +0 -1393
- package/src/zig/rope.zig +0 -1220
- package/src/zig/syntax-style.zig +0 -161
- package/src/zig/terminal.zig +0 -987
- package/src/zig/test.zig +0 -72
- package/src/zig/tests/README.md +0 -18
- package/src/zig/tests/buffer-methods_test.zig +0 -1109
- package/src/zig/tests/buffer_test.zig +0 -2557
- package/src/zig/tests/edit-buffer-history_test.zig +0 -271
- package/src/zig/tests/edit-buffer_test.zig +0 -1689
- package/src/zig/tests/editor-view_test.zig +0 -3299
- package/src/zig/tests/event-emitter_test.zig +0 -249
- package/src/zig/tests/grapheme_test.zig +0 -1304
- package/src/zig/tests/link_test.zig +0 -190
- package/src/zig/tests/mem-registry_test.zig +0 -473
- package/src/zig/tests/memory_leak_regression_test.zig +0 -159
- package/src/zig/tests/native-span-feed_test.zig +0 -1264
- package/src/zig/tests/renderer_test.zig +0 -1017
- package/src/zig/tests/rope-nested_test.zig +0 -712
- package/src/zig/tests/rope_fuzz_test.zig +0 -238
- package/src/zig/tests/rope_test.zig +0 -2362
- package/src/zig/tests/segment-merge.test.zig +0 -148
- package/src/zig/tests/syntax-style_test.zig +0 -557
- package/src/zig/tests/terminal_test.zig +0 -754
- package/src/zig/tests/text-buffer-drawing_test.zig +0 -3237
- package/src/zig/tests/text-buffer-highlights_test.zig +0 -666
- package/src/zig/tests/text-buffer-iterators_test.zig +0 -776
- package/src/zig/tests/text-buffer-segment_test.zig +0 -320
- package/src/zig/tests/text-buffer-selection_test.zig +0 -1035
- package/src/zig/tests/text-buffer-selection_viewport_test.zig +0 -358
- package/src/zig/tests/text-buffer-view_test.zig +0 -3649
- package/src/zig/tests/text-buffer_test.zig +0 -2191
- package/src/zig/tests/unicode-width-map.zon +0 -3909
- package/src/zig/tests/utf8_no_zwj_test.zig +0 -260
- package/src/zig/tests/utf8_test.zig +0 -4057
- package/src/zig/tests/utf8_wcwidth_cursor_test.zig +0 -267
- package/src/zig/tests/utf8_wcwidth_test.zig +0 -357
- package/src/zig/tests/word-wrap-editing_test.zig +0 -498
- package/src/zig/tests/wrap-cache-perf_test.zig +0 -113
- package/src/zig/text-buffer-iterators.zig +0 -499
- package/src/zig/text-buffer-segment.zig +0 -404
- package/src/zig/text-buffer-view.zig +0 -1371
- package/src/zig/text-buffer.zig +0 -1180
- package/src/zig/utf8.zig +0 -1948
- package/src/zig/utils.zig +0 -9
- package/src/zig-structs.ts +0 -261
- package/src/zig.ts +0 -3884
- package/tsconfig.build.json +0 -24
- package/tsconfig.json +0 -27
- /package/{src/lib/tree-sitter/assets → assets}/javascript/highlights.scm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/javascript/tree-sitter-javascript.wasm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/markdown/highlights.scm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/markdown/injections.scm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/markdown/tree-sitter-markdown.wasm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/markdown_inline/highlights.scm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/markdown_inline/tree-sitter-markdown_inline.wasm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/typescript/highlights.scm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/typescript/tree-sitter-typescript.wasm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/zig/highlights.scm +0 -0
- /package/{src/lib/tree-sitter/assets → assets}/zig/tree-sitter-zig.wasm +0 -0
package/dev/thai-debug-test.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
import { TextRenderable, createCliRenderer } from "../src/index.js"
|
|
3
|
-
import { ScrollBoxRenderable } from "../src/renderables/ScrollBox.js"
|
|
4
|
-
async function main() {
|
|
5
|
-
const renderer = await createCliRenderer({ exitOnCtrlC: true })
|
|
6
|
-
console.log("capabilities:", renderer.capabilities)
|
|
7
|
-
const scrollBox = new ScrollBoxRenderable(renderer, {
|
|
8
|
-
id: "scroll-box",
|
|
9
|
-
border: true,
|
|
10
|
-
height: 20,
|
|
11
|
-
title: "Thai Render Debug (Up/Down to scroll, Ctrl+C to exit)",
|
|
12
|
-
titleAlignment: "center",
|
|
13
|
-
})
|
|
14
|
-
const thaiLorem = `ภาษาไทยเป็นภาษาที่มีความสวยงามและซับซ้อนมาก มีพยัญชนะ 44 ตัว สระ 32 รูป และวรรณยุกต์ 4 รูป
|
|
15
|
-
มอญเป็นชนชาติที่มีอิทธิพลต่อภาษาไทยมาก คำว่า "มอ" เป็นพยัญชนะที่ใช้บ่อยในภาษาไทย
|
|
16
|
-
ตัวอย่างคำที่มี มอ: มา มี มือ มอง มัว มอบ มวย มอม มอด มอก
|
|
17
|
-
การเขียนภาษาไทยต้องใส่ใจเรื่องวรรณยุกต์ เช่น ม่า ม้า หม่า หม้า
|
|
18
|
-
สระลอยและสระเปลี่ยนรูปทำให้ภาษาไทยมีความพิเศษ เช่น เมือง แมว ไม้ ใหม่
|
|
19
|
-
คำผสมที่น่าสนใจ: มอมแมม มอดมอด มอมเมา มืดมอม มอมดำ
|
|
20
|
-
ภาษาไทยมีระบบการเขียนที่ไม่เว้นวรรคระหว่างคำ ทำให้การอ่านต้องอาศัยความเข้าใจ
|
|
21
|
-
ตัวอักษรไทยมีสามระดับ: บน กลาง ล่าง เช่น ก็ ปี่ ฎุ ฏู ญ ฐ ฑ
|
|
22
|
-
วรรณยุกต์ไทยมี 5 เสียง: สามัญ เอก โท ตรี จัตวา
|
|
23
|
-
ตัวอย่างเสียงวรรณยุกต์: มา ม่า ม้า หมา หม่า หม้า
|
|
24
|
-
การสะกดคำในภาษาไทยมีกฎเกณฑ์ที่ซับซ้อน มีทั้งตัวสะกดมาตราแม่ ก กา และตัวสะกดไม่ตรงมาตรา
|
|
25
|
-
คำยืมจากภาษาบาลีสันสกฤต: กรรม ธรรม สงฆ์ ศาสนา พระ มหา
|
|
26
|
-
คำยืมจากภาษาเขมร: ถนน เสวย ขนม ตำรวจ ทหาร
|
|
27
|
-
คำยืมจากภาษาจีน: ก๋วยเตี๋ยว เต้าหู้ บะหมี่ เกี๊ยว ซาลาเปา
|
|
28
|
-
ภาษาไทยถิ่นมีหลายภาษา: ภาษาเหนือ ภาษาอีสาน ภาษาใต้ ภาษากลาง
|
|
29
|
-
มอญกับไทยมีความสัมพันธ์ทางวัฒนธรรมมายาวนาน
|
|
30
|
-
ตัวเลขไทย: ๐ ๑ ๒ ๓ ๔ ๕ ๖ ๗ ๘ ๙
|
|
31
|
-
เครื่องหมายวรรคตอน: ฯ ๆ ฯลฯ « » ๏
|
|
32
|
-
อักษรไทยมีต้นกำเนิดจากอักษรเขมร ซึ่งมาจากอักษรปัลลวะของอินเดียใต้
|
|
33
|
-
พ่อขุนรามคำแหงมหาราชทรงประดิษฐ์อักษรไทยเมื่อ พ.ศ. 1826
|
|
34
|
-
ภาษาไทยเป็นภาษาที่มีวรรณยุกต์ การออกเสียงผิดวรรณยุกต์ทำให้ความหมายเปลี่ยน
|
|
35
|
-
ตัวอย่าง: ขาว (สีขาว) ข่าว (news) ข้าว (rice) เข้า (enter)
|
|
36
|
-
มอเตอร์ไซค์ มอนิเตอร์ มอลต์ มอร์ฟีน เป็นคำทับศัพท์ที่มี มอ
|
|
37
|
-
สำนวนไทยที่มี มอ: มอมเมา หมอมหมาม มืดมอม มอดไหม้
|
|
38
|
-
คำกริยาที่มี มอ: มอง มอบ มอม มอด มอก
|
|
39
|
-
คำนามที่มี มอ: มอญ มอด หมอ มอเตอร์
|
|
40
|
-
การผันวรรณยุกต์ของ มอ: มอ ม่อ ม้อ หมอ หม่อ หม้อ
|
|
41
|
-
ภาษาไทยมีคำควบกล้ำ: กร กล กว ขร ขล ขว คร คล คว
|
|
42
|
-
ตัวอย่างคำควบกล้ำ: กราบ กลาง กวาง ครู คลอง ความ
|
|
43
|
-
อักษรสูง กลาง ต่ำ มีผลต่อการผันวรรณยุกต์
|
|
44
|
-
อักษรสูง: ข ฃ ฉ ฐ ถ ผ ฝ ศ ษ ส ห
|
|
45
|
-
อักษรกลาง: ก จ ฎ ฏ ด ต บ ป อ
|
|
46
|
-
อักษรต่ำ: ค ฅ ฆ ง ช ซ ฌ ญ ฑ ฒ ณ ท ธ น พ ฟ ภ ม ย ร ล ว ฬ ฮ`
|
|
47
|
-
const text = new TextRenderable(renderer, {
|
|
48
|
-
id: "thai-text",
|
|
49
|
-
content: thaiLorem,
|
|
50
|
-
})
|
|
51
|
-
scrollBox.add(text)
|
|
52
|
-
renderer.root.add(scrollBox)
|
|
53
|
-
renderer.keyInput.on("keypress", (event) => {
|
|
54
|
-
if (event.name === "down") scrollBox.scrollDown()
|
|
55
|
-
if (event.name === "up") scrollBox.scrollUp()
|
|
56
|
-
})
|
|
57
|
-
renderer.requestRender()
|
|
58
|
-
|
|
59
|
-
renderer.keyInput.on("keypress", (event) => {
|
|
60
|
-
if (event.name === "`") {
|
|
61
|
-
renderer.console.toggle()
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
}
|
|
65
|
-
main().catch((err) => {
|
|
66
|
-
console.error("Error:", err)
|
|
67
|
-
process.exit(1)
|
|
68
|
-
})
|
package/docs/development.md
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
# Development Guide
|
|
2
|
-
|
|
3
|
-
## Prerequisites
|
|
4
|
-
|
|
5
|
-
- [Bun](https://bun.sh) - JavaScript runtime and package manager
|
|
6
|
-
- [Zig](https://ziglang.org/learn/getting-started/) - Required for building native modules
|
|
7
|
-
|
|
8
|
-
## Setup
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
git clone https://github.com/anomalyco/opentui.git
|
|
12
|
-
cd opentui
|
|
13
|
-
bun install
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Building
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
bun run build
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
**Note:** Only needed when changing native Zig code. TypeScript changes don't require rebuilding.
|
|
23
|
-
|
|
24
|
-
## Running Examples
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
cd packages/core
|
|
28
|
-
bun run src/examples/index.ts
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Testing
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# Build native dependencies first
|
|
35
|
-
bun run build
|
|
36
|
-
|
|
37
|
-
# TypeScript tests
|
|
38
|
-
cd packages/core
|
|
39
|
-
bun test
|
|
40
|
-
|
|
41
|
-
# Native tests
|
|
42
|
-
bun run test:native
|
|
43
|
-
|
|
44
|
-
# Filter native tests
|
|
45
|
-
bun run test:native -Dtest-filter="test name"
|
|
46
|
-
|
|
47
|
-
# Benchmarks
|
|
48
|
-
bun run bench:native
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Local Development Linking
|
|
52
|
-
|
|
53
|
-
Link your local OpenTUI to another project:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
./scripts/link-opentui-dev.sh /path/to/your/project
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**Options:**
|
|
60
|
-
|
|
61
|
-
- `--react` - Also link `@fairyhunter13/opentui-react` and React dependencies
|
|
62
|
-
- `--solid` - Also link `@fairyhunter13/opentui-solid` and SolidJS dependencies
|
|
63
|
-
- `--dist` - Link built `dist` directories instead of source
|
|
64
|
-
- `--copy` - Copy instead of symlink (requires `--dist`)
|
|
65
|
-
- `--subdeps` - Find and link packages that depend on opentui (e.g., `opentui-spinner`)
|
|
66
|
-
|
|
67
|
-
**Examples:**
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
# Link core only
|
|
71
|
-
./scripts/link-opentui-dev.sh /path/to/your/project
|
|
72
|
-
|
|
73
|
-
# Link core and solid with subdependency discovery
|
|
74
|
-
./scripts/link-opentui-dev.sh /path/to/your/project --solid --subdeps
|
|
75
|
-
|
|
76
|
-
# Link built artifacts
|
|
77
|
-
./scripts/link-opentui-dev.sh /path/to/your/project --react --dist
|
|
78
|
-
|
|
79
|
-
# Copy for Docker/Windows
|
|
80
|
-
./scripts/link-opentui-dev.sh /path/to/your/project --dist --copy
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
The script automatically links:
|
|
84
|
-
|
|
85
|
-
- Main packages: `@fairyhunter13/opentui-core`, `@fairyhunter13/opentui-solid`, `@fairyhunter13/opentui-react`
|
|
86
|
-
- Peer dependencies: `yoga-layout`, `solid-js`, `react`, `react-dom`, `react-reconciler`
|
|
87
|
-
- Subdependencies (with `--subdeps`): Packages like `opentui-spinner` that depend on opentui
|
|
88
|
-
|
|
89
|
-
**Requirements:** Target project must have `node_modules` (run `bun install` first).
|
|
90
|
-
|
|
91
|
-
## Debugging
|
|
92
|
-
|
|
93
|
-
OpenTUI captures `console.log` output. Toggle the built-in console with backtick or use [Environment Variables](./env-vars.md) for debugging.
|
|
94
|
-
|
|
95
|
-
## Terminal Compatibility
|
|
96
|
-
|
|
97
|
-
### OSC 66 Artifacts on Older Terminals
|
|
98
|
-
|
|
99
|
-
**Problem:** If you see weird artifacts containing "66" in your terminal when running OpenTUI applications, your terminal emulator doesn't support OSC 66 escape sequences (used for explicit character width detection).
|
|
100
|
-
|
|
101
|
-
**Affected Terminals:**
|
|
102
|
-
|
|
103
|
-
- GNOME Terminal
|
|
104
|
-
- Konsole (older versions)
|
|
105
|
-
- xterm (older versions)
|
|
106
|
-
- Many VT100/VT220 emulators
|
|
107
|
-
|
|
108
|
-
**Solution:** Disable OSC 66 queries by setting an environment variable:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
export OPENTUI_FORCE_EXPLICIT_WIDTH=false
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Or run your application with:
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
OPENTUI_FORCE_EXPLICIT_WIDTH=false your-app
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
**For Application Developers:**
|
|
121
|
-
|
|
122
|
-
Set it in your code before creating the renderer:
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
process.env.OPENTUI_FORCE_EXPLICIT_WIDTH = "false"
|
|
126
|
-
|
|
127
|
-
const renderer = new CliRenderer()
|
|
128
|
-
// ... rest of your app
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Or add to your `.env` file:
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
OPENTUI_FORCE_EXPLICIT_WIDTH=false
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
**What This Does:**
|
|
138
|
-
|
|
139
|
-
- Prevents OSC 66 detection queries from being sent
|
|
140
|
-
- Disables the explicit width feature
|
|
141
|
-
- Falls back to standard width calculation
|
|
142
|
-
- No visual artifacts on unsupported terminals
|
|
143
|
-
|
|
144
|
-
**Modern Terminals:** If your terminal supports OSC 66 (Kitty, Ghostty, WezTerm, Alacritty, iTerm2), you don't need this setting - they work correctly by default.
|
package/scripts/build.ts
DELETED
|
@@ -1,400 +0,0 @@
|
|
|
1
|
-
import { spawnSync, type SpawnSyncReturns } from "node:child_process"
|
|
2
|
-
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "fs"
|
|
3
|
-
import { dirname, join, resolve } from "path"
|
|
4
|
-
import { fileURLToPath } from "url"
|
|
5
|
-
import process from "process"
|
|
6
|
-
import path from "path"
|
|
7
|
-
|
|
8
|
-
interface Variant {
|
|
9
|
-
platform: string
|
|
10
|
-
arch: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface PackageJson {
|
|
14
|
-
name: string
|
|
15
|
-
version: string
|
|
16
|
-
license?: string
|
|
17
|
-
repository?: any
|
|
18
|
-
description?: string
|
|
19
|
-
homepage?: string
|
|
20
|
-
author?: string
|
|
21
|
-
bugs?: any
|
|
22
|
-
keywords?: string[]
|
|
23
|
-
module?: string
|
|
24
|
-
main?: string
|
|
25
|
-
types?: string
|
|
26
|
-
type?: string
|
|
27
|
-
dependencies?: Record<string, string>
|
|
28
|
-
devDependencies?: Record<string, string>
|
|
29
|
-
optionalDependencies?: Record<string, string>
|
|
30
|
-
peerDependencies?: Record<string, string>
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
34
|
-
const __dirname = dirname(__filename)
|
|
35
|
-
const rootDir = resolve(__dirname, "..")
|
|
36
|
-
const licensePath = path.resolve(__dirname, "../../../LICENSE")
|
|
37
|
-
const packageJson: PackageJson = JSON.parse(readFileSync(join(rootDir, "package.json"), "utf8"))
|
|
38
|
-
|
|
39
|
-
const args = process.argv.slice(2)
|
|
40
|
-
const buildLib = args.find((arg) => arg === "--lib")
|
|
41
|
-
const buildNative = args.find((arg) => arg === "--native")
|
|
42
|
-
const isDev = args.includes("--dev")
|
|
43
|
-
const buildAll = args.includes("--all") // Build for all platforms
|
|
44
|
-
const gpaSafeStats = args.includes("--gpa-safe-stats")
|
|
45
|
-
|
|
46
|
-
const variants: Variant[] = [
|
|
47
|
-
{ platform: "darwin", arch: "x64" },
|
|
48
|
-
{ platform: "darwin", arch: "arm64" },
|
|
49
|
-
{ platform: "linux", arch: "x64" },
|
|
50
|
-
{ platform: "linux", arch: "arm64" },
|
|
51
|
-
{ platform: "win32", arch: "x64" },
|
|
52
|
-
{ platform: "win32", arch: "arm64" },
|
|
53
|
-
]
|
|
54
|
-
|
|
55
|
-
if (!buildLib && !buildNative) {
|
|
56
|
-
console.error("Error: Please specify --lib, --native, or both")
|
|
57
|
-
process.exit(1)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const getZigTarget = (platform: string, arch: string): string => {
|
|
61
|
-
const platformMap: Record<string, string> = { darwin: "macos", win32: "windows", linux: "linux" }
|
|
62
|
-
const archMap: Record<string, string> = { x64: "x86_64", arm64: "aarch64" }
|
|
63
|
-
return `${archMap[arch] ?? arch}-${platformMap[platform] ?? platform}`
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const replaceLinks = (text: string): string => {
|
|
67
|
-
return packageJson.homepage
|
|
68
|
-
? text.replace(
|
|
69
|
-
/(\[.*?\]\()(\.\/.*?\))/g,
|
|
70
|
-
(_, p1: string, p2: string) => `${p1}${packageJson.homepage}/blob/HEAD/${p2.replace("./", "")}`,
|
|
71
|
-
)
|
|
72
|
-
: text
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const requiredFields: (keyof PackageJson)[] = ["name", "version", "license", "repository", "description"]
|
|
76
|
-
const missingRequired = requiredFields.filter((field) => !packageJson[field])
|
|
77
|
-
if (missingRequired.length > 0) {
|
|
78
|
-
console.error(`Error: Missing required fields in package.json: ${missingRequired.join(", ")}`)
|
|
79
|
-
process.exit(1)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (buildNative) {
|
|
83
|
-
console.log(`Building native ${isDev ? "dev" : "prod"} binaries${buildAll ? " for all platforms" : ""}...`)
|
|
84
|
-
|
|
85
|
-
const zigArgs = ["build", `-Doptimize=${isDev ? "Debug" : "ReleaseFast"}`]
|
|
86
|
-
if (buildAll) {
|
|
87
|
-
zigArgs.push("-Dall")
|
|
88
|
-
}
|
|
89
|
-
if (gpaSafeStats) {
|
|
90
|
-
zigArgs.push("-Dgpa-safe-stats=true")
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const zigBuild: SpawnSyncReturns<Buffer> = spawnSync("zig", zigArgs, {
|
|
94
|
-
cwd: join(rootDir, "src", "zig"),
|
|
95
|
-
stdio: "inherit",
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
if (zigBuild.error) {
|
|
99
|
-
console.error("Error: Zig is not installed or not in PATH")
|
|
100
|
-
process.exit(1)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (zigBuild.status !== 0) {
|
|
104
|
-
console.error("Error: Zig build failed")
|
|
105
|
-
process.exit(1)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
for (const { platform, arch } of variants) {
|
|
109
|
-
const nativeName = `${packageJson.name}-${platform}-${arch}`
|
|
110
|
-
const nativeDir = join(rootDir, "node_modules", nativeName)
|
|
111
|
-
const libDir = join(rootDir, "src", "zig", "lib", getZigTarget(platform, arch))
|
|
112
|
-
|
|
113
|
-
rmSync(nativeDir, { recursive: true, force: true })
|
|
114
|
-
mkdirSync(nativeDir, { recursive: true })
|
|
115
|
-
|
|
116
|
-
let copiedFiles = 0
|
|
117
|
-
let libraryFileName: string | null = null
|
|
118
|
-
for (const name of ["libopentui", "opentui"]) {
|
|
119
|
-
for (const ext of [".so", ".dll", ".dylib"]) {
|
|
120
|
-
const src = join(libDir, `${name}${ext}`)
|
|
121
|
-
if (existsSync(src)) {
|
|
122
|
-
const fileName = `${name}${ext}`
|
|
123
|
-
copyFileSync(src, join(nativeDir, fileName))
|
|
124
|
-
copiedFiles++
|
|
125
|
-
if (!libraryFileName) {
|
|
126
|
-
libraryFileName = fileName
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (copiedFiles === 0) {
|
|
133
|
-
// Skip platforms that weren't built
|
|
134
|
-
console.log(`Skipping ${platform}-${arch}: no libraries found`)
|
|
135
|
-
rmSync(nativeDir, { recursive: true, force: true })
|
|
136
|
-
continue
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const indexTsContent = `const module = await import("./${libraryFileName}", { with: { type: "file" } })
|
|
140
|
-
const path = module.default
|
|
141
|
-
export default path;
|
|
142
|
-
`
|
|
143
|
-
writeFileSync(join(nativeDir, "index.ts"), indexTsContent)
|
|
144
|
-
|
|
145
|
-
writeFileSync(
|
|
146
|
-
join(nativeDir, "package.json"),
|
|
147
|
-
JSON.stringify(
|
|
148
|
-
{
|
|
149
|
-
name: nativeName,
|
|
150
|
-
version: packageJson.version,
|
|
151
|
-
description: `Prebuilt ${platform}-${arch} binaries for ${packageJson.name}`,
|
|
152
|
-
main: "index.ts",
|
|
153
|
-
types: "index.ts",
|
|
154
|
-
license: packageJson.license,
|
|
155
|
-
author: packageJson.author,
|
|
156
|
-
homepage: packageJson.homepage,
|
|
157
|
-
repository: packageJson.repository,
|
|
158
|
-
bugs: packageJson.bugs,
|
|
159
|
-
keywords: [...(packageJson.keywords ?? []), "prebuild", "prebuilt"],
|
|
160
|
-
os: [platform],
|
|
161
|
-
cpu: [arch],
|
|
162
|
-
},
|
|
163
|
-
null,
|
|
164
|
-
2,
|
|
165
|
-
),
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
writeFileSync(
|
|
169
|
-
join(nativeDir, "README.md"),
|
|
170
|
-
replaceLinks(`## ${nativeName}\n\n> Prebuilt ${platform}-${arch} binaries for \`${packageJson.name}\`.`),
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
if (existsSync(licensePath)) copyFileSync(licensePath, join(nativeDir, "LICENSE"))
|
|
174
|
-
console.log("Built:", nativeName)
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if (buildLib) {
|
|
179
|
-
console.log("Building library...")
|
|
180
|
-
|
|
181
|
-
const distDir = join(rootDir, "dist")
|
|
182
|
-
rmSync(distDir, { recursive: true, force: true })
|
|
183
|
-
mkdirSync(distDir, { recursive: true })
|
|
184
|
-
|
|
185
|
-
const externalDeps: string[] = [
|
|
186
|
-
...Object.keys(packageJson.optionalDependencies || {}),
|
|
187
|
-
...Object.keys(packageJson.peerDependencies || {}),
|
|
188
|
-
]
|
|
189
|
-
|
|
190
|
-
// Build main entry point
|
|
191
|
-
if (!packageJson.module) {
|
|
192
|
-
console.error("Error: 'module' field not found in package.json")
|
|
193
|
-
process.exit(1)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const entryPoints: string[] = [
|
|
197
|
-
packageJson.module,
|
|
198
|
-
"src/3d.ts",
|
|
199
|
-
"src/testing.ts",
|
|
200
|
-
"src/runtime-plugin.ts",
|
|
201
|
-
"src/runtime-plugin-support.ts",
|
|
202
|
-
]
|
|
203
|
-
|
|
204
|
-
// Build main entry points with code splitting
|
|
205
|
-
// External patterns to prevent bundling tree-sitter assets and default-parsers
|
|
206
|
-
// to allow standalone executables to work
|
|
207
|
-
const externalPatterns = [
|
|
208
|
-
...externalDeps,
|
|
209
|
-
"*.wasm",
|
|
210
|
-
"*.scm",
|
|
211
|
-
"./lib/tree-sitter/assets/*",
|
|
212
|
-
"./lib/tree-sitter/default-parsers",
|
|
213
|
-
"./lib/tree-sitter/default-parsers.ts",
|
|
214
|
-
]
|
|
215
|
-
|
|
216
|
-
spawnSync(
|
|
217
|
-
"bun",
|
|
218
|
-
[
|
|
219
|
-
"build",
|
|
220
|
-
"--target=bun",
|
|
221
|
-
"--splitting",
|
|
222
|
-
"--outdir=dist",
|
|
223
|
-
"--sourcemap",
|
|
224
|
-
...externalPatterns.flatMap((dep) => ["--external", dep]),
|
|
225
|
-
...entryPoints,
|
|
226
|
-
],
|
|
227
|
-
{
|
|
228
|
-
cwd: rootDir,
|
|
229
|
-
stdio: "inherit",
|
|
230
|
-
},
|
|
231
|
-
)
|
|
232
|
-
|
|
233
|
-
// Build parser worker as standalone bundle (no splitting) so it can be loaded as a Worker
|
|
234
|
-
// Make web-tree-sitter external so it loads from node_modules with its WASM file
|
|
235
|
-
spawnSync(
|
|
236
|
-
"bun",
|
|
237
|
-
[
|
|
238
|
-
"build",
|
|
239
|
-
"--target=bun",
|
|
240
|
-
"--outdir=dist",
|
|
241
|
-
"--sourcemap",
|
|
242
|
-
...externalDeps.flatMap((dep) => ["--external", dep]),
|
|
243
|
-
"--external",
|
|
244
|
-
"web-tree-sitter",
|
|
245
|
-
"src/lib/tree-sitter/parser.worker.ts",
|
|
246
|
-
],
|
|
247
|
-
{
|
|
248
|
-
cwd: rootDir,
|
|
249
|
-
stdio: "inherit",
|
|
250
|
-
},
|
|
251
|
-
)
|
|
252
|
-
|
|
253
|
-
// Post-process to fix Bun's duplicate export issue
|
|
254
|
-
// See: https://github.com/oven-sh/bun/issues/5344
|
|
255
|
-
// and: https://github.com/oven-sh/bun/issues/10631
|
|
256
|
-
console.log("Post-processing bundled files to fix duplicate exports...")
|
|
257
|
-
const bundledFiles = [
|
|
258
|
-
"dist/index.js",
|
|
259
|
-
"dist/3d.js",
|
|
260
|
-
"dist/testing.js",
|
|
261
|
-
"dist/runtime-plugin.js",
|
|
262
|
-
"dist/runtime-plugin-support.js",
|
|
263
|
-
"dist/lib/tree-sitter/parser.worker.js",
|
|
264
|
-
]
|
|
265
|
-
for (const filePath of bundledFiles) {
|
|
266
|
-
const fullPath = join(rootDir, filePath)
|
|
267
|
-
if (existsSync(fullPath)) {
|
|
268
|
-
let content = readFileSync(fullPath, "utf8")
|
|
269
|
-
const helperExportPattern = /^export\s*\{([^}]*(?:__toESM|__commonJS|__export|__require)[^}]*)\};\s*$/gm
|
|
270
|
-
|
|
271
|
-
let modified = false
|
|
272
|
-
content = content.replace(helperExportPattern, (match, exports) => {
|
|
273
|
-
const exportsList = exports.split(",").map((e: string) => e.trim())
|
|
274
|
-
const helpers = ["__toESM", "__commonJS", "__export", "__require"]
|
|
275
|
-
const nonHelpers = exportsList.filter((e: string) => !helpers.includes(e))
|
|
276
|
-
|
|
277
|
-
if (nonHelpers.length > 0) {
|
|
278
|
-
modified = true
|
|
279
|
-
const helperExports = exportsList.filter((e: string) => helpers.includes(e))
|
|
280
|
-
return `export { ${helperExports.join(", ")} };`
|
|
281
|
-
}
|
|
282
|
-
return match
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
if (modified) {
|
|
286
|
-
writeFileSync(fullPath, content)
|
|
287
|
-
console.log(` Fixed duplicate exports in ${filePath}`)
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
console.log("Generating TypeScript declarations...")
|
|
293
|
-
|
|
294
|
-
const tsconfigBuildPath = join(rootDir, "tsconfig.build.json")
|
|
295
|
-
|
|
296
|
-
const tscResult: SpawnSyncReturns<Buffer> = spawnSync("bunx", ["tsc", "-p", tsconfigBuildPath], {
|
|
297
|
-
cwd: rootDir,
|
|
298
|
-
stdio: "inherit",
|
|
299
|
-
})
|
|
300
|
-
|
|
301
|
-
if (tscResult.status !== 0) {
|
|
302
|
-
console.error("Error: TypeScript declaration generation failed")
|
|
303
|
-
process.exit(1)
|
|
304
|
-
} else {
|
|
305
|
-
console.log("TypeScript declarations generated")
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
const treeSitterSrcDir = join(rootDir, "src", "lib", "tree-sitter")
|
|
309
|
-
|
|
310
|
-
const copyAssets = (src: string, dest: string) => {
|
|
311
|
-
mkdirSync(dest, { recursive: true })
|
|
312
|
-
const entries = readdirSync(src, { withFileTypes: true })
|
|
313
|
-
for (const entry of entries) {
|
|
314
|
-
const srcPath = join(src, entry.name)
|
|
315
|
-
const destPath = join(dest, entry.name)
|
|
316
|
-
if (entry.isDirectory()) {
|
|
317
|
-
copyAssets(srcPath, destPath)
|
|
318
|
-
} else if (entry.isFile() && (entry.name.endsWith(".wasm") || entry.name.endsWith(".scm"))) {
|
|
319
|
-
copyFileSync(srcPath, destPath)
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
copyAssets(join(treeSitterSrcDir, "assets"), join(distDir, "assets"))
|
|
325
|
-
console.log(" Copied tree-sitter assets (*.wasm, *.scm) to dist/assets/")
|
|
326
|
-
|
|
327
|
-
// Configure exports for multiple entry points
|
|
328
|
-
const exports = {
|
|
329
|
-
".": {
|
|
330
|
-
import: "./index.js",
|
|
331
|
-
require: "./index.js",
|
|
332
|
-
types: "./index.d.ts",
|
|
333
|
-
},
|
|
334
|
-
"./3d": {
|
|
335
|
-
import: "./3d.js",
|
|
336
|
-
require: "./3d.js",
|
|
337
|
-
types: "./3d.d.ts",
|
|
338
|
-
},
|
|
339
|
-
"./testing": {
|
|
340
|
-
import: "./testing.js",
|
|
341
|
-
require: "./testing.js",
|
|
342
|
-
types: "./testing.d.ts",
|
|
343
|
-
},
|
|
344
|
-
"./runtime-plugin": {
|
|
345
|
-
import: "./runtime-plugin.js",
|
|
346
|
-
require: "./runtime-plugin.js",
|
|
347
|
-
types: "./runtime-plugin.d.ts",
|
|
348
|
-
},
|
|
349
|
-
"./runtime-plugin-support": {
|
|
350
|
-
import: "./runtime-plugin-support.js",
|
|
351
|
-
require: "./runtime-plugin-support.js",
|
|
352
|
-
types: "./runtime-plugin-support.d.ts",
|
|
353
|
-
},
|
|
354
|
-
"./parser.worker": {
|
|
355
|
-
import: "./lib/tree-sitter/parser.worker.js",
|
|
356
|
-
require: "./lib/tree-sitter/parser.worker.js",
|
|
357
|
-
types: "./lib/tree-sitter/parser.worker.d.ts",
|
|
358
|
-
},
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
const optionalDeps: Record<string, string> = Object.fromEntries(
|
|
362
|
-
variants.map(({ platform, arch }) => [`${packageJson.name}-${platform}-${arch}`, packageJson.version]),
|
|
363
|
-
)
|
|
364
|
-
|
|
365
|
-
writeFileSync(
|
|
366
|
-
join(distDir, "package.json"),
|
|
367
|
-
JSON.stringify(
|
|
368
|
-
{
|
|
369
|
-
name: packageJson.name,
|
|
370
|
-
module: "index.js",
|
|
371
|
-
main: "index.js",
|
|
372
|
-
types: "index.d.ts",
|
|
373
|
-
type: packageJson.type,
|
|
374
|
-
version: packageJson.version,
|
|
375
|
-
description: packageJson.description,
|
|
376
|
-
keywords: packageJson.keywords,
|
|
377
|
-
license: packageJson.license,
|
|
378
|
-
author: packageJson.author,
|
|
379
|
-
homepage: packageJson.homepage,
|
|
380
|
-
repository: packageJson.repository,
|
|
381
|
-
bugs: packageJson.bugs,
|
|
382
|
-
exports,
|
|
383
|
-
dependencies: packageJson.dependencies,
|
|
384
|
-
devDependencies: packageJson.devDependencies,
|
|
385
|
-
peerDependencies: packageJson.peerDependencies,
|
|
386
|
-
optionalDependencies: {
|
|
387
|
-
...packageJson.optionalDependencies,
|
|
388
|
-
...optionalDeps,
|
|
389
|
-
},
|
|
390
|
-
},
|
|
391
|
-
null,
|
|
392
|
-
2,
|
|
393
|
-
),
|
|
394
|
-
)
|
|
395
|
-
|
|
396
|
-
writeFileSync(join(distDir, "README.md"), replaceLinks(readFileSync(join(rootDir, "README.md"), "utf8")))
|
|
397
|
-
if (existsSync(licensePath)) copyFileSync(licensePath, join(distDir, "LICENSE"))
|
|
398
|
-
|
|
399
|
-
console.log("Library built at:", distDir)
|
|
400
|
-
}
|
package/scripts/publish.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { spawnSync, type SpawnSyncReturns } from "node:child_process"
|
|
2
|
-
import { existsSync, readFileSync } from "node:fs"
|
|
3
|
-
import { dirname, join, resolve } from "node:path"
|
|
4
|
-
import process from "node:process"
|
|
5
|
-
import { fileURLToPath } from "node:url"
|
|
6
|
-
|
|
7
|
-
interface PackageJson {
|
|
8
|
-
name: string
|
|
9
|
-
version: string
|
|
10
|
-
optionalDependencies?: Record<string, string>
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
14
|
-
const __dirname = dirname(__filename)
|
|
15
|
-
const rootDir = resolve(__dirname, "..")
|
|
16
|
-
|
|
17
|
-
const packageJson: PackageJson = JSON.parse(readFileSync(join(rootDir, "package.json"), "utf8"))
|
|
18
|
-
|
|
19
|
-
console.log(`Publishing @fairyhunter13/opentui-core@${packageJson.version}...`)
|
|
20
|
-
console.log("Make sure you've run the pre-publish validation script first!")
|
|
21
|
-
|
|
22
|
-
const libDir = join(rootDir, "dist")
|
|
23
|
-
const packageJsons: Record<string, PackageJson> = {
|
|
24
|
-
[libDir]: JSON.parse(readFileSync(join(libDir, "package.json"), "utf8")),
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Load all native package.json files
|
|
28
|
-
for (const pkgName of Object.keys(packageJsons[libDir].optionalDependencies!).filter((x) =>
|
|
29
|
-
x.startsWith(packageJson.name),
|
|
30
|
-
)) {
|
|
31
|
-
const nativeDir = join(rootDir, "node_modules", pkgName)
|
|
32
|
-
packageJsons[nativeDir] = JSON.parse(readFileSync(join(nativeDir, "package.json"), "utf8"))
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Publish all packages (main + native packages)
|
|
36
|
-
Object.entries(packageJsons).forEach(([dir, { name, version }]) => {
|
|
37
|
-
console.log(`\nPublishing ${name}@${version}...`)
|
|
38
|
-
|
|
39
|
-
const isSnapshot = version.includes("-snapshot") || /^0\.0\.0-\d{8}-[a-f0-9]{8}$/.test(version)
|
|
40
|
-
const publishArgs = ["publish", "--access=public"]
|
|
41
|
-
|
|
42
|
-
if (isSnapshot) {
|
|
43
|
-
publishArgs.push("--tag", "snapshot")
|
|
44
|
-
console.log(` Publishing as snapshot (--tag snapshot)`)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const publish: SpawnSyncReturns<Buffer> = spawnSync("npm", publishArgs, {
|
|
48
|
-
cwd: dir,
|
|
49
|
-
stdio: "inherit",
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
if (publish.status !== 0) {
|
|
53
|
-
console.error(`Failed to publish '${name}@${version}'.`)
|
|
54
|
-
process.exit(1)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
console.log(`Successfully published '${name}@${version}'`)
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
console.log(`\nAll @fairyhunter13/opentui-core packages published successfully!`)
|