coc-jest: migrate from nodePackages

This commit is contained in:
dish
2025-11-05 16:38:10 -05:00
parent 2e191e2b1a
commit e1e09af914
8 changed files with 122 additions and 20 deletions

View File

@@ -15,6 +15,7 @@
coc-highlight,
coc-html,
coc-java,
coc-jest,
coc-pyright,
coc-sh,
coc-spell-checker,
@@ -96,6 +97,11 @@ final: prev: {
src = "${coc-java}/lib/node_modules/coc-java";
};
coc-jest = buildVimPlugin {
inherit (coc-jest) pname version meta;
src = "${coc-jest}/lib/node_modules/coc-jest";
};
coc-pyright = buildVimPlugin {
pname = "coc-pyright";
inherit (coc-pyright) version meta;

View File

@@ -7,7 +7,6 @@ final: prev:
let
nodePackageNames = [
"coc-go"
"coc-jest"
"coc-json"
"coc-lists"
"coc-ltex"

View File

@@ -0,0 +1,61 @@
diff --git i/package-lock.json w/package-lock.json
index 9ffdc5f..1aac77b 100644
--- i/package-lock.json
+++ w/package-lock.json
@@ -23,6 +23,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"
},
@@ -453,16 +455,22 @@
},
"node_modules/@types/node": {
"version": "13.11.1",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.1.tgz",
+ "integrity": "sha512-eWQGP3qtxwL8FGneRrC5DwrJLGN4/dH1clNTuLfN81HCrxVtxRjygDTUoZJ5ASlDEeo0ppYFQjQIlXhtXpOn6g==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/which": {
"version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/@types/which/-/which-1.3.2.tgz",
+ "integrity": "sha512-8oDqyLC7eD4HM307boe2QWKyuzdzWBj56xI/imSl2cpL+U3tCMaTAkMJ4ee5JBZ/FsOJlvRGeIShiZDAl1qERA==",
"dev": true,
"license": "MIT"
},
"node_modules/coc.nvim": {
"version": "0.0.79-next.11",
+ "resolved": "https://registry.npmjs.org/coc.nvim/-/coc.nvim-0.0.79-next.11.tgz",
+ "integrity": "sha512-1AAP2N4dno8ee2Sn2EHcVhuyhz7GS+VosqBq1W18KGmN/Ht3ry1kNsX7rsTeM/qroadvjtsIC5kM2ke239AiJw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -516,11 +524,15 @@
},
"node_modules/isexe": {
"version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
"dev": true,
"license": "ISC"
},
"node_modules/typescript": {
"version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz",
+ "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -533,6 +545,8 @@
},
"node_modules/which": {
"version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"license": "ISC",
"dependencies": {

View File

@@ -0,0 +1,34 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
}:
buildNpmPackage {
pname = "coc-jest";
version = "1.1.5-unstable-2025-04-19";
src = fetchFromGitHub {
owner = "neoclide";
repo = "coc-jest";
rev = "0ce2cd21c535e0c6c86102bc4da95337cb29948b";
hash = "sha256-jEwQxZWyKh5tgdRD0f/jQ3q9B/fIGD9Pd8AYDsBj4LQ=";
};
patches = [
./package-lock-fix.patch
];
npmDepsHash = "sha256-4X6lmblZnAF+4ZmrWYwfigO90Ah7I+B4tbMpFrguxMU=";
npmBuildScript = "prepare";
passthru.updateScript = ./update.sh;
meta = {
description = "Jest extension for coc.nvim";
homepage = "https://github.com/neoclide/coc-jest";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pyrox0 ];
};
}

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash nodejs nix-update git
WORKDIR=$(mktemp -d)
PACKAGE_DIR="$(realpath "$(dirname "$0")")"
# Clone source
git clone "https://github.com/neoclide/coc-jest" "$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 --version=branch "$UPDATE_NIX_PNAME"
# Cleanup
rm -rf "$WORKDIR"

View File

@@ -86,6 +86,7 @@ mapAliases {
inherit (pkgs) coc-html; # Added 2025-11-05
coc-imselect = throw "coc-imselect was removed because it was broken"; # added 2023-08-21
inherit (pkgs) coc-java; # Added 2025-11-05
inherit (pkgs) coc-jest; # Added 2025-11-05
inherit (pkgs) coc-pyright; # added 2024-07-14
coc-metals = throw "coc-metals was removed because it was deprecated upstream. vimPlugins.nvim-metals is its official replacement."; # Added 2024-10-16
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

View File

@@ -22,7 +22,6 @@
, "cdk8s-cli"
, "clipboard-cli"
, "coc-go"
, "coc-jest"
, "coc-json"
, "coc-lists"
, "coc-ltex"

View File

@@ -37668,24 +37668,6 @@ in
bypassCache = true;
reconstructLock = true;
};
coc-jest = nodeEnv.buildNodePackage {
name = "coc-jest";
packageName = "coc-jest";
version = "1.1.5";
src = fetchurl {
url = "https://registry.npmjs.org/coc-jest/-/coc-jest-1.1.5.tgz";
sha512 = "H6j4hqmsF2b4hSfGQqaXeCahs3LnyYQc6vbtrSkuMQRdosh0gcZQx186kbxph8/5Mecw22Y9BGcsEaF2/RLEbw==";
};
buildInputs = globalBuildInputs;
meta = {
description = "jest extension for coc.nvim";
homepage = "https://github.com/neoclide/coc-jest#readme";
license = "MIT";
};
production = true;
bypassCache = true;
reconstructLock = true;
};
coc-json = nodeEnv.buildNodePackage {
name = "coc-json";
packageName = "coc-json";