blob: 71df968a3d7962443acfb198f461e53e8425561a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
{ lib
, buildNpmPackage
, fetchFromGitHub
, makeWrapper
, redocly
, testers
}:
buildNpmPackage rec {
pname = "redocly";
version = "1.17.0";
src = fetchFromGitHub {
owner = "Redocly";
repo = "redocly-cli";
rev = "@redocly/cli@${version}";
hash = "sha256-6aPNgqem3nG+rPJmxMyjqYPm5mE+93h/uXKCuiUeLxI=";
};
npmDepsHash = "sha256-J+nlY+FKZqwhj4JyuyReW/UoAMX/eouuOAZ2WCzW2VA=";
npmBuildScript = "prepare";
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
npm --prefix packages/cli run copy-assets
'';
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 \
--set-default REDOCLY_TELEMETRY off \
--set-default CI true # Silence update messages
# Symlink for backwards compatibility. Remove after 24.05.
ln -s $out/bin/redocly $out/bin/redocly-cli
'';
passthru = {
tests.version = testers.testVersion {
package = redocly;
};
};
meta = {
changelog = "https://redocly.com/docs/cli/changelog/";
description = "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";
maintainers = with lib.maintainers; [ szlend ];
};
}
|