aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-04-29 00:08:48 -0400
committerGravatar GitHub <noreply@github.com> 2023-04-28 21:08:48 -0700
commit96e113f41c0dae1ccd58c6d1e3b6dd2c54769636 (patch)
tree1f8c0b88d2daa925abff610f4a458d744bc0bf36 /src/api
parentbc0c0f7d203567a5538f271a3bc37c450eeaee46 (diff)
downloadbun-96e113f41c0dae1ccd58c6d1e3b6dd2c54769636.tar.gz
bun-96e113f41c0dae1ccd58c6d1e3b6dd2c54769636.tar.zst
bun-96e113f41c0dae1ccd58c6d1e3b6dd2c54769636.zip
bundler tests: rest of default.test.ts and starting jsx tests (#2765)
Diffstat (limited to 'src/api')
-rw-r--r--src/api/demo/schema.peechy6
-rw-r--r--src/api/demo/schema.zig12
-rw-r--r--src/api/schema.d.ts6
-rw-r--r--src/api/schema.js16
-rw-r--r--src/api/schema.peechy4
-rw-r--r--src/api/schema.zig12
6 files changed, 28 insertions, 28 deletions
diff --git a/src/api/demo/schema.peechy b/src/api/demo/schema.peechy
index 59cb1edf5..09d3c1fac 100644
--- a/src/api/demo/schema.peechy
+++ b/src/api/demo/schema.peechy
@@ -107,7 +107,7 @@ smol ResolveMode {
bundle = 4;
}
-smol Platform {
+smol Target {
browser = 1;
node = 2;
bun = 3;
@@ -326,7 +326,7 @@ message TransformOptions {
LoaderMap loaders = 13;
string[] main_fields = 14;
- Platform platform = 15;
+ Target target = 15;
bool serve = 16;
@@ -550,4 +550,4 @@ message BunInstall {
bool disable_manifest_cache = 16;
string global_dir = 17;
string global_bin_dir = 18;
-} \ No newline at end of file
+}
diff --git a/src/api/demo/schema.zig b/src/api/demo/schema.zig
index e4871b902..748422ed8 100644
--- a/src/api/demo/schema.zig
+++ b/src/api/demo/schema.zig
@@ -792,7 +792,7 @@ pub const Api = struct {
}
};
- pub const Platform = enum(u8) {
+ pub const Target = enum(u8) {
_none,
/// browser
browser,
@@ -1708,8 +1708,8 @@ pub const Api = struct {
/// main_fields
main_fields: []const []const u8,
- /// platform
- platform: ?Platform = null,
+ /// target
+ target: ?Target = null,
/// serve
serve: ?bool = null,
@@ -1796,7 +1796,7 @@ pub const Api = struct {
this.main_fields = try reader.readArray([]const u8);
},
15 => {
- this.platform = try reader.readValue(Platform);
+ this.target = try reader.readValue(Target);
},
16 => {
this.serve = try reader.readValue(bool);
@@ -1896,9 +1896,9 @@ pub const Api = struct {
try writer.writeFieldID(14);
try writer.writeArray([]const u8, main_fields);
}
- if (this.platform) |platform| {
+ if (this.target) |target| {
try writer.writeFieldID(15);
- try writer.writeEnum(platform);
+ try writer.writeEnum(target);
}
if (this.serve) |serve| {
try writer.writeFieldID(16);
diff --git a/src/api/schema.d.ts b/src/api/schema.d.ts
index ed58db778..4114d951d 100644
--- a/src/api/schema.d.ts
+++ b/src/api/schema.d.ts
@@ -135,13 +135,13 @@ export const ResolveModeKeys: {
4: "bundle";
bundle: "bundle";
};
-export const enum Platform {
+export const enum Target {
browser = 1,
node = 2,
bun = 3,
bun_macro = 4,
}
-export const PlatformKeys: {
+export const TargetKeys: {
1: "browser";
browser: "browser";
2: "node";
@@ -534,7 +534,7 @@ export interface TransformOptions {
external?: string[];
loaders?: LoaderMap;
main_fields?: string[];
- platform?: Platform;
+ target?: Target;
serve?: boolean;
extension_order?: string[];
generate_node_module_bundle?: boolean;
diff --git a/src/api/schema.js b/src/api/schema.js
index 3ec60fb4f..c4f2400ed 100644
--- a/src/api/schema.js
+++ b/src/api/schema.js
@@ -548,7 +548,7 @@ const ResolveModeKeys = {
"dev": "dev",
"bundle": "bundle",
};
-const Platform = {
+const Target = {
"1": 1,
"2": 2,
"3": 3,
@@ -558,7 +558,7 @@ const Platform = {
"bun": 3,
"bun_macro": 4,
};
-const PlatformKeys = {
+const TargetKeys = {
"1": "browser",
"2": "node",
"3": "bun",
@@ -1655,7 +1655,7 @@ function decodeTransformOptions(bb) {
break;
case 15:
- result["platform"] = Platform[bb.readByte()];
+ result["target"] = Target[bb.readByte()];
break;
case 16:
@@ -1825,11 +1825,11 @@ function encodeTransformOptions(message, bb) {
}
}
- var value = message["platform"];
+ var value = message["target"];
if (value != null) {
bb.writeByte(15);
- var encoded = Platform[value];
- if (encoded === void 0) throw new Error("Invalid value " + JSON.stringify(value) + ' for enum "Platform"');
+ var encoded = Target[value];
+ if (encoded === void 0) throw new Error("Invalid value " + JSON.stringify(value) + ' for enum "Target"');
bb.writeByte(encoded);
}
@@ -3321,8 +3321,8 @@ export { decodeFallbackMessageContainer };
export { encodeFallbackMessageContainer };
export { ResolveMode };
export { ResolveModeKeys };
-export { Platform };
-export { PlatformKeys };
+export { Target };
+export { TargetKeys };
export { CSSInJSBehavior };
export { CSSInJSBehaviorKeys };
export { JSXRuntime };
diff --git a/src/api/schema.peechy b/src/api/schema.peechy
index a6c0fed8a..71e85d68e 100644
--- a/src/api/schema.peechy
+++ b/src/api/schema.peechy
@@ -111,7 +111,7 @@ smol ResolveMode {
bundle = 4;
}
-smol Platform {
+smol Target {
browser = 1;
node = 2;
bun = 3;
@@ -331,7 +331,7 @@ message TransformOptions {
LoaderMap loaders = 13;
string[] main_fields = 14;
- Platform platform = 15;
+ Target target = 15;
bool serve = 16;
diff --git a/src/api/schema.zig b/src/api/schema.zig
index 2629f1c5e..227d1296b 100644
--- a/src/api/schema.zig
+++ b/src/api/schema.zig
@@ -804,7 +804,7 @@ pub const Api = struct {
}
};
- pub const Platform = enum(u8) {
+ pub const Target = enum(u8) {
_none,
/// browser
browser,
@@ -1723,8 +1723,8 @@ pub const Api = struct {
/// main_fields
main_fields: []const []const u8,
- /// platform
- platform: ?Platform = null,
+ /// target
+ target: ?Target = null,
/// serve
serve: ?bool = null,
@@ -1814,7 +1814,7 @@ pub const Api = struct {
this.main_fields = try reader.readArray([]const u8);
},
15 => {
- this.platform = try reader.readValue(Platform);
+ this.target = try reader.readValue(Target);
},
16 => {
this.serve = try reader.readValue(bool);
@@ -1917,9 +1917,9 @@ pub const Api = struct {
try writer.writeFieldID(14);
try writer.writeArray([]const u8, main_fields);
}
- if (this.platform) |platform| {
+ if (this.target) |target| {
try writer.writeFieldID(15);
- try writer.writeEnum(platform);
+ try writer.writeEnum(target);
}
if (this.serve) |serve| {
try writer.writeFieldID(16);