Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed Jan 8, 2025
1 parent 6e560fa commit 82585a9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ serde_json = "1.0.85"
url = { version = "2.3.1" }
import_map = { version = "0.21.0", features = ["ext"], optional = true }
thiserror = "2"
deno_error = { version = "0.5.2", features = ["url"] }
deno_error = { version = "0.5.3", features = ["url"] }
boxed_error = "0.2.3"
deno_semver = { version = "0.7.1", optional = true }
deno_package_json = { version = "0.4.0", optional = true }
Expand Down
10 changes: 5 additions & 5 deletions src/deno_json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use boxed_error::Boxed;
use deno_error::JsError;
use deno_error::JsErrorClass;
use deno_error::JsErrorBox;
use deno_path_util::url_from_file_path;
use deno_path_util::url_parent;
use deno_path_util::url_to_file_path;
Expand Down Expand Up @@ -725,8 +725,8 @@ pub enum ConfigFileError {
#[error(transparent)]
ImportMap(#[from] import_map::ImportMapError),
#[class(inherit)]
#[error("{0}")]
Other(Box<dyn JsErrorClass>),
#[error(transparent)]
Other(JsErrorBox),
}

#[derive(Debug, Error, JsError)]
Expand Down Expand Up @@ -1072,7 +1072,7 @@ impl ConfigFile {
/// at the "importMap" entry.
pub fn to_import_map(
&self,
fetch_text: impl FnOnce(&Path) -> Result<String, Box<dyn JsErrorClass>>,
fetch_text: impl FnOnce(&Path) -> Result<String, JsErrorBox>,
) -> Result<Option<ImportMapWithDiagnostics>, ConfigFileError> {
let maybe_result = self.to_import_map_value(fetch_text)?;
match maybe_result {
Expand All @@ -1089,7 +1089,7 @@ impl ConfigFile {
/// file specified at the "importMap" entry.
pub fn to_import_map_value(
&self,
read_file: impl FnOnce(&Path) -> Result<String, Box<dyn JsErrorClass>>,
read_file: impl FnOnce(&Path) -> Result<String, JsErrorBox>,
) -> Result<Option<(Cow<Url>, serde_json::Value)>, ConfigFileError> {
// has higher precedence over the path
if self.json.imports.is_some() || self.json.scopes.is_some() {
Expand Down
10 changes: 6 additions & 4 deletions src/workspace/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. MIT license.

use deno_error::JsError;
use deno_error::JsErrorClass;
use deno_error::JsErrorBox;
use deno_package_json::PackageJson;
use deno_package_json::PackageJsonLoadError;
use deno_package_json::PackageJsonRc;
Expand Down Expand Up @@ -31,6 +31,8 @@ use thiserror::Error;
use url::Url;

use crate::deno_json;
use crate::deno_json::get_ts_config_for_emit;
use crate::deno_json::BenchConfig;
use crate::deno_json::ConfigFile;
use crate::deno_json::ConfigFileError;
use crate::deno_json::ConfigFileRc;
Expand All @@ -49,11 +51,11 @@ use crate::deno_json::PatchConfigParseError;
use crate::deno_json::PublishConfig;
pub use crate::deno_json::TaskDefinition;
use crate::deno_json::TestConfig;
use crate::deno_json::ToInvalidConfigError;
use crate::deno_json::ToLockConfigError;
use crate::deno_json::TsConfigForEmit;
use crate::deno_json::TsConfigType;
use crate::deno_json::WorkspaceConfigParseError;
use crate::deno_json::{get_ts_config_for_emit, ToInvalidConfigError};
use crate::deno_json::{BenchConfig, ToLockConfigError};
use crate::glob::FilePatterns;
use crate::glob::PathOrPattern;
use crate::glob::PathOrPatternParseError;
Expand Down Expand Up @@ -559,7 +561,7 @@ impl Workspace {
pub fn create_resolver(
&self,
options: CreateResolverOptions,
read_text: impl FnOnce(&Path) -> Result<String, Box<dyn JsErrorClass>>,
read_text: impl FnOnce(&Path) -> Result<String, JsErrorBox>,
) -> Result<WorkspaceResolver, WorkspaceResolverCreateError> {
WorkspaceResolver::from_workspace(self, options, read_text)
}
Expand Down
9 changes: 5 additions & 4 deletions src/workspace/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::deno_json::ConfigFileError;
use crate::sync::new_rc;
use crate::workspace::Workspace;
use deno_error::JsError;
use deno_error::JsErrorClass;
use deno_error::JsErrorBox;
use deno_package_json::PackageJsonDepValue;
use deno_package_json::PackageJsonDepValueParseError;
use deno_package_json::PackageJsonDepWorkspaceReq;
Expand All @@ -18,10 +18,11 @@ use deno_semver::RangeSetOrTag;
use deno_semver::Version;
use deno_semver::VersionReq;
use import_map::specifier::SpecifierError;
use import_map::ImportMap;
use import_map::ImportMapDiagnostic;
use import_map::ImportMapError;
use import_map::ImportMapErrorKind;
use import_map::ImportMapWithDiagnostics;
use import_map::{ImportMap, ImportMapErrorKind};
use indexmap::IndexMap;
use serde::Deserialize;
use serde::Serialize;
Expand Down Expand Up @@ -251,12 +252,12 @@ impl WorkspaceResolver {
pub(crate) fn from_workspace(
workspace: &Workspace,
options: CreateResolverOptions,
read_file: impl FnOnce(&Path) -> Result<String, Box<dyn JsErrorClass>>,
read_file: impl FnOnce(&Path) -> Result<String, JsErrorBox>,
) -> Result<Self, WorkspaceResolverCreateError> {
fn resolve_import_map(
workspace: &Workspace,
specified_import_map: Option<SpecifiedImportMap>,
read_file: impl FnOnce(&Path) -> Result<String, Box<dyn JsErrorClass>>,
read_file: impl FnOnce(&Path) -> Result<String, JsErrorBox>,
) -> Result<Option<ImportMapWithDiagnostics>, WorkspaceResolverCreateError>
{
let root_deno_json = workspace.root_deno_json();
Expand Down

0 comments on commit 82585a9

Please sign in to comment.