update deno_core implementation to latest 2.2.1

This commit is contained in:
Ruben Fiszel
2025-02-22 11:04:54 +01:00
parent b102ff4a46
commit c6dbd239b4
5 changed files with 3094 additions and 154 deletions
+3034 -122
View File
File diff suppressed because it is too large Load Diff
+19 -14
View File
@@ -160,7 +160,6 @@ windmill-parser-graphql = { path = "./parsers/windmill-parser-graphql" }
windmill-parser-php = { path = "./parsers/windmill-parser-php" }
windmill-api-client = { path = "./windmill-api-client" }
v8 = "=130.0.7" # Exact version
memchr = "2.7.4"
axum = { version = "^0.7", features = ["multipart"] }
headers = "^0"
@@ -212,22 +211,28 @@ itertools = "^0"
regex = "^1"
semver = "^1"
deno_fetch = "0.203.0"
deno_tls = "0.166.0"
deno_console = "0.179.0"
deno_url = "0.179.0"
deno_webidl = "0.179.0"
deno_web = "0.210.0"
deno_net = "0.171.0"
deno_core = "0.321.0"
deno_ast = { version = "=0.43.3", features = ["transpiling"] }
deno_permissions = "0.39.0"
v8 = "=134.4.0" # Exact version
deno_fetch = "0.216.0"
deno_tls = "0.179.0"
deno_console = "0.192.0"
deno_url = "0.192.0"
deno_webidl = "0.192.0"
deno_web = "0.223.0"
deno_io = "0.102.0"
deno_net = "0.184.0"
deno_core = "0.338.0"
deno_ast = { version = "=0.44.0", features = ["transpiling"] }
deno_permissions = "0.51.0"
deno_runtime = { version = "0.200.0", features = ["transpile"] }
deno_telemetry = "0.14.0"
deno_error = "=0.5.5"
swc_common = "=0.37.5"
swc_ecma_parser = "=0.149.1"
swc_ecma_ast = "=0.118.2"
swc_ecma_visit = "=0.104.8"
async-recursion = "^1"
base64 = "^0"
@@ -264,9 +269,9 @@ once_cell = "1.17.1"
gosyn = "0.2.6"
bytes = "1.4.0"
gethostname = "0.4.3"
wasm-bindgen = "=0.2.92"
serde-wasm-bindgen = "0.6.5"
wasm-bindgen-test = "0.3.42"
wasm-bindgen = "^0"
serde-wasm-bindgen = "^0"
wasm-bindgen-test = "^0"
convert_case = "0.6.0"
getrandom = "0.2"
tokio-postgres = {version = "^0.7", features = ["array-impls", "with-serde_json-1", "with-chrono-0_4", "with-uuid-1", "with-bit-vec-0_6"]}
+7 -1
View File
@@ -20,7 +20,7 @@ flow_testing = []
cloud = []
sqlx = []
deno_core = ["dep:deno_fetch", "dep:deno_webidl", "dep:deno_web", "dep:deno_net", "dep:deno_console", "dep:deno_url", "dep:deno_core",
"dep:deno_ast", "dep:deno_tls", "dep:deno_permissions"]
"dep:deno_ast", "dep:deno_tls", "dep:deno_permissions", "dep:deno_io", "dep:deno_runtime", "dep:deno_telemetry", "dep:deno_error"]
otel = ["windmill-common/otel", "dep:opentelemetry"]
dind = ["dep:bollard"]
php = ["dep:windmill-parser-php"]
@@ -70,6 +70,7 @@ dyn-iter.workspace = true
once_cell.workspace = true
tokio-postgres.workspace = true
bit-vec.workspace = true
deno_telemetry = { workspace = true, optional = true }
deno_fetch = { workspace = true, optional = true }
deno_webidl = { workspace = true, optional = true }
deno_web = { workspace = true, optional = true }
@@ -80,6 +81,8 @@ deno_core = { workspace = true, optional = true }
deno_ast = { workspace = true, optional = true }
deno_tls = { workspace = true, optional = true }
deno_permissions = { workspace = true, optional = true }
deno_io = { workspace = true, optional = true }
deno_error = { workspace = true, optional = true }
postgres-native-tls.workspace = true
native-tls.workspace = true
@@ -118,3 +121,6 @@ deno_core = { workspace = true, optional = true }
deno_ast = { workspace = true, optional = true }
deno_tls = { workspace = true, optional = true }
deno_permissions = { workspace = true, optional = true }
deno_io = { workspace = true, optional = true }
deno_runtime = { workspace = true, optional = true }
deno_telemetry = { workspace = true, optional = true }
+6 -3
View File
@@ -32,9 +32,10 @@ impl FetchPermissions for PermissionsContainer {
#[inline(always)]
fn check_read<'a>(
&mut self,
_resolved: bool,
_p: &'a std::path::Path,
_api_name: &str,
) -> Result<Cow<'a, Path>, deno_permissions::PermissionCheckError> {
) -> Result<Cow<'a, std::path::Path>, deno_io::fs::FsError> {
unreachable!("snapshotting")
}
}
@@ -95,7 +96,7 @@ fn main() {
println!("cargo:rustc-env=PROFILE={}", env::var("PROFILE").unwrap());
let exts = vec![
// deno_telemetry::deno_telemetry::init_ops_and_esm(),
deno_telemetry::deno_telemetry::init_ops_and_esm(),
deno_webidl::deno_webidl::init_ops_and_esm(),
deno_url::deno_url::init_ops_and_esm(),
deno_console::deno_console::init_ops_and_esm(),
@@ -117,7 +118,9 @@ fn main() {
deno_core::snapshot::CreateSnapshotOptions {
cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"),
startup_snapshot: None,
extension_transpiler: None,
extension_transpiler: Some(std::rc::Rc::new(|specifier, source| {
deno_runtime::transpile::maybe_transpile_source(specifier, source)
})),
extensions: exts,
with_runtime_cb: None,
skip_op_registration: false,
+28 -14
View File
@@ -108,9 +108,10 @@ impl FetchPermissions for PermissionsContainer {
#[inline(always)]
fn check_read<'a>(
&mut self,
_resolved: bool,
p: &'a std::path::Path,
_api_name: &str,
) -> Result<Cow<'a, std::path::Path>, deno_permissions::PermissionCheckError> {
) -> Result<Cow<'a, std::path::Path>, deno_io::fs::FsError> {
Ok(Cow::Borrowed(p))
}
}
@@ -554,12 +555,17 @@ function get_from_env(name) {{
async fn op_variable(
op_state: Rc<RefCell<OpState>>,
#[string] path: String,
) -> Result<String, anyhow::Error> {
) -> Result<String, deno_error::JsErrorBox> {
let client = op_state.borrow().borrow::<OptAuthedClient>().0.clone();
if let Some(client) = client {
Ok(client.get_variable_value(&path).await?)
Ok(client
.get_variable_value(&path)
.await
.map_err(|e| deno_error::JsErrorBox::generic(e.to_string()))?)
} else {
anyhow::bail!("No client found in op state");
Err(deno_error::JsErrorBox::generic(
"No client found in op state",
))
}
}
@@ -569,16 +575,18 @@ async fn op_variable(
async fn op_get_result(
op_state: Rc<RefCell<OpState>>,
#[string] id: String,
) -> Result<String, anyhow::Error> {
) -> Result<String, deno_error::JsErrorBox> {
let client = op_state.borrow().borrow::<OptAuthedClient>().0.clone();
if let Some(client) = client {
let result = client
client
.get_completed_job_result::<Box<RawValue>>(&id, None)
.await?
.clone();
Ok(result.get().to_string())
.await
.map_err(|e| deno_error::JsErrorBox::generic(e.to_string()))
.map(|x| x.get().to_string())
} else {
anyhow::bail!("No client found in op state");
Err(deno_error::JsErrorBox::generic(
"No client found in op state",
))
}
}
@@ -589,7 +597,7 @@ async fn op_get_id(
op_state: Rc<RefCell<OpState>>,
#[string] flow_job_id: String,
#[string] node_id: String,
) -> Result<Option<String>, anyhow::Error> {
) -> Result<Option<String>, deno_error::JsErrorBox> {
let client = op_state.borrow().borrow::<OptAuthedClient>().0.clone();
if let Some(client) = client {
let result = client
@@ -602,7 +610,9 @@ async fn op_get_id(
Ok(None)
}
} else {
anyhow::bail!("No client found in op state");
Err(deno_error::JsErrorBox::generic(
"No client found in op state",
))
}
}
@@ -612,15 +622,18 @@ async fn op_get_id(
async fn op_resource(
op_state: Rc<RefCell<OpState>>,
#[string] path: String,
) -> Result<Option<String>, anyhow::Error> {
) -> Result<Option<String>, deno_error::JsErrorBox> {
let client = op_state.borrow().borrow::<OptAuthedClient>().0.clone();
if let Some(client) = client {
client
.get_resource_value_interpolated::<Option<Box<RawValue>>>(&path, None)
.await
.map(|x| x.map(|x| x.get().to_string()))
.map_err(|e| deno_error::JsErrorBox::generic(e.to_string()))
} else {
anyhow::bail!("No client found in op state");
Err(deno_error::JsErrorBox::generic(
"No client found in op state",
))
}
}
@@ -822,6 +835,7 @@ pub async fn eval_fetch_timeout(
};
let exts: Vec<Extension> = vec![
deno_telemetry::deno_telemetry::init_ops(),
deno_webidl::deno_webidl::init_ops(),
deno_url::deno_url::init_ops(),
deno_console::deno_console::init_ops(),