From 8f32a1577ec00d239bce39dd1f526b5678041b8b Mon Sep 17 00:00:00 2001 From: carles escrig royo Date: Mon, 23 Sep 2024 11:19:59 +0200 Subject: [PATCH 01/17] fix(ext/web): don't ignore capture in EventTarget.removeEventListener (#25788) --- ext/web/02_event.js | 8 +---- tests/unit/event_target_test.ts | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 7 deletions(-) diff --git a/ext/web/02_event.js b/ext/web/02_event.js index f031d0aeda..a3e40ab996 100644 --- a/ext/web/02_event.js +++ b/ext/web/02_event.js @@ -7,7 +7,6 @@ import { core, primordials } from "ext:core/mod.js"; const { - ArrayPrototypeFilter, ArrayPrototypeIncludes, ArrayPrototypeIndexOf, ArrayPrototypeMap, @@ -982,12 +981,7 @@ class EventTarget { ); const { listeners } = self[eventTargetData]; - if (callback !== null && listeners[type]) { - listeners[type] = ArrayPrototypeFilter( - listeners[type], - (listener) => listener.callback !== callback, - ); - } else if (callback === null || !listeners[type]) { + if (callback === null || !listeners[type]) { return; } diff --git a/tests/unit/event_target_test.ts b/tests/unit/event_target_test.ts index 3577587d19..3f7d8ee24a 100644 --- a/tests/unit/event_target_test.ts +++ b/tests/unit/event_target_test.ts @@ -67,6 +67,64 @@ Deno.test(function anEventTargetCanBeSubclassed() { assertEquals(callCount, 0); }); +Deno.test(function removeEventListenerTest() { + const target = new EventTarget(); + let callCount = 0; + const listener = () => { + ++callCount; + }; + + target.addEventListener("incr", listener, true); + + target.dispatchEvent(new Event("incr")); + assertEquals(callCount, 1); + + // Should not remove the listener because useCapture does not match + target.removeEventListener("incr", listener, false); + + target.dispatchEvent(new Event("incr")); + assertEquals(callCount, 2); + + // Should remove the listener because useCapture matches + target.removeEventListener("incr", listener, true); + + target.dispatchEvent(new Event("incr")); + assertEquals(callCount, 2); + + // Only the capture setting matters to removeEventListener + target.addEventListener("incr", listener, { passive: true }); + + target.dispatchEvent(new Event("incr")); + assertEquals(callCount, 3); + + // Should not remove the listener because useCapture does not match + target.removeEventListener("incr", listener, { capture: true }); + target.removeEventListener("incr", listener, true); + + target.dispatchEvent(new Event("incr")); + assertEquals(callCount, 4); + + // Should remove the listener because useCapture matches + target.removeEventListener("incr", listener); + + target.dispatchEvent(new Event("incr")); + assertEquals(callCount, 4); + + // Again, should remove the listener because useCapture matches + target.addEventListener("incr", listener, { passive: true }); + target.removeEventListener("incr", listener, false); + + target.dispatchEvent(new Event("incr")); + assertEquals(callCount, 4); + + // Again, should remove the listener because useCapture matches + target.addEventListener("incr", listener, { passive: true }); + target.removeEventListener("incr", listener, { capture: false }); + + target.dispatchEvent(new Event("incr")); + assertEquals(callCount, 4); +}); + Deno.test(function removingNullEventListenerShouldSucceed() { const document = new EventTarget(); assertEquals(document.removeEventListener("x", null, false), undefined); From 08d3f1711011d7c3996c7c9b48210bf6e3e027f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 23 Sep 2024 13:18:07 +0100 Subject: [PATCH 02/17] feat: make 'globalThis.location' a configurable property (#25812) This commit changes `globalThis.location` property to be configurable so that packages wanting to override it (or delete it) work properly. Towards https://github.com/denoland/deno/issues/23882 This change makes reproduction from https://github.com/denoland/deno/issues/23882#issuecomment-2340783437 pass properly. --- runtime/js/99_main.js | 1 + tests/specs/run/location/__test__.jsonc | 8 ++++++++ tests/specs/run/location/location.js | 24 ++++++++++++++++++++++++ tests/specs/run/location/location.out | 5 +++++ 4 files changed, 38 insertions(+) create mode 100644 tests/specs/run/location/__test__.jsonc create mode 100644 tests/specs/run/location/location.js create mode 100644 tests/specs/run/location/location.out diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 8f53cffc42..9134ac48a1 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -654,6 +654,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) { if (location_ == null) { mainRuntimeGlobalProperties.location = { writable: true, + configurable: true, }; } else { location.setLocationHref(location_); diff --git a/tests/specs/run/location/__test__.jsonc b/tests/specs/run/location/__test__.jsonc new file mode 100644 index 0000000000..551463d594 --- /dev/null +++ b/tests/specs/run/location/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "tests": { + "location_object_define_property": { + "args": "run location.js", + "output": "location.out" + } + } +} diff --git a/tests/specs/run/location/location.js b/tests/specs/run/location/location.js new file mode 100644 index 0000000000..8562a39957 --- /dev/null +++ b/tests/specs/run/location/location.js @@ -0,0 +1,24 @@ +let _location = undefined; + +console.log(globalThis.location); + +Object.defineProperty(globalThis, "location", { + get() { + return _location; + }, + set(v) { + _location = v; + }, + configurable: true, +}); + +console.log(globalThis.location); + +globalThis.location = "https://deno.com"; + +console.log(_location); +console.log(location); + +delete globalThis["location"]; + +console.log(globalThis.location); diff --git a/tests/specs/run/location/location.out b/tests/specs/run/location/location.out new file mode 100644 index 0000000000..bcb3ff67b9 --- /dev/null +++ b/tests/specs/run/location/location.out @@ -0,0 +1,5 @@ +undefined +undefined +https://deno.com +https://deno.com +undefined From b1550842d99e54a248615d7876b45f9d1d9696b6 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Mon, 23 Sep 2024 19:07:35 +0530 Subject: [PATCH 03/17] tests: enable auto_discovered tests of run/no_deno_json (#25821) Towards https://github.com/denoland/deno/issues/25241 --- tests/specs/run/no_deno_json/__test__.jsonc | 36 +++++++++++++------ tests/specs/run/no_deno_json/code/install.out | 26 ++++++++++++++ .../run/no_deno_json/code/sub_dir/main.out | 1 - 3 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 tests/specs/run/no_deno_json/code/install.out diff --git a/tests/specs/run/no_deno_json/__test__.jsonc b/tests/specs/run/no_deno_json/__test__.jsonc index c8e32fa190..b27e3cbff1 100644 --- a/tests/specs/run/no_deno_json/__test__.jsonc +++ b/tests/specs/run/no_deno_json/__test__.jsonc @@ -29,19 +29,33 @@ "cwd": "code" }, "auto_discovered": { - // TODO(2.0): most likely needs to change output to not expect auto-install - "ignore": true, - // auto-discovered node_modules relative package.json - "args": "run -A main.js", - "output": "code/sub_dir/main.out", - "cwd": "code/sub_dir" + "steps": [ + { + "args": "install", + "output": "code/install.out", + "cwd": "code" + }, + { + // auto-discovered node_modules relative package.json + "args": "run -A main.js", + "output": "code/sub_dir/main.out", + "cwd": "code/sub_dir" + } + ] }, "auto_discovered_arg": { - // TODO(2.0): most likely needs to change output to not expect auto-install - "ignore": true, - // auto-discovered for local script arg - "args": "run -L debug -A code/main.ts", // notice this is not in the sub dir - "output": "main.out" + "steps": [ + { + "args": "install", + "output": "code/install.out", + "cwd": "code" + }, + { + // auto-discovered for local script arg + "args": "run -L debug -A code/main.ts", // notice this is not in the sub dir + "output": "main.out" + } + ] } } } diff --git a/tests/specs/run/no_deno_json/code/install.out b/tests/specs/run/no_deno_json/code/install.out new file mode 100644 index 0000000000..321dc8ebcb --- /dev/null +++ b/tests/specs/run/no_deno_json/code/install.out @@ -0,0 +1,26 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/check-error +Download http://localhost:4260/@denotest/cjs-default-export +Download http://localhost:4260/chalk +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +Download http://localhost:4260/@denotest/check-error/1.0.0.tgz +Download http://localhost:4260/@denotest/cjs-default-export/1.0.0.tgz +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Initialize @denotest/cjs-default-export@1.0.0 +Initialize color-name@1.1.4 +Initialize ansi-styles@4.3.0 +Initialize has-flag@4.0.0 +Initialize supports-color@7.2.0 +Initialize color-convert@2.0.1 +Initialize chalk@4.1.2 +Initialize @denotest/check-error@1.0.0 +[UNORDERED_END] diff --git a/tests/specs/run/no_deno_json/code/sub_dir/main.out b/tests/specs/run/no_deno_json/code/sub_dir/main.out index 0ec7919604..b34a051240 100644 --- a/tests/specs/run/no_deno_json/code/sub_dir/main.out +++ b/tests/specs/run/no_deno_json/code/sub_dir/main.out @@ -1,4 +1,3 @@ -Download http://[WILDCARD] [WILDCARD]sub_dir { [WILDCARD] From bfdca5bc7a05553f3921f3d3f840dadf1f1dbd5c Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 23 Sep 2024 19:40:36 +0530 Subject: [PATCH 04/17] feat(ext/crypto): import and export p521 keys (#25789) Towards https://github.com/denoland/deno/issues/13449 --- Cargo.lock | 1 + Cargo.toml | 1 + ext/crypto/Cargo.toml | 1 + ext/crypto/export_key.rs | 34 ++- ext/crypto/import_key.rs | 79 ++---- ext/crypto/shared.rs | 17 ++ ext/node/Cargo.toml | 2 +- tests/unit/webcrypto_test.ts | 21 -- tests/wpt/runner/expectation.json | 452 ++++++++++-------------------- 9 files changed, 219 insertions(+), 389 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64d28f29b4..f514abb1a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1476,6 +1476,7 @@ dependencies = [ "rand", "ring", "rsa", + "sec1", "serde", "serde_bytes", "sha1", diff --git a/Cargo.toml b/Cargo.toml index 283fb49c46..f020812ad8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -163,6 +163,7 @@ rustls-webpki = "0.102" rustyline = "=13.0.0" saffron = "=0.1.0" scopeguard = "1.2.0" +sec1 = "0.7" serde = { version = "1.0.149", features = ["derive"] } serde_bytes = "0.11" serde_json = "1.0.85" diff --git a/ext/crypto/Cargo.toml b/ext/crypto/Cargo.toml index beea81d1e8..3f2a8d7030 100644 --- a/ext/crypto/Cargo.toml +++ b/ext/crypto/Cargo.toml @@ -33,6 +33,7 @@ p521 = "0.13.3" rand.workspace = true ring = { workspace = true, features = ["std"] } rsa.workspace = true +sec1.workspace = true serde.workspace = true serde_bytes.workspace = true sha1.workspace = true diff --git a/ext/crypto/export_key.rs b/ext/crypto/export_key.rs index 588e9978b0..00ce7e11c6 100644 --- a/ext/crypto/export_key.rs +++ b/ext/crypto/export_key.rs @@ -254,7 +254,9 @@ fn export_key_ec( point.as_ref().to_vec() } EcNamedCurve::P521 => { - return Err(data_error("Unsupported named curve")) + let point = key_data.as_ec_public_key_p521()?; + + point.as_ref().to_vec() } }; Ok(ExportKeyResult::Raw(subject_public_key.into())) @@ -272,7 +274,9 @@ fn export_key_ec( point.as_ref().to_vec() } EcNamedCurve::P521 => { - return Err(data_error("Unsupported named curve")) + let point = key_data.as_ec_public_key_p521()?; + + point.as_ref().to_vec() } }; @@ -285,9 +289,10 @@ fn export_key_ec( oid: elliptic_curve::ALGORITHM_OID, parameters: Some((&p384::NistP384::OID).into()), }, - EcNamedCurve::P521 => { - return Err(data_error("Unsupported named curve")) - } + EcNamedCurve::P521 => AlgorithmIdentifierOwned { + oid: elliptic_curve::ALGORITHM_OID, + parameters: Some((&p521::NistP521::OID).into()), + }, }; let alg_id = match algorithm { @@ -351,7 +356,24 @@ fn export_key_ec( )) } } - EcNamedCurve::P521 => Err(data_error("Unsupported named curve")), + EcNamedCurve::P521 => { + let point = key_data.as_ec_public_key_p521()?; + let coords = point.coordinates(); + + if let p521::elliptic_curve::sec1::Coordinates::Uncompressed { x, y } = + coords + { + Ok(ExportKeyResult::JwkPublicEc { + x: bytes_to_b64(x), + y: bytes_to_b64(y), + }) + } else { + Err(custom_error( + "DOMExceptionOperationError", + "failed to decode public key", + )) + } + } }, ExportKeyFormat::JwkPrivate => { let private_key = key_data.as_ec_private_key()?; diff --git a/ext/crypto/import_key.rs b/ext/crypto/import_key.rs index 88265a2cd6..e30baea03a 100644 --- a/ext/crypto/import_key.rs +++ b/ext/crypto/import_key.rs @@ -7,14 +7,12 @@ use deno_core::JsBuffer; use deno_core::ToJsBuffer; use elliptic_curve::pkcs8::PrivateKeyInfo; use p256::pkcs8::EncodePrivateKey; -use ring::signature::EcdsaKeyPair; use rsa::pkcs1::UintRef; use rsa::pkcs8::der::Encode; use serde::Deserialize; use serde::Serialize; use spki::der::Decode; -use crate::key::CryptoNamedCurve; use crate::shared::*; #[derive(Deserialize)] @@ -45,7 +43,9 @@ pub enum KeyData { y: String, }, JwkPrivateEc { + #[allow(dead_code)] x: String, + #[allow(dead_code)] y: String, d: String, }, @@ -543,9 +543,7 @@ fn import_key_ec_jwk( raw_data: RustRawKeyData::Public(point_bytes.into()), }) } - KeyData::JwkPrivateEc { d, x, y } => { - jwt_b64_int_or_err!(private_d, &d, "invalid JWK private key"); - let point_bytes = import_key_ec_jwk_to_point(x, y, named_curve)?; + KeyData::JwkPrivateEc { d, .. } => { let pkcs8_der = match named_curve { EcNamedCurve::P256 => { let d = decode_b64url_to_field_bytes::(&d)?; @@ -562,27 +560,14 @@ fn import_key_ec_jwk( .map_err(|_| data_error("invalid JWK private key"))? } EcNamedCurve::P521 => { - return Err(data_error("Unsupported named curve")) + let d = decode_b64url_to_field_bytes::(&d)?; + let pk = p521::SecretKey::from_bytes(&d)?; + + pk.to_pkcs8_der() + .map_err(|_| data_error("invalid JWK private key"))? } }; - // Import using ring, to validate key - let key_alg = match named_curve { - EcNamedCurve::P256 => CryptoNamedCurve::P256.into(), - EcNamedCurve::P384 => CryptoNamedCurve::P256.into(), - EcNamedCurve::P521 => { - return Err(data_error("Unsupported named curve")) - } - }; - - let rng = ring::rand::SystemRandom::new(); - let _key_pair = EcdsaKeyPair::from_private_key_and_public_key( - key_alg, - private_d.as_bytes(), - point_bytes.as_ref(), - &rng, - ); - Ok(ImportKeyResult::Ec { raw_data: RustRawKeyData::Private(pkcs8_der.as_bytes().to_vec().into()), }) @@ -649,24 +634,15 @@ fn import_key_ec( }) } KeyData::Pkcs8(data) => { - // 2-7 - // Deserialize PKCS8 - validate structure, extracts named_curve - let named_curve_alg = match named_curve { - EcNamedCurve::P256 | EcNamedCurve::P384 => { - let pk = PrivateKeyInfo::from_der(data.as_ref()) - .map_err(|_| data_error("expected valid PKCS#8 data"))?; - pk.algorithm - .parameters - .ok_or_else(|| data_error("malformed parameters"))? - .try_into() - .unwrap() - } - EcNamedCurve::P521 => { - return Err(data_error("Unsupported named curve")) - } - }; + let pk = PrivateKeyInfo::from_der(data.as_ref()) + .map_err(|_| data_error("expected valid PKCS#8 data"))?; + let named_curve_alg = pk + .algorithm + .parameters + .ok_or_else(|| data_error("malformed parameters"))? + .try_into() + .unwrap(); - // 8-9. let pk_named_curve = match named_curve_alg { // id-secp256r1 ID_SECP256R1_OID => Some(EcNamedCurve::P256), @@ -677,27 +653,8 @@ fn import_key_ec( _ => None, }; - // 10. - if let Some(pk_named_curve) = pk_named_curve { - let signing_alg = match pk_named_curve { - EcNamedCurve::P256 => CryptoNamedCurve::P256.into(), - EcNamedCurve::P384 => CryptoNamedCurve::P384.into(), - EcNamedCurve::P521 => { - return Err(data_error("Unsupported named curve")) - } - }; - - let rng = ring::rand::SystemRandom::new(); - // deserialize pkcs8 using ring crate, to VALIDATE public key - let _private_key = EcdsaKeyPair::from_pkcs8(signing_alg, &data, &rng) - .map_err(|_| data_error("invalid key"))?; - - // 11. - if named_curve != pk_named_curve { - return Err(data_error("curve mismatch")); - } - } else { - return Err(data_error("Unsupported named curve")); + if pk_named_curve != Some(named_curve) { + return Err(data_error("curve mismatch")); } Ok(ImportKeyResult::Ec { diff --git a/ext/crypto/shared.rs b/ext/crypto/shared.rs index d5b2d6593a..d06a268cd6 100644 --- a/ext/crypto/shared.rs +++ b/ext/crypto/shared.rs @@ -126,6 +126,23 @@ impl V8RawKeyData { } } + pub fn as_ec_public_key_p521(&self) -> Result { + match self { + V8RawKeyData::Public(data) => { + // public_key is a serialized EncodedPoint + p521::EncodedPoint::from_bytes(data) + .map_err(|_| type_error("expected valid public EC key")) + } + V8RawKeyData::Private(data) => { + let signing_key = p521::SecretKey::from_pkcs8_der(data) + .map_err(|_| type_error("expected valid private EC key"))?; + Ok(signing_key.public_key().to_encoded_point(false)) + } + // Should never reach here. + V8RawKeyData::Secret(_) => unreachable!(), + } + } + pub fn as_ec_private_key(&self) -> Result<&[u8], AnyError> { match self { V8RawKeyData::Private(data) => Ok(data), diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml index 24e7ecf2ed..1cd97e3e81 100644 --- a/ext/node/Cargo.toml +++ b/ext/node/Cargo.toml @@ -81,7 +81,7 @@ ring.workspace = true ripemd = { version = "0.1.3", features = ["oid"] } rsa.workspace = true scrypt = "0.11.0" -sec1 = "0.7" +sec1.workspace = true serde = "1.0.149" sha1.workspace = true sha2.workspace = true diff --git a/tests/unit/webcrypto_test.ts b/tests/unit/webcrypto_test.ts index 97828c1499..57aa19eaee 100644 --- a/tests/unit/webcrypto_test.ts +++ b/tests/unit/webcrypto_test.ts @@ -2045,24 +2045,3 @@ Deno.test(async function p521Generate() { assert(key.privateKey instanceof CryptoKey); assert(key.publicKey instanceof CryptoKey); }); - -Deno.test(async function invalidEcPointDataError() { - await assertRejects(async () => { - await crypto.subtle - .importKey( - "pkcs8", - // deno-fmt-ignore - new Uint8Array([ - 48, 102, 2, 1, 0, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, - 72, 206, 61, 3, 1, 7, 4, 76, 48, 74, 2, 1, 1, 4, 32, 255, 255, 255, 255, - 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 188, 230, 250, 173, - 167, 23, 158, 132, 243, 185, 202, 194, 252, 99, 37, 81, 161, 35, 3, 33, 0, - 0, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 188, - 230, 250, 173, 167, 23, 158, 132, 243, 185, 202, 194, 252, 99, 37, 81, - ]), - { name: "ECDSA", namedCurve: "P-256" }, - true, - ["sign"], - ); - }, DOMException); -}); diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index cc67addc84..1b31f26e5a 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -6,46 +6,26 @@ "ecdh_bits.https.any.html": [ "P-521 good parameters", "P-521 mixed case parameters", - "P-521 with null length", "P-521 short result", "P-521 non-multiple of 8 bits", - "P-521 mismatched curves", - "P-521 public property of algorithm is not an ECDSA public key", "P-521 no deriveBits usage for base key", - "P-521 public property value is a private key", - "P-521 public property value is a secret key", "P-521 asking for too many bits" ], "ecdh_bits.https.any.worker.html": [ "P-521 good parameters", "P-521 mixed case parameters", - "P-521 with null length", "P-521 short result", "P-521 non-multiple of 8 bits", - "P-521 mismatched curves", - "P-521 public property of algorithm is not an ECDSA public key", "P-521 no deriveBits usage for base key", - "P-521 public property value is a private key", - "P-521 public property value is a secret key", "P-521 asking for too many bits" ], "ecdh_keys.https.any.html": [ "P-521 good parameters", - "P-521 mixed case parameters", - "P-521 mismatched curves", - "P-521 public property of algorithm is not an ECDSA public key", - "P-521 no deriveKey usage for base key", - "P-521 public property value is a private key", - "P-521 public property value is a secret key" + "P-521 mixed case parameters" ], "ecdh_keys.https.any.worker.html": [ "P-521 good parameters", - "P-521 mixed case parameters", - "P-521 mismatched curves", - "P-521 public property of algorithm is not an ECDSA public key", - "P-521 no deriveKey usage for base key", - "P-521 public property value is a private key", - "P-521 public property value is a secret key" + "P-521 mixed case parameters" ], "hkdf.https.any.html?1-1000": true, "hkdf.https.any.html?1001-2000": true, @@ -87,14 +67,12 @@ "X448 key derivation checks for all-zero value result with a key of order p+1 (=1, order 1)", "X25519 good parameters", "X25519 mixed case parameters", - "X25519 with null length", "X25519 short result", "X25519 non-multiple of 8 bits", "X25519 mismatched algorithms", "X25519 no deriveBits usage for base key", "X448 good parameters", "X448 mixed case parameters", - "X448 with null length", "X448 short result", "X448 non-multiple of 8 bits", "X448 mismatched algorithms", @@ -118,14 +96,12 @@ "X448 key derivation checks for all-zero value result with a key of order p+1 (=1, order 1)", "X25519 good parameters", "X25519 mixed case parameters", - "X25519 with null length", "X25519 short result", "X25519 non-multiple of 8 bits", "X25519 mismatched algorithms", "X25519 no deriveBits usage for base key", "X448 good parameters", "X448 mixed case parameters", - "X448 with null length", "X448 short result", "X448 non-multiple of 8 bits", "X448 mismatched algorithms", @@ -184,6 +160,20 @@ "X448 base key is not a private key", "X448 public property value is a private key", "X448 public property value is a secret key" + ], + "derived_bits_length.https.any.html": [ + "X25519 derivation with 256 as 'length' parameter", + "X25519 derivation with 0 as 'length' parameter", + "X25519 derivation with null as 'length' parameter", + "X25519 derivation with undefined as 'length' parameter", + "X25519 derivation with omitted as 'length' parameter" + ], + "derived_bits_length.https.any.worker.html": [ + "X25519 derivation with 256 as 'length' parameter", + "X25519 derivation with 0 as 'length' parameter", + "X25519 derivation with null as 'length' parameter", + "X25519 derivation with undefined as 'length' parameter", + "X25519 derivation with omitted as 'length' parameter" ] }, "digest": { @@ -909,137 +899,43 @@ "historical.any.html": false, "historical.any.worker.html": false, "idlharness.https.any.html": [ - "Window interface: attribute crypto", - "SubtleCrypto interface: operation deriveBits(AlgorithmIdentifier, CryptoKey, unsigned long)" + "Window interface: attribute crypto" ], "idlharness.https.any.worker.html": [ - "WorkerGlobalScope interface: attribute crypto", - "SubtleCrypto interface: operation deriveBits(AlgorithmIdentifier, CryptoKey, unsigned long)" + "WorkerGlobalScope interface: attribute crypto" ], "import_export": { "ec_importKey.https.any.html": [ - "Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, true, [verify])", "Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, true, [verify])", - "Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, true, [verify])", "Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify])", - "Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", "Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", - "Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", "Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, true, [sign])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, true, [sign, sign])", - "Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, true, [sign])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, true, [sign, sign])", - "Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, false, [sign])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, false, [sign, sign])", - "Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, false, [])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, false, [sign])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, false, [sign, sign])", - "Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, false, [])", - "Good parameters: P-521 bits (spki, buffer(158), {name: ECDH, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDH, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDH, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (raw, buffer(133), {name: ECDH, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDH, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveKey])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveBits])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveKey])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveKey])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveBits])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveBits])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveKey])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveBits])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveKey])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveKey])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveBits])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveBits])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [])" + "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])" ], "ec_importKey.https.any.worker.html": [ - "Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, true, [verify])", "Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, true, [verify])", - "Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, true, [verify])", "Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify])", - "Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", "Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", - "Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", "Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, true, [sign])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, true, [sign, sign])", - "Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, true, [sign])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, true, [sign, sign])", - "Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, false, [sign])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, false, [sign, sign])", - "Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, false, [])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, false, [sign])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, false, [sign, sign])", - "Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, false, [])", - "Good parameters: P-521 bits (spki, buffer(158), {name: ECDH, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDH, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDH, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (raw, buffer(133), {name: ECDH, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDH, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveKey])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveBits])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveKey])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveKey])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])", "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveBits])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveBits])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveKey])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveBits])", - "Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveKey])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveKey])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveBits])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveBits])", - "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])", - "ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])", - "Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [])" + "Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])" ], "rsa_importKey.https.any.html": true, "rsa_importKey.https.any.worker.html": true, @@ -1276,62 +1172,50 @@ "ECDSA P-384 with SHA-1 verification", "ECDSA P-384 with SHA-256 verification", "ECDSA P-384 with SHA-512 verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification", + "ECDSA P-521 with SHA-1 verification", + "ECDSA P-521 with SHA-256 verification", + "ECDSA P-521 with SHA-384 verification", + "ECDSA P-521 with SHA-512 verification", "ECDSA P-256 with SHA-1 verification with altered signature after call", "ECDSA P-256 with SHA-384 verification with altered signature after call", "ECDSA P-256 with SHA-512 verification with altered signature after call", "ECDSA P-384 with SHA-1 verification with altered signature after call", "ECDSA P-384 with SHA-256 verification with altered signature after call", "ECDSA P-384 with SHA-512 verification with altered signature after call", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification with altered signature after call", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification with altered signature after call", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification with altered signature after call", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification with altered signature after call", + "ECDSA P-521 with SHA-1 verification with altered signature after call", + "ECDSA P-521 with SHA-256 verification with altered signature after call", + "ECDSA P-521 with SHA-384 verification with altered signature after call", + "ECDSA P-521 with SHA-512 verification with altered signature after call", "ECDSA P-256 with SHA-1 with altered plaintext after call", "ECDSA P-256 with SHA-384 with altered plaintext after call", "ECDSA P-256 with SHA-512 with altered plaintext after call", "ECDSA P-384 with SHA-1 with altered plaintext after call", "ECDSA P-384 with SHA-256 with altered plaintext after call", "ECDSA P-384 with SHA-512 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-1 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-256 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-384 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-512 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-1 using privateKey to verify", - "importVectorKeys step: ECDSA P-521 with SHA-256 using privateKey to verify", - "importVectorKeys step: ECDSA P-521 with SHA-384 using privateKey to verify", - "importVectorKeys step: ECDSA P-521 with SHA-512 using privateKey to verify", - "importVectorKeys step: ECDSA P-521 with SHA-1 using publicKey to sign", - "importVectorKeys step: ECDSA P-521 with SHA-256 using publicKey to sign", - "importVectorKeys step: ECDSA P-521 with SHA-384 using publicKey to sign", - "importVectorKeys step: ECDSA P-521 with SHA-512 using publicKey to sign", - "importVectorKeys step: ECDSA P-521 with SHA-1 no verify usage", - "importVectorKeys step: ECDSA P-521 with SHA-256 no verify usage", - "importVectorKeys step: ECDSA P-521 with SHA-384 no verify usage", - "importVectorKeys step: ECDSA P-521 with SHA-512 no verify usage", + "ECDSA P-521 with SHA-1 with altered plaintext after call", + "ECDSA P-521 with SHA-256 with altered plaintext after call", + "ECDSA P-521 with SHA-384 with altered plaintext after call", + "ECDSA P-521 with SHA-512 with altered plaintext after call", "ECDSA P-256 with SHA-1 round trip", "ECDSA P-256 with SHA-384 round trip", "ECDSA P-256 with SHA-512 round trip", "ECDSA P-384 with SHA-1 round trip", "ECDSA P-384 with SHA-256 round trip", "ECDSA P-384 with SHA-512 round trip", - "importVectorKeys step: ECDSA P-521 with SHA-1 round trip", - "importVectorKeys step: ECDSA P-521 with SHA-256 round trip", - "importVectorKeys step: ECDSA P-521 with SHA-384 round trip", - "importVectorKeys step: ECDSA P-521 with SHA-512 round trip", + "ECDSA P-521 with SHA-1 round trip", + "ECDSA P-521 with SHA-256 round trip", + "ECDSA P-521 with SHA-384 round trip", + "ECDSA P-521 with SHA-512 round trip", "ECDSA P-256 with SHA-1 verification failure due to altered signature", "ECDSA P-256 with SHA-384 verification failure due to altered signature", "ECDSA P-256 with SHA-512 verification failure due to altered signature", "ECDSA P-384 with SHA-1 verification failure due to altered signature", "ECDSA P-384 with SHA-256 verification failure due to altered signature", "ECDSA P-384 with SHA-512 verification failure due to altered signature", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to altered signature", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to altered signature", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to altered signature", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to altered signature", + "ECDSA P-521 with SHA-1 verification failure due to altered signature", + "ECDSA P-521 with SHA-256 verification failure due to altered signature", + "ECDSA P-521 with SHA-384 verification failure due to altered signature", + "ECDSA P-521 with SHA-512 verification failure due to altered signature", "ECDSA P-256 with SHA-256 verification failure due to wrong hash", "ECDSA P-256 with SHA-384 verification failure due to wrong hash", "ECDSA P-256 with SHA-512 verification failure due to wrong hash", @@ -1339,34 +1223,30 @@ "ECDSA P-384 with SHA-256 verification failure due to wrong hash", "ECDSA P-384 with SHA-384 verification failure due to wrong hash", "ECDSA P-384 with SHA-512 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to bad hash name", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to bad hash name", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to bad hash name", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to bad hash name", + "ECDSA P-521 with SHA-1 verification failure due to wrong hash", + "ECDSA P-521 with SHA-256 verification failure due to wrong hash", + "ECDSA P-521 with SHA-384 verification failure due to wrong hash", + "ECDSA P-521 with SHA-512 verification failure due to wrong hash", "ECDSA P-256 with SHA-1 verification failure due to shortened signature", "ECDSA P-256 with SHA-384 verification failure due to shortened signature", "ECDSA P-256 with SHA-512 verification failure due to shortened signature", "ECDSA P-384 with SHA-1 verification failure due to shortened signature", "ECDSA P-384 with SHA-256 verification failure due to shortened signature", "ECDSA P-384 with SHA-512 verification failure due to shortened signature", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to shortened signature", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to shortened signature", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to shortened signature", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to shortened signature", + "ECDSA P-521 with SHA-1 verification failure due to shortened signature", + "ECDSA P-521 with SHA-256 verification failure due to shortened signature", + "ECDSA P-521 with SHA-384 verification failure due to shortened signature", + "ECDSA P-521 with SHA-512 verification failure due to shortened signature", "ECDSA P-256 with SHA-1 verification failure due to altered plaintext", "ECDSA P-256 with SHA-384 verification failure due to altered plaintext", "ECDSA P-256 with SHA-512 verification failure due to altered plaintext", "ECDSA P-384 with SHA-1 verification failure due to altered plaintext", "ECDSA P-384 with SHA-256 verification failure due to altered plaintext", "ECDSA P-384 with SHA-512 verification failure due to altered plaintext", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to altered plaintext", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to altered plaintext", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to altered plaintext", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to altered plaintext", + "ECDSA P-521 with SHA-1 verification failure due to altered plaintext", + "ECDSA P-521 with SHA-256 verification failure due to altered plaintext", + "ECDSA P-521 with SHA-384 verification failure due to altered plaintext", + "ECDSA P-521 with SHA-512 verification failure due to altered plaintext", "ECDSA P-256 with SHA-1 - The signature was truncated by 1 byte verification", "ECDSA P-256 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-384 verification", "ECDSA P-256 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-512 verification", @@ -1409,42 +1289,34 @@ "ECDSA P-384 with SHA-512 - Signature has excess padding verification", "ECDSA P-384 with SHA-512 - The signature is empty verification", "ECDSA P-384 with SHA-512 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature was truncated by 1 byte verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-256 verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-384 verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-512 verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - Signature has excess padding verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature is empty verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature was truncated by 1 byte verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-1 verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-384 verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-512 verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - Signature has excess padding verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature is empty verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature was truncated by 1 byte verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-1 verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-256 verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-512 verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - Signature has excess padding verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature is empty verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature was truncated by 1 byte verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-1 verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-256 verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-384 verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - Signature has excess padding verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature is empty verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 signing with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-256 signing with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-384 signing with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-512 signing with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-1 verifying with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-256 verifying with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-384 verifying with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-512 verifying with wrong algorithm name" + "ECDSA P-521 with SHA-1 - The signature was truncated by 1 byte verification", + "ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-256 verification", + "ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-384 verification", + "ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-512 verification", + "ECDSA P-521 with SHA-1 - Signature has excess padding verification", + "ECDSA P-521 with SHA-1 - The signature is empty verification", + "ECDSA P-521 with SHA-1 - The signature is all zeroes verification", + "ECDSA P-521 with SHA-256 - The signature was truncated by 1 byte verification", + "ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-1 verification", + "ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-384 verification", + "ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-512 verification", + "ECDSA P-521 with SHA-256 - Signature has excess padding verification", + "ECDSA P-521 with SHA-256 - The signature is empty verification", + "ECDSA P-521 with SHA-256 - The signature is all zeroes verification", + "ECDSA P-521 with SHA-384 - The signature was truncated by 1 byte verification", + "ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-1 verification", + "ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-256 verification", + "ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-512 verification", + "ECDSA P-521 with SHA-384 - Signature has excess padding verification", + "ECDSA P-521 with SHA-384 - The signature is empty verification", + "ECDSA P-521 with SHA-384 - The signature is all zeroes verification", + "ECDSA P-521 with SHA-512 - The signature was truncated by 1 byte verification", + "ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-1 verification", + "ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-256 verification", + "ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-384 verification", + "ECDSA P-521 with SHA-512 - Signature has excess padding verification", + "ECDSA P-521 with SHA-512 - The signature is empty verification", + "ECDSA P-521 with SHA-512 - The signature is all zeroes verification" ], "ecdsa.https.any.worker.html": [ "ECDSA P-256 with SHA-1 verification", @@ -1453,62 +1325,50 @@ "ECDSA P-384 with SHA-1 verification", "ECDSA P-384 with SHA-256 verification", "ECDSA P-384 with SHA-512 verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification", + "ECDSA P-521 with SHA-1 verification", + "ECDSA P-521 with SHA-256 verification", + "ECDSA P-521 with SHA-384 verification", + "ECDSA P-521 with SHA-512 verification", "ECDSA P-256 with SHA-1 verification with altered signature after call", "ECDSA P-256 with SHA-384 verification with altered signature after call", "ECDSA P-256 with SHA-512 verification with altered signature after call", "ECDSA P-384 with SHA-1 verification with altered signature after call", "ECDSA P-384 with SHA-256 verification with altered signature after call", "ECDSA P-384 with SHA-512 verification with altered signature after call", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification with altered signature after call", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification with altered signature after call", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification with altered signature after call", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification with altered signature after call", + "ECDSA P-521 with SHA-1 verification with altered signature after call", + "ECDSA P-521 with SHA-256 verification with altered signature after call", + "ECDSA P-521 with SHA-384 verification with altered signature after call", + "ECDSA P-521 with SHA-512 verification with altered signature after call", "ECDSA P-256 with SHA-1 with altered plaintext after call", "ECDSA P-256 with SHA-384 with altered plaintext after call", "ECDSA P-256 with SHA-512 with altered plaintext after call", "ECDSA P-384 with SHA-1 with altered plaintext after call", "ECDSA P-384 with SHA-256 with altered plaintext after call", "ECDSA P-384 with SHA-512 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-1 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-256 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-384 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-512 with altered plaintext after call", - "importVectorKeys step: ECDSA P-521 with SHA-1 using privateKey to verify", - "importVectorKeys step: ECDSA P-521 with SHA-256 using privateKey to verify", - "importVectorKeys step: ECDSA P-521 with SHA-384 using privateKey to verify", - "importVectorKeys step: ECDSA P-521 with SHA-512 using privateKey to verify", - "importVectorKeys step: ECDSA P-521 with SHA-1 using publicKey to sign", - "importVectorKeys step: ECDSA P-521 with SHA-256 using publicKey to sign", - "importVectorKeys step: ECDSA P-521 with SHA-384 using publicKey to sign", - "importVectorKeys step: ECDSA P-521 with SHA-512 using publicKey to sign", - "importVectorKeys step: ECDSA P-521 with SHA-1 no verify usage", - "importVectorKeys step: ECDSA P-521 with SHA-256 no verify usage", - "importVectorKeys step: ECDSA P-521 with SHA-384 no verify usage", - "importVectorKeys step: ECDSA P-521 with SHA-512 no verify usage", + "ECDSA P-521 with SHA-1 with altered plaintext after call", + "ECDSA P-521 with SHA-256 with altered plaintext after call", + "ECDSA P-521 with SHA-384 with altered plaintext after call", + "ECDSA P-521 with SHA-512 with altered plaintext after call", "ECDSA P-256 with SHA-1 round trip", "ECDSA P-256 with SHA-384 round trip", "ECDSA P-256 with SHA-512 round trip", "ECDSA P-384 with SHA-1 round trip", "ECDSA P-384 with SHA-256 round trip", "ECDSA P-384 with SHA-512 round trip", - "importVectorKeys step: ECDSA P-521 with SHA-1 round trip", - "importVectorKeys step: ECDSA P-521 with SHA-256 round trip", - "importVectorKeys step: ECDSA P-521 with SHA-384 round trip", - "importVectorKeys step: ECDSA P-521 with SHA-512 round trip", + "ECDSA P-521 with SHA-1 round trip", + "ECDSA P-521 with SHA-256 round trip", + "ECDSA P-521 with SHA-384 round trip", + "ECDSA P-521 with SHA-512 round trip", "ECDSA P-256 with SHA-1 verification failure due to altered signature", "ECDSA P-256 with SHA-384 verification failure due to altered signature", "ECDSA P-256 with SHA-512 verification failure due to altered signature", "ECDSA P-384 with SHA-1 verification failure due to altered signature", "ECDSA P-384 with SHA-256 verification failure due to altered signature", "ECDSA P-384 with SHA-512 verification failure due to altered signature", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to altered signature", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to altered signature", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to altered signature", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to altered signature", + "ECDSA P-521 with SHA-1 verification failure due to altered signature", + "ECDSA P-521 with SHA-256 verification failure due to altered signature", + "ECDSA P-521 with SHA-384 verification failure due to altered signature", + "ECDSA P-521 with SHA-512 verification failure due to altered signature", "ECDSA P-256 with SHA-256 verification failure due to wrong hash", "ECDSA P-256 with SHA-384 verification failure due to wrong hash", "ECDSA P-256 with SHA-512 verification failure due to wrong hash", @@ -1516,34 +1376,30 @@ "ECDSA P-384 with SHA-256 verification failure due to wrong hash", "ECDSA P-384 with SHA-384 verification failure due to wrong hash", "ECDSA P-384 with SHA-512 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to wrong hash", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to bad hash name", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to bad hash name", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to bad hash name", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to bad hash name", + "ECDSA P-521 with SHA-1 verification failure due to wrong hash", + "ECDSA P-521 with SHA-256 verification failure due to wrong hash", + "ECDSA P-521 with SHA-384 verification failure due to wrong hash", + "ECDSA P-521 with SHA-512 verification failure due to wrong hash", "ECDSA P-256 with SHA-1 verification failure due to shortened signature", "ECDSA P-256 with SHA-384 verification failure due to shortened signature", "ECDSA P-256 with SHA-512 verification failure due to shortened signature", "ECDSA P-384 with SHA-1 verification failure due to shortened signature", "ECDSA P-384 with SHA-256 verification failure due to shortened signature", "ECDSA P-384 with SHA-512 verification failure due to shortened signature", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to shortened signature", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to shortened signature", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to shortened signature", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to shortened signature", + "ECDSA P-521 with SHA-1 verification failure due to shortened signature", + "ECDSA P-521 with SHA-256 verification failure due to shortened signature", + "ECDSA P-521 with SHA-384 verification failure due to shortened signature", + "ECDSA P-521 with SHA-512 verification failure due to shortened signature", "ECDSA P-256 with SHA-1 verification failure due to altered plaintext", "ECDSA P-256 with SHA-384 verification failure due to altered plaintext", "ECDSA P-256 with SHA-512 verification failure due to altered plaintext", "ECDSA P-384 with SHA-1 verification failure due to altered plaintext", "ECDSA P-384 with SHA-256 verification failure due to altered plaintext", "ECDSA P-384 with SHA-512 verification failure due to altered plaintext", - "importVectorKeys step: ECDSA P-521 with SHA-1 verification failure due to altered plaintext", - "importVectorKeys step: ECDSA P-521 with SHA-256 verification failure due to altered plaintext", - "importVectorKeys step: ECDSA P-521 with SHA-384 verification failure due to altered plaintext", - "importVectorKeys step: ECDSA P-521 with SHA-512 verification failure due to altered plaintext", + "ECDSA P-521 with SHA-1 verification failure due to altered plaintext", + "ECDSA P-521 with SHA-256 verification failure due to altered plaintext", + "ECDSA P-521 with SHA-384 verification failure due to altered plaintext", + "ECDSA P-521 with SHA-512 verification failure due to altered plaintext", "ECDSA P-256 with SHA-1 - The signature was truncated by 1 byte verification", "ECDSA P-256 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-384 verification", "ECDSA P-256 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-512 verification", @@ -1586,42 +1442,34 @@ "ECDSA P-384 with SHA-512 - Signature has excess padding verification", "ECDSA P-384 with SHA-512 - The signature is empty verification", "ECDSA P-384 with SHA-512 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature was truncated by 1 byte verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-256 verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-384 verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-512 verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - Signature has excess padding verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature is empty verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature was truncated by 1 byte verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-1 verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-384 verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-512 verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - Signature has excess padding verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature is empty verification", - "importVectorKeys step: ECDSA P-521 with SHA-256 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature was truncated by 1 byte verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-1 verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-256 verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-512 verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - Signature has excess padding verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature is empty verification", - "importVectorKeys step: ECDSA P-521 with SHA-384 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature was truncated by 1 byte verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-1 verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-256 verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-384 verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - Signature has excess padding verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature is empty verification", - "importVectorKeys step: ECDSA P-521 with SHA-512 - The signature is all zeroes verification", - "importVectorKeys step: ECDSA P-521 with SHA-1 signing with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-256 signing with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-384 signing with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-512 signing with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-1 verifying with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-256 verifying with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-384 verifying with wrong algorithm name", - "importVectorKeys step: ECDSA P-521 with SHA-512 verifying with wrong algorithm name" + "ECDSA P-521 with SHA-1 - The signature was truncated by 1 byte verification", + "ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-256 verification", + "ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-384 verification", + "ECDSA P-521 with SHA-1 - The signature was made using SHA-1, however verification is being done using SHA-512 verification", + "ECDSA P-521 with SHA-1 - Signature has excess padding verification", + "ECDSA P-521 with SHA-1 - The signature is empty verification", + "ECDSA P-521 with SHA-1 - The signature is all zeroes verification", + "ECDSA P-521 with SHA-256 - The signature was truncated by 1 byte verification", + "ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-1 verification", + "ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-384 verification", + "ECDSA P-521 with SHA-256 - The signature was made using SHA-256, however verification is being done using SHA-512 verification", + "ECDSA P-521 with SHA-256 - Signature has excess padding verification", + "ECDSA P-521 with SHA-256 - The signature is empty verification", + "ECDSA P-521 with SHA-256 - The signature is all zeroes verification", + "ECDSA P-521 with SHA-384 - The signature was truncated by 1 byte verification", + "ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-1 verification", + "ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-256 verification", + "ECDSA P-521 with SHA-384 - The signature was made using SHA-384, however verification is being done using SHA-512 verification", + "ECDSA P-521 with SHA-384 - Signature has excess padding verification", + "ECDSA P-521 with SHA-384 - The signature is empty verification", + "ECDSA P-521 with SHA-384 - The signature is all zeroes verification", + "ECDSA P-521 with SHA-512 - The signature was truncated by 1 byte verification", + "ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-1 verification", + "ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-256 verification", + "ECDSA P-521 with SHA-512 - The signature was made using SHA-512, however verification is being done using SHA-384 verification", + "ECDSA P-521 with SHA-512 - Signature has excess padding verification", + "ECDSA P-521 with SHA-512 - The signature is empty verification", + "ECDSA P-521 with SHA-512 - The signature is all zeroes verification" ], "hmac.https.any.html": true, "hmac.https.any.worker.html": true, @@ -1642,13 +1490,7 @@ "EdDSA Ed448 verification failure due to altered signature", "EdDSA Ed448 verification failure due to shortened signature", "EdDSA Ed448 verification failure due to altered data", - "Sign and verify using generated Ed448 keys.", - "Ed25519 Verification checks with small-order key of order - Test 0", - "Ed25519 Verification checks with small-order key of order - Test 1", - "Ed25519 Verification checks with small-order key of order - Test 2", - "Ed25519 Verification checks with small-order key of order - Test 11", - "Ed25519 Verification checks with small-order key of order - Test 12", - "Ed25519 Verification checks with small-order key of order - Test 13" + "Sign and verify using generated Ed448 keys." ], "eddsa.https.any.worker.html": [ "EdDSA Ed448 verification", @@ -1663,7 +1505,17 @@ "EdDSA Ed448 verification failure due to altered signature", "EdDSA Ed448 verification failure due to shortened signature", "EdDSA Ed448 verification failure due to altered data", - "Sign and verify using generated Ed448 keys.", + "Sign and verify using generated Ed448 keys." + ], + "eddsa_small_order_points.https.any.html": [ + "Ed25519 Verification checks with small-order key of order - Test 0", + "Ed25519 Verification checks with small-order key of order - Test 1", + "Ed25519 Verification checks with small-order key of order - Test 2", + "Ed25519 Verification checks with small-order key of order - Test 11", + "Ed25519 Verification checks with small-order key of order - Test 12", + "Ed25519 Verification checks with small-order key of order - Test 13" + ], + "eddsa_small_order_points.https.any.worker.html": [ "Ed25519 Verification checks with small-order key of order - Test 0", "Ed25519 Verification checks with small-order key of order - Test 1", "Ed25519 Verification checks with small-order key of order - Test 2", From cab3363026d47f2a975518a3108911a6edc0fd52 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Mon, 23 Sep 2024 20:17:43 +0530 Subject: [PATCH 05/17] tests: update specs::cache::package_json (#25827) Towards https://github.com/denoland/deno/issues/25241 --- tests/specs/cache/package_json/__test__.jsonc | 14 ++++++++++---- tests/specs/cache/package_json/deno.json | 3 +++ tests/specs/cache/package_json/deno.lock.out | 16 ++++++++++++++++ tests/specs/cache/package_json/main.cache.out | 1 - 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 tests/specs/cache/package_json/deno.json create mode 100644 tests/specs/cache/package_json/deno.lock.out diff --git a/tests/specs/cache/package_json/__test__.jsonc b/tests/specs/cache/package_json/__test__.jsonc index 803d5ef09a..27fd3f9bab 100644 --- a/tests/specs/cache/package_json/__test__.jsonc +++ b/tests/specs/cache/package_json/__test__.jsonc @@ -1,7 +1,13 @@ { "tempDir": true, - // TODO(2.0): decide if this test should be fixed or removed - "ignore": true, - "args": "cache main.ts", - "output": "main.cache.out" + "steps": [ + { + "args": "cache main.ts", + "output": "main.cache.out" + }, + { + "args": "eval console.log(Deno.readTextFileSync('deno.lock').trim())", + "output": "deno.lock.out" + } + ] } diff --git a/tests/specs/cache/package_json/deno.json b/tests/specs/cache/package_json/deno.json new file mode 100644 index 0000000000..38af4024b0 --- /dev/null +++ b/tests/specs/cache/package_json/deno.json @@ -0,0 +1,3 @@ +{ + "nodeModulesDir": "none" +} diff --git a/tests/specs/cache/package_json/deno.lock.out b/tests/specs/cache/package_json/deno.lock.out new file mode 100644 index 0000000000..d390a59c13 --- /dev/null +++ b/tests/specs/cache/package_json/deno.lock.out @@ -0,0 +1,16 @@ +{ + "version": "4", + "specifiers": { + "npm:@denotest/esm-basic@*": "1.0.0" + }, + "npm": { + "@denotest/esm-basic@1.0.0": [WILDCARD] + }, + "workspace": { + "packageJson": { + "dependencies": [ + "npm:@denotest/esm-basic@*" + ] + } + } +} diff --git a/tests/specs/cache/package_json/main.cache.out b/tests/specs/cache/package_json/main.cache.out index b8114c12a0..f5a1cd15ee 100644 --- a/tests/specs/cache/package_json/main.cache.out +++ b/tests/specs/cache/package_json/main.cache.out @@ -1,3 +1,2 @@ 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 From be13da5d8d08c105e73bc966f681a02b863903d1 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Tue, 24 Sep 2024 00:02:15 +0900 Subject: [PATCH 06/17] fix: consistent with deno_config and treat `"experimentalDecorators"` as deprecated (#25735) --- cli/schemas/config-file.v1.json | 82 +++++++++++++++++---------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index ab0f4997cb..af18e6f21c 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -35,18 +35,32 @@ "default": false, "markdownDescription": "Enable error reporting in type-checked JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#checkJs" }, - "exactOptionalPropertyTypes": { - "description": "Differentiate between undefined and not present when type checking", + "emitDecoratorMetadata": { + "description": "Emit design-type metadata for decorated declarations in source files.", "type": "boolean", "default": false, - "markdownDescription": "Differentiate between undefined and not present when type checking\n\nSee more: https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes" + "deprecated": true, + "markdownDescription": "Emit design-type metadata for decorated declarations in source files.\n\nSee more: https://www.typescriptlang.org/tsconfig/#emitDecoratorMetadata" + }, + "exactOptionalPropertyTypes": { + "description": "Interpret optional property types as written, rather than adding 'undefined'.", + "type": "boolean", + "default": false, + "markdownDescription": "Interpret optional property types as written, rather than adding 'undefined'.\n\nSee more: https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes" }, "experimentalDecorators": { "description": "Enable experimental support for legacy experimental decorators.", "type": "boolean", "default": false, + "deprecated": true, "markdownDescription": "Enable experimental support for legacy experimental decorators.\n\nSee more: https://www.typescriptlang.org/tsconfig#experimentalDecorators" }, + "isolatedDeclarations": { + "description": "Require sufficient annotation on exports so other tools can trivially generate declaration files.", + "type": "boolean", + "default": false, + "markdownDescription": "Require sufficient annotation on exports so other tools can trivially generate declaration files.\n\nSee more: https://www.typescriptlang.org/tsconfig/#isolatedDeclarations" + }, "jsx": { "description": "Specify what JSX code is generated.", "default": "react", @@ -91,12 +105,6 @@ }, "markdownDescription": "Specify list of elements that should be exempt from being precompiled when the jsx `precompile` transform is used." }, - "keyofStringsOnly": { - "description": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.", - "type": "boolean", - "default": false, - "markdownDescription": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.\n\nSee more: https://www.typescriptlang.org/tsconfig#keyofStringsOnly" - }, "lib": { "description": "Specify a set of bundled library declaration files that describe the target runtime environment.", "type": "array", @@ -143,23 +151,17 @@ "default": true, "markdownDescription": "Enable error reporting when `this` is given the type `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitThis" }, - "noImplicitUseStrict": { - "description": "Disable adding 'use strict' directives in emitted JavaScript files.", - "type": "boolean", - "default": true, - "markdownDescription": "Disable adding 'use strict' directives in emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitUseStrict" - }, "noPropertyAccessFromIndexSignature": { "description": "Enforces using indexed accessors for keys declared using an indexed type.", "type": "boolean", "default": false, "markdownDescription": "Enforces using indexed accessors for keys declared using an indexed type.\n\nSee more: https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature" }, - "noStrictGenericChecks": { - "description": "Disable strict checking of generic signatures in function types.", + "noUncheckedIndexedAccess": { + "description": "Add `undefined` to a type when accessed using an index.", "type": "boolean", "default": false, - "markdownDescription": "Disable strict checking of generic signatures in function types.\n\nSee more: https://www.typescriptlang.org/tsconfig#noStrictGenericChecks" + "markdownDescription": "Add `undefined` to a type when accessed using an index.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess" }, "noUnusedLocals": { "description": "Enable error reporting when a local variables aren't read.", @@ -173,12 +175,6 @@ "default": false, "markdownDescription": "Raise an error when a function parameter isn't read\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedParameters" }, - "noUncheckedIndexedAccess": { - "description": "Add `undefined` to a type when accessed using an index.", - "type": "boolean", - "default": false, - "markdownDescription": "Add `undefined` to a type when accessed using an index.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess" - }, "strict": { "description": "Enable all strict type checking options.", "type": "boolean", @@ -191,41 +187,49 @@ "default": true, "markdownDescription": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictBindCallApply" }, + "strictBuiltinIteratorReturn": { + "description": "Built-in iterators are instantiated with a `TReturn` type of undefined instead of `any`.", + "type": "boolean", + "default": true, + "markdownDescription": "Built-in iterators are instantiated with a `TReturn` type of undefined instead of `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig/#strictBuiltinIteratorReturn" + }, "strictFunctionTypes": { "description": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.", "type": "boolean", "default": true, "markdownDescription": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictFunctionTypes" }, - "strictPropertyInitialization": { - "description": "Check for class properties that are declared but not set in the constructor.", - "type": "boolean", - "default": true, - "markdownDescription": "Check for class properties that are declared but not set in the constructor.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictPropertyInitialization" - }, "strictNullChecks": { "description": "When type checking, take into account `null` and `undefined`.", "type": "boolean", "default": true, "markdownDescription": "When type checking, take into account `null` and `undefined`.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictNullChecks" }, - "suppressExcessPropertyErrors": { - "description": "Disable reporting of excess property errors during the creation of object literals.", + "strictPropertyInitialization": { + "description": "Check for class properties that are declared but not set in the constructor.", "type": "boolean", - "default": false, - "markdownDescription": "Disable reporting of excess property errors during the creation of object literals.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressExcessPropertyErrors" + "default": true, + "markdownDescription": "Check for class properties that are declared but not set in the constructor.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictPropertyInitialization" }, - "suppressImplicitAnyIndexErrors": { - "description": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.", - "type": "boolean", - "default": false, - "markdownDescription": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressImplicitAnyIndexErrors" + "types": { + "description": "Specify type package names to be included without being referenced in a source file.", + "type": "array", + "items": { + "type": "string" + }, + "markdownDescription": "Specify type package names to be included without being referenced in a source file.\n\nSee more: https://www.typescriptlang.org/tsconfig/#types" }, "useUnknownInCatchVariables": { "description": "Default catch clause variables as `unknown` instead of `any`.", "type": "boolean", "default": true, "markdownDescription": "Default catch clause variables as `unknown` instead of `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables" + }, + "verbatimModuleSyntax": { + "description": "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting.", + "type": "boolean", + "default": false, + "markdownDescription": "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting.\n\nSee more: https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax" } } }, From a7ac89935b092f86245ce0370042f4bef14ad82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 23 Sep 2024 17:01:04 +0100 Subject: [PATCH 07/17] feat(fmt): stabilize CSS, HTML and YAML formatters (#25753) This commits stabilizes CSS, HTML and YAML formatters in `deno fmt`. It is no longer required to use either of these flags: - `--unstable-css` - `--unstable-html` - `--unstable-yaml` Or these `unstable` options in the config file: - `fmt-css` - `fmt-html` - `html-yaml` --- cli/args/flags.rs | 48 ++------------ cli/args/mod.rs | 12 ---- cli/lsp/language_server.rs | 9 --- cli/tools/fmt.rs | 64 +++++-------------- tests/integration/lsp_tests.rs | 21 ------ tests/specs/fmt/css/__test__.jsonc | 5 ++ .../{unstable_css => css}/badly_formatted.css | 0 tests/specs/fmt/html/__test__.jsonc | 5 ++ .../badly_formatted.html | 0 .../fmt/unstable_component/__test__.jsonc | 4 +- tests/specs/fmt/unstable_css/__test__.jsonc | 25 -------- tests/specs/fmt/unstable_html/__test__.jsonc | 25 -------- tests/specs/fmt/unstable_yaml/__test__.jsonc | 25 -------- tests/specs/fmt/yaml/__test__.jsonc | 5 ++ .../badly_formatted.yml | 0 15 files changed, 39 insertions(+), 209 deletions(-) create mode 100644 tests/specs/fmt/css/__test__.jsonc rename tests/specs/fmt/{unstable_css => css}/badly_formatted.css (100%) create mode 100644 tests/specs/fmt/html/__test__.jsonc rename tests/specs/fmt/{unstable_html => html}/badly_formatted.html (100%) delete mode 100644 tests/specs/fmt/unstable_css/__test__.jsonc delete mode 100644 tests/specs/fmt/unstable_html/__test__.jsonc delete mode 100644 tests/specs/fmt/unstable_yaml/__test__.jsonc create mode 100644 tests/specs/fmt/yaml/__test__.jsonc rename tests/specs/fmt/{unstable_yaml => yaml}/badly_formatted.yml (100%) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index a5ca78accc..8490fdab65 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -206,10 +206,7 @@ pub struct FmtFlags { pub prose_wrap: Option, pub no_semicolons: Option, pub watch: Option, - pub unstable_css: bool, - pub unstable_html: bool, pub unstable_component: bool, - pub unstable_yaml: bool, } impl FmtFlags { @@ -2219,7 +2216,8 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .help("Enable formatting CSS, SCSS, Sass and Less files") .value_parser(FalseyValueParser::new()) .action(ArgAction::SetTrue) - .help_heading(FMT_HEADING), + .help_heading(FMT_HEADING) + .hide(true), ) .arg( Arg::new("unstable-html") @@ -2227,7 +2225,8 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .help("Enable formatting HTML files") .value_parser(FalseyValueParser::new()) .action(ArgAction::SetTrue) - .help_heading(FMT_HEADING), + .help_heading(FMT_HEADING) + .hide(true), ) .arg( Arg::new("unstable-component") @@ -2243,7 +2242,8 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .help("Enable formatting YAML files") .value_parser(FalseyValueParser::new()) .action(ArgAction::SetTrue) - .help_heading(FMT_HEADING), + .help_heading(FMT_HEADING) + .hide(true), ) }) } @@ -4374,10 +4374,7 @@ fn fmt_parse( let single_quote = matches.remove_one::("single-quote"); let prose_wrap = matches.remove_one::("prose-wrap"); let no_semicolons = matches.remove_one::("no-semicolons"); - let unstable_css = matches.get_flag("unstable-css"); - let unstable_html = matches.get_flag("unstable-html"); let unstable_component = matches.get_flag("unstable-component"); - let unstable_yaml = matches.get_flag("unstable-yaml"); flags.subcommand = DenoSubcommand::Fmt(FmtFlags { check: matches.get_flag("check"), @@ -4389,10 +4386,7 @@ fn fmt_parse( prose_wrap, no_semicolons, watch: watch_arg_parse(matches)?, - unstable_css, - unstable_html, unstable_component, - unstable_yaml, }); Ok(()) } @@ -6272,10 +6266,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() @@ -6298,10 +6289,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() @@ -6324,10 +6312,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() @@ -6350,10 +6335,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Some(Default::default()), }), ..Flags::default() @@ -6385,10 +6367,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: true, - unstable_html: true, unstable_component: true, - unstable_yaml: true, watch: Some(WatchFlags { hmr: false, no_clear_screen: true, @@ -6422,10 +6401,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Some(Default::default()), }), ..Flags::default() @@ -6448,10 +6424,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), @@ -6482,10 +6455,7 @@ mod tests { single_quote: None, prose_wrap: None, no_semicolons: None, - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Some(Default::default()), }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), @@ -6521,10 +6491,7 @@ mod tests { single_quote: Some(true), prose_wrap: Some("never".to_string()), no_semicolons: Some(true), - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() @@ -6554,10 +6521,7 @@ mod tests { single_quote: Some(false), prose_wrap: None, no_semicolons: Some(false), - unstable_css: false, - unstable_html: false, unstable_component: false, - unstable_yaml: false, watch: Default::default(), }), ..Flags::default() diff --git a/cli/args/mod.rs b/cli/args/mod.rs index c4dda95ce4..cec1b53b2d 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -281,10 +281,7 @@ impl BenchOptions { #[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct UnstableFmtOptions { - pub css: bool, - pub html: bool, pub component: bool, - pub yaml: bool, } #[derive(Clone, Debug)] @@ -317,10 +314,7 @@ impl FmtOptions { Self { options: resolve_fmt_options(fmt_flags, fmt_config.options), unstable: UnstableFmtOptions { - css: unstable.css || fmt_flags.unstable_css, - html: unstable.html || fmt_flags.unstable_html, component: unstable.component || fmt_flags.unstable_component, - yaml: unstable.yaml || fmt_flags.unstable_yaml, }, files: fmt_config.files, } @@ -1301,10 +1295,7 @@ impl CliOptions { pub fn resolve_config_unstable_fmt_options(&self) -> UnstableFmtOptions { let workspace = self.workspace(); UnstableFmtOptions { - css: workspace.has_unstable("fmt-css"), - html: workspace.has_unstable("fmt-html"), component: workspace.has_unstable("fmt-component"), - yaml: workspace.has_unstable("fmt-yaml"), } } @@ -1609,10 +1600,7 @@ impl CliOptions { "sloppy-imports", "byonm", "bare-node-builtins", - "fmt-css", - "fmt-html", "fmt-component", - "fmt-yaml", ]); // add more unstable flags to the same vector holding granular flags all_valid_unstable_flags.append(&mut another_unstable_flags); diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index f8fffd2929..a1cc5079d4 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -1385,18 +1385,9 @@ impl Inner { .data_for_specifier(&specifier) .map(|d| &d.member_dir.workspace); let unstable_options = UnstableFmtOptions { - css: maybe_workspace - .map(|w| w.has_unstable("fmt-css")) - .unwrap_or(false), - html: maybe_workspace - .map(|w| w.has_unstable("fmt-html")) - .unwrap_or(false), component: maybe_workspace .map(|w| w.has_unstable("fmt-component")) .unwrap_or(false), - yaml: maybe_workspace - .map(|w| w.has_unstable("fmt-yaml")) - .unwrap_or(false), }; let document = document.clone(); move || { diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index a51a2dfc62..54713e0ec7 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -285,19 +285,9 @@ fn format_markdown( dprint_plugin_json::format_text(&fake_filename, text, &json_config) } "css" | "scss" | "sass" | "less" => { - if unstable_options.css { - format_css(&fake_filename, text, fmt_options) - } else { - Ok(None) - } - } - "html" => { - if unstable_options.html { - format_html(&fake_filename, text, fmt_options) - } else { - Ok(None) - } + format_css(&fake_filename, text, fmt_options) } + "html" => format_html(&fake_filename, text, fmt_options), "svelte" | "vue" | "astro" => { if unstable_options.component { format_html(&fake_filename, text, fmt_options) @@ -305,18 +295,12 @@ fn format_markdown( Ok(None) } } - "yml" | "yaml" => { - if unstable_options.yaml { - pretty_yaml::format_text( - text, - &get_resolved_yaml_config(fmt_options), - ) - .map(Some) - .map_err(AnyError::from) - } else { - Ok(None) - } - } + "yml" | "yaml" => pretty_yaml::format_text( + text, + &get_resolved_yaml_config(fmt_options), + ) + .map(Some) + .map_err(AnyError::from), _ => { let mut codeblock_config = get_resolved_typescript_config(fmt_options); @@ -473,19 +457,9 @@ pub fn format_file( } "json" | "jsonc" => format_json(file_path, file_text, fmt_options), "css" | "scss" | "sass" | "less" => { - if unstable_options.css { - format_css(file_path, file_text, fmt_options) - } else { - Ok(None) - } - } - "html" => { - if unstable_options.html { - format_html(file_path, file_text, fmt_options) - } else { - Ok(None) - } + format_css(file_path, file_text, fmt_options) } + "html" => format_html(file_path, file_text, fmt_options), "svelte" | "vue" | "astro" => { if unstable_options.component { format_html(file_path, file_text, fmt_options) @@ -493,18 +467,12 @@ pub fn format_file( Ok(None) } } - "yml" | "yaml" => { - if unstable_options.yaml { - pretty_yaml::format_text( - file_text, - &get_resolved_yaml_config(fmt_options), - ) - .map(Some) - .map_err(AnyError::from) - } else { - Ok(None) - } - } + "yml" | "yaml" => pretty_yaml::format_text( + file_text, + &get_resolved_yaml_config(fmt_options), + ) + .map(Some) + .map_err(AnyError::from), "ipynb" => dprint_plugin_jupyter::format_text( file_text, |file_path: &Path, file_text: String| { diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index f2c40f8ea6..2d8d88b276 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -10597,13 +10597,6 @@ fn lsp_format_markdown() { fn lsp_format_html() { let context = TestContextBuilder::new().use_temp_cwd().build(); let temp_dir = context.temp_dir(); - temp_dir.write( - "deno.json", - json!({ - "unstable": ["fmt-html"], - }) - .to_string(), - ); let html_file = source_file(temp_dir.path().join("file.html"), " "); let mut client = context.new_lsp_command().build(); @@ -10644,13 +10637,6 @@ fn lsp_format_html() { fn lsp_format_css() { let context = TestContextBuilder::new().use_temp_cwd().build(); let temp_dir = context.temp_dir(); - temp_dir.write( - "deno.json", - json!({ - "unstable": ["fmt-css"], - }) - .to_string(), - ); let css_file = source_file(temp_dir.path().join("file.css"), " foo {}"); let mut client = context.new_lsp_command().build(); client.initialize_default(); @@ -10690,13 +10676,6 @@ fn lsp_format_css() { fn lsp_format_yaml() { let context = TestContextBuilder::new().use_temp_cwd().build(); let temp_dir = context.temp_dir(); - temp_dir.write( - "deno.json", - json!({ - "unstable": ["fmt-yaml"], - }) - .to_string(), - ); let yaml_file = source_file(temp_dir.path().join("file.yaml"), " foo: 1"); let mut client = context.new_lsp_command().build(); client.initialize_default(); diff --git a/tests/specs/fmt/css/__test__.jsonc b/tests/specs/fmt/css/__test__.jsonc new file mode 100644 index 0000000000..e58818fbe5 --- /dev/null +++ b/tests/specs/fmt/css/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "fmt", + "output": "[WILDLINE]badly_formatted.css\nChecked 1 file\n" +} diff --git a/tests/specs/fmt/unstable_css/badly_formatted.css b/tests/specs/fmt/css/badly_formatted.css similarity index 100% rename from tests/specs/fmt/unstable_css/badly_formatted.css rename to tests/specs/fmt/css/badly_formatted.css diff --git a/tests/specs/fmt/html/__test__.jsonc b/tests/specs/fmt/html/__test__.jsonc new file mode 100644 index 0000000000..cec29d1b3b --- /dev/null +++ b/tests/specs/fmt/html/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "fmt --unstable-html", + "output": "[WILDLINE]badly_formatted.html\nChecked 1 file\n" +} diff --git a/tests/specs/fmt/unstable_html/badly_formatted.html b/tests/specs/fmt/html/badly_formatted.html similarity index 100% rename from tests/specs/fmt/unstable_html/badly_formatted.html rename to tests/specs/fmt/html/badly_formatted.html diff --git a/tests/specs/fmt/unstable_component/__test__.jsonc b/tests/specs/fmt/unstable_component/__test__.jsonc index a8f8697da6..36057cbefa 100644 --- a/tests/specs/fmt/unstable_component/__test__.jsonc +++ b/tests/specs/fmt/unstable_component/__test__.jsonc @@ -6,14 +6,14 @@ "output": "Checked 1 file\n" }, "flag": { - "args": "fmt --unstable-css --unstable-component", + "args": "fmt --unstable-component", "output": "[WILDLINE]badly_formatted.svelte\nChecked 1 file\n" }, "config_file": { "steps": [{ "args": [ "eval", - "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-css\", \"fmt-component\"]\\n}\\n')" + "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-component\"]\\n}\\n')" ], "output": "[WILDCARD]" }, { diff --git a/tests/specs/fmt/unstable_css/__test__.jsonc b/tests/specs/fmt/unstable_css/__test__.jsonc deleted file mode 100644 index 32259f3ae4..0000000000 --- a/tests/specs/fmt/unstable_css/__test__.jsonc +++ /dev/null @@ -1,25 +0,0 @@ -{ - "tempDir": true, - "tests": { - "nothing": { - "args": "fmt", - "output": "Checked 1 file\n" - }, - "flag": { - "args": "fmt --unstable-css", - "output": "[WILDLINE]badly_formatted.css\nChecked 1 file\n" - }, - "config_file": { - "steps": [{ - "args": [ - "eval", - "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-css\"]\\n}\\n')" - ], - "output": "[WILDCARD]" - }, { - "args": "fmt", - "output": "[WILDLINE]badly_formatted.css\nChecked 2 files\n" - }] - } - } -} diff --git a/tests/specs/fmt/unstable_html/__test__.jsonc b/tests/specs/fmt/unstable_html/__test__.jsonc deleted file mode 100644 index 2394805ade..0000000000 --- a/tests/specs/fmt/unstable_html/__test__.jsonc +++ /dev/null @@ -1,25 +0,0 @@ -{ - "tempDir": true, - "tests": { - "nothing": { - "args": "fmt", - "output": "Checked 1 file\n" - }, - "flag": { - "args": "fmt --unstable-css --unstable-html", - "output": "[WILDLINE]badly_formatted.html\nChecked 1 file\n" - }, - "config_file": { - "steps": [{ - "args": [ - "eval", - "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-css\", \"fmt-html\"]\\n}\\n')" - ], - "output": "[WILDCARD]" - }, { - "args": "fmt", - "output": "[WILDLINE]badly_formatted.html\nChecked 2 files\n" - }] - } - } -} diff --git a/tests/specs/fmt/unstable_yaml/__test__.jsonc b/tests/specs/fmt/unstable_yaml/__test__.jsonc deleted file mode 100644 index 885db59b98..0000000000 --- a/tests/specs/fmt/unstable_yaml/__test__.jsonc +++ /dev/null @@ -1,25 +0,0 @@ -{ - "tempDir": true, - "tests": { - "nothing": { - "args": "fmt", - "output": "Checked 1 file\n" - }, - "flag": { - "args": "fmt --unstable-yaml", - "output": "[WILDLINE]badly_formatted.yml\nChecked 1 file\n" - }, - "config_file": { - "steps": [{ - "args": [ - "eval", - "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-yaml\"]\\n}\\n')" - ], - "output": "[WILDCARD]" - }, { - "args": "fmt", - "output": "[WILDLINE]badly_formatted.yml\nChecked 2 files\n" - }] - } - } -} \ No newline at end of file diff --git a/tests/specs/fmt/yaml/__test__.jsonc b/tests/specs/fmt/yaml/__test__.jsonc new file mode 100644 index 0000000000..3cef276b81 --- /dev/null +++ b/tests/specs/fmt/yaml/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "fmt", + "output": "[WILDLINE]badly_formatted.yml\nChecked 1 file\n" +} \ No newline at end of file diff --git a/tests/specs/fmt/unstable_yaml/badly_formatted.yml b/tests/specs/fmt/yaml/badly_formatted.yml similarity index 100% rename from tests/specs/fmt/unstable_yaml/badly_formatted.yml rename to tests/specs/fmt/yaml/badly_formatted.yml From 1287739ddfa659c0b2bd88930eb10e9469b59099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Otero?= Date: Mon, 23 Sep 2024 20:27:58 +0200 Subject: [PATCH 08/17] feat(fmt): support vto and njk extensions (#25831) Fixes #25802 markup_fmt plugin supports some HTML-like formats like Angular, Jinja, Twig, Nunjucks or Vento, that are not supported by `deno fmt`. This PR adds support for the extensions `njk` (Nunjucks) and `vto` (Vento). Angular doesn't have a custom extension (it uses `html` afaik) and Jinja and Twig are template engines written in Python and PHP respectively so it doesn't make sense to be supported by Deno. --- cli/tools/fmt.rs | 12 ++++++++++-- tests/specs/fmt/njk/__test__.jsonc | 5 +++++ tests/specs/fmt/njk/badly_formatted.njk | 3 +++ tests/specs/fmt/vento/__test__.jsonc | 5 +++++ tests/specs/fmt/vento/badly_formatted.vto | 3 +++ 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 tests/specs/fmt/njk/__test__.jsonc create mode 100644 tests/specs/fmt/njk/badly_formatted.njk create mode 100644 tests/specs/fmt/vento/__test__.jsonc create mode 100644 tests/specs/fmt/vento/badly_formatted.vto diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 54713e0ec7..489f36f533 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -265,6 +265,8 @@ fn format_markdown( | "svelte" | "vue" | "astro" + | "vto" + | "njk" | "yml" | "yaml" ) { @@ -288,7 +290,7 @@ fn format_markdown( format_css(&fake_filename, text, fmt_options) } "html" => format_html(&fake_filename, text, fmt_options), - "svelte" | "vue" | "astro" => { + "svelte" | "vue" | "astro" | "vto" | "njk" => { if unstable_options.component { format_html(&fake_filename, text, fmt_options) } else { @@ -460,7 +462,7 @@ pub fn format_file( format_css(file_path, file_text, fmt_options) } "html" => format_html(file_path, file_text, fmt_options), - "svelte" | "vue" | "astro" => { + "svelte" | "vue" | "astro" | "vto" | "njk" => { if unstable_options.component { format_html(file_path, file_text, fmt_options) } else { @@ -1139,6 +1141,8 @@ fn is_supported_ext_fmt(path: &Path) -> bool { | "svelte" | "vue" | "astro" + | "vto" + | "njk" | "md" | "mkd" | "mkdn" @@ -1197,6 +1201,10 @@ mod test { assert!(is_supported_ext_fmt(Path::new("foo.VUE"))); assert!(is_supported_ext_fmt(Path::new("foo.astro"))); assert!(is_supported_ext_fmt(Path::new("foo.AsTrO"))); + assert!(is_supported_ext_fmt(Path::new("foo.vto"))); + assert!(is_supported_ext_fmt(Path::new("foo.Vto"))); + assert!(is_supported_ext_fmt(Path::new("foo.njk"))); + assert!(is_supported_ext_fmt(Path::new("foo.NJk"))); assert!(is_supported_ext_fmt(Path::new("foo.yml"))); assert!(is_supported_ext_fmt(Path::new("foo.Yml"))); assert!(is_supported_ext_fmt(Path::new("foo.yaml"))); diff --git a/tests/specs/fmt/njk/__test__.jsonc b/tests/specs/fmt/njk/__test__.jsonc new file mode 100644 index 0000000000..8b6bc87d47 --- /dev/null +++ b/tests/specs/fmt/njk/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "fmt --unstable-component", + "output": "[WILDLINE]badly_formatted.njk\nChecked 1 file\n" +} \ No newline at end of file diff --git a/tests/specs/fmt/njk/badly_formatted.njk b/tests/specs/fmt/njk/badly_formatted.njk new file mode 100644 index 0000000000..71b0578d15 --- /dev/null +++ b/tests/specs/fmt/njk/badly_formatted.njk @@ -0,0 +1,3 @@ +

{{ "Hello, world!" | upper }} +

+ diff --git a/tests/specs/fmt/vento/__test__.jsonc b/tests/specs/fmt/vento/__test__.jsonc new file mode 100644 index 0000000000..c3e3bbf7d1 --- /dev/null +++ b/tests/specs/fmt/vento/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "fmt --unstable-component", + "output": "[WILDLINE]badly_formatted.vto\nChecked 1 file\n" +} \ No newline at end of file diff --git a/tests/specs/fmt/vento/badly_formatted.vto b/tests/specs/fmt/vento/badly_formatted.vto new file mode 100644 index 0000000000..ad46443904 --- /dev/null +++ b/tests/specs/fmt/vento/badly_formatted.vto @@ -0,0 +1,3 @@ +

{{ "Hello, world!" |> toUpperCase }} +

+ From e1c8d2755e23182875b8fefeb558e603dd981418 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 23 Sep 2024 14:46:50 -0400 Subject: [PATCH 09/17] BREAKING: remove support for remote import maps in deno.json (#25836) This is for security reasons for the time being for Deno 2. Details to follow post Deno 2.0 release. Remote import maps seem incredibly rare (only 2 usages on GitHub from what I can tell), so we'll add this back with more permissions if there's enough demand for it: https://github.com/search?type=code&q=%2F%22importMap%22%3A+%22http%2F In the meantime, use the `--import-map` flag and `"deno.importMap"` config in the LSP for remote import maps. --- Cargo.lock | 4 +- cli/Cargo.toml | 2 +- cli/args/mod.rs | 28 ++++---------- cli/lsp/config.rs | 71 +++++++++++++--------------------- tests/integration/lsp_tests.rs | 7 ---- 5 files changed, 37 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f514abb1a6..d06b23bed1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1375,9 +1375,9 @@ dependencies = [ [[package]] name = "deno_config" -version = "0.34.3" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187d7dd888a49bfda396632371139e940c5cf47b15bfcaeeb2ba50f82f6940ec" +checksum = "105864a9e0a7fbc22f1106784b2d263f402f157be1c3e1a9905f53d182700c9f" dependencies = [ "anyhow", "deno_package_json", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ad0a840fdd..d1f1dc5d53 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -65,7 +65,7 @@ winres.workspace = true [dependencies] deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] } deno_cache_dir = { workspace = true } -deno_config = { version = "=0.34.3", features = ["workspace", "sync"] } +deno_config = { version = "=0.35.0", features = ["workspace", "sync"] } deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_doc = { version = "0.148.0", features = ["html", "syntect"] } deno_graph = { version = "=0.82.1" } diff --git a/cli/args/mod.rs b/cli/args/mod.rs index cec1b53b2d..b8a05f325c 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1065,27 +1065,13 @@ impl CliOptions { None => None, } }; - Ok( - self - .workspace() - .create_resolver( - CreateResolverOptions { - pkg_json_dep_resolution, - specified_import_map: cli_arg_specified_import_map, - }, - |specifier| { - let specifier = specifier.clone(); - async move { - let file = file_fetcher - .fetch_bypass_permissions(&specifier) - .await? - .into_text_decoded()?; - Ok(file.source.to_string()) - } - }, - ) - .await?, - ) + Ok(self.workspace().create_resolver( + CreateResolverOptions { + pkg_json_dep_resolution, + specified_import_map: cli_arg_specified_import_map, + }, + |path| Ok(std::fs::read_to_string(path)?), + )?) } pub fn node_ipc_fd(&self) -> Option { diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index 94fdff1674..e55e7b734d 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -1451,9 +1451,10 @@ impl ConfigData { // Mark the import map as a watched file if let Some(import_map_specifier) = member_dir .workspace - .to_import_map_specifier() + .to_import_map_path() .ok() .flatten() + .and_then(|path| Url::from_file_path(path).ok()) { add_watched_file( import_map_specifier.clone(), @@ -1542,50 +1543,32 @@ impl ConfigData { None } }; - let resolver = deno_core::unsync::spawn({ - let workspace = member_dir.workspace.clone(); - let file_fetcher = file_fetcher.cloned(); - async move { - workspace - .create_resolver( - CreateResolverOptions { - pkg_json_dep_resolution, - specified_import_map, - }, - move |specifier| { - let specifier = specifier.clone(); - let file_fetcher = file_fetcher.clone().unwrap(); - async move { - let file = file_fetcher - .fetch_bypass_permissions(&specifier) - .await? - .into_text_decoded()?; - Ok(file.source.to_string()) - } - }, - ) - .await - .inspect_err(|err| { - lsp_warn!( - " Failed to load resolver: {}", - err // will contain the specifier - ); - }) - .ok() - } - }) - .await - .unwrap() - .unwrap_or_else(|| { - // create a dummy resolver - WorkspaceResolver::new_raw( - scope.clone(), - None, - member_dir.workspace.resolver_jsr_pkgs().collect(), - member_dir.workspace.package_jsons().cloned().collect(), - pkg_json_dep_resolution, + let resolver = member_dir + .workspace + .create_resolver( + CreateResolverOptions { + pkg_json_dep_resolution, + specified_import_map, + }, + |path| Ok(std::fs::read_to_string(path)?), ) - }); + .inspect_err(|err| { + lsp_warn!( + " Failed to load resolver: {}", + err // will contain the specifier + ); + }) + .ok() + .unwrap_or_else(|| { + // create a dummy resolver + WorkspaceResolver::new_raw( + scope.clone(), + None, + member_dir.workspace.resolver_jsr_pkgs().collect(), + member_dir.workspace.package_jsons().cloned().collect(), + pkg_json_dep_resolution, + ) + }); if !resolver.diagnostics().is_empty() { lsp_warn!( " Import map diagnostics:\n{}", diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 2d8d88b276..a0368d8d1f 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -363,13 +363,6 @@ fn lsp_import_map_remote() { .use_temp_cwd() .build(); let temp_dir = context.temp_dir(); - temp_dir.write( - "deno.json", - json!({ - "importMap": "http://localhost:4545/import_maps/import_map_remote.json", - }) - .to_string(), - ); temp_dir.write( "file.ts", r#" From 33f169beb90814b7f2f62a8c0e3990722ae3db4c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 23 Sep 2024 15:18:52 -0400 Subject: [PATCH 10/17] chore: add code generation for @types/deno (#25545) --- cli/tsc/dts/lib.deno.ns.d.ts | 21 +- cli/tsc/dts/lib.deno.shared_globals.d.ts | 42 ++-- cli/tsc/dts/lib.deno.unstable.d.ts | 62 ++--- cli/tsc/dts/lib.deno.window.d.ts | 8 +- cli/tsc/dts/lib.deno_webgpu.d.ts | 212 +++++++++--------- .../lib.deno_broadcast_channel.d.ts | 4 +- ext/cache/lib.deno_cache.d.ts | 6 +- ext/canvas/lib.deno_canvas.d.ts | 14 +- ext/console/lib.deno_console.d.ts | 2 +- ext/crypto/lib.deno_crypto.d.ts | 75 ++++--- ext/fetch/lib.deno_fetch.d.ts | 44 ++-- ext/net/lib.deno_net.d.ts | 2 + ext/url/lib.deno_url.d.ts | 16 +- ext/web/06_streams_types.d.ts | 7 +- ext/web/lib.deno_web.d.ts | 188 ++++++++-------- ext/websocket/lib.deno_websocket.d.ts | 10 +- ext/webstorage/lib.deno_webstorage.d.ts | 2 +- tools/generate_types_deno.ts | 100 +++++++++ tools/jsdoc_checker.js | 26 ++- 19 files changed, 485 insertions(+), 356 deletions(-) create mode 100755 tools/generate_types_deno.ts diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index f44bf9a02b..3cca95cdfd 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -10,7 +10,7 @@ * * @category Platform */ -declare interface ImportMeta { +interface ImportMeta { /** A string representation of the fully qualified module URL. When the * module is loaded locally, the value will be a file URL (e.g. * `file:///path/module.ts`). @@ -89,7 +89,7 @@ declare interface ImportMeta { * * @category Performance */ -declare interface Performance { +interface Performance { /** Stores a timestamp with the associated name (a "mark"). */ mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark; @@ -109,7 +109,7 @@ declare interface Performance { * * @category Performance */ -declare interface PerformanceMarkOptions { +interface PerformanceMarkOptions { /** Metadata to be included in the mark. */ // deno-lint-ignore no-explicit-any detail?: any; @@ -126,7 +126,7 @@ declare interface PerformanceMarkOptions { * * @category Performance */ -declare interface PerformanceMeasureOptions { +interface PerformanceMeasureOptions { /** Metadata to be included in the measure. */ // deno-lint-ignore no-explicit-any detail?: any; @@ -317,6 +317,7 @@ declare namespace Deno { * * @category Errors */ export class NotADirectory extends Error {} + /** * Raised when trying to perform an operation while the relevant Deno * permission (like `--allow-read`) has not been granted. @@ -326,6 +327,8 @@ declare namespace Deno { * * @category Errors */ export class NotCapable extends Error {} + + export {}; // only export exports } /** The current process ID of this instance of the Deno CLI. @@ -5407,7 +5410,9 @@ declare namespace Deno { * * @category FFI */ - export type NativeStructType = { readonly struct: readonly NativeType[] }; + export interface NativeStructType { + readonly struct: readonly NativeType[]; + } /** * @category FFI @@ -5700,7 +5705,9 @@ declare namespace Deno { * * @category FFI */ - export type PointerObject = { [brand]: T }; + export interface PointerObject { + [brand]: T; + } /** Pointers are represented either with a {@linkcode PointerObject} * object or a `null` if the pointer is null. @@ -6137,4 +6144,6 @@ declare namespace Deno { | CreateHttpClientOptions | (CreateHttpClientOptions & TlsCertifiedKeyPem), ): HttpClient; + + export {}; // only export exports } diff --git a/cli/tsc/dts/lib.deno.shared_globals.d.ts b/cli/tsc/dts/lib.deno.shared_globals.d.ts index b907a4e9aa..ba872ef46e 100644 --- a/cli/tsc/dts/lib.deno.shared_globals.d.ts +++ b/cli/tsc/dts/lib.deno.shared_globals.d.ts @@ -413,7 +413,7 @@ declare function clearInterval(id?: number): void; declare function clearTimeout(id?: number): void; /** @category Platform */ -declare interface VoidFunction { +interface VoidFunction { (): void; } @@ -445,7 +445,7 @@ declare function queueMicrotask(func: VoidFunction): void; declare function dispatchEvent(event: Event): boolean; /** @category Platform */ -declare interface DOMStringList { +interface DOMStringList { /** Returns the number of strings in strings. */ readonly length: number; /** Returns true if strings contains string, and false otherwise. */ @@ -456,13 +456,13 @@ declare interface DOMStringList { } /** @category Platform */ -declare type BufferSource = ArrayBufferView | ArrayBuffer; +type BufferSource = ArrayBufferView | ArrayBuffer; /** @category I/O */ declare var console: Console; /** @category Events */ -declare interface ErrorEventInit extends EventInit { +interface ErrorEventInit extends EventInit { message?: string; filename?: string; lineno?: number; @@ -471,7 +471,7 @@ declare interface ErrorEventInit extends EventInit { } /** @category Events */ -declare interface ErrorEvent extends Event { +interface ErrorEvent extends Event { readonly message: string; readonly filename: string; readonly lineno: number; @@ -486,13 +486,13 @@ declare var ErrorEvent: { }; /** @category Events */ -declare interface PromiseRejectionEventInit extends EventInit { +interface PromiseRejectionEventInit extends EventInit { promise: Promise; reason?: any; } /** @category Events */ -declare interface PromiseRejectionEvent extends Event { +interface PromiseRejectionEvent extends Event { readonly promise: Promise; readonly reason: any; } @@ -507,24 +507,24 @@ declare var PromiseRejectionEvent: { }; /** @category Workers */ -declare interface AbstractWorkerEventMap { +interface AbstractWorkerEventMap { "error": ErrorEvent; } /** @category Workers */ -declare interface WorkerEventMap extends AbstractWorkerEventMap { +interface WorkerEventMap extends AbstractWorkerEventMap { "message": MessageEvent; "messageerror": MessageEvent; } /** @category Workers */ -declare interface WorkerOptions { +interface WorkerOptions { type?: "classic" | "module"; name?: string; } /** @category Workers */ -declare interface Worker extends EventTarget { +interface Worker extends EventTarget { onerror: (this: Worker, e: ErrorEvent) => any | null; onmessage: (this: Worker, e: MessageEvent) => any | null; onmessageerror: (this: Worker, e: MessageEvent) => any | null; @@ -560,10 +560,10 @@ declare var Worker: { }; /** @category Performance */ -declare type PerformanceEntryList = PerformanceEntry[]; +type PerformanceEntryList = PerformanceEntry[]; /** @category Performance */ -declare interface Performance extends EventTarget { +interface Performance extends EventTarget { /** Returns a timestamp representing the start of the performance measurement. */ readonly timeOrigin: number; @@ -617,7 +617,7 @@ declare var Performance: { declare var performance: Performance; /** @category Performance */ -declare interface PerformanceMarkOptions { +interface PerformanceMarkOptions { /** Metadata to be included in the mark. */ detail?: any; @@ -626,7 +626,7 @@ declare interface PerformanceMarkOptions { } /** @category Performance */ -declare interface PerformanceMeasureOptions { +interface PerformanceMeasureOptions { /** Metadata to be included in the measure. */ detail?: any; @@ -648,7 +648,7 @@ declare interface PerformanceMeasureOptions { * * @category Performance */ -declare interface PerformanceEntry { +interface PerformanceEntry { readonly duration: number; readonly entryType: string; readonly name: string; @@ -675,7 +675,7 @@ declare var PerformanceEntry: { * * @category Performance */ -declare interface PerformanceMark extends PerformanceEntry { +interface PerformanceMark extends PerformanceEntry { readonly detail: any; readonly entryType: "mark"; } @@ -699,7 +699,7 @@ declare var PerformanceMark: { * * @category Performance */ -declare interface PerformanceMeasure extends PerformanceEntry { +interface PerformanceMeasure extends PerformanceEntry { readonly detail: any; readonly entryType: "measure"; } @@ -717,12 +717,12 @@ declare var PerformanceMeasure: { }; /** @category Events */ -declare interface CustomEventInit extends EventInit { +interface CustomEventInit extends EventInit { detail?: T; } /** @category Events */ -declare interface CustomEvent extends Event { +interface CustomEvent extends Event { /** Returns any custom data event was created with. Typically used for * synthetic events. */ readonly detail: T; @@ -735,7 +735,7 @@ declare var CustomEvent: { }; /** @category Platform */ -declare interface ErrorConstructor { +interface ErrorConstructor { /** See https://v8.dev/docs/stack-trace-api#stack-trace-collection-for-custom-exceptions. */ captureStackTrace(error: Object, constructor?: Function): void; // TODO(nayeemrmn): Support `Error.prepareStackTrace()`. We currently use this diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index cafa539b53..973a09d92a 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -212,7 +212,7 @@ declare namespace Deno { * @category Cloud * @experimental */ - export function openKv(path?: string): Promise; + export function openKv(path?: string): Promise; /** **UNSTABLE**: New API, yet to be vetted. * @@ -475,7 +475,11 @@ declare namespace Deno { * @category Cloud * @experimental */ - export type KvEntry = { key: KvKey; value: T; versionstamp: string }; + export interface KvEntry { + key: KvKey; + value: T; + versionstamp: string; + } /** * **UNSTABLE**: New API, yet to be vetted. @@ -680,7 +684,7 @@ declare namespace Deno { value: unknown, options?: { delay?: number; - keysIfUndelivered?: Deno.KvKey[]; + keysIfUndelivered?: KvKey[]; backoffSchedule?: number[]; }, ): this; @@ -911,7 +915,7 @@ declare namespace Deno { value: unknown, options?: { delay?: number; - keysIfUndelivered?: Deno.KvKey[]; + keysIfUndelivered?: KvKey[]; backoffSchedule?: number[]; }, ): Promise; @@ -1041,10 +1045,10 @@ declare namespace Deno { * @category Jupyter * @experimental */ - export type VegaObject = { + export interface VegaObject { $schema: string; [key: string]: unknown; - }; + } /** * A collection of supported media types and data for Jupyter frontends. @@ -1052,7 +1056,7 @@ declare namespace Deno { * @category Jupyter * @experimental */ - export type MediaBundle = { + export interface MediaBundle { "text/plain"?: string; "text/html"?: string; "image/svg+xml"?: string; @@ -1078,7 +1082,7 @@ declare namespace Deno { // Must support a catch all for custom media types / mimetypes [key: string]: string | object | undefined; - }; + } /** * @category Jupyter @@ -1090,9 +1094,9 @@ declare namespace Deno { * @category Jupyter * @experimental */ - export type Displayable = { + export interface Displayable { [$display]: () => MediaBundle | Promise; - }; + } /** * Display function for Jupyter Deno Kernel. @@ -1217,7 +1221,11 @@ declare namespace Deno { buffers?: Uint8Array[]; }, ): Promise; + + export {}; // only export exports } + + export {}; // only export exports } /** **UNSTABLE**: New API, yet to be vetted. @@ -1225,7 +1233,7 @@ declare namespace Deno { * @category Workers * @experimental */ -declare interface WorkerOptions { +interface WorkerOptions { /** **UNSTABLE**: New API, yet to be vetted. * * Configure permissions options to change the level of access the worker will @@ -1266,7 +1274,7 @@ declare interface WorkerOptions { * @category WebSockets * @experimental */ -declare interface WebSocketStreamOptions { +interface WebSocketStreamOptions { protocols?: string[]; signal?: AbortSignal; headers?: HeadersInit; @@ -1277,7 +1285,7 @@ declare interface WebSocketStreamOptions { * @category WebSockets * @experimental */ -declare interface WebSocketConnection { +interface WebSocketConnection { readable: ReadableStream; writable: WritableStream; extensions: string; @@ -1289,7 +1297,7 @@ declare interface WebSocketConnection { * @category WebSockets * @experimental */ -declare interface WebSocketCloseInfo { +interface WebSocketCloseInfo { code?: number; reason?: string; } @@ -1300,7 +1308,7 @@ declare interface WebSocketCloseInfo { * @category WebSockets * @experimental */ -declare interface WebSocketStream { +interface WebSocketStream { url: string; opened: Promise; closed: Promise; @@ -1324,7 +1332,7 @@ declare var WebSocketStream: { * @category WebSockets * @experimental */ -declare interface WebSocketError extends DOMException { +interface WebSocketError extends DOMException { readonly closeCode: number; readonly reason: string; } @@ -2884,7 +2892,7 @@ declare namespace Temporal { * @category Temporal * @experimental */ -declare interface Date { +interface Date { toTemporalInstant(): Temporal.Instant; } @@ -2986,7 +2994,7 @@ declare namespace Intl { * @category Platform * @experimental */ -declare interface Float16Array { +interface Float16Array { /** * The size in bytes of each element in the array. */ @@ -3301,7 +3309,7 @@ declare interface Float16Array { * @category Platform * @experimental */ -declare interface Float16ArrayConstructor { +interface Float16ArrayConstructor { readonly prototype: Float16Array; new (length: number): Float16Array; new (array: ArrayLike | ArrayBufferLike): Float16Array; @@ -3350,7 +3358,7 @@ declare var Float16Array: Float16ArrayConstructor; * @category Platform * @experimental */ -declare interface Float16Array { +interface Float16Array { [Symbol.iterator](): IterableIterator; /** * Returns an array of key, value pairs for every entry in the array @@ -3370,7 +3378,7 @@ declare interface Float16Array { * @category Platform * @experimental */ -declare interface Float16Constructor { +interface Float16Constructor { new (elements: Iterable): Float16Array; /** @@ -3390,7 +3398,7 @@ declare interface Float16Constructor { * @category Platform * @experimental */ -declare interface Float16Array { +interface Float16Array { readonly [Symbol.toStringTag]: "Float16Array"; } @@ -3398,7 +3406,7 @@ declare interface Float16Array { * @category Platform * @experimental */ -declare interface Float16Array { +interface Float16Array { /** * Determines whether an array includes a certain element, returning true or false as appropriate. * @param searchElement The element to search for. @@ -3411,7 +3419,7 @@ declare interface Float16Array { * @category Platform * @experimental */ -declare interface Float16ArrayConstructor { +interface Float16ArrayConstructor { new (): Float16Array; } @@ -3419,7 +3427,7 @@ declare interface Float16ArrayConstructor { * @category Platform * @experimental */ -declare interface Float16Array { +interface Float16Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. @@ -3431,7 +3439,7 @@ declare interface Float16Array { * @category Platform * @experimental */ -declare interface Float16Array { +interface Float16Array { /** * Returns the value of the last element in the array where predicate is true, and undefined * otherwise. @@ -3507,7 +3515,7 @@ declare interface Float16Array { * @category Platform * @experimental */ -declare interface DataView { +interface DataView { /** * Gets the Float16 value at the specified byte offset from the start of the view. There is * no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/cli/tsc/dts/lib.deno.window.d.ts b/cli/tsc/dts/lib.deno.window.d.ts index 511bb04ad4..636e2b0fd0 100644 --- a/cli/tsc/dts/lib.deno.window.d.ts +++ b/cli/tsc/dts/lib.deno.window.d.ts @@ -8,14 +8,14 @@ /// /** @category Platform */ -declare interface WindowEventMap { +interface WindowEventMap { "error": ErrorEvent; "unhandledrejection": PromiseRejectionEvent; "rejectionhandled": PromiseRejectionEvent; } /** @category Platform */ -declare interface Window extends EventTarget { +interface Window extends EventTarget { readonly window: Window & typeof globalThis; readonly self: Window & typeof globalThis; onerror: ((this: Window, ev: ErrorEvent) => any) | null; @@ -105,7 +105,7 @@ declare var sessionStorage: Storage; declare var caches: CacheStorage; /** @category Platform */ -declare interface Navigator { +interface Navigator { readonly gpu: GPU; readonly hardwareConcurrency: number; readonly userAgent: string; @@ -221,7 +221,7 @@ declare function removeEventListener( * * @category Platform */ -declare interface Location { +interface Location { /** Returns a DOMStringList object listing the origins of the ancestor * browsing contexts, from the parent browsing context to the top-level * browsing context. diff --git a/cli/tsc/dts/lib.deno_webgpu.d.ts b/cli/tsc/dts/lib.deno_webgpu.d.ts index e8d8138238..2deb63abc7 100644 --- a/cli/tsc/dts/lib.deno_webgpu.d.ts +++ b/cli/tsc/dts/lib.deno_webgpu.d.ts @@ -6,12 +6,12 @@ /// /** @category GPU */ -declare interface GPUObjectBase { +interface GPUObjectBase { label: string; } /** @category GPU */ -declare interface GPUObjectDescriptorBase { +interface GPUObjectDescriptorBase { label?: string; } @@ -84,13 +84,13 @@ declare class GPU { } /** @category GPU */ -declare interface GPURequestAdapterOptions { +interface GPURequestAdapterOptions { powerPreference?: GPUPowerPreference; forceFallbackAdapter?: boolean; } /** @category GPU */ -declare type GPUPowerPreference = "low-power" | "high-performance"; +type GPUPowerPreference = "low-power" | "high-performance"; /** @category GPU */ declare class GPUAdapter { @@ -103,13 +103,13 @@ declare class GPUAdapter { } /** @category GPU */ -declare interface GPUDeviceDescriptor extends GPUObjectDescriptorBase { +interface GPUDeviceDescriptor extends GPUObjectDescriptorBase { requiredFeatures?: GPUFeatureName[]; requiredLimits?: Record; } /** @category GPU */ -declare type GPUFeatureName = +type GPUFeatureName = | "depth-clip-control" | "depth32float-stencil8" | "pipeline-statistics-query" @@ -206,20 +206,20 @@ declare class GPUBuffer implements GPUObjectBase { } /** @category GPU */ -declare type GPUBufferMapState = "unmapped" | "pending" | "mapped"; +type GPUBufferMapState = "unmapped" | "pending" | "mapped"; /** @category GPU */ -declare interface GPUBufferDescriptor extends GPUObjectDescriptorBase { +interface GPUBufferDescriptor extends GPUObjectDescriptorBase { size: number; usage: GPUBufferUsageFlags; mappedAtCreation?: boolean; } /** @category GPU */ -declare type GPUBufferUsageFlags = number; +type GPUBufferUsageFlags = number; /** @category GPU */ -declare type GPUFlagsConstant = number; +type GPUFlagsConstant = number; /** @category GPU */ declare class GPUBufferUsage { @@ -236,7 +236,7 @@ declare class GPUBufferUsage { } /** @category GPU */ -declare type GPUMapModeFlags = number; +type GPUMapModeFlags = number; /** @category GPU */ declare class GPUMapMode { @@ -262,7 +262,7 @@ declare class GPUTexture implements GPUObjectBase { } /** @category GPU */ -declare interface GPUTextureDescriptor extends GPUObjectDescriptorBase { +interface GPUTextureDescriptor extends GPUObjectDescriptorBase { size: GPUExtent3D; mipLevelCount?: number; sampleCount?: number; @@ -273,10 +273,10 @@ declare interface GPUTextureDescriptor extends GPUObjectDescriptorBase { } /** @category GPU */ -declare type GPUTextureDimension = "1d" | "2d" | "3d"; +type GPUTextureDimension = "1d" | "2d" | "3d"; /** @category GPU */ -declare type GPUTextureUsageFlags = number; +type GPUTextureUsageFlags = number; /** @category GPU */ declare class GPUTextureUsage { @@ -293,7 +293,7 @@ declare class GPUTextureView implements GPUObjectBase { } /** @category GPU */ -declare interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase { +interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase { format?: GPUTextureFormat; dimension?: GPUTextureViewDimension; aspect?: GPUTextureAspect; @@ -304,7 +304,7 @@ declare interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase { } /** @category GPU */ -declare type GPUTextureViewDimension = +type GPUTextureViewDimension = | "1d" | "2d" | "2d-array" @@ -313,10 +313,10 @@ declare type GPUTextureViewDimension = | "3d"; /** @category GPU */ -declare type GPUTextureAspect = "all" | "stencil-only" | "depth-only"; +type GPUTextureAspect = "all" | "stencil-only" | "depth-only"; /** @category GPU */ -declare type GPUTextureFormat = +type GPUTextureFormat = | "r8unorm" | "r8snorm" | "r8uint" @@ -419,7 +419,7 @@ declare class GPUSampler implements GPUObjectBase { } /** @category GPU */ -declare interface GPUSamplerDescriptor extends GPUObjectDescriptorBase { +interface GPUSamplerDescriptor extends GPUObjectDescriptorBase { addressModeU?: GPUAddressMode; addressModeV?: GPUAddressMode; addressModeW?: GPUAddressMode; @@ -433,16 +433,16 @@ declare interface GPUSamplerDescriptor extends GPUObjectDescriptorBase { } /** @category GPU */ -declare type GPUAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat"; +type GPUAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat"; /** @category GPU */ -declare type GPUFilterMode = "nearest" | "linear"; +type GPUFilterMode = "nearest" | "linear"; /** @category GPU */ -declare type GPUMipmapFilterMode = "nearest" | "linear"; +type GPUMipmapFilterMode = "nearest" | "linear"; /** @category GPU */ -declare type GPUCompareFunction = +type GPUCompareFunction = | "never" | "less" | "equal" @@ -458,12 +458,12 @@ declare class GPUBindGroupLayout implements GPUObjectBase { } /** @category GPU */ -declare interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase { +interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase { entries: GPUBindGroupLayoutEntry[]; } /** @category GPU */ -declare interface GPUBindGroupLayoutEntry { +interface GPUBindGroupLayoutEntry { binding: number; visibility: GPUShaderStageFlags; @@ -474,7 +474,7 @@ declare interface GPUBindGroupLayoutEntry { } /** @category GPU */ -declare type GPUShaderStageFlags = number; +type GPUShaderStageFlags = number; /** @category GPU */ declare class GPUShaderStage { @@ -484,35 +484,35 @@ declare class GPUShaderStage { } /** @category GPU */ -declare interface GPUBufferBindingLayout { +interface GPUBufferBindingLayout { type?: GPUBufferBindingType; hasDynamicOffset?: boolean; minBindingSize?: number; } /** @category GPU */ -declare type GPUBufferBindingType = "uniform" | "storage" | "read-only-storage"; +type GPUBufferBindingType = "uniform" | "storage" | "read-only-storage"; /** @category GPU */ -declare interface GPUSamplerBindingLayout { +interface GPUSamplerBindingLayout { type?: GPUSamplerBindingType; } /** @category GPU */ -declare type GPUSamplerBindingType = +type GPUSamplerBindingType = | "filtering" | "non-filtering" | "comparison"; /** @category GPU */ -declare interface GPUTextureBindingLayout { +interface GPUTextureBindingLayout { sampleType?: GPUTextureSampleType; viewDimension?: GPUTextureViewDimension; multisampled?: boolean; } /** @category GPU */ -declare type GPUTextureSampleType = +type GPUTextureSampleType = | "float" | "unfilterable-float" | "depth" @@ -520,13 +520,13 @@ declare type GPUTextureSampleType = | "uint"; /** @category GPU */ -declare type GPUStorageTextureAccess = +type GPUStorageTextureAccess = | "write-only" | "read-only" | "read-write"; /** @category GPU */ -declare interface GPUStorageTextureBindingLayout { +interface GPUStorageTextureBindingLayout { access: GPUStorageTextureAccess; format: GPUTextureFormat; viewDimension?: GPUTextureViewDimension; @@ -538,25 +538,25 @@ declare class GPUBindGroup implements GPUObjectBase { } /** @category GPU */ -declare interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase { +interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase { layout: GPUBindGroupLayout; entries: GPUBindGroupEntry[]; } /** @category GPU */ -declare type GPUBindingResource = +type GPUBindingResource = | GPUSampler | GPUTextureView | GPUBufferBinding; /** @category GPU */ -declare interface GPUBindGroupEntry { +interface GPUBindGroupEntry { binding: number; resource: GPUBindingResource; } /** @category GPU */ -declare interface GPUBufferBinding { +interface GPUBufferBinding { buffer: GPUBuffer; offset?: number; size?: number; @@ -568,15 +568,15 @@ declare class GPUPipelineLayout implements GPUObjectBase { } /** @category GPU */ -declare interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase { +interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase { bindGroupLayouts: GPUBindGroupLayout[]; } /** @category GPU */ -declare type GPUCompilationMessageType = "error" | "warning" | "info"; +type GPUCompilationMessageType = "error" | "warning" | "info"; /** @category GPU */ -declare interface GPUCompilationMessage { +interface GPUCompilationMessage { readonly message: string; readonly type: GPUCompilationMessageType; readonly lineNum: number; @@ -584,7 +584,7 @@ declare interface GPUCompilationMessage { } /** @category GPU */ -declare interface GPUCompilationInfo { +interface GPUCompilationInfo { readonly messages: ReadonlyArray; } @@ -596,12 +596,12 @@ declare class GPUPipelineError extends DOMException { } /** @category GPU */ -declare interface GPUPipelineErrorInit { +interface GPUPipelineErrorInit { reason: GPUPipelineErrorReason; } /** @category GPU */ -declare type GPUPipelineErrorReason = "validation" | "internal"; +type GPUPipelineErrorReason = "validation" | "internal"; /** @category GPU */ declare class GPUShaderModule implements GPUObjectBase { @@ -609,26 +609,26 @@ declare class GPUShaderModule implements GPUObjectBase { } /** @category GPU */ -declare interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase { +interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase { code: string; sourceMap?: any; } /** @category GPU */ -declare type GPUAutoLayoutMode = "auto"; +type GPUAutoLayoutMode = "auto"; /** @category GPU */ -declare interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase { +interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase { layout: GPUPipelineLayout | GPUAutoLayoutMode; } /** @category GPU */ -declare interface GPUPipelineBase { +interface GPUPipelineBase { getBindGroupLayout(index: number): GPUBindGroupLayout; } /** @category GPU */ -declare interface GPUProgrammableStage { +interface GPUProgrammableStage { module: GPUShaderModule; entryPoint?: string; constants?: Record; @@ -642,8 +642,7 @@ declare class GPUComputePipeline implements GPUObjectBase, GPUPipelineBase { } /** @category GPU */ -declare interface GPUComputePipelineDescriptor - extends GPUPipelineDescriptorBase { +interface GPUComputePipelineDescriptor extends GPUPipelineDescriptorBase { compute: GPUProgrammableStage; } @@ -655,8 +654,7 @@ declare class GPURenderPipeline implements GPUObjectBase, GPUPipelineBase { } /** @category GPU */ -declare interface GPURenderPipelineDescriptor - extends GPUPipelineDescriptorBase { +interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase { vertex: GPUVertexState; primitive?: GPUPrimitiveState; depthStencil?: GPUDepthStencilState; @@ -665,7 +663,7 @@ declare interface GPURenderPipelineDescriptor } /** @category GPU */ -declare interface GPUPrimitiveState { +interface GPUPrimitiveState { topology?: GPUPrimitiveTopology; stripIndexFormat?: GPUIndexFormat; frontFace?: GPUFrontFace; @@ -674,7 +672,7 @@ declare interface GPUPrimitiveState { } /** @category GPU */ -declare type GPUPrimitiveTopology = +type GPUPrimitiveTopology = | "point-list" | "line-list" | "line-strip" @@ -682,25 +680,25 @@ declare type GPUPrimitiveTopology = | "triangle-strip"; /** @category GPU */ -declare type GPUFrontFace = "ccw" | "cw"; +type GPUFrontFace = "ccw" | "cw"; /** @category GPU */ -declare type GPUCullMode = "none" | "front" | "back"; +type GPUCullMode = "none" | "front" | "back"; /** @category GPU */ -declare interface GPUMultisampleState { +interface GPUMultisampleState { count?: number; mask?: number; alphaToCoverageEnabled?: boolean; } /** @category GPU */ -declare interface GPUFragmentState extends GPUProgrammableStage { +interface GPUFragmentState extends GPUProgrammableStage { targets: (GPUColorTargetState | null)[]; } /** @category GPU */ -declare interface GPUColorTargetState { +interface GPUColorTargetState { format: GPUTextureFormat; blend?: GPUBlendState; @@ -708,13 +706,13 @@ declare interface GPUColorTargetState { } /** @category GPU */ -declare interface GPUBlendState { +interface GPUBlendState { color: GPUBlendComponent; alpha: GPUBlendComponent; } /** @category GPU */ -declare type GPUColorWriteFlags = number; +type GPUColorWriteFlags = number; /** @category GPU */ declare class GPUColorWrite { @@ -726,14 +724,14 @@ declare class GPUColorWrite { } /** @category GPU */ -declare interface GPUBlendComponent { +interface GPUBlendComponent { operation?: GPUBlendOperation; srcFactor?: GPUBlendFactor; dstFactor?: GPUBlendFactor; } /** @category GPU */ -declare type GPUBlendFactor = +type GPUBlendFactor = | "zero" | "one" | "src" @@ -749,7 +747,7 @@ declare type GPUBlendFactor = | "one-minus-constant"; /** @category GPU */ -declare type GPUBlendOperation = +type GPUBlendOperation = | "add" | "subtract" | "reverse-subtract" @@ -757,7 +755,7 @@ declare type GPUBlendOperation = | "max"; /** @category GPU */ -declare interface GPUDepthStencilState { +interface GPUDepthStencilState { format: GPUTextureFormat; depthWriteEnabled: boolean; @@ -775,7 +773,7 @@ declare interface GPUDepthStencilState { } /** @category GPU */ -declare interface GPUStencilFaceState { +interface GPUStencilFaceState { compare?: GPUCompareFunction; failOp?: GPUStencilOperation; depthFailOp?: GPUStencilOperation; @@ -783,7 +781,7 @@ declare interface GPUStencilFaceState { } /** @category GPU */ -declare type GPUStencilOperation = +type GPUStencilOperation = | "keep" | "zero" | "replace" @@ -794,10 +792,10 @@ declare type GPUStencilOperation = | "decrement-wrap"; /** @category GPU */ -declare type GPUIndexFormat = "uint16" | "uint32"; +type GPUIndexFormat = "uint16" | "uint32"; /** @category GPU */ -declare type GPUVertexFormat = +type GPUVertexFormat = | "uint8x2" | "uint8x4" | "sint8x2" @@ -831,22 +829,22 @@ declare type GPUVertexFormat = | "unorm10-10-10-2"; /** @category GPU */ -declare type GPUVertexStepMode = "vertex" | "instance"; +type GPUVertexStepMode = "vertex" | "instance"; /** @category GPU */ -declare interface GPUVertexState extends GPUProgrammableStage { +interface GPUVertexState extends GPUProgrammableStage { buffers?: (GPUVertexBufferLayout | null)[]; } /** @category GPU */ -declare interface GPUVertexBufferLayout { +interface GPUVertexBufferLayout { arrayStride: number; stepMode?: GPUVertexStepMode; attributes: GPUVertexAttribute[]; } /** @category GPU */ -declare interface GPUVertexAttribute { +interface GPUVertexAttribute { format: GPUVertexFormat; offset: number; @@ -854,7 +852,7 @@ declare interface GPUVertexAttribute { } /** @category GPU */ -declare interface GPUImageDataLayout { +interface GPUImageDataLayout { offset?: number; bytesPerRow?: number; rowsPerImage?: number; @@ -866,7 +864,7 @@ declare class GPUCommandBuffer implements GPUObjectBase { } /** @category GPU */ -declare interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {} +interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {} /** @category GPU */ declare class GPUCommandEncoder implements GPUObjectBase { @@ -927,15 +925,15 @@ declare class GPUCommandEncoder implements GPUObjectBase { } /** @category GPU */ -declare interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase {} +interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase {} /** @category GPU */ -declare interface GPUImageCopyBuffer extends GPUImageDataLayout { +interface GPUImageCopyBuffer extends GPUImageDataLayout { buffer: GPUBuffer; } /** @category GPU */ -declare interface GPUImageCopyTexture { +interface GPUImageCopyTexture { texture: GPUTexture; mipLevel?: number; origin?: GPUOrigin3D; @@ -943,7 +941,7 @@ declare interface GPUImageCopyTexture { } /** @category GPU */ -declare interface GPUProgrammablePassEncoder { +interface GPUProgrammablePassEncoder { setBindGroup( index: number, bindGroup: GPUBindGroup, @@ -993,19 +991,19 @@ declare class GPUComputePassEncoder } /** @category GPU */ -declare interface GPUComputePassTimestampWrites { +interface GPUComputePassTimestampWrites { querySet: GPUQuerySet; beginningOfPassWriteIndex?: number; endOfPassWriteIndex?: number; } /** @category GPU */ -declare interface GPUComputePassDescriptor extends GPUObjectDescriptorBase { +interface GPUComputePassDescriptor extends GPUObjectDescriptorBase { timestampWrites?: GPUComputePassTimestampWrites; } /** @category GPU */ -declare interface GPURenderEncoderBase { +interface GPURenderEncoderBase { setPipeline(pipeline: GPURenderPipeline): undefined; setIndexBuffer( @@ -1120,14 +1118,14 @@ declare class GPURenderPassEncoder } /** @category GPU */ -declare interface GPURenderPassTimestampWrites { +interface GPURenderPassTimestampWrites { querySet: GPUQuerySet; beginningOfPassWriteIndex?: number; endOfPassWriteIndex?: number; } /** @category GPU */ -declare interface GPURenderPassDescriptor extends GPUObjectDescriptorBase { +interface GPURenderPassDescriptor extends GPUObjectDescriptorBase { colorAttachments: (GPURenderPassColorAttachment | null)[]; depthStencilAttachment?: GPURenderPassDepthStencilAttachment; occlusionQuerySet?: GPUQuerySet; @@ -1135,7 +1133,7 @@ declare interface GPURenderPassDescriptor extends GPUObjectDescriptorBase { } /** @category GPU */ -declare interface GPURenderPassColorAttachment { +interface GPURenderPassColorAttachment { view: GPUTextureView; resolveTarget?: GPUTextureView; @@ -1145,7 +1143,7 @@ declare interface GPURenderPassColorAttachment { } /** @category GPU */ -declare interface GPURenderPassDepthStencilAttachment { +interface GPURenderPassDepthStencilAttachment { view: GPUTextureView; depthClearValue?: number; @@ -1160,10 +1158,10 @@ declare interface GPURenderPassDepthStencilAttachment { } /** @category GPU */ -declare type GPULoadOp = "load" | "clear"; +type GPULoadOp = "load" | "clear"; /** @category GPU */ -declare type GPUStoreOp = "store" | "discard"; +type GPUStoreOp = "store" | "discard"; /** @category GPU */ declare class GPURenderBundle implements GPUObjectBase { @@ -1171,7 +1169,7 @@ declare class GPURenderBundle implements GPUObjectBase { } /** @category GPU */ -declare interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {} +interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {} /** @category GPU */ declare class GPURenderBundleEncoder @@ -1228,14 +1226,14 @@ declare class GPURenderBundleEncoder } /** @category GPU */ -declare interface GPURenderPassLayout extends GPUObjectDescriptorBase { +interface GPURenderPassLayout extends GPUObjectDescriptorBase { colorFormats: (GPUTextureFormat | null)[]; depthStencilFormat?: GPUTextureFormat; sampleCount?: number; } /** @category GPU */ -declare interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout { +interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout { depthReadOnly?: boolean; stencilReadOnly?: boolean; } @@ -1275,19 +1273,19 @@ declare class GPUQuerySet implements GPUObjectBase { } /** @category GPU */ -declare interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase { +interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase { type: GPUQueryType; count: number; } /** @category GPU */ -declare type GPUQueryType = "occlusion" | "timestamp"; +type GPUQueryType = "occlusion" | "timestamp"; /** @category GPU */ -declare type GPUDeviceLostReason = "destroyed"; +type GPUDeviceLostReason = "destroyed"; /** @category GPU */ -declare interface GPUDeviceLostInfo { +interface GPUDeviceLostInfo { readonly reason: GPUDeviceLostReason; readonly message: string; } @@ -1313,7 +1311,7 @@ declare class GPUInternalError extends GPUError { } /** @category GPU */ -declare type GPUErrorFilter = "out-of-memory" | "validation" | "internal"; +type GPUErrorFilter = "out-of-memory" | "validation" | "internal"; /** @category GPU */ declare class GPUUncapturedErrorEvent extends Event { @@ -1326,12 +1324,12 @@ declare class GPUUncapturedErrorEvent extends Event { } /** @category GPU */ -declare interface GPUUncapturedErrorEventInit extends EventInit { +interface GPUUncapturedErrorEventInit extends EventInit { error: GPUError; } /** @category GPU */ -declare interface GPUColorDict { +interface GPUColorDict { r: number; g: number; b: number; @@ -1339,33 +1337,33 @@ declare interface GPUColorDict { } /** @category GPU */ -declare type GPUColor = number[] | GPUColorDict; +type GPUColor = number[] | GPUColorDict; /** @category GPU */ -declare interface GPUOrigin3DDict { +interface GPUOrigin3DDict { x?: number; y?: number; z?: number; } /** @category GPU */ -declare type GPUOrigin3D = number[] | GPUOrigin3DDict; +type GPUOrigin3D = number[] | GPUOrigin3DDict; /** @category GPU */ -declare interface GPUExtent3DDict { +interface GPUExtent3DDict { width: number; height?: number; depthOrArrayLayers?: number; } /** @category GPU */ -declare type GPUExtent3D = number[] | GPUExtent3DDict; +type GPUExtent3D = number[] | GPUExtent3DDict; /** @category GPU */ -declare type GPUCanvasAlphaMode = "opaque" | "premultiplied"; +type GPUCanvasAlphaMode = "opaque" | "premultiplied"; /** @category GPU */ -declare interface GPUCanvasConfiguration { +interface GPUCanvasConfiguration { device: GPUDevice; format: GPUTextureFormat; usage?: GPUTextureUsageFlags; @@ -1374,7 +1372,7 @@ declare interface GPUCanvasConfiguration { alphaMode?: GPUCanvasAlphaMode; } /** @category GPU */ -declare interface GPUCanvasContext { +interface GPUCanvasContext { configure(configuration: GPUCanvasConfiguration): undefined; unconfigure(): undefined; getCurrentTexture(): GPUTexture; diff --git a/ext/broadcast_channel/lib.deno_broadcast_channel.d.ts b/ext/broadcast_channel/lib.deno_broadcast_channel.d.ts index ed56de0094..339765ec9c 100644 --- a/ext/broadcast_channel/lib.deno_broadcast_channel.d.ts +++ b/ext/broadcast_channel/lib.deno_broadcast_channel.d.ts @@ -9,7 +9,7 @@ * @category Messaging * @experimental */ -declare interface BroadcastChannelEventMap { +interface BroadcastChannelEventMap { "message": MessageEvent; "messageerror": MessageEvent; } @@ -18,7 +18,7 @@ declare interface BroadcastChannelEventMap { * @category Messaging * @experimental */ -declare interface BroadcastChannel extends EventTarget { +interface BroadcastChannel extends EventTarget { /** * Returns the channel name (as passed to the constructor). */ diff --git a/ext/cache/lib.deno_cache.d.ts b/ext/cache/lib.deno_cache.d.ts index f28de94cee..f9e1818482 100644 --- a/ext/cache/lib.deno_cache.d.ts +++ b/ext/cache/lib.deno_cache.d.ts @@ -9,7 +9,7 @@ declare var caches: CacheStorage; /** @category Cache */ -declare interface CacheStorage { +interface CacheStorage { /** Open a cache storage for the provided name. */ open(cacheName: string): Promise; /** Check if cache already exists for the provided name. */ @@ -19,7 +19,7 @@ declare interface CacheStorage { } /** @category Cache */ -declare interface Cache { +interface Cache { /** * Put the provided request/response into the cache. * @@ -65,7 +65,7 @@ declare var CacheStorage: { }; /** @category Cache */ -declare interface CacheQueryOptions { +interface CacheQueryOptions { ignoreMethod?: boolean; ignoreSearch?: boolean; ignoreVary?: boolean; diff --git a/ext/canvas/lib.deno_canvas.d.ts b/ext/canvas/lib.deno_canvas.d.ts index 54ae3e66bd..c695ba5cd8 100644 --- a/ext/canvas/lib.deno_canvas.d.ts +++ b/ext/canvas/lib.deno_canvas.d.ts @@ -12,14 +12,14 @@ * * @category Canvas */ -declare type ColorSpaceConversion = "default" | "none"; +type ColorSpaceConversion = "default" | "none"; /** * Specifies how the bitmap image should be oriented. * * @category Canvas */ -declare type ImageOrientation = "flipY" | "from-image" | "none"; +type ImageOrientation = "flipY" | "from-image" | "none"; /** * Specifies whether the bitmap's color channels should be premultiplied by @@ -27,7 +27,7 @@ declare type ImageOrientation = "flipY" | "from-image" | "none"; * * @category Canvas */ -declare type PremultiplyAlpha = "default" | "none" | "premultiply"; +type PremultiplyAlpha = "default" | "none" | "premultiply"; /** * Specifies the algorithm to be used for resizing the input to match the @@ -35,20 +35,20 @@ declare type PremultiplyAlpha = "default" | "none" | "premultiply"; * * @category Canvas */ -declare type ResizeQuality = "high" | "low" | "medium" | "pixelated"; +type ResizeQuality = "high" | "low" | "medium" | "pixelated"; /** * The `ImageBitmapSource` type represents an image data source that can be * used to create an `ImageBitmap`. * * @category Canvas */ -declare type ImageBitmapSource = Blob | ImageData; +type ImageBitmapSource = Blob | ImageData; /** * The options of {@linkcode createImageBitmap}. * * @category Canvas */ -declare interface ImageBitmapOptions { +interface ImageBitmapOptions { /** * Specifies whether the image should be decoded using color space * conversion. Either none or default (default). The value default @@ -116,7 +116,7 @@ declare function createImageBitmap( * * @category Canvas */ -declare interface ImageBitmap { +interface ImageBitmap { /** * The height of the bitmap. */ diff --git a/ext/console/lib.deno_console.d.ts b/ext/console/lib.deno_console.d.ts index a4968dc836..0c73972d36 100644 --- a/ext/console/lib.deno_console.d.ts +++ b/ext/console/lib.deno_console.d.ts @@ -6,7 +6,7 @@ /// /** @category I/O */ -declare interface Console { +interface Console { assert(condition?: boolean, ...data: any[]): void; clear(): void; count(label?: string): void; diff --git a/ext/crypto/lib.deno_crypto.d.ts b/ext/crypto/lib.deno_crypto.d.ts index 3e7d50a2ad..827c0224ce 100644 --- a/ext/crypto/lib.deno_crypto.d.ts +++ b/ext/crypto/lib.deno_crypto.d.ts @@ -9,23 +9,23 @@ declare var crypto: Crypto; /** @category Crypto */ -declare interface Algorithm { +interface Algorithm { name: string; } /** @category Crypto */ -declare interface KeyAlgorithm { +interface KeyAlgorithm { name: string; } /** @category Crypto */ -declare type AlgorithmIdentifier = string | Algorithm; +type AlgorithmIdentifier = string | Algorithm; /** @category Crypto */ -declare type HashAlgorithmIdentifier = AlgorithmIdentifier; +type HashAlgorithmIdentifier = AlgorithmIdentifier; /** @category Crypto */ -declare type KeyType = "private" | "public" | "secret"; +type KeyType = "private" | "public" | "secret"; /** @category Crypto */ -declare type KeyUsage = +type KeyUsage = | "decrypt" | "deriveBits" | "deriveKey" @@ -35,19 +35,19 @@ declare type KeyUsage = | "verify" | "wrapKey"; /** @category Crypto */ -declare type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; +type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; /** @category Crypto */ -declare type NamedCurve = string; +type NamedCurve = string; /** @category Crypto */ -declare interface RsaOtherPrimesInfo { +interface RsaOtherPrimesInfo { d?: string; r?: string; t?: string; } /** @category Crypto */ -declare interface JsonWebKey { +interface JsonWebKey { alg?: string; crv?: string; d?: string; @@ -56,6 +56,7 @@ declare interface JsonWebKey { e?: string; ext?: boolean; k?: string; + // deno-lint-ignore camelcase key_ops?: string[]; kty?: string; n?: string; @@ -69,129 +70,129 @@ declare interface JsonWebKey { } /** @category Crypto */ -declare interface AesCbcParams extends Algorithm { +interface AesCbcParams extends Algorithm { iv: BufferSource; } /** @category Crypto */ -declare interface AesGcmParams extends Algorithm { +interface AesGcmParams extends Algorithm { iv: BufferSource; additionalData?: BufferSource; tagLength?: number; } /** @category Crypto */ -declare interface AesCtrParams extends Algorithm { +interface AesCtrParams extends Algorithm { counter: BufferSource; length: number; } /** @category Crypto */ -declare interface HmacKeyGenParams extends Algorithm { +interface HmacKeyGenParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; } /** @category Crypto */ -declare interface EcKeyGenParams extends Algorithm { +interface EcKeyGenParams extends Algorithm { namedCurve: NamedCurve; } /** @category Crypto */ -declare interface EcKeyImportParams extends Algorithm { +interface EcKeyImportParams extends Algorithm { namedCurve: NamedCurve; } /** @category Crypto */ -declare interface EcdsaParams extends Algorithm { +interface EcdsaParams extends Algorithm { hash: HashAlgorithmIdentifier; } /** @category Crypto */ -declare interface RsaHashedImportParams extends Algorithm { +interface RsaHashedImportParams extends Algorithm { hash: HashAlgorithmIdentifier; } /** @category Crypto */ -declare interface RsaHashedKeyGenParams extends RsaKeyGenParams { +interface RsaHashedKeyGenParams extends RsaKeyGenParams { hash: HashAlgorithmIdentifier; } /** @category Crypto */ -declare interface RsaKeyGenParams extends Algorithm { +interface RsaKeyGenParams extends Algorithm { modulusLength: number; publicExponent: Uint8Array; } /** @category Crypto */ -declare interface RsaPssParams extends Algorithm { +interface RsaPssParams extends Algorithm { saltLength: number; } /** @category Crypto */ -declare interface RsaOaepParams extends Algorithm { +interface RsaOaepParams extends Algorithm { label?: Uint8Array; } /** @category Crypto */ -declare interface HmacImportParams extends Algorithm { +interface HmacImportParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; } /** @category Crypto */ -declare interface EcKeyAlgorithm extends KeyAlgorithm { +interface EcKeyAlgorithm extends KeyAlgorithm { namedCurve: NamedCurve; } /** @category Crypto */ -declare interface HmacKeyAlgorithm extends KeyAlgorithm { +interface HmacKeyAlgorithm extends KeyAlgorithm { hash: KeyAlgorithm; length: number; } /** @category Crypto */ -declare interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { hash: KeyAlgorithm; } /** @category Crypto */ -declare interface RsaKeyAlgorithm extends KeyAlgorithm { +interface RsaKeyAlgorithm extends KeyAlgorithm { modulusLength: number; publicExponent: Uint8Array; } /** @category Crypto */ -declare interface HkdfParams extends Algorithm { +interface HkdfParams extends Algorithm { hash: HashAlgorithmIdentifier; info: BufferSource; salt: BufferSource; } /** @category Crypto */ -declare interface Pbkdf2Params extends Algorithm { +interface Pbkdf2Params extends Algorithm { hash: HashAlgorithmIdentifier; iterations: number; salt: BufferSource; } /** @category Crypto */ -declare interface AesDerivedKeyParams extends Algorithm { +interface AesDerivedKeyParams extends Algorithm { length: number; } /** @category Crypto */ -declare interface EcdhKeyDeriveParams extends Algorithm { +interface EcdhKeyDeriveParams extends Algorithm { public: CryptoKey; } /** @category Crypto */ -declare interface AesKeyGenParams extends Algorithm { +interface AesKeyGenParams extends Algorithm { length: number; } /** @category Crypto */ -declare interface AesKeyAlgorithm extends KeyAlgorithm { +interface AesKeyAlgorithm extends KeyAlgorithm { length: number; } @@ -200,7 +201,7 @@ declare interface AesKeyAlgorithm extends KeyAlgorithm { * * @category Crypto */ -declare interface CryptoKey { +interface CryptoKey { readonly algorithm: KeyAlgorithm; readonly extractable: boolean; readonly type: KeyType; @@ -218,7 +219,7 @@ declare var CryptoKey: { * * @category Crypto */ -declare interface CryptoKeyPair { +interface CryptoKeyPair { privateKey: CryptoKey; publicKey: CryptoKey; } @@ -235,7 +236,7 @@ declare var CryptoKeyPair: { * * @category Crypto */ -declare interface SubtleCrypto { +interface SubtleCrypto { generateKey( algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, @@ -374,7 +375,7 @@ declare var SubtleCrypto: { }; /** @category Crypto */ -declare interface Crypto { +interface Crypto { readonly subtle: SubtleCrypto; getRandomValues< T extends diff --git a/ext/fetch/lib.deno_fetch.d.ts b/ext/fetch/lib.deno_fetch.d.ts index c27313903d..d219a38592 100644 --- a/ext/fetch/lib.deno_fetch.d.ts +++ b/ext/fetch/lib.deno_fetch.d.ts @@ -6,7 +6,7 @@ /// /** @category Platform */ -declare interface DomIterable { +interface DomIterable { keys(): IterableIterator; values(): IterableIterator; entries(): IterableIterator<[K, V]>; @@ -18,7 +18,7 @@ declare interface DomIterable { } /** @category Fetch */ -declare type FormDataEntryValue = File | string; +type FormDataEntryValue = File | string; /** Provides a way to easily construct a set of key/value pairs representing * form fields and their values, which can then be easily sent using the @@ -27,7 +27,7 @@ declare type FormDataEntryValue = File | string; * * @category Fetch */ -declare interface FormData extends DomIterable { +interface FormData extends DomIterable { append(name: string, value: string | Blob, fileName?: string): void; delete(name: string): void; get(name: string): FormDataEntryValue | null; @@ -43,7 +43,7 @@ declare var FormData: { }; /** @category Fetch */ -declare interface Body { +interface Body { /** A simple getter used to expose a `ReadableStream` of the body contents. */ readonly body: ReadableStream | null; /** Stores a `Boolean` that declares whether the body has been used in a @@ -77,7 +77,7 @@ declare interface Body { } /** @category Fetch */ -declare type HeadersInit = Iterable | Record; +type HeadersInit = Iterable | Record; /** This Fetch API interface allows you to perform various actions on HTTP * request and response headers. These actions include retrieving, setting, @@ -89,7 +89,7 @@ declare type HeadersInit = Iterable | Record; * * @category Fetch */ -declare interface Headers extends DomIterable { +interface Headers extends DomIterable { /** Appends a new value onto an existing header inside a `Headers` object, or * adds the header if it does not already exist. */ @@ -130,9 +130,9 @@ declare var Headers: { }; /** @category Fetch */ -declare type RequestInfo = Request | string; +type RequestInfo = Request | string; /** @category Fetch */ -declare type RequestCache = +type RequestCache = | "default" | "force-cache" | "no-cache" @@ -140,13 +140,13 @@ declare type RequestCache = | "only-if-cached" | "reload"; /** @category Fetch */ -declare type RequestCredentials = "include" | "omit" | "same-origin"; +type RequestCredentials = "include" | "omit" | "same-origin"; /** @category Fetch */ -declare type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin"; +type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin"; /** @category Fetch */ -declare type RequestRedirect = "error" | "follow" | "manual"; +type RequestRedirect = "error" | "follow" | "manual"; /** @category Fetch */ -declare type ReferrerPolicy = +type ReferrerPolicy = | "" | "no-referrer" | "no-referrer-when-downgrade" @@ -157,7 +157,7 @@ declare type ReferrerPolicy = | "strict-origin-when-cross-origin" | "unsafe-url"; /** @category Fetch */ -declare type BodyInit = +type BodyInit = | Blob | BufferSource | FormData @@ -165,7 +165,7 @@ declare type BodyInit = | ReadableStream | string; /** @category Fetch */ -declare type RequestDestination = +type RequestDestination = | "" | "audio" | "audioworklet" @@ -186,7 +186,7 @@ declare type RequestDestination = | "xslt"; /** @category Fetch */ -declare interface RequestInit { +interface RequestInit { /** * A BodyInit object or null to set request's body. */ @@ -254,7 +254,7 @@ declare interface RequestInit { * * @category Fetch */ -declare interface Request extends Body { +interface Request extends Body { /** * Returns the cache mode associated with request, which is a string * indicating how the request will interact with the browser's cache when @@ -350,14 +350,14 @@ declare var Request: { }; /** @category Fetch */ -declare interface ResponseInit { +interface ResponseInit { headers?: HeadersInit; status?: number; statusText?: string; } /** @category Fetch */ -declare type ResponseType = +type ResponseType = | "basic" | "cors" | "default" @@ -369,7 +369,7 @@ declare type ResponseType = * * @category Fetch */ -declare interface Response extends Body { +interface Response extends Body { readonly headers: Headers; readonly ok: boolean; readonly redirected: boolean; @@ -413,14 +413,14 @@ declare function fetch( /** * @category Fetch */ -declare interface EventSourceInit { +interface EventSourceInit { withCredentials?: boolean; } /** * @category Fetch */ -declare interface EventSourceEventMap { +interface EventSourceEventMap { "error": Event; "message": MessageEvent; "open": Event; @@ -429,7 +429,7 @@ declare interface EventSourceEventMap { /** * @category Fetch */ -declare interface EventSource extends EventTarget { +interface EventSource extends EventTarget { onerror: ((this: EventSource, ev: Event) => any) | null; onmessage: ((this: EventSource, ev: MessageEvent) => any) | null; onopen: ((this: EventSource, ev: Event) => any) | null; diff --git a/ext/net/lib.deno_net.d.ts b/ext/net/lib.deno_net.d.ts index ba2763f6ce..827081f2a4 100644 --- a/ext/net/lib.deno_net.d.ts +++ b/ext/net/lib.deno_net.d.ts @@ -449,4 +449,6 @@ declare namespace Deno { conn: TcpConn, options?: StartTlsOptions, ): Promise; + + export {}; // only export exports } diff --git a/ext/url/lib.deno_url.d.ts b/ext/url/lib.deno_url.d.ts index 71a781636a..946c70607f 100644 --- a/ext/url/lib.deno_url.d.ts +++ b/ext/url/lib.deno_url.d.ts @@ -6,7 +6,7 @@ /// /** @category URL */ -declare interface URLSearchParams { +interface URLSearchParams { /** Appends a specified key/value pair as a new search parameter. * * ```ts @@ -170,7 +170,7 @@ declare var URLSearchParams: { * * @category URL */ -declare interface URL { +interface URL { hash: string; host: string; hostname: string; @@ -202,7 +202,7 @@ declare var URL: { }; /** @category URL */ -declare interface URLPatternInit { +interface URLPatternInit { protocol?: string; username?: string; password?: string; @@ -215,10 +215,10 @@ declare interface URLPatternInit { } /** @category URL */ -declare type URLPatternInput = string | URLPatternInit; +type URLPatternInput = string | URLPatternInit; /** @category URL */ -declare interface URLPatternComponentResult { +interface URLPatternComponentResult { input: string; groups: Record; } @@ -227,7 +227,7 @@ declare interface URLPatternComponentResult { * * @category URL */ -declare interface URLPatternResult { +interface URLPatternResult { /** The inputs provided when matching. */ inputs: [URLPatternInit] | [URLPatternInit, string]; @@ -254,7 +254,7 @@ declare interface URLPatternResult { * * @category URL */ -declare interface URLPatternOptions { +interface URLPatternOptions { /** * Enables case-insensitive matching. * @@ -293,7 +293,7 @@ declare interface URLPatternOptions { * * @category URL */ -declare interface URLPattern { +interface URLPattern { /** * Test if the given input matches the stored pattern. * diff --git a/ext/web/06_streams_types.d.ts b/ext/web/06_streams_types.d.ts index 19eb597d2e..e04f568d26 100644 --- a/ext/web/06_streams_types.d.ts +++ b/ext/web/06_streams_types.d.ts @@ -71,5 +71,10 @@ interface ReadableStreamGenericReader { declare function queueMicrotask(callback: VoidFunction): void; declare namespace Deno { - function inspect(value: unknown, options?: Record): string; + export function inspect( + value: unknown, + options?: Record, + ): string; + + export {}; // only export exports } diff --git a/ext/web/lib.deno_web.d.ts b/ext/web/lib.deno_web.d.ts index e276e7fdbf..2ad97ac7d1 100644 --- a/ext/web/lib.deno_web.d.ts +++ b/ext/web/lib.deno_web.d.ts @@ -6,7 +6,7 @@ /// /** @category Platform */ -declare interface DOMException extends Error { +interface DOMException extends Error { readonly name: string; readonly message: string; /** @deprecated */ @@ -70,7 +70,7 @@ declare var DOMException: { }; /** @category Events */ -declare interface EventInit { +interface EventInit { bubbles?: boolean; cancelable?: boolean; composed?: boolean; @@ -80,7 +80,7 @@ declare interface EventInit { * * @category Events */ -declare interface Event { +interface Event { /** Returns true or false depending on how event was initialized. True if * event goes through its target's ancestors in reverse tree order, and * false otherwise. */ @@ -163,7 +163,7 @@ declare var Event: { * * @category Events */ -declare interface EventTarget { +interface EventTarget { /** Appends an event listener for events whose type attribute value is type. * The callback argument sets the callback that will be invoked when the event * is dispatched. @@ -217,34 +217,34 @@ declare var EventTarget: { }; /** @category Events */ -declare interface EventListener { +interface EventListener { (evt: Event): void; } /** @category Events */ -declare interface EventListenerObject { +interface EventListenerObject { handleEvent(evt: Event): void; } /** @category Events */ -declare type EventListenerOrEventListenerObject = +type EventListenerOrEventListenerObject = | EventListener | EventListenerObject; /** @category Events */ -declare interface AddEventListenerOptions extends EventListenerOptions { +interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; passive?: boolean; signal?: AbortSignal; } /** @category Events */ -declare interface EventListenerOptions { +interface EventListenerOptions { capture?: boolean; } /** @category Events */ -declare interface ProgressEventInit extends EventInit { +interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; total?: number; @@ -256,8 +256,7 @@ declare interface ProgressEventInit extends EventInit { * * @category Events */ -declare interface ProgressEvent - extends Event { +interface ProgressEvent extends Event { readonly lengthComputable: boolean; readonly loaded: number; readonly target: T | null; @@ -296,13 +295,13 @@ declare function atob(s: string): string; declare function btoa(s: string): string; /** @category Encoding */ -declare interface TextDecoderOptions { +interface TextDecoderOptions { fatal?: boolean; ignoreBOM?: boolean; } /** @category Encoding */ -declare interface TextDecodeOptions { +interface TextDecodeOptions { stream?: boolean; } @@ -320,7 +319,7 @@ declare interface TextDecodeOptions { * * @category Encoding */ -declare interface TextDecoder extends TextDecoderCommon { +interface TextDecoder extends TextDecoderCommon { /** Turns binary data, often in the form of a Uint8Array, into a string given * the encoding. */ @@ -334,7 +333,7 @@ declare var TextDecoder: { }; /** @category Encoding */ -declare interface TextDecoderCommon { +interface TextDecoderCommon { /** Returns encoding's name, lowercased. */ readonly encoding: string; /** Returns true if error mode is "fatal", otherwise false. */ @@ -344,13 +343,13 @@ declare interface TextDecoderCommon { } /** @category Encoding */ -declare interface TextEncoderEncodeIntoResult { +interface TextEncoderEncodeIntoResult { read: number; written: number; } /** @category Encoding */ -declare interface TextEncoder extends TextEncoderCommon { +interface TextEncoder extends TextEncoderCommon { /** Returns the result of running UTF-8's encoder. */ encode(input?: string): Uint8Array; encodeInto(input: string, dest: Uint8Array): TextEncoderEncodeIntoResult; @@ -369,7 +368,7 @@ declare interface TextEncoder extends TextEncoderCommon { * * @category Encoding */ -declare interface TextEncoder extends TextEncoderCommon { +interface TextEncoder extends TextEncoderCommon { /** Turns a string into binary data (in the form of a Uint8Array) using UTF-8 encoding. */ encode(input?: string): Uint8Array; @@ -384,14 +383,13 @@ declare var TextEncoder: { }; /** @category Encoding */ -declare interface TextEncoderCommon { +interface TextEncoderCommon { /** Returns "utf-8". */ readonly encoding: string; } /** @category Encoding */ -declare interface TextDecoderStream - extends GenericTransformStream, TextDecoderCommon { +interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon { readonly readable: ReadableStream; readonly writable: WritableStream; } @@ -403,8 +401,7 @@ declare var TextDecoderStream: { }; /** @category Encoding */ -declare interface TextEncoderStream - extends GenericTransformStream, TextEncoderCommon { +interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon { readonly readable: ReadableStream; readonly writable: WritableStream; } @@ -420,7 +417,7 @@ declare var TextEncoderStream: { * * @category Platform */ -declare interface AbortController { +interface AbortController { /** Returns the AbortSignal object associated with this object. */ readonly signal: AbortSignal; /** Invoking this method will set this object's AbortSignal's aborted flag and @@ -439,7 +436,7 @@ declare var AbortController: { }; /** @category Platform */ -declare interface AbortSignalEventMap { +interface AbortSignalEventMap { abort: Event; } @@ -448,7 +445,7 @@ declare interface AbortSignalEventMap { * * @category Platform */ -declare interface AbortSignal extends EventTarget { +interface AbortSignal extends EventTarget { /** Returns true if this AbortSignal's AbortController has signaled to abort, * and false otherwise. */ readonly aborted: boolean; @@ -490,7 +487,7 @@ declare var AbortSignal: { }; /** @category File */ -declare interface FileReaderEventMap { +interface FileReaderEventMap { "abort": ProgressEvent; "error": ProgressEvent; "load": ProgressEvent; @@ -505,7 +502,7 @@ declare interface FileReaderEventMap { * * @category File */ -declare interface FileReader extends EventTarget { +interface FileReader extends EventTarget { readonly error: DOMException | null; onabort: ((this: FileReader, ev: ProgressEvent) => any) | null; onerror: ((this: FileReader, ev: ProgressEvent) => any) | null; @@ -561,13 +558,13 @@ declare var FileReader: { }; /** @category File */ -declare type BlobPart = BufferSource | Blob | string; +type BlobPart = BufferSource | Blob | string; /** @category File */ -declare type EndingType = "transparent" | "native"; +type EndingType = "transparent" | "native"; /** @category File */ -declare interface BlobPropertyBag { +interface BlobPropertyBag { type?: string; endings?: EndingType; } @@ -579,7 +576,7 @@ declare interface BlobPropertyBag { * * @category File */ -declare interface Blob { +interface Blob { readonly size: number; readonly type: string; arrayBuffer(): Promise; @@ -602,7 +599,7 @@ declare var Blob: { }; /** @category File */ -declare interface FilePropertyBag extends BlobPropertyBag { +interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } @@ -611,7 +608,7 @@ declare interface FilePropertyBag extends BlobPropertyBag { * * @category File */ -declare interface File extends Blob { +interface File extends Blob { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; @@ -628,40 +625,40 @@ declare var File: { }; /** @category Streams */ -declare type ReadableStreamReader = +type ReadableStreamReader = | ReadableStreamDefaultReader | ReadableStreamBYOBReader; /** @category Streams */ -declare type ReadableStreamController = +type ReadableStreamController = | ReadableStreamDefaultController | ReadableByteStreamController; /** @category Streams */ -declare interface ReadableStreamGenericReader { +interface ReadableStreamGenericReader { readonly closed: Promise; cancel(reason?: any): Promise; } /** @category Streams */ -declare interface ReadableStreamReadDoneResult { +interface ReadableStreamReadDoneResult { done: true; value?: T; } /** @category Streams */ -declare interface ReadableStreamReadValueResult { +interface ReadableStreamReadValueResult { done: false; value: T; } /** @category Streams */ -declare type ReadableStreamReadResult = +type ReadableStreamReadResult = | ReadableStreamReadValueResult | ReadableStreamReadDoneResult; /** @category Streams */ -declare interface ReadableStreamDefaultReader +interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { read(): Promise>; releaseLock(): void; @@ -674,12 +671,12 @@ declare var ReadableStreamDefaultReader: { }; /** @category Streams */ -declare interface ReadableStreamBYOBReaderReadOptions { +interface ReadableStreamBYOBReaderReadOptions { min?: number; } /** @category Streams */ -declare interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { +interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { read( view: T, options?: ReadableStreamBYOBReaderReadOptions, @@ -694,7 +691,7 @@ declare var ReadableStreamBYOBReader: { }; /** @category Streams */ -declare interface ReadableStreamBYOBRequest { +interface ReadableStreamBYOBRequest { readonly view: ArrayBufferView | null; respond(bytesWritten: number): void; respondWithNewView(view: ArrayBufferView): void; @@ -707,7 +704,7 @@ declare var ReadableStreamBYOBRequest: { }; /** @category Streams */ -declare interface UnderlyingByteSource { +interface UnderlyingByteSource { autoAllocateChunkSize?: number; cancel?: UnderlyingSourceCancelCallback; pull?: (controller: ReadableByteStreamController) => void | PromiseLike; @@ -716,7 +713,7 @@ declare interface UnderlyingByteSource { } /** @category Streams */ -declare interface UnderlyingDefaultSource { +interface UnderlyingDefaultSource { cancel?: UnderlyingSourceCancelCallback; pull?: ( controller: ReadableStreamDefaultController, @@ -726,7 +723,7 @@ declare interface UnderlyingDefaultSource { } /** @category Streams */ -declare interface UnderlyingSink { +interface UnderlyingSink { abort?: UnderlyingSinkAbortCallback; close?: UnderlyingSinkCloseCallback; start?: UnderlyingSinkStartCallback; @@ -735,10 +732,10 @@ declare interface UnderlyingSink { } /** @category Streams */ -declare type ReadableStreamType = "bytes"; +type ReadableStreamType = "bytes"; /** @category Streams */ -declare interface UnderlyingSource { +interface UnderlyingSource { autoAllocateChunkSize?: number; cancel?: UnderlyingSourceCancelCallback; pull?: UnderlyingSourcePullCallback; @@ -747,22 +744,22 @@ declare interface UnderlyingSource { } /** @category Streams */ -declare interface UnderlyingSourceCancelCallback { +interface UnderlyingSourceCancelCallback { (reason?: any): void | PromiseLike; } /** @category Streams */ -declare interface UnderlyingSourcePullCallback { +interface UnderlyingSourcePullCallback { (controller: ReadableStreamController): void | PromiseLike; } /** @category Streams */ -declare interface UnderlyingSourceStartCallback { +interface UnderlyingSourceStartCallback { (controller: ReadableStreamController): any; } /** @category Streams */ -declare interface ReadableStreamDefaultController { +interface ReadableStreamDefaultController { readonly desiredSize: number | null; close(): void; enqueue(chunk?: R): void; @@ -776,7 +773,7 @@ declare var ReadableStreamDefaultController: { }; /** @category Streams */ -declare interface ReadableByteStreamController { +interface ReadableByteStreamController { readonly byobRequest: ReadableStreamBYOBRequest | null; readonly desiredSize: number | null; close(): void; @@ -791,7 +788,7 @@ declare var ReadableByteStreamController: { }; /** @category Streams */ -declare interface StreamPipeOptions { +interface StreamPipeOptions { preventAbort?: boolean; preventCancel?: boolean; preventClose?: boolean; @@ -799,12 +796,12 @@ declare interface StreamPipeOptions { } /** @category Streams */ -declare interface QueuingStrategySize { +interface QueuingStrategySize { (chunk: T): number; } /** @category Streams */ -declare interface QueuingStrategy { +interface QueuingStrategy { highWaterMark?: number; size?: QueuingStrategySize; } @@ -814,7 +811,7 @@ declare interface QueuingStrategy { * * @category Streams */ -declare interface CountQueuingStrategy extends QueuingStrategy { +interface CountQueuingStrategy extends QueuingStrategy { readonly highWaterMark: number; readonly size: QueuingStrategySize; } @@ -826,8 +823,7 @@ declare var CountQueuingStrategy: { }; /** @category Streams */ -declare interface ByteLengthQueuingStrategy - extends QueuingStrategy { +interface ByteLengthQueuingStrategy extends QueuingStrategy { readonly highWaterMark: number; readonly size: QueuingStrategySize; } @@ -839,7 +835,7 @@ declare var ByteLengthQueuingStrategy: { }; /** @category Streams */ -declare interface QueuingStrategyInit { +interface QueuingStrategyInit { highWaterMark: number; } @@ -849,7 +845,7 @@ declare interface QueuingStrategyInit { * * @category Streams */ -declare interface ReadableStream { +interface ReadableStream { readonly locked: boolean; cancel(reason?: any): Promise; getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; @@ -891,36 +887,36 @@ declare var ReadableStream: { }; /** @category Streams */ -declare interface ReadableStreamIteratorOptions { +interface ReadableStreamIteratorOptions { preventCancel?: boolean; } /** @category Streams */ -declare type ReadableStreamReaderMode = "byob"; +type ReadableStreamReaderMode = "byob"; /** @category Streams */ -declare interface ReadableStreamGetReaderOptions { +interface ReadableStreamGetReaderOptions { mode?: ReadableStreamReaderMode; } /** @category Streams */ -declare interface ReadableWritablePair { +interface ReadableWritablePair { readable: ReadableStream; writable: WritableStream; } /** @category Streams */ -declare interface UnderlyingSinkCloseCallback { +interface UnderlyingSinkCloseCallback { (): void | PromiseLike; } /** @category Streams */ -declare interface UnderlyingSinkStartCallback { +interface UnderlyingSinkStartCallback { (controller: WritableStreamDefaultController): any; } /** @category Streams */ -declare interface UnderlyingSinkWriteCallback { +interface UnderlyingSinkWriteCallback { ( chunk: W, controller: WritableStreamDefaultController, @@ -928,7 +924,7 @@ declare interface UnderlyingSinkWriteCallback { } /** @category Streams */ -declare interface UnderlyingSinkAbortCallback { +interface UnderlyingSinkAbortCallback { (reason?: any): void | PromiseLike; } @@ -938,7 +934,7 @@ declare interface UnderlyingSinkAbortCallback { * * @category Streams */ -declare interface WritableStream { +interface WritableStream { readonly locked: boolean; abort(reason?: any): Promise; close(): Promise; @@ -961,7 +957,7 @@ declare var WritableStream: { * * @category Streams */ -declare interface WritableStreamDefaultController { +interface WritableStreamDefaultController { readonly signal: AbortSignal; error(e?: any): void; } @@ -979,7 +975,7 @@ declare var WritableStreamDefaultController: { * * @category Streams */ -declare interface WritableStreamDefaultWriter { +interface WritableStreamDefaultWriter { readonly closed: Promise; readonly desiredSize: number | null; readonly ready: Promise; @@ -996,7 +992,7 @@ declare var WritableStreamDefaultWriter: { }; /** @category Streams */ -declare interface TransformStream { +interface TransformStream { readonly readable: ReadableStream; readonly writable: WritableStream; } @@ -1012,7 +1008,7 @@ declare var TransformStream: { }; /** @category Streams */ -declare interface TransformStreamDefaultController { +interface TransformStreamDefaultController { readonly desiredSize: number | null; enqueue(chunk?: O): void; error(reason?: any): void; @@ -1026,7 +1022,7 @@ declare var TransformStreamDefaultController: { }; /** @category Streams */ -declare interface Transformer { +interface Transformer { flush?: TransformerFlushCallback; readableType?: undefined; start?: TransformerStartCallback; @@ -1036,17 +1032,17 @@ declare interface Transformer { } /** @category Streams */ -declare interface TransformerFlushCallback { +interface TransformerFlushCallback { (controller: TransformStreamDefaultController): void | PromiseLike; } /** @category Streams */ -declare interface TransformerStartCallback { +interface TransformerStartCallback { (controller: TransformStreamDefaultController): any; } /** @category Streams */ -declare interface TransformerTransformCallback { +interface TransformerTransformCallback { ( chunk: I, controller: TransformStreamDefaultController, @@ -1054,21 +1050,21 @@ declare interface TransformerTransformCallback { } /** @category Streams */ -declare interface TransformerCancelCallback { +interface TransformerCancelCallback { (reason: any): void | PromiseLike; } /** @category Streams */ -declare interface GenericTransformStream { +interface GenericTransformStream { readonly readable: ReadableStream; readonly writable: WritableStream; } /** @category Events */ -declare type MessageEventSource = Window | MessagePort; +type MessageEventSource = Window | MessagePort; /** @category Events */ -declare interface MessageEventInit extends EventInit { +interface MessageEventInit extends EventInit { data?: T; lastEventId?: string; origin?: string; @@ -1077,7 +1073,7 @@ declare interface MessageEventInit extends EventInit { } /** @category Events */ -declare interface MessageEvent extends Event { +interface MessageEvent extends Event { /** * Returns the data of the message. */ @@ -1115,10 +1111,10 @@ declare var MessageEvent: { }; /** @category Events */ -declare type Transferable = MessagePort | ArrayBuffer; +type Transferable = MessagePort | ArrayBuffer; /** @category Platform */ -declare interface StructuredSerializeOptions { +interface StructuredSerializeOptions { transfer?: Transferable[]; } @@ -1128,7 +1124,7 @@ declare interface StructuredSerializeOptions { * * @category Messaging */ -declare interface MessageChannel { +interface MessageChannel { readonly port1: MessagePort; readonly port2: MessagePort; } @@ -1145,7 +1141,7 @@ declare var MessageChannel: { }; /** @category Messaging */ -declare interface MessagePortEventMap { +interface MessagePortEventMap { "message": MessageEvent; "messageerror": MessageEvent; } @@ -1156,7 +1152,7 @@ declare interface MessagePortEventMap { * * @category Messaging */ -declare interface MessagePort extends EventTarget { +interface MessagePort extends EventTarget { onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null; onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null; /** @@ -1255,13 +1251,13 @@ declare function structuredClone( * * @category Streams */ -declare interface CompressionStream extends GenericTransformStream { +interface CompressionStream extends GenericTransformStream { readonly readable: ReadableStream; readonly writable: WritableStream; } /** @category Streams */ -declare type CompressionFormat = "deflate" | "deflate-raw" | "gzip"; +type CompressionFormat = "deflate" | "deflate-raw" | "gzip"; /** * An API for compressing a stream of data. @@ -1302,7 +1298,7 @@ declare var CompressionStream: { * * @category Streams */ -declare interface DecompressionStream extends GenericTransformStream { +interface DecompressionStream extends GenericTransformStream { readonly readable: ReadableStream; readonly writable: WritableStream; } @@ -1356,15 +1352,15 @@ declare function reportError( ): void; /** @category Platform */ -declare type PredefinedColorSpace = "srgb" | "display-p3"; +type PredefinedColorSpace = "srgb" | "display-p3"; /** @category Platform */ -declare interface ImageDataSettings { +interface ImageDataSettings { readonly colorSpace?: PredefinedColorSpace; } /** @category Platform */ -declare interface ImageData { +interface ImageData { readonly colorSpace: PredefinedColorSpace; readonly data: Uint8ClampedArray; readonly height: number; diff --git a/ext/websocket/lib.deno_websocket.d.ts b/ext/websocket/lib.deno_websocket.d.ts index c1bdf35421..fb7ea6070c 100644 --- a/ext/websocket/lib.deno_websocket.d.ts +++ b/ext/websocket/lib.deno_websocket.d.ts @@ -6,14 +6,14 @@ /// /** @category WebSockets */ -declare interface CloseEventInit extends EventInit { +interface CloseEventInit extends EventInit { code?: number; reason?: string; wasClean?: boolean; } /** @category WebSockets */ -declare interface CloseEvent extends Event { +interface CloseEvent extends Event { /** * Returns the WebSocket connection close code provided by the server. */ @@ -35,7 +35,7 @@ declare var CloseEvent: { }; /** @category WebSockets */ -declare interface WebSocketEventMap { +interface WebSocketEventMap { close: CloseEvent; error: Event; message: MessageEvent; @@ -52,7 +52,7 @@ declare interface WebSocketEventMap { * @tags allow-net * @category WebSockets */ -declare interface WebSocket extends EventTarget { +interface WebSocket extends EventTarget { /** * Returns a string that indicates how binary data from the WebSocket object is exposed to scripts: * @@ -130,4 +130,4 @@ declare var WebSocket: { }; /** @category WebSockets */ -declare type BinaryType = "arraybuffer" | "blob"; +type BinaryType = "arraybuffer" | "blob"; diff --git a/ext/webstorage/lib.deno_webstorage.d.ts b/ext/webstorage/lib.deno_webstorage.d.ts index a3a4d6cd10..fa6d403dea 100644 --- a/ext/webstorage/lib.deno_webstorage.d.ts +++ b/ext/webstorage/lib.deno_webstorage.d.ts @@ -11,7 +11,7 @@ * * @category Storage */ -declare interface Storage { +interface Storage { /** * Returns the number of key/value pairs currently present in the list associated with the object. */ diff --git a/tools/generate_types_deno.ts b/tools/generate_types_deno.ts new file mode 100755 index 0000000000..265b6f5371 --- /dev/null +++ b/tools/generate_types_deno.ts @@ -0,0 +1,100 @@ +#!/usr/bin/env -S deno run -A +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +// This script is used to generate the @types/deno package on DefinitelyTyped. + +import $ from "jsr:@david/dax@0.42.0"; +import { Node, Project } from "jsr:@ts-morph/ts-morph@23.0.0"; +import * as semver from "jsr:@std/semver@1.0.3"; + +const rootDir = $.path(import.meta.dirname!).parentOrThrow(); +const definitelyTypedDir = rootDir.join( + "../DefinitelyTyped/types/deno/", +); + +if (!definitelyTypedDir.existsSync()) { + throw new Error(`Makes sure ${definitelyTypedDir} exists.`); +} + +const denoExec = rootDir.join( + "target/debug/deno" + (Deno.build.os === "windows" ? ".exe" : ""), +); + +$.logStep("Building Deno executable..."); +await $`cargo build`; + +$.logStep("Creating declaration file..."); +await createDenoDtsFile(); +$.logStep("Updating package.json..."); +await updatePkgJson(); +$.logStep("Formatting..."); +await $`pnpm dprint fmt`.cwd(definitelyTypedDir); + +async function createDenoDtsFile() { + function matchesAny(text: string | undefined, patterns: string[]): boolean { + if (text == null) { + return false; + } + for (const pattern of patterns) { + if (text.includes(pattern)) { + return true; + } + } + return false; + } + + const text = await $`${denoExec} types`.text(); + const project = new Project(); + const file = project.createSourceFile( + definitelyTypedDir.join("index.d.ts").toString(), + text, + { + overwrite: true, + }, + ); + + for (const statement of file.getStatementsWithComments()) { + if (Node.isCommentStatement(statement)) { + const statementText = statement.getText(); + if (statementText.includes(" tag.getTagName() === "category")) { - errors.push(getErrorPrefix(node) + "JSDoc @category tag"); + errors.push(getMissingErrorPrefix(node) + "JSDoc @category tag"); continue; } if (unstableFiles.includes(file)) { if (!tags.find((tag) => tag.getTagName() === "experimental")) { - errors.push(getErrorPrefix(node) + "JSDoc @experimental tag"); + errors.push(getMissingErrorPrefix(node) + "JSDoc @experimental tag"); } } } @@ -81,6 +87,10 @@ if (errors.length > 0) { throw new AggregateError(errors); } -function getErrorPrefix(node) { - return `Symbol at file://${node.getSourceFile().getFilePath()}:${node.getStartLineNumber()} is missing a `; +function getMissingErrorPrefix(node) { + return getErrorPrefix(node) + `is missing a `; +} + +function getErrorPrefix(node) { + return `Symbol at file://${node.getSourceFile().getFilePath()}:${node.getStartLineNumber()} `; } From 1eebd207250afbefaeeff1e889bc6962474a15fa Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Mon, 23 Sep 2024 16:01:05 -0700 Subject: [PATCH 11/17] fix: error out if a valid flag is passed before a subcommand (#25830) Closes #25808 --- cli/args/flags.rs | 72 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 8490fdab65..d325ce7bcb 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1233,6 +1233,51 @@ pub fn flags_from_vec(args: Vec) -> clap::error::Result { } if let Some((subcommand, mut m)) = matches.remove_subcommand() { + let pre_subcommand_arg = app + .get_arguments() + .filter(|arg| !arg.is_global_set()) + .find(|arg| { + matches + .value_source(arg.get_id().as_str()) + .is_some_and(|value| value == clap::parser::ValueSource::CommandLine) + }) + .map(|arg| { + format!( + "--{}", + arg.get_long().unwrap_or_else(|| arg.get_id().as_str()) + ) + }); + + if let Some(arg) = pre_subcommand_arg { + let usage = app.find_subcommand_mut(&subcommand).unwrap().render_usage(); + + let mut err = + clap::error::Error::new(ErrorKind::UnknownArgument).with_cmd(&app); + err.insert( + clap::error::ContextKind::InvalidArg, + clap::error::ContextValue::String(arg.clone()), + ); + + let valid = app.get_styles().get_valid(); + + let styled_suggestion = clap::builder::StyledStr::from(format!( + "'{}{subcommand} {arg}{}' exists", + valid.render(), + valid.render_reset() + )); + + err.insert( + clap::error::ContextKind::Suggested, + clap::error::ContextValue::StyledStrs(vec![styled_suggestion]), + ); + err.insert( + clap::error::ContextKind::Usage, + clap::error::ContextValue::StyledStr(usage), + ); + + return Err(err); + } + match subcommand.as_str() { "add" => add_parse(&mut flags, &mut m), "remove" => remove_parse(&mut flags, &mut m), @@ -4695,16 +4740,10 @@ fn run_parse( "[SCRIPT_ARG] may only be omitted with --v8-flags=--help, else to use the repl with arguments, please use the `deno repl` subcommand", )); } else { - return Err( - app - .get_subcommands_mut() - .find(|subcommand| subcommand.get_name() == "run") - .unwrap() - .error( - clap::error::ErrorKind::MissingRequiredArgument, - "[SCRIPT_ARG] may only be omitted with --v8-flags=--help", - ), - ); + return Err(app.find_subcommand_mut("run").unwrap().error( + clap::error::ErrorKind::MissingRequiredArgument, + "[SCRIPT_ARG] may only be omitted with --v8-flags=--help", + )); } Ok(()) @@ -10799,4 +10838,17 @@ mod tests { } ) } + + #[test] + fn flag_before_subcommand() { + let r = flags_from_vec(svec!["deno", "--allow-net", "repl"]); + assert_eq!( + r.unwrap_err().to_string(), + "error: unexpected argument '--allow-net' found + + tip: 'repl --allow-net' exists + +Usage: deno repl [OPTIONS] [-- [ARGS]...]\n" + ) + } } From d8036ab20c18572fdda26fa7398a152c734c62ed Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Tue, 24 Sep 2024 10:16:34 +0900 Subject: [PATCH 12/17] perf(ext/fetch): improve decompression throughput by upgrading `tower_http` (#25806) This commit improves the throughput when a Deno process is running as a proxy server that deals with compressed data from the upstream server. We have seen a performance degradation since v1.45.3 when we run a HTTP server with Deno with a particular setting, where it fetches _compressed_ data from the upstream server and forwards it to the end client. After some investigation, it turned out that [tower_http::decompression] causes this issue, which was fixed by the new version of this crate, v0.6.1. [tower_http::decompression]: https://docs.rs/tower-http/0.6.0/tower_http/decompression/index.html Fixes #25798 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d06b23bed1..30798cd8b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7541,9 +7541,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" dependencies = [ "async-compression", "bitflags 2.6.0", @@ -7561,9 +7561,9 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" diff --git a/Cargo.toml b/Cargo.toml index f020812ad8..81cbf8b4c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -185,7 +185,7 @@ tokio-rustls = { version = "0.26.0", default-features = false, features = ["ring tokio-socks = "0.5.1" tokio-util = "0.7.4" tower = { version = "0.4.13", default-features = false, features = ["util"] } -tower-http = { version = "0.5.2", features = ["decompression-br", "decompression-gzip"] } +tower-http = { version = "0.6.1", features = ["decompression-br", "decompression-gzip"] } tower-lsp = { package = "deno_tower_lsp", version = "0.1.0", features = ["proposed"] } tower-service = "0.3.2" twox-hash = "=1.6.3" From 74e294c8c1873db447af0f02229470f8d78fffdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 24 Sep 2024 02:33:03 +0100 Subject: [PATCH 13/17] refactor: reenable more tests after DENO_FUTURE migration (#25752) Rewrites and reenables following tests: - `task::task_both_package_json_selected` --- tests/integration/task_tests.rs | 11 ----------- .../task/both_package_json_selected/__test__.jsonc | 10 ++++++++++ .../task/both_package_json_selected}/deno.json | 0 .../task/both_package_json_selected/install.out} | 5 ----- .../task/both_package_json_selected}/package.json | 0 .../package_json_selected.out | 5 +++++ tools/lint.js | 2 +- 7 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 tests/specs/task/both_package_json_selected/__test__.jsonc rename tests/{testdata/task/both => specs/task/both_package_json_selected}/deno.json (100%) rename tests/{testdata/task/both/package_json_selected.out => specs/task/both_package_json_selected/install.out} (67%) rename tests/{testdata/task/both => specs/task/both_package_json_selected}/package.json (100%) create mode 100644 tests/specs/task/both_package_json_selected/package_json_selected.out diff --git a/tests/integration/task_tests.rs b/tests/integration/task_tests.rs index 895e643a05..d198a3be6f 100644 --- a/tests/integration/task_tests.rs +++ b/tests/integration/task_tests.rs @@ -31,17 +31,6 @@ // http_server: true, // }); -// TODO(2.0): not entirely clear what's wrong with this test -// itest!(task_both_package_json_selected { -// args: "task bin asdf", -// cwd: Some("task/both/"), -// output: "task/both/package_json_selected.out", -// copy_temp_dir: Some("task/both/"), -// envs: env_vars_for_npm_tests(), -// exit_code: 0, -// http_server: true, -// }); - // TODO(2.0): not entirely clear what's wrong with this test but it hangs for more than 60s // itest!(task_npx_on_own { // args: "task on-own", diff --git a/tests/specs/task/both_package_json_selected/__test__.jsonc b/tests/specs/task/both_package_json_selected/__test__.jsonc new file mode 100644 index 0000000000..acdb7892d0 --- /dev/null +++ b/tests/specs/task/both_package_json_selected/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "install", + "output": "install.out" + }, + { "args": "task bin asdf", "output": "package_json_selected.out" } + ] +} diff --git a/tests/testdata/task/both/deno.json b/tests/specs/task/both_package_json_selected/deno.json similarity index 100% rename from tests/testdata/task/both/deno.json rename to tests/specs/task/both_package_json_selected/deno.json diff --git a/tests/testdata/task/both/package_json_selected.out b/tests/specs/task/both_package_json_selected/install.out similarity index 67% rename from tests/testdata/task/both/package_json_selected.out rename to tests/specs/task/both_package_json_selected/install.out index c72baeb640..645501a3d9 100644 --- a/tests/testdata/task/both/package_json_selected.out +++ b/tests/specs/task/both_package_json_selected/install.out @@ -1,8 +1,3 @@ Download http://localhost:4260/@denotest/bin Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/bin@1.0.0 -Task bin cli-esm testing this out "asdf" -testing -this -out -asdf diff --git a/tests/testdata/task/both/package.json b/tests/specs/task/both_package_json_selected/package.json similarity index 100% rename from tests/testdata/task/both/package.json rename to tests/specs/task/both_package_json_selected/package.json diff --git a/tests/specs/task/both_package_json_selected/package_json_selected.out b/tests/specs/task/both_package_json_selected/package_json_selected.out new file mode 100644 index 0000000000..6c42a2efb5 --- /dev/null +++ b/tests/specs/task/both_package_json_selected/package_json_selected.out @@ -0,0 +1,5 @@ +Task bin cli-esm testing this out "asdf" +testing +this +out +asdf diff --git a/tools/lint.js b/tools/lint.js index 496e83fc49..6cb27f8dc9 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -220,7 +220,7 @@ async function ensureNoNewITests() { "repl_tests.rs": 0, "run_tests.rs": 331, "shared_library_tests.rs": 0, - "task_tests.rs": 4, + "task_tests.rs": 3, "test_tests.rs": 0, "upgrade_tests.rs": 0, "vendor_tests.rs": 1, From 1e261c9756e232b5d8ef1e7a6627f6f03695ab16 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:12:48 -0700 Subject: [PATCH 14/17] fix: Update deno_npm to fix `deno install` with crossws (#25837) Partially addresses https://github.com/denoland/deno/issues/25648. This allows packages that use `crossws` to be installed with `deno install`. `crossws` specifies an optional peer dependency on `uWebSockets`, but `uWebSockets` is not on npm (it is used with `git:` or `github:` specifiers). Previously we would error on this, now we don't error on non-existent optional peer dependencies. --- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- .../non-existent-optional-peer/1.0.0/index.js | 0 .../non-existent-optional-peer/1.0.0/package.json | 12 ++++++++++++ .../non_existent_optional_peer/__test__.jsonc | 11 +++++++++++ .../install/non_existent_optional_peer/install.out | 6 ++++++ .../install/non_existent_optional_peer/package.json | 5 +++++ 7 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 tests/registry/npm/@denotest/non-existent-optional-peer/1.0.0/index.js create mode 100644 tests/registry/npm/@denotest/non-existent-optional-peer/1.0.0/package.json create mode 100644 tests/specs/install/non_existent_optional_peer/__test__.jsonc create mode 100644 tests/specs/install/non_existent_optional_peer/install.out create mode 100644 tests/specs/install/non_existent_optional_peer/package.json diff --git a/Cargo.lock b/Cargo.lock index 30798cd8b9..f5df8bde68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1870,9 +1870,9 @@ dependencies = [ [[package]] name = "deno_npm" -version = "0.25.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e61b112e9bb332e8e6b0d82fcea7664423933de476e1726dd23a924a2d94f4ef" +checksum = "1809e2d77d8a06bc2800dc10c1d4acb664197e518e289a86e336411c1feba785" dependencies = [ "anyhow", "async-trait", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d1f1dc5d53..a47af07a79 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -71,7 +71,7 @@ deno_doc = { version = "0.148.0", features = ["html", "syntect"] } deno_graph = { version = "=0.82.1" } deno_lint = { version = "=0.67.0", features = ["docs"] } deno_lockfile.workspace = true -deno_npm = "=0.25.1" +deno_npm = "=0.25.2" deno_package_json.workspace = true deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_semver.workspace = true diff --git a/tests/registry/npm/@denotest/non-existent-optional-peer/1.0.0/index.js b/tests/registry/npm/@denotest/non-existent-optional-peer/1.0.0/index.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/registry/npm/@denotest/non-existent-optional-peer/1.0.0/package.json b/tests/registry/npm/@denotest/non-existent-optional-peer/1.0.0/package.json new file mode 100644 index 0000000000..e1eaf20b7d --- /dev/null +++ b/tests/registry/npm/@denotest/non-existent-optional-peer/1.0.0/package.json @@ -0,0 +1,12 @@ +{ + "name": "@denotest/non-existent-optional-peer", + "version": "1.0.0", + "peerDependencies": { + "uWebSockets.js": "*" + }, + "peerDependenciesMeta": { + "uWebSockets.js": { + "optional": true + } + } +} \ No newline at end of file diff --git a/tests/specs/install/non_existent_optional_peer/__test__.jsonc b/tests/specs/install/non_existent_optional_peer/__test__.jsonc new file mode 100644 index 0000000000..b6527f614c --- /dev/null +++ b/tests/specs/install/non_existent_optional_peer/__test__.jsonc @@ -0,0 +1,11 @@ +// test imitates what crossws 0.2.4 has https://www.npmjs.com/package/crossws/v/0.2.4 +// where uWebSockets.js is an optional peer dep, but doesn't exist on npm +{ + "tempDir": true, + "steps": [ + { + "args": "install", + "output": "install.out" + } + ] +} diff --git a/tests/specs/install/non_existent_optional_peer/install.out b/tests/specs/install/non_existent_optional_peer/install.out new file mode 100644 index 0000000000..292c1a4e2f --- /dev/null +++ b/tests/specs/install/non_existent_optional_peer/install.out @@ -0,0 +1,6 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/non-existent-optional-peer +Download http://localhost:4260/uWebSockets.js +Download http://localhost:4260/@denotest/non-existent-optional-peer/1.0.0.tgz +[UNORDERED_END] +Initialize @denotest/non-existent-optional-peer@1.0.0 diff --git a/tests/specs/install/non_existent_optional_peer/package.json b/tests/specs/install/non_existent_optional_peer/package.json new file mode 100644 index 0000000000..c8216ee3d5 --- /dev/null +++ b/tests/specs/install/non_existent_optional_peer/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@denotest/non-existent-optional-peer": "1.0.0" + } +} From 7d7e54172477203f50e553304b0980e17b5fd441 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 24 Sep 2024 15:47:13 +0530 Subject: [PATCH 15/17] fix(ext/node): Fix vm sandbox object panic (#24985) --- ext/node/ops/vm.rs | 63 +++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/ext/node/ops/vm.rs b/ext/node/ops/vm.rs index 12c9b6cdb8..25881cbaed 100644 --- a/ext/node/ops/vm.rs +++ b/ext/node/ops/vm.rs @@ -410,8 +410,8 @@ impl ContextifyContext { fn sandbox<'a>( &self, scope: &mut v8::HandleScope<'a>, - ) -> v8::Local<'a, v8::Object> { - self.sandbox.get(scope).unwrap() + ) -> Option> { + self.sandbox.get(scope) } fn microtask_queue(&self) -> Option<&v8::MicrotaskQueue> { @@ -600,7 +600,9 @@ fn property_query<'s>( let context = ctx.context(scope); let scope = &mut v8::ContextScope::new(scope, context); - let sandbox = ctx.sandbox(scope); + let Some(sandbox) = ctx.sandbox(scope) else { + return v8::Intercepted::No; + }; match sandbox.has_real_named_property(scope, property) { None => v8::Intercepted::No, @@ -645,7 +647,9 @@ fn property_getter<'s>( return v8::Intercepted::No; }; - let sandbox = ctx.sandbox(scope); + let Some(sandbox) = ctx.sandbox(scope) else { + return v8::Intercepted::No; + }; let tc_scope = &mut v8::TryCatch::new(scope); let maybe_rv = sandbox.get_real_named_property(tc_scope, key).or_else(|| { @@ -689,14 +693,14 @@ fn property_setter<'s>( None => (v8::PropertyAttribute::NONE, false), }; let mut read_only = attributes.is_read_only(); - - let (attributes, is_declared_on_sandbox) = match ctx - .sandbox(scope) - .get_real_named_property_attributes(scope, key) - { - Some(attr) => (attr, true), - None => (v8::PropertyAttribute::NONE, false), + let Some(sandbox) = ctx.sandbox(scope) else { + return v8::Intercepted::No; }; + let (attributes, is_declared_on_sandbox) = + match sandbox.get_real_named_property_attributes(scope, key) { + Some(attr) => (attr, true), + None => (v8::PropertyAttribute::NONE, false), + }; read_only |= attributes.is_read_only(); if read_only { @@ -731,14 +735,12 @@ fn property_setter<'s>( return v8::Intercepted::No; }; - if ctx.sandbox(scope).set(scope, key.into(), value).is_none() { + if sandbox.set(scope, key.into(), value).is_none() { return v8::Intercepted::No; } if is_declared_on_sandbox { - if let Some(desc) = - ctx.sandbox(scope).get_own_property_descriptor(scope, key) - { + if let Some(desc) = sandbox.get_own_property_descriptor(scope, key) { if !desc.is_undefined() { let desc_obj: v8::Local = desc.try_into().unwrap(); // We have to specify the return value for any contextual or get/set @@ -774,7 +776,9 @@ fn property_descriptor<'s>( }; let context = ctx.context(scope); - let sandbox = ctx.sandbox(scope); + let Some(sandbox) = ctx.sandbox(scope) else { + return v8::Intercepted::No; + }; let scope = &mut v8::ContextScope::new(scope, context); if sandbox.has_own_property(scope, key).unwrap_or(false) { @@ -818,7 +822,9 @@ fn property_definer<'s>( return v8::Intercepted::No; } - let sandbox = ctx.sandbox(scope); + let Some(sandbox) = ctx.sandbox(scope) else { + return v8::Intercepted::No; + }; let define_prop_on_sandbox = |scope: &mut v8::HandleScope, @@ -880,7 +886,10 @@ fn property_deleter<'s>( }; let context = ctx.context(scope); - let sandbox = ctx.sandbox(scope); + let Some(sandbox) = ctx.sandbox(scope) else { + return v8::Intercepted::No; + }; + let context_scope = &mut v8::ContextScope::new(scope, context); if sandbox.delete(context_scope, key.into()).unwrap_or(false) { return v8::Intercepted::No; @@ -900,7 +909,10 @@ fn property_enumerator<'s>( }; let context = ctx.context(scope); - let sandbox = ctx.sandbox(scope); + let Some(sandbox) = ctx.sandbox(scope) else { + return; + }; + let context_scope = &mut v8::ContextScope::new(scope, context); let Some(properties) = sandbox .get_property_names(context_scope, v8::GetPropertyNamesArgs::default()) @@ -921,12 +933,14 @@ fn indexed_property_enumerator<'s>( }; let context = ctx.context(scope); let scope = &mut v8::ContextScope::new(scope, context); + let Some(sandbox) = ctx.sandbox(scope) else { + return; + }; // By default, GetPropertyNames returns string and number property names, and // doesn't convert the numbers to strings. - let Some(properties) = ctx - .sandbox(scope) - .get_property_names(scope, v8::GetPropertyNamesArgs::default()) + let Some(properties) = + sandbox.get_property_names(scope, v8::GetPropertyNamesArgs::default()) else { return; }; @@ -1019,7 +1033,10 @@ fn indexed_property_deleter<'s>( }; let context = ctx.context(scope); - let sandbox = ctx.sandbox(scope); + let Some(sandbox) = ctx.sandbox(scope) else { + return v8::Intercepted::No; + }; + let context_scope = &mut v8::ContextScope::new(scope, context); if !sandbox.delete_index(context_scope, index).unwrap_or(false) { return v8::Intercepted::No; From 3242550f5f0b33769a4e0a24a7dc96773647ca75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 24 Sep 2024 14:54:48 +0100 Subject: [PATCH 16/17] fix(fmt): --check was broken for CSS, YAML and HTML (#25848) `deno fmt --check` was broken for CSS, YAML and HTML files. Before this PR, formatting any of these file types would return a string, even though the contract in `cli/tools/fmt.rs` is to only return a string if the formatting changed. This causes wrong flagging of these files as being badly formatted even though diffs showed nothing (because they were in fact formatted properly). Closes https://github.com/denoland/deno/issues/25840 --- cli/tools/fmt.rs | 51 ++++++++++++++++-------- tests/specs/fmt/css/__test__.jsonc | 12 +++++- tests/specs/fmt/css/well_formatted.css | 3 ++ tests/specs/fmt/html/__test__.jsonc | 12 +++++- tests/specs/fmt/html/well_formatted.html | 11 +++++ tests/specs/fmt/yaml/__test__.jsonc | 14 +++++-- tests/specs/fmt/yaml/well_formatted.yml | 3 ++ 7 files changed, 82 insertions(+), 24 deletions(-) create mode 100644 tests/specs/fmt/css/well_formatted.css create mode 100644 tests/specs/fmt/html/well_formatted.html create mode 100644 tests/specs/fmt/yaml/well_formatted.yml diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 489f36f533..7a3c0de4b7 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -297,12 +297,7 @@ fn format_markdown( Ok(None) } } - "yml" | "yaml" => pretty_yaml::format_text( - text, - &get_resolved_yaml_config(fmt_options), - ) - .map(Some) - .map_err(AnyError::from), + "yml" | "yaml" => format_yaml(text, fmt_options), _ => { let mut codeblock_config = get_resolved_typescript_config(fmt_options); @@ -339,13 +334,33 @@ pub fn format_css( file_text: &str, fmt_options: &FmtOptionsConfig, ) -> Result, AnyError> { - malva::format_text( + let formatted_str = malva::format_text( file_text, malva::detect_syntax(file_path).unwrap_or(malva::Syntax::Css), &get_resolved_malva_config(fmt_options), ) - .map(Some) - .map_err(AnyError::from) + .map_err(AnyError::from)?; + + Ok(if formatted_str == file_text { + None + } else { + Some(formatted_str) + }) +} + +fn format_yaml( + file_text: &str, + fmt_options: &FmtOptionsConfig, +) -> Result, AnyError> { + let formatted_str = + pretty_yaml::format_text(file_text, &get_resolved_yaml_config(fmt_options)) + .map_err(AnyError::from)?; + + Ok(if formatted_str == file_text { + None + } else { + Some(formatted_str) + }) } pub fn format_html( @@ -353,7 +368,7 @@ pub fn format_html( file_text: &str, fmt_options: &FmtOptionsConfig, ) -> Result, AnyError> { - markup_fmt::format_text( + let format_result = markup_fmt::format_text( file_text, markup_fmt::detect_language(file_path) .unwrap_or(markup_fmt::Language::Html), @@ -419,7 +434,6 @@ pub fn format_html( } }, ) - .map(Some) .map_err(|error| match error { markup_fmt::FormatError::Syntax(error) => AnyError::from(error), markup_fmt::FormatError::External(errors) => { @@ -438,6 +452,14 @@ pub fn format_html( .collect::(), ) } + }); + + let formatted_str = format_result?; + + Ok(if formatted_str == file_text { + None + } else { + Some(formatted_str) }) } @@ -469,12 +491,7 @@ pub fn format_file( Ok(None) } } - "yml" | "yaml" => pretty_yaml::format_text( - file_text, - &get_resolved_yaml_config(fmt_options), - ) - .map(Some) - .map_err(AnyError::from), + "yml" | "yaml" => format_yaml(file_text, fmt_options), "ipynb" => dprint_plugin_jupyter::format_text( file_text, |file_path: &Path, file_text: String| { diff --git a/tests/specs/fmt/css/__test__.jsonc b/tests/specs/fmt/css/__test__.jsonc index e58818fbe5..a3ded6d431 100644 --- a/tests/specs/fmt/css/__test__.jsonc +++ b/tests/specs/fmt/css/__test__.jsonc @@ -1,5 +1,13 @@ { "tempDir": true, - "args": "fmt", - "output": "[WILDLINE]badly_formatted.css\nChecked 1 file\n" + "tests": { + "badly_formatted": { + "args": "fmt badly_formatted.css", + "output": "[WILDLINE]badly_formatted.css\nChecked 1 file\n" + }, + "well_formatted": { + "args": "fmt --check well_formatted.css", + "output": "Checked 1 file\n" + } + } } diff --git a/tests/specs/fmt/css/well_formatted.css b/tests/specs/fmt/css/well_formatted.css new file mode 100644 index 0000000000..1653551f47 --- /dev/null +++ b/tests/specs/fmt/css/well_formatted.css @@ -0,0 +1,3 @@ +#app > .btn { + color: #000; +} diff --git a/tests/specs/fmt/html/__test__.jsonc b/tests/specs/fmt/html/__test__.jsonc index cec29d1b3b..7f31694236 100644 --- a/tests/specs/fmt/html/__test__.jsonc +++ b/tests/specs/fmt/html/__test__.jsonc @@ -1,5 +1,13 @@ { "tempDir": true, - "args": "fmt --unstable-html", - "output": "[WILDLINE]badly_formatted.html\nChecked 1 file\n" + "tests": { + "badly_formatted": { + "args": "fmt badly_formatted.html", + "output": "[WILDLINE]badly_formatted.html\nChecked 1 file\n" + }, + "well_formatted": { + "args": "fmt --check well_formatted.html", + "output": "Checked 1 file\n" + } + } } diff --git a/tests/specs/fmt/html/well_formatted.html b/tests/specs/fmt/html/well_formatted.html new file mode 100644 index 0000000000..c0c06cd9bd --- /dev/null +++ b/tests/specs/fmt/html/well_formatted.html @@ -0,0 +1,11 @@ +
content
+ + + + diff --git a/tests/specs/fmt/yaml/__test__.jsonc b/tests/specs/fmt/yaml/__test__.jsonc index 3cef276b81..499b4144b7 100644 --- a/tests/specs/fmt/yaml/__test__.jsonc +++ b/tests/specs/fmt/yaml/__test__.jsonc @@ -1,5 +1,13 @@ { "tempDir": true, - "args": "fmt", - "output": "[WILDLINE]badly_formatted.yml\nChecked 1 file\n" -} \ No newline at end of file + "tests": { + "badly_formatted": { + "args": "fmt badly_formatted.yml", + "output": "[WILDLINE]badly_formatted.yml\nChecked 1 file\n" + }, + "well_formatted": { + "args": "fmt --check well_formatted.yml", + "output": "Checked 1 file\n" + } + } +} diff --git a/tests/specs/fmt/yaml/well_formatted.yml b/tests/specs/fmt/yaml/well_formatted.yml new file mode 100644 index 0000000000..016e0b9510 --- /dev/null +++ b/tests/specs/fmt/yaml/well_formatted.yml @@ -0,0 +1,3 @@ +- Test +- Test +- Test From 5a1943cd9560466a5922bd3cd79cca5c9f378561 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 24 Sep 2024 07:04:52 -0700 Subject: [PATCH 17/17] fix: better error for Deno.UnsafeWindowSurface, correct HttpClient name, cleanup unused code (#25833) --- cli/main.rs | 7 +++++++ cli/tsc/dts/lib.deno.ns.d.ts | 4 +++- runtime/js/90_deno_ns.js | 11 +---------- runtime/lib.rs | 4 ++-- tests/unit/fetch_test.ts | 1 + 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cli/main.rs b/cli/main.rs index 84c3704ca1..c0eccab5df 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -385,6 +385,13 @@ fn get_suggestions_for_terminal_errors(e: &JsError) -> Vec { FixSuggestion::info("window global is not available in Deno 2."), FixSuggestion::hint("Replace `window` with `globalThis`."), ]; + } else if msg.contains("UnsafeWindowSurface is not a constructor") { + return vec![ + FixSuggestion::info("Deno.UnsafeWindowSurface is an unstable API."), + FixSuggestion::hint( + "Run again with `--unstable-webgpu` flag to enable this API.", + ), + ]; } } diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 3cca95cdfd..36592e10dc 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -6041,9 +6041,11 @@ declare namespace Deno { * * @category Fetch */ - export interface HttpClient extends Disposable { + export class HttpClient implements Disposable { /** Close the HTTP client. */ close(): void; + + [Symbol.dispose](): void; } /** diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 35378da4d3..2448bc3bc6 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -132,7 +132,7 @@ const denoNs = { UnsafePointerView: ffi.UnsafePointerView, UnsafeFnPointer: ffi.UnsafeFnPointer, umask: fs.umask, - httpClient: httpClient.httpClient, + HttpClient: httpClient.HttpClient, createHttpClient: httpClient.createHttpClient, }; @@ -160,15 +160,6 @@ denoNsUnstableById[unstableIds.cron] = { cron: cron.cron, }; -denoNsUnstableById[unstableIds.ffi] = {}; - -denoNsUnstableById[unstableIds.fs] = {}; - -denoNsUnstableById[unstableIds.http] = { - HttpClient: httpClient.HttpClient, - createHttpClient: httpClient.createHttpClient, -}; - denoNsUnstableById[unstableIds.kv] = { openKv: kv.openKv, AtomicOperation: kv.AtomicOperation, diff --git a/runtime/lib.rs b/runtime/lib.rs index 034c094a08..f0b1129ce3 100644 --- a/runtime/lib.rs +++ b/runtime/lib.rs @@ -122,8 +122,8 @@ pub static UNSTABLE_GRANULAR_FLAGS: &[UnstableGranularFlag] = &[ }, UnstableGranularFlag { name: deno_webgpu::UNSTABLE_FEATURE_NAME, - help_text: "Enable unstable `WebGPU` API", - show_in_help: false, + help_text: "Enable unstable `WebGPU` APIs", + show_in_help: true, id: 11, }, UnstableGranularFlag { diff --git a/tests/unit/fetch_test.ts b/tests/unit/fetch_test.ts index 48cde90ab6..3ae96746a7 100644 --- a/tests/unit/fetch_test.ts +++ b/tests/unit/fetch_test.ts @@ -1156,6 +1156,7 @@ Deno.test( > { const caCert = Deno.readTextFileSync("tests/testdata/tls/RootCA.pem"); const client = Deno.createHttpClient({ caCerts: [caCert] }); + assert(client instanceof Deno.HttpClient); const response = await fetch("https://localhost:5545/assets/fixture.json", { client, });