about summary refs log tree commit diff
path: root/pkgs/by-name/te
diff options
context:
space:
mode:
authornatsukium <tomoya.otabi@gmail.com>2024-05-17 10:58:53 +0900
committernatsukium <tomoya.otabi@gmail.com>2024-05-18 01:04:51 +0900
commit2aaa9011e18c5db23360cff91d6cdc6055dc73ef (patch)
tree7ede68a4a4f74cc6ae7f3400c6dc72ec68a5e418 /pkgs/by-name/te
parent8fc1968cb284d6d824a468a617de3ff5946f811d (diff)
textlint-rule-unexpanded-acronym: repackage with fetchYarnDeps
Diffstat (limited to 'pkgs/by-name/te')
-rw-r--r--pkgs/by-name/te/textlint-rule-unexpanded-acronym/package.nix79
-rw-r--r--pkgs/by-name/te/textlint-rule-unexpanded-acronym/test.md1
-rw-r--r--pkgs/by-name/te/textlint/package.nix2
3 files changed, 82 insertions, 0 deletions
diff --git a/pkgs/by-name/te/textlint-rule-unexpanded-acronym/package.nix b/pkgs/by-name/te/textlint-rule-unexpanded-acronym/package.nix
new file mode 100644
index 0000000000000..a0a7cc87bff04
--- /dev/null
+++ b/pkgs/by-name/te/textlint-rule-unexpanded-acronym/package.nix
@@ -0,0 +1,79 @@
+{
+  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;
+  };
+})
diff --git a/pkgs/by-name/te/textlint-rule-unexpanded-acronym/test.md b/pkgs/by-name/te/textlint-rule-unexpanded-acronym/test.md
new file mode 100644
index 0000000000000..06b7ca62cea5e
--- /dev/null
+++ b/pkgs/by-name/te/textlint-rule-unexpanded-acronym/test.md
@@ -0,0 +1 @@
+Passing an expression `expr` that evaluates to a store path to any built-in function which reads from the filesystem constitutes IFD.
diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix
index a389b5fd4e3fe..7087ad4145a50 100644
--- a/pkgs/by-name/te/textlint/package.nix
+++ b/pkgs/by-name/te/textlint/package.nix
@@ -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
       ]
     );