Skip to content

Commit

Permalink
Add support for Deno
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSensor committed Dec 6, 2024
1 parent 44c521a commit 27c6f22
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 7 deletions.
6 changes: 6 additions & 0 deletions functions/_tide_item_deno.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function _tide_item_deno
if path is $_tide_parent_dirs/deno.json
deno --version | string match -qr "deno (?<v>.*) \(.*\)"
_tide_print_item deno $tide_deno_icon' ' $v
end
end
2 changes: 1 addition & 1 deletion functions/_tide_remove_unusable_items.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function _tide_remove_unusable_items
# Remove tool-specific items for tools the machine doesn't have installed
set -l removed_items
for item in aws bun crystal direnv distrobox docker elixir gcloud git go java kubectl nix_shell node php pulumi python ruby rustc terraform toolbox zig
for item in aws bun crystal deno direnv distrobox docker elixir gcloud git go java kubectl nix_shell node php pulumi python ruby rustc terraform toolbox zig
contains $item $tide_left_prompt_items $tide_right_prompt_items || continue

set -l cli_names $item
Expand Down
6 changes: 4 additions & 2 deletions functions/tide/configure/configs/classic.fish
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ tide_context_color_ssh D7AF87
tide_context_hostname_parts 1
tide_crystal_bg_color 444444
tide_crystal_color FFFFFF
tide_deno_bg_color 444444
tide_deno_color FFFFFF
tide_direnv_bg_color 444444
tide_direnv_bg_color_denied 444444
tide_direnv_color $_tide_color_gold
Expand Down Expand Up @@ -79,11 +81,11 @@ tide_pwd_bg_color 444444
tide_pwd_color_anchors $_tide_color_light_blue
tide_pwd_color_dirs $_tide_color_dark_blue
tide_pwd_color_truncated_dirs 8787AF
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform bun.lockb Cargo.toml composer.json CVS go.mod package.json build.zig
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform bun.lockb Cargo.toml composer.json CVS go.mod deno.json package.json build.zig
tide_python_bg_color 444444
tide_python_color 00AFAF
tide_right_prompt_frame_enabled true
tide_right_prompt_items status cmd_duration context jobs direnv bun node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig
tide_right_prompt_items status cmd_duration context jobs direnv bun deno node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig
tide_right_prompt_prefix 
tide_right_prompt_separator_diff_color 
tide_right_prompt_separator_same_color 
Expand Down
2 changes: 2 additions & 0 deletions functions/tide/configure/configs/classic_16color.fish
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ tide_context_color_root bryellow
tide_context_color_ssh yellow
tide_crystal_bg_color black
tide_crystal_color brwhite
tide_deno_bg_color black
tide_deno_color white
tide_direnv_bg_color black
tide_direnv_bg_color_denied black
tide_direnv_color bryellow
Expand Down
6 changes: 4 additions & 2 deletions functions/tide/configure/configs/lean.fish
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ tide_context_color_ssh D7AF87
tide_context_hostname_parts 1
tide_crystal_bg_color normal
tide_crystal_color FFFFFF
tide_deno_bg_color normal
tide_deno_color FFFFFF
tide_direnv_bg_color normal
tide_direnv_bg_color_denied normal
tide_direnv_color $_tide_color_gold
Expand Down Expand Up @@ -79,11 +81,11 @@ tide_pwd_bg_color normal
tide_pwd_color_anchors $_tide_color_light_blue
tide_pwd_color_dirs $_tide_color_dark_blue
tide_pwd_color_truncated_dirs 8787AF
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform bun.lockb Cargo.toml composer.json CVS go.mod package.json build.zig
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform bun.lockb Cargo.toml composer.json CVS go.mod deno.json package.json build.zig
tide_python_bg_color normal
tide_python_color 00AFAF
tide_right_prompt_frame_enabled false
tide_right_prompt_items status cmd_duration context jobs direnv bun node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig
tide_right_prompt_items status cmd_duration context jobs direnv bun deno node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig
tide_right_prompt_prefix ' '
tide_right_prompt_separator_diff_color ' '
tide_right_prompt_separator_same_color ' '
Expand Down
2 changes: 2 additions & 0 deletions functions/tide/configure/configs/lean_16color.fish
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ tide_context_color_root bryellow
tide_context_color_ssh yellow
tide_crystal_bg_color normal
tide_crystal_color brwhite
tide_deno_bg_color normal
tide_deno_color white
tide_direnv_bg_color normal
tide_direnv_bg_color_denied normal
tide_direnv_color bryellow
Expand Down
6 changes: 4 additions & 2 deletions functions/tide/configure/configs/rainbow.fish
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ tide_context_color_ssh D7AF87
tide_context_hostname_parts 1
tide_crystal_bg_color FFFFFF
tide_crystal_color 000000
tide_deno_bg_color FFFFFF
tide_deno_color 000000
tide_direnv_bg_color $_tide_color_gold
tide_direnv_bg_color_denied FF0000
tide_direnv_color 000000
Expand Down Expand Up @@ -79,11 +81,11 @@ tide_pwd_bg_color 3465A4
tide_pwd_color_anchors E4E4E4
tide_pwd_color_dirs E4E4E4
tide_pwd_color_truncated_dirs BCBCBC
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform bun.lockb Cargo.toml composer.json CVS go.mod package.json build.zig
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform bun.lockb Cargo.toml composer.json CVS go.mod deno.json package.json build.zig
tide_python_bg_color 444444
tide_python_color 00AFAF
tide_right_prompt_frame_enabled true
tide_right_prompt_items status cmd_duration context jobs direnv bun node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig
tide_right_prompt_items status cmd_duration context jobs direnv bun deno node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig
tide_right_prompt_prefix 
tide_right_prompt_separator_diff_color 
tide_right_prompt_separator_same_color 
Expand Down
2 changes: 2 additions & 0 deletions functions/tide/configure/configs/rainbow_16color.fish
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ tide_context_color_root yellow
tide_context_color_ssh yellow
tide_crystal_bg_color brwhite
tide_crystal_color black
tide_deno_bg_color white
tide_deno_color black
tide_direnv_bg_color bryellow
tide_direnv_bg_color_denied brred
tide_direnv_color black
Expand Down
1 change: 1 addition & 0 deletions functions/tide/configure/icons.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tide_character_vi_icon_replace ▶
tide_character_vi_icon_visual V
tide_cmd_duration_icon
tide_crystal_icon 
tide_deno_icon 
tide_direnv_icon ▼
tide_distrobox_icon 󰆧
tide_docker_icon 
Expand Down
22 changes: 22 additions & 0 deletions tests/_tide_item_deno.test.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# RUN: %fish %s
_tide_parent_dirs

function _deno
_tide_decolor (_tide_item_deno)
end

set -l tmpdir (mktemp -d)
cd $tmpdir

mock deno --version "echo deno 2.1.2 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2
"
set -lx tide_deno_icon 

_deno # CHECK:

touch deno.json
_deno # CHECK:  2.1.2

command rm -r $tmpdir

0 comments on commit 27c6f22

Please sign in to comment.