Skip to main content

bynk_project/
lib.rs

1//! Bynk's project model (#1113, P4.0): discovery, the unit dependency graph,
2//! path resolution, cross-unit consistency checks, and the schema-registry
3//! document's read/write halves.
4//!
5//! Extracted from `bynk-emit/src/project.rs` and its `project/` submodule
6//! tree so `bynk-emit` becomes a *dependent* of this crate rather than owning
7//! this code directly (`design/tracks/project-model.md` §3, §6 row P4.0).
8//! `bynk-check`/`bynk-syntax`/grammar/AST/emitter language surface is
9//! untouched — a crate-boundary and internal-representation move, not a
10//! language change.
11//!
12//! What did **not** move (stays in `bynk-emit`, per the slice's own scope):
13//! `schema_registry::reconcile` and its helpers (`bynk_check`-coupled via
14//! `UnitTable`, pending P4.1's `bynk-check` entry point); `diagnostics::Mode`,
15//! `ErrorSink`, `ProjectAnalysis`, `ProjectFailure`, `ContextSequenceInfo`,
16//! `ContextBoundaryInfo` (facts about how the pipeline is driven/consumed,
17//! not about the project itself); `symbols` (`UnitTable`, `bynk_check`-coupled
18//! via `resolver::MethodTable`); `validate`/`tests_emit` (checking and test
19//! codegen, not project modelling).
20//!
21//! The public surface below is enumerated by hand (R10.4-style) — no blanket
22//! `pub use module::*`.
23
24// The README's `rust` examples are compiled (and, unless marked `no_run`, run)
25// as doctests, so they cannot rot (#1645). `cfg(doctest)` keeps this item out of
26// every build and out of the docs.rs front page, which the `//!` docs above own.
27#[cfg(doctest)]
28#[doc = include_str!("../README.md")]
29struct ReadmeDoctests;
30
31pub mod assets;
32pub mod consistency;
33pub mod containers;
34pub mod contracts_lock;
35pub mod dev_ack;
36pub mod discovery;
37pub mod env_protocol;
38pub mod environment;
39pub mod graph;
40pub mod hyperdrive;
41pub mod json;
42pub mod lock;
43pub mod manifest;
44#[cfg(feature = "schema")]
45pub mod manifest_schema;
46pub mod packages;
47pub mod parse_cache;
48pub mod paths;
49pub mod roots;
50pub mod schema_registry;
51pub mod snapshots;
52pub mod vectorize;
53pub mod worker_groups;
54pub mod worker_layout;
55pub mod workspace;
56pub mod wrangler_keys;
57
58mod diagnostics;
59
60pub use consistency::{
61    check_directory_kind_consistency, check_directory_name_consistency,
62    check_group_kind_consistency, check_group_module_docs, check_path_name_alignment,
63};
64pub use diagnostics::{AttributedError, LabelFile};
65pub use discovery::{
66    ParsedFile, RecoveredSources, case_effective_tier, check_file_directory_conflicts,
67    discover_bynk_files, discover_project_files, holds_bynk_source, is_project_boundary,
68    nested_projects, parse_sources, parse_sources_recovering, read_adapter_binding,
69    read_adapter_include, read_source, suite_effective_tier_is_system,
70};
71pub use graph::{detect_consumes_cycles, detect_provider_dependency_cycles};
72pub use json::json_string;
73pub use manifest::{
74    DependencySource, DependencySpec, PackageConfig, RegistryConfig, WorkspaceConfig,
75    read_package_config,
76};
77pub use packages::{
78    GraphProblem, Package, PackageGraph, PackageId, dependency_trees, display_names,
79    display_unit_name, resolve_graph, split_canonical,
80};
81pub use paths::{
82    BuildConfig, CheckConfig, ClientConfig, ClientLayout, MANIFEST_MAP_TABLES, MANIFEST_TABLES,
83    PG_SCHEMA_FILE, PROFILE_NAMES, ProfileConfig, ProjectPaths, ProjectPathsError, TestPostgres,
84    TestTarget, UnstableConfig, WorkersConfig, check_manifest, check_manifest_str, commons_dir_for,
85    duplicate_compatibility_flag_warning, is_multi_file_layout, is_unpinned_range, normalize_rel,
86    read_check_config, read_test_postgres, read_unstable_config, renamed_unit_name,
87    render_package_json, test_postgres_of, try_read_build_config, try_read_build_config_with,
88    try_read_mutate_exclude, try_read_profiles, try_read_project_paths,
89    try_read_project_paths_with, try_read_test_targets, try_read_unstable_config,
90    try_read_unstable_config_with, try_read_workers_config, try_read_workers_config_with,
91    ts_output_path, unit_path_matches, worker_dir_name, worker_file_source_path,
92    worker_handlers_output_path, worker_handlers_source_path,
93};
94pub use roots::{Roots, SchemaLock, UnitKind};
95pub use workspace::{
96    ImplicitWorkspace, ImplicitWorkspaceError, Workspace, find_parent_workspace,
97    implicit_workspace, is_workspace_root, load_workspace,
98};