diff options
Diffstat (limited to 'src/bundler')
-rw-r--r-- | src/bundler/entry_points.zig | 8 | ||||
-rw-r--r-- | src/bundler/generate_node_modules_bundle.zig | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/bundler/entry_points.zig b/src/bundler/entry_points.zig index 9b52596f5..a501bcddb 100644 --- a/src/bundler/entry_points.zig +++ b/src/bundler/entry_points.zig @@ -85,9 +85,9 @@ pub const ClientEntryPoint = struct { var joined_base_and_dir_parts = [_]string{ original_path.dir, original_path.base }; var generated_path = Fs.FileSystem.instance.absBuf(&joined_base_and_dir_parts, outbuffer); - std.mem.copy(u8, outbuffer[generated_path.len..], ".entry"); + bun.copy(u8, outbuffer[generated_path.len..], ".entry"); generated_path = outbuffer[0 .. generated_path.len + ".entry".len]; - std.mem.copy(u8, outbuffer[generated_path.len..], original_path.ext); + bun.copy(u8, outbuffer[generated_path.len..], original_path.ext); return outbuffer[0 .. generated_path.len + original_path.ext.len]; } @@ -99,7 +99,7 @@ pub const ClientEntryPoint = struct { original_ext = original_path.ext[entry_i + "entry".len ..]; } - std.mem.copy(u8, outbuffer[generated_path.len..], original_ext); + bun.copy(u8, outbuffer[generated_path.len..], original_ext); return outbuffer[0 .. generated_path.len + original_ext.len]; } @@ -299,7 +299,7 @@ pub const MacroEntryPoint = struct { macro_label_: string, ) !void { const dir_to_use: string = import_path.dirWithTrailingSlash(); - std.mem.copy(u8, entry.code_buffer[0..macro_label_.len], macro_label_); + bun.copy(u8, &entry.code_buffer, macro_label_); const macro_label = entry.code_buffer[0..macro_label_.len]; const code = try std.fmt.bufPrint( diff --git a/src/bundler/generate_node_modules_bundle.zig b/src/bundler/generate_node_modules_bundle.zig index 321777a20..69216ae72 100644 --- a/src/bundler/generate_node_modules_bundle.zig +++ b/src/bundler/generate_node_modules_bundle.zig @@ -334,7 +334,7 @@ pub const magic_bytes = "#!/usr/bin/env bun\n\n"; // Then, you add that number to initial_header.len const initial_header = brk: { var buf = std.mem.zeroes([magic_bytes.len + 5]u8); - // std.mem.copy(u8, &buf, magic_bytes); + // bun.copy(u8, &buf, magic_bytes); // var remainder = buf[magic_bytes.len..]; // // Write an invalid byte offset to be updated after we finish generating the code // std.mem.writeIntNative(u32, remainder[0 .. remainder.len - 1], 0); @@ -454,8 +454,8 @@ pub fn generate( var i: u16 = 0; inner: for (bundle_keys, 0..) |name, k| { - std.mem.copy(u8, &Bundler.tmp_buildfile_buf, name); - std.mem.copy(u8, Bundler.tmp_buildfile_buf[name.len..], "/package.json"); + bun.copy(u8, &Bundler.tmp_buildfile_buf, name); + bun.copy(u8, Bundler.tmp_buildfile_buf[name.len..], "/package.json"); const package_json_import = Bundler.tmp_buildfile_buf[0 .. name.len + "/package.json".len]; const result = bundler.resolver.resolve(bundler.fs.top_level_dir, package_json_import, .stmt) catch |err| { generator.log.addErrorFmt(null, logger.Loc.Empty, bundler.allocator, "{s} resolving always bundled module \"{s}\"", .{ @errorName(err), name }) catch unreachable; @@ -680,7 +680,7 @@ pub fn generate( Output.prettyErrorln( \\<r><red>error<r>: no dependencies to bundle! \\ - \\"bun bun" currently only bundles dependencies in node_modules. + \\"bun bun" currently only bundles dependencies in node_modules. \\ , .{}, @@ -969,9 +969,9 @@ const BundledModuleData = struct { var buf_to_use: []u8 = if (is_main) &normalized_package_path2 else &normalized_package_path; - std.mem.copy(u8, buf_to_use, pkg.name); + bun.copy(u8, buf_to_use, pkg.name); buf_to_use[pkg.name.len] = '/'; - std.mem.copy(u8, buf_to_use[pkg.name.len + 1 ..], import_path); + bun.copy(u8, buf_to_use[pkg.name.len + 1 ..], import_path); package_path = buf_to_use[0 .. pkg.name.len + import_path.len + 1]; return BundledModuleData{ .import_path = import_path, @@ -1005,9 +1005,9 @@ const BundledModuleData = struct { var buf_to_use: []u8 = if (is_main) &normalized_package_path2 else &normalized_package_path; - std.mem.copy(u8, buf_to_use, pkg.name); + bun.copy(u8, buf_to_use, pkg.name); buf_to_use[pkg.name.len] = '/'; - std.mem.copy(u8, buf_to_use[pkg.name.len + 1 ..], import_path); + bun.copy(u8, buf_to_use[pkg.name.len + 1 ..], import_path); package_path = buf_to_use[0 .. pkg.name.len + import_path.len + 1]; return BundledModuleData{ .import_path = import_path, |