push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
{
lib,
fetchFromGitHub,
fetchYarnDeps,
makeWrapper,
nodejs,
stdenv,
yarnBuildHook,
yarnConfigHook,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "graphql-language-service-cli";
version = "3.5.0";
src = fetchFromGitHub {
owner = "graphql";
repo = "graphiql";
tag = "graphql-language-service-cli@${finalAttrs.version}";
hash = "sha256-NJTggaMNMjOP5oN+gHxFTwEdNipPNzTFfA6f975HDgM=";
};
patches = [
./patches/0001-repurpose-vscode-graphql-build-script.patch
];
yarnOfflineCache = fetchYarnDeps {
yarnLock = "${finalAttrs.src}/yarn.lock";
hash = "sha256-ae6KP2sFgw8/8YaTJSPscBlVQ5/bzbvHRZygcMgFAlU=";
};
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
nodejs
makeWrapper
];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,lib}
pushd packages/graphql-language-service-cli
node esbuild.js --minify
# copy package.json for --version command
mv {out/graphql.js,package.json} $out/lib
makeWrapper ${lib.getExe nodejs} $out/bin/graphql-lsp \
--add-flags $out/lib/graphql.js \
popd
runHook postInstall
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
passthru = {
updateScript = ./updater.sh;
};
meta = {
description = "Official, runtime independent Language Service for GraphQL";
homepage = "https://github.com/graphql/graphiql";
changelog = "https://github.com/graphql/graphiql/blob/${finalAttrs.src.tag}/packages/graphql-language-service-cli/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ nathanregner ];
mainProgram = "graphql-lsp";
};
})

View File

@@ -0,0 +1,63 @@
From ceeca9463380ab11483ec22f9e46fdc3f83162b0 Mon Sep 17 00:00:00 2001
From: Nathan Regner <nathanregner@gmail.com>
Date: Sat, 15 Mar 2025 15:50:13 -0600
Subject: [PATCH] Repurpose vscode-graphql build script
Bundling the output script means we don't have to ship 1GB of
`node_modules` (there are lots of unrelated dependencies used by other
packages in the monorepo).
---
.../esbuild.js | 28 ++-----------------
1 file changed, 2 insertions(+), 26 deletions(-)
rename packages/{vscode-graphql => graphql-language-service-cli}/esbuild.js (59%)
diff --git a/packages/vscode-graphql/esbuild.js b/packages/graphql-language-service-cli/esbuild.js
similarity index 59%
rename from packages/vscode-graphql/esbuild.js
rename to packages/graphql-language-service-cli/esbuild.js
index 744f4e60..4b9147fa 100644
--- a/packages/vscode-graphql/esbuild.js
+++ b/packages/graphql-language-service-cli/esbuild.js
@@ -1,12 +1,8 @@
const { build } = require('esbuild');
const [, , arg] = process.argv;
-const logger = console;
-
-const isWatchMode = arg === '--watch';
-
build({
- entryPoints: ['src/extension.ts', 'src/server/index.ts'],
+ entryPoints: ['bin/graphql.js'],
bundle: true,
minify: arg === '--minify',
platform: 'node',
@@ -50,24 +46,4 @@ build({
'liquor',
'twig',
],
-})
- .then(({ errors, warnings }) => {
- if (warnings.length) {
- logger.warn(...warnings);
- }
- if (errors.length) {
- logger.error(...errors);
- }
-
- logger.log('successfully bundled vscode-graphql 🚀');
-
- if (isWatchMode) {
- logger.log('watching... 🕰');
- } else {
- process.exit();
- }
- })
- .catch(err => {
- logger.error(err);
- process.exit(1);
- });
+});
--
2.48.1

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils curl jq nix-update
set -euo pipefail
# this package is part of a monorepo with many tags; nix-update only seems to
# fetch the 10 most recent
# https://github.com/Mic92/nix-update/issues/231
owner="graphql"
repo="graphiql"
version=$(
curl -s ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/graphql/graphiql/git/refs/tags/graphql-language-service-cli" |
jq 'map(.ref | capture("refs/tags/graphql-language-service-cli@(?<version>[0-9.]+)").version) | .[]' -r |
sort --reverse --version-sort | head -n1
)
if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
echo "Already up to date!"
exit 0
fi
nix-update graphql-language-service-cli --version $version