Unverified Commit 2aaa9011 authored by natsukium's avatar natsukium
Browse files

textlint-rule-unexpanded-acronym: repackage with fetchYarnDeps

parent 8fc1968c
Loading
Loading
Loading
Loading
+79 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  fetchYarnDeps,
  fixup-yarn-lock,
  nodejs,
  yarn,
  textlint,
  textlint-rule-unexpanded-acronym,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "textlint-rule-unexpanded-acronym";
  version = "1.2.4";

  src = fetchFromGitHub {
    owner = "textlint-rule";
    repo = "textlint-rule-unexpanded-acronym";
    rev = "refs/tags/${finalAttrs.version}";
    hash = "sha256-oUOofYfdENRQnwmBDADQgA1uGtRirqqGg8T+QA0LCXY=";
  };

  offlineCache = fetchYarnDeps {
    yarnLock = "${finalAttrs.src}/yarn.lock";
    hash = "sha256-90ZONfn7CnrCsYGliF+c7Ss+SgVmaCYnaVdq3s1HdJU=";
  };

  nativeBuildInputs = [
    fixup-yarn-lock
    nodejs
    yarn
  ];

  configurePhase = ''
    runHook preConfigure

    export HOME=$(mktemp -d)
    yarn config --offline set yarn-offline-mirror "$offlineCache"
    fixup-yarn-lock yarn.lock
    yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
    patchShebangs node_modules

    runHook postConfigure
  '';

  buildPhase = ''
    runHook preBuild

    yarn --offline build

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    yarn --offline --production install
    rm -r test
    mkdir -p $out/lib/node_modules/textlint-rule-unexpanded-acronym
    cp -r . $out/lib/node_modules/textlint-rule-unexpanded-acronym/

    runHook postInstall
  '';

  passthru.tests = textlint.testPackages {
    rule = textlint-rule-unexpanded-acronym;
    testFile = ./test.md;
  };

  meta = {
    description = "Textlint rule that check unexpanded acronym";
    homepage = "https://github.com/textlint-rule/textlint-rule-unexpanded-acronym";
    changelog = "https://github.com/textlint-rule/textlint-rule-unexpanded-acronym/releases/tag/${finalAttrs.src.rev}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ natsukium ];
    platforms = textlint.meta.platforms;
  };
})
+1 −0
Original line number Diff line number Diff line
Passing an expression `expr` that evaluates to a store path to any built-in function which reads from the filesystem constitutes IFD.
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
  textlint-rule-preset-ja-technical-writing,
  textlint-rule-stop-words,
  textlint-rule-terminology,
  textlint-rule-unexpanded-acronym,
  textlint-rule-write-good,
}:

@@ -110,6 +111,7 @@ buildNpmPackage rec {
        textlint-rule-preset-ja-technical-writing
        textlint-rule-stop-words
        textlint-rule-terminology
        textlint-rule-unexpanded-acronym
        textlint-rule-write-good
      ]
    );
+1 −0
Original line number Diff line number Diff line
@@ -144,6 +144,7 @@ mapAliases {
  inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15
  inherit (pkgs) textlint-rule-stop-words; # Added 2024-05-17
  inherit (pkgs) textlint-rule-terminology; # Added 2024-05-17
  inherit (pkgs) textlint-rule-unexpanded-acronym; # Added 2024-05-17
  inherit (pkgs) textlint-rule-write-good; # Added 2024-05-16
  thelounge = pkgs.thelounge; # Added 2023-05-22
  three = throw "three was removed because it was no longer needed"; # Added 2023-09-08
+0 −1
Original line number Diff line number Diff line
@@ -225,7 +225,6 @@
, "textlint-rule-common-misspellings"
, "textlint-rule-no-start-duplicated-conjunction"
, "textlint-rule-period-in-list-item"
, "textlint-rule-unexpanded-acronym"
, "thelounge-plugin-closepms"
, "thelounge-plugin-giphy"
, "thelounge-plugin-shortcuts"
Loading