diff --git a/pkgs/by-name/te/textlint-rule-preset-ja-spacing/package.nix b/pkgs/by-name/te/textlint-rule-preset-ja-spacing/package.nix new file mode 100644 index 000000000000..777b25fbdf9f --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-preset-ja-spacing/package.nix @@ -0,0 +1,68 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchYarnDeps, + nodejs, + yarnBuildHook, + yarnConfigHook, + textlint, + textlint-rule-preset-ja-spacing, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "textlint-rule-preset-ja-spacing"; + version = "2.4.3"; + + src = fetchFromGitHub { + owner = "textlint-ja"; + repo = "textlint-rule-preset-ja-spacing"; + tag = "v${finalAttrs.version}"; + hash = "sha256-M27qhjIHMcKbuPAh523Pi5IB5BD0VWawh84kUyLcKvg="; + }; + + offlineCache = fetchYarnDeps { + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-AfbYACqYBvfsKzhryQabXQQmera19N/UH67sR5kbihM="; + }; + + nativeBuildInputs = [ + nodejs + yarnBuildHook + yarnConfigHook + ]; + + installPhase = '' + runHook preInstall + + yarn install \ + --force \ + --frozen-lockfile \ + --ignore-engines \ + --ignore-platform \ + --ignore-scripts \ + --no-progress \ + --non-interactive \ + --offline \ + --production=true + + mkdir -p $out/lib + cp -r . $out/lib + + runHook postInstall + ''; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-preset-ja-spacing; + testFile = ./test.md; + }; + + meta = { + description = "スペース周りのスタイルを扱うtextlintルールプリセット"; + homepage = "https://github.com/textlint-ja/textlint-rule-preset-ja-spacing"; + changelog = "https://github.com/textlint-ja/textlint-rule-preset-ja-spacing/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + platforms = textlint.meta.platforms; + }; +}) diff --git a/pkgs/by-name/te/textlint-rule-preset-ja-spacing/test.md b/pkgs/by-name/te/textlint-rule-preset-ja-spacing/test.md new file mode 100644 index 000000000000..5f373dd916b6 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-preset-ja-spacing/test.md @@ -0,0 +1 @@ +Nix は純粋関数型パッケージマネージャーです。 diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index d6ae834c533b..1b126c2a823c 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -18,6 +18,7 @@ textlint-rule-max-comma, textlint-rule-no-start-duplicated-conjunction, textlint-rule-period-in-list-item, + textlint-rule-preset-ja-spacing, textlint-rule-preset-ja-technical-writing, textlint-rule-prh, textlint-rule-stop-words, @@ -124,6 +125,7 @@ buildNpmPackage rec { textlint-rule-max-comma textlint-rule-no-start-duplicated-conjunction textlint-rule-period-in-list-item + textlint-rule-preset-ja-spacing textlint-rule-preset-ja-technical-writing textlint-rule-prh textlint-rule-stop-words