gatsby-cli: migrate from nodePackages (#458847)
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchYarnDeps,
|
||||
yarnConfigHook,
|
||||
yarnBuildHook,
|
||||
nodejs,
|
||||
findutils,
|
||||
makeBinaryWrapper,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "gatsby-cli";
|
||||
version = "5.15.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "gatsbyjs";
|
||||
repo = "gatsby";
|
||||
tag = "gatsby-cli@${finalAttrs.version}";
|
||||
hash = "sha256-sNNbOV9UuCTYHp4cSK9ngCukUXDNV4iOIc9PPQVYymM=";
|
||||
};
|
||||
|
||||
yarnKeepDevDeps = true;
|
||||
|
||||
yarnOfflineCache = fetchYarnDeps {
|
||||
yarnLock = finalAttrs.src + "/yarn.lock";
|
||||
hash = "sha256-wfg9Nj9Z8vyp2NdE+fOTuM+pXnfM/r46CbfuE5f3fGU=";
|
||||
};
|
||||
|
||||
yarnBuildScript = "lerna";
|
||||
yarnBuildFlags = [
|
||||
"run"
|
||||
"build"
|
||||
"--scope"
|
||||
"gatsby-cli"
|
||||
"--include-dependencies"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
yarnConfigHook
|
||||
yarnBuildHook
|
||||
# Needed for executing package.json scripts
|
||||
nodejs
|
||||
findutils
|
||||
makeBinaryWrapper
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
patchShebangs packages/**/node_modules
|
||||
yarn run lerna run prepare --scope gatsby-cli --include-dependencies
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/lib/node_modules/
|
||||
mv packages/ $out/lib/packages/
|
||||
mv node_modules/* $out/lib/node_modules/
|
||||
|
||||
makeWrapper ${lib.getExe nodejs} $out/bin/gatsby \
|
||||
--add-flags $out/lib/packages/gatsby-cli/cli.js \
|
||||
--set NODE_PATH $out/lib/node_modules
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script {
|
||||
extraArgs = [
|
||||
"--version-regex"
|
||||
"'gatsby-cli@(.*)'"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/gatsbyjs/gatsby/releases/tag/gatsby%2540${finalAttrs.version}";
|
||||
description = "The Gatsby command line interface";
|
||||
homepage = "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-cli#readme";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ pyrox0 ];
|
||||
mainProgram = "gatsby";
|
||||
};
|
||||
})
|
||||
@@ -114,6 +114,7 @@ mapAliases {
|
||||
inherit (pkgs) fixjson; # added 2024-06-26
|
||||
flood = pkgs.flood; # Added 2023-07-25
|
||||
ganache = throw "ganache was removed because it was deprecated upstream"; # added 2024-12-02
|
||||
inherit (pkgs) gatsby-cli; # Added 2025-11-05
|
||||
generator-code = throw "generator-code was removed because it provides no executable"; # added 2023-09-24
|
||||
inherit (pkgs) git-run; # added 2024-06-26
|
||||
git-ssb = throw "git-ssb was removed because it was broken"; # added 2023-08-21
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
, "fleek-cli"
|
||||
, "forever"
|
||||
, "fx"
|
||||
, "gatsby-cli"
|
||||
, "grunt-cli"
|
||||
, "makam"
|
||||
, "gulp-cli"
|
||||
|
||||
-986
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user