lol

Merge pull request #211227 from 06kellyjac/deno

deno: 1.29.3 -> 1.29.4

authored by

Nick Cao and committed by
GitHub
428f4027 4b91dcfc

+93 -8
+4 -3
pkgs/development/web/deno/default.nix
··· 17 17 18 18 rustPlatform.buildRustPackage rec { 19 19 pname = "deno"; 20 - version = "1.29.3"; 20 + version = "1.29.4"; 21 21 22 22 src = fetchFromGitHub { 23 23 owner = "denoland"; 24 24 repo = pname; 25 25 rev = "v${version}"; 26 - sha256 = "sha256-CH0uri8mnpcojuE8Pil/gsvEfDu/txjCevvGjqhiK1k="; 26 + sha256 = "sha256-oCBtqOm/d5dpIv70/Ht0M6izxdvm59LCiDHgcMcwLek="; 27 27 }; 28 - cargoSha256 = "sha256-I7MIcZeMQzgplza8YAqmuWaX4Gw3ZoDXHyzq/5opO4M="; 28 + cargoSha256 = "sha256-Y/1yfCeWleNrk5MgkIoAtkH8e6YSZWa+GF5RgLaZXQA="; 29 29 30 30 postPatch = '' 31 31 # upstream uses lld on aarch64-darwin for faster builds ··· 85 85 ''; 86 86 87 87 passthru.updateScript = ./update/update.ts; 88 + passthru.tests = callPackage ./tests { }; 88 89 89 90 meta = with lib; { 90 91 homepage = "https://deno.land/";
+5 -5
pkgs/development/web/deno/librusty_v8.nix
··· 11 11 }; 12 12 in 13 13 fetch_librusty_v8 { 14 - version = "0.60.0"; 14 + version = "0.60.1"; 15 15 shas = { 16 - x86_64-linux = "sha256-2cq9fpKhx3ctZ5Lo2RofXD5bXfVUUN6bRtG453MQMW4="; 17 - aarch64-linux = "sha256-hjVUzCYdGkc3kMC/cSXDFOaqJmMBi83dqqASS5R2158="; 18 - x86_64-darwin = "sha256-EyYWfDU0eVFVzSVAHBFUbsppzpHtwe+Fd+z2ZmIub2c="; 19 - aarch64-darwin = "sha256-2VyEFqWsPZlkEDvNxkmrMCIKfsO7LAO+VvsjSMcyFUo="; 16 + x86_64-linux = "sha256-P8H+XJqrt9jdKM885L1epMldp+stwmEw+0Gtd2x3r4g="; 17 + aarch64-linux = "sha256-frHpBP2pL3o4efFLHP2r3zsWJrNT93yYu2Qkxv+7m8Y="; 18 + x86_64-darwin = "sha256-taewoYBkyikqWueLSD9dW1EDjzkV68Xplid1UaLZgRM="; 19 + aarch64-darwin = "sha256-s2YEVbuYpiT/qrmE37aXk13MetrnJo6l+s1Q2y6b5kU="; 20 20 }; 21 21 }
+1
pkgs/development/web/deno/tests/basic.ts
··· 1 + console.log(1 + 1)
+68
pkgs/development/web/deno/tests/default.nix
··· 1 + { deno, runCommand, lib, testers }: 2 + let 3 + testDenoRun = 4 + name: 5 + { args ? "" 6 + , dir ? ./. + "/${name}" 7 + , file ? "index.ts" 8 + , expected ? "" 9 + , expectFailure ? false 10 + }: 11 + let 12 + command = "deno run ${args} ${dir}/${file}"; 13 + in 14 + runCommand "deno-test-${name}" { nativeBuildInputs = [ deno ]; meta.timeout = 60; } '' 15 + HOME=$(mktemp -d) 16 + if output=$(${command} 2>&1); then 17 + if [[ $output =~ '${expected}' ]]; then 18 + echo "Test '${name}' passed" 19 + touch $out 20 + else 21 + echo -n ${lib.escapeShellArg command} >&2 22 + echo " output did not match what was expected." >&2 23 + echo "The expected was:" >&2 24 + echo '${expected}' >&2 25 + echo "The output was:" >&2 26 + echo "$output" >&2 27 + exit 1 28 + fi 29 + else 30 + if [[ "${toString expectFailure}" == "1" ]]; then 31 + echo "Test '${name}' failed as expected" 32 + touch $out 33 + exit 0 34 + fi 35 + echo -n ${lib.escapeShellArg command} >&2 36 + echo " returned a non-zero exit code." >&2 37 + echo "$output" >&2 38 + exit 1 39 + fi 40 + ''; 41 + in 42 + (lib.mapAttrs testDenoRun { 43 + basic = { 44 + dir = ./.; 45 + file = "basic.ts"; 46 + expected = "2"; 47 + }; 48 + import-json = { 49 + expected = "hello from JSON"; 50 + }; 51 + import-ts = { 52 + expected = "hello from ts"; 53 + }; 54 + read-file = { 55 + args = "--allow-read"; 56 + expected = "hello from a file"; 57 + }; 58 + fail-read-file = { 59 + expectFailure = true; 60 + dir = ./read-file; 61 + }; 62 + }) // 63 + { 64 + version = testers.testVersion { 65 + package = deno; 66 + command = "deno --version"; 67 + }; 68 + }
+1
pkgs/development/web/deno/tests/import-json/data.json
··· 1 + { "msg": "hello from JSON" }
+2
pkgs/development/web/deno/tests/import-json/index.ts
··· 1 + import file from "./data.json" assert { type: "json" }; 2 + console.log(file.msg);
+3
pkgs/development/web/deno/tests/import-ts/index.ts
··· 1 + import { sayHello } from "./lib.ts" 2 + 3 + sayHello("ts")
+3
pkgs/development/web/deno/tests/import-ts/lib.ts
··· 1 + export function sayHello(thing: string) { 2 + console.log(`hello from ${thing}`); 3 + }
+1
pkgs/development/web/deno/tests/read-file/data.txt
··· 1 + hello from a file
+5
pkgs/development/web/deno/tests/read-file/index.ts
··· 1 + // trim 'file://' prefix 2 + const thisDir = Deno.mainModule.substring(7, Deno.mainModule.length); 3 + const getParent = (path: string) => path.substring(0, path.lastIndexOf("/")) 4 + const text = await Deno.readTextFile(getParent(thisDir) + "/data.txt"); 5 + console.log(text);