diff --git a/pkgs/applications/editors/vscode/extensions/anthropic.claude-code/default.nix b/pkgs/applications/editors/vscode/extensions/anthropic.claude-code/default.nix index 0f9df73767fa..511cb04a355a 100644 --- a/pkgs/applications/editors/vscode/extensions/anthropic.claude-code/default.nix +++ b/pkgs/applications/editors/vscode/extensions/anthropic.claude-code/default.nix @@ -7,8 +7,8 @@ vscode-utils.buildVscodeMarketplaceExtension { mktplcRef = { name = "claude-code"; publisher = "anthropic"; - version = "2.0.59"; - hash = "sha256-rVbKynudnoXLgd5upcCWqkrZsV4739d6qV31HWI2TX0="; + version = "2.0.61"; + hash = "sha256-dZu2CIjRyvAhTRwOuQV2s0SoEUQko+dQfnQg6ECwLv4="; }; meta = { diff --git a/pkgs/by-name/cl/claude-code/package-lock.json b/pkgs/by-name/cl/claude-code/package-lock.json index d6d52f786062..857d56f650e8 100644 --- a/pkgs/by-name/cl/claude-code/package-lock.json +++ b/pkgs/by-name/cl/claude-code/package-lock.json @@ -1,12 +1,12 @@ { "name": "@anthropic-ai/claude-code", - "version": "2.0.59", + "version": "2.0.61", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@anthropic-ai/claude-code", - "version": "2.0.59", + "version": "2.0.61", "license": "SEE LICENSE IN README.md", "bin": { "claude": "cli.js" diff --git a/pkgs/by-name/cl/claude-code/package.nix b/pkgs/by-name/cl/claude-code/package.nix index 6d8fcfbd239c..95ced91e418f 100644 --- a/pkgs/by-name/cl/claude-code/package.nix +++ b/pkgs/by-name/cl/claude-code/package.nix @@ -1,3 +1,7 @@ +# NOTE: Use the following command to update the package +# ```sh +# nix-shell maintainers/scripts/update.nix --argstr commit true --arg predicate '(path: pkg: builtins.elem path [["claude-code"] ["vscode-extensions" "anthropic" "claude-code"]])' +# ``` { lib, buildNpmPackage, @@ -7,18 +11,14 @@ }: buildNpmPackage (finalAttrs: { pname = "claude-code"; - # NOTE: Use the following command to update the package - # ```sh - # nix-shell maintainers/scripts/update.nix --argstr commit true --argstr package vscode-extensions.anthropic.claude-code && nix-shell maintainers/scripts/update.nix --argstr commit true --argstr package claude-code - # ``` - version = "2.0.59"; + version = "2.0.61"; src = fetchzip { url = "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${finalAttrs.version}.tgz"; - hash = "sha256-Fl7KpzW8PemrCqQRju8/oWBTZ1Z3cCg0RZ1CAfMQAkY="; + hash = "sha256-701TwdPtqudwKuphVngMiI6TbM9y1S/HFVTREhkHgdY="; }; - npmDepsHash = "sha256-VaEsT9Iw+iIqWFqOrpZS2O8PRhNOcxwdPHM3SbnhN8s="; + npmDepsHash = "sha256-lPWrFSintH3/4T5IKSH9tBX3q3Ow/L0ptk+NsVGR+uQ="; postPatch = '' cp ${./package-lock.json} package-lock.json diff --git a/pkgs/by-name/cl/claude-code/update.sh b/pkgs/by-name/cl/claude-code/update.sh index a3fe5d871a99..870f73308600 100755 --- a/pkgs/by-name/cl/claude-code/update.sh +++ b/pkgs/by-name/cl/claude-code/update.sh @@ -1,5 +1,5 @@ -#!/usr/bin/env nix-shell -#!nix-shell --pure --keep NIX_PATH -i bash --packages nodejs nix-update git cacert +#!/usr/bin/env nix +#!nix shell --ignore-environment .#cacert .#nodejs .#git .#nix-update .#nix .#gnused .#findutils .#bash --command bash set -euo pipefail @@ -7,4 +7,9 @@ version=$(npm view @anthropic-ai/claude-code version) # Update version and hashes AUTHORIZED=1 NIXPKGS_ALLOW_UNFREE=1 nix-update claude-code --version="$version" --generate-lockfile -nix-update vscode-extensions.anthropic.claude-code --use-update-script --version "$version" + +# nix-update can't update package-lock.json along with npmDepsHash +# TODO: Remove this workaround if nix-update can update package-lock.json along with npmDepsHash. +(nix-build --expr '((import ./.) { system = builtins.currentSystem; }).claude-code.npmDeps.overrideAttrs { outputHash = ""; outputHashAlgo = "sha256"; }' 2>&1 || true) \ +| sed -nE '$s/ *got: *(sha256-[A-Za-z0-9+/=-]+).*/\1/p' \ +| xargs -I{} sed -i 's|npmDepsHash = "sha256-[^"]*";|npmDepsHash = "{}";|' pkgs/by-name/cl/claude-code/package.nix