Skip to content

Commit

Permalink
dprint-plugins: init
Browse files Browse the repository at this point in the history
Co-Authored-By: Jonas Chevalier <[email protected]>
Signed-off-by: phanirithvij <[email protected]>
  • Loading branch information
phanirithvij and zimbatm committed Jan 2, 2025
1 parent f7c8b09 commit c772c53
Show file tree
Hide file tree
Showing 15 changed files with 408 additions and 0 deletions.
44 changes: 44 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{ lib, fetchurl }:
let
mkDprintPlugin =
{
url,
hash,
pname,
version,
description,
initConfig,
updateUrl,
license ? lib.licenses.mit,
maintainers ? [ lib.maintainers.phanirithvij ],
}:
fetchurl {
inherit hash url;
name = "${pname}-${version}.wasm";
meta = {
inherit
description
license
maintainers
;
};
passthru = {
updateScript = ./update-plugins.py;
inherit initConfig updateUrl;
};
};
inherit (lib)
filterAttrs
mapAttrs'
nameValuePair
removeSuffix
;
files = filterAttrs (
name: type: type == "regular" && name != "default.nix" && lib.hasSuffix ".nix" name
) (builtins.readDir ./.);
plugins = mapAttrs' (
name: _:
nameValuePair (removeSuffix ".nix" name) (import (./. + "/${name}") { inherit mkDprintPlugin; })
) files;
in
plugins // { inherit mkDprintPlugin; }
21 changes: 21 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/dprint-plugin-biome.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Biome (JS/TS) wrapper plugin.";
hash = "sha256-+zY+myazFAUxeNuWFigkvF4zpKBs+jzVYQT09jRWFKI=";
initConfig = {
configExcludes = [ "**/node_modules" ];
configKey = "biome";
fileExtensions = [
"ts"
"tsx"
"js"
"jsx"
"cjs"
"mjs"
];
};
pname = "dprint-plugin-biome";
updateUrl = "https://plugins.dprint.dev/dprint/biome/latest.json";
url = "https://plugins.dprint.dev/biome-0.7.1.wasm";
version = "0.7.1";
}
14 changes: 14 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/dprint-plugin-dockerfile.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Dockerfile code formatter.";
hash = "sha256-gsfMLa4zw8AblOS459ZS9OZrkGCQi5gBN+a3hvOsspk=";
initConfig = {
configExcludes = [ ];
configKey = "dockerfile";
fileExtensions = [ "dockerfile" ];
};
pname = "dprint-plugin-dockerfile";
updateUrl = "https://plugins.dprint.dev/dprint/dockerfile/latest.json";
url = "https://plugins.dprint.dev/dockerfile-0.3.2.wasm";
version = "0.3.2";
}
14 changes: 14 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/dprint-plugin-json.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "JSON/JSONC code formatter.";
hash = "sha256-Sw+HkUb4K2wrLuQRZibr8gOCR3Rz36IeId4Vd4LijmY=";
initConfig = {
configExcludes = [ "**/*-lock.json" ];
configKey = "json";
fileExtensions = [ "json" ];
};
pname = "dprint-plugin-json";
updateUrl = "https://plugins.dprint.dev/dprint/json/latest.json";
url = "https://plugins.dprint.dev/json-0.19.4.wasm";
version = "0.19.4";
}
14 changes: 14 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/dprint-plugin-jupyter.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Jupyter notebook code block formatter.";
hash = "sha256-877CEZbMlj9cHkFtl16XCnan37SeEGUL3BHaUKUv8S4=";
initConfig = {
configExcludes = [ ];
configKey = "jupyter";
fileExtensions = [ "ipynb" ];
};
pname = "dprint-plugin-jupyter";
updateUrl = "https://plugins.dprint.dev/dprint/jupyter/latest.json";
url = "https://plugins.dprint.dev/jupyter-0.1.5.wasm";
version = "0.1.5";
}
14 changes: 14 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/dprint-plugin-markdown.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Markdown code formatter.";
hash = "sha256-PIEN9UnYC8doJpdzS7M6QEHQNQtj7WwXAgvewPsTjqs=";
initConfig = {
configExcludes = [ ];
configKey = "markdown";
fileExtensions = [ "md" ];
};
pname = "dprint-plugin-markdown";
updateUrl = "https://plugins.dprint.dev/dprint/markdown/latest.json";
url = "https://plugins.dprint.dev/markdown-0.17.8.wasm";
version = "0.17.8";
}
17 changes: 17 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/dprint-plugin-ruff.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "Ruff (Python) wrapper plugin.";
hash = "sha256-15InHQgF9c0Js4yUJxmZ1oNj1O16FBU12u/GOoaSAJ8=";
initConfig = {
configExcludes = [ ];
configKey = "ruff";
fileExtensions = [
"py"
"pyi"
];
};
pname = "dprint-plugin-ruff";
updateUrl = "https://plugins.dprint.dev/dprint/ruff/latest.json";
url = "https://plugins.dprint.dev/ruff-0.3.9.wasm";
version = "0.3.9";
}
14 changes: 14 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/dprint-plugin-toml.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "TOML code formatter.";
hash = "sha256-aDfo/sKfOeNpyfd/4N1LgL1bObTTnviYrA8T7M/1KNs=";
initConfig = {
configExcludes = [ ];
configKey = "toml";
fileExtensions = [ "toml" ];
};
pname = "dprint-plugin-toml";
updateUrl = "https://plugins.dprint.dev/dprint/toml/latest.json";
url = "https://plugins.dprint.dev/toml-0.6.3.wasm";
version = "0.6.3";
}
21 changes: 21 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/dprint-plugin-typescript.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "TypeScript/JavaScript code formatter.";
hash = "sha256-urgKQOjgkoDJCH/K7DWLJCkD0iH0Ok+rvrNDI0i4uS0=";
initConfig = {
configExcludes = [ "**/node_modules" ];
configKey = "typescript";
fileExtensions = [
"ts"
"tsx"
"js"
"jsx"
"cjs"
"mjs"
];
};
pname = "dprint-plugin-typescript";
updateUrl = "https://plugins.dprint.dev/dprint/typescript/latest.json";
url = "https://plugins.dprint.dev/typescript-0.93.3.wasm";
version = "0.93.3";
}
19 changes: 19 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/g-plane-malva.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "CSS, SCSS, Sass and Less formatter.";
hash = "sha256-zt7F1tgPhPAn+gtps6+JB5RtvjIZw2n/G85Bv6kazgU=";
initConfig = {
configExcludes = [ "**/node_modules" ];
configKey = "malva";
fileExtensions = [
"css"
"scss"
"sass"
"less"
];
};
pname = "g-plane-malva";
updateUrl = "https://plugins.dprint.dev/g-plane/malva/latest.json";
url = "https://plugins.dprint.dev/g-plane/malva-v0.11.1.wasm";
version = "0.11.1";
}
24 changes: 24 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/g-plane-markup_fmt.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "HTML, Vue, Svelte, Astro, Angular, Jinja, Twig, Nunjucks, and Vento formatter.";
hash = "sha256-G8UnJbc+oZ60V3oi8W2SS6H06zEYfY3wpmSUp+1GF8k=";
initConfig = {
configExcludes = [ ];
configKey = "markup";
fileExtensions = [
"html"
"vue"
"svelte"
"astro"
"jinja"
"jinja2"
"twig"
"njk"
"vto"
];
};
pname = "g-plane-markup_fmt";
updateUrl = "https://plugins.dprint.dev/g-plane/markup_fmt/latest.json";
url = "https://plugins.dprint.dev/g-plane/markup_fmt-v0.18.0.wasm";
version = "0.18.0";
}
17 changes: 17 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/g-plane-pretty_graphql.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "GraphQL formatter.";
hash = "sha256-PlQwpR0tMsghMrOX7is+anN57t9xa9weNtoWpc0E9ec=";
initConfig = {
configExcludes = [ ];
configKey = "graphql";
fileExtensions = [
"graphql"
"gql"
];
};
pname = "g-plane-pretty_graphql";
updateUrl = "https://plugins.dprint.dev/g-plane/pretty_graphql/latest.json";
url = "https://plugins.dprint.dev/g-plane/pretty_graphql-v0.2.1.wasm";
version = "0.2.1";
}
17 changes: 17 additions & 0 deletions pkgs/by-name/dp/dprint/plugins/g-plane-pretty_yaml.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ mkDprintPlugin }:
mkDprintPlugin {
description = "YAML formatter.";
hash = "sha256-6ua021G7ZW7Ciwy/OHXTA1Joj9PGEx3SZGtvaA//gzo=";
initConfig = {
configExcludes = [ ];
configKey = "yaml";
fileExtensions = [
"yaml"
"yml"
];
};
pname = "g-plane-pretty_yaml";
updateUrl = "https://plugins.dprint.dev/g-plane/pretty_yaml/latest.json";
url = "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm";
version = "0.5.0";
}
Loading

0 comments on commit c772c53

Please sign in to comment.