mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-22 12:34:39 +00:00
build: upgrade tinymist-{derive,l10n,package,std}, typst-shim edition… (#1995)
… to 2024
This commit is contained in:
parent
46e7eca2b4
commit
920a318df4
18 changed files with 22 additions and 22 deletions
|
|
@ -3,7 +3,6 @@ name = "tinymist-analysis"
|
||||||
description = "Typst Static Analyzers for Tinymist."
|
description = "Typst Static Analyzers for Tinymist."
|
||||||
categories = ["compilers"]
|
categories = ["compilers"]
|
||||||
keywords = ["language", "typst"]
|
keywords = ["language", "typst"]
|
||||||
# group: world
|
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ keywords = ["typst"]
|
||||||
version = "0.13.16"
|
version = "0.13.16"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition = "2024"
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
rust-version.workspace = true
|
rust-version.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ extern crate proc_macro;
|
||||||
|
|
||||||
use proc_macro::TokenStream;
|
use proc_macro::TokenStream;
|
||||||
use quote::quote;
|
use quote::quote;
|
||||||
use syn::{parse_macro_input, DeriveInput};
|
use syn::{DeriveInput, parse_macro_input};
|
||||||
|
|
||||||
#[proc_macro_derive(BindTyCtx, attributes(bind))]
|
#[proc_macro_derive(BindTyCtx, attributes(bind))]
|
||||||
pub fn bind_ty_ctx(input: TokenStream) -> TokenStream {
|
pub fn bind_ty_ctx(input: TokenStream) -> TokenStream {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ keywords = ["language", "typst"]
|
||||||
version = "0.13.16"
|
version = "0.13.16"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition = "2024"
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
rust-version.workspace = true
|
rust-version.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ keywords = ["api", "language", "typst"]
|
||||||
version = "0.13.16"
|
version = "0.13.16"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition = "2024"
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
rust-version.workspace = true
|
rust-version.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use std::io::{self, Read};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use ecow::{eco_format, EcoVec};
|
use ecow::{EcoVec, eco_format};
|
||||||
use tinymist_std::{ImmutBytes, ImmutPath};
|
use tinymist_std::{ImmutBytes, ImmutPath};
|
||||||
use typst::diag::{PackageError, PackageResult};
|
use typst::diag::{PackageError, PackageResult};
|
||||||
use typst::syntax::package::{PackageSpec, VersionlessPackageSpec};
|
use typst::syntax::package::{PackageSpec, VersionlessPackageSpec};
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ impl<S: AsRef<str>> PackFs for HttpPack<S> {
|
||||||
let reader = match resp.and_then(|r| r.error_for_status()) {
|
let reader = match resp.and_then(|r| r.error_for_status()) {
|
||||||
Ok(response) => response,
|
Ok(response) => response,
|
||||||
Err(err) if matches!(err.status().map(|s| s.as_u16()), Some(404)) => {
|
Err(err) if matches!(err.status().map(|s| s.as_u16()), Some(404)) => {
|
||||||
return Err(PackageError::NotFound(spec.clone()))
|
return Err(PackageError::NotFound(spec.clone()));
|
||||||
}
|
}
|
||||||
Err(err) => return Err(PackageError::NetworkFailed(Some(eco_format!("{err}")))),
|
Err(err) => return Err(PackageError::NetworkFailed(Some(eco_format!("{err}")))),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
use std::{io::Read, path::Path};
|
use std::{io::Read, path::Path};
|
||||||
|
|
||||||
use js_sys::Uint8Array;
|
use js_sys::Uint8Array;
|
||||||
use typst::diag::{eco_format, EcoString};
|
use typst::diag::{EcoString, eco_format};
|
||||||
use wasm_bindgen::{prelude::*, JsValue};
|
use wasm_bindgen::{JsValue, prelude::*};
|
||||||
|
|
||||||
use super::{PackageError, PackageRegistry, PackageSpec};
|
use super::{PackageError, PackageRegistry, PackageSpec};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@ use std::path::Path;
|
||||||
use std::sync::{Arc, OnceLock};
|
use std::sync::{Arc, OnceLock};
|
||||||
|
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use reqwest::blocking::Response;
|
|
||||||
use reqwest::Certificate;
|
use reqwest::Certificate;
|
||||||
|
use reqwest::blocking::Response;
|
||||||
use tinymist_std::ImmutPath;
|
use tinymist_std::ImmutPath;
|
||||||
use typst::diag::{eco_format, EcoString, PackageResult, StrResult};
|
use typst::diag::{EcoString, PackageResult, StrResult, eco_format};
|
||||||
use typst::syntax::package::{PackageVersion, VersionlessPackageSpec};
|
use typst::syntax::package::{PackageVersion, VersionlessPackageSpec};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
DummyNotifier, Notifier, PackageError, PackageRegistry, PackageSpec, DEFAULT_REGISTRY,
|
DEFAULT_REGISTRY, DummyNotifier, Notifier, PackageError, PackageRegistry, PackageSpec,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The http package registry for typst.ts.
|
/// The http package registry for typst.ts.
|
||||||
|
|
@ -289,7 +289,7 @@ impl PackageStorage {
|
||||||
let reader = match resp.and_then(|r| r.error_for_status()) {
|
let reader = match resp.and_then(|r| r.error_for_status()) {
|
||||||
Ok(response) => response,
|
Ok(response) => response,
|
||||||
Err(err) if matches!(err.status().map(|s| s.as_u16()), Some(404)) => {
|
Err(err) if matches!(err.status().map(|s| s.as_u16()), Some(404)) => {
|
||||||
return Err(PackageError::NotFound(spec.clone()))
|
return Err(PackageError::NotFound(spec.clone()));
|
||||||
}
|
}
|
||||||
Err(err) => return Err(PackageError::NetworkFailed(Some(eco_format!("{err}")))),
|
Err(err) => return Err(PackageError::NetworkFailed(Some(eco_format!("{err}")))),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ description = "Additional functions wrapping Rust's standard library."
|
||||||
version = "0.13.16"
|
version = "0.13.16"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition = "2024"
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,5 +108,5 @@ pub use well_known::*;
|
||||||
/// The prelude of the Typst module.
|
/// The prelude of the Typst module.
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub use comemo::Prehashed;
|
pub use comemo::Prehashed;
|
||||||
pub use ecow::{eco_format, eco_vec, EcoString, EcoVec};
|
pub use ecow::{EcoString, EcoVec, eco_format, eco_vec};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,7 @@ pub mod prelude {
|
||||||
use crate::Error;
|
use crate::Error;
|
||||||
|
|
||||||
pub use super::{IgnoreLogging, WithContext, WithContextUntyped};
|
pub use super::{IgnoreLogging, WithContext, WithContextUntyped};
|
||||||
pub use crate::{bail, Result};
|
pub use crate::{Result, bail};
|
||||||
|
|
||||||
pub fn map_string_err<T: ToString>(loc: &'static str) -> impl Fn(T) -> Error {
|
pub fn map_string_err<T: ToString>(loc: &'static str) -> impl Fn(T) -> Error {
|
||||||
move |e| Error::new(loc, e.to_string().to_error_kind(), None)
|
move |e| Error::new(loc, e.to_string().to_error_kind(), None)
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,7 @@ mod sys {
|
||||||
use windows_sys::Win32::Foundation::HANDLE;
|
use windows_sys::Win32::Foundation::HANDLE;
|
||||||
use windows_sys::Win32::Foundation::{ERROR_INVALID_FUNCTION, ERROR_LOCK_VIOLATION};
|
use windows_sys::Win32::Foundation::{ERROR_INVALID_FUNCTION, ERROR_LOCK_VIOLATION};
|
||||||
use windows_sys::Win32::Storage::FileSystem::{
|
use windows_sys::Win32::Storage::FileSystem::{
|
||||||
LockFileEx, UnlockFile, LOCKFILE_EXCLUSIVE_LOCK, LOCKFILE_FAIL_IMMEDIATELY,
|
LOCKFILE_EXCLUSIVE_LOCK, LOCKFILE_FAIL_IMMEDIATELY, LockFileEx, UnlockFile,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub(super) fn lock_shared(file: &File) -> Result<()> {
|
pub(super) fn lock_shared(file: &File) -> Result<()> {
|
||||||
|
|
|
||||||
|
|
@ -723,7 +723,7 @@ fn exclude_from_content_indexing(path: &Path) {
|
||||||
use std::iter::once;
|
use std::iter::once;
|
||||||
use std::os::windows::prelude::OsStrExt;
|
use std::os::windows::prelude::OsStrExt;
|
||||||
use windows_sys::Win32::Storage::FileSystem::{
|
use windows_sys::Win32::Storage::FileSystem::{
|
||||||
GetFileAttributesW, SetFileAttributesW, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED,
|
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED, GetFileAttributesW, SetFileAttributesW,
|
||||||
};
|
};
|
||||||
|
|
||||||
let path: Vec<u16> = path.as_os_str().encode_wide().chain(once(0)).collect();
|
let path: Vec<u16> = path.as_os_str().encode_wide().chain(once(0)).collect();
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ pub fn diff(path: &Path, base: &Path) -> Option<PathBuf> {
|
||||||
mod test {
|
mod test {
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use super::{clean as inner_path_clean, unix_slash, PathClean};
|
use super::{PathClean, clean as inner_path_clean, unix_slash};
|
||||||
|
|
||||||
pub fn clean<P: AsRef<Path>>(path: P) -> String {
|
pub fn clean<P: AsRef<Path>>(path: P) -> String {
|
||||||
unix_slash(&inner_path_clean(path))
|
unix_slash(&inner_path_clean(path))
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,9 @@
|
||||||
name = "typst-shim"
|
name = "typst-shim"
|
||||||
description = "A compatibility layer for Typst release and mainline versions."
|
description = "A compatibility layer for Typst release and mainline versions."
|
||||||
authors = ["The Typst Project Developers"]
|
authors = ["The Typst Project Developers"]
|
||||||
|
# group: world
|
||||||
version = "0.13.16"
|
version = "0.13.16"
|
||||||
edition.workspace = true
|
edition = "2024"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
//! Typst Evaluation
|
//! Typst Evaluation
|
||||||
|
|
||||||
use comemo::Track;
|
use comemo::Track;
|
||||||
|
use typst::World;
|
||||||
use typst::diag::SourceResult;
|
use typst::diag::SourceResult;
|
||||||
use typst::engine::{Engine, Route, Sink, Traced};
|
use typst::engine::{Engine, Route, Sink, Traced};
|
||||||
use typst::foundations::{Context, Func, Module, Value};
|
use typst::foundations::{Context, Func, Module, Value};
|
||||||
use typst::introspection::Introspector;
|
use typst::introspection::Introspector;
|
||||||
use typst::syntax::Source;
|
use typst::syntax::Source;
|
||||||
use typst::World;
|
|
||||||
|
|
||||||
pub use typst_eval::*;
|
pub use typst_eval::*;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
//! Typst Evaluation
|
//! Typst Evaluation
|
||||||
|
|
||||||
use comemo::Track;
|
use comemo::Track;
|
||||||
|
use typst::World;
|
||||||
use typst::diag::SourceResult;
|
use typst::diag::SourceResult;
|
||||||
use typst::engine::{Engine, Route, Sink, Traced};
|
use typst::engine::{Engine, Route, Sink, Traced};
|
||||||
use typst::foundations::{Context, Func, Module, Value};
|
use typst::foundations::{Context, Func, Module, Value};
|
||||||
use typst::introspection::Introspector;
|
use typst::introspection::Introspector;
|
||||||
use typst::syntax::Source;
|
use typst::syntax::Source;
|
||||||
use typst::World;
|
|
||||||
|
|
||||||
pub use typst_eval::*;
|
pub use typst_eval::*;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue