1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-09 07:39:15 -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" "third_party"
], ],
"plugins": [ "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/json-0.19.3.wasm",
"https://plugins.dprint.dev/markdown-0.17.8.wasm", "https://plugins.dprint.dev/markdown-0.17.8.wasm",
"https://plugins.dprint.dev/toml-0.6.2.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. // Bump this number when you want to purge the cache.
// Note: the tools/release/01_bump_crate_versions.ts script will update this version // 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. // automatically via regex, so ensure that this line maintains this format.
const cacheVersion = 13; const cacheVersion = 14;
const ubuntuX86Runner = "ubuntu-22.04"; const ubuntuX86Runner = "ubuntu-22.04";
const ubuntuX86XlRunner = "ubuntu-22.04-xl"; const ubuntuX86XlRunner = "ubuntu-22.04-xl";

View file

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

View file

@ -44,48 +44,48 @@ license = "MIT"
repository = "https://github.com/denoland/deno" repository = "https://github.com/denoland/deno"
[workspace.dependencies] [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_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_lockfile = "=0.23.0"
deno_media_type = { version = "0.1.4", features = ["module_specifier"] } deno_media_type = { version = "0.1.4", features = ["module_specifier"] }
deno_permissions = { version = "0.26.0", path = "./runtime/permissions" } deno_permissions = { version = "0.27.0", path = "./runtime/permissions" }
deno_runtime = { version = "0.175.0", path = "./runtime" } deno_runtime = { version = "0.176.0", path = "./runtime" }
deno_semver = "=0.5.13" deno_semver = "=0.5.13"
deno_terminal = "0.2.0" 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" } test_util = { package = "test_server", path = "./tests/util/server" }
denokv_proto = "0.8.1" denokv_proto = "0.8.1"
denokv_remote = "0.8.1" denokv_remote = "0.8.1"
# denokv_sqlite brings in bundled sqlite if we don't disable the default features # 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 # exts
deno_broadcast_channel = { version = "0.160.0", path = "./ext/broadcast_channel" } deno_broadcast_channel = { version = "0.161.0", path = "./ext/broadcast_channel" }
deno_cache = { version = "0.98.0", path = "./ext/cache" } deno_cache = { version = "0.99.0", path = "./ext/cache" }
deno_canvas = { version = "0.35.0", path = "./ext/canvas" } deno_canvas = { version = "0.36.0", path = "./ext/canvas" }
deno_console = { version = "0.166.0", path = "./ext/console" } deno_console = { version = "0.167.0", path = "./ext/console" }
deno_cron = { version = "0.46.0", path = "./ext/cron" } deno_cron = { version = "0.47.0", path = "./ext/cron" }
deno_crypto = { version = "0.180.0", path = "./ext/crypto" } deno_crypto = { version = "0.181.0", path = "./ext/crypto" }
deno_fetch = { version = "0.190.0", path = "./ext/fetch" } deno_fetch = { version = "0.191.0", path = "./ext/fetch" }
deno_ffi = { version = "0.153.0", path = "./ext/ffi" } deno_ffi = { version = "0.154.0", path = "./ext/ffi" }
deno_fs = { version = "0.76.0", path = "./ext/fs" } deno_fs = { version = "0.77.0", path = "./ext/fs" }
deno_http = { version = "0.164.0", path = "./ext/http" } deno_http = { version = "0.165.0", path = "./ext/http" }
deno_io = { version = "0.76.0", path = "./ext/io" } deno_io = { version = "0.77.0", path = "./ext/io" }
deno_kv = { version = "0.74.0", path = "./ext/kv" } deno_kv = { version = "0.75.0", path = "./ext/kv" }
deno_napi = { version = "0.97.0", path = "./ext/napi" } deno_napi = { version = "0.98.0", path = "./ext/napi" }
deno_net = { version = "0.158.0", path = "./ext/net" } deno_net = { version = "0.159.0", path = "./ext/net" }
deno_node = { version = "0.103.0", path = "./ext/node" } deno_node = { version = "0.104.0", path = "./ext/node" }
deno_tls = { version = "0.153.0", path = "./ext/tls" } deno_tls = { version = "0.154.0", path = "./ext/tls" }
deno_url = { version = "0.166.0", path = "./ext/url" } deno_url = { version = "0.167.0", path = "./ext/url" }
deno_web = { version = "0.197.0", path = "./ext/web" } deno_web = { version = "0.198.0", path = "./ext/web" }
deno_webgpu = { version = "0.133.0", path = "./ext/webgpu" } deno_webgpu = { version = "0.134.0", path = "./ext/webgpu" }
deno_webidl = { version = "0.166.0", path = "./ext/webidl" } deno_webidl = { version = "0.167.0", path = "./ext/webidl" }
deno_websocket = { version = "0.171.0", path = "./ext/websocket" } deno_websocket = { version = "0.172.0", path = "./ext/websocket" }
deno_webstorage = { version = "0.161.0", path = "./ext/webstorage" } deno_webstorage = { version = "0.162.0", path = "./ext/webstorage" }
node_resolver = { version = "0.5.0", path = "./ext/node_resolver" } node_resolver = { version = "0.6.0", path = "./ext/node_resolver" }
aes = "=0.8.3" aes = "=0.8.3"
anyhow = "1.0.57" anyhow = "1.0.57"
@ -155,7 +155,7 @@ rand = "=0.8.5"
regex = "^1.7.0" 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 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" 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 = { version = "0.23.11", default-features = false, features = ["logging", "std", "tls12", "ring"] }
rustls-pemfile = "2" rustls-pemfile = "2"
rustls-tokio-stream = "=0.3.0" 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: We also have one-line install commands at:
https://github.com/denoland/deno_install 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 ### 1.46.1 / 2024.08.22
- fix(ext/node): http2session ready state (#25143) - fix(ext/node): http2session ready state (#25143)

View file

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

View file

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

View file

@ -10,6 +10,7 @@ use clap::ColorChoice;
use clap::Command; use clap::Command;
use clap::ValueHint; use clap::ValueHint;
use color_print::cstr; use color_print::cstr;
use deno_config::deno_json::NodeModulesDirMode;
use deno_config::glob::FilePatterns; use deno_config::glob::FilePatterns;
use deno_config::glob::PathOrPatternSet; use deno_config::glob::PathOrPatternSet;
use deno_core::anyhow::bail; use deno_core::anyhow::bail;
@ -40,7 +41,6 @@ use crate::args::resolve_no_prompt;
use crate::util::fs::canonicalize_path; use crate::util::fs::canonicalize_path;
use super::flags_net; use super::flags_net;
use super::DENO_FUTURE;
#[derive(Clone, Debug, Default, Eq, PartialEq)] #[derive(Clone, Debug, Default, Eq, PartialEq)]
pub enum ConfigFlag { pub enum ConfigFlag {
@ -581,7 +581,6 @@ fn parse_packages_allowed_scripts(s: &str) -> Result<String, AnyError> {
pub struct UnstableConfig { pub struct UnstableConfig {
pub legacy_flag_enabled: bool, // --unstable pub legacy_flag_enabled: bool, // --unstable
pub bare_node_builtins: bool, // --unstable-bare-node-builts pub bare_node_builtins: bool, // --unstable-bare-node-builts
pub byonm: bool,
pub sloppy_imports: bool, pub sloppy_imports: bool,
pub features: Vec<String>, // --unstabe-kv --unstable-cron pub features: Vec<String>, // --unstabe-kv --unstable-cron
} }
@ -603,7 +602,7 @@ pub struct Flags {
pub cached_only: bool, pub cached_only: bool,
pub type_check_mode: TypeCheckMode, pub type_check_mode: TypeCheckMode,
pub config_flag: ConfigFlag, pub config_flag: ConfigFlag,
pub node_modules_dir: Option<bool>, pub node_modules_dir: Option<NodeModulesDirMode>,
pub vendor: Option<bool>, pub vendor: Option<bool>,
pub enable_op_summary_metrics: bool, pub enable_op_summary_metrics: bool,
pub enable_testing_features: 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 <g>DENO_AUTH_TOKENS</> A semi-colon separated list of bearer tokens and hostnames
to use when fetching remote modules from private repositories to use when fetching remote modules from private repositories
<p(245)>(e.g. "abcde12345@deno.land;54321edcba@github.com")</> <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_CERT</> Load certificate authorities from PEM encoded file
<g>DENO_DIR</> Set the cache directory <g>DENO_DIR</> Set the cache directory
<g>DENO_INSTALL_ROOT</> Set deno install's output 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</> <p(245)>deno test | deno test test.ts</>
<g>publish</> Publish the current working directory's package or workspace <g>publish</> Publish the current working directory's package or workspace
<g>upgrade</> Upgrade deno executable to given version <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} {after-help}
<y>Docs:</> https://docs.deno.com <y>Docs:</> https://docs.deno.com
@ -1508,11 +1506,7 @@ pub fn clap_root() -> Command {
.subcommand(fmt_subcommand()) .subcommand(fmt_subcommand())
.subcommand(init_subcommand()) .subcommand(init_subcommand())
.subcommand(info_subcommand()) .subcommand(info_subcommand())
.subcommand(if *DENO_FUTURE { .subcommand(future_install_subcommand())
future_install_subcommand()
} else {
install_subcommand()
})
.subcommand(json_reference_subcommand()) .subcommand(json_reference_subcommand())
.subcommand(jupyter_subcommand()) .subcommand(jupyter_subcommand())
.subcommand(uninstall_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 { fn install_args(cmd: Command) -> Command {
let cmd = if deno_future { let cmd = cmd.arg(
cmd.arg( Arg::new("cmd")
Arg::new("cmd") .required_if_eq("global", "true")
.required_if_eq("global", "true") .num_args(1..)
.num_args(1..) .value_hint(ValueHint::FilePath),
.value_hint(ValueHint::FilePath), );
)
} else {
cmd.arg(
Arg::new("cmd")
.required_unless_present("help")
.num_args(1..)
.value_hint(ValueHint::FilePath),
)
};
cmd cmd
.arg( .arg(
Arg::new("name") Arg::new("name")
@ -2466,40 +2451,7 @@ These must be added to the path manually if required.", UnstableArgsConfig::Reso
.visible_alias("i") .visible_alias("i")
.defer(|cmd| { .defer(|cmd| {
let cmd = runtime_args(cmd, true, true).arg(check_arg(true)).arg(allow_scripts_arg()); let cmd = runtime_args(cmd, true, true).arg(check_arg(true)).arg(allow_scripts_arg());
install_args(cmd, true) install_args(cmd)
})
}
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)
}) })
} }
@ -3918,15 +3870,35 @@ fn no_npm_arg() -> Arg {
.help_heading(DEPENDENCY_MANAGEMENT_HEADING) .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 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") Arg::new("node-modules-dir")
.long("node-modules-dir") .long("node-modules-dir")
.num_args(0..=1) .num_args(0..=1)
.value_parser(value_parser!(bool)) .value_parser(clap::builder::ValueParser::new(parse_node_modules_dir_mode))
.value_name("DIRECTORY") .value_name("MODE")
.default_missing_value("true")
.require_equals(true) .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) .help_heading(DEPENDENCY_MANAGEMENT_HEADING)
} }
@ -4006,7 +3978,6 @@ impl Iterator for UnstableArgsIter {
Arg::new("unstable-byonm") Arg::new("unstable-byonm")
.long("unstable-byonm") .long("unstable-byonm")
.help("Enable unstable 'bring your own node_modules' feature") .help("Enable unstable 'bring your own node_modules' feature")
.env("DENO_UNSTABLE_BYONM")
.value_parser(FalseyValueParser::new()) .value_parser(FalseyValueParser::new())
.action(ArgAction::SetTrue) .action(ArgAction::SetTrue)
.hide(true) .hide(true)
@ -4443,7 +4414,7 @@ fn install_parse(flags: &mut Flags, matches: &mut ArgMatches) {
runtime_args_parse(flags, matches, true, true); runtime_args_parse(flags, matches, true, true);
let global = matches.get_flag("global"); let global = matches.get_flag("global");
if global || !*DENO_FUTURE { if global {
let root = matches.remove_one::<String>("root"); let root = matches.remove_one::<String>("root");
let force = matches.get_flag("force"); let force = matches.get_flag("force");
let name = matches.remove_one::<String>("name"); let name = matches.remove_one::<String>("name");
@ -5318,7 +5289,7 @@ fn node_modules_and_vendor_dir_arg_parse(
flags: &mut Flags, flags: &mut Flags,
matches: &mut ArgMatches, 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"); flags.vendor = matches.remove_one::<bool>("vendor");
} }
@ -5390,7 +5361,6 @@ fn unstable_args_parse(
flags.unstable_config.bare_node_builtins = flags.unstable_config.bare_node_builtins =
matches.get_flag("unstable-bare-node-builtins"); matches.get_flag("unstable-bare-node-builtins");
flags.unstable_config.byonm = matches.get_flag("unstable-byonm");
flags.unstable_config.sloppy_imports = flags.unstable_config.sloppy_imports =
matches.get_flag("unstable-sloppy-imports"); matches.get_flag("unstable-sloppy-imports");
@ -8212,8 +8182,12 @@ mod tests {
#[test] #[test]
fn install() { fn install() {
let r = let r = flags_from_vec(svec![
flags_from_vec(svec!["deno", "install", "jsr:@std/http/file-server"]); "deno",
"install",
"-g",
"jsr:@std/http/file-server"
]);
assert_eq!( assert_eq!(
r.unwrap(), r.unwrap(),
Flags { Flags {
@ -8225,7 +8199,7 @@ mod tests {
root: None, root: None,
force: false, force: false,
}), }),
global: false, global: true,
}), }),
..Flags::default() ..Flags::default()
} }
@ -8258,7 +8232,7 @@ mod tests {
#[test] #[test]
fn install_with_flags() { fn install_with_flags() {
#[rustfmt::skip] #[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!( assert_eq!(
r.unwrap(), r.unwrap(),
Flags { Flags {
@ -8270,7 +8244,7 @@ mod tests {
root: Some("/foo".to_string()), root: Some("/foo".to_string()),
force: true, force: true,
}), }),
global: false, global: true,
}), }),
import_map_path: Some("import_map.json".to_string()), import_map_path: Some("import_map.json".to_string()),
no_remote: true, no_remote: true,
@ -8650,25 +8624,7 @@ mod tests {
watch: None, watch: None,
bare: true, bare: true,
}), }),
node_modules_dir: Some(true), node_modules_dir: None,
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),
code_cache_enabled: true, code_cache_enabled: true,
..Flags::default() ..Flags::default()
} }

View file

@ -239,12 +239,6 @@ impl CliLockfile {
} }
let lockfile = self.lockfile.lock(); let lockfile = self.lockfile.lock();
if lockfile.has_content_changed { 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 = let contents =
std::fs::read_to_string(&lockfile.filename).unwrap_or_default(); std::fs::read_to_string(&lockfile.filename).unwrap_or_default();
let new_contents = lockfile.as_json_string(); let new_contents = lockfile.as_json_string();
@ -252,7 +246,7 @@ impl CliLockfile {
// has an extra newline at the end // has an extra newline at the end
let diff = diff.trim_end(); let diff = diff.trim_end();
Err(deno_core::anyhow::anyhow!( 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 { } else {
Ok(()) Ok(())

View file

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

View file

@ -793,20 +793,12 @@ impl CliFactory {
self.maybe_inspector_server()?.clone(), self.maybe_inspector_server()?.clone(),
cli_options.maybe_lockfile().cloned(), cli_options.maybe_lockfile().cloned(),
self.feature_checker()?.clone(), 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() { if cli_options.code_cache_enabled() {
Some(self.code_cache()?.clone()) Some(self.code_cache()?.clone())
} else { } else {
None None
}, },
self.create_cli_main_worker_options()?,
)) ))
} }
@ -871,6 +863,13 @@ impl CliFactory {
unstable: cli_options.legacy_unstable_flag(), unstable: cli_options.legacy_unstable_flag(),
create_hmr_runner, create_hmr_runner,
create_coverage_collector, 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> { ) -> Result<(), AnyError> {
// ensure an "npm install" is done if the user has explicitly // ensure an "npm install" is done if the user has explicitly
// opted into using a node_modules directory // 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() { if let Some(npm_resolver) = self.npm_resolver.as_managed() {
npm_resolver.ensure_top_level_package_json_install().await?; 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::FmtConfig;
use deno_config::deno_json::FmtOptionsConfig; use deno_config::deno_json::FmtOptionsConfig;
use deno_config::deno_json::LintConfig; use deno_config::deno_json::LintConfig;
use deno_config::deno_json::NodeModulesDirMode;
use deno_config::deno_json::TestConfig; use deno_config::deno_json::TestConfig;
use deno_config::deno_json::TsConfig; use deno_config::deno_json::TsConfig;
use deno_config::fs::DenoConfigFs; use deno_config::fs::DenoConfigFs;
@ -54,7 +55,6 @@ use crate::args::CliLockfile;
use crate::args::ConfigFile; use crate::args::ConfigFile;
use crate::args::LintFlags; use crate::args::LintFlags;
use crate::args::LintOptions; use crate::args::LintOptions;
use crate::args::DENO_FUTURE;
use crate::cache::FastInsecureHasher; use crate::cache::FastInsecureHasher;
use crate::file_fetcher::FileFetcher; use crate::file_fetcher::FileFetcher;
use crate::lsp::logging::lsp_warn; use crate::lsp::logging::lsp_warn;
@ -1387,11 +1387,14 @@ impl ConfigData {
} }
} }
let byonm = std::env::var("DENO_UNSTABLE_BYONM").is_ok() let node_modules_dir = member_dir
|| member_dir.workspace.has_unstable("byonm") .workspace
|| (*DENO_FUTURE .node_modules_dir_mode()
&& member_dir.workspace.package_jsons().next().is_some() .unwrap_or_default();
&& member_dir.workspace.node_modules_dir().is_none()); let byonm = match node_modules_dir {
Some(mode) => mode == NodeModulesDirMode::Manual,
None => member_dir.workspace.package_jsons().next().is_some(),
};
if byonm { if byonm {
lsp_log!(" Enabled 'bring your own node_modules'."); 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 // `nodeModulesDir: true` setting in the deno.json file. This is to
// reduce the chance of modifying someone's node_modules directory // reduce the chance of modifying someone's node_modules directory
// without them having asked us to do so. // 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 { if explicitly_disabled {
return None; return None;
} }
let enabled = byonm 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(); || workspace.vendor_dir_path().is_some();
if !enabled { if !enabled {
return None; return None;
} }

View file

@ -3611,11 +3611,6 @@ impl Inner {
.as_ref() .as_ref()
.map(|url| url.to_string()) .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 // bit of a hack to force the lsp to cache the @types/node package
type_check_mode: crate::args::TypeCheckMode::Local, type_check_mode: crate::args::TypeCheckMode::Local,
..Default::default() ..Default::default()

View file

@ -32,7 +32,6 @@ mod worker;
use crate::args::flags_from_vec; use crate::args::flags_from_vec;
use crate::args::DenoSubcommand; use crate::args::DenoSubcommand;
use crate::args::Flags; use crate::args::Flags;
use crate::args::DENO_FUTURE;
use crate::graph_container::ModuleGraphContainer; use crate::graph_container::ModuleGraphContainer;
use crate::util::display; use crate::util::display;
use crate::util::v8::get_v8_flags_from_env; 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 // 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()], 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`
// TODO(bartlomieju): I think this can be removed as it's handled by `deno_core` // and its settings.
// and its settings. // deno_ast removes TypeScript `assert` keywords, so this flag only affects JavaScript
// deno_ast removes TypeScript `assert` keywords, so this flag only affects JavaScript // TODO(petamoriken): Need to check TypeScript `assert` keywords in deno_ast
// TODO(petamoriken): Need to check TypeScript `assert` keywords in deno_ast vec!["--no-harmony-import-assertions".to_string()]
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(),
]
}
} }
}; };
init_v8_flags(&default_v8_flags, &flags.v8_flags, get_v8_flags_from_env()); init_v8_flags(&default_v8_flags, &flags.v8_flags, get_v8_flags_from_env());
// TODO(bartlomieju): remove last argument in Deno 2. // 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); util::logger::init(flags.log_level);
Ok(flags) Ok(flags)

View file

@ -2,7 +2,7 @@
[package] [package]
name = "napi_sym" name = "napi_sym"
version = "0.96.0" version = "0.97.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license.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() { 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 let packages = packages_with_scripts_not_run
.iter() .iter()
.map(|(_, p)| format!("npm:{p}")) .map(|(_, p)| format!("npm:{p}"))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", "); .join(", ");
log::warn!("{}: Packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed. 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} 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>`{maybe_install_example}):\n {packages}", crate::colors::yellow("warning")); (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 { for (scripts_warned_path, _) in packages_with_scripts_not_run {
let _ignore_err = fs::write(scripts_warned_path, ""); 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"); let package_json_path = package_folder.join("package.json");
if !self.fs.exists_sync(&package_json_path) { if !self.fs.exists_sync(&package_json_path) {
return Err(anyhow!( 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(), 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 { unstable_config: UnstableConfig {
legacy_flag_enabled: cli_options.legacy_unstable_flag(), legacy_flag_enabled: cli_options.legacy_unstable_flag(),
bare_node_builtins: cli_options.unstable_bare_node_builtins(), bare_node_builtins: cli_options.unstable_bare_node_builtins(),
byonm: cli_options.use_byonm(),
sloppy_imports: cli_options.unstable_sloppy_imports(), sloppy_imports: cli_options.unstable_sloppy_imports(),
features: cli_options.unstable_features(), features: cli_options.unstable_features(),
}, },

View file

@ -706,6 +706,8 @@ pub async fn run(
None, None,
None, None,
feature_checker, feature_checker,
// Code cache is not supported for standalone binary yet.
None,
CliMainWorkerOptions { CliMainWorkerOptions {
argv: metadata.argv, argv: metadata.argv,
log_level: WorkerLogLevel::Info, log_level: WorkerLogLevel::Info,
@ -732,17 +734,13 @@ pub async fn run(
unstable: metadata.unstable_config.legacy_flag_enabled, unstable: metadata.unstable_config.legacy_flag_enabled,
create_hmr_runner: None, create_hmr_runner: None,
create_coverage_collector: 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. // 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 // now walk the graph that only includes the fast check dependencies
while let Some(specifier) = pending.pop_front() { while let Some(specifier) = pending.pop_front() {
let Some(module) = graph.get(&specifier) else { let Some(module) = graph.get(specifier) else {
continue; continue;
}; };
if let Some(entry) = maybe_get_check_entry(module, check_js) { 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]); 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)) => { Ok(Some(root)) => {
let maybe_cache_info = match root { let maybe_cache_info = match root {
Module::Js(module) => module.maybe_cache_info.as_ref(), Module::Js(module) => module.maybe_cache_info.as_ref(),
@ -694,9 +694,9 @@ impl<'a> GraphDisplayContext<'a> {
Resolution::Ok(resolved) => { Resolution::Ok(resolved) => {
let specifier = &resolved.specifier; let specifier = &resolved.specifier;
let resolved_specifier = self.graph.resolve(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), 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!( Ok(None) => TreeNode::from_text(format!(
"{} {}", "{} {}",
colors::red(specifier), colors::red(specifier),

View file

@ -1049,7 +1049,8 @@ async fn publish_package(
sha256: faster_hex::hex_string(&sha2::Sha256::digest(&meta_bytes)), 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]; let tlog_entry = &bundle.verification_material.tlog_entries[0];
log::info!("{}", log::info!("{}",

View file

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

View file

@ -229,16 +229,16 @@ impl Predicate {
struct ProvenanceAttestation { struct ProvenanceAttestation {
#[serde(rename = "type")] #[serde(rename = "type")]
_type: &'static str, _type: &'static str,
subject: Subject, subject: Vec<Subject>,
predicate_type: &'static str, predicate_type: &'static str,
predicate: Predicate, predicate: Predicate,
} }
impl ProvenanceAttestation { impl ProvenanceAttestation {
pub fn new_github_actions(subject: Subject) -> Self { pub fn new_github_actions(subjects: Vec<Subject>) -> Self {
Self { Self {
_type: INTOTO_STATEMENT_TYPE, _type: INTOTO_STATEMENT_TYPE,
subject, subject: subjects,
predicate_type: SLSA_PREDICATE_TYPE, predicate_type: SLSA_PREDICATE_TYPE,
predicate: Predicate::new_github_actions(), predicate: Predicate::new_github_actions(),
} }
@ -296,7 +296,7 @@ pub struct ProvenanceBundle {
pub async fn generate_provenance( pub async fn generate_provenance(
http_client: &HttpClient, http_client: &HttpClient,
subject: Subject, subjects: Vec<Subject>,
) -> Result<ProvenanceBundle, AnyError> { ) -> Result<ProvenanceBundle, AnyError> {
if !is_gha() { if !is_gha() {
bail!("Automatic provenance is only available in GitHub Actions"); 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 attestation = serde_json::to_string(&slsa)?;
let bundle = attest(http_client, &attestation, INTOTO_PAYLOAD_TYPE).await?; let bundle = attest(http_client, &attestation, INTOTO_PAYLOAD_TYPE).await?;
@ -738,8 +738,13 @@ mod tests {
sha256: "yourmom".to_string(), sha256: "yourmom".to_string(),
}, },
}; };
let slsa = ProvenanceAttestation::new_github_actions(subject); let slsa = ProvenanceAttestation::new_github_actions(vec![subject]);
assert_eq!(slsa.subject.name, "jsr:@divy/sdl2@0.0.1"); assert_eq!(
assert_eq!(slsa.subject.digest.sha256, "yourmom"); 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::io::Read;
use std::sync::Arc; use std::sync::Arc;
use deno_config::deno_json::NodeModulesDirMode;
use deno_core::error::AnyError; use deno_core::error::AnyError;
use deno_runtime::deno_permissions::Permissions; use deno_runtime::deno_permissions::Permissions;
use deno_runtime::deno_permissions::PermissionsContainer; 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> { pub async fn maybe_npm_install(factory: &CliFactory) -> Result<(), AnyError> {
// ensure an "npm install" is done if the user has explicitly // ensure an "npm install" is done if the user has explicitly
// opted into using a managed node_modules directory // 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() { if let Some(npm_resolver) = factory.npm_resolver().await?.as_managed() {
npm_resolver.ensure_top_level_package_json_install().await?; 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_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_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_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_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_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"], "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 crate::version;
use async_trait::async_trait; use async_trait::async_trait;
use color_print::cstr;
use deno_core::anyhow::bail; use deno_core::anyhow::bail;
use deno_core::anyhow::Context; use deno_core::anyhow::Context;
use deno_core::error::AnyError; 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 CANARY_URL: &str = "https://dl.deno.land/canary";
const RC_URL: &str = "https://dl.deno.land/release"; 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> = pub static ARCHIVE_NAME: Lazy<String> =
Lazy::new(|| format!("deno-{}.zip", env!("TARGET"))); Lazy::new(|| format!("deno-{}.zip", env!("TARGET")));
@ -226,15 +229,70 @@ impl<
} }
} }
fn get_minor_version(version: &str) -> &str { fn get_minor_version_blog_post_url(semver: &Version) -> String {
version.rsplitn(2, '.').collect::<Vec<&str>>()[1] format!("https://deno.com/blog/v{}.{}", semver.major, semver.minor)
} }
fn print_release_notes(current_version: &str, new_version: &str) { fn get_rc_version_blog_post_url(semver: &Version) -> String {
// TODO(bartlomieju): we might want to reconsider this one for RC releases. format!(
// TODO(bartlomieju): also maybe just parse using `Version::standard` instead "https://deno.com/blog/v{}.{}-rc-{}",
// of using `get_minor_version`? semver.major, semver.minor, semver.pre[1]
if get_minor_version(current_version) == get_minor_version(new_version) { )
}
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; return;
} }
@ -249,10 +307,7 @@ fn print_release_notes(current_version: &str, new_version: &str) {
log::info!( log::info!(
"{}\n\n {}\n", "{}\n\n {}\n",
colors::gray("Blog post:"), colors::gray("Blog post:"),
colors::bold(format!( colors::bold(get_minor_version_blog_post_url(&new_semver))
"https://deno.com/blog/v{}",
get_minor_version(new_version)
))
); );
} }
@ -320,14 +375,14 @@ pub fn check_for_upgrades(
log::info!( log::info!(
"{} {}", "{} {}",
colors::green("A new canary release of Deno is available."), 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 => { ReleaseChannel::Rc => {
log::info!( log::info!(
"{} {}", "{} {}",
colors::green("A new release candidate of Deno is available."), 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) // TODO(bartlomieju)
@ -512,7 +567,9 @@ pub async fn upgrade(
print_release_notes( print_release_notes(
version::DENO_VERSION_INFO.deno, version::DENO_VERSION_INFO.deno,
&selected_version_to_upgrade.version_or_hash, &selected_version_to_upgrade.version_or_hash,
); &client,
)
.await;
} }
drop(temp_dir); drop(temp_dir);
return Ok(()); return Ok(());
@ -540,7 +597,9 @@ pub async fn upgrade(
print_release_notes( print_release_notes(
version::DENO_VERSION_INFO.deno, version::DENO_VERSION_INFO.deno,
&selected_version_to_upgrade.version_or_hash, &selected_version_to_upgrade.version_or_hash,
); &client,
)
.await;
} }
drop(temp_dir); // delete the temp dir drop(temp_dir); // delete the temp dir
@ -591,12 +650,20 @@ impl RequestedVersion {
let (channel, passed_version) = if is_canary { let (channel, passed_version) = if is_canary {
if !re_hash.is_match(&passed_version) { 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) (ReleaseChannel::Canary, passed_version)
} else { } else {
let Ok(semver) = Version::parse_standard(&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()) { 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 graph = output.graph;
let npm_package_count = graph.npm_packages.len(); let npm_package_count = graph.npm_packages.len();
let try_add_node_modules_dir = npm_package_count > 0 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!( log::info!(
concat!("Vendored {} {} into {} directory.",), concat!("Vendored {} {} into {} directory.",),
@ -341,7 +344,7 @@ fn update_config_text(
let insert_position = obj.range.end - 1; let insert_position = obj.range.end - 1;
text_changes.push(TextChange { text_changes.push(TextChange {
range: insert_position..insert_position, range: insert_position..insert_position,
new_text: r#""nodeModulesDir": true"#.to_string(), new_text: r#""nodeModulesDir": "auto""#.to_string(),
}); });
should_format = true; should_format = true;
modified_result.added_node_modules_dir = true; modified_result.added_node_modules_dir = true;
@ -451,7 +454,7 @@ mod internal_test {
assert_eq!( assert_eq!(
result.new_text.unwrap(), result.new_text.unwrap(),
r#"{ r#"{
"nodeModulesDir": true, "nodeModulesDir": "auto",
"importMap": "./vendor/import_map.json" "importMap": "./vendor/import_map.json"
} }
"# "#
@ -464,7 +467,7 @@ mod internal_test {
assert_eq!( assert_eq!(
result.new_text.unwrap(), result.new_text.unwrap(),
r#"{ r#"{
"nodeModulesDir": true "nodeModulesDir": "auto"
} }
"# "#
); );
@ -543,10 +546,10 @@ mod internal_test {
#[test] #[test]
fn no_update_node_modules_dir() { 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( let result = update_config_text(
r#"{ r#"{
"nodeModulesDir": false "nodeModulesDir": "none"
} }
"#, "#,
&Default::default(), &Default::default(),
@ -560,7 +563,7 @@ mod internal_test {
let result = update_config_text( let result = update_config_text(
r#"{ r#"{
"nodeModulesDir": true "nodeModulesDir": "auto"
} }
"#, "#,
&Default::default(), &Default::default(),

View file

@ -4060,73 +4060,6 @@ declare namespace Deno {
bytesReceived: number; 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. * Additional information for FsEvent objects with the "other" kind.
* *
@ -5506,50 +5439,6 @@ declare namespace Deno {
*/ */
export function ftruncateSync(rid: number, len?: number): void; 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. * Returns a `Deno.FileInfo` for the given file stream.
* *

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
[package] [package]
name = "deno_ffi" name = "deno_ffi"
version = "0.153.0" version = "0.154.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license.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( function utimeSync(
path, path,
atime, atime,
@ -766,11 +740,21 @@ class FsFile {
} }
async utime(atime, mtime) { 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) { 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() { isTerminal() {
@ -1004,8 +988,6 @@ export {
ftruncateSync, ftruncateSync,
funlock, funlock,
funlockSync, funlockSync,
futime,
futimeSync,
link, link,
linkSync, linkSync,
lstat, lstat,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -528,22 +528,4 @@ declare namespace Deno {
conn: TcpConn, conn: TcpConn,
options?: StartTlsOptions, options?: StartTlsOptions,
): Promise<TlsConn>; ): 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] [package]
name = "deno_node" name = "deno_node"
version = "0.103.0" version = "0.104.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license.workspace = true license.workspace = true

View file

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

View file

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

View file

@ -2295,10 +2295,10 @@ export class ERR_HTTP2_INVALID_SETTING_VALUE extends NodeRangeError {
} }
export class ERR_HTTP2_STREAM_CANCEL extends NodeError { export class ERR_HTTP2_STREAM_CANCEL extends NodeError {
override cause?: Error; override cause?: Error;
constructor(error: Error) { constructor(error?: Error) {
super( super(
"ERR_HTTP2_STREAM_CANCEL", "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 (caused by: ${error.message})`
: "The pending stream has been canceled", : "The pending stream has been canceled",
); );

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
[package] [package]
name = "deno_runtime" name = "deno_runtime"
version = "0.175.0" version = "0.176.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license.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"; import * as webgpuSurface from "ext:deno_webgpu/02_surface.js";
const denoNs = { const denoNs = {
metrics: () => {
internals.warnOnDeprecatedApi("Deno.metrics()", new Error().stack);
return core.metrics();
},
Process: process.Process, Process: process.Process,
run: process.run, run: process.run,
isatty: tty.isatty, isatty: tty.isatty,
@ -97,22 +93,6 @@ const denoNs = {
); );
return fs.ftruncate(rid, len); 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, errors: errors.errors,
inspect: console.inspect, inspect: console.inspect,
env: os.env, env: os.env,
@ -190,14 +170,6 @@ const denoNs = {
connectTls: tls.connectTls, connectTls: tls.connectTls,
listenTls: tls.listenTls, listenTls: tls.listenTls,
startTls: tls.startTls, startTls: tls.startTls,
shutdown(rid) {
internals.warnOnDeprecatedApi(
"Deno.shutdown()",
new Error().stack,
"Use `Deno.Conn.closeWrite()` instead.",
);
net.shutdown(rid);
},
fstatSync(rid) { fstatSync(rid) {
internals.warnOnDeprecatedApi( internals.warnOnDeprecatedApi(
"Deno.fstatSync()", "Deno.fstatSync()",

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -140,7 +140,7 @@ itest!(mixed_case_package_name_global_dir {
itest!(mixed_case_package_name_local_dir { itest!(mixed_case_package_name_local_dir {
args: 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", output: "npm/mixed_case_package_name/local.out",
exit_code: 0, exit_code: 0,
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
@ -148,15 +148,16 @@ itest!(mixed_case_package_name_local_dir {
temp_cwd: true, temp_cwd: true,
}); });
itest!(local_dir_resolves_symlinks { // TODO(2.0): this should be rewritten to a spec test and first run `deno install`
args: "run -A index.js", // itest!(local_dir_resolves_symlinks {
output: "npm/local_dir_resolves_symlinks/index.out", // args: "run -A index.js",
exit_code: 0, // output: "npm/local_dir_resolves_symlinks/index.out",
envs: env_vars_for_npm_tests(), // exit_code: 0,
cwd: Some("npm/local_dir_resolves_symlinks/"), // envs: env_vars_for_npm_tests(),
copy_temp_dir: Some("npm/local_dir_resolves_symlinks/"), // cwd: Some("npm/local_dir_resolves_symlinks/"),
http_server: true, // copy_temp_dir: Some("npm/local_dir_resolves_symlinks/"),
}); // http_server: true,
// });
// FIXME(bartlomieju): npm: specifiers are not handled in dynamic imports // FIXME(bartlomieju): npm: specifiers are not handled in dynamic imports
// at the moment // at the moment
@ -373,7 +374,7 @@ itest!(permissions_outside_package {
}); });
itest!(run_existing_npm_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", output: "npm/run_existing_npm_package/main.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
@ -384,7 +385,7 @@ itest!(run_existing_npm_package {
itest!(run_existing_npm_package_with_subpath { itest!(run_existing_npm_package_with_subpath {
args: 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", output: "npm/run_existing_npm_package_with_subpath/main.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
@ -812,7 +813,7 @@ itest!(builtin_module_module {
itest!(node_modules_dir_require_added_node_modules_folder { itest!(node_modules_dir_require_added_node_modules_folder {
args: 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", output: "npm/require_added_nm_folder/main.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
@ -830,7 +831,7 @@ itest!(node_modules_dir_require_main_entry {
}); });
itest!(node_modules_dir_with_deps { 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", output: "npm/cjs_with_deps/main_node_modules.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
@ -838,7 +839,7 @@ itest!(node_modules_dir_with_deps {
}); });
itest!(node_modules_dir_yargs { 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", output: "npm/cjs_yargs/main.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
@ -854,7 +855,7 @@ fn node_modules_dir_cache() {
let deno = util::deno_cmd_with_deno_dir(&deno_dir) let deno = util::deno_cmd_with_deno_dir(&deno_dir)
.current_dir(deno_dir.path()) .current_dir(deno_dir.path())
.arg("cache") .arg("cache")
.arg("--node-modules-dir") .arg("--node-modules-dir=auto")
.arg("--quiet") .arg("--quiet")
.arg(util::testdata_path().join("npm/dual_cjs_esm/main.ts")) .arg(util::testdata_path().join("npm/dual_cjs_esm/main.ts"))
.envs(env_vars_for_npm_tests()) .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) let deno = util::deno_cmd_with_deno_dir(&deno_dir)
.current_dir(deno_dir.path()) .current_dir(deno_dir.path())
.arg("run") .arg("run")
.arg("--node-modules-dir") .arg("--node-modules-dir=auto")
.arg("--quiet") .arg("--quiet")
.arg("-A") .arg("-A")
.arg(util::testdata_path().join("npm/dual_cjs_esm/main.ts")) .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 // now run with local node modules
let output = context let output = context
.new_command() .new_command()
.args("run -A --node-modules-dir main.ts") .args("run -A --node-modules-dir=auto main.ts")
.run(); .run();
output.assert_exit_code(0); output.assert_exit_code(0);
output.assert_matches_file( output.assert_matches_file(
@ -1513,7 +1514,7 @@ fn peer_deps_with_copied_folders_and_lockfile() {
// now again run with local node modules // now again run with local node modules
let output = context let output = context
.new_command() .new_command()
.args("run -A --node-modules-dir main.ts") .args("run -A --node-modules-dir=auto main.ts")
.run(); .run();
output.assert_exit_code(0); output.assert_exit_code(0);
output.assert_matches_text("1\n2\n"); 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 // now ensure it works with reloading
let output = context let output = context
.new_command() .new_command()
.args("run -A --reload --node-modules-dir main.ts") .args("run -A --reload --node-modules-dir=auto main.ts")
.run(); .run();
output.assert_exit_code(0); output.assert_exit_code(0);
output.assert_matches_file( 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 // now ensure it works with reloading and no lockfile
let output = context let output = context
.new_command() .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(); .run();
output.assert_exit_code(0); output.assert_exit_code(0);
output.assert_matches_file( output.assert_matches_file(
@ -1563,25 +1564,27 @@ itest!(create_require {
http_server: true, http_server: true,
}); });
itest!(node_modules_import_run { // TODO(2.0): this should be rewritten to a spec test and first run `deno install`
args: "run --quiet main.ts", // itest!(node_modules_import_run {
output: "npm/node_modules_import/main.out", // args: "run --quiet main.ts",
http_server: true, // output: "npm/node_modules_import/main.out",
copy_temp_dir: Some("npm/node_modules_import/"), // http_server: true,
cwd: Some("npm/node_modules_import/"), // copy_temp_dir: Some("npm/node_modules_import/"),
envs: env_vars_for_npm_tests(), // cwd: Some("npm/node_modules_import/"),
exit_code: 0, // envs: env_vars_for_npm_tests(),
}); // exit_code: 0,
// });
itest!(node_modules_import_check { // TODO(2.0): this should be rewritten to a spec test and first run `deno install`
args: "check --quiet main.ts", // itest!(node_modules_import_check {
output: "npm/node_modules_import/main_check.out", // args: "check --quiet main.ts",
envs: env_vars_for_npm_tests(), // output: "npm/node_modules_import/main_check.out",
http_server: true, // envs: env_vars_for_npm_tests(),
cwd: Some("npm/node_modules_import/"), // http_server: true,
copy_temp_dir: Some("npm/node_modules_import/"), // cwd: Some("npm/node_modules_import/"),
exit_code: 1, // copy_temp_dir: Some("npm/node_modules_import/"),
}); // exit_code: 1,
// });
itest!(non_existent_dep { itest!(non_existent_dep {
args: "cache npm:@denotest/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] #[test]
#[ignore]
fn reload_info_not_found_cache_but_exists_remote() { fn reload_info_not_found_cache_but_exists_remote() {
fn remove_version(registry_json: &mut Value, version: &str) { fn remove_version(registry_json: &mut Value, version: &str) {
registry_json registry_json
@ -1875,7 +1880,7 @@ fn binary_package_with_optional_dependencies() {
let output = context let output = context
.new_command() .new_command()
.args("run -A --node-modules-dir main.js") .args("run -A --node-modules-dir=auto main.js")
.run(); .run();
#[cfg(target_os = "windows")] #[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 node_modules_dir = temp_dir.path().join("node_modules");
let rm_node_modules = || std::fs::remove_dir_all(&node_modules_dir).unwrap(); 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';"); temp_dir.write("main.ts", "import 'npm:@denotest/esm-basic';");
let deno_cache_cmd = test_context.new_command().args("cache --quiet main.ts"); 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()); assert!(node_modules_dir.exists());
rm_node_modules(); rm_node_modules();
temp_dir.write("deno.json", r#"{ "nodeModulesDir": false }"#); temp_dir.write("deno.json", r#"{ "nodeModulesDir": "none" }"#);
deno_cache_cmd.run(); deno_cache_cmd.run();
assert!(!node_modules_dir.exists()); assert!(!node_modules_dir.exists());
@ -1991,7 +1996,7 @@ fn node_modules_dir_config_file() {
test_context test_context
.new_command() .new_command()
.args("cache --quiet --node-modules-dir main.ts") .args("cache --quiet --node-modules-dir=auto main.ts")
.run(); .run();
assert!(node_modules_dir.exists()); assert!(node_modules_dir.exists());
@ -1999,7 +2004,7 @@ fn node_modules_dir_config_file() {
rm_node_modules(); rm_node_modules();
test_context test_context
.new_command() .new_command()
.args("cache --quiet --node-modules-dir=false --vendor main.ts") .args("cache --quiet --node-modules-dir=none --vendor main.ts")
.run(); .run();
assert!(!node_modules_dir.exists()); 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 // when the node_modules_dir is explicitly opted into, we should always
// ensure a top level package.json install occurs // 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( temp_dir.write(
"package.json", "package.json",
"{ \"dependencies\": { \"@denotest/esm-basic\": \"1.0\" }}", "{ \"dependencies\": { \"@denotest/esm-basic\": \"1.0\" }}",
@ -2105,7 +2110,7 @@ itest!(check_package_file_dts_dmts_dcts {
}); });
itest!(require_resolve_url_paths { 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", output: "npm/require_resolve_url/url_paths.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
@ -2116,10 +2121,7 @@ itest!(require_resolve_url_paths {
#[test] #[test]
fn byonm_cjs_esm_packages() { fn byonm_cjs_esm_packages() {
let test_context = TestContextBuilder::for_npm() let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
.env("DENO_UNSTABLE_BYONM", "1")
.use_temp_cwd()
.build();
let dir = test_context.temp_dir(); let dir = test_context.temp_dir();
test_context.run_npm("init -y"); test_context.run_npm("init -y");
@ -2201,10 +2203,7 @@ console.log(getKind());
#[test] #[test]
fn future_byonm_cjs_esm_packages() { fn future_byonm_cjs_esm_packages() {
let test_context = TestContextBuilder::for_npm() let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
.env("DENO_FUTURE", "1")
.use_temp_cwd()
.build();
let dir = test_context.temp_dir(); let dir = test_context.temp_dir();
test_context.run_npm("init -y"); test_context.run_npm("init -y");
@ -2285,59 +2284,13 @@ console.log(getKind());
} }
#[test] #[test]
fn byonm_import_map() { fn node_modules_dir_manual_import_map() {
let test_context = TestContextBuilder::for_npm().use_temp_cwd().build(); let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
let dir = test_context.temp_dir(); let dir = test_context.temp_dir();
dir.write( dir.write(
"deno.json", "deno.json",
r#"{ r#"{
"imports": { "nodeModulesDir": "manual",
"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#"{
"imports": { "imports": {
"basic": "npm:@denotest/esm-basic" "basic": "npm:@denotest/esm-basic"
} }
@ -2376,10 +2329,7 @@ console.log(getValue());
#[test] #[test]
fn byonm_package_specifier_not_installed_and_invalid_subpath() { fn byonm_package_specifier_not_installed_and_invalid_subpath() {
let test_context = TestContextBuilder::for_npm() let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
.env("DENO_UNSTABLE_BYONM", "1")
.use_temp_cwd()
.build();
let dir = test_context.temp_dir(); let dir = test_context.temp_dir();
dir.path().join("package.json").write_json(&json!({ dir.path().join("package.json").write_json(&json!({
"dependencies": { "dependencies": {
@ -2520,10 +2470,7 @@ console.log(getValue());
#[test] #[test]
fn future_byonm_npm_workspaces() { fn future_byonm_npm_workspaces() {
let test_context = TestContextBuilder::for_npm() let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
.env("DENO_FUTURE", "1")
.use_temp_cwd()
.build();
let dir = test_context.temp_dir(); let dir = test_context.temp_dir();
dir.write( dir.write(
@ -2776,7 +2723,7 @@ fn cjs_export_analysis_import_cjs_directly_relative_import() {
itest!(imports_package_json { itest!(imports_package_json {
args: 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", output: "npm/imports_package_json/main.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
@ -2784,7 +2731,7 @@ itest!(imports_package_json {
itest!(imports_package_json_import_not_defined { itest!(imports_package_json_import_not_defined {
args: 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", output: "npm/imports_package_json/import_not_defined.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
exit_code: 1, exit_code: 1,
@ -2793,7 +2740,7 @@ itest!(imports_package_json_import_not_defined {
itest!(imports_package_json_sub_path_import_not_defined { itest!(imports_package_json_sub_path_import_not_defined {
args: 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", output: "npm/imports_package_json/sub_path_import_not_defined.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
exit_code: 1, exit_code: 1,
@ -2801,7 +2748,7 @@ itest!(imports_package_json_sub_path_import_not_defined {
}); });
itest!(different_nested_dep_node_modules_dir_false { 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", output: "npm/different_nested_dep/main.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
exit_code: 0, exit_code: 0,
@ -2809,7 +2756,7 @@ itest!(different_nested_dep_node_modules_dir_false {
}); });
itest!(different_nested_dep_node_modules_dir_true { 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", output: "npm/different_nested_dep/main.out",
copy_temp_dir: Some("npm/different_nested_dep/"), copy_temp_dir: Some("npm/different_nested_dep/"),
cwd: 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"); test_context.run_npm("install");
let output = test_context let output = test_context.new_command().args("run main.js").run();
.new_command()
.args("run main.js")
.env("DENO_FUTURE", "1")
.run();
output.assert_matches_file("npm/different_nested_dep/main.out"); 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] #[flaky_test::flaky_test]
#[ignore]
fn package_json_uncached_no_error() { fn package_json_uncached_no_error() {
let test_context = TestContextBuilder::for_npm() let test_context = TestContextBuilder::for_npm()
.use_temp_cwd() .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] #[test]
#[ignore]
fn lock_deno_json_package_json_deps() { fn lock_deno_json_package_json_deps() {
let context = TestContextBuilder::new() let context = TestContextBuilder::new()
.use_temp_cwd() .use_temp_cwd()
@ -1104,7 +1106,7 @@ fn lock_deno_json_package_json_deps_workspace() {
// deno.json // deno.json
let deno_json = temp_dir.join("deno.json"); let deno_json = temp_dir.join("deno.json");
deno_json.write_json(&json!({ deno_json.write_json(&json!({
"nodeModulesDir": true "nodeModulesDir": "auto"
})); }));
// package.json // package.json
@ -1801,16 +1803,6 @@ itest!(top_level_for_await_ts {
output: "run/top_level_await/top_level_for_await.out", 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 { itest!(unstable_worker {
args: "run --reload --quiet --allow-read run/unstable_worker.ts", args: "run --reload --quiet --allow-read run/unstable_worker.ts",
output: "run/unstable_worker.ts.out", output: "run/unstable_worker.ts.out",
@ -1848,26 +1840,6 @@ itest!(unstable_cron_enabled {
output: "run/unstable_cron.enabled.out", 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 { itest!(unstable_http_disabled {
args: "run --quiet --reload --allow-read run/unstable_http.js", args: "run --quiet --reload --allow-read run/unstable_http.js",
output: "run/unstable_http.disabled.out", output: "run/unstable_http.disabled.out",
@ -1899,17 +1871,6 @@ itest!(unstable_kv_enabled {
output: "run/unstable_kv.enabled.out", 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 { itest!(import_compression {
args: "run --quiet --reload --allow-net run/import_compression/main.ts", args: "run --quiet --reload --allow-net run/import_compression/main.ts",
output: "run/import_compression/main.out", output: "run/import_compression/main.out",
@ -3433,16 +3394,19 @@ itest!(
} }
); );
itest!(package_json_auto_discovered_for_npm_binary { // TODO(2.0): this should be rewritten to a spec test and first run `deno install`
args: "run -L debug -A npm:@denotest/bin/cli-esm this is a test", // itest!(package_json_auto_discovered_for_npm_binary {
output: "run/with_package_json/npm_binary/main.out", // args: "run -L debug -A npm:@denotest/bin/cli-esm this is a test",
cwd: Some("run/with_package_json/npm_binary/"), // output: "run/with_package_json/npm_binary/main.out",
copy_temp_dir: Some("run/with_package_json/"), // cwd: Some("run/with_package_json/npm_binary/"),
envs: env_vars_for_npm_tests(), // copy_temp_dir: Some("run/with_package_json/"),
http_server: true, // 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] #[test]
#[ignore]
fn package_json_with_deno_json() { fn package_json_with_deno_json() {
let context = TestContextBuilder::for_npm() let context = TestContextBuilder::for_npm()
.use_copy_temp_dir("package_json/deno_json/") .use_copy_temp_dir("package_json/deno_json/")

View file

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

View file

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

View file

@ -4,6 +4,7 @@ use std::process::Command;
use std::process::Stdio; use std::process::Stdio;
use std::time::Instant; use std::time::Instant;
use test_util as util; use test_util as util;
use test_util::assert_starts_with;
use test_util::TempDir; use test_util::TempDir;
use test_util::TestContext; use test_util::TestContext;
use util::TestContextBuilder; use util::TestContextBuilder;
@ -163,9 +164,10 @@ fn upgrade_invalid_stable_version() {
.wait_with_output() .wait_with_output()
.unwrap(); .unwrap();
assert!(!output.status.success()); assert!(!output.status.success());
assert_eq!( assert_starts_with!(
"error: Invalid version passed\n", &util::strip_ansi_codes(&String::from_utf8(output.stderr.clone()).unwrap())
util::strip_ansi_codes(&String::from_utf8(output.stderr).unwrap()) .to_string(),
"error: Invalid version passed (foobar)"
); );
} }
@ -188,9 +190,10 @@ fn upgrade_invalid_canary_version() {
.wait_with_output() .wait_with_output()
.unwrap(); .unwrap();
assert!(!output.status.success()); assert!(!output.status.success());
assert_eq!( assert_starts_with!(
"error: Invalid commit hash passed\n", &util::strip_ansi_codes(&String::from_utf8(output.stderr.clone()).unwrap())
util::strip_ansi_codes(&String::from_utf8(output.stderr).unwrap()) .to_string(),
"error: Invalid commit hash passed (foobar)"
); );
} }
@ -221,9 +224,10 @@ fn upgrade_invalid_lockfile() {
.unwrap(); .unwrap();
assert!(!output.status.success()); assert!(!output.status.success());
// should make it here instead of erroring on an invalid lockfile // should make it here instead of erroring on an invalid lockfile
assert_eq!( assert_starts_with!(
"error: Invalid version passed\n", &util::strip_ansi_codes(&String::from_utf8(output.stderr.clone()).unwrap())
util::strip_ansi_codes(&String::from_utf8(output.stderr).unwrap()) .to_string(),
"error: Invalid version passed (foobar)"
); );
} }
@ -251,7 +255,7 @@ fn upgrade_prompt() {
pty.expect_any(&[ pty.expect_any(&[
" 99999.99.99 Run `deno upgrade` to install it.", " 99999.99.99 Run `deno upgrade` to install it.",
// it builds canary releases on main, so check for this in that case // 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()); assert!(output.status.success());
} }
// TODO(2.0): decide if this test should be updated or removed
#[test] #[test]
#[ignore]
fn vendor_npm_node_specifiers() { fn vendor_npm_node_specifiers() {
let context = TestContextBuilder::for_npm().use_temp_cwd().build(); let context = TestContextBuilder::for_npm().use_temp_cwd().build();
let temp_dir = context.temp_dir(); let temp_dir = context.temp_dir();
@ -600,7 +602,7 @@ fn vendor_npm_node_specifiers() {
vendored_npm_package_text("1 npm package"), vendored_npm_package_text("1 npm package"),
success_text_updated_deno_json("vendor/") 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"); output.assert_matches_text("true 5\n");
assert!(temp_dir.path().join("node_modules").exists()); assert!(temp_dir.path().join("node_modules").exists());
assert!(temp_dir.path().join("deno.lock").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( file_to_watch.write(
r#" r#"
setInterval(() => {}, 0); setInterval(() => {}, 0);
window.addEventListener("load", () => { globalThis.addEventListener("load", () => {
console.log("load"); console.log("load");
}); });
window.addEventListener("unload", () => { globalThis.addEventListener("unload", () => {
console.log("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. // Change content of the file, this time without an interval to keep it alive.
file_to_watch.write( file_to_watch.write(
r#" r#"
window.addEventListener("load", () => { globalThis.addEventListener("load", () => {
console.log("load"); console.log("load");
}); });
window.addEventListener("unload", () => { globalThis.addEventListener("unload", () => {
console.log("unload"); console.log("unload");
}); });
"#, "#,

View file

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

View file

@ -1,5 +1,13 @@
{ {
"tempDir": true, "tempDir": true,
"args": "bench", "steps": [
"output": "lib.bench.out" {
"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 Check file:///[WILDCARD]/lib.bench.ts
CPU | [WILDCARD] CPU | [WILDCARD]
Runtime | [WILDCARD] Runtime | [WILDCARD]

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,25 +1,5 @@
{ {
"steps": [ "args": "run main.js",
{ "output": "error.out",
"args": "run main.js", "exitCode": 1
"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"
}
]
} }

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": [ "steps": [
{ {
"args": "run -A --unstable-fs --config ../../../config/deno.json main.js", "args": "run -A --unstable-fs --config ../../../config/deno.json main.js",
"output": "main.out", "output": "main.out"
"envs": {
"DENO_FUTURE": "1"
}
}, },
{ {
"args": "run -A --unstable-fs --config ../../../config/deno.json worker.js", "args": "run -A --unstable-fs --config ../../../config/deno.json worker.js",
"output": "main.out", "output": "main.out"
"envs": {
"DENO_FUTURE": "1"
}
} }
] ]
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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