Initial deno project
This commit is contained in:
commit
a57a22a072
7 changed files with 131 additions and 0 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake
|
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
# nix build results
|
||||
/result
|
||||
|
||||
# direnv cache
|
||||
/.direnv
|
49
.helix/languages.toml
Normal file
49
.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
deno.json
Normal file
10
deno.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"tasks": {
|
||||
"dev": "deno run -A --watch=src,mod.ts mod.ts"
|
||||
},
|
||||
"fmt": {
|
||||
"useTabs": true,
|
||||
"semiColons": false,
|
||||
"singleQuote": true
|
||||
}
|
||||
}
|
27
flake.lock
Normal file
27
flake.lock
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1724224976,
|
||||
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
34
flake.nix
Normal file
34
flake.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
}: let
|
||||
inherit (self) outputs;
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
|
||||
in {
|
||||
devShells = forEachSupportedSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
in {
|
||||
deno-dev = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
vscode-langservers-extracted
|
||||
deno
|
||||
curl
|
||||
xh
|
||||
sqlite
|
||||
];
|
||||
};
|
||||
|
||||
default = outputs.devShells.${system}.deno-dev;
|
||||
});
|
||||
};
|
||||
}
|
5
mod.ts
Normal file
5
mod.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
console.log('Hello, world!')
|
||||
|
||||
if (true) {
|
||||
console.log('Truth!')
|
||||
}
|
Loading…
Reference in a new issue