summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-05-12 12:38:11 +0200
committerAlan Pearce2024-05-12 12:39:50 +0200
commitf433d8313946a1dcf7d8be09fe401344aed9de6f (patch)
tree5118f0945c255d85a2f8c0e8ff297c63f4d470f4
parent647d704194342bbbd64c213fd35ee46f39579517 (diff)
downloadnixfiles-f433d8313946a1dcf7d8be09fe401344aed9de6f.tar.lz
nixfiles-f433d8313946a1dcf7d8be09fe401344aed9de6f.tar.zst
nixfiles-f433d8313946a1dcf7d8be09fe401344aed9de6f.zip
patch prettierd to work with apheleia
-rw-r--r--overlays/node-packages/default.nix5
-rw-r--r--overlays/node-packages/prettierd.patch32
2 files changed, 36 insertions, 1 deletions
diff --git a/overlays/node-packages/default.nix b/overlays/node-packages/default.nix
index 3e5c9259..b89a10a3 100644
--- a/overlays/node-packages/default.nix
+++ b/overlays/node-packages/default.nix
@@ -1,6 +1,9 @@
 self: super: {
   nodePackages = super.nodePackages.extend
     (final: prev:
-      super.callPackage ./prettier-plugin-go-template { }
+      super.callPackage ./prettier-plugin-go-template { } // { }
     );
+  prettierd = super.prettierd.overrideAttrs (old: {
+    patches = [ ./prettierd.patch ];
+  });
 }
diff --git a/overlays/node-packages/prettierd.patch b/overlays/node-packages/prettierd.patch
new file mode 100644
index 00000000..9abb572d
--- /dev/null
+++ b/overlays/node-packages/prettierd.patch
@@ -0,0 +1,32 @@
+diff --git a/src/service.ts b/src/service.ts
+index 93164e5..eafc38f 100644
+--- a/src/service.ts
++++ b/src/service.ts
+@@ -153,8 +153,26 @@ function parseCLIArguments(args: string[]): [CLIArguments, string, CliOptions] {
+           parsedArguments.ignorePath = nextArg.value;
+           break;
+         }
++        case "--stdin-filepath": {
++          const nextArg = argsIterator.next();
++          if (nextArg.done) {
++            throw new Error("--stdin-filepath option expects a file path");
++          }
++
++          fileName = nextArg.value;
++          break;
++        }
+         default: {
+-          optionArgs.push(arg);
++          if (arg.includes("=")) {
++            optionArgs.push(arg);
++          } else {
++            const nextArg = argsIterator.next();
++            if (nextArg.done) {
++              throw new Error(`--${arg} expects a value`);
++            }
++
++            optionArgs.push(`${arg}=${nextArg.value}`);
++          }
+         }
+       }
+     } else {