1use std::path::{Path, PathBuf};
7
8pub use crate::error::{PrayError, PrayResult};
9pub use crate::lockfile::{
10 build_lockfile, lockfile_hash, lockfiles_equivalent, parse_lockfile, read_lockfile,
11 serialize_lockfile, write_lockfile, write_lockfile_if_changed, LockSource, LockedPackage,
12 LockedTarget, Lockfile, ManagedSpanRecord, ProvisionedFileRecord,
13};
14pub use crate::manifest::{
15 parse_manifest, read_manifest_text, Manifest, ManifestLocal, ManifestPackage, ManifestSource,
16 ManifestTarget, RenderPolicy,
17};
18pub use crate::package_spec::{parse_package_spec, PackageSpec};
19pub use crate::render::{render_project, write_rendered_targets, RenderedTarget};
20pub use crate::resolve::{
21 project_root_from_manifest, resolve_project, resolve_project_with_options, ResolvedLocalFile,
22 ResolvedPackage, ResolvedProject,
23};
24pub use crate::resolve_context::ResolveOptions;
25pub use crate::verify::{
26 drift_project, inspect_locked_destinations, inspect_project, verify_project,
27 VerificationFinding, VerificationReport,
28};
29
30pub fn default_manifest_path(working_directory: impl AsRef<Path>) -> PathBuf {
32 working_directory.as_ref().join("Prayfile")
33}
34
35pub fn default_lockfile_path(project_root: impl AsRef<Path>) -> PathBuf {
37 project_root.as_ref().join("Prayfile.lock")
38}
39
40#[cfg(test)]
41mod tests {
42 use super::{default_lockfile_path, default_manifest_path};
43 use std::path::Path;
44
45 #[test]
46 fn default_paths_join_project_root() {
47 let root = Path::new("/tmp/project");
48 assert_eq!(default_manifest_path(root), root.join("Prayfile"));
49 assert_eq!(default_lockfile_path(root), root.join("Prayfile.lock"));
50 }
51}