-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevenv.nix
More file actions
66 lines (63 loc) · 2.15 KB
/
Copy pathdevenv.nix
File metadata and controls
66 lines (63 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
# More config is provided by input shared
enterShell = ''
echo "🛠️ DBP Cabinet App Dev Shell"
'';
# https://devenv.sh/git-hooks/
git-hooks = {
hooks = {
# Try i18next with "env TERM=dumb"
i18next.enable = true;
i18next2 = {
enable = false;
name = "i18next2";
description = "Check translations with i18next-cli";
# If we try this without --dry-run then the hook hangs with high cpu load
# entry = "npx i18next-cli lint";
# entry = "npm run check";
# entry = "eza";
# entry = "sh -c \"npx i18next-cli extract --ci --dry-run 2>&1 | tee /tmp/i18next.log\"";
# entry = "sh -c \"npx i18next-cli extract --ci\"";
# entry = "timeout 10 sh -c \"npx i18next-cli extract --ci --dry-run; exit $?\"";
# entry = "timeout 10 sh -c \"./node_modules/.bin/i18next-cli extract --ci < /dev/null; exit $?\"";
# entry = "node ./node_modules/.bin/i18next-cli extract --ci";
entry = "/nix/store/gydp4lzvfnhirnqdbd4fab24hwvskxhb-i18next-cli-1.20.4/bin/i18next-cli extract --ci";
# entry = "extract-translations";
# always_run = true;
language = "system";
pass_filenames = false;
files = "(src/.*\\.js$|translation\\.json$)";
stages = [ "pre-commit" ];
require_serial = true;
verbose = true;
};
};
};
# scripts = {
# check.exec = "i18next-cli lint";
# extract-translations.exec = "i18next-cli extract --ci";
# };
#
# tasks = {
# "i18next:lint" = {
# description = "Run i18next-cli lint to check translations";
# exec = ''
# npx i18next-cli lint
# '';
# # before = [ "devenv:git-hooks:run" ];
# };
# "i18next:extract" = {
# description = "Run i18next-cli extract to extract new translations";
# execIfModified = [
# "src/**/*.js"
# "translation.json"
# ];
# exec = ''
# npx i18next-cli extract
# '';
# # after = [ "devenv:git-hooks:run" ];
# before = [ "devenv:git-hooks:run" ];
# # before = [ "devenv:pre-commit:after" ];
# };
# };
}