@involvex/fresh-editor 0.1.76 → 0.1.78

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.
Files changed (90) hide show
  1. package/bin/CHANGELOG.md +1017 -0
  2. package/bin/LICENSE +117 -0
  3. package/bin/README.md +248 -0
  4. package/bin/fresh.exe +0 -0
  5. package/bin/plugins/README.md +71 -0
  6. package/bin/plugins/audit_mode.i18n.json +821 -0
  7. package/bin/plugins/audit_mode.ts +1810 -0
  8. package/bin/plugins/buffer_modified.i18n.json +67 -0
  9. package/bin/plugins/buffer_modified.ts +281 -0
  10. package/bin/plugins/calculator.i18n.json +93 -0
  11. package/bin/plugins/calculator.ts +770 -0
  12. package/bin/plugins/clangd-lsp.ts +168 -0
  13. package/bin/plugins/clangd_support.i18n.json +223 -0
  14. package/bin/plugins/clangd_support.md +20 -0
  15. package/bin/plugins/clangd_support.ts +325 -0
  16. package/bin/plugins/color_highlighter.i18n.json +145 -0
  17. package/bin/plugins/color_highlighter.ts +304 -0
  18. package/bin/plugins/config-schema.json +768 -0
  19. package/bin/plugins/csharp-lsp.ts +147 -0
  20. package/bin/plugins/csharp_support.i18n.json +80 -0
  21. package/bin/plugins/csharp_support.ts +170 -0
  22. package/bin/plugins/css-lsp.ts +143 -0
  23. package/bin/plugins/diagnostics_panel.i18n.json +236 -0
  24. package/bin/plugins/diagnostics_panel.ts +642 -0
  25. package/bin/plugins/examples/README.md +85 -0
  26. package/bin/plugins/examples/async_demo.ts +165 -0
  27. package/bin/plugins/examples/bookmarks.ts +329 -0
  28. package/bin/plugins/examples/buffer_query_demo.ts +110 -0
  29. package/bin/plugins/examples/git_grep.ts +262 -0
  30. package/bin/plugins/examples/hello_world.ts +93 -0
  31. package/bin/plugins/examples/virtual_buffer_demo.ts +116 -0
  32. package/bin/plugins/find_references.i18n.json +275 -0
  33. package/bin/plugins/find_references.ts +359 -0
  34. package/bin/plugins/git_blame.i18n.json +496 -0
  35. package/bin/plugins/git_blame.ts +707 -0
  36. package/bin/plugins/git_find_file.i18n.json +314 -0
  37. package/bin/plugins/git_find_file.ts +300 -0
  38. package/bin/plugins/git_grep.i18n.json +171 -0
  39. package/bin/plugins/git_grep.ts +191 -0
  40. package/bin/plugins/git_gutter.i18n.json +93 -0
  41. package/bin/plugins/git_gutter.ts +477 -0
  42. package/bin/plugins/git_log.i18n.json +481 -0
  43. package/bin/plugins/git_log.ts +1285 -0
  44. package/bin/plugins/go-lsp.ts +143 -0
  45. package/bin/plugins/html-lsp.ts +145 -0
  46. package/bin/plugins/json-lsp.ts +145 -0
  47. package/bin/plugins/lib/fresh.d.ts +1321 -0
  48. package/bin/plugins/lib/index.ts +24 -0
  49. package/bin/plugins/lib/navigation-controller.ts +214 -0
  50. package/bin/plugins/lib/panel-manager.ts +220 -0
  51. package/bin/plugins/lib/types.ts +72 -0
  52. package/bin/plugins/lib/virtual-buffer-factory.ts +130 -0
  53. package/bin/plugins/live_grep.i18n.json +171 -0
  54. package/bin/plugins/live_grep.ts +422 -0
  55. package/bin/plugins/markdown_compose.i18n.json +223 -0
  56. package/bin/plugins/markdown_compose.ts +630 -0
  57. package/bin/plugins/merge_conflict.i18n.json +821 -0
  58. package/bin/plugins/merge_conflict.ts +1810 -0
  59. package/bin/plugins/path_complete.i18n.json +80 -0
  60. package/bin/plugins/path_complete.ts +165 -0
  61. package/bin/plugins/python-lsp.ts +162 -0
  62. package/bin/plugins/rust-lsp.ts +166 -0
  63. package/bin/plugins/search_replace.i18n.json +405 -0
  64. package/bin/plugins/search_replace.ts +484 -0
  65. package/bin/plugins/test_i18n.i18n.json +67 -0
  66. package/bin/plugins/test_i18n.ts +18 -0
  67. package/bin/plugins/theme_editor.i18n.json +3746 -0
  68. package/bin/plugins/theme_editor.ts +2063 -0
  69. package/bin/plugins/todo_highlighter.i18n.json +184 -0
  70. package/bin/plugins/todo_highlighter.ts +206 -0
  71. package/bin/plugins/typescript-lsp.ts +167 -0
  72. package/bin/plugins/vi_mode.i18n.json +1549 -0
  73. package/bin/plugins/vi_mode.ts +2747 -0
  74. package/bin/plugins/welcome.i18n.json +236 -0
  75. package/bin/plugins/welcome.ts +76 -0
  76. package/bin/themes/dark.json +102 -0
  77. package/bin/themes/dracula.json +62 -0
  78. package/bin/themes/high-contrast.json +102 -0
  79. package/bin/themes/light.json +102 -0
  80. package/bin/themes/nord.json +62 -0
  81. package/bin/themes/nostalgia.json +102 -0
  82. package/bin/themes/solarized-dark.json +62 -0
  83. package/binary-install.js +1 -1
  84. package/dist/bin/fresh.js +9 -0
  85. package/dist/binary-install.js +149 -0
  86. package/dist/binary.js +30 -0
  87. package/dist/fresh-6yhknp07.exe +0 -0
  88. package/dist/install.js +158 -0
  89. package/dist/run-fresh.js +43 -0
  90. package/package.json +7 -2
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "light",
3
+ "editor": {
4
+ "bg": [255, 255, 255],
5
+ "fg": [0, 0, 0],
6
+ "cursor": [0, 0, 0],
7
+ "inactive_cursor": [180, 180, 180],
8
+ "selection_bg": [173, 214, 255],
9
+ "current_line_bg": [245, 245, 245],
10
+ "line_number_fg": [140, 140, 140],
11
+ "line_number_bg": [255, 255, 255],
12
+ "diff_add_bg": [200, 255, 200],
13
+ "diff_remove_bg": [255, 200, 200],
14
+ "diff_modify_bg": [255, 252, 240]
15
+ },
16
+ "ui": {
17
+ "tab_active_fg": [40, 40, 40],
18
+ "tab_active_bg": [255, 255, 255],
19
+ "tab_inactive_fg": [100, 100, 100],
20
+ "tab_inactive_bg": [230, 230, 230],
21
+ "tab_separator_bg": [200, 200, 200],
22
+ "tab_close_hover_fg": [220, 50, 50],
23
+ "tab_hover_bg": [210, 210, 210],
24
+ "menu_bg": [245, 245, 245],
25
+ "menu_fg": [30, 30, 30],
26
+ "menu_active_bg": [225, 225, 225],
27
+ "menu_active_fg": [0, 0, 0],
28
+ "menu_dropdown_bg": [248, 248, 248],
29
+ "menu_dropdown_fg": [30, 30, 30],
30
+ "menu_highlight_bg": [209, 226, 243],
31
+ "menu_highlight_fg": [0, 0, 0],
32
+ "menu_border_fg": [180, 180, 180],
33
+ "menu_separator_fg": [210, 210, 210],
34
+ "menu_hover_bg": [230, 235, 240],
35
+ "menu_hover_fg": [0, 0, 0],
36
+ "menu_disabled_fg": [160, 160, 160],
37
+ "menu_disabled_bg": [248, 248, 248],
38
+ "status_bar_fg": "Black",
39
+ "status_bar_bg": [220, 220, 220],
40
+ "prompt_fg": "Black",
41
+ "prompt_bg": [230, 240, 250],
42
+ "prompt_selection_fg": "Black",
43
+ "prompt_selection_bg": [173, 214, 255],
44
+ "popup_border_fg": [180, 180, 180],
45
+ "popup_bg": [232, 238, 245],
46
+ "popup_selection_bg": [209, 226, 243],
47
+ "popup_text_fg": [30, 30, 30],
48
+ "suggestion_bg": [232, 238, 245],
49
+ "suggestion_selected_bg": [209, 226, 243],
50
+ "help_bg": "White",
51
+ "help_fg": "Black",
52
+ "help_key_fg": "Blue",
53
+ "help_separator_fg": "Gray",
54
+ "help_indicator_fg": "Red",
55
+ "help_indicator_bg": "White",
56
+ "inline_code_bg": [230, 230, 235],
57
+ "split_separator_fg": [140, 140, 140],
58
+ "split_separator_hover_fg": [70, 130, 180],
59
+ "scrollbar_track_fg": [220, 220, 220],
60
+ "scrollbar_thumb_fg": [180, 180, 180],
61
+ "scrollbar_track_hover_fg": [200, 200, 200],
62
+ "scrollbar_thumb_hover_fg": [140, 140, 140],
63
+ "compose_margin_bg": [220, 220, 225],
64
+ "semantic_highlight_bg": [220, 230, 240],
65
+ "terminal_bg": "Default",
66
+ "terminal_fg": "Default",
67
+ "status_warning_indicator_bg": [202, 145, 0],
68
+ "status_warning_indicator_fg": [0, 0, 0],
69
+ "status_error_indicator_bg": [200, 40, 40],
70
+ "status_error_indicator_fg": [255, 255, 255],
71
+ "status_warning_indicator_hover_bg": [232, 175, 30],
72
+ "status_warning_indicator_hover_fg": [0, 0, 0],
73
+ "status_error_indicator_hover_bg": [230, 70, 70],
74
+ "status_error_indicator_hover_fg": [255, 255, 255],
75
+ "tab_drop_zone_bg": [173, 214, 255],
76
+ "tab_drop_zone_border": [70, 130, 180]
77
+ },
78
+ "search": {
79
+ "match_bg": [255, 255, 150],
80
+ "match_fg": [0, 0, 0]
81
+ },
82
+ "diagnostic": {
83
+ "error_fg": "Red",
84
+ "error_bg": [255, 220, 220],
85
+ "warning_fg": [128, 128, 0],
86
+ "warning_bg": [255, 255, 200],
87
+ "info_fg": "Blue",
88
+ "info_bg": [220, 240, 255],
89
+ "hint_fg": "DarkGray",
90
+ "hint_bg": [240, 240, 240]
91
+ },
92
+ "syntax": {
93
+ "keyword": [175, 0, 219],
94
+ "string": [163, 21, 21],
95
+ "comment": [0, 128, 0],
96
+ "function": [121, 94, 38],
97
+ "type": [0, 128, 128],
98
+ "variable": [0, 16, 128],
99
+ "constant": [0, 112, 193],
100
+ "operator": [0, 0, 0]
101
+ }
102
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "nord",
3
+ "editor": {
4
+ "bg": [46, 52, 64],
5
+ "fg": [216, 222, 233],
6
+ "cursor": [136, 192, 208],
7
+ "selection_bg": [67, 76, 94],
8
+ "current_line_bg": [59, 66, 82],
9
+ "line_number_fg": [76, 86, 106],
10
+ "line_number_bg": [46, 52, 64]
11
+ },
12
+ "ui": {
13
+ "tab_active_fg": [236, 239, 244],
14
+ "tab_active_bg": [67, 76, 94],
15
+ "tab_inactive_fg": [216, 222, 233],
16
+ "tab_inactive_bg": [59, 66, 82],
17
+ "tab_separator_bg": [46, 52, 64],
18
+ "status_bar_fg": [46, 52, 64],
19
+ "status_bar_bg": [136, 192, 208],
20
+ "prompt_fg": [46, 52, 64],
21
+ "prompt_bg": [163, 190, 140],
22
+ "prompt_selection_fg": [236, 239, 244],
23
+ "prompt_selection_bg": [94, 129, 172],
24
+ "popup_border_fg": [76, 86, 106],
25
+ "popup_bg": [59, 66, 82],
26
+ "popup_selection_bg": [94, 129, 172],
27
+ "popup_text_fg": [216, 222, 233],
28
+ "suggestion_bg": [59, 66, 82],
29
+ "suggestion_selected_bg": [94, 129, 172],
30
+ "help_bg": [46, 52, 64],
31
+ "help_fg": [216, 222, 233],
32
+ "help_key_fg": [136, 192, 208],
33
+ "help_separator_fg": [76, 86, 106],
34
+ "help_indicator_fg": [191, 97, 106],
35
+ "help_indicator_bg": [46, 52, 64],
36
+ "split_separator_fg": [76, 86, 106]
37
+ },
38
+ "search": {
39
+ "match_bg": [235, 203, 139],
40
+ "match_fg": [46, 52, 64]
41
+ },
42
+ "diagnostic": {
43
+ "error_fg": [191, 97, 106],
44
+ "error_bg": [59, 46, 50],
45
+ "warning_fg": [235, 203, 139],
46
+ "warning_bg": [59, 56, 46],
47
+ "info_fg": [129, 161, 193],
48
+ "info_bg": [46, 52, 64],
49
+ "hint_fg": [76, 86, 106],
50
+ "hint_bg": [46, 52, 64]
51
+ },
52
+ "syntax": {
53
+ "keyword": [129, 161, 193],
54
+ "string": [163, 190, 140],
55
+ "comment": [76, 86, 106],
56
+ "function": [136, 192, 208],
57
+ "type": [143, 188, 187],
58
+ "variable": [216, 222, 233],
59
+ "constant": [180, 142, 173],
60
+ "operator": [129, 161, 193]
61
+ }
62
+ }
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "nostalgia",
3
+ "editor": {
4
+ "bg": [0, 0, 170],
5
+ "fg": [255, 255, 85],
6
+ "cursor": [255, 255, 255],
7
+ "inactive_cursor": [170, 170, 170],
8
+ "selection_bg": [170, 170, 170],
9
+ "current_line_bg": [0, 0, 128],
10
+ "line_number_fg": [85, 255, 255],
11
+ "line_number_bg": [0, 0, 170],
12
+ "diff_add_bg": [0, 100, 0],
13
+ "diff_remove_bg": [170, 0, 0],
14
+ "diff_modify_bg": [20, 20, 140]
15
+ },
16
+ "ui": {
17
+ "tab_active_fg": [0, 0, 0],
18
+ "tab_active_bg": [170, 170, 170],
19
+ "tab_inactive_fg": [255, 255, 85],
20
+ "tab_inactive_bg": [0, 0, 128],
21
+ "tab_separator_bg": [0, 0, 170],
22
+ "tab_close_hover_fg": [255, 85, 85],
23
+ "tab_hover_bg": [0, 0, 200],
24
+ "menu_bg": [170, 170, 170],
25
+ "menu_fg": [0, 0, 0],
26
+ "menu_active_bg": [0, 170, 0],
27
+ "menu_active_fg": [255, 255, 255],
28
+ "menu_dropdown_bg": [170, 170, 170],
29
+ "menu_dropdown_fg": [0, 0, 0],
30
+ "menu_highlight_bg": [0, 170, 0],
31
+ "menu_highlight_fg": [255, 255, 255],
32
+ "menu_border_fg": [0, 0, 0],
33
+ "menu_separator_fg": [85, 85, 85],
34
+ "menu_hover_bg": [0, 170, 0],
35
+ "menu_hover_fg": [255, 255, 255],
36
+ "menu_disabled_fg": [85, 85, 85],
37
+ "menu_disabled_bg": [170, 170, 170],
38
+ "status_bar_fg": [0, 0, 0],
39
+ "status_bar_bg": [0, 170, 170],
40
+ "prompt_fg": [255, 255, 85],
41
+ "prompt_bg": [0, 0, 170],
42
+ "prompt_selection_fg": [0, 0, 0],
43
+ "prompt_selection_bg": [170, 170, 170],
44
+ "popup_border_fg": [255, 255, 255],
45
+ "popup_bg": [0, 0, 170],
46
+ "popup_selection_bg": [0, 170, 0],
47
+ "popup_text_fg": [255, 255, 85],
48
+ "suggestion_bg": [0, 0, 170],
49
+ "suggestion_selected_bg": [0, 170, 0],
50
+ "help_bg": [0, 0, 170],
51
+ "help_fg": [255, 255, 85],
52
+ "help_key_fg": [85, 255, 255],
53
+ "help_separator_fg": [170, 170, 170],
54
+ "help_indicator_fg": [255, 85, 85],
55
+ "help_indicator_bg": [0, 0, 170],
56
+ "inline_code_bg": [0, 0, 85],
57
+ "split_separator_fg": [85, 255, 255],
58
+ "split_separator_hover_fg": [255, 255, 255],
59
+ "scrollbar_track_fg": [0, 0, 128],
60
+ "scrollbar_thumb_fg": [170, 170, 170],
61
+ "scrollbar_track_hover_fg": [0, 0, 128],
62
+ "scrollbar_thumb_hover_fg": [255, 255, 255],
63
+ "compose_margin_bg": [0, 0, 128],
64
+ "semantic_highlight_bg": [0, 85, 170],
65
+ "terminal_bg": [0, 0, 170],
66
+ "terminal_fg": [255, 255, 85],
67
+ "status_warning_indicator_bg": [170, 85, 0],
68
+ "status_warning_indicator_fg": [255, 255, 255],
69
+ "status_error_indicator_bg": [170, 0, 0],
70
+ "status_error_indicator_fg": [255, 255, 255],
71
+ "status_warning_indicator_hover_bg": [200, 115, 30],
72
+ "status_warning_indicator_hover_fg": [255, 255, 255],
73
+ "status_error_indicator_hover_bg": [200, 30, 30],
74
+ "status_error_indicator_hover_fg": [255, 255, 255],
75
+ "tab_drop_zone_bg": [0, 170, 170],
76
+ "tab_drop_zone_border": [255, 255, 255]
77
+ },
78
+ "search": {
79
+ "match_bg": [170, 85, 0],
80
+ "match_fg": [255, 255, 255]
81
+ },
82
+ "diagnostic": {
83
+ "error_fg": [255, 85, 85],
84
+ "error_bg": [128, 0, 0],
85
+ "warning_fg": [255, 255, 85],
86
+ "warning_bg": [128, 128, 0],
87
+ "info_fg": [85, 255, 255],
88
+ "info_bg": [0, 85, 128],
89
+ "hint_fg": [170, 170, 170],
90
+ "hint_bg": [0, 0, 128]
91
+ },
92
+ "syntax": {
93
+ "keyword": [255, 255, 255],
94
+ "string": [0, 255, 255],
95
+ "comment": [128, 128, 128],
96
+ "function": [255, 255, 0],
97
+ "type": [0, 255, 0],
98
+ "variable": [255, 255, 85],
99
+ "constant": [255, 0, 255],
100
+ "operator": [170, 170, 170]
101
+ }
102
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "solarized-dark",
3
+ "editor": {
4
+ "bg": [0, 43, 54],
5
+ "fg": [131, 148, 150],
6
+ "cursor": [38, 139, 210],
7
+ "selection_bg": [7, 54, 66],
8
+ "current_line_bg": [7, 54, 66],
9
+ "line_number_fg": [88, 110, 117],
10
+ "line_number_bg": [0, 43, 54]
11
+ },
12
+ "ui": {
13
+ "tab_active_fg": [253, 246, 227],
14
+ "tab_active_bg": [38, 139, 210],
15
+ "tab_inactive_fg": [131, 148, 150],
16
+ "tab_inactive_bg": [7, 54, 66],
17
+ "tab_separator_bg": [0, 43, 54],
18
+ "status_bar_fg": [0, 43, 54],
19
+ "status_bar_bg": [147, 161, 161],
20
+ "prompt_fg": [0, 43, 54],
21
+ "prompt_bg": [181, 137, 0],
22
+ "prompt_selection_fg": [253, 246, 227],
23
+ "prompt_selection_bg": [38, 139, 210],
24
+ "popup_border_fg": [88, 110, 117],
25
+ "popup_bg": [7, 54, 66],
26
+ "popup_selection_bg": [38, 139, 210],
27
+ "popup_text_fg": [131, 148, 150],
28
+ "suggestion_bg": [7, 54, 66],
29
+ "suggestion_selected_bg": [38, 139, 210],
30
+ "help_bg": [0, 43, 54],
31
+ "help_fg": [131, 148, 150],
32
+ "help_key_fg": [42, 161, 152],
33
+ "help_separator_fg": [88, 110, 117],
34
+ "help_indicator_fg": [220, 50, 47],
35
+ "help_indicator_bg": [0, 43, 54],
36
+ "split_separator_fg": [88, 110, 117]
37
+ },
38
+ "search": {
39
+ "match_bg": [181, 137, 0],
40
+ "match_fg": [253, 246, 227]
41
+ },
42
+ "diagnostic": {
43
+ "error_fg": [220, 50, 47],
44
+ "error_bg": [42, 43, 54],
45
+ "warning_fg": [181, 137, 0],
46
+ "warning_bg": [30, 54, 54],
47
+ "info_fg": [38, 139, 210],
48
+ "info_bg": [0, 50, 66],
49
+ "hint_fg": [88, 110, 117],
50
+ "hint_bg": [0, 43, 54]
51
+ },
52
+ "syntax": {
53
+ "keyword": [133, 153, 0],
54
+ "string": [42, 161, 152],
55
+ "comment": [88, 110, 117],
56
+ "function": [38, 139, 210],
57
+ "type": [181, 137, 0],
58
+ "variable": [131, 148, 150],
59
+ "constant": [203, 75, 22],
60
+ "operator": [131, 148, 150]
61
+ }
62
+ }
package/binary-install.js CHANGED
@@ -38,7 +38,7 @@ function download(url, dest) {
38
38
  async function install() {
39
39
  const info = getBinaryInfo();
40
40
  const archiveName = `fresh-editor-${info.target}.${info.ext}`;
41
- const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${archiveName}`;
41
+ const url = `https://github.com/${REPO}/releases/download/latest/${archiveName}`;
42
42
  const archivePath = path.join(__dirname, archiveName);
43
43
  const binDir = path.join(__dirname, 'bin');
44
44
  const binaryPath = path.join(binDir, info.binaryName);
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3
+ var __require = import.meta.require;
4
+
5
+ // bin/fresh.exe
6
+ var fresh_default = "../fresh-6yhknp07.exe";
7
+ export {
8
+ fresh_default as default
9
+ };
@@ -0,0 +1,149 @@
1
+ // @bun
2
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3
+ var __require = import.meta.require;
4
+
5
+ // binary.js
6
+ var require_binary = __commonJS((exports, module) => {
7
+ var os = __require("os");
8
+ function getBinaryInfo() {
9
+ const platform = os.platform();
10
+ const arch = os.arch();
11
+ const targets = {
12
+ "darwin-x64": { target: "x86_64-apple-darwin", ext: "tar.xz" },
13
+ "darwin-arm64": { target: "aarch64-apple-darwin", ext: "tar.xz" },
14
+ "linux-x64": { target: "x86_64-unknown-linux-gnu", ext: "tar.xz" },
15
+ "linux-arm64": { target: "aarch64-unknown-linux-gnu", ext: "tar.xz" },
16
+ "win32-x64": { target: "x86_64-pc-windows-msvc", ext: "zip" }
17
+ };
18
+ const key = `${platform}-${arch}`;
19
+ const info = targets[key];
20
+ if (!info) {
21
+ throw new Error(`Unsupported platform: ${platform}-${arch}`);
22
+ }
23
+ return {
24
+ ...info,
25
+ binaryName: platform === "win32" ? "fresh.exe" : "fresh"
26
+ };
27
+ }
28
+ module.exports = { getBinaryInfo };
29
+ });
30
+
31
+ // package.json
32
+ var require_package = __commonJS((exports, module) => {
33
+ module.exports = {
34
+ name: "@involvex/fresh-editor",
35
+ version: "0.1.76",
36
+ description: "A modern terminal-based text editor with plugin support",
37
+ repository: {
38
+ type: "git",
39
+ url: "https://github.com/involvex/fresh.git"
40
+ },
41
+ license: "Apache-2.0",
42
+ bin: {
43
+ fresh: "run-fresh.js"
44
+ },
45
+ scripts: {
46
+ postinstall: "node install.js",
47
+ start: "node run-fresh.js",
48
+ dev: "node run-fresh.js -- --dev"
49
+ },
50
+ files: [
51
+ "binary.js",
52
+ "binary-install.js",
53
+ "install.js",
54
+ "run-fresh.js",
55
+ "plugins/**/*",
56
+ "themes/**/*",
57
+ "README.md",
58
+ "LICENSE",
59
+ "CHANGELOG.md"
60
+ ],
61
+ os: ["darwin", "linux", "win32"],
62
+ cpu: ["x64", "arm64"],
63
+ keywords: ["editor", "terminal", "cli", "text-editor", "vim"],
64
+ engines: {
65
+ node: ">=18"
66
+ }
67
+ };
68
+ });
69
+
70
+ // binary-install.js
71
+ var require_binary_install = __commonJS((exports, module) => {
72
+ var __dirname = "D:\\repos\\fresh\\npm-package";
73
+ var https = __require("https");
74
+ var fs = __require("fs");
75
+ var path = __require("path");
76
+ var { execSync } = __require("child_process");
77
+ var { getBinaryInfo } = require_binary();
78
+ var VERSION = require_package().version;
79
+ var REPO = "sinelaw/fresh";
80
+ function download(url, dest) {
81
+ return new Promise((resolve, reject) => {
82
+ const file = fs.createWriteStream(dest);
83
+ file.on("error", (err) => {
84
+ file.close();
85
+ reject(err);
86
+ });
87
+ https.get(url, (response) => {
88
+ if (response.statusCode === 302 || response.statusCode === 301) {
89
+ file.close(() => {
90
+ download(response.headers.location, dest).then(resolve).catch(reject);
91
+ });
92
+ return;
93
+ }
94
+ if (response.statusCode !== 200) {
95
+ file.close();
96
+ reject(new Error(`Failed to download: ${response.statusCode}`));
97
+ return;
98
+ }
99
+ response.pipe(file);
100
+ file.on("finish", () => {
101
+ file.close();
102
+ resolve();
103
+ });
104
+ }).on("error", (err) => {
105
+ file.close();
106
+ reject(err);
107
+ });
108
+ });
109
+ }
110
+ async function install() {
111
+ const info = getBinaryInfo();
112
+ const archiveName = `fresh-editor-${info.target}.${info.ext}`;
113
+ const url = `https://github.com/${REPO}/releases/download/latest/${archiveName}`;
114
+ const archivePath = path.join(__dirname, archiveName);
115
+ const binDir = path.join(__dirname, "bin");
116
+ const binaryPath = path.join(binDir, info.binaryName);
117
+ console.log(`Downloading ${url}...`);
118
+ await download(url, archivePath);
119
+ const stats = fs.statSync(archivePath);
120
+ if (stats.size === 0) {
121
+ throw new Error(`Downloaded file is empty: ${archivePath}`);
122
+ }
123
+ console.log(`Downloaded ${stats.size} bytes`);
124
+ fs.mkdirSync(binDir, { recursive: true });
125
+ if (info.ext === "tar.xz") {
126
+ execSync(`tar -xJf "${archivePath}" -C "${binDir}" --strip-components=1`, { stdio: "inherit" });
127
+ } else if (info.ext === "zip") {
128
+ if (process.platform === "win32") {
129
+ execSync(`powershell -Command "Expand-Archive -Path '${archivePath}' -DestinationPath '${binDir}' -Force"`, { stdio: "inherit" });
130
+ const nested = path.join(binDir, `fresh-editor-${info.target}`);
131
+ if (fs.existsSync(nested)) {
132
+ fs.readdirSync(nested).forEach((f) => {
133
+ fs.renameSync(path.join(nested, f), path.join(binDir, f));
134
+ });
135
+ fs.rmdirSync(nested);
136
+ }
137
+ } else {
138
+ execSync(`unzip -o "${archivePath}" -d "${binDir}"`, { stdio: "inherit" });
139
+ }
140
+ }
141
+ fs.unlinkSync(archivePath);
142
+ if (!fs.existsSync(binaryPath)) {
143
+ throw new Error(`Installation failed: binary not found at ${binaryPath}`);
144
+ }
145
+ console.log("fresh-editor installed successfully!");
146
+ }
147
+ module.exports = { install };
148
+ });
149
+ export default require_binary_install();
package/dist/binary.js ADDED
@@ -0,0 +1,30 @@
1
+ // @bun
2
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3
+ var __require = import.meta.require;
4
+
5
+ // binary.js
6
+ var require_binary = __commonJS((exports, module) => {
7
+ var os = __require("os");
8
+ function getBinaryInfo() {
9
+ const platform = os.platform();
10
+ const arch = os.arch();
11
+ const targets = {
12
+ "darwin-x64": { target: "x86_64-apple-darwin", ext: "tar.xz" },
13
+ "darwin-arm64": { target: "aarch64-apple-darwin", ext: "tar.xz" },
14
+ "linux-x64": { target: "x86_64-unknown-linux-gnu", ext: "tar.xz" },
15
+ "linux-arm64": { target: "aarch64-unknown-linux-gnu", ext: "tar.xz" },
16
+ "win32-x64": { target: "x86_64-pc-windows-msvc", ext: "zip" }
17
+ };
18
+ const key = `${platform}-${arch}`;
19
+ const info = targets[key];
20
+ if (!info) {
21
+ throw new Error(`Unsupported platform: ${platform}-${arch}`);
22
+ }
23
+ return {
24
+ ...info,
25
+ binaryName: platform === "win32" ? "fresh.exe" : "fresh"
26
+ };
27
+ }
28
+ module.exports = { getBinaryInfo };
29
+ });
30
+ export default require_binary();
Binary file
@@ -0,0 +1,158 @@
1
+ // @bun
2
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3
+ var __require = import.meta.require;
4
+
5
+ // binary.js
6
+ var require_binary = __commonJS((exports, module) => {
7
+ var os = __require("os");
8
+ function getBinaryInfo() {
9
+ const platform = os.platform();
10
+ const arch = os.arch();
11
+ const targets = {
12
+ "darwin-x64": { target: "x86_64-apple-darwin", ext: "tar.xz" },
13
+ "darwin-arm64": { target: "aarch64-apple-darwin", ext: "tar.xz" },
14
+ "linux-x64": { target: "x86_64-unknown-linux-gnu", ext: "tar.xz" },
15
+ "linux-arm64": { target: "aarch64-unknown-linux-gnu", ext: "tar.xz" },
16
+ "win32-x64": { target: "x86_64-pc-windows-msvc", ext: "zip" }
17
+ };
18
+ const key = `${platform}-${arch}`;
19
+ const info = targets[key];
20
+ if (!info) {
21
+ throw new Error(`Unsupported platform: ${platform}-${arch}`);
22
+ }
23
+ return {
24
+ ...info,
25
+ binaryName: platform === "win32" ? "fresh.exe" : "fresh"
26
+ };
27
+ }
28
+ module.exports = { getBinaryInfo };
29
+ });
30
+
31
+ // package.json
32
+ var require_package = __commonJS((exports, module) => {
33
+ module.exports = {
34
+ name: "@involvex/fresh-editor",
35
+ version: "0.1.76",
36
+ description: "A modern terminal-based text editor with plugin support",
37
+ repository: {
38
+ type: "git",
39
+ url: "https://github.com/involvex/fresh.git"
40
+ },
41
+ license: "Apache-2.0",
42
+ bin: {
43
+ fresh: "run-fresh.js"
44
+ },
45
+ scripts: {
46
+ postinstall: "node install.js",
47
+ start: "node run-fresh.js",
48
+ dev: "node run-fresh.js -- --dev"
49
+ },
50
+ files: [
51
+ "binary.js",
52
+ "binary-install.js",
53
+ "install.js",
54
+ "run-fresh.js",
55
+ "plugins/**/*",
56
+ "themes/**/*",
57
+ "README.md",
58
+ "LICENSE",
59
+ "CHANGELOG.md"
60
+ ],
61
+ os: ["darwin", "linux", "win32"],
62
+ cpu: ["x64", "arm64"],
63
+ keywords: ["editor", "terminal", "cli", "text-editor", "vim"],
64
+ engines: {
65
+ node: ">=18"
66
+ }
67
+ };
68
+ });
69
+
70
+ // binary-install.js
71
+ var require_binary_install = __commonJS((exports, module) => {
72
+ var __dirname = "D:\\repos\\fresh\\npm-package";
73
+ var https = __require("https");
74
+ var fs = __require("fs");
75
+ var path = __require("path");
76
+ var { execSync } = __require("child_process");
77
+ var { getBinaryInfo } = require_binary();
78
+ var VERSION = require_package().version;
79
+ var REPO = "sinelaw/fresh";
80
+ function download(url, dest) {
81
+ return new Promise((resolve, reject) => {
82
+ const file = fs.createWriteStream(dest);
83
+ file.on("error", (err) => {
84
+ file.close();
85
+ reject(err);
86
+ });
87
+ https.get(url, (response) => {
88
+ if (response.statusCode === 302 || response.statusCode === 301) {
89
+ file.close(() => {
90
+ download(response.headers.location, dest).then(resolve).catch(reject);
91
+ });
92
+ return;
93
+ }
94
+ if (response.statusCode !== 200) {
95
+ file.close();
96
+ reject(new Error(`Failed to download: ${response.statusCode}`));
97
+ return;
98
+ }
99
+ response.pipe(file);
100
+ file.on("finish", () => {
101
+ file.close();
102
+ resolve();
103
+ });
104
+ }).on("error", (err) => {
105
+ file.close();
106
+ reject(err);
107
+ });
108
+ });
109
+ }
110
+ async function install() {
111
+ const info = getBinaryInfo();
112
+ const archiveName = `fresh-editor-${info.target}.${info.ext}`;
113
+ const url = `https://github.com/${REPO}/releases/download/latest/${archiveName}`;
114
+ const archivePath = path.join(__dirname, archiveName);
115
+ const binDir = path.join(__dirname, "bin");
116
+ const binaryPath = path.join(binDir, info.binaryName);
117
+ console.log(`Downloading ${url}...`);
118
+ await download(url, archivePath);
119
+ const stats = fs.statSync(archivePath);
120
+ if (stats.size === 0) {
121
+ throw new Error(`Downloaded file is empty: ${archivePath}`);
122
+ }
123
+ console.log(`Downloaded ${stats.size} bytes`);
124
+ fs.mkdirSync(binDir, { recursive: true });
125
+ if (info.ext === "tar.xz") {
126
+ execSync(`tar -xJf "${archivePath}" -C "${binDir}" --strip-components=1`, { stdio: "inherit" });
127
+ } else if (info.ext === "zip") {
128
+ if (process.platform === "win32") {
129
+ execSync(`powershell -Command "Expand-Archive -Path '${archivePath}' -DestinationPath '${binDir}' -Force"`, { stdio: "inherit" });
130
+ const nested = path.join(binDir, `fresh-editor-${info.target}`);
131
+ if (fs.existsSync(nested)) {
132
+ fs.readdirSync(nested).forEach((f) => {
133
+ fs.renameSync(path.join(nested, f), path.join(binDir, f));
134
+ });
135
+ fs.rmdirSync(nested);
136
+ }
137
+ } else {
138
+ execSync(`unzip -o "${archivePath}" -d "${binDir}"`, { stdio: "inherit" });
139
+ }
140
+ }
141
+ fs.unlinkSync(archivePath);
142
+ if (!fs.existsSync(binaryPath)) {
143
+ throw new Error(`Installation failed: binary not found at ${binaryPath}`);
144
+ }
145
+ console.log("fresh-editor installed successfully!");
146
+ }
147
+ module.exports = { install };
148
+ });
149
+
150
+ // install.js
151
+ var require_install = __commonJS(() => {
152
+ var { install } = require_binary_install();
153
+ install().catch((err) => {
154
+ console.error(err);
155
+ process.exit(1);
156
+ });
157
+ });
158
+ export default require_install();