Unverified Commit 1e813266 authored by natsukium's avatar natsukium
Browse files

textlint-rule-abbr-within-parentheses: repackage with fetchYarnDeps

parent e242a02e
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-abbr-within-parentheses,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "textlint-rule-abbr-within-parentheses";
  version = "1.0.2";

  src = fetchFromGitHub {
    owner = "azu";
    repo = "textlint-rule-abbr-within-parentheses";
    rev = "refs/tags/${finalAttrs.version}";
    hash = "sha256-CBrf7WtvywDmtuSyxkDtAyjmrj7KS3TQLSsNfMxeWXw=";
  };

  offlineCache = fetchYarnDeps {
    yarnLock = "${finalAttrs.src}/yarn.lock";
    hash = "sha256-N4tnja6qTo7jtn7Dh4TwBUCUKfbIbHvdZ7aeJcE+NlU=";
  };

  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-abbr-within-parentheses
    cp -r . $out/lib/node_modules/textlint-rule-abbr-within-parentheses/

    runHook postInstall
  '';

  passthru.tests = textlint.testPackages {
    rule = textlint-rule-abbr-within-parentheses;
    testFile = ./test.md;
  };

  meta = {
    description = "Textlint rule check if write abbreviations within parentheses";
    homepage = "https://github.com/azu/textlint-rule-abbr-within-parentheses";
    changelog = "https://github.com/azu/textlint-rule-abbr-within-parentheses/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(Import From Derivation).
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
  runCommand,
  textlint,
  textlint-plugin-latex2e,
  textlint-rule-abbr-within-parentheses,
  textlint-rule-alex,
  textlint-rule-diacritics,
  textlint-rule-en-max-word-count,
@@ -105,6 +106,7 @@ buildNpmPackage rec {
    tests = lib.mergeAttrsList (
      map (package: package.tests) [
        textlint-plugin-latex2e
        textlint-rule-abbr-within-parentheses
        textlint-rule-alex
        textlint-rule-diacritics
        textlint-rule-en-max-word-count
+1 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ mapAliases {
  inherit (pkgs) terser; # Added 2023-08-31
  inherit (pkgs) textlint; # Added 2024-05-13
  textlint-plugin-latex = throw "textlint-plugin-latex was removed because it is unmaintained for years. Please use textlint-plugin-latex2e instead."; # Added 2024-05-17
  inherit (pkgs) textlint-rule-abbr-within-parentheses; # Added 2024-05-17
  inherit (pkgs) textlint-rule-alex; # Added 2024-05-16
  inherit (pkgs) textlint-rule-diacritics; # Added 2024-05-16
  inherit (pkgs) textlint-rule-en-max-word-count; # Added 2024-05-17
+0 −1
Original line number Diff line number Diff line
@@ -221,7 +221,6 @@
, "tailwindcss"
, "teck-programmer"
, "tern"
, "textlint-rule-abbr-within-parentheses"
, "textlint-rule-common-misspellings"
, "textlint-rule-no-start-duplicated-conjunction"
, "thelounge-plugin-closepms"
Loading