Skip to content

Commit

Permalink
Merge branch 'main' into sqlite_integer_out_or_range
Browse files Browse the repository at this point in the history
Signed-off-by: Divy Srivastava <[email protected]>
  • Loading branch information
littledivy authored Feb 1, 2025
2 parents a71df27 + 9da6a20 commit 67fb26b
Show file tree
Hide file tree
Showing 276 changed files with 9,322 additions and 22,658 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 34 additions & 10 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ mod ts {
// Deno built-in type libraries
"decorators",
"decorators.legacy",
"es5",
"dom.asynciterable",
"dom",
"dom.extras",
"dom.iterable",
"es2015.collection",
"es2015.core",
"es2015",
Expand All @@ -145,10 +148,13 @@ mod ts {
"es2015.symbol",
"es2015.symbol.wellknown",
"es2016.array.include",
"es2016.intl",
"es2016",
"es2016.full",
"es2016.intl",
"es2017.arraybuffer",
"es2017",
"es2017.date",
"es2017.full",
"es2017.intl",
"es2017.object",
"es2017.sharedmemory",
Expand All @@ -157,52 +163,70 @@ mod ts {
"es2018.asyncgenerator",
"es2018.asynciterable",
"es2018",
"es2018.full",
"es2018.intl",
"es2018.promise",
"es2018.regexp",
"es2019.array",
"es2019",
"es2019.full",
"es2019.intl",
"es2019.object",
"es2019.string",
"es2019.symbol",
"es2020.bigint",
"es2020",
"es2020.date",
"es2020.full",
"es2020.intl",
"es2020.number",
"es2020.promise",
"es2020.sharedmemory",
"es2020.string",
"es2020.symbol.wellknown",
"es2021",
"es2021.full",
"es2021.intl",
"es2021.promise",
"es2021.string",
"es2021.weakref",
"es2022",
"es2022.array",
"es2022",
"es2022.error",
"es2022.full",
"es2022.intl",
"es2022.object",
"es2022.regexp",
"es2022.sharedmemory",
"es2022.string",
"es2023",
"es2023.array",
"es2023.collection",
"es2023",
"es2023.full",
"es2023.intl",
"esnext",
"es2024.arraybuffer",
"es2024.collection",
"es2024",
"es2024.full",
"es2024.object",
"es2024.promise",
"es2024.regexp",
"es2024.sharedmemory",
"es2024.string",
"es5",
"es6",
"esnext.array",
"esnext.collection",
"esnext",
"esnext.decorators",
"esnext.disposable",
"esnext.full",
"esnext.intl",
"esnext.iterator",
"esnext.object",
"esnext.promise",
"esnext.regexp",
"esnext.string",
"scripthost",
"webworker.asynciterable",
"webworker",
"webworker.importscripts",
"webworker.iterable",
];

let path_dts = cwd.join("tsc/dts");
Expand Down
6 changes: 5 additions & 1 deletion cli/lib/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ pub enum RootCertStoreLoadError {
FailedAddPemFile(String),
#[error("Failed opening CA file: {0}")]
CaFileOpenError(String),
#[error("Failed to load platform certificates: {0}")]
FailedNativeCerts(String),
}

/// Create and populate a root cert store based on the passed options and
Expand Down Expand Up @@ -89,7 +91,9 @@ pub fn get_root_cert_store(
root_cert_store.extend(webpki_roots::TLS_SERVER_ROOTS.to_vec());
}
"system" => {
let roots = load_native_certs().expect("could not load platform certs");
let roots = load_native_certs().map_err(|err| {
RootCertStoreLoadError::FailedNativeCerts(err.to_string())
})?;
for root in roots {
if let Err(err) = root_cert_store
.add(rustls::pki_types::CertificateDer::from(root.0.clone()))
Expand Down
2 changes: 1 addition & 1 deletion cli/lib/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn otel_runtime_config() -> OtelRuntimeConfig {
}

const GIT_COMMIT_HASH: &str = env!("GIT_COMMIT_HASH");
const TYPESCRIPT: &str = "5.6.2";
const TYPESCRIPT: &str = "5.7.3";
const DENO_VERSION: &str = env!("DENO_VERSION");
// TODO(bartlomieju): ideally we could remove this const.
const IS_CANARY: bool = option_env!("DENO_CANARY").is_some();
Expand Down
41 changes: 13 additions & 28 deletions cli/lsp/language_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ impl Inner {
})?;
let asset_or_doc = self.get_asset_or_document(&action_data.specifier)?;
let line_index = asset_or_doc.line_index();
let refactor_edit_info = self
let mut refactor_edit_info = self
.ts_server
.get_edits_for_refactor(
self.snapshot(),
Expand All @@ -1901,34 +1901,19 @@ impl Inner {
)),
asset_or_doc.scope().cloned(),
)
.await;

match refactor_edit_info {
Ok(mut refactor_edit_info) => {
if kind_suffix == ".rewrite.function.returnType"
|| kind_suffix == ".move.newFile"
{
refactor_edit_info.edits =
fix_ts_import_changes(&refactor_edit_info.edits, self).map_err(
|err| {
error!("Unable to remap changes: {:#}", err);
LspError::internal_error()
},
)?
}
code_action.edit = refactor_edit_info.to_workspace_edit(self)?;
}
Err(err) => {
// TODO(nayeemrmn): Investigate cause for
// https://github.com/denoland/deno/issues/27778. Prevent popups for
// this error for now.
if kind_suffix == ".move.newFile" {
lsp_warn!("{:#}", err);
} else {
return Err(err);
}
}
.await?;
if kind_suffix == ".rewrite.function.returnType"
|| kind_suffix == ".move.newFile"
{
refactor_edit_info.edits =
fix_ts_import_changes(&refactor_edit_info.edits, self).map_err(
|err| {
error!("Unable to remap changes: {:#}", err);
LspError::internal_error()
},
)?
}
code_action.edit = refactor_edit_info.to_workspace_edit(self)?;
code_action
} else {
// The code action doesn't need to be resolved
Expand Down
18 changes: 16 additions & 2 deletions cli/lsp/tsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6015,11 +6015,25 @@ mod tests {

// get some notification when the size of the assets grows
let mut total_size = 0;
for asset in assets {
for asset in &assets {
total_size += asset.text().len();
}
assert!(total_size > 0);
assert!(total_size < 2_000_000); // currently as of TS 4.6, it's 0.7MB
#[allow(clippy::print_stderr)]
// currently as of TS 5.7, it's 3MB
if total_size > 3_500_000 {
let mut sizes = Vec::new();
for asset in &assets {
sizes.push((asset.specifier(), asset.text().len()));
}
sizes.sort_by_cached_key(|(_, size)| *size);
sizes.reverse();
for (specifier, size) in &sizes {
eprintln!("{}: {}", specifier, size);
}
eprintln!("Total size: {}", total_size);
panic!("Assets were quite large.");
}
}

#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion cli/npm/installer/resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fn get_add_pkg_reqs_options(package_reqs: &[PackageReq]) -> AddPkgReqsOptions {
// WARNING: When bumping this version, check if anything needs to be
// updated in the `setNodeOnlyGlobalNames` call in 99_main_compiler.js
types_node_version_req: Some(
VersionReq::parse_from_npm("22.0.0 - 22.5.4").unwrap(),
VersionReq::parse_from_npm("22.9.0 - 22.12.0").unwrap(),
),
}
}
Expand Down
2 changes: 1 addition & 1 deletion cli/snapshot/shared.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Copyright 2018-2025 the Deno authors. MIT license.

pub static TS_VERSION: &str = "5.6.2";
pub static TS_VERSION: &str = "5.7.3";
Loading

0 comments on commit 67fb26b

Please sign in to comment.