Skip to content

Commit

Permalink
eas-cli: migrate from nodePackages
Browse files Browse the repository at this point in the history
fix: use pkgs/by-name

fix: apply suggested fixes

fix: apply correct formatting

add changelog to meta
  • Loading branch information
zestsystem committed Feb 5, 2025
1 parent 4a3807f commit f4e91ee
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 650 deletions.
59 changes: 59 additions & 0 deletions pkgs/by-name/ea/eas-cli/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
fetchYarnDeps,
yarnConfigHook,
yarnBuildHook,
yarnInstallHook,
nodejs,
jq,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "eas-cli";
version = "14.7.1";

src = fetchFromGitHub {
owner = "expo";
repo = "eas-cli";
rev = "v${finalAttrs.version}";
hash = "sha256-h7LohShs4j9Z7Mbe6MSMqfszrEPBcGeTpB+ma3iBXyM=";
};

packageJson = finalAttrs.src + "/packages/eas-cli/package.json";

yarnOfflineCache = fetchYarnDeps {
yarnLock = finalAttrs.src + "/yarn.lock"; # Point to the root lockfile
hash = "sha256-pnp9MI2S5v4a7KftxYC3Sgc487vooX8+7lmYkmRTWWs=";
};

nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
yarnInstallHook
nodejs
jq
];

# Add version field to package.json to prevent yarn pack from failing
preInstall = ''
echo "Adding version field to package.json"
jq '. + {version: "${finalAttrs.version}"}' package.json > package.json.tmp
mv package.json.tmp package.json
'';

postInstall = ''
echo "Creating symlink for eas-cli binary"
mkdir -p $out/bin
ln -sf $out/lib/node_modules/eas-cli-root/packages/eas-cli/bin/run $out/bin/eas
chmod +x $out/bin/eas
'';

meta = {
changelog = "https://github.com/expo/eas-cli/releases/tag/v${finalAttrs.version}";
description = "EAS command line tool from submodule";
homepage = "https://github.com/expo/eas-cli";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ zestsystem ];
};
})
1 change: 1 addition & 0 deletions pkgs/development/node-packages/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ mapAliases {
inherit (pkgs.elmPackages) elm-test;
inherit (pkgs) eslint; # Added 2024-08-28
inherit (pkgs) eslint_d; # Added 2023-05-26
inherit (pkgs) eas-cli; # added 2025-01-08
expo-cli = throw "expo-cli was removed because it was deprecated upstream. Use `npx expo` or eas-cli instead."; # added 2024-12-02
inherit (pkgs) firebase-tools; # added 2023-08-18
inherit (pkgs) fixjson; # added 2024-06-26
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/node-packages/node-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
, "dotenv-vault"
, "elasticdump"
, "@electron-forge/cli"
, "eas-cli"
, "elm-oracle"
, "emoj"
, "emojione"
Expand Down
Loading

0 comments on commit f4e91ee

Please sign in to comment.