Skip to content

Commit f4e91ee

Browse files
committed
eas-cli: migrate from nodePackages
fix: use pkgs/by-name fix: apply suggested fixes fix: apply correct formatting add changelog to meta
1 parent 4a3807f commit f4e91ee

File tree

4 files changed

+60
-650
lines changed

4 files changed

+60
-650
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
lib,
3+
stdenvNoCC,
4+
fetchFromGitHub,
5+
fetchYarnDeps,
6+
yarnConfigHook,
7+
yarnBuildHook,
8+
yarnInstallHook,
9+
nodejs,
10+
jq,
11+
}:
12+
stdenvNoCC.mkDerivation (finalAttrs: {
13+
pname = "eas-cli";
14+
version = "14.7.1";
15+
16+
src = fetchFromGitHub {
17+
owner = "expo";
18+
repo = "eas-cli";
19+
rev = "v${finalAttrs.version}";
20+
hash = "sha256-h7LohShs4j9Z7Mbe6MSMqfszrEPBcGeTpB+ma3iBXyM=";
21+
};
22+
23+
packageJson = finalAttrs.src + "/packages/eas-cli/package.json";
24+
25+
yarnOfflineCache = fetchYarnDeps {
26+
yarnLock = finalAttrs.src + "/yarn.lock"; # Point to the root lockfile
27+
hash = "sha256-pnp9MI2S5v4a7KftxYC3Sgc487vooX8+7lmYkmRTWWs=";
28+
};
29+
30+
nativeBuildInputs = [
31+
yarnConfigHook
32+
yarnBuildHook
33+
yarnInstallHook
34+
nodejs
35+
jq
36+
];
37+
38+
# Add version field to package.json to prevent yarn pack from failing
39+
preInstall = ''
40+
echo "Adding version field to package.json"
41+
jq '. + {version: "${finalAttrs.version}"}' package.json > package.json.tmp
42+
mv package.json.tmp package.json
43+
'';
44+
45+
postInstall = ''
46+
echo "Creating symlink for eas-cli binary"
47+
mkdir -p $out/bin
48+
ln -sf $out/lib/node_modules/eas-cli-root/packages/eas-cli/bin/run $out/bin/eas
49+
chmod +x $out/bin/eas
50+
'';
51+
52+
meta = {
53+
changelog = "https://github.com/expo/eas-cli/releases/tag/v${finalAttrs.version}";
54+
description = "EAS command line tool from submodule";
55+
homepage = "https://github.com/expo/eas-cli";
56+
license = lib.licenses.mit;
57+
maintainers = with lib.maintainers; [ zestsystem ];
58+
};
59+
})

pkgs/development/node-packages/aliases.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ mapAliases {
9696
inherit (pkgs.elmPackages) elm-test;
9797
inherit (pkgs) eslint; # Added 2024-08-28
9898
inherit (pkgs) eslint_d; # Added 2023-05-26
99+
inherit (pkgs) eas-cli; # added 2025-01-08
99100
expo-cli = throw "expo-cli was removed because it was deprecated upstream. Use `npx expo` or eas-cli instead."; # added 2024-12-02
100101
inherit (pkgs) firebase-tools; # added 2023-08-18
101102
inherit (pkgs) fixjson; # added 2024-06-26

pkgs/development/node-packages/node-packages.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
, "dotenv-vault"
7878
, "elasticdump"
7979
, "@electron-forge/cli"
80-
, "eas-cli"
8180
, "elm-oracle"
8281
, "emoj"
8382
, "emojione"

0 commit comments

Comments
 (0)