Skip to content

Commit

Permalink
Merge pull request #2 from dezren39/patch-2_2
Browse files Browse the repository at this point in the history
  • Loading branch information
dezren39 authored Jul 3, 2024
2 parents 26e7118 + 19afc03 commit 94f8d4e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkgs/by-name/wr/wrangler/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,18 @@ stdenv.mkDerivation (finalAttrs: {
# I'm sure this is suboptimal but it seems to work. Points:
# - when build is run in the original repo, no specific executable seems to be generated; you run the resulting build with pnpm run start
# - this means we need to add a dedicated script - perhaps it is possible to create this frok the workers-sdk dir, but I don't know how to do this
# - the bulid process builds a version of miniflare which is used by wrangler; for this reason, the miniflare package is copied also
# - the build process builds a version of miniflare which is used by wrangler; for this reason, the miniflare package is copied also
# - pnpm stores all content in the top-level node_modules directory, but it is linked to from a node_modules directory inside wrangler
# - as they are linked via symlinks, the relative location of them on the filesystem should be maintained
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/lib $out/lib/packages/wrangler
rm -rf node_modules/typescript node_modules/eslint node_modules/.bin/eslint node_modules/prettier node_modules/.bin/prettier
cp -r node_modules $out/lib
cp -r packages/wrangler/bin $out/lib/packages/wrangler
cp -r packages/wrangler/wrangler-dist $out/lib/packages/wrangler
cp -r packages/wrangler/node_modules $out/lib/packages/wrangler
cp -r packages/miniflare $out/lib/packages/wrangler
cp -r packages/miniflare $out/lib/packages/
cp $wranglerScript $out/bin/wrangler
chmod a+x $out/bin/wrangler
substituteInPlace $out/bin/wrangler --replace-warn /bin/sh ${pkgs.bash}/bin/sh
Expand Down

0 comments on commit 94f8d4e

Please sign in to comment.