textlint: repackage with buildNpmPackage

This commit is contained in:
natsukium 2024-05-13 22:12:38 +09:00
parent 17a5c56edb
commit f1a746de73
No known key found for this signature in database
GPG Key ID: 9EA45A31DB994C53
5 changed files with 79 additions and 213 deletions

View File

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

View File

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

View File

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

View File

@ -221,7 +221,6 @@
, "tailwindcss"
, "teck-programmer"
, "tern"
, "textlint"
, "textlint-plugin-latex"
, "textlint-rule-abbr-within-parentheses"
, "textlint-rule-alex"

View File

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