Skip to content

Commit 6898384

Browse files
committed
netlify-cli: 19.0.2 -> 23.9.2
Upgrades for netlify-cli were broken for a while because postinstall script was changed to not build the packages into dist directory ahead of time, but rather expect the user to do this. Add an workaround to not run postinstall logic entirely. Also disable edge functions in tests using an internal flag, because they try to download Deno, some types definitions, and maybe other stuff at runtime.
1 parent 4b89c53 commit 6898384

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

pkgs/by-name/ne/netlify-cli/package.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,22 @@
1111

1212
buildNpmPackage rec {
1313
pname = "netlify-cli";
14-
version = "19.0.2";
14+
version = "23.9.2";
1515

1616
src = fetchFromGitHub {
1717
owner = "netlify";
1818
repo = "cli";
1919
tag = "v${version}";
20-
hash = "sha256-+P+hS/g/xRFNvzESZ5LyxyQSSRZ7BzCg9ZX/ndNLeDg=";
20+
hash = "sha256-rjxm/TrKsvYCKwoHkZRZXFpFTfLd0s0D/H6p5Bull0E=";
2121
};
2222

23-
npmDepsHash = "sha256-3C+tTqLJCm48pAbQMiIq2SsHmb4bcCaf3IU/cTeR5BA=";
23+
# Prevent postinstall script from running before package is built
24+
# See https://github.com/netlify/cli/blob/v23.9.2/scripts/postinstall.js#L70
25+
postPatch = ''
26+
touch .git
27+
'';
28+
29+
npmDepsHash = "sha256-itzEmCOBXxspGiwxt8t6di7/EuCo2Qkl5JVSkMfUemI=";
2430

2531
inherit nodejs;
2632

pkgs/by-name/ne/netlify-cli/test.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ runCommand "netlify-cli-test"
2727
echo '/with-redirect /' >_redirects
2828
2929
# Start a local server and wait for it to respond
30-
netlify dev --offline --port 8888 2>&1 | tee log &
30+
# Edge functions require specific version of Deno and internet access for other Netlify stuff
31+
netlify dev --offline --internal-disable-edge-functions --port 8888 --debug 2>&1 | tee log &
3132
sleep 0.1 || true
3233
for (( i=0; i<300; i++ )); do
33-
if grep --ignore-case 'Server now ready' <log; then
34+
if ! jobs %% > /dev/null; then
35+
echo "Server died before starting" >&2
36+
exit 1
37+
fi
38+
if grep --ignore-case 'Local dev server ready' <log; then
3439
break
3540
else
3641
sleep 1

0 commit comments

Comments
 (0)