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

This commit is contained in:
natsukium 2024-05-17 21:17:14 +09:00
parent e242a02edc
commit 1e81326637
No known key found for this signature in database
GPG Key ID: 9EA45A31DB994C53
6 changed files with 83 additions and 39 deletions

View File

@ -0,0 +1,79 @@
{
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;
};
})

View File

@ -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(Import From Derivation).

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -93160,44 +93160,6 @@ in
bypassCache = true;
reconstructLock = true;
};
textlint-rule-abbr-within-parentheses = nodeEnv.buildNodePackage {
name = "textlint-rule-abbr-within-parentheses";
packageName = "textlint-rule-abbr-within-parentheses";
version = "1.0.2";
src = fetchurl {
url = "https://registry.npmjs.org/textlint-rule-abbr-within-parentheses/-/textlint-rule-abbr-within-parentheses-1.0.2.tgz";
sha512 = "GcAtxXttLsZfN75tSCo3V8/RTlglvhnn7McNTgI0uS4ADr67RoD64bSVIs4p/nY3sMNsf1taPjKnhZIQLuVjZg==";
};
dependencies = [
sources."call-bind-1.0.7"
sources."define-data-property-1.1.4"
sources."define-properties-1.2.1"
sources."es-define-property-1.0.0"
sources."es-errors-1.3.0"
sources."function-bind-1.1.2"
sources."functions-have-names-1.2.3"
sources."get-intrinsic-1.2.4"
sources."gopd-1.0.1"
sources."has-property-descriptors-1.0.2"
sources."has-proto-1.0.3"
sources."has-symbols-1.0.3"
sources."hasown-2.0.2"
sources."match-index-1.0.3"
sources."object-keys-1.1.1"
sources."regexp.prototype.flags-1.5.2"
sources."set-function-length-1.2.2"
sources."set-function-name-2.0.2"
];
buildInputs = globalBuildInputs;
meta = {
description = "textlint rule check that abbreviations within parentheses.";
homepage = "https://github.com/azu/textlint-rule-abbr-within-parentheses";
license = "MIT";
};
production = true;
bypassCache = true;
reconstructLock = true;
};
textlint-rule-common-misspellings = nodeEnv.buildNodePackage {
name = "textlint-rule-common-misspellings";
packageName = "textlint-rule-common-misspellings";