vim-language-server: use to yarn{Build,Config}Hook

This commit is contained in:
Doron Behar 2024-06-07 16:22:57 +03:00
parent ee7cfec5aa
commit 64facc446a
2 changed files with 19 additions and 65 deletions

View File

@ -1,49 +0,0 @@
{
"name": "vim-language-server",
"version": "2.3.1",
"description": "vim language server",
"keywords": [
"viml",
"vim",
"lsp",
"language",
"server",
"autocomplete"
],
"main": "./out/index.js",
"repository": "https://github.com/iamcco/vim-language-server",
"author": "iamcco <ooiss@qq.com>",
"license": "MIT",
"scripts": {
"build-docs": "rm ./src/docs/builtin-docs.json && ./bin/build-docs.js",
"build": "rm -rf ./out && webpack",
"watch": "webpack -w",
"test": "mocha test/src/**/*.ts --require ts-node/register",
"lint": "tslint -c tslint.json --format verbose {.,test}/src/**/*.ts src/index.ts",
"fix": "tslint -c tslint.json --fix {.,test}/src/**/*.ts src/index.ts"
},
"bin": {
"vim-language-server": "./bin/index.js"
},
"devDependencies": {
"@types/mocha": "^7.0.2",
"@types/node": "^11.13.6",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"fast-glob": "^3.2.4",
"findup": "^0.1.5",
"mocha": "^7.1.2",
"rxjs": "^6.6.7",
"rxjs-operators": "^1.1.3",
"shvl": "^2.0.0",
"ts-loader": "^8.1.0",
"ts-node": "^9.1.1",
"tslint": "^6.1.3",
"typescript": "^4.2.3",
"vscode-languageserver": "^7.0.0",
"vscode-languageserver-textdocument": "^1.0.1",
"vscode-uri": "^3.0.2",
"webpack": "^5.30.0",
"webpack-cli": "^4.6.0"
}
}

View File

@ -1,38 +1,41 @@
{ lib
, mkYarnPackage
, stdenv
, fetchFromGitHub
, fetchYarnDeps
, yarnConfigHook
, yarnBuildHook
, nodejs
, npmHooks
}:
mkYarnPackage rec {
stdenv.mkDerivation (finalAttrs: {
pname = "vim-language-server";
version = "2.3.1";
src = fetchFromGitHub {
owner = "iamcco";
repo = "vim-language-server";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-NfBKNCTvCMIJrSiTlCG+LtVoMBMdCc3rzpDb9Vp2CGM=";
};
packageJSON = ./package.json;
offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-mo8urQaWIHu33+r0Y7mL9mJ/aSe/5CihuIetTeDHEUQ=";
};
buildPhase = ''
runHook preBuild
export HOME=$(mktemp -d)
# https://stackoverflow.com/a/69699772/4935114
env NODE_OPTIONS=--openssl-legacy-provider yarn --offline build
runHook postBuild
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
# Needed for executing package.json scripts
nodejs
npmHooks.npmInstallHook
];
# https://stackoverflow.com/a/69699772/4935114
preBuild = ''
export NODE_OPTIONS=--openssl-legacy-provider
'';
doDist = false;
meta = with lib; {
description = "VImScript language server, LSP for vim script";
homepage = "https://github.com/iamcco/vim-language-server";
@ -40,4 +43,4 @@ mkYarnPackage rec {
maintainers = with maintainers; [ doronbehar ];
mainProgram = "vim-language-server";
};
}
})