1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-08 23:28:18 -05:00

Merge branch 'main' into open-flag-on-serve

This commit is contained in:
HasanAlrimawi 2024-09-01 14:50:57 +03:00 committed by GitHub
commit fb4d2afdc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
193 changed files with 1135 additions and 1515 deletions

View file

@ -65,7 +65,7 @@
"third_party"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.91.6.wasm",
"https://plugins.dprint.dev/typescript-0.91.7.wasm",
"https://plugins.dprint.dev/json-0.19.3.wasm",
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
"https://plugins.dprint.dev/toml-0.6.2.wasm",

View file

@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify";
// Bump this number when you want to purge the cache.
// Note: the tools/release/01_bump_crate_versions.ts script will update this version
// automatically via regex, so ensure that this line maintains this format.
const cacheVersion = 13;
const cacheVersion = 14;
const ubuntuX86Runner = "ubuntu-22.04";
const ubuntuX86XlRunner = "ubuntu-22.04-xl";

View file

@ -367,8 +367,8 @@ jobs:
path: |-
~/.cargo/registry/index
~/.cargo/registry/cache
key: '13-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
restore-keys: '13-cargo-home-${{ matrix.os }}-${{ matrix.arch }}'
key: '14-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
restore-keys: '14-cargo-home-${{ matrix.os }}-${{ matrix.arch }}'
if: '!(matrix.skip)'
- name: Restore cache build output (PR)
uses: actions/cache/restore@v4
@ -381,7 +381,7 @@ jobs:
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: '13-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
restore-keys: '14-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
- name: Apply and update mtime cache
if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))'
uses: ./.github/mtime_cache
@ -670,7 +670,7 @@ jobs:
!./target/*/gn_out
!./target/*/*.zip
!./target/*/*.tar.gz
key: '13-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
key: '14-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
publish-canary:
name: publish canary
runs-on: ubuntu-22.04

279
Cargo.lock generated
View file

@ -454,7 +454,7 @@ version = "0.69.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"cexpr",
"clang-sys",
"itertools 0.10.5",
@ -494,9 +494,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.5.0"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
dependencies = [
"serde",
]
@ -1063,7 +1063,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b28bfe653d79bd16c77f659305b195b82bb5ce0c0eb2a4846b82ddbd77586813"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"libloading 0.8.3",
"winapi",
]
@ -1146,7 +1146,7 @@ dependencies = [
[[package]]
name = "deno"
version = "1.46.1"
version = "2.0.0-rc.0"
dependencies = [
"anstream",
"async-trait",
@ -1272,11 +1272,10 @@ dependencies = [
[[package]]
name = "deno_ast"
version = "0.41.2"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a8207814a257d99164dbf780a73b9dee17af4db983f4b23ffbf20c7340d52f5"
checksum = "3b08d11d9e4086b00d3428650e31153cf5896586411763cb88a6423ce5b18791"
dependencies = [
"anyhow",
"base64 0.21.7",
"deno_media_type",
"deno_terminal 0.1.1",
@ -1284,6 +1283,7 @@ dependencies = [
"once_cell",
"percent-encoding",
"serde",
"sourcemap 9.0.0",
"swc_atoms",
"swc_bundler",
"swc_common",
@ -1316,7 +1316,7 @@ dependencies = [
[[package]]
name = "deno_bench_util"
version = "0.160.0"
version = "0.161.0"
dependencies = [
"bencher",
"deno_core",
@ -1325,7 +1325,7 @@ dependencies = [
[[package]]
name = "deno_broadcast_channel"
version = "0.160.0"
version = "0.161.0"
dependencies = [
"async-trait",
"deno_core",
@ -1335,7 +1335,7 @@ dependencies = [
[[package]]
name = "deno_cache"
version = "0.98.0"
version = "0.99.0"
dependencies = [
"async-trait",
"deno_core",
@ -1365,7 +1365,7 @@ dependencies = [
[[package]]
name = "deno_canvas"
version = "0.35.0"
version = "0.36.0"
dependencies = [
"deno_core",
"deno_webgpu",
@ -1375,9 +1375,9 @@ dependencies = [
[[package]]
name = "deno_config"
version = "0.30.1"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9657dbcc5210407fd9a1b1571310f2fe25c6dd6be2195c964d19f43d70045a95"
checksum = "c774f2e49b4ca47f1fe5c39e1775d1434280a4f168252fed8f4a3f2230868448"
dependencies = [
"anyhow",
"deno_package_json",
@ -1397,7 +1397,7 @@ dependencies = [
[[package]]
name = "deno_console"
version = "0.166.0"
version = "0.167.0"
dependencies = [
"deno_core",
]
@ -1427,7 +1427,7 @@ dependencies = [
"serde_json",
"serde_v8",
"smallvec",
"sourcemap",
"sourcemap 8.0.1",
"static_assertions",
"tokio",
"url",
@ -1442,7 +1442,7 @@ checksum = "a13951ea98c0a4c372f162d669193b4c9d991512de9f2381dd161027f34b26b1"
[[package]]
name = "deno_cron"
version = "0.46.0"
version = "0.47.0"
dependencies = [
"anyhow",
"async-trait",
@ -1454,7 +1454,7 @@ dependencies = [
[[package]]
name = "deno_crypto"
version = "0.180.0"
version = "0.181.0"
dependencies = [
"aes",
"aes-gcm",
@ -1487,9 +1487,9 @@ dependencies = [
[[package]]
name = "deno_doc"
version = "0.146.0"
version = "0.148.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48063b68a1646ef64811171b683eb2993e08260b33b2bd987649679945099370"
checksum = "144fa07977ba9eeeb98bcd267b7f0a6f8033f0f1f20fd210e669b3c4f30cefa2"
dependencies = [
"ammonia",
"anyhow",
@ -1513,9 +1513,9 @@ dependencies = [
[[package]]
name = "deno_emit"
version = "0.44.0"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a22b37181789a1b04ef823c168a194e821f8f3145d9d9d6b4da4207eba807d"
checksum = "33aca9546e36a1b85efb630add94a4c2ac13c2333bb48df4439002c002f4c5b2"
dependencies = [
"anyhow",
"base64 0.21.7",
@ -1530,7 +1530,7 @@ dependencies = [
[[package]]
name = "deno_fetch"
version = "0.190.0"
version = "0.191.0"
dependencies = [
"base64 0.21.7",
"bytes",
@ -1562,7 +1562,7 @@ dependencies = [
[[package]]
name = "deno_ffi"
version = "0.153.0"
version = "0.154.0"
dependencies = [
"deno_core",
"deno_permissions",
@ -1579,7 +1579,7 @@ dependencies = [
[[package]]
name = "deno_fs"
version = "0.76.0"
version = "0.77.0"
dependencies = [
"async-trait",
"base32",
@ -1599,9 +1599,9 @@ dependencies = [
[[package]]
name = "deno_graph"
version = "0.81.3"
version = "0.82.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "450d75c29d99fd7325dd19a1ed7c3afb18ec04d1f4a4762350a29cbe041647c3"
checksum = "646757b109993751f618d20de9bafc17f8f886fa910fb82c2c89b9e1df220ac6"
dependencies = [
"anyhow",
"async-trait",
@ -1628,7 +1628,7 @@ dependencies = [
[[package]]
name = "deno_http"
version = "0.164.0"
version = "0.165.0"
dependencies = [
"async-compression",
"async-trait",
@ -1667,7 +1667,7 @@ dependencies = [
[[package]]
name = "deno_io"
version = "0.76.0"
version = "0.77.0"
dependencies = [
"async-trait",
"deno_core",
@ -1688,7 +1688,7 @@ dependencies = [
[[package]]
name = "deno_kv"
version = "0.74.0"
version = "0.75.0"
dependencies = [
"anyhow",
"async-trait",
@ -1717,9 +1717,9 @@ dependencies = [
[[package]]
name = "deno_lint"
version = "0.63.1"
version = "0.64.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0e6cc8fcb4819dd5e12d640d6fc455217c66bda00e30fd6d46d2844e3e1bdcf"
checksum = "b47f5f65369a3f188b5fa7c1263d9f96cdaa688e417b8852a3c8de0389e1c985"
dependencies = [
"anyhow",
"deno_ast",
@ -1758,7 +1758,7 @@ dependencies = [
[[package]]
name = "deno_napi"
version = "0.97.0"
version = "0.98.0"
dependencies = [
"deno_core",
"deno_permissions",
@ -1780,7 +1780,7 @@ dependencies = [
[[package]]
name = "deno_net"
version = "0.158.0"
version = "0.159.0"
dependencies = [
"deno_core",
"deno_permissions",
@ -1796,7 +1796,7 @@ dependencies = [
[[package]]
name = "deno_node"
version = "0.103.0"
version = "0.104.0"
dependencies = [
"aead-gcm-stream",
"aes",
@ -1932,7 +1932,7 @@ dependencies = [
[[package]]
name = "deno_permissions"
version = "0.26.0"
version = "0.27.0"
dependencies = [
"deno_core",
"deno_terminal 0.2.0",
@ -1947,7 +1947,7 @@ dependencies = [
[[package]]
name = "deno_runtime"
version = "0.175.0"
version = "0.176.0"
dependencies = [
"deno_ast",
"deno_broadcast_channel",
@ -2060,7 +2060,7 @@ dependencies = [
[[package]]
name = "deno_tls"
version = "0.153.0"
version = "0.154.0"
dependencies = [
"deno_core",
"deno_native_certs",
@ -2108,7 +2108,7 @@ dependencies = [
[[package]]
name = "deno_url"
version = "0.166.0"
version = "0.167.0"
dependencies = [
"deno_bench_util",
"deno_console",
@ -2119,7 +2119,7 @@ dependencies = [
[[package]]
name = "deno_web"
version = "0.197.0"
version = "0.198.0"
dependencies = [
"async-trait",
"base64-simd 0.8.0",
@ -2140,7 +2140,7 @@ dependencies = [
[[package]]
name = "deno_webgpu"
version = "0.133.0"
version = "0.134.0"
dependencies = [
"deno_core",
"raw-window-handle",
@ -2152,7 +2152,7 @@ dependencies = [
[[package]]
name = "deno_webidl"
version = "0.166.0"
version = "0.167.0"
dependencies = [
"deno_bench_util",
"deno_core",
@ -2160,7 +2160,7 @@ dependencies = [
[[package]]
name = "deno_websocket"
version = "0.171.0"
version = "0.172.0"
dependencies = [
"bytes",
"deno_core",
@ -2181,7 +2181,7 @@ dependencies = [
[[package]]
name = "deno_webstorage"
version = "0.161.0"
version = "0.162.0"
dependencies = [
"deno_core",
"deno_web",
@ -2200,9 +2200,9 @@ dependencies = [
[[package]]
name = "denokv_proto"
version = "0.8.1"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "114538d2cacd2b219f05faa753d80950f95416e47c77904c7452d5f41e157059"
checksum = "f629c77d2bf59e2e2a07fd7b14bfffae352a3813fbdcb801e72205741fb7625c"
dependencies = [
"anyhow",
"async-trait",
@ -2241,9 +2241,9 @@ dependencies = [
[[package]]
name = "denokv_sqlite"
version = "0.8.1"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "188b792af19082cbfc7b666e71979775300482877d8b80601f4a5a86a80098a3"
checksum = "3c4f5719e2bf698ec4f39fe29d91b62ff06a4b4a37ee481ffb8658d140fed986"
dependencies = [
"anyhow",
"async-stream",
@ -2534,9 +2534,9 @@ dependencies = [
[[package]]
name = "dprint-plugin-typescript"
version = "0.91.6"
version = "0.91.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "390da1b0ba3761f824518a3e4f06ca273837ba16fac73560efd201342b980561"
checksum = "243879526ffc78aeb111719c3180f95820847c28eeeffb8d2585d1ec15a44fe4"
dependencies = [
"anyhow",
"deno_ast",
@ -2549,9 +2549,9 @@ dependencies = [
[[package]]
name = "dprint-swc-ext"
version = "0.18.0"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f385cdad3065151fae39262ad43003099234689856a0dc476e8804c5ba8f475b"
checksum = "0ba28c12892aadb751c2ba7001d8460faee4748a04b4edc51c7121cc67ee03db"
dependencies = [
"allocator-api2",
"bumpalo",
@ -2819,9 +2819,9 @@ dependencies = [
[[package]]
name = "eszip"
version = "0.77.0"
version = "0.78.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d14989a45cef01c2dd79546bec3c392a7bbb3e9928bbf71acae5551bb4e71be9"
checksum = "d0546f00d41dbc6e90b50e922759c02559a897e59b683369c3a13519cd5108b6"
dependencies = [
"anyhow",
"async-trait",
@ -2831,7 +2831,7 @@ dependencies = [
"deno_npm",
"deno_semver",
"futures",
"hashlink",
"hashlink 0.8.4",
"indexmap",
"serde",
"serde_json",
@ -2842,9 +2842,9 @@ dependencies = [
[[package]]
name = "fallible-iterator"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
[[package]]
name = "fallible-streaming-iterator"
@ -3329,7 +3329,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"gpu-alloc-types",
]
@ -3339,7 +3339,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
]
[[package]]
@ -3348,7 +3348,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"gpu-descriptor-types",
"hashbrown",
]
@ -3359,7 +3359,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
]
[[package]]
@ -3464,6 +3464,15 @@ dependencies = [
"hashbrown",
]
[[package]]
name = "hashlink"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af"
dependencies = [
"hashbrown",
]
[[package]]
name = "heck"
version = "0.4.1"
@ -4214,15 +4223,15 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"libc",
]
[[package]]
name = "libsqlite3-sys"
version = "0.26.0"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326"
checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
dependencies = [
"cc",
"pkg-config",
@ -4445,7 +4454,7 @@ version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5637e166ea14be6063a3f8ba5ccb9a4159df7d8f6d61c02fc3d480b1f90dcfcb"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"block",
"core-graphics-types",
"foreign-types",
@ -4508,7 +4517,7 @@ checksum = "e536ae46fcab0876853bd4a632ede5df4b1c2527a58f6c5a4150fe86be858231"
dependencies = [
"arrayvec",
"bit-set",
"bitflags 2.5.0",
"bitflags 2.6.0",
"codespan-reporting",
"hexf-parse",
"indexmap",
@ -4539,7 +4548,7 @@ dependencies = [
[[package]]
name = "napi_sym"
version = "0.96.0"
version = "0.97.0"
dependencies = [
"quote",
"serde",
@ -4601,14 +4610,14 @@ version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"cfg-if",
"libc",
]
[[package]]
name = "node_resolver"
version = "0.5.0"
version = "0.6.0"
dependencies = [
"anyhow",
"async-trait",
@ -4651,7 +4660,7 @@ version = "6.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"crossbeam-channel",
"filetime",
"fsevent-sys",
@ -5481,7 +5490,7 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb4e75767fbc9d92b90e4d0c011f61358cde9513b31ef07ea3631b15ffc3b4fd"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"memchr",
"unicase",
]
@ -5858,7 +5867,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94"
dependencies = [
"base64 0.21.7",
"bitflags 2.5.0",
"bitflags 2.6.0",
"serde",
"serde_derive",
]
@ -5922,14 +5931,14 @@ dependencies = [
[[package]]
name = "rusqlite"
version = "0.29.0"
version = "0.32.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2"
checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"fallible-iterator",
"fallible-streaming-iterator",
"hashlink",
"hashlink 0.9.1",
"libsqlite3-sys",
"smallvec",
]
@ -5979,7 +5988,7 @@ version = "0.38.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"errno 0.3.8",
"libc",
"linux-raw-sys",
@ -6065,7 +6074,7 @@ version = "13.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02a2d683a4ac90aeef5b1013933f6d977bd37d51ff3f4dad829d4931a7e6be86"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"cfg-if",
"clipboard-win",
"fd-lock",
@ -6545,6 +6554,25 @@ dependencies = [
"url",
]
[[package]]
name = "sourcemap"
version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dab08a862c70980b8e23698b507e272317ae52a608a164a844111f5372374f1f"
dependencies = [
"base64-simd 0.7.0",
"bitvec",
"data-encoding",
"debugid",
"if_chain",
"rustc-hash",
"rustc_version 0.2.3",
"serde",
"serde_json",
"unicode-id-start",
"url",
]
[[package]]
name = "spin"
version = "0.9.8"
@ -6557,7 +6585,7 @@ version = "0.3.0+sdk-1.3.268.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
]
[[package]]
@ -6703,9 +6731,9 @@ dependencies = [
[[package]]
name = "swc_bundler"
version = "0.233.3"
version = "0.237.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9e0a88398e80a77bd6e1b523698a0f1ab3b12fbddd03c8a69a73963c02d3bbc"
checksum = "c77c112c218a09635d99a45802a81b4f341d6c28c81076aa2c29ba3bcd9151a9"
dependencies = [
"anyhow",
"crc",
@ -6747,9 +6775,9 @@ dependencies = [
[[package]]
name = "swc_common"
version = "0.36.2"
version = "0.37.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1802b1642488aec58597dc55ea88992c165660d6e44e9838d4d93f7b78ab95f3"
checksum = "12d0a8eaaf1606c9207077d75828008cb2dfb51b095a766bd2b72ef893576e31"
dependencies = [
"ast_node",
"better_scoped_tls",
@ -6762,7 +6790,7 @@ dependencies = [
"rustc-hash",
"serde",
"siphasher",
"sourcemap",
"sourcemap 9.0.0",
"swc_allocator",
"swc_atoms",
"swc_eq_ignore_macros",
@ -6774,9 +6802,9 @@ dependencies = [
[[package]]
name = "swc_config"
version = "0.1.14"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84b67e115ab136fe0eb03558bb0508ca7782eeb446a96d165508c48617e3fd94"
checksum = "4740e53eaf68b101203c1df0937d5161a29f3c13bceed0836ddfe245b72dd000"
dependencies = [
"anyhow",
"indexmap",
@ -6800,11 +6828,11 @@ dependencies = [
[[package]]
name = "swc_ecma_ast"
version = "0.117.4"
version = "0.118.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5da2f0310e8cd84b8c803095e75b2cbca872c71fc7f7404d4c9c8117d894960"
checksum = "a6f866d12e4d519052b92a0a86d1ac7ff17570da1272ca0c89b3d6f802cd79df"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"is-macro",
"num-bigint",
"phf 0.11.2",
@ -6818,15 +6846,15 @@ dependencies = [
[[package]]
name = "swc_ecma_codegen"
version = "0.154.4"
version = "0.155.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7badcda2c45056495ed94b957884099cb000470ae7901ba68db2e7fd48414a4b"
checksum = "cc7641608ef117cfbef9581a99d02059b522fcca75e5244fa0cbbd8606689c6f"
dependencies = [
"memchr",
"num-bigint",
"once_cell",
"serde",
"sourcemap",
"sourcemap 9.0.0",
"swc_allocator",
"swc_atoms",
"swc_common",
@ -6849,9 +6877,9 @@ dependencies = [
[[package]]
name = "swc_ecma_loader"
version = "0.48.1"
version = "0.49.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a201c65ccbaa0c80fbcfd5c90dcc0bfc7ae62ac596f2233651ac715caf5d2c12"
checksum = "55fa3d55045b97894bfb04d38aff6d6302ac8a6a38e3bb3dfb0d20475c4974a9"
dependencies = [
"anyhow",
"pathdiff",
@ -6863,9 +6891,9 @@ dependencies = [
[[package]]
name = "swc_ecma_parser"
version = "0.148.1"
version = "0.149.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8204235f635274dba4adc30c47ac896fd126ddfc53b27210676722423cbb2e7"
checksum = "683dada14722714588b56481399c699378b35b2ba4deb5c4db2fb627a97fb54b"
dependencies = [
"either",
"new_debug_unreachable",
@ -6885,12 +6913,12 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_base"
version = "0.143.3"
version = "0.145.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6df81c1cbb920d9c47abe6fb105363b0f78df2c8f6b0910c4fdd2ad7cbdfb23d"
checksum = "65f21494e75d0bd8ef42010b47cabab9caaed8f2207570e809f6f4eb51a710d1"
dependencies = [
"better_scoped_tls",
"bitflags 2.5.0",
"bitflags 2.6.0",
"indexmap",
"once_cell",
"phf 0.11.2",
@ -6908,9 +6936,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_classes"
version = "0.132.1"
version = "0.134.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53291bcdfca4bd4c2546c3170d7f0ea1d4f22f6fce2a531265ead010a9a2ebdf"
checksum = "3c3d884594385bea9405a2e1721151470d9a14d3ceec5dd773c0ca6894791601"
dependencies = [
"swc_atoms",
"swc_common",
@ -6934,9 +6962,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_optimization"
version = "0.204.2"
version = "0.208.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7f9a903d6774d3f9005775badc25817296791ffed560f1b7e38aab62ca37ff"
checksum = "98d8447ea20ef76958a8240feef95743702485a84331e6df5bdbe7e383c87838"
dependencies = [
"dashmap",
"indexmap",
@ -6958,9 +6986,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_proposal"
version = "0.177.1"
version = "0.179.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2d84d062b05ae89982a76ff47881a5e15bbd02e9b3c68dc14a3f5eacf48abca"
checksum = "79938ff510fc647febd8c6c3ef4143d099fdad87a223680e632623d056dae2dd"
dependencies = [
"either",
"rustc-hash",
@ -6978,9 +7006,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_react"
version = "0.189.2"
version = "0.191.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d411add563dd86d50b3db6e74e38def06587fa2fd370b430f71226688bfa6ded"
checksum = "76c76d8b9792ce51401d38da0fa62158d61f6d80d16d68fe5b03ce4bf5fba383"
dependencies = [
"base64 0.21.7",
"dashmap",
@ -7003,9 +7031,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_typescript"
version = "0.194.3"
version = "0.198.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f73c4ae3eb15adc5865dc729c4e111040529cec5a349d56ed0b4a0de1a86242"
checksum = "15455da4768f97186c40523e83600495210c11825d3a44db43383fd81eace88d"
dependencies = [
"ryu-js",
"serde",
@ -7020,9 +7048,9 @@ dependencies = [
[[package]]
name = "swc_ecma_utils"
version = "0.133.4"
version = "0.134.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6148af60d25da893aef037621e4869e9b580eb280e12f5a8d4f87fa5e4cd5da"
checksum = "029eec7dd485923a75b5a45befd04510288870250270292fc2c1b3a9e7547408"
dependencies = [
"indexmap",
"num_cpus",
@ -7039,9 +7067,9 @@ dependencies = [
[[package]]
name = "swc_ecma_visit"
version = "0.103.3"
version = "0.104.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed8026e4d9abcb75d511bf7623d49e8e135f02f4f9a6bb7c115df8239cfe3d4f"
checksum = "5b1c6802e68e51f336e8bc9644e9ff9da75d7da9c1a6247d532f2e908aa33e81"
dependencies = [
"new_debug_unreachable",
"num-bigint",
@ -7065,9 +7093,9 @@ dependencies = [
[[package]]
name = "swc_fast_graph"
version = "0.24.1"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3f854cf8efc290aa927d31dab98b42011ff2341fecb2b27fdc817ef7b30ef3b"
checksum = "357e2c97bb51431d65080f25b436bc4e2fc1a7f64a643bc21a8353e478dc799f"
dependencies = [
"indexmap",
"petgraph",
@ -7077,9 +7105,9 @@ dependencies = [
[[package]]
name = "swc_graph_analyzer"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d97d4b3b186f842f6def323db73f1bc90d7086bd5fa1fb4cca527e20c70f856e"
checksum = "f84e1d24a0d6e4066b42cfc00ab9b3109e314465aa199dd3e16849ed9566dce7"
dependencies = [
"auto_impl",
"petgraph",
@ -7101,11 +7129,12 @@ dependencies = [
[[package]]
name = "swc_visit"
version = "0.6.1"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e194d14f94121fd08b823d3379eedb3ce455785d9e0c3d2742c59377e283207"
checksum = "1ceb044142ba2719ef9eb3b6b454fce61ab849eb696c34d190f04651955c613d"
dependencies = [
"either",
"new_debug_unreachable",
]
[[package]]
@ -7576,7 +7605,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5"
dependencies = [
"async-compression",
"bitflags 2.5.0",
"bitflags 2.6.0",
"bytes",
"futures-core",
"http 1.1.0",
@ -7950,7 +7979,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692624c4fd58ff50aa6d690c159df18e7881c13970005b9b2bff77dc425fd370"
dependencies = [
"bindgen",
"bitflags 2.5.0",
"bitflags 2.6.0",
"fslock",
"gzip-header",
"home",
@ -7966,7 +7995,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97599c400fc79925922b58303e98fcb8fa88f573379a08ddb652e72cbd2e70f6"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"encoding_rs",
"indexmap",
"num-bigint",
@ -8164,7 +8193,7 @@ checksum = "d50819ab545b867d8a454d1d756b90cd5f15da1f2943334ca314af10583c9d39"
dependencies = [
"arrayvec",
"bit-vec",
"bitflags 2.5.0",
"bitflags 2.6.0",
"cfg_aliases",
"codespan-reporting",
"document-features",
@ -8195,7 +8224,7 @@ dependencies = [
"arrayvec",
"ash",
"bit-set",
"bitflags 2.5.0",
"bitflags 2.6.0",
"block",
"cfg_aliases",
"core-graphics-types",
@ -8233,7 +8262,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1353d9a46bff7f955a680577f34c69122628cc2076e1d6f3a9be6ef00ae793ef"
dependencies = [
"bitflags 2.5.0",
"bitflags 2.6.0",
"js-sys",
"serde",
"web-sys",

View file

@ -44,48 +44,48 @@ license = "MIT"
repository = "https://github.com/denoland/deno"
[workspace.dependencies]
deno_ast = { version = "=0.41.2", features = ["transpiling"] }
deno_ast = { version = "=0.42.0", features = ["transpiling"] }
deno_core = { version = "0.307.0" }
deno_bench_util = { version = "0.160.0", path = "./bench_util" }
deno_bench_util = { version = "0.161.0", path = "./bench_util" }
deno_lockfile = "=0.23.0"
deno_media_type = { version = "0.1.4", features = ["module_specifier"] }
deno_permissions = { version = "0.26.0", path = "./runtime/permissions" }
deno_runtime = { version = "0.175.0", path = "./runtime" }
deno_permissions = { version = "0.27.0", path = "./runtime/permissions" }
deno_runtime = { version = "0.176.0", path = "./runtime" }
deno_semver = "=0.5.13"
deno_terminal = "0.2.0"
napi_sym = { version = "0.96.0", path = "./cli/napi/sym" }
napi_sym = { version = "0.97.0", path = "./cli/napi/sym" }
test_util = { package = "test_server", path = "./tests/util/server" }
denokv_proto = "0.8.1"
denokv_remote = "0.8.1"
# denokv_sqlite brings in bundled sqlite if we don't disable the default features
denokv_sqlite = { default-features = false, version = "0.8.1" }
denokv_sqlite = { default-features = false, version = "0.8.2" }
# exts
deno_broadcast_channel = { version = "0.160.0", path = "./ext/broadcast_channel" }
deno_cache = { version = "0.98.0", path = "./ext/cache" }
deno_canvas = { version = "0.35.0", path = "./ext/canvas" }
deno_console = { version = "0.166.0", path = "./ext/console" }
deno_cron = { version = "0.46.0", path = "./ext/cron" }
deno_crypto = { version = "0.180.0", path = "./ext/crypto" }
deno_fetch = { version = "0.190.0", path = "./ext/fetch" }
deno_ffi = { version = "0.153.0", path = "./ext/ffi" }
deno_fs = { version = "0.76.0", path = "./ext/fs" }
deno_http = { version = "0.164.0", path = "./ext/http" }
deno_io = { version = "0.76.0", path = "./ext/io" }
deno_kv = { version = "0.74.0", path = "./ext/kv" }
deno_napi = { version = "0.97.0", path = "./ext/napi" }
deno_net = { version = "0.158.0", path = "./ext/net" }
deno_node = { version = "0.103.0", path = "./ext/node" }
deno_tls = { version = "0.153.0", path = "./ext/tls" }
deno_url = { version = "0.166.0", path = "./ext/url" }
deno_web = { version = "0.197.0", path = "./ext/web" }
deno_webgpu = { version = "0.133.0", path = "./ext/webgpu" }
deno_webidl = { version = "0.166.0", path = "./ext/webidl" }
deno_websocket = { version = "0.171.0", path = "./ext/websocket" }
deno_webstorage = { version = "0.161.0", path = "./ext/webstorage" }
node_resolver = { version = "0.5.0", path = "./ext/node_resolver" }
deno_broadcast_channel = { version = "0.161.0", path = "./ext/broadcast_channel" }
deno_cache = { version = "0.99.0", path = "./ext/cache" }
deno_canvas = { version = "0.36.0", path = "./ext/canvas" }
deno_console = { version = "0.167.0", path = "./ext/console" }
deno_cron = { version = "0.47.0", path = "./ext/cron" }
deno_crypto = { version = "0.181.0", path = "./ext/crypto" }
deno_fetch = { version = "0.191.0", path = "./ext/fetch" }
deno_ffi = { version = "0.154.0", path = "./ext/ffi" }
deno_fs = { version = "0.77.0", path = "./ext/fs" }
deno_http = { version = "0.165.0", path = "./ext/http" }
deno_io = { version = "0.77.0", path = "./ext/io" }
deno_kv = { version = "0.75.0", path = "./ext/kv" }
deno_napi = { version = "0.98.0", path = "./ext/napi" }
deno_net = { version = "0.159.0", path = "./ext/net" }
deno_node = { version = "0.104.0", path = "./ext/node" }
deno_tls = { version = "0.154.0", path = "./ext/tls" }
deno_url = { version = "0.167.0", path = "./ext/url" }
deno_web = { version = "0.198.0", path = "./ext/web" }
deno_webgpu = { version = "0.134.0", path = "./ext/webgpu" }
deno_webidl = { version = "0.167.0", path = "./ext/webidl" }
deno_websocket = { version = "0.172.0", path = "./ext/websocket" }
deno_webstorage = { version = "0.162.0", path = "./ext/webstorage" }
node_resolver = { version = "0.6.0", path = "./ext/node_resolver" }
aes = "=0.8.3"
anyhow = "1.0.57"
@ -155,7 +155,7 @@ rand = "=0.8.5"
regex = "^1.7.0"
reqwest = { version = "=0.12.5", default-features = false, features = ["rustls-tls", "stream", "gzip", "brotli", "socks", "json", "http2"] } # pinned because of https://github.com/seanmonstar/reqwest/pull/1955
ring = "^0.17.0"
rusqlite = { version = "=0.29.0", features = ["unlock_notify", "bundled"] }
rusqlite = { version = "0.32.0", features = ["unlock_notify", "bundled"] }
rustls = { version = "0.23.11", default-features = false, features = ["logging", "std", "tls12", "ring"] }
rustls-pemfile = "2"
rustls-tokio-stream = "=0.3.0"

View file

@ -6,6 +6,39 @@ https://github.com/denoland/deno/releases
We also have one-line install commands at:
https://github.com/denoland/deno_install
### 1.46.2 / 2024.08.29
- Revert "feat(fetch): accept async iterables for body" (#25207)
- fix(bench): Fix table column alignments and NO_COLOR=1 (#25190)
- fix(ext/crypto): throw DataError for invalid EC key import (#25181)
- fix(ext/fetch): percent decode userinfo when parsing proxies (#25229)
- fix(ext/node): emit `online` event after worker thread is initialized (#25243)
- fix(ext/node): export JWK public key (#25239)
- fix(ext/node): import EC JWK keys (#25266)
- fix(ext/node): import JWK octet key pairs (#25180)
- fix(ext/node): import RSA JWK keys (#25267)
- fix(ext/node): throw when loading `cpu-features` module (#25257)
- fix(ext/node): update aead-gcm-stream to 0.3 (#25261)
- fix(ext/webgpu): allow to build on unsupported platforms (#25202)
- fix(fmt): fix incorrect quotes in components (#25249)
- fix(fmt/markdown): fix regression with multi-line footnotes and inline math
(#25222)
- fix(install): Use relative symlinks in deno install (#25164)
- fix(lsp): panic on url_to_uri() (#25238)
- fix(napi): Don't run microtasks in napi_resolve_deferred (#25246)
- fix(napi): Fix worker threads importing already-loaded NAPI addon (#25245)
- fix(node/cluster): improve stubs to make log4js work (#25146)
- fix(runtime/web_worker): populate `SnapshotOptions` for `WebWorker` when
instantiated without snapshot (#25280)
- fix(task): support tasks with colons in name in `deno run` (#25233)
- fix: handle showing warnings while the progress bar is shown (#25187)
- fix: reland async context (#25140)
- fix: removed unstable-htttp from deno help (#25216)
- fix: replace `npm install` hint with `deno install` hint (#25244)
- fix: update deno_doc (#25290)
- fix: upgrade deno_core to 0.307.0 (#25287)
- perf(ext/node): reduce some allocations in require (#25197)
### 1.46.1 / 2024.08.22
- fix(ext/node): http2session ready state (#25143)

View file

@ -2,7 +2,7 @@
[package]
name = "deno_bench_util"
version = "0.160.0"
version = "0.161.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno"
version = "1.46.1"
version = "2.0.0-rc.0"
authors.workspace = true
default-run = "deno"
edition.workspace = true
@ -65,12 +65,12 @@ winres.workspace = true
[dependencies]
deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] }
deno_cache_dir = { workspace = true }
deno_config = { version = "=0.30.1", features = ["workspace", "sync"] }
deno_config = { version = "=0.32.0", features = ["workspace", "sync"] }
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
deno_doc = { version = "0.146.0", features = ["html", "syntect"] }
deno_emit = "=0.44.0"
deno_graph = { version = "=0.81.3" }
deno_lint = { version = "=0.63.1", features = ["docs"] }
deno_doc = { version = "0.148.0", features = ["html", "syntect"] }
deno_emit = "=0.45.0"
deno_graph = { version = "=0.82.0" }
deno_lint = { version = "=0.64.0", features = ["docs"] }
deno_lockfile.workspace = true
deno_npm = "=0.25.0"
deno_package_json.workspace = true
@ -78,7 +78,7 @@ deno_runtime = { workspace = true, features = ["include_js_files_for_snapshottin
deno_semver.workspace = true
deno_task_shell = "=0.17.0"
deno_terminal.workspace = true
eszip = "=0.77.0"
eszip = "=0.78.0"
libsui = "0.3.0"
napi_sym.workspace = true
node_resolver.workspace = true
@ -103,7 +103,7 @@ dotenvy = "0.15.7"
dprint-plugin-json = "=0.19.3"
dprint-plugin-jupyter = "=0.1.3"
dprint-plugin-markdown = "=0.17.8"
dprint-plugin-typescript = "=0.91.6"
dprint-plugin-typescript = "=0.91.7"
env_logger = "=0.10.0"
fancy-regex = "=0.10.0"
faster-hex.workspace = true

View file

@ -10,6 +10,7 @@ use clap::ColorChoice;
use clap::Command;
use clap::ValueHint;
use color_print::cstr;
use deno_config::deno_json::NodeModulesDirMode;
use deno_config::glob::FilePatterns;
use deno_config::glob::PathOrPatternSet;
use deno_core::anyhow::bail;
@ -40,7 +41,6 @@ use crate::args::resolve_no_prompt;
use crate::util::fs::canonicalize_path;
use super::flags_net;
use super::DENO_FUTURE;
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub enum ConfigFlag {
@ -581,7 +581,6 @@ fn parse_packages_allowed_scripts(s: &str) -> Result<String, AnyError> {
pub struct UnstableConfig {
pub legacy_flag_enabled: bool, // --unstable
pub bare_node_builtins: bool, // --unstable-bare-node-builts
pub byonm: bool,
pub sloppy_imports: bool,
pub features: Vec<String>, // --unstabe-kv --unstable-cron
}
@ -603,7 +602,7 @@ pub struct Flags {
pub cached_only: bool,
pub type_check_mode: TypeCheckMode,
pub config_flag: ConfigFlag,
pub node_modules_dir: Option<bool>,
pub node_modules_dir: Option<NodeModulesDirMode>,
pub vendor: Option<bool>,
pub enable_op_summary_metrics: bool,
pub enable_testing_features: bool,
@ -1114,7 +1113,6 @@ static ENV_VARIABLES_HELP: &str = cstr!(
<g>DENO_AUTH_TOKENS</> A semi-colon separated list of bearer tokens and hostnames
to use when fetching remote modules from private repositories
<p(245)>(e.g. "abcde12345@deno.land;54321edcba@github.com")</>
<g>DENO_FUTURE</> Set to "1" to enable APIs that will take effect in Deno 2
<g>DENO_CERT</> Load certificate authorities from PEM encoded file
<g>DENO_DIR</> Set the cache directory
<g>DENO_INSTALL_ROOT</> Set deno install's output directory
@ -1177,7 +1175,7 @@ static DENO_HELP: &str = cstr!(
<p(245)>deno test | deno test test.ts</>
<g>publish</> Publish the current working directory's package or workspace
<g>upgrade</> Upgrade deno executable to given version
<p(245)>deno upgrade | deno upgrade --version=1.45.0 | deno upgrade --canary</>
<p(245)>deno upgrade | deno upgrade 1.45.0 | deno upgrade canary</>
{after-help}
<y>Docs:</> https://docs.deno.com
@ -1508,11 +1506,7 @@ pub fn clap_root() -> Command {
.subcommand(fmt_subcommand())
.subcommand(init_subcommand())
.subcommand(info_subcommand())
.subcommand(if *DENO_FUTURE {
future_install_subcommand()
} else {
install_subcommand()
})
.subcommand(future_install_subcommand())
.subcommand(json_reference_subcommand())
.subcommand(jupyter_subcommand())
.subcommand(uninstall_subcommand())
@ -2375,22 +2369,13 @@ TypeScript compiler cache: Subdirectory containing TS compiler output.",
))
}
fn install_args(cmd: Command, deno_future: bool) -> Command {
let cmd = if deno_future {
cmd.arg(
Arg::new("cmd")
.required_if_eq("global", "true")
.num_args(1..)
.value_hint(ValueHint::FilePath),
)
} else {
cmd.arg(
Arg::new("cmd")
.required_unless_present("help")
.num_args(1..)
.value_hint(ValueHint::FilePath),
)
};
fn install_args(cmd: Command) -> Command {
let cmd = cmd.arg(
Arg::new("cmd")
.required_if_eq("global", "true")
.num_args(1..)
.value_hint(ValueHint::FilePath),
);
cmd
.arg(
Arg::new("name")
@ -2466,40 +2451,7 @@ These must be added to the path manually if required.", UnstableArgsConfig::Reso
.visible_alias("i")
.defer(|cmd| {
let cmd = runtime_args(cmd, true, true).arg(check_arg(true)).arg(allow_scripts_arg());
install_args(cmd, true)
})
}
fn install_subcommand() -> Command {
command("install",
"Installs a script as an executable in the installation root's bin directory.
deno install --global --allow-net --allow-read jsr:@std/http/file-server
deno install -g https://examples.deno.land/color-logging.ts
To change the executable name, use -n/--name:
deno install -g --allow-net --allow-read -n serve jsr:@std/http/file-server
The executable name is inferred by default:
- Attempt to take the file stem of the URL path. The above example would
become 'file_server'.
- If the file stem is something generic like 'main', 'mod', 'index' or 'cli',
and the path has no parent, take the file name of the parent path. Otherwise
settle with the generic name.
- If the resulting name has an '@...' suffix, strip it.
To change the installation root, use --root:
deno install -g --allow-net --allow-read --root /usr/local jsr:@std/http/file-server
The installation root is determined, in order of precedence:
- --root option
- DENO_INSTALL_ROOT environment variable
- $HOME/.deno
These must be added to the path manually if required.", UnstableArgsConfig::ResolutionAndRuntime)
.defer(|cmd| {
let cmd = runtime_args(cmd, true, true).arg(check_arg(true));
install_args(cmd, false)
install_args(cmd)
})
}
@ -3918,15 +3870,35 @@ fn no_npm_arg() -> Arg {
.help_heading(DEPENDENCY_MANAGEMENT_HEADING)
}
fn node_modules_arg_parse(flags: &mut Flags, matches: &mut ArgMatches) {
let value = matches.remove_one::<NodeModulesDirMode>("node-modules-dir");
if let Some(mode) = value {
flags.node_modules_dir = Some(mode);
}
}
fn node_modules_dir_arg() -> Arg {
fn parse_node_modules_dir_mode(
s: &str,
) -> Result<NodeModulesDirMode, String> {
match s {
"auto" | "true" => Ok(NodeModulesDirMode::Auto),
"manual" => Ok(NodeModulesDirMode::Manual),
"none" | "false" => Ok(NodeModulesDirMode::None),
_ => Err(format!(
"Invalid value '{}': expected \"auto\", \"manual\" or \"none\"",
s
)),
}
}
Arg::new("node-modules-dir")
.long("node-modules-dir")
.num_args(0..=1)
.value_parser(value_parser!(bool))
.value_name("DIRECTORY")
.default_missing_value("true")
.value_parser(clap::builder::ValueParser::new(parse_node_modules_dir_mode))
.value_name("MODE")
.require_equals(true)
.help("Enables or disables the use of a local node_modules folder for npm packages")
.help("Sets the node modules management mode for npm packages")
.help_heading(DEPENDENCY_MANAGEMENT_HEADING)
}
@ -4006,7 +3978,6 @@ impl Iterator for UnstableArgsIter {
Arg::new("unstable-byonm")
.long("unstable-byonm")
.help("Enable unstable 'bring your own node_modules' feature")
.env("DENO_UNSTABLE_BYONM")
.value_parser(FalseyValueParser::new())
.action(ArgAction::SetTrue)
.hide(true)
@ -4443,7 +4414,7 @@ fn install_parse(flags: &mut Flags, matches: &mut ArgMatches) {
runtime_args_parse(flags, matches, true, true);
let global = matches.get_flag("global");
if global || !*DENO_FUTURE {
if global {
let root = matches.remove_one::<String>("root");
let force = matches.get_flag("force");
let name = matches.remove_one::<String>("name");
@ -5318,7 +5289,7 @@ fn node_modules_and_vendor_dir_arg_parse(
flags: &mut Flags,
matches: &mut ArgMatches,
) {
flags.node_modules_dir = matches.remove_one::<bool>("node-modules-dir");
node_modules_arg_parse(flags, matches);
flags.vendor = matches.remove_one::<bool>("vendor");
}
@ -5390,7 +5361,6 @@ fn unstable_args_parse(
flags.unstable_config.bare_node_builtins =
matches.get_flag("unstable-bare-node-builtins");
flags.unstable_config.byonm = matches.get_flag("unstable-byonm");
flags.unstable_config.sloppy_imports =
matches.get_flag("unstable-sloppy-imports");
@ -8212,8 +8182,12 @@ mod tests {
#[test]
fn install() {
let r =
flags_from_vec(svec!["deno", "install", "jsr:@std/http/file-server"]);
let r = flags_from_vec(svec![
"deno",
"install",
"-g",
"jsr:@std/http/file-server"
]);
assert_eq!(
r.unwrap(),
Flags {
@ -8225,7 +8199,7 @@ mod tests {
root: None,
force: false,
}),
global: false,
global: true,
}),
..Flags::default()
}
@ -8258,7 +8232,7 @@ mod tests {
#[test]
fn install_with_flags() {
#[rustfmt::skip]
let r = flags_from_vec(svec!["deno", "install", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--cert", "example.crt", "--cached-only", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229", "--name", "file_server", "--root", "/foo", "--force", "--env=.example.env", "jsr:@std/http/file-server", "foo", "bar"]);
let r = flags_from_vec(svec!["deno", "install", "--global", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--cert", "example.crt", "--cached-only", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229", "--name", "file_server", "--root", "/foo", "--force", "--env=.example.env", "jsr:@std/http/file-server", "foo", "bar"]);
assert_eq!(
r.unwrap(),
Flags {
@ -8270,7 +8244,7 @@ mod tests {
root: Some("/foo".to_string()),
force: true,
}),
global: false,
global: true,
}),
import_map_path: Some("import_map.json".to_string()),
no_remote: true,
@ -8650,25 +8624,7 @@ mod tests {
watch: None,
bare: true,
}),
node_modules_dir: Some(true),
code_cache_enabled: true,
..Flags::default()
}
);
let r = flags_from_vec(svec![
"deno",
"run",
"--node-modules-dir=false",
"script.ts"
]);
assert_eq!(
r.unwrap(),
Flags {
subcommand: DenoSubcommand::Run(RunFlags::new_default(
"script.ts".to_string(),
)),
node_modules_dir: Some(false),
node_modules_dir: None,
code_cache_enabled: true,
..Flags::default()
}

View file

@ -239,12 +239,6 @@ impl CliLockfile {
}
let lockfile = self.lockfile.lock();
if lockfile.has_content_changed {
let suggested = if *super::DENO_FUTURE {
"`deno cache --frozen=false`, `deno install --frozen=false`,"
} else {
"`deno cache --frozen=false`"
};
let contents =
std::fs::read_to_string(&lockfile.filename).unwrap_or_default();
let new_contents = lockfile.as_json_string();
@ -252,7 +246,7 @@ impl CliLockfile {
// has an extra newline at the end
let diff = diff.trim_end();
Err(deno_core::anyhow::anyhow!(
"The lockfile is out of date. Run {suggested} or rerun with `--frozen=false` to update it.\nchanges:\n{diff}"
"The lockfile is out of date. Run `deno cache --frozen=false`, `deno install --frozen=false`, or rerun with `--frozen=false` to update it.\nchanges:\n{diff}"
))
} else {
Ok(())

View file

@ -8,7 +8,9 @@ mod lockfile;
mod package_json;
use deno_ast::SourceMapOption;
use deno_config::deno_json::NodeModulesDirMode;
use deno_config::workspace::CreateResolverOptions;
use deno_config::workspace::FolderConfigs;
use deno_config::workspace::PackageJsonDepResolution;
use deno_config::workspace::VendorEnablement;
use deno_config::workspace::Workspace;
@ -50,7 +52,6 @@ use deno_core::anyhow::Context;
use deno_core::error::AnyError;
use deno_core::serde_json;
use deno_core::url::Url;
use deno_runtime::deno_node::PackageJson;
use deno_runtime::deno_permissions::PermissionsOptions;
use deno_runtime::deno_tls::deno_native_certs::load_native_certs;
use deno_runtime::deno_tls::rustls;
@ -63,6 +64,7 @@ use dotenvy::from_filename;
use once_cell::sync::Lazy;
use serde::Deserialize;
use serde::Serialize;
use std::borrow::Cow;
use std::collections::HashMap;
use std::env;
use std::io::BufReader;
@ -116,9 +118,6 @@ pub static DENO_DISABLE_PEDANTIC_NODE_WARNINGS: Lazy<bool> = Lazy::new(|| {
.is_some()
});
pub static DENO_FUTURE: Lazy<bool> =
Lazy::new(|| std::env::var("DENO_FUTURE").ok().is_some());
pub fn jsr_url() -> &'static Url {
static JSR_URL: Lazy<Url> = Lazy::new(|| {
let env_var_name = "JSR_URL";
@ -813,14 +812,12 @@ impl CliOptions {
}
let maybe_lockfile = maybe_lockfile.filter(|_| !force_global_cache);
let root_folder = start_dir.workspace.root_folder_configs();
let deno_dir_provider =
Arc::new(DenoDirProvider::new(flags.cache_path.clone()));
let maybe_node_modules_folder = resolve_node_modules_folder(
&initial_cwd,
&flags,
root_folder.deno_json.as_deref(),
root_folder.pkg_json.as_deref(),
&start_dir.workspace,
&deno_dir_provider,
)
.with_context(|| "Resolving node_modules folder.")?;
@ -1137,10 +1134,6 @@ impl CliOptions {
self.flags.env_file.as_ref()
}
pub fn enable_future_features(&self) -> bool {
*DENO_FUTURE
}
pub fn resolve_main_module(&self) -> Result<ModuleSpecifier, AnyError> {
let main_module = match &self.flags.subcommand {
DenoSubcommand::Bundle(bundle_flags) => {
@ -1255,11 +1248,13 @@ impl CliOptions {
}
}
pub fn node_modules_dir_enablement(&self) -> Option<bool> {
self
.flags
.node_modules_dir
.or_else(|| self.workspace().node_modules_dir())
pub fn node_modules_dir(
&self,
) -> Result<Option<NodeModulesDirMode>, AnyError> {
if let Some(flag) = self.flags.node_modules_dir {
return Ok(Some(flag));
}
self.workspace().node_modules_dir_mode().map_err(Into::into)
}
pub fn vendor_dir_path(&self) -> Option<&PathBuf> {
@ -1611,9 +1606,17 @@ impl CliOptions {
|| self.workspace().has_unstable("bare-node-builtins")
}
fn byonm_enabled(&self) -> bool {
// check if enabled via unstable
self.node_modules_dir().ok().flatten() == Some(NodeModulesDirMode::Manual)
|| NPM_PROCESS_STATE
.as_ref()
.map(|s| matches!(s.kind, NpmProcessStateKind::Byonm))
.unwrap_or(false)
}
pub fn use_byonm(&self) -> bool {
if self.enable_future_features()
&& self.node_modules_dir_enablement().is_none()
if self.node_modules_dir().ok().flatten().is_none()
&& self.maybe_node_modules_folder.is_some()
&& self
.workspace()
@ -1624,13 +1627,7 @@ impl CliOptions {
return true;
}
// check if enabled via unstable
self.flags.unstable_config.byonm
|| NPM_PROCESS_STATE
.as_ref()
.map(|s| matches!(s.kind, NpmProcessStateKind::Byonm))
.unwrap_or(false)
|| self.workspace().has_unstable("byonm")
self.byonm_enabled()
}
pub fn unstable_sloppy_imports(&self) -> bool {
@ -1652,18 +1649,17 @@ impl CliOptions {
}
});
if *DENO_FUTURE {
let future_features = [
deno_runtime::deno_ffi::UNSTABLE_FEATURE_NAME.to_string(),
deno_runtime::deno_fs::UNSTABLE_FEATURE_NAME.to_string(),
deno_runtime::deno_webgpu::UNSTABLE_FEATURE_NAME.to_string(),
];
future_features.iter().for_each(|future_feature| {
if !from_config_file.contains(future_feature) {
from_config_file.push(future_feature.to_string());
}
});
}
// TODO(2.0): remove this code and enable these features in `99_main.js` by default.
let future_features = [
deno_runtime::deno_ffi::UNSTABLE_FEATURE_NAME.to_string(),
deno_runtime::deno_fs::UNSTABLE_FEATURE_NAME.to_string(),
deno_runtime::deno_webgpu::UNSTABLE_FEATURE_NAME.to_string(),
];
future_features.iter().for_each(|future_feature| {
if !from_config_file.contains(future_feature) {
from_config_file.push(future_feature.to_string());
}
});
if !from_config_file.is_empty() {
// collect unstable granular flags
@ -1762,42 +1758,55 @@ impl CliOptions {
fn resolve_node_modules_folder(
cwd: &Path,
flags: &Flags,
maybe_config_file: Option<&ConfigFile>,
maybe_package_json: Option<&PackageJson>,
workspace: &Workspace,
deno_dir_provider: &Arc<DenoDirProvider>,
) -> Result<Option<PathBuf>, AnyError> {
let use_node_modules_dir = flags
.node_modules_dir
.or_else(|| maybe_config_file.and_then(|c| c.json.node_modules_dir))
.or(flags.vendor)
.or_else(|| maybe_config_file.and_then(|c| c.json.vendor));
fn resolve_from_root(root_folder: &FolderConfigs, cwd: &Path) -> PathBuf {
root_folder
.deno_json
.as_ref()
.map(|c| Cow::Owned(c.dir_path()))
.or_else(|| {
root_folder
.pkg_json
.as_ref()
.map(|c| Cow::Borrowed(c.dir_path()))
})
.unwrap_or(Cow::Borrowed(cwd))
.join("node_modules")
}
let root_folder = workspace.root_folder_configs();
let use_node_modules_dir = if let Some(mode) = flags.node_modules_dir {
Some(mode.uses_node_modules_dir())
} else {
workspace
.node_modules_dir_mode()?
.map(|m| m.uses_node_modules_dir())
.or(flags.vendor)
.or_else(|| root_folder.deno_json.as_ref().and_then(|c| c.json.vendor))
};
let path = if use_node_modules_dir == Some(false) {
return Ok(None);
} else if let Some(state) = &*NPM_PROCESS_STATE {
return Ok(state.local_node_modules_path.as_ref().map(PathBuf::from));
} else if let Some(package_json_path) = maybe_package_json.map(|c| &c.path) {
} else if workspace.package_jsons().next().is_some() {
let node_modules_dir = resolve_from_root(root_folder, cwd);
if let Ok(deno_dir) = deno_dir_provider.get_or_create() {
// `deno_dir.root` can be symlink in macOS
if let Ok(root) = canonicalize_path_maybe_not_exists(&deno_dir.root) {
if package_json_path.starts_with(root) {
if node_modules_dir.starts_with(root) {
// if the package.json is in deno_dir, then do not use node_modules
// next to it as local node_modules dir
return Ok(None);
}
}
}
// auto-discover the local_node_modules_folder when a package.json exists
// and it's not in deno_dir
package_json_path.parent().unwrap().join("node_modules")
node_modules_dir
} else if use_node_modules_dir.is_none() {
return Ok(None);
} else if let Some(config_path) = maybe_config_file
.as_ref()
.and_then(|c| c.specifier.to_file_path().ok())
{
config_path.parent().unwrap().join("node_modules")
} else {
cwd.join("node_modules")
resolve_from_root(root_folder, cwd)
};
Ok(Some(canonicalize_path_maybe_not_exists(&path)?))
}
@ -1887,19 +1896,18 @@ pub fn npm_pkg_req_ref_to_binary_command(
pub fn config_to_deno_graph_workspace_member(
config: &ConfigFile,
) -> Result<deno_graph::WorkspaceMember, AnyError> {
let nv = deno_semver::package::PackageNv {
name: match &config.json.name {
Some(name) => name.clone(),
None => bail!("Missing 'name' field in config file."),
},
version: match &config.json.version {
Some(name) => deno_semver::Version::parse_standard(name)?,
None => bail!("Missing 'version' field in config file."),
},
let name = match &config.json.name {
Some(name) => name.clone(),
None => bail!("Missing 'name' field in config file."),
};
let version = match &config.json.version {
Some(name) => Some(deno_semver::Version::parse_standard(name)?),
None => None,
};
Ok(deno_graph::WorkspaceMember {
base: config.specifier.join("./").unwrap(),
nv,
name,
version,
exports: config.to_exports_config()?.into_map(),
})
}

View file

@ -793,20 +793,12 @@ impl CliFactory {
self.maybe_inspector_server()?.clone(),
cli_options.maybe_lockfile().cloned(),
self.feature_checker()?.clone(),
self.create_cli_main_worker_options()?,
cli_options.node_ipc_fd(),
cli_options.serve_port(),
cli_options.serve_host(),
cli_options.enable_future_features(),
// TODO(bartlomieju): temporarily disabled
// cli_options.disable_deprecated_api_warning,
true,
cli_options.verbose_deprecated_api_warning,
if cli_options.code_cache_enabled() {
Some(self.code_cache()?.clone())
} else {
None
},
self.create_cli_main_worker_options()?,
))
}
@ -871,6 +863,13 @@ impl CliFactory {
unstable: cli_options.legacy_unstable_flag(),
create_hmr_runner,
create_coverage_collector,
node_ipc: cli_options.node_ipc_fd(),
serve_port: cli_options.serve_port(),
serve_host: cli_options.serve_host(),
// TODO(bartlomieju): temporarily disabled
disable_deprecated_api_warning: true,
verbose_deprecated_api_warning: cli_options
.verbose_deprecated_api_warning,
})
}
}

View file

@ -541,7 +541,12 @@ impl ModuleGraphBuilder {
) -> Result<(), AnyError> {
// ensure an "npm install" is done if the user has explicitly
// opted into using a node_modules directory
if self.options.node_modules_dir_enablement() == Some(true) {
if self
.options
.node_modules_dir()?
.map(|m| m.uses_node_modules_dir())
.unwrap_or(false)
{
if let Some(npm_resolver) = self.npm_resolver.as_managed() {
npm_resolver.ensure_top_level_package_json_install().await?;
}

View file

@ -5,6 +5,7 @@ use deno_config::deno_json::DenoJsonCache;
use deno_config::deno_json::FmtConfig;
use deno_config::deno_json::FmtOptionsConfig;
use deno_config::deno_json::LintConfig;
use deno_config::deno_json::NodeModulesDirMode;
use deno_config::deno_json::TestConfig;
use deno_config::deno_json::TsConfig;
use deno_config::fs::DenoConfigFs;
@ -54,7 +55,6 @@ use crate::args::CliLockfile;
use crate::args::ConfigFile;
use crate::args::LintFlags;
use crate::args::LintOptions;
use crate::args::DENO_FUTURE;
use crate::cache::FastInsecureHasher;
use crate::file_fetcher::FileFetcher;
use crate::lsp::logging::lsp_warn;
@ -1387,11 +1387,14 @@ impl ConfigData {
}
}
let byonm = std::env::var("DENO_UNSTABLE_BYONM").is_ok()
|| member_dir.workspace.has_unstable("byonm")
|| (*DENO_FUTURE
&& member_dir.workspace.package_jsons().next().is_some()
&& member_dir.workspace.node_modules_dir().is_none());
let node_modules_dir = member_dir
.workspace
.node_modules_dir_mode()
.unwrap_or_default();
let byonm = match node_modules_dir {
Some(mode) => mode == NodeModulesDirMode::Manual,
None => member_dir.workspace.package_jsons().next().is_some(),
};
if byonm {
lsp_log!(" Enabled 'bring your own node_modules'.");
}
@ -1865,13 +1868,17 @@ fn resolve_node_modules_dir(
// `nodeModulesDir: true` setting in the deno.json file. This is to
// reduce the chance of modifying someone's node_modules directory
// without them having asked us to do so.
let explicitly_disabled = workspace.node_modules_dir() == Some(false);
let node_modules_mode = workspace.node_modules_dir_mode().ok().flatten();
let explicitly_disabled = node_modules_mode == Some(NodeModulesDirMode::None);
if explicitly_disabled {
return None;
}
let enabled = byonm
|| workspace.node_modules_dir() == Some(true)
|| node_modules_mode
.map(|m| m.uses_node_modules_dir())
.unwrap_or(false)
|| workspace.vendor_dir_path().is_some();
if !enabled {
return None;
}

View file

@ -3611,11 +3611,6 @@ impl Inner {
.as_ref()
.map(|url| url.to_string())
}),
node_modules_dir: Some(
config_data
.and_then(|d| d.node_modules_dir.as_ref())
.is_some(),
),
// bit of a hack to force the lsp to cache the @types/node package
type_check_mode: crate::args::TypeCheckMode::Local,
..Default::default()

View file

@ -32,7 +32,6 @@ mod worker;
use crate::args::flags_from_vec;
use crate::args::DenoSubcommand;
use crate::args::Flags;
use crate::args::DENO_FUTURE;
use crate::graph_container::ModuleGraphContainer;
use crate::util::display;
use crate::util::v8::get_v8_flags_from_env;
@ -454,30 +453,19 @@ fn resolve_flags_and_init(
// https://github.com/microsoft/vscode/blob/48d4ba271686e8072fc6674137415bc80d936bc7/extensions/typescript-language-features/src/configuration/configuration.ts#L213-L214
DenoSubcommand::Lsp => vec!["--max-old-space-size=3072".to_string()],
_ => {
if *DENO_FUTURE {
// TODO(bartlomieju): I think this can be removed as it's handled by `deno_core`
// and its settings.
// deno_ast removes TypeScript `assert` keywords, so this flag only affects JavaScript
// TODO(petamoriken): Need to check TypeScript `assert` keywords in deno_ast
vec!["--no-harmony-import-assertions".to_string()]
} else {
vec![
// TODO(bartlomieju): I think this can be removed as it's handled by `deno_core`
// and its settings.
// If we're still in v1.X version we want to support import assertions.
// V8 12.6 unshipped the support by default, so force it by passing a
// flag.
"--harmony-import-assertions".to_string(),
// Verify with DENO_FUTURE for now.
"--no-maglev".to_string(),
]
}
// TODO(bartlomieju): I think this can be removed as it's handled by `deno_core`
// and its settings.
// deno_ast removes TypeScript `assert` keywords, so this flag only affects JavaScript
// TODO(petamoriken): Need to check TypeScript `assert` keywords in deno_ast
vec!["--no-harmony-import-assertions".to_string()]
}
};
init_v8_flags(&default_v8_flags, &flags.v8_flags, get_v8_flags_from_env());
// TODO(bartlomieju): remove last argument in Deno 2.
deno_core::JsRuntime::init_platform(None, !*DENO_FUTURE);
deno_core::JsRuntime::init_platform(
None, /* import assertions enabled */ false,
);
util::logger::init(flags.log_level);
Ok(flags)

View file

@ -2,7 +2,7 @@
[package]
name = "napi_sym"
version = "0.96.0"
version = "0.97.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -831,22 +831,14 @@ async fn sync_resolution_with_fs(
}
if !packages_with_scripts_not_run.is_empty() {
let (maybe_install, maybe_install_example) = if *crate::args::DENO_FUTURE {
(
" or `deno install`",
" or `deno install --allow-scripts=pkg1,pkg2`",
)
} else {
("", "")
};
let packages = packages_with_scripts_not_run
.iter()
.map(|(_, p)| format!("npm:{p}"))
.collect::<Vec<_>>()
.join(", ");
log::warn!("{}: Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed.
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache`{maybe_install}
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>`{maybe_install_example}):\n {packages}", crate::colors::yellow("warning"));
This may cause the packages to not work correctly. To run them, use the `--allow-scripts` flag with `deno cache` or `deno install`
(e.g. `deno cache --allow-scripts=pkg1,pkg2 <entrypoint>` or `deno install --allow-scripts=pkg1,pkg2`):\n {packages}", crate::colors::yellow("warning"));
for (scripts_warned_path, _) in packages_with_scripts_not_run {
let _ignore_err = fs::write(scripts_warned_path, "");
}

View file

@ -225,13 +225,8 @@ impl CliNodeResolver {
let package_json_path = package_folder.join("package.json");
if !self.fs.exists_sync(&package_json_path) {
return Err(anyhow!(
"Could not find '{}'. Deno expects the node_modules/ directory to be up to date. Did you forget to run `{}`?",
"Could not find '{}'. Deno expects the node_modules/ directory to be up to date. Did you forget to run `deno install`?",
package_json_path.display(),
if *crate::args::DENO_FUTURE {
"deno install"
} else {
"npm install"
},
));
}
}

View file

@ -629,7 +629,6 @@ impl<'a> DenoCompileBinaryWriter<'a> {
unstable_config: UnstableConfig {
legacy_flag_enabled: cli_options.legacy_unstable_flag(),
bare_node_builtins: cli_options.unstable_bare_node_builtins(),
byonm: cli_options.use_byonm(),
sloppy_imports: cli_options.unstable_sloppy_imports(),
features: cli_options.unstable_features(),
},

View file

@ -706,6 +706,8 @@ pub async fn run(
None,
None,
feature_checker,
// Code cache is not supported for standalone binary yet.
None,
CliMainWorkerOptions {
argv: metadata.argv,
log_level: WorkerLogLevel::Info,
@ -732,17 +734,13 @@ pub async fn run(
unstable: metadata.unstable_config.legacy_flag_enabled,
create_hmr_runner: None,
create_coverage_collector: None,
node_ipc: None,
serve_port: None,
serve_host: None,
// TODO(bartlomieju): temporarily disabled
disable_deprecated_api_warning: true,
verbose_deprecated_api_warning: false,
},
None,
None,
None,
false,
// TODO(bartlomieju): temporarily disabled
// metadata.disable_deprecated_api_warning,
true,
false,
// Code cache is not supported for standalone binary yet.
None,
);
// Initialize v8 once from the main thread.

View file

@ -427,7 +427,7 @@ fn get_tsc_roots(
// now walk the graph that only includes the fast check dependencies
while let Some(specifier) = pending.pop_front() {
let Some(module) = graph.get(&specifier) else {
let Some(module) = graph.get(specifier) else {
continue;
};
if let Some(entry) = maybe_get_check_entry(module, check_js) {

View file

@ -440,7 +440,7 @@ impl<'a> GraphDisplayContext<'a> {
}
let root_specifier = self.graph.resolve(&self.graph.roots[0]);
match self.graph.try_get(&root_specifier) {
match self.graph.try_get(root_specifier) {
Ok(Some(root)) => {
let maybe_cache_info = match root {
Module::Js(module) => module.maybe_cache_info.as_ref(),
@ -694,9 +694,9 @@ impl<'a> GraphDisplayContext<'a> {
Resolution::Ok(resolved) => {
let specifier = &resolved.specifier;
let resolved_specifier = self.graph.resolve(specifier);
Some(match self.graph.try_get(&resolved_specifier) {
Some(match self.graph.try_get(resolved_specifier) {
Ok(Some(module)) => self.build_module_info(module, type_dep),
Err(err) => self.build_error_info(err, &resolved_specifier),
Err(err) => self.build_error_info(err, resolved_specifier),
Ok(None) => TreeNode::from_text(format!(
"{} {}",
colors::red(specifier),

View file

@ -1049,7 +1049,8 @@ async fn publish_package(
sha256: faster_hex::hex_string(&sha2::Sha256::digest(&meta_bytes)),
},
};
let bundle = provenance::generate_provenance(http_client, subject).await?;
let bundle =
provenance::generate_provenance(http_client, vec![subject]).await?;
let tlog_entry = &bundle.verification_material.tlog_entries[0];
log::info!("{}",

View file

@ -140,10 +140,10 @@ impl DenoOrPackageJson {
),
factory,
)),
(None, Some(package_json)) if options.enable_future_features() => {
(None, Some(package_json)) => {
Ok((DenoOrPackageJson::Npm(package_json.clone(), None), factory))
}
(None, Some(_) | None) => {
(None, None) => {
std::fs::write(options.initial_cwd().join("deno.json"), "{}\n")
.context("Failed to create deno.json file")?;
drop(factory); // drop to prevent use

View file

@ -229,16 +229,16 @@ impl Predicate {
struct ProvenanceAttestation {
#[serde(rename = "type")]
_type: &'static str,
subject: Subject,
subject: Vec<Subject>,
predicate_type: &'static str,
predicate: Predicate,
}
impl ProvenanceAttestation {
pub fn new_github_actions(subject: Subject) -> Self {
pub fn new_github_actions(subjects: Vec<Subject>) -> Self {
Self {
_type: INTOTO_STATEMENT_TYPE,
subject,
subject: subjects,
predicate_type: SLSA_PREDICATE_TYPE,
predicate: Predicate::new_github_actions(),
}
@ -296,7 +296,7 @@ pub struct ProvenanceBundle {
pub async fn generate_provenance(
http_client: &HttpClient,
subject: Subject,
subjects: Vec<Subject>,
) -> Result<ProvenanceBundle, AnyError> {
if !is_gha() {
bail!("Automatic provenance is only available in GitHub Actions");
@ -308,7 +308,7 @@ pub async fn generate_provenance(
);
};
let slsa = ProvenanceAttestation::new_github_actions(subject);
let slsa = ProvenanceAttestation::new_github_actions(subjects);
let attestation = serde_json::to_string(&slsa)?;
let bundle = attest(http_client, &attestation, INTOTO_PAYLOAD_TYPE).await?;
@ -738,8 +738,13 @@ mod tests {
sha256: "yourmom".to_string(),
},
};
let slsa = ProvenanceAttestation::new_github_actions(subject);
assert_eq!(slsa.subject.name, "jsr:@divy/sdl2@0.0.1");
assert_eq!(slsa.subject.digest.sha256, "yourmom");
let slsa = ProvenanceAttestation::new_github_actions(vec![subject]);
assert_eq!(
slsa.subject.len(),
1,
"Subject should be an array per the in-toto specification"
);
assert_eq!(slsa.subject[0].name, "jsr:@divy/sdl2@0.0.1");
assert_eq!(slsa.subject[0].digest.sha256, "yourmom");
}
}

View file

@ -3,6 +3,7 @@
use std::io::Read;
use std::sync::Arc;
use deno_config::deno_json::NodeModulesDirMode;
use deno_core::error::AnyError;
use deno_runtime::deno_permissions::Permissions;
use deno_runtime::deno_permissions::PermissionsContainer;
@ -194,7 +195,9 @@ pub async fn eval_command(
pub async fn maybe_npm_install(factory: &CliFactory) -> Result<(), AnyError> {
// ensure an "npm install" is done if the user has explicitly
// opted into using a managed node_modules directory
if factory.cli_options()?.node_modules_dir_enablement() == Some(true) {
if factory.cli_options()?.node_modules_dir()?
== Some(NodeModulesDirMode::Auto)
{
if let Some(npm_resolver) = factory.npm_resolver().await?.as_managed() {
npm_resolver.ensure_top_level_package_json_install().await?;
}

View file

@ -326,7 +326,6 @@ pub const OP_DETAILS: phf::Map<&'static str, [&'static str; 2]> = phf_map! {
"op_fs_ftruncate_async" => ["truncate a file", "awaiting the result of a `Deno.ftruncate` or `Deno.FsFile.truncate` call"],
"op_fs_funlock_async_unstable" => ["unlock a file", "awaiting the result of a `Deno.funlock` call"],
"op_fs_funlock_async" => ["unlock a file", "awaiting the result of a `Deno.FsFile.unlock` call"],
"op_fs_futime_async" => ["change file timestamps", "awaiting the result of a `Deno.futime` or `Deno.FsFile.utime` call"],
"op_fs_link_async" => ["create a hard link", "awaiting the result of a `Deno.link` call"],
"op_fs_lstat_async" => ["get file metadata", "awaiting the result of a `Deno.lstat` call"],
"op_fs_make_temp_dir_async" => ["create a temporary directory", "awaiting the result of a `Deno.makeTempDir` call"],

View file

@ -15,6 +15,7 @@ use crate::util::progress_bar::ProgressBarStyle;
use crate::version;
use async_trait::async_trait;
use color_print::cstr;
use deno_core::anyhow::bail;
use deno_core::anyhow::Context;
use deno_core::error::AnyError;
@ -37,6 +38,8 @@ const RELEASE_URL: &str = "https://github.com/denoland/deno/releases";
const CANARY_URL: &str = "https://dl.deno.land/canary";
const RC_URL: &str = "https://dl.deno.land/release";
static EXAMPLE_USAGE: &str = cstr!("Example usage:\n <p(245)>deno upgrade | deno upgrade 1.46 | deno upgrade canary</>");
pub static ARCHIVE_NAME: Lazy<String> =
Lazy::new(|| format!("deno-{}.zip", env!("TARGET")));
@ -226,15 +229,70 @@ impl<
}
}
fn get_minor_version(version: &str) -> &str {
version.rsplitn(2, '.').collect::<Vec<&str>>()[1]
fn get_minor_version_blog_post_url(semver: &Version) -> String {
format!("https://deno.com/blog/v{}.{}", semver.major, semver.minor)
}
fn print_release_notes(current_version: &str, new_version: &str) {
// TODO(bartlomieju): we might want to reconsider this one for RC releases.
// TODO(bartlomieju): also maybe just parse using `Version::standard` instead
// of using `get_minor_version`?
if get_minor_version(current_version) == get_minor_version(new_version) {
fn get_rc_version_blog_post_url(semver: &Version) -> String {
format!(
"https://deno.com/blog/v{}.{}-rc-{}",
semver.major, semver.minor, semver.pre[1]
)
}
async fn print_release_notes(
current_version: &str,
new_version: &str,
client: &HttpClient,
) {
let Ok(current_semver) = Version::parse_standard(current_version) else {
return;
};
let Ok(new_semver) = Version::parse_standard(new_version) else {
return;
};
let is_switching_from_deno1_to_deno2 =
new_semver.major == 2 && current_semver.major == 1;
let is_deno_2_rc = new_semver.major == 2
&& new_semver.minor == 0
&& new_semver.patch == 0
&& new_semver.pre.first() == Some(&"rc".to_string());
if is_deno_2_rc || is_switching_from_deno1_to_deno2 {
log::info!(
"{}\n\n {}\n",
colors::gray("Migration guide:"),
colors::bold(
"https://docs.deno.com/runtime/manual/advanced/migrate_deprecations"
)
);
}
if is_deno_2_rc {
log::info!(
"{}\n\n {}\n",
colors::gray("If you find a bug, please report to:"),
colors::bold("https://github.com/denoland/deno/issues/new")
);
// Check if there's blog post entry for this release
let blog_url_str = get_rc_version_blog_post_url(&new_semver);
let blog_url = Url::parse(&blog_url_str).unwrap();
if client.download(blog_url).await.is_ok() {
log::info!(
"{}\n\n {}\n",
colors::gray("Blog post:"),
colors::bold(blog_url_str)
);
}
return;
}
let should_print = current_semver.major != new_semver.major
|| current_semver.minor != new_semver.minor;
if !should_print {
return;
}
@ -249,10 +307,7 @@ fn print_release_notes(current_version: &str, new_version: &str) {
log::info!(
"{}\n\n {}\n",
colors::gray("Blog post:"),
colors::bold(format!(
"https://deno.com/blog/v{}",
get_minor_version(new_version)
))
colors::bold(get_minor_version_blog_post_url(&new_semver))
);
}
@ -320,14 +375,14 @@ pub fn check_for_upgrades(
log::info!(
"{} {}",
colors::green("A new canary release of Deno is available."),
colors::italic_gray("Run `deno upgrade --canary` to install it.")
colors::italic_gray("Run `deno upgrade canary` to install it.")
);
}
ReleaseChannel::Rc => {
log::info!(
"{} {}",
colors::green("A new release candidate of Deno is available."),
colors::italic_gray("Run `deno upgrade --rc` to install it.")
colors::italic_gray("Run `deno upgrade rc` to install it.")
);
}
// TODO(bartlomieju)
@ -512,7 +567,9 @@ pub async fn upgrade(
print_release_notes(
version::DENO_VERSION_INFO.deno,
&selected_version_to_upgrade.version_or_hash,
);
&client,
)
.await;
}
drop(temp_dir);
return Ok(());
@ -540,7 +597,9 @@ pub async fn upgrade(
print_release_notes(
version::DENO_VERSION_INFO.deno,
&selected_version_to_upgrade.version_or_hash,
);
&client,
)
.await;
}
drop(temp_dir); // delete the temp dir
@ -591,12 +650,20 @@ impl RequestedVersion {
let (channel, passed_version) = if is_canary {
if !re_hash.is_match(&passed_version) {
bail!("Invalid commit hash passed");
bail!(
"Invalid commit hash passed ({})\n\n{}",
colors::gray(passed_version),
EXAMPLE_USAGE
);
}
(ReleaseChannel::Canary, passed_version)
} else {
let Ok(semver) = Version::parse_standard(&passed_version) else {
bail!("Invalid version passed");
bail!(
"Invalid version passed ({})\n\n{}",
colors::gray(passed_version),
EXAMPLE_USAGE
);
};
if semver.pre.contains(&"rc".to_string()) {
@ -1692,4 +1759,31 @@ mod test {
);
}
}
#[test]
fn blog_post_links() {
let version = Version::parse_standard("1.46.0").unwrap();
assert_eq!(
get_minor_version_blog_post_url(&version),
"https://deno.com/blog/v1.46"
);
let version = Version::parse_standard("2.1.1").unwrap();
assert_eq!(
get_minor_version_blog_post_url(&version),
"https://deno.com/blog/v2.1"
);
let version = Version::parse_standard("2.0.0-rc.0").unwrap();
assert_eq!(
get_rc_version_blog_post_url(&version),
"https://deno.com/blog/v2.0-rc-0"
);
let version = Version::parse_standard("2.0.0-rc.2").unwrap();
assert_eq!(
get_rc_version_blog_post_url(&version),
"https://deno.com/blog/v2.0-rc-2"
);
}
}

View file

@ -88,7 +88,10 @@ pub async fn vendor(
let graph = output.graph;
let npm_package_count = graph.npm_packages.len();
let try_add_node_modules_dir = npm_package_count > 0
&& cli_options.node_modules_dir_enablement().unwrap_or(true);
&& cli_options
.node_modules_dir()?
.map(|m| m.uses_node_modules_dir())
.unwrap_or(true);
log::info!(
concat!("Vendored {} {} into {} directory.",),
@ -341,7 +344,7 @@ fn update_config_text(
let insert_position = obj.range.end - 1;
text_changes.push(TextChange {
range: insert_position..insert_position,
new_text: r#""nodeModulesDir": true"#.to_string(),
new_text: r#""nodeModulesDir": "auto""#.to_string(),
});
should_format = true;
modified_result.added_node_modules_dir = true;
@ -451,7 +454,7 @@ mod internal_test {
assert_eq!(
result.new_text.unwrap(),
r#"{
"nodeModulesDir": true,
"nodeModulesDir": "auto",
"importMap": "./vendor/import_map.json"
}
"#
@ -464,7 +467,7 @@ mod internal_test {
assert_eq!(
result.new_text.unwrap(),
r#"{
"nodeModulesDir": true
"nodeModulesDir": "auto"
}
"#
);
@ -543,10 +546,10 @@ mod internal_test {
#[test]
fn no_update_node_modules_dir() {
// will not update if this is already set (even if it's false)
// will not update if this is already set (even if it's "none")
let result = update_config_text(
r#"{
"nodeModulesDir": false
"nodeModulesDir": "none"
}
"#,
&Default::default(),
@ -560,7 +563,7 @@ mod internal_test {
let result = update_config_text(
r#"{
"nodeModulesDir": true
"nodeModulesDir": "auto"
}
"#,
&Default::default(),

View file

@ -4060,73 +4060,6 @@ declare namespace Deno {
bytesReceived: number;
}
/** @category Runtime
*
* @deprecated This will be removed in Deno 2.0.
*/
export interface Metrics extends OpMetrics {
ops: Record<string, OpMetrics>;
}
/** Receive metrics from the privileged side of Deno. This is primarily used
* in the development of Deno. _Ops_, also called _bindings_, are the
* go-between between Deno JavaScript sandbox and the rest of Deno.
*
* ```shell
* > console.table(Deno.metrics())
*
* (index) Values
*
* opsDispatched 3
* opsDispatchedSync 2
* opsDispatchedAsync 1
* opsDispatchedAsyncUnref 0
* opsCompleted 3
* opsCompletedSync 2
* opsCompletedAsync 1
* opsCompletedAsyncUnref 0
* bytesSentControl 73
* bytesSentData 0
* bytesReceived 375
*
* ```
*
* @category Runtime
*
* @deprecated This will be removed in Deno 2.0.
*/
export function metrics(): Metrics;
/**
* A map of open resources that Deno is tracking. The key is the resource ID
* (_rid_) and the value is its representation.
*
* @deprecated This will be removed in Deno 2.0.
*
* @category Runtime */
export interface ResourceMap {
[rid: number]: unknown;
}
/** Returns a map of open resource IDs (_rid_) along with their string
* representations. This is an internal API and as such resource
* representation has `unknown` type; that means it can change any time and
* should not be depended upon.
*
* ```ts
* console.log(Deno.resources());
* // { 0: "stdin", 1: "stdout", 2: "stderr" }
* Deno.openSync('../test.file');
* console.log(Deno.resources());
* // { 0: "stdin", 1: "stdout", 2: "stderr", 3: "fsFile" }
* ```
*
* @deprecated This will be removed in Deno 2.0.
*
* @category Runtime
*/
export function resources(): ResourceMap;
/**
* Additional information for FsEvent objects with the "other" kind.
*
@ -5506,50 +5439,6 @@ declare namespace Deno {
*/
export function ftruncateSync(rid: number, len?: number): void;
/**
* Synchronously changes the access (`atime`) and modification (`mtime`) times
* of a file stream resource referenced by `rid`. Given times are either in
* seconds (UNIX epoch time) or as `Date` objects.
*
* ```ts
* const file = Deno.openSync("file.txt", { create: true, write: true });
* Deno.futimeSync(file.rid, 1556495550, new Date());
* ```
*
* @deprecated This will be removed in Deno 2.0. See the
* {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
* for migration instructions.
*
* @category File System
*/
export function futimeSync(
rid: number,
atime: number | Date,
mtime: number | Date,
): void;
/**
* Changes the access (`atime`) and modification (`mtime`) times of a file
* stream resource referenced by `rid`. Given times are either in seconds
* (UNIX epoch time) or as `Date` objects.
*
* ```ts
* const file = await Deno.open("file.txt", { create: true, write: true });
* await Deno.futime(file.rid, 1556495550, new Date());
* ```
*
* @deprecated This will be removed in Deno 2.0. See the
* {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
* for migration instructions.
*
* @category File System
*/
export function futime(
rid: number,
atime: number | Date,
mtime: number | Date,
): Promise<void>;
/**
* Returns a `Deno.FileInfo` for the given file stream.
*

View file

@ -116,6 +116,11 @@ pub struct CliMainWorkerOptions {
pub skip_op_registration: bool,
pub create_hmr_runner: Option<CreateHmrRunnerCb>,
pub create_coverage_collector: Option<CreateCoverageCollectorCb>,
pub node_ipc: Option<i64>,
pub serve_port: Option<u16>,
pub serve_host: Option<String>,
pub disable_deprecated_api_warning: bool,
pub verbose_deprecated_api_warning: bool,
}
struct SharedWorkerState {
@ -135,13 +140,8 @@ struct SharedWorkerState {
maybe_inspector_server: Option<Arc<InspectorServer>>,
maybe_lockfile: Option<Arc<CliLockfile>>,
feature_checker: Arc<FeatureChecker>,
node_ipc: Option<i64>,
enable_future_features: bool,
disable_deprecated_api_warning: bool,
verbose_deprecated_api_warning: bool,
code_cache: Option<Arc<dyn code_cache::CodeCache>>,
serve_port: Option<u16>,
serve_host: Option<String>,
}
impl SharedWorkerState {
@ -434,14 +434,8 @@ impl CliMainWorkerFactory {
maybe_inspector_server: Option<Arc<InspectorServer>>,
maybe_lockfile: Option<Arc<CliLockfile>>,
feature_checker: Arc<FeatureChecker>,
options: CliMainWorkerOptions,
node_ipc: Option<i64>,
serve_port: Option<u16>,
serve_host: Option<String>,
enable_future_features: bool,
disable_deprecated_api_warning: bool,
verbose_deprecated_api_warning: bool,
code_cache: Option<Arc<dyn code_cache::CodeCache>>,
options: CliMainWorkerOptions,
) -> Self {
Self {
shared: Arc::new(SharedWorkerState {
@ -461,12 +455,8 @@ impl CliMainWorkerFactory {
maybe_inspector_server,
maybe_lockfile,
feature_checker,
node_ipc,
serve_port,
serve_host,
enable_future_features,
disable_deprecated_api_warning,
verbose_deprecated_api_warning,
// TODO(2.0): remove?
enable_future_features: true,
code_cache,
}),
}
@ -602,13 +592,17 @@ impl CliMainWorkerFactory {
has_node_modules_dir: shared.options.has_node_modules_dir,
argv0: shared.options.argv0.clone(),
node_debug: shared.options.node_debug.clone(),
node_ipc_fd: shared.node_ipc,
disable_deprecated_api_warning: shared.disable_deprecated_api_warning,
verbose_deprecated_api_warning: shared.verbose_deprecated_api_warning,
node_ipc_fd: shared.options.node_ipc,
disable_deprecated_api_warning: shared
.options
.disable_deprecated_api_warning,
verbose_deprecated_api_warning: shared
.options
.verbose_deprecated_api_warning,
future: shared.enable_future_features,
mode,
serve_port: shared.serve_port,
serve_host: shared.serve_host.clone(),
serve_port: shared.options.serve_port,
serve_host: shared.options.serve_host.clone(),
},
extensions: custom_extensions,
startup_snapshot: crate::js::deno_isolate_init(),
@ -801,12 +795,16 @@ fn create_web_worker_callback(
argv0: shared.options.argv0.clone(),
node_debug: shared.options.node_debug.clone(),
node_ipc_fd: None,
disable_deprecated_api_warning: shared.disable_deprecated_api_warning,
verbose_deprecated_api_warning: shared.verbose_deprecated_api_warning,
disable_deprecated_api_warning: shared
.options
.disable_deprecated_api_warning,
verbose_deprecated_api_warning: shared
.options
.verbose_deprecated_api_warning,
future: shared.enable_future_features,
mode: WorkerExecutionMode::Worker,
serve_port: shared.serve_port,
serve_host: shared.serve_host.clone(),
serve_port: shared.options.serve_port,
serve_host: shared.options.serve_host.clone(),
},
extensions: vec![],
startup_snapshot: crate::js::deno_isolate_init(),

View file

@ -2,7 +2,7 @@
[package]
name = "deno_broadcast_channel"
version = "0.160.0"
version = "0.161.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_cache"
version = "0.98.0"
version = "0.99.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_canvas"
version = "0.35.0"
version = "0.36.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_console"
version = "0.166.0"
version = "0.167.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_cron"
version = "0.46.0"
version = "0.47.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_crypto"
version = "0.180.0"
version = "0.181.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_fetch"
version = "0.190.0"
version = "0.191.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_ffi"
version = "0.153.0"
version = "0.154.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -482,32 +482,6 @@ function toUnixTimeFromEpoch(value) {
];
}
function futimeSync(
rid,
atime,
mtime,
) {
const { 0: atimeSec, 1: atimeNsec } = toUnixTimeFromEpoch(atime);
const { 0: mtimeSec, 1: mtimeNsec } = toUnixTimeFromEpoch(mtime);
op_fs_futime_sync(rid, atimeSec, atimeNsec, mtimeSec, mtimeNsec);
}
async function futime(
rid,
atime,
mtime,
) {
const { 0: atimeSec, 1: atimeNsec } = toUnixTimeFromEpoch(atime);
const { 0: mtimeSec, 1: mtimeNsec } = toUnixTimeFromEpoch(mtime);
await op_fs_futime_async(
rid,
atimeSec,
atimeNsec,
mtimeSec,
mtimeNsec,
);
}
function utimeSync(
path,
atime,
@ -766,11 +740,21 @@ class FsFile {
}
async utime(atime, mtime) {
await futime(this.#rid, atime, mtime);
const { 0: atimeSec, 1: atimeNsec } = toUnixTimeFromEpoch(atime);
const { 0: mtimeSec, 1: mtimeNsec } = toUnixTimeFromEpoch(mtime);
await op_fs_futime_async(
this.#rid,
atimeSec,
atimeNsec,
mtimeSec,
mtimeNsec,
);
}
utimeSync(atime, mtime) {
futimeSync(this.#rid, atime, mtime);
const { 0: atimeSec, 1: atimeNsec } = toUnixTimeFromEpoch(atime);
const { 0: mtimeSec, 1: mtimeNsec } = toUnixTimeFromEpoch(mtime);
op_fs_futime_sync(this.#rid, atimeSec, atimeNsec, mtimeSec, mtimeNsec);
}
isTerminal() {
@ -1004,8 +988,6 @@ export {
ftruncateSync,
funlock,
funlockSync,
futime,
futimeSync,
link,
linkSync,
lstat,

View file

@ -2,7 +2,7 @@
[package]
name = "deno_fs"
version = "0.76.0"
version = "0.77.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_http"
version = "0.164.0"
version = "0.165.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_io"
version = "0.76.0"
version = "0.77.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_kv"
version = "0.74.0"
version = "0.75.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_napi"
version = "0.97.0"
version = "0.98.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -63,10 +63,6 @@ async function write(rid, data) {
return await core.write(rid, data);
}
function shutdown(rid) {
return core.shutdown(rid);
}
async function resolveDns(query, recordType, options) {
let cancelRid;
let abortHandler;
@ -164,7 +160,7 @@ class Conn {
}
closeWrite() {
return shutdown(this.#rid);
return core.shutdown(this.#rid);
}
get readable() {
@ -647,7 +643,6 @@ export {
Listener,
listenOptionApiName,
resolveDns,
shutdown,
TcpConn,
UnixConn,
validatePort,

View file

@ -2,7 +2,7 @@
[package]
name = "deno_net"
version = "0.158.0"
version = "0.159.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -528,22 +528,4 @@ declare namespace Deno {
conn: TcpConn,
options?: StartTlsOptions,
): Promise<TlsConn>;
/** Shutdown socket send operations.
*
* Matches behavior of POSIX shutdown(3).
*
* ```ts
* const listener = Deno.listen({ port: 80 });
* const conn = await listener.accept();
* Deno.shutdown(conn.rid);
* ```
*
* @deprecated This will be removed in Deno 2.0. See the
* {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
* for migration instructions.
*
* @category Network
*/
export function shutdown(rid: number): Promise<void>;
}

View file

@ -2,7 +2,7 @@
[package]
name = "deno_node"
version = "0.103.0"
version = "0.104.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -145,7 +145,6 @@ export function fork(
args = [
"run",
...op_bootstrap_unstable_args(),
"--node-modules-dir",
"-A",
...stringifiedV8Flags,
...execArgv,

View file

@ -840,6 +840,11 @@ async function clientHttp2Request(
reqHeaders,
);
if (session.closed || session.destroyed) {
debugHttp2(">>> session closed during request promise");
throw new ERR_HTTP2_STREAM_CANCEL();
}
return await op_http2_client_request(
session[kDenoClientRid],
pseudoHeaders,
@ -900,6 +905,12 @@ export class ClientHttp2Stream extends Duplex {
session[kDenoClientRid],
this.#rid,
);
if (session.closed || session.destroyed) {
debugHttp2(">>> session closed during response promise");
throw new ERR_HTTP2_STREAM_CANCEL();
}
const [response, endStream] = await op_http2_client_get_response(
this.#rid,
);
@ -918,7 +929,12 @@ export class ClientHttp2Stream extends Duplex {
);
this[kDenoResponse] = response;
this.emit("ready");
})();
})().catch((e) => {
if (!(e instanceof ERR_HTTP2_STREAM_CANCEL)) {
debugHttp2(">>> request/response promise error", e);
}
this.destroy(e);
});
}
[kUpdateTimer]() {

View file

@ -2295,10 +2295,10 @@ export class ERR_HTTP2_INVALID_SETTING_VALUE extends NodeRangeError {
}
export class ERR_HTTP2_STREAM_CANCEL extends NodeError {
override cause?: Error;
constructor(error: Error) {
constructor(error?: Error) {
super(
"ERR_HTTP2_STREAM_CANCEL",
typeof error.message === "string"
error && typeof error.message === "string"
? `The pending stream has been canceled (caused by: ${error.message})`
: "The pending stream has been canceled",
);

View file

@ -2,7 +2,7 @@
[package]
name = "node_resolver"
version = "0.5.0"
version = "0.6.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_tls"
version = "0.153.0"
version = "0.154.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_url"
version = "0.166.0"
version = "0.167.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_web"
version = "0.197.0"
version = "0.198.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_webgpu"
version = "0.133.0"
version = "0.134.0"
authors = ["the Deno authors"]
edition.workspace = true
license = "MIT"

View file

@ -2,7 +2,7 @@
[package]
name = "deno_webidl"
version = "0.166.0"
version = "0.167.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_websocket"
version = "0.171.0"
version = "0.172.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_webstorage"
version = "0.161.0"
version = "0.162.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -2,7 +2,7 @@
[package]
name = "deno_runtime"
version = "0.175.0"
version = "0.176.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -32,10 +32,6 @@ import * as cron from "ext:deno_cron/01_cron.ts";
import * as webgpuSurface from "ext:deno_webgpu/02_surface.js";
const denoNs = {
metrics: () => {
internals.warnOnDeprecatedApi("Deno.metrics()", new Error().stack);
return core.metrics();
},
Process: process.Process,
run: process.run,
isatty: tty.isatty,
@ -97,22 +93,6 @@ const denoNs = {
);
return fs.ftruncate(rid, len);
},
async futime(rid, atime, mtime) {
internals.warnOnDeprecatedApi(
"Deno.futime()",
new Error().stack,
"Use `Deno.FsFile.utime()` instead.",
);
await fs.futime(rid, atime, mtime);
},
futimeSync(rid, atime, mtime) {
internals.warnOnDeprecatedApi(
"Deno.futimeSync()",
new Error().stack,
"Use `Deno.FsFile.utimeSync()` instead.",
);
fs.futimeSync(rid, atime, mtime);
},
errors: errors.errors,
inspect: console.inspect,
env: os.env,
@ -190,14 +170,6 @@ const denoNs = {
connectTls: tls.connectTls,
listenTls: tls.listenTls,
startTls: tls.startTls,
shutdown(rid) {
internals.warnOnDeprecatedApi(
"Deno.shutdown()",
new Error().stack,
"Use `Deno.Conn.closeWrite()` instead.",
);
net.shutdown(rid);
},
fstatSync(rid) {
internals.warnOnDeprecatedApi(
"Deno.fstatSync()",

View file

@ -620,10 +620,6 @@ const internalSymbol = Symbol("Deno.internal");
const finalDenoNs = {
internal: internalSymbol,
[internalSymbol]: internals,
resources() {
internals.warnOnDeprecatedApi("Deno.resources()", new Error().stack);
return core.resources();
},
close(rid) {
internals.warnOnDeprecatedApi(
"Deno.close()",
@ -946,15 +942,12 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
delete Deno.funlockSync;
delete Deno.iter;
delete Deno.iterSync;
delete Deno.metrics;
delete Deno.readAll;
delete Deno.readAllSync;
delete Deno.read;
delete Deno.readSync;
delete Deno.resources;
delete Deno.seek;
delete Deno.seekSync;
delete Deno.shutdown;
delete Deno.writeAll;
delete Deno.writeAllSync;
delete Deno.write;
@ -1136,15 +1129,12 @@ function bootstrapWorkerRuntime(
delete Deno.funlockSync;
delete Deno.iter;
delete Deno.iterSync;
delete Deno.metrics;
delete Deno.readAll;
delete Deno.readAllSync;
delete Deno.read;
delete Deno.readSync;
delete Deno.resources;
delete Deno.seek;
delete Deno.seekSync;
delete Deno.shutdown;
delete Deno.writeAll;
delete Deno.writeAllSync;
delete Deno.write;

View file

@ -2,7 +2,7 @@
[package]
name = "deno_permissions"
version = "0.26.0"
version = "0.27.0"
authors.workspace = true
edition.workspace = true
license.workspace = true

View file

@ -26,6 +26,8 @@ fn xdg_cache_home_dir() {
assert!(xdg_cache_home.read_dir().count() > 0);
}
// TODO(2.0): reenable
#[ignore]
#[test]
fn cache_matching_package_json_dep_should_not_install_all() {
let context = TestContextBuilder::for_npm().use_temp_cwd().build();

View file

@ -257,35 +257,38 @@ itest!(check_dts {
exit_code: 1,
});
itest!(package_json_basic {
args: "check main.ts",
output: "package_json/basic/main.check.out",
envs: env_vars_for_npm_tests(),
http_server: true,
cwd: Some("package_json/basic"),
copy_temp_dir: Some("package_json/basic"),
exit_code: 0,
});
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
// itest!(package_json_basic {
// args: "check main.ts",
// output: "package_json/basic/main.check.out",
// envs: env_vars_for_npm_tests(),
// http_server: true,
// cwd: Some("package_json/basic"),
// copy_temp_dir: Some("package_json/basic"),
// exit_code: 0,
// });
itest!(package_json_fail_check {
args: "check --quiet fail_check.ts",
output: "package_json/basic/fail_check.check.out",
envs: env_vars_for_npm_tests(),
http_server: true,
cwd: Some("package_json/basic"),
copy_temp_dir: Some("package_json/basic"),
exit_code: 1,
});
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
// itest!(package_json_fail_check {
// args: "check --quiet fail_check.ts",
// output: "package_json/basic/fail_check.check.out",
// envs: env_vars_for_npm_tests(),
// http_server: true,
// cwd: Some("package_json/basic"),
// copy_temp_dir: Some("package_json/basic"),
// exit_code: 1,
// });
itest!(package_json_with_deno_json {
args: "check --quiet main.ts",
output: "package_json/deno_json/main.check.out",
cwd: Some("package_json/deno_json/"),
copy_temp_dir: Some("package_json/deno_json/"),
envs: env_vars_for_npm_tests(),
http_server: true,
exit_code: 1,
});
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
// itest!(package_json_with_deno_json {
// args: "check --quiet main.ts",
// output: "package_json/deno_json/main.check.out",
// cwd: Some("package_json/deno_json/"),
// copy_temp_dir: Some("package_json/deno_json/"),
// envs: env_vars_for_npm_tests(),
// http_server: true,
// exit_code: 1,
// });
#[test]
fn check_error_in_dep_then_fix() {

View file

@ -726,7 +726,9 @@ fn dynamic_import_unanalyzable() {
.assert_exit_code(0);
}
// TODO(2.0): this test should first run `deno install`?
#[test]
#[ignore]
fn compile_npm_specifiers() {
let context = TestContextBuilder::for_npm().use_temp_cwd().build();
@ -850,7 +852,7 @@ fn compile_npm_file_system() {
compile_args: vec!["-A"],
run_args: vec![],
output_file: "compile/npm_fs/main.out",
node_modules_dir: true,
node_modules_local: true,
input_name: Some("binary"),
expected_name: "binary",
exit_code: 0,
@ -865,7 +867,7 @@ fn compile_npm_bin_esm() {
compile_args: vec![],
run_args: vec!["this", "is", "a", "test"],
output_file: "npm/deno_run_esm.out",
node_modules_dir: false,
node_modules_local: false,
input_name: None,
expected_name: "cli-esm",
exit_code: 0,
@ -880,7 +882,7 @@ fn compile_npm_bin_cjs() {
compile_args: vec![],
run_args: vec!["this", "is", "a", "test"],
output_file: "npm/deno_run_cjs.out",
node_modules_dir: false,
node_modules_local: false,
input_name: None,
expected_name: "cli-cjs",
exit_code: 0,
@ -895,7 +897,7 @@ fn compile_npm_cowsay_main() {
compile_args: vec!["--allow-read"],
run_args: vec!["Hello"],
output_file: "npm/deno_run_cowsay.out",
node_modules_dir: false,
node_modules_local: false,
input_name: None,
expected_name: "cowsay",
exit_code: 0,
@ -910,7 +912,7 @@ fn compile_npm_vfs_implicit_read_permissions() {
compile_args: vec![],
run_args: vec![],
output_file: "compile/vfs_implicit_read_permission/main.out",
node_modules_dir: false,
node_modules_local: false,
input_name: Some("binary"),
expected_name: "binary",
exit_code: 0,
@ -925,7 +927,7 @@ fn compile_npm_no_permissions() {
compile_args: vec![],
run_args: vec!["Hello"],
output_file: "npm/deno_run_cowsay_no_permissions.out",
node_modules_dir: false,
node_modules_local: false,
input_name: None,
expected_name: "cowsay",
exit_code: 1,
@ -940,7 +942,7 @@ fn compile_npm_cowsay_explicit() {
compile_args: vec!["--allow-read"],
run_args: vec!["Hello"],
output_file: "npm/deno_run_cowsay.out",
node_modules_dir: false,
node_modules_local: false,
input_name: None,
expected_name: "cowsay",
exit_code: 0,
@ -955,7 +957,7 @@ fn compile_npm_cowthink() {
compile_args: vec!["--allow-read"],
run_args: vec!["Hello"],
output_file: "npm/deno_run_cowthink.out",
node_modules_dir: false,
node_modules_local: false,
input_name: None,
expected_name: "cowthink",
exit_code: 0,
@ -965,7 +967,7 @@ fn compile_npm_cowthink() {
struct RunNpmBinCompileOptions<'a> {
input_specifier: &'a str,
copy_temp_dir: Option<&'a str>,
node_modules_dir: bool,
node_modules_local: bool,
output_file: &'a str,
input_name: Option<&'a str>,
expected_name: &'a str,
@ -986,8 +988,8 @@ fn run_npm_bin_compile_test(opts: RunNpmBinCompileOptions) {
args.extend(opts.compile_args.iter().map(|s| s.to_string()));
if opts.node_modules_dir {
args.push("--node-modules-dir".to_string());
if opts.node_modules_local {
args.push("--node-modules-dir=auto".to_string());
}
if let Some(bin_name) = opts.input_name {
@ -1050,7 +1052,7 @@ fn compile_node_modules_symlink_outside() {
// compile folder
let output = context
.new_command()
.args("compile --allow-read --node-modules-dir --output bin main.ts")
.args("compile --allow-read --node-modules-dir=auto --output bin main.ts")
.run();
output.assert_exit_code(0);
output.assert_matches_file(
@ -1073,7 +1075,7 @@ fn compile_node_modules_symlink_outside() {
// compile
let output = context
.new_command()
.args("compile --allow-read --node-modules-dir --output bin main.ts")
.args("compile --allow-read --node-modules-dir=auto --output bin main.ts")
.run();
output.assert_exit_code(0);
output.assert_matches_file(
@ -1103,7 +1105,7 @@ console.log(getValue());"#,
// compile folder
let output = context
.new_command()
.args("compile --allow-read --node-modules-dir --output bin main.ts")
.args("compile --allow-read --node-modules-dir=auto --output bin main.ts")
.run();
output.assert_exit_code(0);
output.assert_matches_text(

View file

@ -2,7 +2,7 @@
use test_util as util;
use test_util::itest;
use util::env_vars_for_npm_tests;
// use util::env_vars_for_npm_tests;
use util::TestContextBuilder;
#[test]
@ -135,15 +135,16 @@ itest!(with_config_override {
output: "info/with_config/with_config.out",
});
itest!(package_json_basic {
args: "info --quiet main.ts",
output: "package_json/basic/main.info.out",
envs: env_vars_for_npm_tests(),
http_server: true,
cwd: Some("package_json/basic"),
copy_temp_dir: Some("package_json/basic"),
exit_code: 0,
});
// TODO(2.0): this test should be a spec test and first run `deno install`
// itest!(package_json_basic {
// args: "info --quiet main.ts",
// output: "package_json/basic/main.info.out",
// envs: env_vars_for_npm_tests(),
// http_server: true,
// cwd: Some("package_json/basic"),
// copy_temp_dir: Some("package_json/basic"),
// exit_code: 0,
// });
itest!(info_import_map {
args: "info preact/debug",

View file

@ -20,7 +20,7 @@ fn install_basic() {
let output = context
.new_command()
.args("install --check --name echo_test http://localhost:4545/echo.ts")
.args("install --check --name echo_test -g http://localhost:4545/echo.ts")
.envs([
("HOME", temp_dir_str.as_str()),
("USERPROFILE", temp_dir_str.as_str()),
@ -30,10 +30,7 @@ fn install_basic() {
output.assert_exit_code(0);
let output_text = output.combined_output();
assert_contains!(
output_text,
"`deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag."
);
assert_contains!(output_text, "✅ Successfully installed echo_test");
// no lockfile should be created locally
assert!(!temp_dir.path().join("deno.lock").exists());
@ -167,7 +164,7 @@ fn install_custom_dir_env_var() {
context
.new_command()
.current_dir(util::root_path()) // different cwd
.args("install --check --name echo_test http://localhost:4545/echo.ts")
.args("install --check --name echo_test -g http://localhost:4545/echo.ts")
.envs([
("HOME", temp_dir_str.as_str()),
("USERPROFILE", temp_dir_str.as_str()),
@ -210,6 +207,7 @@ fn installer_test_local_module_run() {
.current_dir(util::root_path())
.args_vec([
"install",
"-g",
"--name",
"echo_test",
"--root",
@ -254,7 +252,7 @@ fn installer_test_remote_module_run() {
let bin_dir = root_dir.join("bin");
context
.new_command()
.args("install --name echo_test --root ./root http://localhost:4545/echo.ts hello")
.args("install --name echo_test --root ./root -g http://localhost:4545/echo.ts hello")
.run()
.skip_output_check()
.assert_exit_code(0);
@ -296,7 +294,7 @@ fn check_local_by_default() {
let script_path_str = script_path.to_string_lossy().to_string();
context
.new_command()
.args_vec(["install", script_path_str.as_str()])
.args_vec(["install", "-g", script_path_str.as_str()])
.envs([
("HOME", temp_dir_str.as_str()),
("USERPROFILE", temp_dir_str.as_str()),
@ -320,7 +318,7 @@ fn check_local_by_default2() {
let script_path_str = script_path.to_string_lossy().to_string();
context
.new_command()
.args_vec(["install", script_path_str.as_str()])
.args_vec(["install", "-g", script_path_str.as_str()])
.envs([
("HOME", temp_dir_str.as_str()),
("NO_COLOR", "1"),

View file

@ -8757,9 +8757,9 @@ fn lsp_npm_specifier_unopened_file() {
assert_eq!(output.status.code(), Some(0));
let stdout = String::from_utf8(output.stdout).unwrap();
assert!(stdout.is_empty());
assert_eq!(stdout.as_str(), "");
let stderr = String::from_utf8(output.stderr).unwrap();
assert!(stderr.is_empty());
assert_eq!(stderr.as_str(), "");
// open main.ts, which imports other.ts (unopened)
client.did_open(json!({
@ -9035,7 +9035,7 @@ fn lsp_completions_node_specifier_node_modules_dir() {
temp_dir.write(
temp_dir.path().join("deno.json"),
json!({
"nodeModulesDir": true,
"nodeModulesDir": "auto",
})
.to_string(),
);
@ -9442,7 +9442,7 @@ fn lsp_npmrc() {
temp_dir.write(
temp_dir.path().join("deno.json"),
json!({
"nodeModulesDir": true,
"nodeModulesDir": "auto",
})
.to_string(),
);
@ -12369,6 +12369,13 @@ fn lsp_node_modules_dir() {
.use_temp_cwd()
.build();
let temp_dir = context.temp_dir();
temp_dir.write(
"deno.json",
json!({
"nodeModulesDir": "none",
})
.to_string(),
);
// having a package.json should have no effect on whether
// a node_modules dir is created
@ -12406,7 +12413,7 @@ fn lsp_node_modules_dir() {
temp_dir.write(
temp_dir.path().join("deno.json"),
"{ \"nodeModulesDir\": true, \"lock\": false }\n",
"{ \"nodeModulesDir\": \"auto\", \"lock\": false }\n",
);
let refresh_config = |client: &mut LspClient| {
client.change_configuration(json!({ "deno": {
@ -12442,7 +12449,7 @@ fn lsp_node_modules_dir() {
// now add a lockfile and cache
temp_dir.write(
temp_dir.path().join("deno.json"),
"{ \"nodeModulesDir\": true }\n",
"{ \"nodeModulesDir\": \"auto\" }\n",
);
refresh_config(&mut client);
cache(&mut client);
@ -13049,21 +13056,21 @@ fn lsp_deno_json_scopes_node_modules_dir() {
temp_dir.write(
"project1/deno.json",
json!({
"nodeModulesDir": true,
"nodeModulesDir": "auto",
})
.to_string(),
);
temp_dir.write(
"project2/deno.json",
json!({
"nodeModulesDir": true,
"nodeModulesDir": "auto",
})
.to_string(),
);
temp_dir.write(
"project2/project3/deno.json",
json!({
"nodeModulesDir": true,
"nodeModulesDir": "auto",
})
.to_string(),
);
@ -14240,7 +14247,7 @@ fn lsp_deno_json_workspace_node_modules_dir() {
"project1/deno.json",
json!({
"workspace": ["project2"],
"nodeModulesDir": true,
"nodeModulesDir": "auto",
})
.to_string(),
);
@ -14371,6 +14378,15 @@ fn lsp_npm_workspace() {
.use_temp_cwd()
.build();
let temp_dir = context.temp_dir();
// TODO(nayeemrmn): Goto definition for local npm package imports should work
// even with byonm. Remove this when fixed.
temp_dir.write(
"deno.json",
json!({
"nodeModulesDir": "auto",
})
.to_string(),
);
temp_dir.write(
"package.json",
json!({
@ -14609,11 +14625,8 @@ fn lsp_jupyter_byonm_diagnostics() {
}
#[test]
fn lsp_deno_future_env_byonm() {
let context = TestContextBuilder::for_npm()
.env("DENO_FUTURE", "1")
.use_temp_cwd()
.build();
fn lsp_byonm() {
let context = TestContextBuilder::for_npm().use_temp_cwd().build();
let temp_dir = context.temp_dir();
temp_dir.path().join("package.json").write_json(&json!({
"dependencies": {
@ -15171,7 +15184,6 @@ fn lsp_cjs_internal_types_default_export() {
.use_http_server()
.use_temp_cwd()
.add_npm_env_vars()
.env("DENO_FUTURE", "1")
.build();
let temp_dir = context.temp_dir();
temp_dir.write("deno.json", r#"{}"#);
@ -15220,7 +15232,6 @@ fn lsp_cjs_import_dual() {
.use_http_server()
.use_temp_cwd()
.add_npm_env_vars()
.env("DENO_FUTURE", "1")
.build();
let temp_dir = context.temp_dir();
temp_dir.write("deno.json", r#"{}"#);

View file

@ -107,7 +107,6 @@ fn node_unit_test(test: String) {
let mut deno = util::deno_cmd()
.current_dir(util::root_path())
.env("DENO_FUTURE", "1")
.arg("test")
.arg("--config")
.arg(deno_config_path())

View file

@ -140,7 +140,7 @@ itest!(mixed_case_package_name_global_dir {
itest!(mixed_case_package_name_local_dir {
args:
"run --node-modules-dir -A $TESTDATA/npm/mixed_case_package_name/local.ts",
"run --node-modules-dir=auto -A $TESTDATA/npm/mixed_case_package_name/local.ts",
output: "npm/mixed_case_package_name/local.out",
exit_code: 0,
envs: env_vars_for_npm_tests(),
@ -148,15 +148,16 @@ itest!(mixed_case_package_name_local_dir {
temp_cwd: true,
});
itest!(local_dir_resolves_symlinks {
args: "run -A index.js",
output: "npm/local_dir_resolves_symlinks/index.out",
exit_code: 0,
envs: env_vars_for_npm_tests(),
cwd: Some("npm/local_dir_resolves_symlinks/"),
copy_temp_dir: Some("npm/local_dir_resolves_symlinks/"),
http_server: true,
});
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
// itest!(local_dir_resolves_symlinks {
// args: "run -A index.js",
// output: "npm/local_dir_resolves_symlinks/index.out",
// exit_code: 0,
// envs: env_vars_for_npm_tests(),
// cwd: Some("npm/local_dir_resolves_symlinks/"),
// copy_temp_dir: Some("npm/local_dir_resolves_symlinks/"),
// http_server: true,
// });
// FIXME(bartlomieju): npm: specifiers are not handled in dynamic imports
// at the moment
@ -373,7 +374,7 @@ itest!(permissions_outside_package {
});
itest!(run_existing_npm_package {
args: "run --allow-read --node-modules-dir npm:@denotest/bin",
args: "run --allow-read --node-modules-dir=auto npm:@denotest/bin",
output: "npm/run_existing_npm_package/main.out",
envs: env_vars_for_npm_tests(),
http_server: true,
@ -384,7 +385,7 @@ itest!(run_existing_npm_package {
itest!(run_existing_npm_package_with_subpath {
args:
"run --allow-read --node-modules-dir npm:@denotest/bin/cli-esm dev --help",
"run --allow-read --node-modules-dir=auto npm:@denotest/bin/cli-esm dev --help",
output: "npm/run_existing_npm_package_with_subpath/main.out",
envs: env_vars_for_npm_tests(),
http_server: true,
@ -812,7 +813,7 @@ itest!(builtin_module_module {
itest!(node_modules_dir_require_added_node_modules_folder {
args:
"run --node-modules-dir -A --quiet $TESTDATA/npm/require_added_nm_folder/main.js",
"run --node-modules-dir=auto -A --quiet $TESTDATA/npm/require_added_nm_folder/main.js",
output: "npm/require_added_nm_folder/main.out",
envs: env_vars_for_npm_tests(),
http_server: true,
@ -830,7 +831,7 @@ itest!(node_modules_dir_require_main_entry {
});
itest!(node_modules_dir_with_deps {
args: "run --allow-read --allow-env --node-modules-dir $TESTDATA/npm/cjs_with_deps/main.js",
args: "run --allow-read --allow-env --node-modules-dir=auto $TESTDATA/npm/cjs_with_deps/main.js",
output: "npm/cjs_with_deps/main_node_modules.out",
envs: env_vars_for_npm_tests(),
http_server: true,
@ -838,7 +839,7 @@ itest!(node_modules_dir_with_deps {
});
itest!(node_modules_dir_yargs {
args: "run --allow-read --allow-env --node-modules-dir $TESTDATA/npm/cjs_yargs/main.js",
args: "run --allow-read --allow-env --node-modules-dir=auto $TESTDATA/npm/cjs_yargs/main.js",
output: "npm/cjs_yargs/main.out",
envs: env_vars_for_npm_tests(),
http_server: true,
@ -854,7 +855,7 @@ fn node_modules_dir_cache() {
let deno = util::deno_cmd_with_deno_dir(&deno_dir)
.current_dir(deno_dir.path())
.arg("cache")
.arg("--node-modules-dir")
.arg("--node-modules-dir=auto")
.arg("--quiet")
.arg(util::testdata_path().join("npm/dual_cjs_esm/main.ts"))
.envs(env_vars_for_npm_tests())
@ -887,7 +888,7 @@ fn node_modules_dir_cache() {
let deno = util::deno_cmd_with_deno_dir(&deno_dir)
.current_dir(deno_dir.path())
.arg("run")
.arg("--node-modules-dir")
.arg("--node-modules-dir=auto")
.arg("--quiet")
.arg("-A")
.arg(util::testdata_path().join("npm/dual_cjs_esm/main.ts"))
@ -1495,7 +1496,7 @@ fn peer_deps_with_copied_folders_and_lockfile() {
// now run with local node modules
let output = context
.new_command()
.args("run -A --node-modules-dir main.ts")
.args("run -A --node-modules-dir=auto main.ts")
.run();
output.assert_exit_code(0);
output.assert_matches_file(
@ -1513,7 +1514,7 @@ fn peer_deps_with_copied_folders_and_lockfile() {
// now again run with local node modules
let output = context
.new_command()
.args("run -A --node-modules-dir main.ts")
.args("run -A --node-modules-dir=auto main.ts")
.run();
output.assert_exit_code(0);
output.assert_matches_text("1\n2\n");
@ -1521,7 +1522,7 @@ fn peer_deps_with_copied_folders_and_lockfile() {
// now ensure it works with reloading
let output = context
.new_command()
.args("run -A --reload --node-modules-dir main.ts")
.args("run -A --reload --node-modules-dir=auto main.ts")
.run();
output.assert_exit_code(0);
output.assert_matches_file(
@ -1531,7 +1532,7 @@ fn peer_deps_with_copied_folders_and_lockfile() {
// now ensure it works with reloading and no lockfile
let output = context
.new_command()
.args("run -A --reload --node-modules-dir --no-lock main.ts")
.args("run -A --reload --node-modules-dir=auto --no-lock main.ts")
.run();
output.assert_exit_code(0);
output.assert_matches_file(
@ -1563,25 +1564,27 @@ itest!(create_require {
http_server: true,
});
itest!(node_modules_import_run {
args: "run --quiet main.ts",
output: "npm/node_modules_import/main.out",
http_server: true,
copy_temp_dir: Some("npm/node_modules_import/"),
cwd: Some("npm/node_modules_import/"),
envs: env_vars_for_npm_tests(),
exit_code: 0,
});
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
// itest!(node_modules_import_run {
// args: "run --quiet main.ts",
// output: "npm/node_modules_import/main.out",
// http_server: true,
// copy_temp_dir: Some("npm/node_modules_import/"),
// cwd: Some("npm/node_modules_import/"),
// envs: env_vars_for_npm_tests(),
// exit_code: 0,
// });
itest!(node_modules_import_check {
args: "check --quiet main.ts",
output: "npm/node_modules_import/main_check.out",
envs: env_vars_for_npm_tests(),
http_server: true,
cwd: Some("npm/node_modules_import/"),
copy_temp_dir: Some("npm/node_modules_import/"),
exit_code: 1,
});
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
// itest!(node_modules_import_check {
// args: "check --quiet main.ts",
// output: "npm/node_modules_import/main_check.out",
// envs: env_vars_for_npm_tests(),
// http_server: true,
// cwd: Some("npm/node_modules_import/"),
// copy_temp_dir: Some("npm/node_modules_import/"),
// exit_code: 1,
// });
itest!(non_existent_dep {
args: "cache npm:@denotest/non-existent-dep",
@ -1611,7 +1614,9 @@ itest!(non_existent_dep_version {
)),
});
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
#[test]
#[ignore]
fn reload_info_not_found_cache_but_exists_remote() {
fn remove_version(registry_json: &mut Value, version: &str) {
registry_json
@ -1875,7 +1880,7 @@ fn binary_package_with_optional_dependencies() {
let output = context
.new_command()
.args("run -A --node-modules-dir main.js")
.args("run -A --node-modules-dir=auto main.js")
.run();
#[cfg(target_os = "windows")]
@ -1966,7 +1971,7 @@ fn node_modules_dir_config_file() {
let node_modules_dir = temp_dir.path().join("node_modules");
let rm_node_modules = || std::fs::remove_dir_all(&node_modules_dir).unwrap();
temp_dir.write("deno.json", r#"{ "nodeModulesDir": true }"#);
temp_dir.write("deno.json", r#"{ "nodeModulesDir": "auto" }"#);
temp_dir.write("main.ts", "import 'npm:@denotest/esm-basic';");
let deno_cache_cmd = test_context.new_command().args("cache --quiet main.ts");
@ -1980,7 +1985,7 @@ fn node_modules_dir_config_file() {
assert!(node_modules_dir.exists());
rm_node_modules();
temp_dir.write("deno.json", r#"{ "nodeModulesDir": false }"#);
temp_dir.write("deno.json", r#"{ "nodeModulesDir": "none" }"#);
deno_cache_cmd.run();
assert!(!node_modules_dir.exists());
@ -1991,7 +1996,7 @@ fn node_modules_dir_config_file() {
test_context
.new_command()
.args("cache --quiet --node-modules-dir main.ts")
.args("cache --quiet --node-modules-dir=auto main.ts")
.run();
assert!(node_modules_dir.exists());
@ -1999,7 +2004,7 @@ fn node_modules_dir_config_file() {
rm_node_modules();
test_context
.new_command()
.args("cache --quiet --node-modules-dir=false --vendor main.ts")
.args("cache --quiet --node-modules-dir=none --vendor main.ts")
.run();
assert!(!node_modules_dir.exists());
}
@ -2016,7 +2021,7 @@ fn top_level_install_package_json_explicit_opt_in() {
// when the node_modules_dir is explicitly opted into, we should always
// ensure a top level package.json install occurs
temp_dir.write("deno.json", "{ \"nodeModulesDir\": true }");
temp_dir.write("deno.json", "{ \"nodeModulesDir\": \"auto\" }");
temp_dir.write(
"package.json",
"{ \"dependencies\": { \"@denotest/esm-basic\": \"1.0\" }}",
@ -2105,7 +2110,7 @@ itest!(check_package_file_dts_dmts_dcts {
});
itest!(require_resolve_url_paths {
args: "run -A --quiet --node-modules-dir url_paths.ts",
args: "run -A --quiet --node-modules-dir=auto url_paths.ts",
output: "npm/require_resolve_url/url_paths.out",
envs: env_vars_for_npm_tests(),
http_server: true,
@ -2116,10 +2121,7 @@ itest!(require_resolve_url_paths {
#[test]
fn byonm_cjs_esm_packages() {
let test_context = TestContextBuilder::for_npm()
.env("DENO_UNSTABLE_BYONM", "1")
.use_temp_cwd()
.build();
let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
let dir = test_context.temp_dir();
test_context.run_npm("init -y");
@ -2201,10 +2203,7 @@ console.log(getKind());
#[test]
fn future_byonm_cjs_esm_packages() {
let test_context = TestContextBuilder::for_npm()
.env("DENO_FUTURE", "1")
.use_temp_cwd()
.build();
let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
let dir = test_context.temp_dir();
test_context.run_npm("init -y");
@ -2285,59 +2284,13 @@ console.log(getKind());
}
#[test]
fn byonm_import_map() {
fn node_modules_dir_manual_import_map() {
let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
let dir = test_context.temp_dir();
dir.write(
"deno.json",
r#"{
"imports": {
"basic": "npm:@denotest/esm-basic"
},
"unstable": [ "byonm" ]
}"#,
);
dir.write(
"package.json",
r#"{
"name": "my-project",
"version": "1.0.0",
"type": "module",
"dependencies": {
"@denotest/esm-basic": "^1.0"
}
}"#,
);
test_context.run_npm("install");
dir.write(
"main.ts",
r#"
// import map should resolve
import { getValue } from "basic";
// and resolving via node resolution
import { setValue } from "@denotest/esm-basic";
setValue(5);
console.log(getValue());
"#,
);
let output = test_context.new_command().args("run main.ts").run();
output.assert_matches_text("5\n");
let output = test_context.new_command().args("check main.ts").run();
output.assert_matches_text("Check file:///[WILDCARD]/main.ts\n");
}
#[test]
fn future_byonm_import_map() {
let test_context = TestContextBuilder::for_npm()
.env("DENO_FUTURE", "1")
.use_temp_cwd()
.build();
let dir = test_context.temp_dir();
dir.write(
"deno.json",
r#"{
"nodeModulesDir": "manual",
"imports": {
"basic": "npm:@denotest/esm-basic"
}
@ -2376,10 +2329,7 @@ console.log(getValue());
#[test]
fn byonm_package_specifier_not_installed_and_invalid_subpath() {
let test_context = TestContextBuilder::for_npm()
.env("DENO_UNSTABLE_BYONM", "1")
.use_temp_cwd()
.build();
let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
let dir = test_context.temp_dir();
dir.path().join("package.json").write_json(&json!({
"dependencies": {
@ -2520,10 +2470,7 @@ console.log(getValue());
#[test]
fn future_byonm_npm_workspaces() {
let test_context = TestContextBuilder::for_npm()
.env("DENO_FUTURE", "1")
.use_temp_cwd()
.build();
let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
let dir = test_context.temp_dir();
dir.write(
@ -2776,7 +2723,7 @@ fn cjs_export_analysis_import_cjs_directly_relative_import() {
itest!(imports_package_json {
args:
"run --no-lock --node-modules-dir=false npm/imports_package_json/main.js",
"run --no-lock --node-modules-dir=none npm/imports_package_json/main.js",
output: "npm/imports_package_json/main.out",
envs: env_vars_for_npm_tests(),
http_server: true,
@ -2784,7 +2731,7 @@ itest!(imports_package_json {
itest!(imports_package_json_import_not_defined {
args:
"run --no-lock --node-modules-dir=false npm/imports_package_json/import_not_defined.js",
"run --no-lock --node-modules-dir=none npm/imports_package_json/import_not_defined.js",
output: "npm/imports_package_json/import_not_defined.out",
envs: env_vars_for_npm_tests(),
exit_code: 1,
@ -2793,7 +2740,7 @@ itest!(imports_package_json_import_not_defined {
itest!(imports_package_json_sub_path_import_not_defined {
args:
"run --no-lock --node-modules-dir=false npm/imports_package_json/sub_path_import_not_defined.js",
"run --no-lock --node-modules-dir=none npm/imports_package_json/sub_path_import_not_defined.js",
output: "npm/imports_package_json/sub_path_import_not_defined.out",
envs: env_vars_for_npm_tests(),
exit_code: 1,
@ -2801,7 +2748,7 @@ itest!(imports_package_json_sub_path_import_not_defined {
});
itest!(different_nested_dep_node_modules_dir_false {
args: "run --quiet --no-lock --node-modules-dir=false npm/different_nested_dep/main.js",
args: "run --quiet --no-lock --node-modules-dir=none npm/different_nested_dep/main.js",
output: "npm/different_nested_dep/main.out",
envs: env_vars_for_npm_tests(),
exit_code: 0,
@ -2809,7 +2756,7 @@ itest!(different_nested_dep_node_modules_dir_false {
});
itest!(different_nested_dep_node_modules_dir_true {
args: "run --no-lock --quiet --node-modules-dir=true main.js",
args: "run --no-lock --quiet --node-modules-dir=auto main.js",
output: "npm/different_nested_dep/main.out",
copy_temp_dir: Some("npm/different_nested_dep/"),
cwd: Some("npm/different_nested_dep/"),
@ -2843,11 +2790,7 @@ fn different_nested_dep_byonm_future() {
test_context.run_npm("install");
let output = test_context
.new_command()
.args("run main.js")
.env("DENO_FUTURE", "1")
.run();
let output = test_context.new_command().args("run main.js").run();
output.assert_matches_file("npm/different_nested_dep/main.out");
}

View file

@ -1040,7 +1040,9 @@ fn pty_tab_indexable_props() {
});
}
// TODO(2.0): this should first run `deno install`
#[flaky_test::flaky_test]
#[ignore]
fn package_json_uncached_no_error() {
let test_context = TestContextBuilder::for_npm()
.use_temp_cwd()

View file

@ -946,7 +946,9 @@ fn lock_redirects() {
);
}
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
#[test]
#[ignore]
fn lock_deno_json_package_json_deps() {
let context = TestContextBuilder::new()
.use_temp_cwd()
@ -1104,7 +1106,7 @@ fn lock_deno_json_package_json_deps_workspace() {
// deno.json
let deno_json = temp_dir.join("deno.json");
deno_json.write_json(&json!({
"nodeModulesDir": true
"nodeModulesDir": "auto"
}));
// package.json
@ -1801,16 +1803,6 @@ itest!(top_level_for_await_ts {
output: "run/top_level_await/top_level_for_await.out",
});
itest!(unstable_disabled_js {
args: "run --reload run/unstable.js",
output: "run/unstable_disabled_js.out",
});
itest!(unstable_enabled_js {
args: "run --quiet --reload --unstable-fs run/unstable.ts",
output: "run/unstable_enabled_js.out",
});
itest!(unstable_worker {
args: "run --reload --quiet --allow-read run/unstable_worker.ts",
output: "run/unstable_worker.ts.out",
@ -1848,26 +1840,6 @@ itest!(unstable_cron_enabled {
output: "run/unstable_cron.enabled.out",
});
itest!(unstable_ffi_disabled {
args: "run --quiet --reload --allow-read run/unstable_ffi.js",
output: "run/unstable_ffi.disabled.out",
});
itest!(unstable_ffi_enabled {
args: "run --quiet --reload --allow-read --unstable-ffi run/unstable_ffi.js",
output: "run/unstable_ffi.enabled.out",
});
itest!(unstable_fs_disabled {
args: "run --quiet --reload --allow-read run/unstable_fs.js",
output: "run/unstable_fs.disabled.out",
});
itest!(unstable_fs_enabled {
args: "run --quiet --reload --allow-read --unstable-fs run/unstable_fs.js",
output: "run/unstable_fs.enabled.out",
});
itest!(unstable_http_disabled {
args: "run --quiet --reload --allow-read run/unstable_http.js",
output: "run/unstable_http.disabled.out",
@ -1899,17 +1871,6 @@ itest!(unstable_kv_enabled {
output: "run/unstable_kv.enabled.out",
});
itest!(unstable_webgpu_disabled {
args: "run --quiet --reload --allow-read run/unstable_webgpu.js",
output: "run/unstable_webgpu.disabled.out",
});
itest!(unstable_webgpu_enabled {
args:
"run --quiet --reload --allow-read --unstable-webgpu run/unstable_webgpu.js",
output: "run/unstable_webgpu.enabled.out",
});
itest!(import_compression {
args: "run --quiet --reload --allow-net run/import_compression/main.ts",
output: "run/import_compression/main.out",
@ -3433,16 +3394,19 @@ itest!(
}
);
itest!(package_json_auto_discovered_for_npm_binary {
args: "run -L debug -A npm:@denotest/bin/cli-esm this is a test",
output: "run/with_package_json/npm_binary/main.out",
cwd: Some("run/with_package_json/npm_binary/"),
copy_temp_dir: Some("run/with_package_json/"),
envs: env_vars_for_npm_tests(),
http_server: true,
});
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
// itest!(package_json_auto_discovered_for_npm_binary {
// args: "run -L debug -A npm:@denotest/bin/cli-esm this is a test",
// output: "run/with_package_json/npm_binary/main.out",
// cwd: Some("run/with_package_json/npm_binary/"),
// copy_temp_dir: Some("run/with_package_json/"),
// envs: env_vars_for_npm_tests(),
// http_server: true,
// });
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
#[test]
#[ignore]
fn package_json_with_deno_json() {
let context = TestContextBuilder::for_npm()
.use_copy_temp_dir("package_json/deno_json/")

View file

@ -167,27 +167,29 @@ itest!(task_package_json_echo {
http_server: true,
});
itest!(task_package_json_npm_bin {
args: "task bin extra",
cwd: Some("task/package_json/"),
output: "task/package_json/bin.out",
copy_temp_dir: Some("task/package_json/"),
envs: env_vars_for_npm_tests(),
exit_code: 0,
http_server: true,
});
// TODO(2.0): this should first run `deno install`
// itest!(task_package_json_npm_bin {
// args: "task bin extra",
// cwd: Some("task/package_json/"),
// output: "task/package_json/bin.out",
// copy_temp_dir: Some("task/package_json/"),
// envs: env_vars_for_npm_tests(),
// exit_code: 0,
// http_server: true,
// });
// TODO(2.0): decide what to do with this test
// should not auto-install the packages in the package.json
// when using nodeModulesDir: false
itest!(task_package_json_node_modules_dir_false {
args: "task echo",
cwd: Some("task/package_json_node_modules_dir_false/"),
output: "task/package_json_node_modules_dir_false/bin.out",
copy_temp_dir: Some("task/package_json_node_modules_dir_false/"),
envs: env_vars_for_npm_tests(),
exit_code: 0,
http_server: true,
});
// itest!(task_package_json_node_modules_dir_false {
// args: "task echo",
// cwd: Some("task/package_json_node_modules_dir_false/"),
// output: "task/package_json_node_modules_dir_false/bin.out",
// copy_temp_dir: Some("task/package_json_node_modules_dir_false/"),
// envs: env_vars_for_npm_tests(),
// exit_code: 0,
// http_server: true,
// });
itest!(task_both_no_arg {
args: "task",
@ -207,15 +209,16 @@ itest!(task_both_deno_json_selected {
http_server: true,
});
itest!(task_both_package_json_selected {
args: "task bin asdf",
cwd: Some("task/both/"),
output: "task/both/package_json_selected.out",
copy_temp_dir: Some("task/both/"),
envs: env_vars_for_npm_tests(),
exit_code: 0,
http_server: true,
});
// TODO(2.0): not entirely clear what's wrong with this test
// itest!(task_both_package_json_selected {
// args: "task bin asdf",
// cwd: Some("task/both/"),
// output: "task/both/package_json_selected.out",
// copy_temp_dir: Some("task/both/"),
// envs: env_vars_for_npm_tests(),
// exit_code: 0,
// http_server: true,
// });
itest!(task_both_prefers_deno {
args: "task output some text",
@ -237,15 +240,16 @@ itest!(task_npx_non_existent {
http_server: true,
});
itest!(task_npx_on_own {
args: "task on-own",
cwd: Some("task/npx/"),
output: "task/npx/on_own.out",
copy_temp_dir: Some("task/npx/"),
envs: env_vars_for_npm_tests(),
exit_code: 1,
http_server: true,
});
// TODO(2.0): not entirely clear what's wrong with this test but it hangs for more than 60s
// itest!(task_npx_on_own {
// args: "task on-own",
// cwd: Some("task/npx/"),
// output: "task/npx/on_own.out",
// copy_temp_dir: Some("task/npx/"),
// envs: env_vars_for_npm_tests(),
// exit_code: 1,
// http_server: true,
// });
itest!(task_pre_post {
args: "task test",

View file

@ -6,7 +6,7 @@ use test_util as util;
use test_util::itest;
use util::assert_contains;
use util::assert_not_contains;
use util::env_vars_for_npm_tests;
// use util::env_vars_for_npm_tests;
use util::wildcard_match;
use util::TestContext;
use util::TestContextBuilder;
@ -617,15 +617,16 @@ fn sigint_with_hanging_test() {
);
}
itest!(package_json_basic {
args: "test",
output: "package_json/basic/lib.test.out",
envs: env_vars_for_npm_tests(),
http_server: true,
cwd: Some("package_json/basic"),
copy_temp_dir: Some("package_json/basic"),
exit_code: 0,
});
// TODO(2.0): this should be rewritten to a spec test and first run `deno install`
// itest!(package_json_basic {
// args: "test",
// output: "package_json/basic/lib.test.out",
// envs: env_vars_for_npm_tests(),
// http_server: true,
// cwd: Some("package_json/basic"),
// copy_temp_dir: Some("package_json/basic"),
// exit_code: 0,
// });
itest!(test_replace_timers {
args: "test test/replace_timers.js",

View file

@ -4,6 +4,7 @@ use std::process::Command;
use std::process::Stdio;
use std::time::Instant;
use test_util as util;
use test_util::assert_starts_with;
use test_util::TempDir;
use test_util::TestContext;
use util::TestContextBuilder;
@ -163,9 +164,10 @@ fn upgrade_invalid_stable_version() {
.wait_with_output()
.unwrap();
assert!(!output.status.success());
assert_eq!(
"error: Invalid version passed\n",
util::strip_ansi_codes(&String::from_utf8(output.stderr).unwrap())
assert_starts_with!(
&util::strip_ansi_codes(&String::from_utf8(output.stderr.clone()).unwrap())
.to_string(),
"error: Invalid version passed (foobar)"
);
}
@ -188,9 +190,10 @@ fn upgrade_invalid_canary_version() {
.wait_with_output()
.unwrap();
assert!(!output.status.success());
assert_eq!(
"error: Invalid commit hash passed\n",
util::strip_ansi_codes(&String::from_utf8(output.stderr).unwrap())
assert_starts_with!(
&util::strip_ansi_codes(&String::from_utf8(output.stderr.clone()).unwrap())
.to_string(),
"error: Invalid commit hash passed (foobar)"
);
}
@ -221,9 +224,10 @@ fn upgrade_invalid_lockfile() {
.unwrap();
assert!(!output.status.success());
// should make it here instead of erroring on an invalid lockfile
assert_eq!(
"error: Invalid version passed\n",
util::strip_ansi_codes(&String::from_utf8(output.stderr).unwrap())
assert_starts_with!(
&util::strip_ansi_codes(&String::from_utf8(output.stderr.clone()).unwrap())
.to_string(),
"error: Invalid version passed (foobar)"
);
}
@ -251,7 +255,7 @@ fn upgrade_prompt() {
pty.expect_any(&[
" 99999.99.99 Run `deno upgrade` to install it.",
// it builds canary releases on main, so check for this in that case
"Run `deno upgrade --canary` to install it.",
"Run `deno upgrade canary` to install it.",
]);
});
}

View file

@ -569,7 +569,9 @@ Download http://localhost:4545/vendor/logger.ts\n{}\n\n{}",
assert!(output.status.success());
}
// TODO(2.0): decide if this test should be updated or removed
#[test]
#[ignore]
fn vendor_npm_node_specifiers() {
let context = TestContextBuilder::for_npm().use_temp_cwd().build();
let temp_dir = context.temp_dir();
@ -600,7 +602,7 @@ fn vendor_npm_node_specifiers() {
vendored_npm_package_text("1 npm package"),
success_text_updated_deno_json("vendor/")
));
let output = context.new_command().args("run -A my_app.ts").run();
let output = context.new_command().args("run -A -q my_app.ts").run();
output.assert_matches_text("true 5\n");
assert!(temp_dir.path().join("node_modules").exists());
assert!(temp_dir.path().join("deno.lock").exists());

View file

@ -796,11 +796,11 @@ async fn run_watch_load_unload_events() {
file_to_watch.write(
r#"
setInterval(() => {}, 0);
window.addEventListener("load", () => {
globalThis.addEventListener("load", () => {
console.log("load");
});
window.addEventListener("unload", () => {
globalThis.addEventListener("unload", () => {
console.log("unload");
});
"#,
@ -827,11 +827,11 @@ async fn run_watch_load_unload_events() {
// Change content of the file, this time without an interval to keep it alive.
file_to_watch.write(
r#"
window.addEventListener("load", () => {
globalThis.addEventListener("load", () => {
console.log("load");
});
window.addEventListener("unload", () => {
globalThis.addEventListener("unload", () => {
console.log("unload");
});
"#,

View file

@ -17,9 +17,6 @@
"exitCode": 1
},
{
"envs": {
"DENO_FUTURE": "1"
},
"args": "install ajv@latest",
"output": "error: jsr:ajv was not found, but a matching npm package exists. Did you mean `deno install npm:ajv@latest`?\n",
"exitCode": 1

View file

@ -1,5 +1,13 @@
{
"tempDir": true,
"args": "bench",
"output": "lib.bench.out"
"steps": [
{
"args": "install",
"output": "install.out"
},
{
"args": "bench",
"output": "lib.bench.out"
}
]
}

View file

@ -0,0 +1,3 @@
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
Initialize @denotest/esm-basic@1.0.0

View file

@ -1,6 +1,3 @@
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
Initialize @denotest/esm-basic@1.0.0
Check file:///[WILDCARD]/lib.bench.ts
CPU | [WILDCARD]
Runtime | [WILDCARD]

View file

@ -1,5 +1,7 @@
{
"tempDir": true,
// TODO(2.0): decide if this test should be fixed or removed
"ignore": true,
"args": "cache main.ts",
"output": "main.cache.out"
}

View file

@ -9,6 +9,7 @@
"echo_test",
"--root",
"$PWD",
"-g",
"https://localhost:5545/echo.ts"
],
"output": "[WILDCARD]"

View file

@ -1,8 +1,5 @@
{
"tempDir": true,
"envs": {
"DENO_FUTURE": "1"
},
"steps": [{
"args": "install",
"output": "[WILDCARD]"

View file

@ -1,3 +1,3 @@
{
"nodeModulesDir": true
"nodeModulesDir": "auto"
}

View file

@ -1,7 +1,4 @@
{
"envs": {
"DENO_FUTURE": "1"
},
"tempDir": true,
"steps": [{
"args": "install",

View file

@ -1,25 +1,5 @@
{
"steps": [
{
"args": "run main.js",
"output": "error.out",
"exitCode": 1,
"envs": {
"DENO_FUTURE": "1"
}
},
// Running the same multiple times, should warn each time.
{
"args": "run main.js",
"output": "error.out",
"exitCode": 1,
"envs": {
"DENO_FUTURE": "1"
}
},
{
"args": "run main.js",
"output": "success.out"
}
]
"args": "run main.js",
"output": "error.out",
"exitCode": 1
}

View file

@ -1,7 +0,0 @@
⚠️ Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.
import foo from "./main.json" assert { type: "json" };
at [WILDCARD]import_assertions/main.js:1:30
{ foo: "foo" }

View file

@ -2,17 +2,11 @@
"steps": [
{
"args": "run -A --unstable-fs --config ../../../config/deno.json main.js",
"output": "main.out",
"envs": {
"DENO_FUTURE": "1"
}
"output": "main.out"
},
{
"args": "run -A --unstable-fs --config ../../../config/deno.json worker.js",
"output": "main.out",
"envs": {
"DENO_FUTURE": "1"
}
"output": "main.out"
}
]
}

View file

@ -17,15 +17,12 @@ console.log("Deno.funlock is", Deno.funlock);
console.log("Deno.funlockSync is", Deno.funlockSync);
console.log("Deno.iter is", Deno.iter);
console.log("Deno.iterSync is", Deno.iterSync);
console.log("Deno.metrics is", Deno.metrics);
console.log("Deno.readAll is", Deno.readAll);
console.log("Deno.readAllSync is", Deno.readAllSync);
console.log("Deno.read is", Deno.read);
console.log("Deno.readSync is", Deno.readSync);
console.log("Deno.resources is", Deno.resources);
console.log("Deno.seek is", Deno.seek);
console.log("Deno.seekSync is", Deno.seekSync);
console.log("Deno.shutdown is", Deno.shutdown);
console.log("Deno.writeAll is", Deno.writeAll);
console.log("Deno.writeAllSync is", Deno.writeAllSync);
console.log("Deno.write is", Deno.write);

View file

@ -14,15 +14,12 @@ Deno.funlock is undefined
Deno.funlockSync is undefined
Deno.iter is undefined
Deno.iterSync is undefined
Deno.metrics is undefined
Deno.readAll is undefined
Deno.readAllSync is undefined
Deno.read is undefined
Deno.readSync is undefined
Deno.resources is undefined
Deno.seek is undefined
Deno.seekSync is undefined
Deno.shutdown is undefined
Deno.writeAll is undefined
Deno.writeAllSync is undefined
Deno.write is undefined

View file

@ -3,18 +3,12 @@
{
// Notice `--unstable-*` flags are not needed anymore
"args": "run -A --config ../../../config/deno.json main.js",
"output": "main.out",
"envs": {
"DENO_FUTURE": "1"
}
"output": "main.out"
},
{
// Notice `--unstable-*` flags are not needed anymore
"args": "run -A --config ../../../config/deno.json worker.js",
"output": "main.out",
"envs": {
"DENO_FUTURE": "1"
}
"output": "main.out"
}
]
}

View file

@ -2,9 +2,6 @@
"tempDir": true,
"steps": [
{
"envs": {
"DENO_FUTURE": "1"
},
"args": "install npm:ajv@latest",
"output": "install.out"
}

View file

@ -1,8 +1,5 @@
{
"tempDir": true,
"envs": {
"DENO_FUTURE": "1"
},
"steps": [
{
"args": "install --global --root ./bins --name deno-test-bin ./pkg/main.js",

View file

@ -1,8 +1,5 @@
{
"tempDir": true,
"envs": {
"DENO_FUTURE": "1"
},
"steps": [
{
"args": "install npm:@denotest/esm-basic",

View file

@ -1,8 +1,5 @@
{
"tempDir": true,
"envs": {
"DENO_FUTURE": "1"
},
"steps": [
{
"args": "install npm:@denotest/esm-basic",

View file

@ -1,8 +1,5 @@
{
"tempDir": true,
"envs": {
"DENO_FUTURE": "1"
},
"steps": [
{
"args": "install",

Some files were not shown because too many files have changed in this diff Show more