Skip to content
Open
4 changes: 0 additions & 4 deletions src/bun.js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ use bun_core::{Global, Output};
use bun_jsc::virtual_machine::VirtualMachine;
use bun_standalone_graph::StandaloneModuleGraph::{Flags as GraphFlags, StandaloneModuleGraph};

// Thin re-exports (mirrors `pub const X = @import(...)` at file top).
pub use crate::api;
pub use crate::webcore;

pub(crate) fn apply_standalone_runtime_flags(
b: &mut bun_bundler::Transpiler,
graph: &StandaloneModuleGraph,
Expand Down
2 changes: 1 addition & 1 deletion src/bun_core/Global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ pub fn crash() -> ! {
exit(1);
}

// `BunInfo` (struct + `generate()`) lives at `bun_runtime::server::BunInfo`
// `BunInfo` (struct + `generate()`) lives in `bun_runtime`'s server module
// because it depends on analytics/js_parser/interchange — all higher-tier. Only the version constants below
// are needed at this tier.

Expand Down
1 change: 0 additions & 1 deletion src/bun_core/string/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub use self::unicode::{
decode_wtf8_rune_t_multibyte, wtf8_byte_sequence_length,
wtf8_byte_sequence_length_with_invalid,
};
pub use unicode_draft::CodePointZero;

// Sub-modules (peer files under `src/string/immutable/`).
#[path = "immutable/escapeHTML.rs"]
Expand Down
9 changes: 1 addition & 8 deletions src/bun_core/string/immutable/unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ fn append_u16_as_u8(dst: &mut Vec<u8>, src: &[u16]) {

/// Integer types usable as the codepoint result of [`decode_wtf8_rune_t`].
/// Sealed to two instantiations (`i32` aka `CodePoint`, and `u32`);
/// every caller in-tree is one of these. `ZERO_VALUE` is the per-type sentinel
/// (`-1` for i32, `0` for u32).
/// every caller in-tree is one of these.
///
/// Bounds widened from `From<u8>` to include the bit-ops needed by
/// `decode_wtf8_rune_t_multibyte` plus a `from_u32` constructor (folds in the
Expand All @@ -66,8 +65,6 @@ pub trait CodePointZero:
+ core::ops::BitOr<Output = Self>
+ core::ops::BitAnd<Output = Self>
{
const ZERO_VALUE: Self;
const MAX: Self;
fn from_u32(v: u32) -> Self;
/// Alias kept for `decode_wtf8_rune_t_multibyte` integer-literal compares.
#[inline]
Expand All @@ -77,17 +74,13 @@ pub trait CodePointZero:
}

impl CodePointZero for CodePoint {
const ZERO_VALUE: Self = -1;
const MAX: Self = CodePoint::MAX;
#[inline]
fn from_u32(v: u32) -> Self {
v as i32
}
}

impl CodePointZero for u32 {
const ZERO_VALUE: Self = 0;
const MAX: Self = u32::MAX;
#[inline]
fn from_u32(v: u32) -> Self {
v
Expand Down
3 changes: 0 additions & 3 deletions src/bundler/LinkerContext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@ pub(crate) use crate::linker_context::scan_imports_and_exports::scan_imports_and

pub(crate) use crate::linker_context::compute_chunks::compute_chunks;
pub use crate::linker_context::metafile_builder as MetafileBuilder;
pub use crate::linker_context::output_file_list_builder as OutputFileListBuilder;
pub use crate::linker_context::static_route_visitor as StaticRouteVisitor;
// do_step5 / create_exports_for_file are inherent methods on LinkerContext (see
// `linker_context/doStep5.rs`), not free functions — no item re-export.
pub(crate) use crate::linker_context::compute_cross_chunk_dependencies::compute_cross_chunk_dependencies;
pub use crate::linker_context::do_step5;
pub(crate) use crate::linker_context::generate_chunks_in_parallel::generate_chunks_in_parallel;
pub(crate) use crate::linker_context::post_process_css_chunk::post_process_css_chunk;
pub(crate) use crate::linker_context::post_process_html_chunk::post_process_html_chunk;
Expand Down
4 changes: 1 addition & 3 deletions src/bundler/bundle_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ pub mod bv2_impl {

/// TYPE_ONLY subset of the `Framework` fields
/// the bundler/parser actually consult; `file_system_router_types`
/// stays in T6 because only `bake::FrameworkRouter` reads it.
/// stays in T6 because only `bake::framework_router` reads it.
#[non_exhaustive]
pub struct Framework {
pub(crate) built_in_modules: bun_collections::StringArrayHashMap<BuiltInModule>,
Expand Down Expand Up @@ -7300,7 +7300,6 @@ pub mod bv2_impl {
}
}

pub use crate::AdditionalFile;
pub use bun_core::cheap_prefix_normalizer;

#[derive(Clone, Copy, Default)]
Expand Down Expand Up @@ -7683,7 +7682,6 @@ pub mod bv2_impl {
pub use crate::BundleThread::{BuildResult, BundleV2Result, CompletionStruct, singleton};

// re-exports
pub use crate::IndexStringMap::IndexStringMap;
pub use bun_ast::Loc;

// C++ binding for lazy metafile getter (defined in BundlerMetafile.cpp)
Expand Down
1 change: 0 additions & 1 deletion src/bundler/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ pub(crate) use bun_ast::{Index, IndexInt};
pub mod options {
pub use super::OutputFile;
pub use super::options_impl::*;
pub use super::output_file::BakeExtra;
pub use super::output_file::IndexOptional;
/// `OutputFile.init` argument struct.
pub(crate) use super::output_file::Options as OutputFileInit;
Expand Down
4 changes: 1 addition & 3 deletions src/codegen/generate-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1752,9 +1752,7 @@ const rustModuleResolver = (() => {
const asMatch = item.match(/^(\S+)\s+as\s+(\w+)$/);
const source = asMatch ? asMatch[1] : item;
const exported = asMatch ? asMatch[2] : item;
// Skip module re-exports: `pub use foo::glob as Glob` re-exports a
// *module* (lowercase source leaf), not a type — `crate::api::Glob`
// wouldn't name a struct.
// A module re-export (lowercase source leaf) does not name a type.
const sourceLeaf = source.split("::").pop()!;
if (!/^[A-Z]/.test(sourceLeaf)) continue;
if (!/^[A-Z]\w*$/.test(exported)) continue;
Expand Down
1 change: 0 additions & 1 deletion src/collections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,5 +479,4 @@ pub mod hash_map {
}

pub mod array_list;
pub use array_list::ArrayListAlignedIn;
pub use array_list::ArrayListDefault;
3 changes: 1 addition & 2 deletions src/css/css_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub use crate::properties::{
css_modules::Composes,
custom::{TokenList, TokenListFns},
};
pub use crate::rules::custom_media::CustomMediaRule as CustomMedia;
pub use crate::rules::{
self as css_rules, CssRule, CssRuleList, Location, MinifyContext, StyleContext,
import::{ImportConditions, ImportRule},
Expand All @@ -74,7 +73,7 @@ pub use crate::selectors::{
parser::{Component, PseudoClass, PseudoElement, Selector, SelectorList},
selector,
};
pub use crate::values::ident::{CustomIdentFns, DashedIdentFns, IdentFns};
pub use crate::values::ident::{CustomIdentFns, DashedIdentFns};

pub use crate::values::{
color::ColorFallbackKind,
Expand Down
1 change: 0 additions & 1 deletion src/css/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ macro_rules! css_eql_partialeq {
}
)+};
}
pub use css_eql_partialeq;

impl CssEql for [u8] {
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/css/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub(crate) use compat::Feature;
/// Alias of `error::ParserErrorKind`.
pub use error::ParserErrorKind as ParseErrorKind;
pub use properties::custom::{TokenList, TokenListFns};
pub use values::ident::{CustomIdentFns, DashedIdentFns, IdentFns};
pub use values::ident::IdentFns;
pub use values::string::{CssString as CSSString, CssStringFns as CSSStringFns};

// `css::generic::*` is an alternate spelling of the protocol traits +
Expand Down
1 change: 0 additions & 1 deletion src/css/rules/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ impl ContainerName {
}
}

pub use ContainerName as ContainerNameFns;
pub(crate) type ContainerSizeFeature = QueryFeature<ContainerSizeFeatureId>;

#[derive(Clone, Copy, PartialEq, Eq, css::DefineEnumProperty)]
Expand Down
3 changes: 0 additions & 3 deletions src/css/selectors/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ use bun_collections::ArrayHashMap;

bun_core::declare_scope!(CSS_SELECTORS, visible);

pub use css::PrintErr as _PrintErr;
pub use css::Printer as _Printer; // re-export alias parity

pub(crate) use parser::Component;
pub use parser::PseudoClass;
pub use parser::PseudoElement;
Expand Down
4 changes: 1 addition & 3 deletions src/install/PackageManager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,7 @@ pub use resolution::{assign_root_resolution, resolve_from_disk_cache};

pub use self::progress_strings::ProgressStrings;

pub use self::patch_package::{PatchCommitResult, do_patch_commit, prepare_patch};

pub use self::process_dependency_list::GitResolver;
pub use self::patch_package::PatchCommitResult;

pub use self::run_tasks::{
alloc_github_url, decrement_pending_tasks, drain_dependency_list, flush_dependency_queue,
Expand Down
2 changes: 0 additions & 2 deletions src/install/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ pub use repository::{Repository, RepositoryExt};
pub use resolution::Tag as ResolutionTag;

// Real types — previously shadowed by inline ZST stubs in this file.
pub use _folder_resolver::FolderResolution;
pub use isolated_install::Store;
pub use lifecycle_script_runner::LifecycleScriptSubprocess;
pub use network_task::NetworkTask;
Expand All @@ -313,7 +312,6 @@ pub use package_manager_real::security_scanner::SecurityScanSubprocess;
pub use package_manager_task::Task;
pub use package_manifest_map::PackageManifestMap;
pub use patch_install::PatchTask;
pub use postinstall_optimizer::PostinstallOptimizer;
pub use tarball_stream::TarballStream;

// PackageManager + its associated types — re-exported from the file-backed
Expand Down
2 changes: 0 additions & 2 deletions src/install/patch_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ use crate::{
resolution::Resolution,
};

pub use crate::lockfile::PatchedDep;

bun_output::declare_scope!(InstallPatch, visible);

/// Length of the hex representation of `u64::MAX` (i.e. 16).
Expand Down
6 changes: 3 additions & 3 deletions src/jsc/VirtualMachine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub struct VirtualMachine {
// `transpiler.resolver.standalone_module_graph` without a downcast.
pub standalone_module_graph: Option<&'static dyn bun_resolver::StandaloneModuleGraph>,
pub smol: bool,
// LAYERING: real type is `bun_runtime::api::dns::Resolver::Order` (forward
// LAYERING: real type is `bun_runtime::dns_jsc::Order` (forward
// dep); stored as its `u8` repr.
pub dns_result_order: u8,
pub cpu_profiler_config: Option<crate::bun_cpu_profiler::CPUProfilerConfig>,
Expand Down Expand Up @@ -2021,7 +2021,7 @@ extern crate alloc;
// §Dispatch — `bun_runtime` vtable.
//
// `init` / `load_entry_point` / the `bun -e` path reach into types that live
// in the higher-tier `bun_runtime` crate (`api::Timer::All`, `node::fs`,
// in the higher-tier `bun_runtime` crate (`timer::All`, `node::fs`,
// `webcore::Body`, the bundler entry-point generator, …). Per PORTING.md
// §Dispatch (cold-path), the low tier defines a manual vtable; `bun_runtime`
// defines the `#[no_mangle]` static `__BUN_RUNTIME_HOOKS`. The fn-ptr
Expand Down Expand Up @@ -3169,7 +3169,7 @@ pub struct Options {
pub env_loader: Option<NonNull<bun_dotenv::Loader>>,
pub store_fd: bool,
pub smol: bool,
// LAYERING: real type is `bun_runtime::api::dns::Resolver::Order` (forward
// LAYERING: real type is `bun_runtime::dns_jsc::Order` (forward
// dep); stored as its `u8` repr.
pub dns_result_order: u8,
/// `--print` needs the result from evaluating the main module.
Expand Down
17 changes: 0 additions & 17 deletions src/jsc/bindings/ErrorCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const errors: ErrorCodeMapping = [
["ERR_BORINGSSL", Error],
["ERR_ZSTD", Error],
["ERR_BROTLI_INVALID_PARAM", RangeError],
["ERR_BUFFER_CONTEXT_NOT_AVAILABLE", Error],
["ERR_BUFFER_OUT_OF_BOUNDS", RangeError],
["ERR_BUFFER_TOO_LARGE", RangeError],
["ERR_CHILD_PROCESS_IPC_REQUIRED", Error],
Expand All @@ -40,9 +39,7 @@ const errors: ErrorCodeMapping = [
["ERR_CRYPTO_HASH_UPDATE_FAILED", Error],
["ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS", Error],
["ERR_CRYPTO_INCOMPATIBLE_KEY", Error],
["ERR_CRYPTO_INITIALIZATION_FAILED", Error],
["ERR_CRYPTO_INVALID_AUTH_TAG", TypeError],
["ERR_CRYPTO_INVALID_COUNTER", TypeError],
["ERR_CRYPTO_INVALID_CURVE", TypeError],
["ERR_CRYPTO_INVALID_DIGEST", TypeError],
["ERR_CRYPTO_INVALID_IV", TypeError],
Expand All @@ -54,12 +51,9 @@ const errors: ErrorCodeMapping = [
["ERR_CRYPTO_INVALID_MESSAGELEN", RangeError],
["ERR_CRYPTO_INVALID_SCRYPT_PARAMS", RangeError],
["ERR_CRYPTO_INVALID_STATE", Error],
["ERR_CRYPTO_INVALID_TAG_LENGTH", RangeError],
["ERR_CRYPTO_JOB_INIT_FAILED", Error],
["ERR_CRYPTO_JWK_UNSUPPORTED_CURVE", Error],
["ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE", Error],
["ERR_CRYPTO_OPERATION_FAILED", Error],
["ERR_CRYPTO_SCRYPT_INVALID_PARAMETER", Error],
["ERR_CRYPTO_SIGN_KEY_REQUIRED", Error],
["ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH", RangeError],
["ERR_CRYPTO_UNKNOWN_CIPHER", Error],
Expand All @@ -72,7 +66,6 @@ const errors: ErrorCodeMapping = [
["ERR_ENCODING_INVALID_ENCODED_DATA", TypeError],
["ERR_ENCODING_NOT_SUPPORTED", RangeError],
["ERR_EVENT_RECURSION", Error],
["ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE", Error],
["ERR_FEATURE_UNAVAILABLE_ON_PLATFORM", TypeError],
["ERR_FORMDATA_PARSE_ERROR", TypeError],
["ERR_FS_CP_DIR_TO_NON_DIR", Error],
Expand Down Expand Up @@ -130,7 +123,6 @@ const errors: ErrorCodeMapping = [
["ERR_HTTP2_INVALID_SETTING_VALUE", TypeError, "TypeError", RangeError],
["ERR_ILLEGAL_CONSTRUCTOR", TypeError],
["ERR_INCOMPATIBLE_OPTION_PAIR", TypeError],
["ERR_INVALID_ADDRESS", Error],
["ERR_INVALID_ADDRESS_FAMILY", RangeError],
["ERR_INVALID_ARG_TYPE", TypeError],
["ERR_INVALID_ARG_VALUE", TypeError, undefined, RangeError],
Expand All @@ -146,7 +138,6 @@ const errors: ErrorCodeMapping = [
["ERR_INVALID_MIME_SYNTAX", TypeError],
["ERR_INVALID_MODULE", Error],
["ERR_INVALID_OBJECT_DEFINE_PROPERTY", TypeError],
["ERR_INVALID_PACKAGE_CONFIG", Error],
["ERR_INVALID_PROTOCOL", TypeError],
["ERR_INVALID_RETURN_VALUE", TypeError],
["ERR_INVALID_STATE", Error, undefined, TypeError, RangeError],
Expand All @@ -160,15 +151,12 @@ const errors: ErrorCodeMapping = [
["ERR_IPC_ONE_PIPE", Error],
["ERR_LOAD_SQLITE_EXTENSION", Error],
["ERR_MEMORY_ALLOCATION_FAILED", Error],
["ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE", Error],
["ERR_METHOD_NOT_IMPLEMENTED", Error],
["ERR_MISSING_ARGS", TypeError],
["ERR_MISSING_PASSPHRASE", TypeError],
["ERR_MISSING_PLATFORM_FOR_WORKER", Error],
["ERR_MODULE_LINK_MISMATCH", TypeError],
["ERR_MODULE_NOT_FOUND", Error],
["ERR_MULTIPLE_CALLBACK", Error],
["ERR_NON_CONTEXT_AWARE_DISABLED", Error],
["ERR_OPERATION_FAILED", Error],
["ERR_OUT_OF_RANGE", RangeError],
["ERR_PARSE_ARGS_INVALID_OPTION_VALUE", TypeError],
Expand Down Expand Up @@ -218,7 +206,6 @@ const errors: ErrorCodeMapping = [
["ERR_MYSQL_IDLE_TIMEOUT", Error, "MySQLError"],
["ERR_MYSQL_LIFETIME_TIMEOUT", Error, "MySQLError"],
["ERR_UNHANDLED_REJECTION", Error, "UnhandledPromiseRejection"],
["ERR_REQUIRE_ASYNC_MODULE", Error],
["ERR_S3_INVALID_ENDPOINT", Error],
["ERR_S3_INVALID_METHOD", Error],
["ERR_S3_INVALID_PATH", Error],
Expand Down Expand Up @@ -259,7 +246,6 @@ const errors: ErrorCodeMapping = [
["ERR_TLS_INVALID_PROTOCOL_METHOD", TypeError],
["ERR_TLS_INVALID_PROTOCOL_VERSION", TypeError],
["ERR_TLS_PROTOCOL_VERSION_CONFLICT", TypeError],
["ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED", Error],
["ERR_TLS_RENEGOTIATION_DISABLED", Error],
["ERR_TLS_RENEGOTIATION_UNSUPPORTED", Error],
["ERR_TLS_SNI_FROM_SERVER", Error],
Expand All @@ -275,9 +261,7 @@ const errors: ErrorCodeMapping = [
["ERR_UNKNOWN_SIGNAL", TypeError],
["ERR_ZSTD_INVALID_PARAM", RangeError],
["ERR_USE_AFTER_CLOSE", Error],
["ERR_WASI_NOT_STARTED", Error],
["ERR_WEBASSEMBLY_RESPONSE", TypeError],
["ERR_WORKER_INIT_FAILED", Error],
["ERR_WORKER_NOT_RUNNING", Error],
["ERR_WORKER_UNSUPPORTED_OPERATION", TypeError],
["ERR_WORKER_PATH", TypeError],
Expand Down Expand Up @@ -329,7 +313,6 @@ const errors: ErrorCodeMapping = [
["HPE_CLOSED_CONNECTION", Error],
["HPE_INVALID_CHUNK_SIZE", Error],
["HPE_INVALID_CONSTANT", Error],
["ERR_SECRETS_NOT_AVAILABLE", Error],
["ERR_SECRETS_NOT_FOUND", Error],
["ERR_SECRETS_ACCESS_DENIED", Error],
["ERR_SECRETS_PLATFORM_ERROR", Error],
Expand Down
7 changes: 1 addition & 6 deletions src/jsc/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,7 @@ pub type GenString = bun_core::String;
/// `release_gen_val_array_buffer` in the owning containers' `Drop` impls.
pub type GenArrayBuffer = *mut JSCArrayBuffer;

/// `bun.bun_js.webcore.Blob.Ref` — adopted `*mut Blob` (the codegen `m_ctx`
/// payload). LAYERING: `webcore::Blob` lives in `bun_runtime` (a dependent of
/// this crate); the bindgen extern struct only ever stores the raw pointer
/// (filled by C++ `bindgenConvertJSTo*`), so it stays erased as `*mut c_void`
/// here and is cast to `*mut bun_runtime::webcore::Blob` by the consumer in
/// `bun_runtime::api::bun::spawn::stdio::convert_from_extern`.
/// The codegen `m_ctx` `*mut webcore::Blob`, erased: `Blob` lives in `bun_runtime`.
pub type GenBlob = *mut core::ffi::c_void;

// ──────────────────────────────────────────────────────────────────────────
Expand Down
Loading
Loading