{ pkgs ? import <nixpkgs> { config.allowUnfree = true; } }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    # Node.js ecosystem
    nodejs_24
    nodePackages.pnpm
    claude-code
  ];

  shellHook = ''
    echo "Node.js development environment"
    echo "Node version: $(node --version)"
    echo "PNPM version: $(pnpm --version)"

    export PATH="$PWD/node_modules/.bin:$PATH"

    # Install dependencies if package.json exists
    if [ -f "package.json" ] && [ ! -d "node_modules" ]; then
      echo "Installing npm dependencies..."
      pnpm install
    fi
  '';
}
