prettier: make plugin bundling actually work

This commit is contained in:
dish 2025-10-23 22:04:44 -04:00
parent c9869223b8
commit 2597cbe7af

View file

@ -98,12 +98,12 @@ let
# Arguments
plugin
: Attribute set with `.packageName` and `.outPath` defined
: Attribute set with `.pname` and `.outPath` defined
*/
nodeEntryPointOf =
plugin:
let
pluginDir = "${plugin.outPath}/lib/node_modules/${plugin.packageName}";
pluginDir = "${plugin.outPath}/lib/node_modules/${plugin.pname}";
packageJsonAttrs = builtins.fromJSON (builtins.readFile "${pluginDir}/package.json");
@ -118,10 +118,10 @@ let
pathAbsoluteFallback
else
lib.warn ''
${plugin.packageName}: error context, tried finding entry point under;
${plugin.pname}: error context, tried finding entry point under;
pathAbsoluteNaive -> ${pathAbsoluteNaive}
pathAbsoluteFallback -> ${pathAbsoluteFallback}
'' throw ''${plugin.packageName}: does not provide parse-able entry point'';
'' throw ''${plugin.pname}: does not provide parse-able entry point'';
in
stdenv.mkDerivation (finalAttrs: {
pname = "prettier";