summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Daniels <mdaniels5757@gmail.com>2026-01-18 20:17:57 +0000
committerGitHub <noreply@github.com>2026-01-18 20:17:57 +0000
commit9ebfe6d2a73f14e4cb4b346356934214297eef7a (patch)
tree65a98349a08d0da59f4f43f4f258bafea664526b
parente2914ac84a61a66deb81fb389c963a7bc339bd60 (diff)
parent8db56aee4d058df2fd6b9f0146d319d070074743 (diff)
tsx: modernize, 4.19.3 -> 4.21.0, add self as maintainer (#458471)
-rw-r--r--pkgs/by-name/ts/tsx/package.nix33
1 files changed, 21 insertions, 12 deletions
diff --git a/pkgs/by-name/ts/tsx/package.nix b/pkgs/by-name/ts/tsx/package.nix
index 9f836c1c5bdc..ac2e8a6ccd28 100644
--- a/pkgs/by-name/ts/tsx/package.nix
+++ b/pkgs/by-name/ts/tsx/package.nix
@@ -2,35 +2,36 @@
lib,
stdenv,
fetchFromGitHub,
- pnpm_9,
+ pnpm_10,
fetchPnpmDeps,
pnpmConfigHook,
nodejs_22,
versionCheckHook,
+ nix-update-script,
}:
let
- pnpm' = pnpm_9.override { nodejs = nodejs_22; };
+ pnpm' = pnpm_10.override { nodejs = nodejs_22; };
in
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
pname = "tsx";
- version = "4.19.3";
+ version = "4.21.0";
src = fetchFromGitHub {
owner = "privatenumber";
repo = "tsx";
- tag = "v${version}";
- hash = "sha256-wdv2oqJNc6U0Fyv4jT+0LUcYaDfodHk1vQZGMdyFF/E=";
+ tag = "v${finalAttrs.version}";
+ hash = "sha256-vlVRq637l84xi9Og0ryzYuu+1b/eBq13jQJIptY0u0o=";
};
pnpmDeps = fetchPnpmDeps {
- inherit
+ inherit (finalAttrs)
pname
version
src
;
pnpm = pnpm';
fetcherVersion = 1;
- hash = "sha256-57KDZ9cHb7uqnypC0auIltmYMmIhs4PWyf0HTRWEFiU=";
+ hash = "sha256-6ZizQtZC43yXrz634VXksRCKGkDKryICvT3Q+JCuIEw=";
};
nativeBuildInputs = [
@@ -54,7 +55,7 @@ stdenv.mkDerivation rec {
# because tsx uses semantic-release, the package.json has a placeholder
# version number. this patches it to match the version of the nix package,
# which in turn is the release version in github.
- substituteInPlace package.json --replace-fail "0.0.0-semantic-release" "${version}"
+ substituteInPlace package.json --replace-fail "0.0.0-semantic-release" "${finalAttrs.version}"
runHook postPatch
'';
@@ -62,7 +63,10 @@ stdenv.mkDerivation rec {
buildPhase = ''
runHook preBuild
- npm run build
+ pnpm run build
+
+ # remove unneeded files
+ find dist -type f \( -name '*.cts' -or -name '*.mts' -or -name '*.ts' \) -delete
# remove devDependencies that are only required to build
# and package the typescript code
@@ -93,11 +97,16 @@ stdenv.mkDerivation rec {
];
doInstallCheck = true;
+ passthru.updateScript = nix-update-script { };
+
meta = {
description = "TypeScript Execute (tsx): The easiest way to run TypeScript in Node.js";
homepage = "https://tsx.is";
license = lib.licenses.mit;
- maintainers = [ lib.maintainers.sdedovic ];
+ maintainers = with lib.maintainers; [
+ sdedovic
+ higherorderlogic
+ ];
mainProgram = "tsx";
};
-}
+})