coc-pairs: migrate from nodePackages

This commit is contained in:
dish
2025-11-06 15:37:49 -05:00
parent 6c67d0ee2d
commit b96b2c33bb
8 changed files with 95 additions and 20 deletions
@@ -19,6 +19,7 @@
coc-json,
coc-lists,
coc-markdownlint,
coc-pairs,
coc-pyright,
coc-sh,
coc-spell-checker,
@@ -120,6 +121,11 @@ final: prev: {
src = "${coc-markdownlint}/lib/node_modules/coc-markdownlint";
};
coc-pairs = buildVimPlugin {
inherit (coc-pairs) pname version meta;
src = "${coc-pairs}/lib/node_modules/coc-pairs";
};
coc-pyright = buildVimPlugin {
pname = "coc-pyright";
inherit (coc-pyright) version meta;
@@ -8,7 +8,6 @@ let
nodePackageNames = [
"coc-go"
"coc-ltex"
"coc-pairs"
"coc-prettier"
"coc-r-lsp"
"coc-rust-analyzer"
@@ -0,0 +1,28 @@
diff --git c/package-lock.json i/package-lock.json
index ee9b22f..4d693ab 100644
--- c/package-lock.json
+++ i/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "coc-pairs",
- "version": "1.5.1",
+ "version": "1.5.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coc-pairs",
- "version": "1.5.1",
+ "version": "1.5.2",
"license": "MIT",
"devDependencies": {
"@chemzqm/tsconfig": "^0.0.3",
@@ -20,6 +20,8 @@
},
"node_modules/@chemzqm/tsconfig": {
"version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/@chemzqm/tsconfig/-/tsconfig-0.0.3.tgz",
+ "integrity": "sha512-MjF25vbqLYR+S+JJLgBi0vn4gZqv/C87H+yPSlVKEqlIJAJOGJOgFPUFvRS7pdRHqkv2flX/oRxzxhlu2V0X1w==",
"dev": true,
"license": "MIT"
},
+32
View File
@@ -0,0 +1,32 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
}:
buildNpmPackage (finalAttrs: {
pname = "coc-pairs";
version = "1.5.2";
src = fetchFromGitHub {
owner = "neoclide";
repo = "coc-pairs";
tag = finalAttrs.version;
hash = "sha256-CUNnNS8mRjyVyjFw4dLnFpskdZNn/+UjVwOcuZJkeNw=";
};
patches = [
./package-lock-fix.patch
];
npmDepsHash = "sha256-yIMed7x5EzJMMhsA/O08kLpVYMujyJq1qol/KilxxTs=";
passthru.updateScript = ./update.sh;
meta = {
description = "Basic auto pairs extension for coc.nvim";
homepage = "https://github.com/neoclide/coc-pairs";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pyrox0 ];
};
})
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash nodejs nix-update git curl jq
WORKDIR=$(mktemp -d)
PACKAGE_DIR="$(realpath "$(dirname "$0")")"
# Get latest tag
NEW_VERSION=$(curl "https://api.github.com/repos/neoclide/coc-pairs/tags" | jq -r '.[] | .name' | sort --version-sort | tail -1)
if [[ "$UPDATE_NIX_OLD_VERSION" == "$NEW_VERSION" ]]; then
echo "package is up to date: $UPDATE_NIX_OLD_VERSION"
exit 0
fi
# Clone source
git clone "https://github.com/neoclide/coc-pairs" -b "$NEW_VERSION" "$WORKDIR/src"
pushd "$WORKDIR/src"
npx --yes npm-package-lock-add-resolved
# Update package-lock patch
git diff >"$PACKAGE_DIR/package-lock-fix.patch"
popd
# Run nix-update
nix-update "$UPDATE_NIX_PNAME"
# Cleanup
rm -rf "$WORKDIR"
@@ -91,6 +91,7 @@ mapAliases {
inherit (pkgs) coc-lists; # Added 2025-11-05
inherit (pkgs) coc-markdownlint; # Added 2025-11-05
coc-metals = throw "coc-metals was removed because it was deprecated upstream. vimPlugins.nvim-metals is its official replacement."; # Added 2024-10-16
inherit (pkgs) coc-pairs; # added 2025-11-05
inherit (pkgs) coc-pyright; # added 2024-07-14
coc-python = throw "coc-python was removed because it was abandoned upstream on 2020-12-24. Upstream now recommends using coc-pyright or coc-jedi instead."; # added 2024-10-15
coc-rls = throw "coc-rls was removed because rls was deprecated in 2022. You should use coc-rust-analyzer instead, as rust-analyzer is maintained."; # added 2025-10-01
@@ -23,7 +23,6 @@
, "clipboard-cli"
, "coc-go"
, "coc-ltex"
, "coc-pairs"
, "coc-prettier"
, "coc-r-lsp"
, "coc-rust-analyzer"
-18
View File
@@ -37686,24 +37686,6 @@ in
bypassCache = true;
reconstructLock = true;
};
coc-pairs = nodeEnv.buildNodePackage {
name = "coc-pairs";
packageName = "coc-pairs";
version = "1.5.1";
src = fetchurl {
url = "https://registry.npmjs.org/coc-pairs/-/coc-pairs-1.5.1.tgz";
sha512 = "/wQOKlptsj2KB4yoIBYN3xtTbCKSsGbRdkNAeYCKCQZX0J5uVMFNgo363+k1BVp9KrkWQDlvVluF3Xf1ei8PfA==";
};
buildInputs = globalBuildInputs;
meta = {
description = "Auto pair extension for coc.nvim";
homepage = "https://github.com/neoclide/coc-pairs#readme";
license = "MIT";
};
production = true;
bypassCache = true;
reconstructLock = true;
};
coc-prettier = nodeEnv.buildNodePackage {
name = "coc-prettier";
packageName = "coc-prettier";