vtsls: init at 0.2.6 (#347284)
This commit is contained in:
commit
4ac41e0f5f
@ -11951,6 +11951,13 @@
|
||||
name = "André Kugland";
|
||||
keys = [ { fingerprint = "6A62 5E60 E3FF FCAE B3AA 50DC 1DA9 3817 80CD D833"; } ];
|
||||
};
|
||||
kuglimon = {
|
||||
name = "Tatu Argillander";
|
||||
email = "tatu.argillander@kouralabs.com";
|
||||
github = "kuglimon";
|
||||
githubId = 629430;
|
||||
keys = [ { fingerprint = "2843 750C B1AB E256 94BE 40E2 D843 D30B 42CA 0E2D"; } ];
|
||||
};
|
||||
kupac = {
|
||||
github = "Kupac";
|
||||
githubId = 8224569;
|
||||
|
93
pkgs/by-name/vt/vtsls/package.nix
Normal file
93
pkgs/by-name/vt/vtsls/package.nix
Normal file
@ -0,0 +1,93 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
nodejs_22,
|
||||
gitMinimal,
|
||||
pnpm_8,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "vtsls";
|
||||
version = "0.2.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "yioneko";
|
||||
repo = "vtsls";
|
||||
rev = "server-v${finalAttrs.version}";
|
||||
hash = "sha256-HCi9WLh4IEfhgkQNUVk6IGkQfYagg805Rix78zG6xt0=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs_22
|
||||
# patches are applied with git during build
|
||||
gitMinimal
|
||||
pnpm_8.configHook
|
||||
];
|
||||
|
||||
buildInputs = [ nodejs_22 ];
|
||||
|
||||
pnpmWorkspaces = [ "@vtsls/language-server" ];
|
||||
|
||||
pnpmDeps = pnpm_8.fetchDeps {
|
||||
inherit (finalAttrs)
|
||||
pnpmWorkspaces
|
||||
pname
|
||||
src
|
||||
version
|
||||
;
|
||||
hash = "sha256-4XxQ0Z2atTBItrD9iY7q5rJaCmb1EeDBvQ5+L3ceRXI=";
|
||||
};
|
||||
|
||||
# Patches to get submodule sha from file instead of 'git submodule status'
|
||||
patches = [ ./vtsls-build-patch.patch ];
|
||||
|
||||
# Skips manual confirmations during build
|
||||
CI = true;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# During build vtsls needs a working git installation.
|
||||
git config --global user.name nixbld
|
||||
git config --global user.email nixbld@example.com
|
||||
|
||||
# during build this sha is used as a marker to skip applying patches and
|
||||
# copying files, which doesn't matter in this case
|
||||
echo "dummysha" > ./packages/service/HEAD
|
||||
|
||||
# Requires a git repository during build
|
||||
git init packages/service/vscode
|
||||
|
||||
# Depends on the @vtsls/language-service workspace
|
||||
# '--workspace-concurrency=1' helps debug failing builds.
|
||||
pnpm --filter "@vtsls/language-server..." build
|
||||
|
||||
# These trash deterministic builds. During build the whole directory is
|
||||
# copied to another path.
|
||||
rm -rf packages/service/vscode/.git
|
||||
rm -rf packages/service/src/typescript-language-features/.git
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,lib/vtsls-language-server}
|
||||
cp -r {packages,node_modules} $out/lib/vtsls-language-server
|
||||
ln -s $out/lib/vtsls-language-server/packages/server/bin/vtsls.js $out/bin/vtsls
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "LSP wrapper for typescript extension of vscode.";
|
||||
homepage = "https://github.com/yioneko/vtsls";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ kuglimon ];
|
||||
mainProgram = "vtsls";
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
})
|
18
pkgs/by-name/vt/vtsls/vtsls-build-patch.patch
Normal file
18
pkgs/by-name/vt/vtsls/vtsls-build-patch.patch
Normal file
@ -0,0 +1,18 @@
|
||||
diff --git a/packages/service/scripts/patch.js b/packages/service/scripts/patch.js
|
||||
index 2d01f3a..f26c216 100644
|
||||
--- a/packages/service/scripts/patch.js
|
||||
+++ b/packages/service/scripts/patch.js
|
||||
@@ -13,11 +13,7 @@ const vscTsExtPath = path.resolve(__dirname, "../vscode/extensions/typescript-la
|
||||
const tsExtPath = path.resolve(__dirname, "../src/typescript-language-features");
|
||||
|
||||
async function getVscodeSha() {
|
||||
- const { stdout } = await exec("git", ["submodule", "status", "vscode"], {
|
||||
- cwd: path.resolve(__dirname, "../"),
|
||||
- });
|
||||
- const commit = stdout.match(/^\s*([^\s]+)\s/)[1];
|
||||
- return commit;
|
||||
+ return await fs.readFile('./HEAD', { encoding: 'utf8' });
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user