turbopack_env/
issue.rs

1use turbo_tasks::{ResolvedVc, Vc};
2use turbo_tasks_fs::FileSystemPath;
3use turbopack_core::issue::{Issue, IssueStage, OptionStyledString, StyledString};
4
5/// An issue that occurred while resolving the parsing or evaluating the .env.
6#[turbo_tasks::value(shared)]
7pub struct ProcessEnvIssue {
8    pub path: ResolvedVc<FileSystemPath>,
9    pub description: ResolvedVc<StyledString>,
10}
11
12#[turbo_tasks::value_impl]
13impl Issue for ProcessEnvIssue {
14    #[turbo_tasks::function]
15    fn title(&self) -> Vc<StyledString> {
16        StyledString::Text("Error loading dotenv file".into()).cell()
17    }
18
19    #[turbo_tasks::function]
20    fn stage(&self) -> Vc<IssueStage> {
21        IssueStage::Load.into()
22    }
23
24    #[turbo_tasks::function]
25    fn file_path(&self) -> Vc<FileSystemPath> {
26        *self.path
27    }
28
29    #[turbo_tasks::function]
30    fn description(&self) -> Vc<OptionStyledString> {
31        Vc::cell(Some(self.description))
32    }
33}