Add deno flake template and fix emoji script
This commit is contained in:
parent
f48badb047
commit
0925b57461
8 changed files with 95 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
r="$(< "$HOME/.emoji.txt" sk --height 40%)"
|
r="$(< "$HOME/.emoji.txt" fzf --height 40%)"
|
||||||
echo "$r" | awk '$0=$1' | tr -d '\n' | clip
|
echo "$r" | awk '$0=$1' | tr -d '\n' | clip
|
||||||
echo "Copied $r emoji to your clipboard"
|
echo "Copied $r emoji to your clipboard"
|
||||||
|
|
|
@ -3,4 +3,8 @@
|
||||||
path = ./rust;
|
path = ./rust;
|
||||||
description = "A template for working on a Rust project";
|
description = "A template for working on a Rust project";
|
||||||
};
|
};
|
||||||
|
deno = {
|
||||||
|
path = ./deno;
|
||||||
|
description = "A template for working on a TypeScript and Deno project";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
1
templates/deno/.envrc
Normal file
1
templates/deno/.envrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
2
templates/deno/.gitignore
vendored
Normal file
2
templates/deno/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/target
|
||||||
|
/.direnv
|
49
templates/deno/.helix/languages.toml
Normal file
49
templates/deno/.helix/languages.toml
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
[language-server.deno]
|
||||||
|
command = "deno"
|
||||||
|
args = ["lsp"]
|
||||||
|
config.hostInfo = "helix"
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "javascript"
|
||||||
|
scope = "source.js"
|
||||||
|
injection-regex = "(js|javascript)"
|
||||||
|
language-id = "javascript"
|
||||||
|
file-types = ["js", "mjs", "cjs", "rules", "es6", "pac", "jakefile"]
|
||||||
|
shebangs = ["node"]
|
||||||
|
comment-token = "//"
|
||||||
|
language-servers = [ "deno" ]
|
||||||
|
indent = { tab-width = 2, unit = "\t" }
|
||||||
|
auto-format = true
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "jsx"
|
||||||
|
scope = "source.jsx"
|
||||||
|
injection-regex = "jsx"
|
||||||
|
language-id = "javascriptreact"
|
||||||
|
file-types = ["jsx"]
|
||||||
|
comment-token = "//"
|
||||||
|
language-servers = [ "deno" ]
|
||||||
|
indent = { tab-width = 2, unit = "\t" }
|
||||||
|
grammar = "javascript"
|
||||||
|
auto-format = true
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "typescript"
|
||||||
|
scope = "source.ts"
|
||||||
|
injection-regex = "(ts|typescript)"
|
||||||
|
file-types = ["ts", "mts", "cts"]
|
||||||
|
language-id = "typescript"
|
||||||
|
shebangs = ["deno", "ts-node"]
|
||||||
|
language-servers = [ "deno" ]
|
||||||
|
indent = { tab-width = 2, unit = "\t" }
|
||||||
|
auto-format = true
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "tsx"
|
||||||
|
scope = "source.tsx"
|
||||||
|
injection-regex = "(tsx)"
|
||||||
|
language-id = "typescriptreact"
|
||||||
|
file-types = ["tsx"]
|
||||||
|
language-servers = [ "deno" ]
|
||||||
|
indent = { tab-width = 2, unit = "\t" }
|
||||||
|
auto-format = true
|
10
templates/deno/deno.jsonc
Normal file
10
templates/deno/deno.jsonc
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"tasks": {
|
||||||
|
"dev": "deno run -A --watch=src src/mod.ts",
|
||||||
|
},
|
||||||
|
"fmt": {
|
||||||
|
"useTabs": true,
|
||||||
|
"semiColons": false,
|
||||||
|
"singleQuote": true,
|
||||||
|
},
|
||||||
|
}
|
23
templates/deno/flake.nix
Normal file
23
templates/deno/flake.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=2c7f3c0fb7c08a0814627611d9d7d45ab6d75335";
|
||||||
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
}: let
|
||||||
|
inherit (self) outputs;
|
||||||
|
supportedSystems = ["x86_64-linux"];
|
||||||
|
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
|
||||||
|
in {
|
||||||
|
devShells = forEachSupportedSystem (system: let
|
||||||
|
pkgs = import nixpkgs {inherit system;};
|
||||||
|
in {
|
||||||
|
deno-dev = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
deno
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
default = outputs.devShells.${system}.deno-dev;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
5
templates/deno/src/mod.ts
Normal file
5
templates/deno/src/mod.ts
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
console.log("Hello, world!")
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
console.log("Truth!")
|
||||||
|
}
|
Loading…
Reference in a new issue