Add res:format run target

This commit is contained in:
Hoang Nguyen 2024-03-08 00:00:00 +07:00
parent b1f48e19fd
commit a283801d72
Signed by: folliehiyuki
GPG Key ID: B0567C20730E9B11
8 changed files with 21 additions and 3 deletions

View File

@ -10,4 +10,4 @@ Monorepo managing all of my cloud and home lab resources.
=== Structure
This repository is small, and each Pulumi project is a 1-stack directory. Therefore, all Pulumi projects use the same name, while their stack names are chosen to be the parent directory name. The `+Pulumi.yaml+` file at repository's root is reused for every Pulumi projects inside.
This repository is small, and each Pulumi project is a one-stack directory. Therefore, all Pulumi projects use the same project name, while their stack names are chosen to be the parent directory name. The `+Pulumi.yaml+` file at repository's root is reused for all Pulumi projects inside.

View File

@ -37,10 +37,17 @@
"cwd": "{projectRoot}"
}
},
"res:format": {
"executor": "nx:run-commands",
"options": {
"commands": ["rescript format -all"],
"cwd": "{projectRoot}"
}
},
"res:dev": {
"executor": "nx:run-commands",
"options": {
"commands": ["rescript -w"],
"commands": ["rescript build -w"],
"cwd": "{projectRoot}"
}
}

View File

@ -9,6 +9,7 @@
"targets": {
"res:build": {},
"res:clean": {},
"res:format": {},
"res:dev": {}
}
}

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -27,6 +27,7 @@
},
"res:build": {},
"res:clean": {},
"res:format": {},
"res:dev": {}
}
}

View File

@ -0,0 +1 @@

View File

@ -4,9 +4,15 @@
* SPDX-License-Identifier: Apache-2.0
*/
_: {
{ pkgs, ... }: {
projectRootFile = "flake.lock";
settings.formatter.rescript = {
command = "${pkgs.nodePackages.pnpm}/bin/pnpm";
options = [ "nx" "run-many" "-t" "res:format" ];
includes = [ "*.res" ];
};
# List of formatters: https://github.com/numtide/treefmt-nix/tree/main/programs
programs =
builtins.listToAttrs (