mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 07:24:07 +01:00
Upgrade Deno
This commit is contained in:
1023
src-tauri/Cargo.lock
generated
1023
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -25,8 +25,8 @@ http = "0.2.8"
|
||||
reqwest = { version = "0.11.14", features = ["json"] }
|
||||
tokio = { version = "1.25.0", features = ["sync"] }
|
||||
futures = "0.3.26"
|
||||
deno_core = "0.174.0"
|
||||
deno_ast = { version = "0.24.0", features = ["transpiling"] }
|
||||
deno_core = "0.178.0"
|
||||
deno_ast = { version = "0.25.0", features = ["transpiling"] }
|
||||
sqlx = { version = "0.6.2", features = ["sqlite", "runtime-tokio-rustls", "json", "chrono", "time", "offline"] }
|
||||
uuid = "1.3.0"
|
||||
rand = "0.8.5"
|
||||
|
||||
@@ -630,7 +630,10 @@ fn create_window(handle: &AppHandle<Wry>) -> Window<Wry> {
|
||||
.resizable(true)
|
||||
.inner_size(1100.0, 600.0)
|
||||
.hidden_title(true)
|
||||
.title("Yaak")
|
||||
.title(match is_dev() {
|
||||
true => "Yaak",
|
||||
false => "Yaak Dev",
|
||||
})
|
||||
.title_bar_style(TitleBarStyle::Overlay)
|
||||
.build()
|
||||
.expect("failed to build window");
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
use deno_ast::{MediaType, ParseParams, SourceTextInfo};
|
||||
use deno_core::error::AnyError;
|
||||
use deno_core::{op, Extension, JsRuntime, ModuleSource, ModuleType, RuntimeOptions};
|
||||
use std::rc::Rc;
|
||||
|
||||
use deno_ast::{MediaType, ParseParams, SourceTextInfo};
|
||||
use deno_core::error::AnyError;
|
||||
use deno_core::futures::FutureExt;
|
||||
use deno_core::{
|
||||
normalize_path, op, Extension, JsRuntime, ModuleCode, ModuleSource, ModuleType, RuntimeOptions,
|
||||
};
|
||||
use futures::executor;
|
||||
|
||||
pub fn run_plugin_sync(file_path: &str) -> Result<(), AnyError> {
|
||||
@@ -26,7 +28,9 @@ pub async fn run_plugin(file_path: &str) -> Result<(), AnyError> {
|
||||
.execute_script("<runtime>", include_str!("runtime.js"))
|
||||
.expect("Failed to execute runtime.js");
|
||||
|
||||
let main_module = deno_core::resolve_path(file_path).expect("Failed to resolve path");
|
||||
let current_dir = &std::env::current_dir().expect("Unable to get CWD");
|
||||
let main_module =
|
||||
deno_core::resolve_path(file_path, current_dir).expect("Failed to resolve path");
|
||||
let mod_id = runtime
|
||||
.load_main_module(&main_module, None)
|
||||
.await
|
||||
@@ -66,12 +70,14 @@ impl deno_core::ModuleLoader for TsModuleLoader {
|
||||
) -> std::pin::Pin<Box<deno_core::ModuleSourceFuture>> {
|
||||
let module_specifier = module_specifier.clone();
|
||||
async move {
|
||||
let path = module_specifier.to_file_path().unwrap();
|
||||
let path = module_specifier
|
||||
.to_file_path()
|
||||
.expect("Failed to convert to file path");
|
||||
|
||||
// Determine what the MediaType is (this is done based on the file
|
||||
// extension) and whether transpiling is required.
|
||||
let media_type = MediaType::from(&path);
|
||||
let (module_type, should_transpile) = match MediaType::from(&path) {
|
||||
let media_type = MediaType::from_path(&path);
|
||||
let (module_type, should_transpile) = match media_type {
|
||||
MediaType::JavaScript | MediaType::Mjs | MediaType::Cjs => {
|
||||
(ModuleType::JavaScript, false)
|
||||
}
|
||||
@@ -84,7 +90,7 @@ impl deno_core::ModuleLoader for TsModuleLoader {
|
||||
| MediaType::Dcts
|
||||
| MediaType::Tsx => (ModuleType::JavaScript, true),
|
||||
MediaType::Json => (ModuleType::Json, false),
|
||||
_ => panic!("Unknown extension {:?}", path.extension()),
|
||||
_ => panic!("Unknown extension {:?}", path),
|
||||
};
|
||||
|
||||
// Read the file, transpile if necessary.
|
||||
@@ -105,7 +111,7 @@ impl deno_core::ModuleLoader for TsModuleLoader {
|
||||
|
||||
// Load and return module.
|
||||
let module = ModuleSource {
|
||||
code: code.into_bytes().into_boxed_slice(),
|
||||
code: ModuleCode::from(code),
|
||||
module_type,
|
||||
module_url_specified: module_specifier.to_string(),
|
||||
module_url_found: module_specifier.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user