-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #476 from r-k-b/elm-review-offline
let `elm-review --offline` succeed in Nix sandboxed builds
- Loading branch information
Showing
14 changed files
with
266 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Index: lib/project-dependencies.js | ||
IDEA additional info: | ||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | ||
<+>UTF-8 | ||
=================================================================== | ||
diff --git a/lib/project-dependencies.js b/lib/project-dependencies.js | ||
--- a/lib/project-dependencies.js (revision f0894b30a252e7db739546efa17f2ded174d167a) | ||
+++ b/lib/project-dependencies.js (date 1722160229220) | ||
@@ -33,6 +33,7 @@ | ||
packageVersion | ||
).catch(() => { | ||
hasDependenciesThatCouldNotBeDownloaded = true; | ||
+ console.log('getDocsJson failed:', {elmVersion, name, packageVersion}); | ||
return []; | ||
}), | ||
ProjectJsonFiles.getElmJson( | ||
@@ -42,6 +43,7 @@ | ||
packageVersion | ||
).catch(() => { | ||
hasDependenciesThatCouldNotBeDownloaded = true; | ||
+ console.log('getElmJson failed:', {elmVersion, name, packageVersion}) | ||
return defaultElmJson(name, packageVersion); | ||
}) | ||
]); | ||
Index: lib/project-json-files.js | ||
IDEA additional info: | ||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | ||
<+>UTF-8 | ||
=================================================================== | ||
diff --git a/lib/project-json-files.js b/lib/project-json-files.js | ||
--- a/lib/project-json-files.js (revision f0894b30a252e7db739546efa17f2ded174d167a) | ||
+++ b/lib/project-json-files.js (date 1722162109928) | ||
@@ -46,6 +46,7 @@ | ||
} catch (error) { | ||
// Finally, try to download it from the packages website | ||
if (options.offline) { | ||
+ console.log('getElmJson read failed', {cacheLocation}) | ||
// Unless we're in offline mode | ||
throw error; | ||
} | ||
@@ -147,6 +148,7 @@ | ||
} catch (error) { | ||
// Finally, try to download it from the packages website | ||
if (options.offline) { | ||
+ console.log('getDocsJson read failed', {cacheLocation}) | ||
// Unless we're in offline mode | ||
throw error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ elm-review-tool-src, elmPackages, pkgs, stdenv }: | ||
pkgs.buildNpmPackage { | ||
name = "elm-review"; | ||
src = elm-review-tool-src; | ||
npmDepsHash = | ||
# pkgs.lib.fakeHash; | ||
"sha256-BnvEdkKiFbUtEFGom9ZaCqZzId4ViGU3PlZ/BJCmX4A="; | ||
patches = [ ./elm-review-offline-details.patch ]; | ||
nativeBuildInputs = with pkgs; [ coreutils ]; | ||
buildInputs = with elmPackages; [ elm elm-format ]; | ||
buildPhase = '' | ||
substituteInPlace ./package.json \ | ||
--replace-fail '"elm-tooling install"' '"echo skipping elm-tooling"' | ||
mkdir -p "$out" | ||
cp -r * "$out"/ | ||
mv $out/bin/elm-review $out/bin/elm-review.js | ||
cat << EOF > $out/bin/elm-review | ||
#!${pkgs.bash}/bin/bash | ||
${pkgs.nodejs}/bin/node ./elm-review.js \ | ||
--namespace="elm-review-nix-from-src" \ | ||
--compiler="${elmPackages.elm}/bin/elm \ | ||
--elm-format-path="${elmPackages.elm-format}/bin/elm-format \ | ||
"$@" | ||
EOF | ||
chmod +x $out/bin/elm-review | ||
''; | ||
} |
Oops, something went wrong.