-
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.
wip: try to bring elm-review inside the sandboxed build
- Loading branch information
Showing
13 changed files
with
362 additions
and
20 deletions.
There are no files selected for viewing
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
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 | ||
''; | ||
} |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ elm-review-tool, elmPackages, fetchElmDepsWithDocs, lib, pkgs, stdenv | ||
, reviewSrc }: | ||
let | ||
elmVersion = "0.19.1"; | ||
elmPkgDeps = import ./elm/elm-srcs-main.nix | ||
// import ./elm/elm-srcs-review.nix; | ||
|
||
mkDocs = lib.mapAttrsToList (name: info: | ||
let _ = ""; | ||
in '' | ||
base="$PWD" | ||
echo "zzz base is $base" | ||
echo "zzz EH is $ELM_HOME" | ||
echo .elm/${elmVersion}/packages/${name}/${info.version} | ||
cd .elm/${elmVersion}/packages/${name}/${info.version} | ||
elm make --docs=docs.json | ||
cd "$base" | ||
'') elmPkgDeps; | ||
in stdenv.mkDerivation { | ||
name = "elm-reviewed"; | ||
src = reviewSrc; | ||
|
||
buildInputs = with elmPackages; [ | ||
elm | ||
elm-json | ||
elm-review-tool | ||
pkgs.breakpointHook | ||
]; | ||
|
||
buildPhase = elmPackages.fetchElmDeps { | ||
inherit elmVersion; | ||
elmPackages = elmPkgDeps; | ||
registryDat = ./elm/registry.dat; | ||
}; | ||
|
||
installPhase = '' | ||
set -e | ||
'' + (lib.concatStrings mkDocs) + '' | ||
mkdir -p .elm/elm-review/2.12.0 | ||
ln -s ../../${elmVersion} .elm/elm-review/2.12.0/${elmVersion} | ||
elm-review --offline | ||
echo "passed" > $out | ||
''; | ||
} |
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,11 @@ | ||
# based on https://github.com/NixOS/nixpkgs/blob/ae5eab1bf17d71ab2e7c467aa13ccd3811d73fff/pkgs/development/compilers/elm/lib/fetchElmDeps.nix | ||
{ pkgs, fetchurl }: | ||
|
||
{ elmPackages, registryDat, elmVersion }: | ||
|
||
let | ||
makeDotElm = | ||
pkgs.callPackage ./makeDotElmWithDocs.nix { inherit registryDat; }; | ||
in '' | ||
export ELM_HOME=`pwd`/.elm | ||
'' + (makeDotElm elmVersion elmPackages) |
Oops, something went wrong.