aboutsummaryrefslogtreecommitdiff
path: root/src/node_fallbacks.zig
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-08-10 11:57:37 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-10 11:57:37 -0700
commit68ac8c12c20cafc92467485abc5c2d5c052a11e0 (patch)
treedcf99dbac6bded997e976bf3daff2c47eba61e77 /src/node_fallbacks.zig
parent28d1676d505b1180b9fe1fa9b7a7bf30ad13e547 (diff)
downloadbun-68ac8c12c20cafc92467485abc5c2d5c052a11e0.tar.gz
bun-68ac8c12c20cafc92467485abc5c2d5c052a11e0.tar.zst
bun-68ac8c12c20cafc92467485abc5c2d5c052a11e0.zip
remove non-node node-fallbacks (#4082)
* remove non-node node-fallbacks. * organize the imports
Diffstat (limited to 'src/node_fallbacks.zig')
-rw-r--r--src/node_fallbacks.zig78
1 files changed, 0 insertions, 78 deletions
diff --git a/src/node_fallbacks.zig b/src/node_fallbacks.zig
index a8f125943..00af75885 100644
--- a/src/node_fallbacks.zig
+++ b/src/node_fallbacks.zig
@@ -29,11 +29,6 @@ const tty_code: string = @embedFile("./node-fallbacks/out/tty.js");
const url_code: string = @embedFile("./node-fallbacks/out/url.js");
const util_code: string = @embedFile("./node-fallbacks/out/util.js");
const zlib_code: string = @embedFile("./node-fallbacks/out/zlib.js");
-const supports_color_code: string = @embedFile("./node-fallbacks/out/supports-color.js");
-
-const node_fetch_code: string = @embedFile("./node-fallbacks/out/node-fetch.js");
-const isomorphic_fetch_code: string = @embedFile("./node-fallbacks/out/isomorphic-fetch.js");
-const vercel_fetch_code: string = @embedFile("./node-fallbacks/out/@vercel_fetch.js");
const assert_import_path = "/bun-vfs/node_modules/assert/index.js";
const buffer_import_path = "/bun-vfs/node_modules/buffer/index.js";
@@ -58,11 +53,6 @@ const tty_import_path = "/bun-vfs/node_modules/tty/index.js";
const url_import_path = "/bun-vfs/node_modules/url/index.js";
const util_import_path = "/bun-vfs/node_modules/util/index.js";
const zlib_import_path = "/bun-vfs/node_modules/zlib/index.js";
-const supports_color_import_path = "/bun-vfs/node_modules/supports-color/index.js";
-
-const node_fetch_import_path = "/bun-vfs/node_modules/node-fetch/index.js";
-const isomorphic_fetch_import_path = "/bun-vfs/node_modules/isomorphic-fetch/index.js";
-const vercel_fetch_import_path = "/bun-vfs/node_modules/@vercel/fetch/index.js";
const assert_package_json = PackageJSON{
.name = "assert",
@@ -277,44 +267,6 @@ const zlib_package_json = PackageJSON{
.source = logger.Source.initPathString("/bun-vfs/node_modules/zlib/package.json", ""),
};
-const node_fetch_package_json = PackageJSON{
- .name = "node-fetch",
- .version = "0.0.0-polyfill",
- .module_type = .esm,
- .hash = @as(u32, @truncate(bun.hash("node-fetch@0.0.0-polyfill"))),
- .main_fields = undefined,
- .browser_map = undefined,
- .source = logger.Source.initPathString("/bun-vfs/node_modules/node-fetch/package.json", ""),
-};
-const isomorphic_fetch_package_json = PackageJSON{
- .name = "isomorphic-fetch",
- .version = "0.0.0-polyfill",
- .module_type = .esm,
- .hash = @as(u32, @truncate(bun.hash("isomorphic-fetch@0.0.0-polyfill"))),
- .main_fields = undefined,
- .browser_map = undefined,
- .source = logger.Source.initPathString("/bun-vfs/node_modules/isomorphic-fetch/package.json", ""),
-};
-const supports_color_package_json = PackageJSON{
- .name = "supports-color",
- .version = "0.0.0-polyfill",
- .module_type = .esm,
- .hash = @as(u32, @truncate(bun.hash("supports-color@0.0.0-polyfill"))),
- .main_fields = undefined,
- .browser_map = undefined,
- .source = logger.Source.initPathString("/bun-vfs/node_modules/supports-color/package.json", ""),
-};
-
-const vercel_fetch_package_json = PackageJSON{
- .name = "@vercel/fetch",
- .version = "0.0.0-polyfill",
- .module_type = .esm,
- .hash = @as(u32, @truncate(bun.hash("@vercel/fetch@0.0.0-polyfill"))),
- .main_fields = undefined,
- .browser_map = undefined,
- .source = logger.Source.initPathString("/bun-vfs/node_modules/@vercel/fetch/package.json", ""),
-};
-
pub const FallbackModule = struct {
path: Fs.Path,
code: string,
@@ -435,30 +387,6 @@ pub const FallbackModule = struct {
.code = zlib_code,
.package_json = &zlib_package_json,
};
-
- pub const @"node-fetch" = FallbackModule{
- .path = Fs.Path.initWithNamespaceVirtual(node_fetch_import_path, "node", "node-fetch"),
- .code = node_fetch_code,
- .package_json = &node_fetch_package_json,
- };
-
- pub const @"isomorphic-fetch" = FallbackModule{
- .path = Fs.Path.initWithNamespaceVirtual(isomorphic_fetch_import_path, "node", "isomorphic-fetch"),
- .code = isomorphic_fetch_code,
- .package_json = &isomorphic_fetch_package_json,
- };
-
- pub const @"@vercel/fetch" = FallbackModule{
- .path = Fs.Path.initWithNamespaceVirtual(vercel_fetch_import_path, "node", "@vercel/fetch"),
- .code = vercel_fetch_code,
- .package_json = &vercel_fetch_package_json,
- };
-
- pub const @"supports-color" = FallbackModule{
- .path = Fs.Path.initWithNamespaceVirtual(supports_color_import_path, "node", "supports-color"),
- .code = supports_color_code,
- .package_json = &supports_color_package_json,
- };
};
pub const Map = ComptimeStringMap(FallbackModule, .{
@@ -485,12 +413,6 @@ pub const Map = ComptimeStringMap(FallbackModule, .{
&.{ "url", FallbackModule.url },
&.{ "util", FallbackModule.util },
&.{ "zlib", FallbackModule.zlib },
-
- &.{ "supports-color", FallbackModule.@"supports-color" },
-
- &.{ "node-fetch", FallbackModule.@"node-fetch" },
- &.{ "isomorphic-fetch", FallbackModule.@"isomorphic-fetch" },
- &.{ "@vercel/fetch", FallbackModule.@"@vercel/fetch" },
});
pub fn contentsFromPath(path: string) ?string {