From 5d1ad253933435d4bd7e0797c72f85b668817edb Mon Sep 17 00:00:00 2001 From: natsukium Date: Mon, 13 May 2024 22:12:38 +0900 Subject: [PATCH 01/18] textlint: repackage with buildNpmPackage (cherry picked from commit f1a746de733107227e2492320801ad7a3f6acd6f) --- pkgs/by-name/te/textlint/package.nix | 59 +++++ .../te/textlint/remove-workspaces.patch | 19 ++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 212 ------------------ 5 files changed, 79 insertions(+), 213 deletions(-) create mode 100644 pkgs/by-name/te/textlint/package.nix create mode 100644 pkgs/by-name/te/textlint/remove-workspaces.patch diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix new file mode 100644 index 000000000000..a15277831c2a --- /dev/null +++ b/pkgs/by-name/te/textlint/package.nix @@ -0,0 +1,59 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, + autoconf, + automake, +}: + +buildNpmPackage rec { + pname = "textlint"; + version = "14.0.4"; + + src = fetchFromGitHub { + owner = "textlint"; + repo = "textlint"; + rev = "refs/tags/v${version}"; + hash = "sha256-u8BRzfvpZ8xggJwH8lsu+hqsql6s4SZVlkFzLBe6zvE="; + }; + + patches = [ + # this package uses lerna and requires building many workspaces. + # this patch removes unnecessary workspaces, + # reducing package size and build time. + ./remove-workspaces.patch + ]; + + npmDepsHash = "sha256-rmRtCP51rt/wd/ef0iwMMI6eCGF1KNN7kJqomitMJ+w="; + + nativeBuildInputs = [ + autoconf + automake + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,lib} + + npm prune --omit=dev --no-save + rm -r node_modules/.cache + rm -r packages/textlint-{scripts,tester} + rm -r packages/@textlint/*/test + + cp -r node_modules $out/lib + cp -r packages $out/lib + ln -s $out/lib/node_modules/textlint/bin/textlint.js $out/bin/textlint + + runHook postInstall + ''; + + meta = { + description = "The pluggable natural language linter for text and markdown"; + homepage = "https://github.com/textlint/textlint"; + changelog = "https://github.com/textlint/textlint/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + mainProgram = "textlint"; + }; +} diff --git a/pkgs/by-name/te/textlint/remove-workspaces.patch b/pkgs/by-name/te/textlint/remove-workspaces.patch new file mode 100644 index 000000000000..3e949e7906de --- /dev/null +++ b/pkgs/by-name/te/textlint/remove-workspaces.patch @@ -0,0 +1,19 @@ +diff --git a/package.json b/package.json +index 9dd7fdc6..c5e74f88 100644 +--- a/package.json ++++ b/package.json +@@ -56,12 +56,8 @@ + "trailingComma": "none" + }, + "workspaces": [ +- "packages/*", +- "examples/*", +- "packages/@textlint/*", +- "packages/textlint-scripts/examples/*", +- "test/*", +- "website" ++ "packages/textlint", ++ "packages/@textlint/*" + ], + "packageManager": "npm@9.9.2" + } diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 64708d8ffd92..26a0e604791d 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -136,6 +136,7 @@ mapAliases { swagger = throw "swagger was removed because it was broken and abandoned upstream"; # added 2023-09-09 tedicross = throw "tedicross was removed because it was broken"; # added 2023-09-09 inherit (pkgs) terser; # Added 2023-08-31 + inherit (pkgs) textlint; # Added 2024-05-13 thelounge = pkgs.thelounge; # Added 2023-05-22 three = throw "three was removed because it was no longer needed"; # Added 2023-09-08 inherit (pkgs) titanium; # added 2023-08-17 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index c0d021e9f472..c3054acbb98a 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -221,7 +221,6 @@ , "tailwindcss" , "teck-programmer" , "tern" -, "textlint" , "textlint-plugin-latex" , "textlint-rule-abbr-within-parentheses" , "textlint-rule-alex" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 9b498be3b7fa..16a93d37b27c 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93160,218 +93160,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint = nodeEnv.buildNodePackage { - name = "textlint"; - packageName = "textlint"; - version = "14.0.4"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint/-/textlint-14.0.4.tgz"; - sha512 = "xPQkC/BftPjizjs31wci/791EjwfN11iRLrNKiPVBogYd1r+6TnSxbCERZhgXCGcD9tEHss0kOYc0+vPEEG8jg=="; - }; - dependencies = [ - sources."@aashutoshrathi/word-wrap-1.2.6" - sources."@azu/format-text-1.0.2" - sources."@azu/style-format-1.0.1" - sources."@textlint/ast-node-types-14.0.4" - sources."@textlint/ast-tester-14.0.4" - sources."@textlint/ast-traverse-14.0.4" - sources."@textlint/config-loader-14.0.4" - sources."@textlint/feature-flag-14.0.4" - sources."@textlint/fixer-formatter-14.0.4" - sources."@textlint/kernel-14.0.4" - sources."@textlint/linter-formatter-14.0.4" - sources."@textlint/markdown-to-ast-14.0.4" - sources."@textlint/module-interop-14.0.4" - sources."@textlint/source-code-fixer-14.0.4" - sources."@textlint/text-to-ast-14.0.4" - sources."@textlint/textlint-plugin-markdown-14.0.4" - sources."@textlint/textlint-plugin-text-14.0.4" - sources."@textlint/types-14.0.4" - sources."@textlint/utils-14.0.4" - sources."@types/mdast-3.0.15" - sources."@types/unist-2.0.10" - sources."ajv-8.12.0" - sources."ansi-regex-5.0.1" - sources."ansi-styles-4.3.0" - sources."argparse-1.0.10" - sources."astral-regex-2.0.0" - sources."bail-1.0.5" - sources."balanced-match-1.0.2" - sources."boundary-2.0.0" - sources."brace-expansion-1.1.11" - sources."ccount-1.1.0" - sources."chalk-4.1.2" - sources."character-entities-1.2.4" - sources."character-entities-legacy-1.1.4" - sources."character-reference-invalid-1.1.4" - sources."charenc-0.0.2" - sources."color-convert-2.0.1" - sources."color-name-1.1.4" - sources."concat-map-0.0.1" - sources."crypt-0.0.2" - sources."debug-4.3.4" - sources."deep-is-0.1.4" - sources."diff-5.2.0" - sources."emoji-regex-8.0.0" - sources."error-ex-1.3.2" - sources."escape-string-regexp-4.0.0" - sources."esprima-4.0.1" - sources."extend-3.0.2" - sources."fast-deep-equal-3.1.3" - sources."fast-equals-4.0.3" - sources."fast-levenshtein-2.0.6" - sources."fault-1.0.4" - sources."file-entry-cache-5.0.1" - sources."find-up-2.1.0" - sources."flat-cache-2.0.1" - sources."flatted-2.0.2" - sources."format-0.2.2" - sources."fs.realpath-1.0.0" - sources."function-bind-1.1.2" - sources."get-stdin-5.0.1" - sources."glob-7.2.3" - sources."graceful-fs-4.2.11" - sources."has-flag-4.0.0" - sources."hasown-2.0.2" - sources."hosted-git-info-2.8.9" - sources."inflight-1.0.6" - sources."inherits-2.0.4" - sources."is-alphabetical-1.0.4" - sources."is-alphanumerical-1.0.4" - sources."is-arrayish-0.2.1" - sources."is-buffer-2.0.5" - sources."is-core-module-2.13.1" - sources."is-decimal-1.0.4" - sources."is-fullwidth-code-point-3.0.0" - sources."is-hexadecimal-1.0.4" - sources."is-plain-obj-2.1.0" - sources."is-utf8-0.2.1" - sources."js-yaml-3.14.1" - sources."json-parse-better-errors-1.0.2" - sources."json-schema-traverse-1.0.0" - sources."json5-2.2.3" - sources."levn-0.4.1" - sources."load-json-file-1.1.0" - sources."locate-path-2.0.0" - sources."lodash-4.17.21" - sources."lodash.truncate-4.4.2" - sources."longest-streak-2.0.4" - sources."markdown-table-2.0.0" - (sources."md5-2.3.0" // { - dependencies = [ - sources."is-buffer-1.1.6" - ]; - }) - sources."mdast-util-find-and-replace-1.1.1" - sources."mdast-util-footnote-0.1.7" - sources."mdast-util-from-markdown-0.8.5" - sources."mdast-util-frontmatter-0.2.0" - sources."mdast-util-gfm-0.1.2" - sources."mdast-util-gfm-autolink-literal-0.1.3" - sources."mdast-util-gfm-strikethrough-0.2.3" - sources."mdast-util-gfm-table-0.1.6" - sources."mdast-util-gfm-task-list-item-0.1.6" - sources."mdast-util-to-markdown-0.6.5" - sources."mdast-util-to-string-2.0.0" - sources."micromark-2.11.4" - sources."micromark-extension-footnote-0.3.2" - sources."micromark-extension-frontmatter-0.2.2" - sources."micromark-extension-gfm-0.3.3" - sources."micromark-extension-gfm-autolink-literal-0.5.7" - sources."micromark-extension-gfm-strikethrough-0.6.5" - sources."micromark-extension-gfm-table-0.4.3" - sources."micromark-extension-gfm-tagfilter-0.3.0" - sources."micromark-extension-gfm-task-list-item-0.3.3" - sources."minimatch-3.1.2" - sources."minimist-1.2.8" - sources."mkdirp-0.5.6" - sources."ms-2.1.2" - sources."normalize-package-data-2.5.0" - sources."once-1.4.0" - sources."optionator-0.9.3" - sources."p-limit-1.3.0" - sources."p-locate-2.0.0" - sources."p-try-1.0.0" - sources."parse-entities-2.0.0" - sources."parse-json-2.2.0" - sources."path-exists-3.0.0" - sources."path-is-absolute-1.0.1" - sources."path-parse-1.0.7" - sources."path-to-glob-pattern-2.0.1" - sources."path-type-1.1.0" - sources."pify-2.3.0" - sources."pinkie-2.0.4" - sources."pinkie-promise-2.0.1" - sources."pluralize-2.0.0" - sources."prelude-ls-1.2.1" - sources."punycode-2.3.1" - (sources."rc-config-loader-4.1.3" // { - dependencies = [ - sources."argparse-2.0.1" - sources."js-yaml-4.1.0" - ]; - }) - sources."read-pkg-1.1.0" - (sources."read-pkg-up-3.0.0" // { - dependencies = [ - sources."load-json-file-4.0.0" - sources."parse-json-4.0.0" - sources."path-type-3.0.0" - sources."pify-3.0.0" - sources."read-pkg-3.0.0" - sources."strip-bom-3.0.0" - ]; - }) - sources."remark-footnotes-3.0.0" - sources."remark-frontmatter-3.0.0" - sources."remark-gfm-1.0.0" - sources."remark-parse-9.0.0" - sources."repeat-string-1.6.1" - sources."require-from-string-2.0.2" - sources."resolve-1.22.8" - sources."rimraf-2.6.3" - sources."semver-5.7.2" - sources."slice-ansi-4.0.0" - sources."spdx-correct-3.2.0" - sources."spdx-exceptions-2.5.0" - sources."spdx-expression-parse-3.0.1" - sources."spdx-license-ids-3.0.17" - sources."sprintf-js-1.0.3" - sources."string-width-4.2.3" - sources."strip-ansi-6.0.1" - sources."strip-bom-2.0.0" - sources."structured-source-4.0.0" - sources."supports-color-7.2.0" - sources."supports-preserve-symlinks-flag-1.0.0" - sources."table-6.8.1" - sources."text-table-0.2.0" - sources."traverse-0.6.8" - sources."trough-1.0.5" - sources."try-resolve-1.0.1" - sources."type-check-0.4.0" - sources."unified-9.2.2" - sources."unique-concat-0.2.2" - sources."unist-util-is-4.1.0" - sources."unist-util-stringify-position-2.0.3" - sources."unist-util-visit-parents-3.1.1" - sources."uri-js-4.4.1" - sources."validate-npm-package-license-3.0.4" - sources."vfile-4.2.1" - sources."vfile-message-2.0.4" - sources."wrappy-1.0.2" - sources."write-1.0.3" - sources."zwitch-1.0.5" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "The pluggable linting tool for text and markdown."; - homepage = "https://github.com/textlint/textlint/"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; textlint-plugin-latex = nodeEnv.buildNodePackage { name = "textlint-plugin-latex"; packageName = "textlint-plugin-latex"; From d25bcd6bda9676e88dae48794f8b084c15e0e09d Mon Sep 17 00:00:00 2001 From: natsukium Date: Mon, 13 May 2024 22:28:09 +0900 Subject: [PATCH 02/18] textlint: make textlint pluggable with passthru.withPackages textlint isn't useful without rules and plugins. This change will allow to provide a wrapper that can use them, using `textlint.withPackages [ xxx ]` like the Python environment. (cherry picked from commit cd59be301d5c005db23c8499cdcd358849983542) --- pkgs/by-name/te/textlint/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index a15277831c2a..b4270876f41b 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -4,6 +4,9 @@ fetchFromGitHub, autoconf, automake, + makeWrapper, + runCommand, + textlint, }: buildNpmPackage rec { @@ -48,6 +51,15 @@ buildNpmPackage rec { runHook postInstall ''; + passthru = { + withPackages = + ps: + runCommand "textlint-with-packages" { nativeBuildInputs = [ makeWrapper ]; } '' + makeWrapper ${textlint}/bin/textlint $out/bin/textlint \ + --set NODE_PATH ${lib.makeSearchPath "lib/node_modules" ps} + ''; + }; + meta = { description = "The pluggable natural language linter for text and markdown"; homepage = "https://github.com/textlint/textlint"; From 78b139ef58fc5a9787b6ef1a9e8d8750e63d733f Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 18 May 2024 00:51:25 +0900 Subject: [PATCH 03/18] textlint: add test utility (cherry picked from commit 68c7f8e5ab16d76a6010d1af0cfd0e5390467ab1) --- pkgs/by-name/te/textlint/package.nix | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index b4270876f41b..a13330829425 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -58,6 +58,38 @@ buildNpmPackage rec { makeWrapper ${textlint}/bin/textlint $out/bin/textlint \ --set NODE_PATH ${lib.makeSearchPath "lib/node_modules" ps} ''; + + testPackages = + { + rule, + testFile, + pname ? rule.pname, + plugin ? null, + }: + let + ruleName = lib.removePrefix "textlint-rule-" rule.pname; + isPreset = lib.hasPrefix "preset-" ruleName; + ruleName' = lib.removePrefix "preset-" ruleName; + pluginName = lib.removePrefix "textlint-plugin-" plugin.pname; + args = + "${testFile} ${if isPreset then "--preset" else "--rule"} ${ruleName'}" + + lib.optionalString (plugin != null) " --plugin ${pluginName}"; + in + { + "${pname}-test" = + runCommand "${pname}-test" + { + nativeBuildInputs = [ + (textlint.withPackages [ + rule + plugin + ]) + ]; + } + '' + grep ${ruleName'} <(textlint ${args}) > $out + ''; + }; }; meta = { From d666c6e82d813c61fc7ef7888513b3bc00488813 Mon Sep 17 00:00:00 2001 From: natsukium Date: Mon, 13 May 2024 22:29:53 +0900 Subject: [PATCH 04/18] textlint-rule-preset-ja-technical-writing: init at 10.0.1 (cherry picked from commit f26194c4f163d1835d134d1e4b8e1f869d1bab32) --- .../package.nix | 72 +++++++++++++++++++ .../test.md | 1 + pkgs/by-name/te/textlint/package.nix | 7 ++ 3 files changed, 80 insertions(+) create mode 100644 pkgs/by-name/te/textlint-rule-preset-ja-technical-writing/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-preset-ja-technical-writing/test.md diff --git a/pkgs/by-name/te/textlint-rule-preset-ja-technical-writing/package.nix b/pkgs/by-name/te/textlint-rule-preset-ja-technical-writing/package.nix new file mode 100644 index 000000000000..2123a088feb6 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-preset-ja-technical-writing/package.nix @@ -0,0 +1,72 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchYarnDeps, + fixup-yarn-lock, + nodejs, + yarn, + textlint, + textlint-rule-preset-ja-technical-writing, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "textlint-rule-preset-ja-technical-writing"; + version = "10.0.1"; + + src = fetchFromGitHub { + owner = "textlint-ja"; + repo = "textlint-rule-preset-ja-technical-writing"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-8KoP/JagMf2kFxz8hr9e0hJH7yPukRURb48v0nPkC/8="; + }; + + offlineCache = fetchYarnDeps { + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-jm+8XK1E60D1AgYBnlKL0fkAWnn68z2PhCK7T/XbUgk="; + }; + + nativeBuildInputs = [ + nodejs + fixup-yarn-lock + 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 + ''; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + yarn --offline --production install + mkdir -p $out/lib/node_modules/textlint-rule-preset-ja-technical-writing + cp -r . $out/lib/node_modules/textlint-rule-preset-ja-technical-writing + + runHook postInstall + ''; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-preset-ja-technical-writing; + testFile = ./test.md; + }; + + meta = { + description = "技術文書向けのtextlintルールプリセット"; + homepage = "https://github.com/textlint-ja/textlint-rule-preset-ja-technical-writing"; + changelog = "https://github.com/textlint-ja/textlint-rule-preset-ja-technical-writing/blob/${finalAttrs.src.rev}/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-technical-writing/test.md b/pkgs/by-name/te/textlint-rule-preset-ja-technical-writing/test.md new file mode 100644 index 000000000000..880cf56c5dd2 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-preset-ja-technical-writing/test.md @@ -0,0 +1 @@ +ニックスはいいぞ diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index a13330829425..66802e8a84fc 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -7,6 +7,7 @@ makeWrapper, runCommand, textlint, + textlint-rule-preset-ja-technical-writing, }: buildNpmPackage rec { @@ -90,6 +91,12 @@ buildNpmPackage rec { grep ${ruleName'} <(textlint ${args}) > $out ''; }; + + tests = lib.mergeAttrsList ( + map (package: package.tests) [ + textlint-rule-preset-ja-technical-writing + ] + ); }; meta = { From a065c440139b12891898a65a9d815c5872cc38ca Mon Sep 17 00:00:00 2001 From: natsukium Date: Wed, 15 May 2024 01:30:05 +0900 Subject: [PATCH 05/18] textlint-rule-max-comma: repackage with fetchYarnDeps (cherry picked from commit 95507da635c22e0c33b85ddfedb0e124d292588a) --- .../te/textlint-rule-max-comma/package.nix | 79 +++++++++++++++++++ .../te/textlint-rule-max-comma/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 + pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 46 ----------- 6 files changed, 83 insertions(+), 47 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-max-comma/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-max-comma/test.md diff --git a/pkgs/by-name/te/textlint-rule-max-comma/package.nix b/pkgs/by-name/te/textlint-rule-max-comma/package.nix new file mode 100644 index 000000000000..5afea41bd8c7 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-max-comma/package.nix @@ -0,0 +1,79 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchYarnDeps, + fixup-yarn-lock, + nodejs, + yarn, + textlint, + textlint-rule-max-comma, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "textlint-rule-max-comma"; + version = "4.0.0"; + + src = fetchFromGitHub { + owner = "textlint-rule"; + repo = "textlint-rule-max-comma"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-Sf7ehhEOcy1HdgnIra8darkucF6RebQQV/NfJtft/DA="; + }; + + offlineCache = fetchYarnDeps { + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-jSsVQhvmc5mJ1gh6I5UaLvdz+HpaXI0fXFX0KCh01/c="; + }; + + 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-max-comma + cp -r . $out/lib/node_modules/textlint-rule-max-comma/ + + runHook postInstall + ''; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-max-comma; + testFile = ./test.md; + }; + + meta = { + description = "Textlint rule is that limit maximum comma(,) count of sentence"; + homepage = "https://github.com/textlint-rule/textlint-rule-max-comma"; + changelog = "https://github.com/textlint-rule/textlint-rule-max-comma/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-max-comma/test.md b/pkgs/by-name/te/textlint-rule-max-comma/test.md new file mode 100644 index 000000000000..9223245ad977 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-max-comma/test.md @@ -0,0 +1 @@ +Nix, is a tool, that takes a unique approach to package management and system configuration, Learn how to make reproducible, declarative, and reliable systems. diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 66802e8a84fc..833a525f679c 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -7,6 +7,7 @@ makeWrapper, runCommand, textlint, + textlint-rule-max-comma, textlint-rule-preset-ja-technical-writing, }: @@ -94,6 +95,7 @@ buildNpmPackage rec { tests = lib.mergeAttrsList ( map (package: package.tests) [ + textlint-rule-max-comma textlint-rule-preset-ja-technical-writing ] ); diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 26a0e604791d..21743b72f1ce 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -137,6 +137,7 @@ mapAliases { tedicross = throw "tedicross was removed because it was broken"; # added 2023-09-09 inherit (pkgs) terser; # Added 2023-08-31 inherit (pkgs) textlint; # Added 2024-05-13 + inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15 thelounge = pkgs.thelounge; # Added 2023-05-22 three = throw "three was removed because it was no longer needed"; # Added 2023-09-08 inherit (pkgs) titanium; # added 2023-08-17 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index c3054acbb98a..0b0e5f17dfcb 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -227,7 +227,6 @@ , "textlint-rule-common-misspellings" , "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-stop-words" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 16a93d37b27c..58f2fe319502 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93867,52 +93867,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-max-comma = nodeEnv.buildNodePackage { - name = "textlint-rule-max-comma"; - packageName = "textlint-rule-max-comma"; - version = "4.0.0"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-max-comma/-/textlint-rule-max-comma-4.0.0.tgz"; - sha512 = "2vKKXNg1YuTqr9/FrHvOGEHFe+6lNSDtzuEv+KRB+tuaj++UNa/YPvyY34UdDYuHUSKNcYdto8GlIUhAJDW9WQ=="; - }; - dependencies = [ - sources."@textlint/ast-node-types-13.4.1" - sources."@types/unist-2.0.10" - sources."bail-1.0.5" - sources."boundary-2.0.0" - sources."ccount-1.1.0" - sources."comma-separated-tokens-1.0.8" - sources."extend-3.0.2" - sources."hast-util-from-parse5-5.0.3" - sources."hast-util-parse-selector-2.2.5" - sources."hastscript-5.1.2" - sources."is-buffer-2.0.5" - sources."is-plain-obj-2.1.0" - sources."parse5-5.1.1" - sources."property-information-5.6.0" - sources."rehype-parse-6.0.2" - sources."sentence-splitter-5.0.0" - sources."space-separated-tokens-1.1.5" - sources."structured-source-4.0.0" - sources."textlint-util-to-string-3.3.4" - sources."trough-1.0.5" - sources."unified-8.4.2" - sources."unist-util-stringify-position-2.0.3" - sources."vfile-4.2.1" - sources."vfile-message-2.0.4" - sources."web-namespaces-1.1.4" - sources."xtend-4.0.2" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "textlint rule that limit maxinum comma(,) count of sentence."; - homepage = "https://github.com/azu/textlint-rule-max-comma#readme"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; textlint-rule-no-start-duplicated-conjunction = nodeEnv.buildNodePackage { name = "textlint-rule-no-start-duplicated-conjunction"; packageName = "textlint-rule-no-start-duplicated-conjunction"; From 0a9de878b9902406fbb7d5788c0ed3ce9cd52b28 Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 16 May 2024 22:40:55 +0900 Subject: [PATCH 06/18] textlint-rule-alex: repackage with buildNpmPackage (cherry picked from commit e633e33303176f9d3e7349d82b04a38e544683ea) --- .../by-name/te/textlint-rule-alex/package.nix | 34 ++ pkgs/by-name/te/textlint-rule-alex/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 + pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 554 ------------------ 6 files changed, 38 insertions(+), 555 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-alex/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-alex/test.md diff --git a/pkgs/by-name/te/textlint-rule-alex/package.nix b/pkgs/by-name/te/textlint-rule-alex/package.nix new file mode 100644 index 000000000000..343cd6da8217 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-alex/package.nix @@ -0,0 +1,34 @@ +{ + lib, + fetchFromGitHub, + buildNpmPackage, + textlint, + textlint-rule-alex, +}: + +buildNpmPackage rec { + pname = "textlint-rule-alex"; + version = "5.0.0"; + + src = fetchFromGitHub { + owner = "textlint-rule"; + repo = "textlint-rule-alex"; + rev = "refs/tags/v${version}"; + hash = "sha256-1JoiUhiRXZWIyLAJXp5ZzFAa/NBCN79jYh5kMNbO0jI="; + }; + + npmDepsHash = "sha256-ovDDiOZ415ubyDqbLNggzoVuqUWsRlG3zlhRW6xU3SQ="; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-alex; + testFile = ./test.md; + }; + + meta = { + description = "Textlint rule for alex"; + homepage = "https://github.com/textlint-rule/textlint-rule-alex"; + changelog = "https://github.com/textlint-rule/textlint-rule-alex/releases/tag/${src.rev}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/by-name/te/textlint-rule-alex/test.md b/pkgs/by-name/te/textlint-rule-alex/test.md new file mode 100644 index 000000000000..1e9915c7abde --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-alex/test.md @@ -0,0 +1 @@ +A message for this sentence will pop up. diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 833a525f679c..8f43803f3494 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -7,6 +7,7 @@ makeWrapper, runCommand, textlint, + textlint-rule-alex, textlint-rule-max-comma, textlint-rule-preset-ja-technical-writing, }: @@ -95,6 +96,7 @@ buildNpmPackage rec { tests = lib.mergeAttrsList ( map (package: package.tests) [ + textlint-rule-alex textlint-rule-max-comma textlint-rule-preset-ja-technical-writing ] diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 21743b72f1ce..e74265ca30d2 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -137,6 +137,7 @@ mapAliases { tedicross = throw "tedicross was removed because it was broken"; # added 2023-09-09 inherit (pkgs) terser; # Added 2023-08-31 inherit (pkgs) textlint; # Added 2024-05-13 + inherit (pkgs) textlint-rule-alex; # Added 2024-05-16 inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15 thelounge = pkgs.thelounge; # Added 2023-05-22 three = throw "three was removed because it was no longer needed"; # Added 2023-09-08 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 0b0e5f17dfcb..e0953523fb4c 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -223,7 +223,6 @@ , "tern" , "textlint-plugin-latex" , "textlint-rule-abbr-within-parentheses" -, "textlint-rule-alex" , "textlint-rule-common-misspellings" , "textlint-rule-diacritics" , "textlint-rule-en-max-word-count" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 58f2fe319502..dac497d965a0 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93220,560 +93220,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-alex = nodeEnv.buildNodePackage { - name = "textlint-rule-alex"; - packageName = "textlint-rule-alex"; - version = "5.0.0"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-alex/-/textlint-rule-alex-5.0.0.tgz"; - sha512 = "8HkUNY0HezGhzQbIMPvZBVdjKIkJ3Wqi29sSMM4Pc89Hdvcpn9Yr8YQoZi/mFn/njSKm/3AYtKoIMx4ziKDDqg=="; - }; - dependencies = [ - sources."@babel/code-frame-7.23.5" - sources."@babel/helper-validator-identifier-7.22.20" - sources."@babel/highlight-7.23.4" - sources."@isaacs/cliui-8.0.2" - sources."@npmcli/config-6.4.1" - (sources."@npmcli/map-workspaces-3.0.4" // { - dependencies = [ - sources."glob-10.3.10" - sources."minimatch-9.0.3" - ]; - }) - sources."@npmcli/name-from-folder-2.0.0" - sources."@pnpm/config.env-replace-1.1.0" - (sources."@pnpm/network.ca-file-1.0.2" // { - dependencies = [ - sources."graceful-fs-4.2.10" - ]; - }) - sources."@pnpm/npm-conf-2.2.2" - sources."@sindresorhus/is-5.6.0" - sources."@szmarczak/http-timer-5.0.1" - sources."@textlint/ast-node-types-13.4.1" - sources."@types/acorn-4.0.6" - sources."@types/concat-stream-2.0.3" - sources."@types/debug-4.1.12" - sources."@types/estree-1.0.5" - sources."@types/estree-jsx-1.0.5" - sources."@types/hast-2.3.10" - sources."@types/http-cache-semantics-4.0.4" - sources."@types/is-empty-1.2.3" - sources."@types/mdast-3.0.15" - sources."@types/minimist-1.2.5" - sources."@types/ms-0.7.34" - sources."@types/nlcst-1.0.4" - sources."@types/node-18.19.25" - sources."@types/normalize-package-data-2.4.4" - sources."@types/supports-color-8.1.3" - sources."@types/unist-2.0.10" - sources."abbrev-2.0.0" - sources."acorn-8.11.3" - sources."acorn-jsx-5.3.2" - sources."alex-11.0.1" - (sources."ansi-align-3.0.1" // { - dependencies = [ - sources."emoji-regex-8.0.0" - sources."string-width-4.2.3" - sources."strip-ansi-6.0.1" - ]; - }) - sources."ansi-regex-5.0.1" - sources."ansi-styles-3.2.1" - sources."array-iterate-2.0.1" - sources."arrify-1.0.1" - sources."bail-2.0.2" - sources."balanced-match-1.0.2" - sources."boundary-2.0.0" - (sources."boxen-7.1.1" // { - dependencies = [ - sources."chalk-5.3.0" - sources."type-fest-2.19.0" - ]; - }) - sources."brace-expansion-2.0.1" - sources."bubble-stream-error-1.0.0" - sources."buffer-from-1.1.2" - sources."cacheable-lookup-7.0.0" - sources."cacheable-request-10.2.14" - sources."camelcase-7.0.1" - (sources."camelcase-keys-8.0.2" // { - dependencies = [ - sources."type-fest-2.19.0" - ]; - }) - sources."ccount-2.0.1" - sources."chalk-2.4.2" - sources."character-entities-2.0.2" - sources."character-entities-html4-2.1.0" - sources."character-entities-legacy-3.0.0" - sources."character-reference-invalid-2.0.1" - sources."ci-info-4.0.0" - sources."cli-boxes-3.0.0" - sources."color-convert-1.9.3" - sources."color-name-1.1.3" - sources."comma-separated-tokens-2.0.3" - (sources."concat-stream-2.0.0" // { - dependencies = [ - sources."readable-stream-3.6.2" - sources."string_decoder-1.3.0" - ]; - }) - (sources."config-chain-1.1.13" // { - dependencies = [ - sources."ini-1.3.8" - ]; - }) - sources."configstore-6.0.0" - sources."core-util-is-1.0.3" - sources."cross-spawn-7.0.3" - (sources."crypto-random-string-4.0.0" // { - dependencies = [ - sources."type-fest-1.4.0" - ]; - }) - sources."cuss-2.2.0" - sources."debug-4.3.4" - sources."decamelize-6.0.0" - (sources."decamelize-keys-1.1.1" // { - dependencies = [ - sources."decamelize-1.2.0" - sources."map-obj-1.0.1" - ]; - }) - sources."decode-named-character-reference-1.0.2" - (sources."decompress-response-6.0.0" // { - dependencies = [ - sources."mimic-response-3.1.0" - ]; - }) - sources."deep-extend-0.6.0" - sources."defer-to-connect-2.0.1" - sources."dequal-2.0.3" - sources."diff-5.2.0" - sources."dot-prop-6.0.1" - sources."duplexer-0.1.2" - sources."eastasianwidth-0.2.0" - sources."emoji-regex-9.2.2" - sources."end-of-stream-1.4.4" - sources."error-ex-1.3.2" - sources."escape-goat-4.0.0" - sources."escape-string-regexp-1.0.5" - sources."estree-util-is-identifier-name-2.1.0" - sources."estree-util-visit-1.2.1" - sources."event-stream-3.1.7" - sources."extend-3.0.2" - sources."fault-2.0.1" - sources."find-up-6.3.0" - sources."foreground-child-3.1.1" - sources."form-data-encoder-2.1.4" - sources."format-0.2.2" - sources."from-0.1.7" - sources."fs.realpath-1.0.0" - sources."function-bind-1.1.2" - sources."get-stream-6.0.1" - sources."git-diff-tree-1.1.0" - sources."git-spawned-stream-1.0.1" - sources."glob-8.1.0" - (sources."global-dirs-3.0.1" // { - dependencies = [ - sources."ini-2.0.0" - ]; - }) - sources."got-12.6.1" - sources."graceful-fs-4.2.11" - sources."hard-rejection-2.1.0" - sources."has-flag-3.0.0" - sources."has-yarn-3.0.0" - sources."hasown-2.0.2" - sources."hast-util-embedded-2.0.1" - sources."hast-util-from-parse5-7.1.2" - sources."hast-util-has-property-2.0.1" - sources."hast-util-is-body-ok-link-2.0.0" - sources."hast-util-is-element-2.1.3" - sources."hast-util-parse-selector-3.1.1" - sources."hast-util-phrasing-2.0.2" - sources."hast-util-to-nlcst-2.2.0" - sources."hast-util-to-string-2.0.0" - sources."hast-util-whitespace-2.0.1" - sources."hastscript-7.2.0" - sources."hosted-git-info-5.2.1" - sources."http-cache-semantics-4.1.1" - (sources."http2-wrapper-2.2.1" // { - dependencies = [ - sources."quick-lru-5.1.1" - ]; - }) - sources."ignore-5.3.1" - sources."import-lazy-4.0.0" - sources."import-meta-resolve-2.2.2" - sources."imurmurhash-0.1.4" - sources."indent-string-5.0.0" - sources."inflight-1.0.6" - sources."inherits-2.0.4" - sources."ini-4.1.2" - sources."is-alphabetical-2.0.1" - sources."is-alphanumerical-2.0.1" - sources."is-arrayish-0.2.1" - sources."is-buffer-2.0.5" - (sources."is-ci-3.0.1" // { - dependencies = [ - sources."ci-info-3.9.0" - ]; - }) - sources."is-core-module-2.13.1" - sources."is-decimal-2.0.1" - sources."is-empty-1.2.0" - sources."is-fullwidth-code-point-3.0.0" - sources."is-hexadecimal-2.0.1" - sources."is-installed-globally-0.4.0" - sources."is-npm-6.0.0" - sources."is-obj-2.0.0" - sources."is-path-inside-3.0.3" - sources."is-plain-obj-1.1.0" - sources."is-typedarray-1.0.0" - sources."is-yarn-global-0.4.1" - sources."isarray-0.0.1" - sources."isexe-2.0.0" - sources."jackspeak-2.3.6" - sources."js-tokens-4.0.0" - sources."json-buffer-3.0.1" - sources."json-parse-even-better-errors-2.3.1" - sources."keyv-4.5.4" - sources."kind-of-6.0.3" - sources."kleur-4.1.5" - sources."latest-version-7.0.0" - sources."limit-spawn-0.0.3" - sources."lines-and-columns-1.2.4" - sources."load-plugin-5.1.0" - sources."locate-path-7.2.0" - sources."longest-streak-3.1.0" - sources."lowercase-keys-3.0.0" - sources."lru-cache-7.18.3" - sources."map-obj-4.3.0" - sources."map-stream-0.1.0" - sources."markdown-table-3.0.3" - sources."mdast-comment-marker-2.1.2" - (sources."mdast-util-find-and-replace-2.2.2" // { - dependencies = [ - sources."escape-string-regexp-5.0.0" - ]; - }) - sources."mdast-util-from-markdown-1.3.1" - sources."mdast-util-frontmatter-1.0.1" - sources."mdast-util-gfm-2.0.2" - sources."mdast-util-gfm-autolink-literal-1.0.3" - sources."mdast-util-gfm-footnote-1.0.2" - sources."mdast-util-gfm-strikethrough-1.0.3" - sources."mdast-util-gfm-table-1.0.7" - sources."mdast-util-gfm-task-list-item-1.0.2" - sources."mdast-util-mdx-2.0.1" - sources."mdast-util-mdx-expression-1.3.2" - sources."mdast-util-mdx-jsx-2.1.4" - sources."mdast-util-mdxjs-esm-1.3.1" - sources."mdast-util-phrasing-3.0.1" - sources."mdast-util-to-markdown-1.5.0" - sources."mdast-util-to-nlcst-5.2.1" - sources."mdast-util-to-string-3.2.0" - sources."meow-11.0.0" - sources."micromark-3.2.0" - sources."micromark-core-commonmark-1.1.0" - sources."micromark-extension-frontmatter-1.1.1" - sources."micromark-extension-gfm-2.0.3" - sources."micromark-extension-gfm-autolink-literal-1.0.5" - sources."micromark-extension-gfm-footnote-1.1.2" - sources."micromark-extension-gfm-strikethrough-1.0.7" - sources."micromark-extension-gfm-table-1.0.7" - sources."micromark-extension-gfm-tagfilter-1.0.2" - sources."micromark-extension-gfm-task-list-item-1.0.5" - sources."micromark-extension-mdx-expression-1.0.8" - sources."micromark-extension-mdx-jsx-1.0.5" - sources."micromark-extension-mdx-md-1.0.1" - sources."micromark-extension-mdxjs-1.0.1" - sources."micromark-extension-mdxjs-esm-1.0.5" - sources."micromark-factory-destination-1.1.0" - sources."micromark-factory-label-1.1.0" - sources."micromark-factory-mdx-expression-1.0.9" - sources."micromark-factory-space-1.1.0" - sources."micromark-factory-title-1.1.0" - sources."micromark-factory-whitespace-1.1.0" - sources."micromark-util-character-1.2.0" - sources."micromark-util-chunked-1.1.0" - sources."micromark-util-classify-character-1.1.0" - sources."micromark-util-combine-extensions-1.1.0" - sources."micromark-util-decode-numeric-character-reference-1.1.0" - sources."micromark-util-decode-string-1.1.0" - sources."micromark-util-encode-1.1.0" - sources."micromark-util-events-to-acorn-1.2.3" - sources."micromark-util-html-tag-name-1.2.0" - sources."micromark-util-normalize-identifier-1.1.0" - sources."micromark-util-resolve-all-1.1.0" - sources."micromark-util-sanitize-uri-1.2.0" - sources."micromark-util-subtokenize-1.1.0" - sources."micromark-util-symbol-1.1.0" - sources."micromark-util-types-1.1.0" - sources."mimic-response-4.0.0" - sources."min-indent-1.0.1" - sources."minimatch-5.1.6" - sources."minimist-1.2.8" - sources."minimist-options-4.1.0" - sources."minipass-7.0.4" - sources."mri-1.2.0" - sources."ms-2.1.2" - sources."nlcst-is-literal-2.1.1" - sources."nlcst-normalize-3.1.1" - sources."nlcst-search-3.1.1" - sources."nlcst-to-string-3.1.1" - sources."nopt-7.2.0" - sources."normalize-package-data-4.0.1" - sources."normalize-url-8.0.1" - sources."npm-normalize-package-bin-3.0.1" - sources."object-keys-0.4.0" - sources."once-1.4.0" - sources."p-cancelable-3.0.0" - sources."p-limit-4.0.0" - sources."p-locate-6.0.0" - sources."package-json-8.1.1" - (sources."parse-english-5.0.0" // { - dependencies = [ - sources."nlcst-to-string-2.0.4" - ]; - }) - sources."parse-entities-4.0.1" - sources."parse-json-5.2.0" - (sources."parse-latin-5.0.1" // { - dependencies = [ - sources."unist-util-modify-children-3.1.1" - sources."unist-util-visit-children-2.0.2" - ]; - }) - sources."parse5-6.0.1" - sources."path-exists-5.0.0" - sources."path-key-3.1.1" - (sources."path-scurry-1.10.1" // { - dependencies = [ - sources."lru-cache-10.2.0" - ]; - }) - sources."pause-stream-0.0.11" - sources."pluralize-8.0.0" - sources."proc-log-3.0.0" - sources."process-nextick-args-1.0.7" - sources."property-information-6.4.1" - sources."proto-list-1.2.4" - sources."pump-1.0.3" - sources."pump-chain-1.0.0" - sources."pupa-3.1.0" - sources."quick-lru-6.1.2" - sources."quotation-2.0.3" - (sources."rc-1.2.8" // { - dependencies = [ - sources."ini-1.3.8" - ]; - }) - (sources."read-package-json-fast-3.0.2" // { - dependencies = [ - sources."json-parse-even-better-errors-3.0.1" - ]; - }) - (sources."read-pkg-7.1.0" // { - dependencies = [ - sources."hosted-git-info-4.1.0" - sources."lru-cache-6.0.0" - sources."normalize-package-data-3.0.3" - sources."type-fest-2.19.0" - ]; - }) - (sources."read-pkg-up-9.1.0" // { - dependencies = [ - sources."type-fest-2.19.0" - ]; - }) - sources."readable-stream-1.0.34" - sources."redent-4.0.0" - sources."registry-auth-token-5.0.2" - sources."registry-url-6.0.1" - sources."rehype-parse-8.0.5" - sources."rehype-retext-3.0.2" - sources."remark-frontmatter-4.0.1" - sources."remark-gfm-3.0.1" - sources."remark-mdx-2.0.0" - sources."remark-message-control-7.1.1" - sources."remark-parse-10.0.2" - sources."remark-retext-5.0.1" - sources."resolve-alpn-1.2.1" - sources."responselike-3.0.0" - sources."retext-english-4.1.0" - sources."retext-equality-6.6.0" - sources."retext-profanities-7.2.2" - sources."sade-1.8.1" - sources."safe-buffer-5.2.1" - (sources."semver-7.6.0" // { - dependencies = [ - sources."lru-cache-6.0.0" - ]; - }) - sources."semver-diff-4.0.0" - sources."shebang-command-2.0.0" - sources."shebang-regex-3.0.0" - sources."signal-exit-4.1.0" - sources."sliced-1.0.1" - sources."space-separated-tokens-2.0.2" - (sources."spawn-to-readstream-0.1.3" // { - dependencies = [ - sources."through2-0.4.2" - ]; - }) - sources."spdx-correct-3.2.0" - sources."spdx-exceptions-2.5.0" - sources."spdx-expression-parse-3.0.1" - sources."spdx-license-ids-3.0.17" - sources."split-0.2.10" - (sources."split-transform-stream-0.1.1" // { - dependencies = [ - sources."bubble-stream-error-0.0.1" - sources."through2-0.4.2" - ]; - }) - sources."stream-combiner-0.0.4" - sources."string-width-5.1.2" - (sources."string-width-cjs-4.2.3" // { - dependencies = [ - sources."emoji-regex-8.0.0" - sources."strip-ansi-6.0.1" - ]; - }) - sources."string_decoder-0.10.31" - sources."stringify-entities-4.0.3" - (sources."strip-ansi-7.1.0" // { - dependencies = [ - sources."ansi-regex-6.0.1" - ]; - }) - sources."strip-ansi-cjs-6.0.1" - sources."strip-indent-4.0.0" - sources."strip-json-comments-2.0.1" - sources."structured-source-4.0.0" - sources."supports-color-5.5.0" - (sources."textlint-rule-helper-2.3.1" // { - dependencies = [ - sources."unist-util-is-4.1.0" - sources."unist-util-visit-2.0.3" - sources."unist-util-visit-parents-3.1.1" - ]; - }) - sources."through-2.3.8" - (sources."through2-2.0.0" // { - dependencies = [ - sources."isarray-1.0.0" - sources."readable-stream-2.0.6" - sources."xtend-4.0.2" - ]; - }) - sources."to-vfile-7.2.4" - sources."trim-newlines-4.1.1" - sources."trough-2.2.0" - sources."type-fest-3.13.1" - sources."typedarray-0.0.6" - sources."typedarray-to-buffer-3.1.5" - sources."undici-types-5.26.5" - sources."unherit-3.0.1" - (sources."unified-10.1.2" // { - dependencies = [ - sources."is-plain-obj-4.1.0" - ]; - }) - sources."unified-diff-4.0.1" - (sources."unified-engine-10.1.0" // { - dependencies = [ - sources."is-plain-obj-4.1.0" - sources."lines-and-columns-2.0.4" - sources."parse-json-6.0.2" - ]; - }) - (sources."unified-message-control-4.0.0" // { - dependencies = [ - sources."unist-util-visit-3.1.0" - sources."unist-util-visit-parents-4.1.1" - ]; - }) - sources."unique-string-3.0.0" - sources."unist-util-inspect-7.0.2" - sources."unist-util-is-5.2.1" - (sources."unist-util-modify-children-2.0.0" // { - dependencies = [ - sources."array-iterate-1.1.4" - ]; - }) - sources."unist-util-position-4.0.4" - sources."unist-util-position-from-estree-1.1.2" - sources."unist-util-remove-position-4.0.2" - sources."unist-util-stringify-position-3.0.3" - sources."unist-util-visit-4.1.2" - sources."unist-util-visit-children-1.1.4" - sources."unist-util-visit-parents-5.1.3" - (sources."update-notifier-6.0.2" // { - dependencies = [ - sources."chalk-5.3.0" - ]; - }) - sources."util-deprecate-1.0.2" - sources."uvu-0.5.6" - sources."validate-npm-package-license-3.0.4" - sources."vfile-5.3.7" - sources."vfile-find-up-6.1.0" - sources."vfile-location-4.1.0" - sources."vfile-message-3.1.4" - (sources."vfile-reporter-7.0.5" // { - dependencies = [ - sources."supports-color-9.4.0" - ]; - }) - sources."vfile-sort-3.0.1" - sources."vfile-statistics-2.0.1" - sources."walk-up-path-3.0.1" - sources."web-namespaces-2.0.1" - sources."which-2.0.2" - sources."widest-line-4.0.1" - (sources."wrap-ansi-8.1.0" // { - dependencies = [ - sources."ansi-styles-6.2.1" - ]; - }) - (sources."wrap-ansi-cjs-7.0.0" // { - dependencies = [ - sources."ansi-styles-4.3.0" - sources."color-convert-2.0.1" - sources."color-name-1.1.4" - sources."emoji-regex-8.0.0" - sources."string-width-4.2.3" - sources."strip-ansi-6.0.1" - ]; - }) - sources."wrappy-1.0.2" - (sources."write-file-atomic-3.0.3" // { - dependencies = [ - sources."signal-exit-3.0.7" - ]; - }) - sources."xdg-basedir-5.1.0" - sources."xtend-2.1.2" - sources."yallist-4.0.0" - sources."yaml-2.4.1" - sources."yargs-parser-21.1.1" - sources."yocto-queue-1.0.0" - sources."zwitch-2.0.4" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "textlint rule for alex"; - homepage = "https://github.com/textlint-rule/textlint-rule-alex"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; textlint-rule-common-misspellings = nodeEnv.buildNodePackage { name = "textlint-rule-common-misspellings"; packageName = "textlint-rule-common-misspellings"; From d9bb9fd8dbf84885fabfa5cf837b19b5d7e545a7 Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 16 May 2024 22:53:08 +0900 Subject: [PATCH 07/18] textlint-rule-write-good: repackage with fetchYarnDeps (cherry picked from commit c28503fd79755124700ec611adbd6f030f83937b) --- .../te/textlint-rule-write-good/package.nix | 79 +++++++++++++++++++ .../te/textlint-rule-write-good/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 + pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 36 --------- 6 files changed, 83 insertions(+), 37 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-write-good/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-write-good/test.md diff --git a/pkgs/by-name/te/textlint-rule-write-good/package.nix b/pkgs/by-name/te/textlint-rule-write-good/package.nix new file mode 100644 index 000000000000..feec3ced6ea9 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-write-good/package.nix @@ -0,0 +1,79 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchYarnDeps, + fixup-yarn-lock, + nodejs, + yarn, + textlint, + textlint-rule-write-good, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "textlint-rule-write-good"; + version = "2.0.0-unstable-2024-05-02"; + + src = fetchFromGitHub { + owner = "textlint-rule"; + repo = "textlint-rule-write-good"; + rev = "586afa0989ae9ac8a93436f58a24d99afe1cac21"; + hash = "sha256-ghEmWkwGVvLMy6Gf7IrariDRNfuNBc9EVOQz5w38g0I="; + }; + + offlineCache = fetchYarnDeps { + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-J02MoKPEYtehQMSaOR1Ytfme1ffgHbQcNnEENeTaxaA="; + }; + + 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-write-good + cp -r . $out/lib/node_modules/textlint-rule-write-good/ + + runHook postInstall + ''; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-write-good; + testFile = ./test.md; + }; + + meta = { + description = "Textlint rule to check your English styles with write-good"; + homepage = "https://github.com/textlint-rule/textlint-rule-write-good"; + changelog = "https://github.com/textlint-rule/textlint-rule-write-good/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-write-good/test.md b/pkgs/by-name/te/textlint-rule-write-good/test.md new file mode 100644 index 000000000000..6615a6f67a8f --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-write-good/test.md @@ -0,0 +1 @@ +So the cat was stolen. diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 8f43803f3494..31ef9a6a499d 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -10,6 +10,7 @@ textlint-rule-alex, textlint-rule-max-comma, textlint-rule-preset-ja-technical-writing, + textlint-rule-write-good, }: buildNpmPackage rec { @@ -99,6 +100,7 @@ buildNpmPackage rec { textlint-rule-alex textlint-rule-max-comma textlint-rule-preset-ja-technical-writing + textlint-rule-write-good ] ); }; diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index e74265ca30d2..9acf3b1ddcd5 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -139,6 +139,7 @@ mapAliases { inherit (pkgs) textlint; # Added 2024-05-13 inherit (pkgs) textlint-rule-alex; # Added 2024-05-16 inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15 + inherit (pkgs) textlint-rule-write-good; # Added 2024-05-16 thelounge = pkgs.thelounge; # Added 2023-05-22 three = throw "three was removed because it was no longer needed"; # Added 2023-09-08 inherit (pkgs) titanium; # added 2023-08-17 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index e0953523fb4c..d18d577db274 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -231,7 +231,6 @@ , "textlint-rule-stop-words" , "textlint-rule-terminology" , "textlint-rule-unexpanded-acronym" -, "textlint-rule-write-good" , "thelounge-plugin-closepms" , "thelounge-plugin-giphy" , "thelounge-plugin-shortcuts" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index dac497d965a0..16732693f2de 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93527,42 +93527,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-write-good = nodeEnv.buildNodePackage { - name = "textlint-rule-write-good"; - packageName = "textlint-rule-write-good"; - version = "2.0.0"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-write-good/-/textlint-rule-write-good-2.0.0.tgz"; - sha512 = "yvOJavJD+PgyUzvsoLDDzDtgCVBva/HNhEvsFnYVugrWz0qy2hr+/4B4wkzjro4wfPbwz20GQe5h13N4DeUEeA=="; - }; - dependencies = [ - sources."@textlint/ast-node-types-13.4.1" - sources."@types/unist-2.0.10" - sources."adverb-where-0.2.6" - sources."boundary-2.0.0" - sources."commander-2.20.3" - sources."e-prime-0.10.4" - sources."no-cliches-0.3.6" - sources."passive-voice-0.1.0" - sources."structured-source-4.0.0" - sources."textlint-rule-helper-2.3.1" - sources."too-wordy-0.3.6" - sources."unist-util-is-4.1.0" - sources."unist-util-visit-2.0.3" - sources."unist-util-visit-parents-3.1.1" - sources."weasel-words-0.1.1" - sources."write-good-1.0.8" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "textlint rule to check your English style with write good"; - homepage = "https://github.com/textlint-rule/textlint-rule-write-good"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; thelounge-plugin-closepms = nodeEnv.buildNodePackage { name = "thelounge-plugin-closepms"; packageName = "thelounge-plugin-closepms"; From 6f2cd96b3d1575672a8c42e17021500886014d7a Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 16 May 2024 23:47:56 +0900 Subject: [PATCH 08/18] textlint-rule-diacritics: repackage with buildNpmPackage (cherry picked from commit d47ef02451dfa3b68261b6c3be189c493d0184d7) --- .../te/textlint-rule-diacritics/package.nix | 36 +++++++++++++++++++ .../te/textlint-rule-diacritics/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 ++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 22 ------------ 6 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-diacritics/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-diacritics/test.md diff --git a/pkgs/by-name/te/textlint-rule-diacritics/package.nix b/pkgs/by-name/te/textlint-rule-diacritics/package.nix new file mode 100644 index 000000000000..95c11c40c30c --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-diacritics/package.nix @@ -0,0 +1,36 @@ +{ + lib, + fetchFromGitHub, + buildNpmPackage, + textlint, + textlint-rule-diacritics, +}: + +buildNpmPackage rec { + pname = "textlint-rule-diacritics"; + version = "1.0.0-unstable-2023-01-05"; + + src = fetchFromGitHub { + owner = "sapegin"; + repo = "textlint-rule-diacritics"; + rev = "07977d866aa6ce514bc6ed3a1087b2bb5869bfb4"; + hash = "sha256-Zr+qWvgpLq3pzO4A7c+x4rTKkaSNO4t1gCiyJL3lkws="; + }; + + npmDepsHash = "sha256-bKA8aPVBYdzRPwCyFdEs3eWStJwswCZPVpsqGWwc42E="; + + dontNpmBuild = true; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-diacritics; + testFile = ./test.md; + }; + + meta = { + description = "Textlint rule to check correct usage of diacritics"; + homepage = "https://github.com/sapegin/textlint-rule-diacritics?tab=readme-ov-file"; + changelog = "https://github.com/sapegin/textlint-rule-diacritics/releases/tag/${src.rev}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/by-name/te/textlint-rule-diacritics/test.md b/pkgs/by-name/te/textlint-rule-diacritics/test.md new file mode 100644 index 000000000000..84e58d545741 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-diacritics/test.md @@ -0,0 +1 @@ +creme brulee diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 31ef9a6a499d..e2bb79a2aef1 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -8,6 +8,7 @@ runCommand, textlint, textlint-rule-alex, + textlint-rule-diacritics, textlint-rule-max-comma, textlint-rule-preset-ja-technical-writing, textlint-rule-write-good, @@ -98,6 +99,7 @@ buildNpmPackage rec { tests = lib.mergeAttrsList ( map (package: package.tests) [ textlint-rule-alex + textlint-rule-diacritics textlint-rule-max-comma textlint-rule-preset-ja-technical-writing textlint-rule-write-good diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 9acf3b1ddcd5..1fdafa76142d 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -138,6 +138,7 @@ mapAliases { inherit (pkgs) terser; # Added 2023-08-31 inherit (pkgs) textlint; # Added 2024-05-13 inherit (pkgs) textlint-rule-alex; # Added 2024-05-16 + inherit (pkgs) textlint-rule-diacritics; # Added 2024-05-16 inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15 inherit (pkgs) textlint-rule-write-good; # Added 2024-05-16 thelounge = pkgs.thelounge; # Added 2023-05-22 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index d18d577db274..85b76fb17b1d 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -224,7 +224,6 @@ , "textlint-plugin-latex" , "textlint-rule-abbr-within-parentheses" , "textlint-rule-common-misspellings" -, "textlint-rule-diacritics" , "textlint-rule-en-max-word-count" , "textlint-rule-no-start-duplicated-conjunction" , "textlint-rule-period-in-list-item" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 16732693f2de..09b1caf3e936 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93245,28 +93245,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-diacritics = nodeEnv.buildNodePackage { - name = "textlint-rule-diacritics"; - packageName = "textlint-rule-diacritics"; - version = "1.0.0"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-diacritics/-/textlint-rule-diacritics-1.0.0.tgz"; - sha512 = "hhJvDZzhV+sKD7walPQ4VmWkBw5o1T/lFLRsoDsAJF+LYhD89R5/L4yFVtxFRUkP9VZ5cvoUIPkYjZvkPEawTA=="; - }; - dependencies = [ - sources."match-casing-1.0.3" - sources."strip-json-comments-3.1.1" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "Textlint rule to check correct usage of diacritics"; - homepage = "https://github.com/sapegin/textlint-rule-diacritics"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; textlint-rule-en-max-word-count = nodeEnv.buildNodePackage { name = "textlint-rule-en-max-word-count"; packageName = "textlint-rule-en-max-word-count"; From 9b0989a1a09624b7416a14489560d82f7765ef81 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 17 May 2024 09:11:17 +0900 Subject: [PATCH 09/18] textlint-rule-stop-words: repackage with buildNpmPackage (cherry picked from commit c4db484f1438489334971f1279f6f967ab3ebe31) --- .../te/textlint-rule-stop-words/package.nix | 36 +++++++++++++++++++ .../te/textlint-rule-stop-words/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 ++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 30 ---------------- 6 files changed, 40 insertions(+), 31 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-stop-words/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-stop-words/test.md diff --git a/pkgs/by-name/te/textlint-rule-stop-words/package.nix b/pkgs/by-name/te/textlint-rule-stop-words/package.nix new file mode 100644 index 000000000000..f2fa8ca901cc --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-stop-words/package.nix @@ -0,0 +1,36 @@ +{ + lib, + fetchFromGitHub, + buildNpmPackage, + textlint, + textlint-rule-stop-words, +}: + +buildNpmPackage rec { + pname = "textlint-rule-stop-words"; + version = "5.0.0"; + + src = fetchFromGitHub { + owner = "sapegin"; + repo = "textlint-rule-stop-words"; + rev = "refs/tags/v${version}"; + hash = "sha256-e9jTbDULOs0DwtT9UZp7k5+RR5Ab/x/sizIvs1MrmZs="; + }; + + npmDepsHash = "sha256-t9PPHFIiY4vw0ocw6nMuaeYuYWxbc1Pzo0R6bqIsHeI="; + + dontNpmBuild = true; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-stop-words; + testFile = ./test.md; + }; + + meta = { + description = "Textlint rule to find filler words, buzzwords and clichés"; + homepage = "https://github.com/sapegin/textlint-rule-stop-words"; + changelog = "https://github.com/sapegin/textlint-rule-stop-words/releases/tag/${src.rev}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/by-name/te/textlint-rule-stop-words/test.md b/pkgs/by-name/te/textlint-rule-stop-words/test.md new file mode 100644 index 000000000000..7cd8fc64f625 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-stop-words/test.md @@ -0,0 +1 @@ +and etc. diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index e2bb79a2aef1..9f438a5f7e81 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -11,6 +11,7 @@ textlint-rule-diacritics, textlint-rule-max-comma, textlint-rule-preset-ja-technical-writing, + textlint-rule-stop-words, textlint-rule-write-good, }: @@ -102,6 +103,7 @@ buildNpmPackage rec { textlint-rule-diacritics textlint-rule-max-comma textlint-rule-preset-ja-technical-writing + textlint-rule-stop-words textlint-rule-write-good ] ); diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 1fdafa76142d..4d62d04f07a4 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -140,6 +140,7 @@ mapAliases { inherit (pkgs) textlint-rule-alex; # Added 2024-05-16 inherit (pkgs) textlint-rule-diacritics; # Added 2024-05-16 inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15 + inherit (pkgs) textlint-rule-stop-words; # Added 2024-05-17 inherit (pkgs) textlint-rule-write-good; # Added 2024-05-16 thelounge = pkgs.thelounge; # Added 2023-05-22 three = throw "three was removed because it was no longer needed"; # Added 2023-09-08 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 85b76fb17b1d..26edfcd24632 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -227,7 +227,6 @@ , "textlint-rule-en-max-word-count" , "textlint-rule-no-start-duplicated-conjunction" , "textlint-rule-period-in-list-item" -, "textlint-rule-stop-words" , "textlint-rule-terminology" , "textlint-rule-unexpanded-acronym" , "thelounge-plugin-closepms" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 09b1caf3e936..4e41a7b94008 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93358,36 +93358,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-stop-words = nodeEnv.buildNodePackage { - name = "textlint-rule-stop-words"; - packageName = "textlint-rule-stop-words"; - version = "4.0.0"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-stop-words/-/textlint-rule-stop-words-4.0.0.tgz"; - sha512 = "vP99cbTyapn+Hviom2doO3pJtjlhKlZvlHTf21zoB22CxJx2w3S7Ie169neB5U4Xsei+NodHf5tnwT933mO19A=="; - }; - dependencies = [ - sources."@textlint/ast-node-types-13.4.1" - sources."@types/unist-2.0.10" - sources."boundary-2.0.0" - sources."lodash-4.17.21" - sources."split-lines-2.1.0" - sources."structured-source-4.0.0" - sources."textlint-rule-helper-2.3.1" - sources."unist-util-is-4.1.0" - sources."unist-util-visit-2.0.3" - sources."unist-util-visit-parents-3.1.1" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "Textlint rule to find filler words, buzzwords and chiches"; - homepage = "https://github.com/sapegin/textlint-rule-stop-words"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; textlint-rule-terminology = nodeEnv.buildNodePackage { name = "textlint-rule-terminology"; packageName = "textlint-rule-terminology"; From 600786c8cd985ab0108c25ab00d3ba99dbf327f0 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 17 May 2024 09:33:52 +0900 Subject: [PATCH 10/18] textlint-plugin-latex2e: init at 1.2.1-unstable-2024-02-05 (cherry picked from commit dc4a3ade28f0260ccd8b2b0ebf8af7701d6e7145) --- .../te/textlint-plugin-latex2e/package.nix | 37 +++++++++++++++++++ .../te/textlint-plugin-latex2e/test.tex | 4 ++ pkgs/by-name/te/textlint/package.nix | 2 + 3 files changed, 43 insertions(+) create mode 100644 pkgs/by-name/te/textlint-plugin-latex2e/package.nix create mode 100644 pkgs/by-name/te/textlint-plugin-latex2e/test.tex diff --git a/pkgs/by-name/te/textlint-plugin-latex2e/package.nix b/pkgs/by-name/te/textlint-plugin-latex2e/package.nix new file mode 100644 index 000000000000..5325d880a638 --- /dev/null +++ b/pkgs/by-name/te/textlint-plugin-latex2e/package.nix @@ -0,0 +1,37 @@ +{ + lib, + fetchFromGitHub, + buildNpmPackage, + textlint, + textlint-plugin-latex2e, + textlint-rule-max-comma, +}: + +buildNpmPackage rec { + pname = "textlint-plugin-latex2e"; + version = "1.2.1-unstable-2024-02-05"; + + src = fetchFromGitHub { + owner = "textlint"; + repo = "textlint-plugin-latex2e"; + rev = "d3ba1be14543aaaf8e52f87d103fafb3ebb7c4b0"; + hash = "sha256-sCDpyhnznMAkIPWK0BawWZwuR9UO/ipIG2o5hyBkJQ0="; + }; + + npmDepsHash = "sha256-u2cMZC3s4iGCWG6iVMDYfb6XbxfjCdwpzl7opkwtrU8="; + + passthru.tests = textlint.testPackages { + inherit (textlint-plugin-latex2e) pname; + rule = textlint-rule-max-comma; + plugin = textlint-plugin-latex2e; + testFile = ./test.tex; + }; + + meta = { + description = "Textlint Plugin LaTeX2ε"; + homepage = "https://github.com/textlint/textlint-plugin-latex2e"; + changelog = "https://github.com/textlint/textlint-plugin-latex2e/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/by-name/te/textlint-plugin-latex2e/test.tex b/pkgs/by-name/te/textlint-plugin-latex2e/test.tex new file mode 100644 index 000000000000..98ec66816b6d --- /dev/null +++ b/pkgs/by-name/te/textlint-plugin-latex2e/test.tex @@ -0,0 +1,4 @@ +\documentclass{article} +\begin{document} +Nix, is a tool, that takes a unique approach to package management and system configuration, Learn how to make reproducible, declarative, and reliable systems. +\end{document} diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 9f438a5f7e81..432dba68b7d4 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -7,6 +7,7 @@ makeWrapper, runCommand, textlint, + textlint-plugin-latex2e, textlint-rule-alex, textlint-rule-diacritics, textlint-rule-max-comma, @@ -99,6 +100,7 @@ buildNpmPackage rec { tests = lib.mergeAttrsList ( map (package: package.tests) [ + textlint-plugin-latex2e textlint-rule-alex textlint-rule-diacritics textlint-rule-max-comma From befdd4fcc96b43b3154a944909b4e5ac55dbf840 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 17 May 2024 09:18:47 +0900 Subject: [PATCH 11/18] textlint-plugin-latex: remove (cherry picked from commit 9587d0c8f9577832891a12584cb49b2d696a57f8) --- pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 22 ------------------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 4d62d04f07a4..0d5b888a6516 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -137,6 +137,7 @@ mapAliases { tedicross = throw "tedicross was removed because it was broken"; # added 2023-09-09 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-alex; # Added 2024-05-16 inherit (pkgs) textlint-rule-diacritics; # Added 2024-05-16 inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 26edfcd24632..fb10b893431b 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -221,7 +221,6 @@ , "tailwindcss" , "teck-programmer" , "tern" -, "textlint-plugin-latex" , "textlint-rule-abbr-within-parentheses" , "textlint-rule-common-misspellings" , "textlint-rule-en-max-word-count" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 4e41a7b94008..633eec16c24c 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93160,28 +93160,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-plugin-latex = nodeEnv.buildNodePackage { - name = "textlint-plugin-latex"; - packageName = "textlint-plugin-latex"; - version = "1.0.4"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-plugin-latex/-/textlint-plugin-latex-1.0.4.tgz"; - sha512 = "ILjivll38Ry+R13ZYG8gGEjPxUP712MSZZIIqm7cV7iUIzysvKQyyf5hYHiNZD/+ijVzlje8RiB49IbvQ7K7mw=="; - }; - dependencies = [ - sources."@textlint/ast-node-types-4.4.3" - sources."txt-to-ast-3.0.3" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "Latex plugin for [textlint](https://github.com/textlint/textlint "textlint")."; - homepage = "https://github.com/elzup/textlint-plugin-latex"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; textlint-rule-abbr-within-parentheses = nodeEnv.buildNodePackage { name = "textlint-rule-abbr-within-parentheses"; packageName = "textlint-rule-abbr-within-parentheses"; From b97023cd16079fb7dd33db48b04499330e8cff76 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 17 May 2024 09:59:55 +0900 Subject: [PATCH 12/18] textlint-rule-terminology: repackage with buildNpmPackage (cherry picked from commit 3109179f68472dccb1fa5200eeb4c30010035156) --- .../te/textlint-rule-terminology/package.nix | 36 +++++++++++++++++++ .../te/textlint-rule-terminology/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 ++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 30 ---------------- 6 files changed, 40 insertions(+), 31 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-terminology/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-terminology/test.md diff --git a/pkgs/by-name/te/textlint-rule-terminology/package.nix b/pkgs/by-name/te/textlint-rule-terminology/package.nix new file mode 100644 index 000000000000..ac6ab2dd8ff0 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-terminology/package.nix @@ -0,0 +1,36 @@ +{ + lib, + fetchFromGitHub, + buildNpmPackage, + textlint, + textlint-rule-terminology, +}: + +buildNpmPackage rec { + pname = "textlint-rule-terminology"; + version = "5.0.0"; + + src = fetchFromGitHub { + owner = "sapegin"; + repo = "textlint-rule-terminology"; + rev = "refs/tags/v${version}"; + hash = "sha256-/NuKZSugizP4b2LFNqPrTvoXNE4D1sytU2B7T40ZASQ="; + }; + + npmDepsHash = "sha256-FQr7E6ZSJxj/ide+3JJwc27x15L1bAIAlPnMl8hdQ8w="; + + dontNpmBuild = true; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-terminology; + testFile = ./test.md; + }; + + meta = { + description = "Textlint rule to check correct terms spelling"; + homepage = "https://github.com/sapegin/textlint-rule-terminology"; + changelog = "https://github.com/sapegin/textlint-rule-terminology/releases/tag/${src.rev}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/by-name/te/textlint-rule-terminology/test.md b/pkgs/by-name/te/textlint-rule-terminology/test.md new file mode 100644 index 000000000000..7c64883b9352 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-terminology/test.md @@ -0,0 +1 @@ +Javascript diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 432dba68b7d4..892976116f65 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -13,6 +13,7 @@ textlint-rule-max-comma, textlint-rule-preset-ja-technical-writing, textlint-rule-stop-words, + textlint-rule-terminology, textlint-rule-write-good, }: @@ -106,6 +107,7 @@ buildNpmPackage rec { textlint-rule-max-comma textlint-rule-preset-ja-technical-writing textlint-rule-stop-words + textlint-rule-terminology textlint-rule-write-good ] ); diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 0d5b888a6516..4a753a886ff3 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -142,6 +142,7 @@ mapAliases { inherit (pkgs) textlint-rule-diacritics; # Added 2024-05-16 inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15 inherit (pkgs) textlint-rule-stop-words; # Added 2024-05-17 + inherit (pkgs) textlint-rule-terminology; # Added 2024-05-17 inherit (pkgs) textlint-rule-write-good; # Added 2024-05-16 thelounge = pkgs.thelounge; # Added 2023-05-22 three = throw "three was removed because it was no longer needed"; # Added 2023-09-08 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index fb10b893431b..31d217c81cdf 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -226,7 +226,6 @@ , "textlint-rule-en-max-word-count" , "textlint-rule-no-start-duplicated-conjunction" , "textlint-rule-period-in-list-item" -, "textlint-rule-terminology" , "textlint-rule-unexpanded-acronym" , "thelounge-plugin-closepms" , "thelounge-plugin-giphy" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 633eec16c24c..1b17797ebf4e 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93336,36 +93336,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-terminology = nodeEnv.buildNodePackage { - name = "textlint-rule-terminology"; - packageName = "textlint-rule-terminology"; - version = "4.0.1"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-terminology/-/textlint-rule-terminology-4.0.1.tgz"; - sha512 = "wKiVhc2B9HP2MFU4x7ZDx+oM5u43ETpKWTLHKvdhPRZ0+davi4M8mFmkZVovDIMO7igsGjixikcvFmnCMg3kmQ=="; - }; - dependencies = [ - sources."@textlint/ast-node-types-13.4.1" - sources."@types/unist-2.0.10" - sources."boundary-2.0.0" - sources."lodash-4.17.21" - sources."strip-json-comments-3.1.1" - sources."structured-source-4.0.0" - sources."textlint-rule-helper-2.3.1" - sources."unist-util-is-4.1.0" - sources."unist-util-visit-2.0.3" - sources."unist-util-visit-parents-3.1.1" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "TextLint rule to check correct terms spelling"; - homepage = "https://github.com/sapegin/textlint-rule-terminology"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; textlint-rule-unexpanded-acronym = nodeEnv.buildNodePackage { name = "textlint-rule-unexpanded-acronym"; packageName = "textlint-rule-unexpanded-acronym"; From 218d1791d0d2488dd5c20dd6fc3b85486ae9c986 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 17 May 2024 10:12:42 +0900 Subject: [PATCH 13/18] textlint-rule-en-max-word-count: repackage with fetchYarnDeps (cherry picked from commit 8fc1968cb284d6d824a468a617de3ff5946f811d) --- .../package.nix | 79 +++++++++++++++++++ .../textlint-rule-en-max-word-count/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 + pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 46 ----------- 6 files changed, 83 insertions(+), 47 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-en-max-word-count/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-en-max-word-count/test.md diff --git a/pkgs/by-name/te/textlint-rule-en-max-word-count/package.nix b/pkgs/by-name/te/textlint-rule-en-max-word-count/package.nix new file mode 100644 index 000000000000..893ed385dabb --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-en-max-word-count/package.nix @@ -0,0 +1,79 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchYarnDeps, + fixup-yarn-lock, + nodejs, + yarn, + textlint, + textlint-rule-en-max-word-count, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "textlint-rule-en-max-word-count"; + version = "2.0.1"; + + src = fetchFromGitHub { + owner = "textlint-rule"; + repo = "textlint-rule-en-max-word-count"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-ZZWN0PVHQBHcvJ53jDtD/6wLxBYmSHO7OXb5UQQAmyc="; + }; + + offlineCache = fetchYarnDeps { + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-3sEbvIfSaMz9pJalEKs7y05OVh+cKDg9jfLYmVyS53M="; + }; + + 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-en-max-word-count + cp -r . $out/lib/node_modules/textlint-rule-en-max-word-count/ + + runHook postInstall + ''; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-en-max-word-count; + testFile = ./test.md; + }; + + meta = { + description = "Textlint rule that specify the maximum word count of a sentence"; + homepage = "https://github.com/textlint-rule/textlint-rule-en-max-word-count"; + changelog = "https://github.com/textlint-rule/textlint-rule-en-max-word-count/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-en-max-word-count/test.md b/pkgs/by-name/te/textlint-rule-en-max-word-count/test.md new file mode 100644 index 000000000000..717096b6f333 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-en-max-word-count/test.md @@ -0,0 +1 @@ +Nix is a tool that takes a unique approach to package management and system configuration, learn how to make reproducible declarative and reliable systems, Nix builds packages in isolation from each other, this ensures that they are reproducible and don’t have undeclared dependencies, so if a package works on one machine, it will also work on another. diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 892976116f65..a389b5fd4e3f 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -10,6 +10,7 @@ textlint-plugin-latex2e, textlint-rule-alex, textlint-rule-diacritics, + textlint-rule-en-max-word-count, textlint-rule-max-comma, textlint-rule-preset-ja-technical-writing, textlint-rule-stop-words, @@ -104,6 +105,7 @@ buildNpmPackage rec { textlint-plugin-latex2e textlint-rule-alex textlint-rule-diacritics + textlint-rule-en-max-word-count textlint-rule-max-comma textlint-rule-preset-ja-technical-writing textlint-rule-stop-words diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 4a753a886ff3..75e663186225 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -140,6 +140,7 @@ mapAliases { 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-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 inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15 inherit (pkgs) textlint-rule-stop-words; # Added 2024-05-17 inherit (pkgs) textlint-rule-terminology; # Added 2024-05-17 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 31d217c81cdf..b06e7b2ad950 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -223,7 +223,6 @@ , "tern" , "textlint-rule-abbr-within-parentheses" , "textlint-rule-common-misspellings" -, "textlint-rule-en-max-word-count" , "textlint-rule-no-start-duplicated-conjunction" , "textlint-rule-period-in-list-item" , "textlint-rule-unexpanded-acronym" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 1b17797ebf4e..aa54227896e9 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93223,52 +93223,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-en-max-word-count = nodeEnv.buildNodePackage { - name = "textlint-rule-en-max-word-count"; - packageName = "textlint-rule-en-max-word-count"; - version = "2.0.1"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-en-max-word-count/-/textlint-rule-en-max-word-count-2.0.1.tgz"; - sha512 = "gZMxUU+/O8QIchBQoo50QryknmMKahb2vBj89wVvk+Dhvp70nAJKSkpt2vjZVYBWCxpIKysQlwheBjrFZWpkfg=="; - }; - dependencies = [ - sources."@textlint/ast-node-types-13.4.1" - sources."@types/unist-2.0.10" - sources."bail-1.0.5" - sources."boundary-2.0.0" - sources."ccount-1.1.0" - sources."comma-separated-tokens-1.0.8" - sources."extend-3.0.2" - sources."hast-util-from-parse5-5.0.3" - sources."hast-util-parse-selector-2.2.5" - sources."hastscript-5.1.2" - sources."is-buffer-2.0.5" - sources."is-plain-obj-2.1.0" - sources."parse5-5.1.1" - sources."property-information-5.6.0" - sources."rehype-parse-6.0.2" - sources."sentence-splitter-4.4.1" - sources."space-separated-tokens-1.1.5" - sources."structured-source-4.0.0" - sources."textlint-util-to-string-3.3.4" - sources."trough-1.0.5" - sources."unified-8.4.2" - sources."unist-util-stringify-position-2.0.3" - sources."vfile-4.2.1" - sources."vfile-message-2.0.4" - sources."web-namespaces-1.1.4" - sources."xtend-4.0.2" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "textlint rule that specify the maximum word count of a sentence."; - homepage = "https://github.com/textlint-rule/textlint-rule-en-max-word-count"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; textlint-rule-no-start-duplicated-conjunction = nodeEnv.buildNodePackage { name = "textlint-rule-no-start-duplicated-conjunction"; packageName = "textlint-rule-no-start-duplicated-conjunction"; From 551d1d0dfb7631744a7c45a8a058df8d1e8fa862 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 17 May 2024 10:58:53 +0900 Subject: [PATCH 14/18] textlint-rule-unexpanded-acronym: repackage with fetchYarnDeps (cherry picked from commit 2aaa9011e18c5db23360cff91d6cdc6055dc73ef) --- .../package.nix | 79 +++++++++++++++++ .../textlint-rule-unexpanded-acronym/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 + pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 87 ------------------- 6 files changed, 83 insertions(+), 88 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-unexpanded-acronym/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-unexpanded-acronym/test.md 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 000000000000..a0a7cc87bff0 --- /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 000000000000..06b7ca62cea5 --- /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 a389b5fd4e3f..7087ad4145a5 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 ] ); diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 75e663186225..93b2cb53d4c3 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -144,6 +144,7 @@ mapAliases { inherit (pkgs) textlint-rule-max-comma; # Added 2024-05-15 inherit (pkgs) textlint-rule-stop-words; # Added 2024-05-17 inherit (pkgs) textlint-rule-terminology; # Added 2024-05-17 + inherit (pkgs) textlint-rule-unexpanded-acronym; # Added 2024-05-17 inherit (pkgs) textlint-rule-write-good; # Added 2024-05-16 thelounge = pkgs.thelounge; # Added 2023-05-22 three = throw "three was removed because it was no longer needed"; # Added 2023-09-08 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index b06e7b2ad950..f79e524ec525 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -225,7 +225,6 @@ , "textlint-rule-common-misspellings" , "textlint-rule-no-start-duplicated-conjunction" , "textlint-rule-period-in-list-item" -, "textlint-rule-unexpanded-acronym" , "thelounge-plugin-closepms" , "thelounge-plugin-giphy" , "thelounge-plugin-shortcuts" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index aa54227896e9..381d0daf8d88 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93290,93 +93290,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-unexpanded-acronym = nodeEnv.buildNodePackage { - name = "textlint-rule-unexpanded-acronym"; - packageName = "textlint-rule-unexpanded-acronym"; - version = "1.2.4"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-unexpanded-acronym/-/textlint-rule-unexpanded-acronym-1.2.4.tgz"; - sha512 = "F1kV06CdonOM2awtXjCSRYUsRJfDfZIujQQo4zEMqNqD6UwpkapxpZOiwcwbeaQz00+17ljbJEoGqIe2XeiU+w=="; - }; - dependencies = [ - sources."array-buffer-byte-length-1.0.1" - sources."array-includes-3.1.7" - sources."arraybuffer.prototype.slice-1.0.3" - sources."available-typed-arrays-1.0.7" - sources."call-bind-1.0.7" - sources."data-view-buffer-1.0.1" - sources."data-view-byte-length-1.0.1" - sources."data-view-byte-offset-1.0.0" - sources."define-data-property-1.1.4" - sources."define-properties-1.2.1" - sources."es-abstract-1.23.2" - sources."es-define-property-1.0.0" - sources."es-errors-1.3.0" - sources."es-object-atoms-1.0.0" - sources."es-set-tostringtag-2.0.3" - sources."es-to-primitive-1.2.1" - sources."for-each-0.3.3" - sources."function-bind-1.1.2" - sources."function.prototype.name-1.1.6" - sources."functions-have-names-1.2.3" - sources."get-intrinsic-1.2.4" - sources."get-symbol-description-1.0.2" - sources."globalthis-1.0.3" - sources."gopd-1.0.1" - sources."has-bigints-1.0.2" - sources."has-property-descriptors-1.0.2" - sources."has-proto-1.0.3" - sources."has-symbols-1.0.3" - sources."has-tostringtag-1.0.2" - sources."hasown-2.0.2" - sources."internal-slot-1.0.7" - sources."is-array-buffer-3.0.4" - sources."is-bigint-1.0.4" - sources."is-boolean-object-1.1.2" - sources."is-callable-1.2.7" - sources."is-capitalized-1.0.0" - sources."is-data-view-1.0.1" - sources."is-date-object-1.0.5" - sources."is-negative-zero-2.0.3" - sources."is-number-object-1.0.7" - sources."is-regex-1.1.4" - sources."is-shared-array-buffer-1.0.3" - sources."is-string-1.0.7" - sources."is-symbol-1.0.4" - sources."is-typed-array-1.1.13" - sources."is-weakref-1.0.2" - sources."isarray-2.0.5" - sources."object-inspect-1.13.1" - sources."object-keys-1.1.1" - sources."object.assign-4.1.5" - sources."possible-typed-array-names-1.0.0" - sources."regexp.prototype.flags-1.5.2" - sources."safe-array-concat-1.1.2" - sources."safe-regex-test-1.0.3" - sources."set-function-length-1.2.2" - sources."set-function-name-2.0.2" - sources."side-channel-1.0.6" - sources."string.prototype.trim-1.2.9" - sources."string.prototype.trimend-1.0.8" - sources."string.prototype.trimstart-1.0.7" - sources."typed-array-buffer-1.0.2" - sources."typed-array-byte-length-1.0.1" - sources."typed-array-byte-offset-1.0.2" - sources."typed-array-length-1.0.5" - sources."unbox-primitive-1.0.2" - sources."which-boxed-primitive-1.0.2" - sources."which-typed-array-1.1.15" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "textlint rule that check unexpanded acronym word."; - homepage = "https://github.com/textlint-rule/textlint-rule-unexpanded-acronym"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; thelounge-plugin-closepms = nodeEnv.buildNodePackage { name = "thelounge-plugin-closepms"; packageName = "thelounge-plugin-closepms"; From 289d6c37517dc4333fbacafb295a72129f8dbf81 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 17 May 2024 21:07:51 +0900 Subject: [PATCH 15/18] textlint-rule-period-in-list-item: repackage with fetchYarnDeps (cherry picked from commit e242a02edc425581d9b898914573a28c2b6c2543) --- .../package.nix | 79 +++++++++++++++++++ .../textlint-rule-period-in-list-item/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 + pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 22 ------ 6 files changed, 83 insertions(+), 23 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-period-in-list-item/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-period-in-list-item/test.md diff --git a/pkgs/by-name/te/textlint-rule-period-in-list-item/package.nix b/pkgs/by-name/te/textlint-rule-period-in-list-item/package.nix new file mode 100644 index 000000000000..22397ccc42ff --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-period-in-list-item/package.nix @@ -0,0 +1,79 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchYarnDeps, + fixup-yarn-lock, + nodejs, + yarn, + textlint, + textlint-rule-period-in-list-item, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "textlint-rule-period-in-list-item"; + version = "1.0.1"; + + src = fetchFromGitHub { + owner = "textlint-rule"; + repo = "textlint-rule-period-in-list-item"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-hAkueH5q5s0kmvKZiOrCxtfmoHtHH0U8cVLhQ7eoqT0="; + }; + + offlineCache = fetchYarnDeps { + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-4tVTR/Wpcr/nJrBhqV3AowwcUiFNiuohyKn6yQvorvc="; + }; + + 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-period-in-list-item + cp -r . $out/lib/node_modules/textlint-rule-period-in-list-item/ + + runHook postInstall + ''; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-period-in-list-item; + testFile = ./test.md; + }; + + meta = { + description = "Textlint rule that check with or without period in list item"; + homepage = "https://github.com/textlint-rule/textlint-rule-period-in-list-item"; + changelog = "https://github.com/textlint-rule/textlint-rule-period-in-list-item/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-period-in-list-item/test.md b/pkgs/by-name/te/textlint-rule-period-in-list-item/test.md new file mode 100644 index 000000000000..69e2e7132874 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-period-in-list-item/test.md @@ -0,0 +1 @@ +- item. diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 7087ad4145a5..d6355410b9c2 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -12,6 +12,7 @@ textlint-rule-diacritics, textlint-rule-en-max-word-count, textlint-rule-max-comma, + textlint-rule-period-in-list-item, textlint-rule-preset-ja-technical-writing, textlint-rule-stop-words, textlint-rule-terminology, @@ -108,6 +109,7 @@ buildNpmPackage rec { textlint-rule-diacritics textlint-rule-en-max-word-count textlint-rule-max-comma + textlint-rule-period-in-list-item textlint-rule-preset-ja-technical-writing textlint-rule-stop-words textlint-rule-terminology diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 93b2cb53d4c3..3bf0cf7f328c 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -142,6 +142,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-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 inherit (pkgs) textlint-rule-unexpanded-acronym; # Added 2024-05-17 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index f79e524ec525..a68f9c61a5e7 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -224,7 +224,6 @@ , "textlint-rule-abbr-within-parentheses" , "textlint-rule-common-misspellings" , "textlint-rule-no-start-duplicated-conjunction" -, "textlint-rule-period-in-list-item" , "thelounge-plugin-closepms" , "thelounge-plugin-giphy" , "thelounge-plugin-shortcuts" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 381d0daf8d88..199058416540 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93268,28 +93268,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-period-in-list-item = nodeEnv.buildNodePackage { - name = "textlint-rule-period-in-list-item"; - packageName = "textlint-rule-period-in-list-item"; - version = "1.0.1"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-period-in-list-item/-/textlint-rule-period-in-list-item-1.0.1.tgz"; - sha512 = "dNPa4WzePcgsz8A+CxFGQgKNZCEvjjwMCu3DFcpYB4eKuhcSISEiS/mvEO42oGAALJluYdYVZxN3yMD6XzkLBA=="; - }; - dependencies = [ - sources."check-ends-with-period-3.0.2" - sources."emoji-regex-10.3.0" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "textlint rule that check with or without period in list item."; - homepage = "https://github.com/textlint-rule/textlint-rule-period-in-list-item"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; thelounge-plugin-closepms = nodeEnv.buildNodePackage { name = "thelounge-plugin-closepms"; packageName = "thelounge-plugin-closepms"; From 410be13e5c171725f831597313eecaf4fc9bcd01 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 17 May 2024 21:17:14 +0900 Subject: [PATCH 16/18] textlint-rule-abbr-within-parentheses: repackage with fetchYarnDeps (cherry picked from commit 1e8132663768e0381499469251e2eadc5b1d3a20) --- .../package.nix | 79 +++++++++++++++++++ .../test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 + pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 38 --------- 6 files changed, 83 insertions(+), 39 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-abbr-within-parentheses/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-abbr-within-parentheses/test.md diff --git a/pkgs/by-name/te/textlint-rule-abbr-within-parentheses/package.nix b/pkgs/by-name/te/textlint-rule-abbr-within-parentheses/package.nix new file mode 100644 index 000000000000..96e3906930e2 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-abbr-within-parentheses/package.nix @@ -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; + }; +}) diff --git a/pkgs/by-name/te/textlint-rule-abbr-within-parentheses/test.md b/pkgs/by-name/te/textlint-rule-abbr-within-parentheses/test.md new file mode 100644 index 000000000000..224b1703098b --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-abbr-within-parentheses/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(Import From Derivation). diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index d6355410b9c2..b894931fab88 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -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 diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 3bf0cf7f328c..2e6b79dbdbbb 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -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 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index a68f9c61a5e7..f210967f0a64 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -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" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 199058416540..36bea39739e2 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -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"; From edda1892d7f886f16b45246bcbc65fcc05958016 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 17 May 2024 21:25:25 +0900 Subject: [PATCH 17/18] textlint-rule-no-start-duplicated-conjunction: repackage with fetchYarnDeps (cherry picked from commit 950ff0df9280eaaf8fd6d2a7cb0f0b300a1ac42d) --- .../package.nix | 79 +++++++++++++++++++ .../test.md | 3 + pkgs/by-name/te/textlint/package.nix | 2 + pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 45 ----------- 6 files changed, 85 insertions(+), 46 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-no-start-duplicated-conjunction/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-no-start-duplicated-conjunction/test.md diff --git a/pkgs/by-name/te/textlint-rule-no-start-duplicated-conjunction/package.nix b/pkgs/by-name/te/textlint-rule-no-start-duplicated-conjunction/package.nix new file mode 100644 index 000000000000..1390e9ac54b1 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-no-start-duplicated-conjunction/package.nix @@ -0,0 +1,79 @@ +{ + 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; + }; +}) diff --git a/pkgs/by-name/te/textlint-rule-no-start-duplicated-conjunction/test.md b/pkgs/by-name/te/textlint-rule-no-start-duplicated-conjunction/test.md new file mode 100644 index 000000000000..41c8f499942e --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-no-start-duplicated-conjunction/test.md @@ -0,0 +1,3 @@ +But, A is ~. +So, A is ~. +But, A is ~. diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index b894931fab88..2e683c5d0823 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -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 diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 2e6b79dbdbbb..e623708d1618 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -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 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index f210967f0a64..d8563afa47bd 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -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" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 36bea39739e2..bf9019a762d4 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93185,51 +93185,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-no-start-duplicated-conjunction = nodeEnv.buildNodePackage { - name = "textlint-rule-no-start-duplicated-conjunction"; - packageName = "textlint-rule-no-start-duplicated-conjunction"; - version = "2.0.2"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-no-start-duplicated-conjunction/-/textlint-rule-no-start-duplicated-conjunction-2.0.2.tgz"; - sha512 = "HydBbkWjnMn4KrnlpnusY1BGjIG+64UySxRCvRphUAIiuJL2nbkdrIIiOjwfQhllKUa7Sf33bs6RAcbEWjZVfg=="; - }; - dependencies = [ - sources."@textlint/ast-node-types-4.4.3" - sources."@types/unist-2.0.10" - sources."boundary-1.0.1" - sources."buffer-from-1.1.2" - sources."concat-stream-2.0.0" - sources."inherits-2.0.4" - sources."object-assign-4.1.1" - sources."object_values-0.1.2" - sources."readable-stream-3.6.2" - sources."safe-buffer-5.2.1" - sources."sentence-splitter-3.2.3" - sources."string_decoder-1.3.0" - sources."structured-source-3.0.2" - (sources."textlint-rule-helper-2.3.1" // { - dependencies = [ - sources."@textlint/ast-node-types-13.4.1" - sources."boundary-2.0.0" - sources."structured-source-4.0.0" - ]; - }) - sources."typedarray-0.0.6" - sources."unist-util-is-4.1.0" - sources."unist-util-visit-2.0.3" - sources."unist-util-visit-parents-3.1.1" - sources."util-deprecate-1.0.2" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "textlint rule that check no start with duplicated conjunction."; - homepage = "https://github.com/textlint-rule/textlint-rule-no-start-duplicated-conjunction"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; thelounge-plugin-closepms = nodeEnv.buildNodePackage { name = "thelounge-plugin-closepms"; packageName = "thelounge-plugin-closepms"; From 0baa634e8eb61d0bfa144dac2f00338570722e8b Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 25 May 2024 17:02:56 +0900 Subject: [PATCH 18/18] textlint-rule-common-misspellings: repackage There is no lock file in this package, but it is old and stable enough so that we handle dependencies manually. (cherry picked from commit 5f58c6a87d8b20472d9a4fdfe12b2d09c0c6f575) --- .../package.nix | 135 ++++++++++++++++++ .../textlint-rule-common-misspellings/test.md | 1 + pkgs/by-name/te/textlint/package.nix | 2 + pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 25 ---- 6 files changed, 139 insertions(+), 26 deletions(-) create mode 100644 pkgs/by-name/te/textlint-rule-common-misspellings/package.nix create mode 100644 pkgs/by-name/te/textlint-rule-common-misspellings/test.md diff --git a/pkgs/by-name/te/textlint-rule-common-misspellings/package.nix b/pkgs/by-name/te/textlint-rule-common-misspellings/package.nix new file mode 100644 index 000000000000..ad17e2a91092 --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-common-misspellings/package.nix @@ -0,0 +1,135 @@ +{ + lib, + stdenvNoCC, + fetchurl, + fetchFromGitHub, + fetchYarnDeps, + fixup-yarn-lock, + nodejs, + yarn, + textlint, + textlint-rule-common-misspellings, +}: + +# there is no lock file in this package, but it is old and stable enough +# so that we handle dependencies manually +let + misspellings = stdenvNoCC.mkDerivation (finalAttrs: { + pname = "misspellings"; + version = "1.1.0"; + + src = fetchurl { + url = "https://registry.npmjs.org/misspellings/-/misspellings-${finalAttrs.version}.tgz"; + hash = "sha256-+4QxmGjoF0mBldN4XQMvoK8YDS4PBV9/c+/BPf4FbkM="; + }; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib/node_modules/misspellings + cp -r . $out/lib/node_modules/misspellings/ + + runHook postInstall + ''; + }); + + textlint-rule-helper = stdenvNoCC.mkDerivation (finalAttrs: { + pname = "textlint-rule-helper"; + version = "2.3.1"; + + src = fetchFromGitHub { + owner = "textlint"; + repo = "textlint-rule-helper"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-SVeL/3KC/yazSGsmn5We8fJAuVqfcspzN7i2a4+EOlI="; + }; + + offlineCache = fetchYarnDeps { + yarnLock = "${finalAttrs.src}/yarn.lock"; + hash = "sha256-UN56VuUHl7aS+QLON8ZROTSCGKKCn/8xuIkR46LyY+U="; + }; + + 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-helper + cp -r . $out/lib/node_modules/textlint-rule-helper/ + + runHook postInstall + ''; + }); +in +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "textlint-rule-common-misspellings"; + version = "1.0.1"; + + src = fetchurl { + url = "https://registry.npmjs.org/textlint-rule-common-misspellings/-/textlint-rule-common-misspellings-${finalAttrs.version}.tgz"; + hash = "sha256-5QVb5T2yGuunNhRQG5brJQyicRRbO8XewzjO2RzN0bI="; + }; + + dontBuild = true; + + buildInputs = [ + misspellings + textlint-rule-helper + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib/node_modules/textlint-rule-common-misspellings/node_modules/textlint-rule-helper + cp -r ${misspellings}/lib/node_modules/misspellings $out/lib/node_modules/textlint-rule-common-misspellings/node_modules/misspellings + cp -r ${textlint-rule-helper}/lib/node_modules/textlint-rule-helper/node_modules/* $out/lib/node_modules/textlint-rule-common-misspellings/node_modules + cp -r ${textlint-rule-helper}/lib/node_modules/textlint-rule-helper/lib $out/lib/node_modules/textlint-rule-common-misspellings/node_modules/textlint-rule-helper/lib + cp -r ${textlint-rule-helper}/lib/node_modules/textlint-rule-helper/package.json $out/lib/node_modules/textlint-rule-common-misspellings/node_modules/textlint-rule-helper/package.json + + cp -r . $out/lib/node_modules/textlint-rule-common-misspellings/ + + runHook postInstall + ''; + + passthru.tests = textlint.testPackages { + rule = textlint-rule-common-misspellings; + testFile = ./test.md; + }; + + meta = { + description = "Textlint rule to check common misspellings"; + homepage = "https://github.com/io-monad/textlint-rule-common-misspellings"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ natsukium ]; + mainProgram = "textlint-rule-common-misspellings"; + platforms = textlint.meta.platforms; + }; +}) diff --git a/pkgs/by-name/te/textlint-rule-common-misspellings/test.md b/pkgs/by-name/te/textlint-rule-common-misspellings/test.md new file mode 100644 index 000000000000..b0e84d77f2bd --- /dev/null +++ b/pkgs/by-name/te/textlint-rule-common-misspellings/test.md @@ -0,0 +1 @@ +`textlint-rule-common-misspellings` is an old and mature libary. diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 2e683c5d0823..8fea962d8e72 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -10,6 +10,7 @@ textlint-plugin-latex2e, textlint-rule-abbr-within-parentheses, textlint-rule-alex, + textlint-rule-common-misspellings, textlint-rule-diacritics, textlint-rule-en-max-word-count, textlint-rule-max-comma, @@ -109,6 +110,7 @@ buildNpmPackage rec { textlint-plugin-latex2e textlint-rule-abbr-within-parentheses textlint-rule-alex + textlint-rule-common-misspellings textlint-rule-diacritics textlint-rule-en-max-word-count textlint-rule-max-comma diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index e623708d1618..d4588b2ef365 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -140,6 +140,7 @@ mapAliases { 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-common-misspellings; # Added 2024-05-25 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 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index d8563afa47bd..8256f094aab7 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -221,7 +221,6 @@ , "tailwindcss" , "teck-programmer" , "tern" -, "textlint-rule-common-misspellings" , "thelounge-plugin-closepms" , "thelounge-plugin-giphy" , "thelounge-plugin-shortcuts" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index bf9019a762d4..8ab3c12b4f69 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -93160,31 +93160,6 @@ in bypassCache = true; reconstructLock = true; }; - textlint-rule-common-misspellings = nodeEnv.buildNodePackage { - name = "textlint-rule-common-misspellings"; - packageName = "textlint-rule-common-misspellings"; - version = "1.0.1"; - src = fetchurl { - url = "https://registry.npmjs.org/textlint-rule-common-misspellings/-/textlint-rule-common-misspellings-1.0.1.tgz"; - sha512 = "f5KWhQFJzJBUX3RirAS25aSkAaaOHeSHtBeb7d49O+vxnAX3dZBS5DB/e5M1kR4tifW4qae64oqWZygoGYWkjQ=="; - }; - dependencies = [ - sources."misspellings-1.1.0" - sources."textlint-rule-helper-1.2.0" - sources."unist-util-is-3.0.0" - sources."unist-util-visit-1.4.1" - sources."unist-util-visit-parents-2.1.2" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "textlint rule to check common misspellings"; - homepage = "https://github.com/io-monad/textlint-rule-common-misspellings"; - license = "GPL-3.0"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; thelounge-plugin-closepms = nodeEnv.buildNodePackage { name = "thelounge-plugin-closepms"; packageName = "thelounge-plugin-closepms";