Merge pull request #272320 from szlend/redocly-cli

redocly-cli: init at 1.5.0
This commit is contained in:
Domen Kožar 2023-12-08 14:12:29 +01:00 committed by GitHub
commit 3c10c699b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{ lib
, buildNpmPackage
, fetchFromGitHub
, makeWrapper
}:
buildNpmPackage rec {
pname = "redocly-cli";
version = "1.5.0";
src = fetchFromGitHub {
owner = "Redocly";
repo = "redocly-cli";
rev = "@redocly/cli@${version}";
hash = "sha256-Wi3IxPeNqD1s1Q0Pi9cCus6jCQM0noBTHIAp9HUSpZk=";
};
npmDepsHash = "sha256-BcjQ9z2i1YBt6lBqgkRcv29P/WZeuGjVSeVmekaFugM=";
npmBuildScript = "prepare";
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
rm $out/lib/node_modules/@redocly/cli/node_modules/@redocly/{cli,openapi-core}
cp -R packages/cli $out/lib/node_modules/@redocly/cli/node_modules/@redocly/cli
cp -R packages/core $out/lib/node_modules/@redocly/cli/node_modules/@redocly/openapi-core
mkdir $out/bin
makeWrapper $out/lib/node_modules/@redocly/cli/node_modules/@redocly/cli/bin/cli.js $out/bin/redocly-cli --set REDOCLY_TELEMETRY off
'';
installCheckPhase = ''
runHook preInstallCheck
$out/bin/redocly-cli --version
runHook postInstallCheck
'';
doInstallCheck = true;
meta = {
description = "Redocly CLI makes OpenAPI easy. Lint/validate to any standard, generate beautiful docs, and more.";
homepage = "https://github.com/Redocly/redocly-cli";
license = lib.licenses.mit;
mainProgram = "redocly-cli";
maintainers = with lib.maintainers; [ szlend ];
};
}

View file

@ -30,5 +30,7 @@ buildNpmPackage rec {
license = lib.licenses.mit;
mainProgram = "redoc-cli";
maintainers = with lib.maintainers; [ veehaitch ];
# https://github.com/NixOS/nixpkgs/issues/272217
broken = true;
};
}