Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion completions/bun.bash
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ _bun_completions() {

local SUBCOMMANDS="dev bun create run install add remove upgrade completions discord help init pm x test repl update audit dedupe prune outdated link unlink build";

GLOBAL_OPTIONS[LONG_OPTIONS]="--use --cwd --bunfile --server-bunfile --config --disable-react-fast-refresh --disable-hmr --env-file --extension-order --jsx-factory --jsx-fragment --extension-order --jsx-factory --jsx-fragment --jsx-import-source --jsx-production --jsx-runtime --main-fields --no-summary --version --platform --public-dir --tsconfig-override --define --external --help --inject --loader --origin --port --dump-environment-variables --dump-limits --disable-bun-js";
GLOBAL_OPTIONS[LONG_OPTIONS]="--use --cwd --bunfile --server-bunfile --config --disable-react-fast-refresh --disable-hmr --env-file --extension-order --jsx-factory --jsx-fragment --extension-order --jsx-factory --jsx-fragment --jsx-import-source --jsx-production --jsx-runtime --main-fields --no-summary --version --platform --public-dir --tsconfig-override --define --external --help --inject --loader --origin --port";
GLOBAL_OPTIONS[SHORT_OPTIONS]="-c -v -d -e -h -i -l -u -p";

PACKAGE_OPTIONS[ADD_OPTIONS_LONG]="--development --optional --peer --catalog --filter";
Expand Down
4 changes: 1 addition & 3 deletions completions/bun.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,7 @@ _bun_run_completion() {
'-i[Automatically install dependencies and use global cache in bun'"'"'s runtime, equivalent to --install=fallback'] \
'--prefer-offline[Skip staleness checks for packages in bun'"'"'s JavaScript runtime and resolve from disk]' \
'--prefer-latest[Use the latest matching versions of packages in bun'"'"'s JavaScript runtime, always checking npm]' \
'--silent[Don'"'"'t repeat the command for bun run]' \
'--dump-environment-variables[Dump environment variables from .env and process as JSON and quit. Useful for debugging]' \
'--dump-limits[Dump system limits. Userful for debugging]' &&
'--silent[Don'"'"'t repeat the command for bun run]' &&
ret=0

case $state in
Expand Down
31 changes: 0 additions & 31 deletions src/bundler/transpiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,37 +653,6 @@ impl<'a> Transpiler<'a> {
pub fn sync_resolver_opts(&mut self) {
self.resolver.opts = resolver_bundle_options_subset(&self.options);
}

/// Print the loaded environment variables to stdout as 2-space-indented
/// JSON.
#[cold]
#[inline(never)]
pub fn dump_environment_variables(&self) {
use bun_js_printer::{Encoding, write_json_string};
// Dump `env.map.*` as 2-space-indented JSON. `bun_dotenv::Map` doesn't
// impl `serde::Serialize`, so iterate and emit the object by hand.
// Keys and values go through `write_json_string` (the same escaper the
// printer uses for metafile/HTML-manifest JSON) so `"` / `\` / control
// bytes are escaped as standard JSON requires.
bun_core::Output::flush();
let env = self.env_mut();
let w = bun_core::Output::writer();
let _ = w.write_all(b"{\n");
let mut first = true;
let mut it = env.map.iterator();
while let Some(pair) = it.next() {
if !first {
let _ = w.write_all(b",\n");
}
first = false;
let _ = w.write_all(b" ");
let _ = write_json_string::<_, { Encoding::Utf8 }>(&**pair.key_ptr, w);
let _ = w.write_all(b": ");
let _ = write_json_string::<_, { Encoding::Utf8 }>(&*pair.value_ptr.value, w);
}
let _ = w.write_all(b"\n}\n");
bun_core::Output::flush();
}
}

// ══════════════════════════════════════════════════════════════════════════
Expand Down
2 changes: 0 additions & 2 deletions src/options_types/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ pub fn try_get<'a>() -> Option<&'a ContextData> {
}

pub struct DebugOptions {
pub dump_environment_variables: bool,
pub silent: bool,
pub hot_reload: HotReload,
/// `--watch-kill-signal`: signal whose JS handlers run before a `--watch`
Expand All @@ -377,7 +376,6 @@ impl Default for DebugOptions {
#[inline(always)]
fn default() -> Self {
Self {
dump_environment_variables: false,
silent: false,
hot_reload: HotReload::None,
watch_kill_signal: bun_core::SignalCode::DEFAULT,
Expand Down
1 change: 0 additions & 1 deletion src/runtime/cli/Arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ pub(crate) const BUILD_ONLY_PARAMS: &[ParamType] = concat_params!(
parse_param!(
"--css-chunking Chunk CSS files together to reduce duplicated CSS loaded in a browser. Only has an effect when multiple entrypoints import CSS"
),
parse_param!("--dump-environment-variables"),
parse_param!("--conditions <STR>... Pass custom conditions to resolve"),
parse_param!(
"--app (EXPERIMENTAL) Build a web app for production using Bun Bake."
Expand Down
7 changes: 0 additions & 7 deletions src/runtime/cli/build_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,13 +599,6 @@ impl BuildCommand {
}
let _ = client_transpiler;

// var env_loader = this_transpiler.env;

if ctx.debug.dump_environment_variables {
this_transpiler.dump_environment_variables();
return Ok(());
}

let mut reachable_file_count: usize = 0;
let mut minify_duration: u64 = 0;
let mut input_code_length: u64 = 0;
Expand Down
Loading