Unverified Commit 950ff0df authored by natsukium's avatar natsukium
Browse files

textlint-rule-no-start-duplicated-conjunction: repackage with fetchYarnDeps

parent 1e813266
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-no-start-duplicated-conjunction,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "textlint-rule-no-start-duplicated-conjunction";
  version = "2.0.2";

  src = fetchFromGitHub {
    owner = "textlint-rule";
    repo = "textlint-rule-no-start-duplicated-conjunction";
    rev = "refs/tags/${finalAttrs.version}";
    hash = "sha256-DtuCkHy440j2VI/JDJGrW2M8alQ8pxllfIZfB4+9z3U=";
  };

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

  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-no-start-duplicated-conjunction
    cp -r . $out/lib/node_modules/textlint-rule-no-start-duplicated-conjunction/

    runHook postInstall
  '';

  passthru.tests = textlint.testPackages {
    rule = textlint-rule-no-start-duplicated-conjunction;
    testFile = ./test.md;
  };

  meta = {
    description = "Textlint rule that check no start with duplicated conjunction";
    homepage = "https://github.com/textlint-rule/textlint-rule-no-start-duplicated-conjunction";
    changelog = "https://github.com/textlint-rule/textlint-rule-no-start-duplicated-conjunction/releases/tag/${finalAttrs.src.rev}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ natsukium ];
    platforms = textlint.meta.platforms;
  };
})
+3 −0
Original line number Diff line number Diff line
But, A is ~.
So, A is ~.
But, A is ~.
+2 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
  textlint-rule-diacritics,
  textlint-rule-en-max-word-count,
  textlint-rule-max-comma,
  textlint-rule-no-start-duplicated-conjunction,
  textlint-rule-period-in-list-item,
  textlint-rule-preset-ja-technical-writing,
  textlint-rule-stop-words,
@@ -111,6 +112,7 @@ buildNpmPackage rec {
        textlint-rule-diacritics
        textlint-rule-en-max-word-count
        textlint-rule-max-comma
        textlint-rule-no-start-duplicated-conjunction
        textlint-rule-period-in-list-item
        textlint-rule-preset-ja-technical-writing
        textlint-rule-stop-words
+1 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ mapAliases {
  inherit (pkgs) textlint-rule-diacritics; # Added 2024-05-16
  inherit (pkgs) textlint-rule-en-max-word-count; # Added 2024-05-17
  inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15
  inherit (pkgs) textlint-rule-no-start-duplicated-conjunction; # Added 2024-05-17
  inherit (pkgs) textlint-rule-period-in-list-item; # Added 2024-05-17
  inherit (pkgs) textlint-rule-stop-words; # Added 2024-05-17
  inherit (pkgs) textlint-rule-terminology; # Added 2024-05-17
+0 −1
Original line number Diff line number Diff line
@@ -222,7 +222,6 @@
, "teck-programmer"
, "tern"
, "textlint-rule-common-misspellings"
, "textlint-rule-no-start-duplicated-conjunction"
, "thelounge-plugin-closepms"
, "thelounge-plugin-giphy"
, "thelounge-plugin-shortcuts"
Loading