diff options
Diffstat (limited to 'src/cli')
-rw-r--r-- | src/cli/build_command.zig | 7 | ||||
-rw-r--r-- | src/cli/create_command.zig | 2 | ||||
-rw-r--r-- | src/cli/install_completions_command.zig | 2 | ||||
-rw-r--r-- | src/cli/run_command.zig | 17 | ||||
-rw-r--r-- | src/cli/test_command.zig | 28 | ||||
-rw-r--r-- | src/cli/upgrade_command.zig | 2 |
6 files changed, 23 insertions, 35 deletions
diff --git a/src/cli/build_command.zig b/src/cli/build_command.zig index bb4eb4313..f87d88930 100644 --- a/src/cli/build_command.zig +++ b/src/cli/build_command.zig @@ -26,7 +26,7 @@ const Api = @import("../api/schema.zig").Api; const resolve_path = @import("../resolver/resolve_path.zig"); const configureTransformOptionsForBun = @import("../bun.js/config.zig").configureTransformOptionsForBun; const bundler = bun.bundler; -const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle; + const DotEnv = @import("../env_loader.zig"); const fs = @import("../fs.zig"); @@ -48,7 +48,7 @@ pub const BuildCommand = struct { ctx.args.target = .bun; } - var this_bundler = try bundler.Bundler.init(allocator, log, ctx.args, null, null); + var this_bundler = try bundler.Bundler.init(allocator, log, ctx.args, null); this_bundler.options.source_map = options.SourceMapOption.fromApi(ctx.args.source_map); this_bundler.resolver.opts.source_map = options.SourceMapOption.fromApi(ctx.args.source_map); @@ -200,9 +200,6 @@ pub const BuildCommand = struct { router.config.static_dir_enabled = false; this_bundler.router = null; } - this_bundler.options.node_modules_bundle = null; - this_bundler.options.node_modules_bundle_pretty_path = ""; - this_bundler.options.node_modules_bundle_url = ""; }; this_bundler.options.jsx.development = !this_bundler.options.production; diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig index aff34e9b4..544329a98 100644 --- a/src/cli/create_command.zig +++ b/src/cli/create_command.zig @@ -26,7 +26,7 @@ const resolve_path = @import("../resolver/resolve_path.zig"); const configureTransformOptionsForBun = @import("../bun.js/config.zig").configureTransformOptionsForBun; const Command = @import("../cli.zig").Command; const bundler = bun.bundler; -const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle; + const fs = @import("../fs.zig"); const URL = @import("../url.zig").URL; const HTTP = @import("root").bun.HTTP; diff --git a/src/cli/install_completions_command.zig b/src/cli/install_completions_command.zig index b51c75d60..7e19d12f1 100644 --- a/src/cli/install_completions_command.zig +++ b/src/cli/install_completions_command.zig @@ -25,7 +25,7 @@ const resolve_path = @import("../resolver/resolve_path.zig"); const configureTransformOptionsForBun = @import("../bun.js/config.zig").configureTransformOptionsForBun; const Command = @import("../cli.zig").Command; const bundler = bun.bundler; -const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle; + const fs = @import("../fs.zig"); const URL = @import("../url.zig").URL; const ParseJSON = @import("../json_parser.zig").ParseJSON; diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig index b445ccdc4..ba05e1ddf 100644 --- a/src/cli/run_command.zig +++ b/src/cli/run_command.zig @@ -26,7 +26,7 @@ const resolve_path = @import("../resolver/resolve_path.zig"); const configureTransformOptionsForBun = @import("../bun.js/config.zig").configureTransformOptionsForBun; const Command = @import("../cli.zig").Command; const bundler = bun.bundler; -const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle; + const DotEnv = @import("../env_loader.zig"); const which = @import("../which.zig").which; const Run = @import("../bun_js.zig").Run; @@ -385,11 +385,8 @@ pub const RunCommand = struct { pub fn ls(ctx: Command.Context) !void { var args = ctx.args; - args.node_modules_bundle_path = null; - args.node_modules_bundle_path_server = null; - args.generate_node_module_bundle = false; - var this_bundler = try bundler.Bundler.init(ctx.allocator, ctx.log, args, null, null); + var this_bundler = try bundler.Bundler.init(ctx.allocator, ctx.log, args, null); this_bundler.options.env.behavior = Api.DotEnvBehavior.load_all; this_bundler.options.env.prefix = ""; @@ -471,10 +468,7 @@ pub const RunCommand = struct { force_using_bun: bool, ) !*DirInfo { var args = ctx.args; - args.node_modules_bundle_path = null; - args.node_modules_bundle_path_server = null; - args.generate_node_module_bundle = false; - this_bundler.* = try bundler.Bundler.init(ctx.allocator, ctx.log, args, null, env); + this_bundler.* = try bundler.Bundler.init(ctx.allocator, ctx.log, args, env); this_bundler.options.env.behavior = Api.DotEnvBehavior.load_all; this_bundler.env.quiet = true; this_bundler.options.env.prefix = ""; @@ -661,11 +655,8 @@ pub const RunCommand = struct { } var args = ctx.args; - args.node_modules_bundle_path = null; - args.node_modules_bundle_path_server = null; - args.generate_node_module_bundle = false; - var this_bundler = bundler.Bundler.init(ctx.allocator, ctx.log, args, null, null) catch return shell_out; + var this_bundler = bundler.Bundler.init(ctx.allocator, ctx.log, args, null) catch return shell_out; this_bundler.options.env.behavior = Api.DotEnvBehavior.load_all; this_bundler.options.env.prefix = ""; this_bundler.env.quiet = true; diff --git a/src/cli/test_command.zig b/src/cli/test_command.zig index 3a9411e08..fe9611d85 100644 --- a/src/cli/test_command.zig +++ b/src/cli/test_command.zig @@ -27,8 +27,7 @@ const Api = @import("../api/schema.zig").Api; const resolve_path = @import("../resolver/resolve_path.zig"); const configureTransformOptionsForBun = @import("../bun.js/config.zig").configureTransformOptionsForBun; const Command = @import("../cli.zig").Command; -const bundler = bun.bundler; -const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle; + const DotEnv = @import("../env_loader.zig"); const which = @import("../which.zig").which; const Run = @import("../bun_js.zig").Run; @@ -625,18 +624,19 @@ pub const TestCommand = struct { js_ast.Expr.Data.Store.create(default_allocator); js_ast.Stmt.Data.Store.create(default_allocator); var vm = try JSC.VirtualMachine.init( - ctx.allocator, - ctx.args, - null, - ctx.log, - env_loader, - // we must store file descriptors because we reuse them for - // iterating through the directory tree recursively - // - // in the future we should investigate if refactoring this to not - // rely on the dir fd yields a performance improvement - true, - ctx.runtime_options.smol, + .{ + .allocator = ctx.allocator, + .args = ctx.args, + .log = ctx.log, + .env_loader = env_loader, + // we must store file descriptors because we reuse them for + // iterating through the directory tree recursively + // + // in the future we should investigate if refactoring this to not + // rely on the dir fd yields a performance improvement + .store_fd = true, + .smol = ctx.runtime_options.smol, + }, ); vm.argv = ctx.passthrough; vm.preload = ctx.preloads; diff --git a/src/cli/upgrade_command.zig b/src/cli/upgrade_command.zig index b8bfd3f73..3fadfe5c2 100644 --- a/src/cli/upgrade_command.zig +++ b/src/cli/upgrade_command.zig @@ -25,7 +25,7 @@ const resolve_path = @import("../resolver/resolve_path.zig"); const configureTransformOptionsForBun = @import("../bun.js/config.zig").configureTransformOptionsForBun; const Command = @import("../cli.zig").Command; const bundler = bun.bundler; -const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle; + const fs = @import("../fs.zig"); const URL = @import("../url.zig").URL; const HTTP = @import("root").bun.HTTP; |