diff options
author | 2021-10-03 20:26:54 -0700 | |
---|---|---|
committer | 2021-10-03 20:26:54 -0700 | |
commit | 73c27a9a25a81f5e58f260cb5f126674f9e48902 (patch) | |
tree | 3c4f714ea03e0113f5a4b6577e75cb1320d09be6 | |
parent | 82bf89a946690c0297cba84bf50214eba705a863 (diff) | |
download | bun-73c27a9a25a81f5e58f260cb5f126674f9e48902.tar.gz bun-73c27a9a25a81f5e58f260cb5f126674f9e48902.tar.zst bun-73c27a9a25a81f5e58f260cb5f126674f9e48902.zip |
Fix various macOS-specific compile errors and run `zig fmt`
-rw-r--r-- | build-id | 2 | ||||
-rw-r--r-- | packages/bun-error/package-lock.json | 182 | ||||
-rw-r--r-- | src/api/schema.zig | 3920 | ||||
-rw-r--r-- | src/css_scanner.zig | 5 | ||||
-rw-r--r-- | src/fs.zig | 3 | ||||
-rw-r--r-- | src/global.zig | 9 | ||||
-rw-r--r-- | src/http.zig | 15 | ||||
-rw-r--r-- | src/javascript/jsc/JavascriptCore.zig | 1 | ||||
-rw-r--r-- | src/javascript/jsc/bindings/headers.zig | 51 | ||||
-rw-r--r-- | src/js_printer.zig | 12 | ||||
-rw-r--r-- | src/node-fallbacks/package-lock.json | 1184 | ||||
-rw-r--r-- | src/runtime.version | 2 | ||||
-rw-r--r-- | src/watcher.zig | 42 |
13 files changed, 3310 insertions, 2118 deletions
@@ -1 +1 @@ -27 +28 diff --git a/packages/bun-error/package-lock.json b/packages/bun-error/package-lock.json index 967076433..c33780e18 100644 --- a/packages/bun-error/package-lock.json +++ b/packages/bun-error/package-lock.json @@ -1,8 +1,182 @@ { "name": "bun-error", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "bun-error", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "esbuild": "^0.12.26", + "preact": "^10.5.14", + "preact-compat": "^3.19.0", + "react": "^17.0.2", + "react-dom": "^17.0.2" + } + }, + "node_modules/esbuild": { + "version": "0.12.26", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.26.tgz", + "integrity": "sha512-YmTkhPKjvTJ+G5e96NyhGf69bP+hzO0DscqaVJTi5GM34uaD4Ecj7omu5lJO+NrxCUBRhy2chONLK1h/2LwoXA==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + } + }, + "node_modules/immutability-helper": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-2.9.1.tgz", + "integrity": "sha512-r/RmRG8xO06s/k+PIaif2r5rGc3j4Yhc01jSBfwPCXDLYZwp/yxralI37Df1mwmuzcCsen/E/ITKcTEvc1PQmQ==", + "dependencies": { + "invariant": "^2.2.0" + } + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/preact": { + "version": "10.5.14", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.5.14.tgz", + "integrity": "sha512-KojoltCrshZ099ksUZ2OQKfbH66uquFoxHSbnwKbTJHeQNvx42EmC7wQVWNuDt6vC5s3nudRHFtKbpY4ijKlaQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, + "node_modules/preact-compat": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/preact-compat/-/preact-compat-3.19.0.tgz", + "integrity": "sha512-f83A4hIhH8Uzhb9GbIcGk8SM19ffWlwP9mDaYwQdRnMdekZwcCA7eIAbeV4EMQaV9C0Yuy8iKgBAtyTKPZQt/Q==", + "dependencies": { + "immutability-helper": "^2.7.1", + "preact-context": "^1.1.3", + "preact-render-to-string": "^3.8.2", + "preact-transition-group": "^1.1.1", + "prop-types": "^15.6.2", + "standalone-react-addons-pure-render-mixin": "^0.1.1" + }, + "peerDependencies": { + "preact": "<10" + } + }, + "node_modules/preact-context": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/preact-context/-/preact-context-1.1.4.tgz", + "integrity": "sha512-gcCjPJ65R0MiW9hDu8W/3WAmyTElIvwLyEO6oLQiM6/TbLKLxCpBCWV8GJjx52TTEyUr60HLDcmoCXZlslelzQ==", + "peerDependencies": { + "preact": "^8.2.7" + } + }, + "node_modules/preact-render-to-string": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-3.8.2.tgz", + "integrity": "sha512-przuZPajiurStGgxMoJP0EJeC4xj5CgHv+M7GfF3YxAdhGgEWAkhOSE0xympAFN20uMayntBZpttIZqqLl77fw==", + "dependencies": { + "pretty-format": "^3.5.1" + }, + "peerDependencies": { + "preact": "*" + } + }, + "node_modules/preact-transition-group": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/preact-transition-group/-/preact-transition-group-1.1.1.tgz", + "integrity": "sha1-8KSTJ+pRXs406ivoZMSn0p5dbhA=", + "peerDependencies": { + "preact": "*" + } + }, + "node_modules/pretty-format": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz", + "integrity": "sha1-v77VbV6ad2ZF9LH/eqGjrE+jw4U=" + }, + "node_modules/prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + }, + "node_modules/react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + }, + "peerDependencies": { + "react": "17.0.2" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, + "node_modules/scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "node_modules/standalone-react-addons-pure-render-mixin": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/standalone-react-addons-pure-render-mixin/-/standalone-react-addons-pure-render-mixin-0.1.1.tgz", + "integrity": "sha1-PHQJ9MecQN6axyxhbPZ5qZTzdVE=" + } + }, "dependencies": { "esbuild": { "version": "0.12.26", @@ -64,7 +238,8 @@ "preact-context": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/preact-context/-/preact-context-1.1.4.tgz", - "integrity": "sha512-gcCjPJ65R0MiW9hDu8W/3WAmyTElIvwLyEO6oLQiM6/TbLKLxCpBCWV8GJjx52TTEyUr60HLDcmoCXZlslelzQ==" + "integrity": "sha512-gcCjPJ65R0MiW9hDu8W/3WAmyTElIvwLyEO6oLQiM6/TbLKLxCpBCWV8GJjx52TTEyUr60HLDcmoCXZlslelzQ==", + "requires": {} }, "preact-render-to-string": { "version": "3.8.2", @@ -77,7 +252,8 @@ "preact-transition-group": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/preact-transition-group/-/preact-transition-group-1.1.1.tgz", - "integrity": "sha1-8KSTJ+pRXs406ivoZMSn0p5dbhA=" + "integrity": "sha1-8KSTJ+pRXs406ivoZMSn0p5dbhA=", + "requires": {} }, "pretty-format": { "version": "3.8.0", diff --git a/src/api/schema.zig b/src/api/schema.zig index 8c4f608d8..24b3f405e 100644 --- a/src/api/schema.zig +++ b/src/api/schema.zig @@ -1,4 +1,3 @@ - const std = @import("std"); pub const Reader = struct { @@ -282,2495 +281,2362 @@ pub fn Writer(comptime WritableStream: type) type { pub const ByteWriter = Writer(*std.io.FixedBufferStream([]u8)); pub const FileWriter = Writer(std.fs.File); +pub const Api = struct { + pub const Loader = enum(u8) { + _none, + /// jsx + jsx, + /// js + js, + /// ts + ts, -pub const Api = struct { - -pub const Loader = enum(u8) { - -_none, - /// jsx - jsx, - - /// js - js, - - /// ts - ts, - - /// tsx - tsx, + /// tsx + tsx, - /// css - css, - - /// file - file, - - /// json - json, - -_, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } + /// css + css, - -}; - -pub const FrameworkEntryPointType = enum(u8) { - -_none, - /// client - client, - - /// server - server, - - /// fallback - fallback, - -_, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - - -}; + /// file + file, -pub const StackFrameScope = enum(u8) { + /// json + json, -_none, - /// Eval - eval, + _, - /// Module - module, - - /// Function - function, - - /// Global - global, - - /// Wasm - wasm, - - /// Constructor - constructor, - -_, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - - -}; - -pub const StackFrame = struct { -/// function_name -function_name: []const u8, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -/// file -file: []const u8, + pub const FrameworkEntryPointType = enum(u8) { + _none, + /// client + client, -/// position -position: StackFramePosition, + /// server + server, -/// scope -scope: StackFrameScope, + /// fallback + fallback, + _, -pub fn decode(reader: anytype) anyerror!StackFrame { - var this = std.mem.zeroes(StackFrame); + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; - this.function_name = try reader.readValue([]const u8); - this.file = try reader.readValue([]const u8); - this.position = try reader.readValue(StackFramePosition); - this.scope = try reader.readValue(StackFrameScope); - return this; -} + pub const StackFrameScope = enum(u8) { + _none, + /// Eval + eval, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.function_name); - try writer.writeValue(this.file); - try writer.writeValue(this.position); - try writer.writeEnum(this.scope); -} + /// Module + module, -}; + /// Function + function, -pub const StackFramePosition = packed struct { -/// source_offset -source_offset: i32 = 0, + /// Global + global, -/// line -line: i32 = 0, + /// Wasm + wasm, -/// line_start -line_start: i32 = 0, + /// Constructor + constructor, -/// line_stop -line_stop: i32 = 0, + _, -/// column_start -column_start: i32 = 0, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -/// column_stop -column_stop: i32 = 0, + pub const StackFrame = struct { + /// function_name + function_name: []const u8, -/// expression_start -expression_start: i32 = 0, + /// file + file: []const u8, -/// expression_stop -expression_stop: i32 = 0, + /// position + position: StackFramePosition, + /// scope + scope: StackFrameScope, -pub fn decode(reader: anytype) anyerror!StackFramePosition { - var this = std.mem.zeroes(StackFramePosition); + pub fn decode(reader: anytype) anyerror!StackFrame { + var this = std.mem.zeroes(StackFrame); - this.source_offset = try reader.readValue(i32); - this.line = try reader.readValue(i32); - this.line_start = try reader.readValue(i32); - this.line_stop = try reader.readValue(i32); - this.column_start = try reader.readValue(i32); - this.column_stop = try reader.readValue(i32); - this.expression_start = try reader.readValue(i32); - this.expression_stop = try reader.readValue(i32); - return this; -} + this.function_name = try reader.readValue([]const u8); + this.file = try reader.readValue([]const u8); + this.position = try reader.readValue(StackFramePosition); + this.scope = try reader.readValue(StackFrameScope); + return this; + } -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.source_offset); - try writer.writeInt(this.line); - try writer.writeInt(this.line_start); - try writer.writeInt(this.line_stop); - try writer.writeInt(this.column_start); - try writer.writeInt(this.column_stop); - try writer.writeInt(this.expression_start); - try writer.writeInt(this.expression_stop); -} + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.function_name); + try writer.writeValue(this.file); + try writer.writeValue(this.position); + try writer.writeEnum(this.scope); + } + }; -}; + pub const StackFramePosition = packed struct { + /// source_offset + source_offset: i32 = 0, -pub const SourceLine = struct { -/// line -line: i32 = 0, + /// line + line: i32 = 0, -/// text -text: []const u8, + /// line_start + line_start: i32 = 0, + /// line_stop + line_stop: i32 = 0, -pub fn decode(reader: anytype) anyerror!SourceLine { - var this = std.mem.zeroes(SourceLine); + /// column_start + column_start: i32 = 0, - this.line = try reader.readValue(i32); - this.text = try reader.readValue([]const u8); - return this; -} + /// column_stop + column_stop: i32 = 0, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.line); - try writer.writeValue(this.text); -} + /// expression_start + expression_start: i32 = 0, -}; + /// expression_stop + expression_stop: i32 = 0, -pub const StackTrace = struct { -/// source_lines -source_lines: []const SourceLine, + pub fn decode(reader: anytype) anyerror!StackFramePosition { + var this = std.mem.zeroes(StackFramePosition); -/// frames -frames: []const StackFrame, + this.source_offset = try reader.readValue(i32); + this.line = try reader.readValue(i32); + this.line_start = try reader.readValue(i32); + this.line_stop = try reader.readValue(i32); + this.column_start = try reader.readValue(i32); + this.column_stop = try reader.readValue(i32); + this.expression_start = try reader.readValue(i32); + this.expression_stop = try reader.readValue(i32); + return this; + } + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.source_offset); + try writer.writeInt(this.line); + try writer.writeInt(this.line_start); + try writer.writeInt(this.line_stop); + try writer.writeInt(this.column_start); + try writer.writeInt(this.column_stop); + try writer.writeInt(this.expression_start); + try writer.writeInt(this.expression_stop); + } + }; -pub fn decode(reader: anytype) anyerror!StackTrace { - var this = std.mem.zeroes(StackTrace); + pub const SourceLine = struct { + /// line + line: i32 = 0, - this.source_lines = try reader.readArray(SourceLine); - this.frames = try reader.readArray(StackFrame); - return this; -} + /// text + text: []const u8, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray(SourceLine, this.source_lines); - try writer.writeArray(StackFrame, this.frames); -} + pub fn decode(reader: anytype) anyerror!SourceLine { + var this = std.mem.zeroes(SourceLine); -}; + this.line = try reader.readValue(i32); + this.text = try reader.readValue([]const u8); + return this; + } -pub const JsException = struct { -/// name -name: ?[]const u8 = null, - -/// message -message: ?[]const u8 = null, - -/// runtime_type -runtime_type: ?u16 = null, - -/// code -code: ?u8 = null, - -/// stack -stack: ?StackTrace = null, - - -pub fn decode(reader: anytype) anyerror!JsException { - var this = std.mem.zeroes(JsException); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.name = try reader.readValue([]const u8); -}, - 2 => { - this.message = try reader.readValue([]const u8); -}, - 3 => { - this.runtime_type = try reader.readValue(u16); -}, - 4 => { - this.code = try reader.readValue(u8); -}, - 5 => { - this.stack = try reader.readValue(StackTrace); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.line); + try writer.writeValue(this.text); + } + }; -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.name) |name| { - try writer.writeFieldID(1); - try writer.writeValue(name); -} -if (this.message) |message| { - try writer.writeFieldID(2); - try writer.writeValue(message); -} -if (this.runtime_type) |runtime_type| { - try writer.writeFieldID(3); - try writer.writeInt(runtime_type); -} -if (this.code) |code| { - try writer.writeFieldID(4); - try writer.writeInt(code); -} -if (this.stack) |stack| { - try writer.writeFieldID(5); - try writer.writeValue(stack); -} -try writer.endMessage(); -} + pub const StackTrace = struct { + /// source_lines + source_lines: []const SourceLine, -}; + /// frames + frames: []const StackFrame, -pub const FallbackStep = enum(u8) { + pub fn decode(reader: anytype) anyerror!StackTrace { + var this = std.mem.zeroes(StackTrace); -_none, - /// ssr_disabled - ssr_disabled, + this.source_lines = try reader.readArray(SourceLine); + this.frames = try reader.readArray(StackFrame); + return this; + } - /// create_vm - create_vm, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(SourceLine, this.source_lines); + try writer.writeArray(StackFrame, this.frames); + } + }; - /// configure_router - configure_router, + pub const JsException = struct { + /// name + name: ?[]const u8 = null, - /// configure_defines - configure_defines, + /// message + message: ?[]const u8 = null, - /// resolve_entry_point - resolve_entry_point, + /// runtime_type + runtime_type: ?u16 = null, - /// load_entry_point - load_entry_point, + /// code + code: ?u8 = null, - /// eval_entry_point - eval_entry_point, + /// stack + stack: ?StackTrace = null, - /// fetch_event_handler - fetch_event_handler, + pub fn decode(reader: anytype) anyerror!JsException { + var this = std.mem.zeroes(JsException); -_, + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); + 1 => { + this.name = try reader.readValue([]const u8); + }, + 2 => { + this.message = try reader.readValue([]const u8); + }, + 3 => { + this.runtime_type = try reader.readValue(u16); + }, + 4 => { + this.code = try reader.readValue(u8); + }, + 5 => { + this.stack = try reader.readValue(StackTrace); + }, + else => { + return error.InvalidMessage; + }, } + } + unreachable; + } - -}; - -pub const Problems = struct { -/// code -code: u16 = 0, - -/// name -name: []const u8, - -/// exceptions -exceptions: []const JsException, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.name) |name| { + try writer.writeFieldID(1); + try writer.writeValue(name); + } + if (this.message) |message| { + try writer.writeFieldID(2); + try writer.writeValue(message); + } + if (this.runtime_type) |runtime_type| { + try writer.writeFieldID(3); + try writer.writeInt(runtime_type); + } + if (this.code) |code| { + try writer.writeFieldID(4); + try writer.writeInt(code); + } + if (this.stack) |stack| { + try writer.writeFieldID(5); + try writer.writeValue(stack); + } + try writer.endMessage(); + } + }; -/// build -build: Log, + pub const FallbackStep = enum(u8) { + _none, + /// ssr_disabled + ssr_disabled, + /// create_vm + create_vm, -pub fn decode(reader: anytype) anyerror!Problems { - var this = std.mem.zeroes(Problems); + /// configure_router + configure_router, - this.code = try reader.readValue(u16); - this.name = try reader.readValue([]const u8); - this.exceptions = try reader.readArray(JsException); - this.build = try reader.readValue(Log); - return this; -} + /// configure_defines + configure_defines, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.code); - try writer.writeValue(this.name); - try writer.writeArray(JsException, this.exceptions); - try writer.writeValue(this.build); -} + /// resolve_entry_point + resolve_entry_point, -}; + /// load_entry_point + load_entry_point, -pub const Router = struct { -/// routes -routes: []const []const u8, + /// eval_entry_point + eval_entry_point, -/// route -route: i32 = 0, + /// fetch_event_handler + fetch_event_handler, -/// params -params: StringMap, + _, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -pub fn decode(reader: anytype) anyerror!Router { - var this = std.mem.zeroes(Router); + pub const Problems = struct { + /// code + code: u16 = 0, - this.routes = try reader.readArray([]const u8); - this.route = try reader.readValue(i32); - this.params = try reader.readValue(StringMap); - return this; -} + /// name + name: []const u8, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray([]const u8, this.routes); - try writer.writeInt(this.route); - try writer.writeValue(this.params); -} + /// exceptions + exceptions: []const JsException, -}; + /// build + build: Log, -pub const FallbackMessageContainer = struct { -/// message -message: ?[]const u8 = null, - -/// router -router: ?Router = null, - -/// reason -reason: ?FallbackStep = null, - -/// problems -problems: ?Problems = null, - -/// cwd -cwd: ?[]const u8 = null, - - -pub fn decode(reader: anytype) anyerror!FallbackMessageContainer { - var this = std.mem.zeroes(FallbackMessageContainer); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.message = try reader.readValue([]const u8); -}, - 2 => { - this.router = try reader.readValue(Router); -}, - 3 => { - this.reason = try reader.readValue(FallbackStep); -}, - 4 => { - this.problems = try reader.readValue(Problems); -}, - 5 => { - this.cwd = try reader.readValue([]const u8); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + pub fn decode(reader: anytype) anyerror!Problems { + var this = std.mem.zeroes(Problems); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.message) |message| { - try writer.writeFieldID(1); - try writer.writeValue(message); -} -if (this.router) |router| { - try writer.writeFieldID(2); - try writer.writeValue(router); -} -if (this.reason) |reason| { - try writer.writeFieldID(3); - try writer.writeEnum(reason); -} -if (this.problems) |problems| { - try writer.writeFieldID(4); - try writer.writeValue(problems); -} -if (this.cwd) |cwd| { - try writer.writeFieldID(5); - try writer.writeValue(cwd); -} -try writer.endMessage(); -} + this.code = try reader.readValue(u16); + this.name = try reader.readValue([]const u8); + this.exceptions = try reader.readArray(JsException); + this.build = try reader.readValue(Log); + return this; + } -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.code); + try writer.writeValue(this.name); + try writer.writeArray(JsException, this.exceptions); + try writer.writeValue(this.build); + } + }; -pub const ResolveMode = enum(u8) { + pub const Router = struct { + /// routes + routes: []const []const u8, -_none, - /// disable - disable, + /// route + route: i32 = 0, - /// lazy - lazy, + /// params + params: StringMap, - /// dev - dev, + pub fn decode(reader: anytype) anyerror!Router { + var this = std.mem.zeroes(Router); - /// bundle - bundle, + this.routes = try reader.readArray([]const u8); + this.route = try reader.readValue(i32); + this.params = try reader.readValue(StringMap); + return this; + } -_, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray([]const u8, this.routes); + try writer.writeInt(this.route); + try writer.writeValue(this.params); + } + }; - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } + pub const FallbackMessageContainer = struct { + /// message + message: ?[]const u8 = null, - -}; + /// router + router: ?Router = null, -pub const Platform = enum(u8) { + /// reason + reason: ?FallbackStep = null, -_none, - /// browser - browser, + /// problems + problems: ?Problems = null, - /// node - node, + /// cwd + cwd: ?[]const u8 = null, - /// bun - bun, + pub fn decode(reader: anytype) anyerror!FallbackMessageContainer { + var this = std.mem.zeroes(FallbackMessageContainer); -_, + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); + 1 => { + this.message = try reader.readValue([]const u8); + }, + 2 => { + this.router = try reader.readValue(Router); + }, + 3 => { + this.reason = try reader.readValue(FallbackStep); + }, + 4 => { + this.problems = try reader.readValue(Problems); + }, + 5 => { + this.cwd = try reader.readValue([]const u8); + }, + else => { + return error.InvalidMessage; + }, } + } + unreachable; + } - -}; - -pub const CssInJsBehavior = enum(u8) { - -_none, - /// facade - facade, - - /// facade_onimportcss - facade_onimportcss, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.message) |message| { + try writer.writeFieldID(1); + try writer.writeValue(message); + } + if (this.router) |router| { + try writer.writeFieldID(2); + try writer.writeValue(router); + } + if (this.reason) |reason| { + try writer.writeFieldID(3); + try writer.writeEnum(reason); + } + if (this.problems) |problems| { + try writer.writeFieldID(4); + try writer.writeValue(problems); + } + if (this.cwd) |cwd| { + try writer.writeFieldID(5); + try writer.writeValue(cwd); + } + try writer.endMessage(); + } + }; - /// auto_onimportcss - auto_onimportcss, + pub const ResolveMode = enum(u8) { + _none, + /// disable + disable, -_, + /// lazy + lazy, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } + /// dev + dev, - -}; + /// bundle + bundle, -pub const JsxRuntime = enum(u8) { + _, -_none, - /// automatic - automatic, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; - /// classic - classic, + pub const Platform = enum(u8) { + _none, + /// browser + browser, -_, + /// node + node, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } + /// bun + bun, - -}; + _, -pub const Jsx = struct { -/// factory -factory: []const u8, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -/// runtime -runtime: JsxRuntime, + pub const CssInJsBehavior = enum(u8) { + _none, + /// facade + facade, -/// fragment -fragment: []const u8, + /// facade_onimportcss + facade_onimportcss, -/// development -development: bool = false, + /// auto_onimportcss + auto_onimportcss, -/// import_source -import_source: []const u8, + _, -/// react_fast_refresh -react_fast_refresh: bool = false, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; + pub const JsxRuntime = enum(u8) { + _none, + /// automatic + automatic, -pub fn decode(reader: anytype) anyerror!Jsx { - var this = std.mem.zeroes(Jsx); + /// classic + classic, - this.factory = try reader.readValue([]const u8); - this.runtime = try reader.readValue(JsxRuntime); - this.fragment = try reader.readValue([]const u8); - this.development = try reader.readValue(bool); - this.import_source = try reader.readValue([]const u8); - this.react_fast_refresh = try reader.readValue(bool); - return this; -} + _, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.factory); - try writer.writeEnum(this.runtime); - try writer.writeValue(this.fragment); - try writer.writeInt(@intCast(u8, @boolToInt(this.development))); - try writer.writeValue(this.import_source); - try writer.writeInt(@intCast(u8, @boolToInt(this.react_fast_refresh))); -} + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -}; + pub const Jsx = struct { + /// factory + factory: []const u8, -pub const StringPointer = packed struct { -/// offset -offset: u32 = 0, + /// runtime + runtime: JsxRuntime, -/// length -length: u32 = 0, + /// fragment + fragment: []const u8, + /// development + development: bool = false, -pub fn decode(reader: anytype) anyerror!StringPointer { - var this = std.mem.zeroes(StringPointer); + /// import_source + import_source: []const u8, - this.offset = try reader.readValue(u32); - this.length = try reader.readValue(u32); - return this; -} + /// react_fast_refresh + react_fast_refresh: bool = false, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.offset); - try writer.writeInt(this.length); -} + pub fn decode(reader: anytype) anyerror!Jsx { + var this = std.mem.zeroes(Jsx); -}; + this.factory = try reader.readValue([]const u8); + this.runtime = try reader.readValue(JsxRuntime); + this.fragment = try reader.readValue([]const u8); + this.development = try reader.readValue(bool); + this.import_source = try reader.readValue([]const u8); + this.react_fast_refresh = try reader.readValue(bool); + return this; + } -pub const JavascriptBundledModule = struct { -/// path -path: StringPointer, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.factory); + try writer.writeEnum(this.runtime); + try writer.writeValue(this.fragment); + try writer.writeInt(@intCast(u8, @boolToInt(this.development))); + try writer.writeValue(this.import_source); + try writer.writeInt(@intCast(u8, @boolToInt(this.react_fast_refresh))); + } + }; -/// code -code: StringPointer, + pub const StringPointer = packed struct { + /// offset + offset: u32 = 0, -/// package_id -package_id: u32 = 0, + /// length + length: u32 = 0, -/// id -id: u32 = 0, + pub fn decode(reader: anytype) anyerror!StringPointer { + var this = std.mem.zeroes(StringPointer); -/// path_extname_length -path_extname_length: u8 = 0, + this.offset = try reader.readValue(u32); + this.length = try reader.readValue(u32); + return this; + } + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.offset); + try writer.writeInt(this.length); + } + }; -pub fn decode(reader: anytype) anyerror!JavascriptBundledModule { - var this = std.mem.zeroes(JavascriptBundledModule); + pub const JavascriptBundledModule = struct { + /// path + path: StringPointer, - this.path = try reader.readValue(StringPointer); - this.code = try reader.readValue(StringPointer); - this.package_id = try reader.readValue(u32); - this.id = try reader.readValue(u32); - this.path_extname_length = try reader.readValue(u8); - return this; -} + /// code + code: StringPointer, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.path); - try writer.writeValue(this.code); - try writer.writeInt(this.package_id); - try writer.writeInt(this.id); - try writer.writeInt(this.path_extname_length); -} + /// package_id + package_id: u32 = 0, -}; + /// id + id: u32 = 0, -pub const JavascriptBundledPackage = struct { -/// name -name: StringPointer, + /// path_extname_length + path_extname_length: u8 = 0, -/// version -version: StringPointer, + pub fn decode(reader: anytype) anyerror!JavascriptBundledModule { + var this = std.mem.zeroes(JavascriptBundledModule); -/// hash -hash: u32 = 0, + this.path = try reader.readValue(StringPointer); + this.code = try reader.readValue(StringPointer); + this.package_id = try reader.readValue(u32); + this.id = try reader.readValue(u32); + this.path_extname_length = try reader.readValue(u8); + return this; + } -/// modules_offset -modules_offset: u32 = 0, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.path); + try writer.writeValue(this.code); + try writer.writeInt(this.package_id); + try writer.writeInt(this.id); + try writer.writeInt(this.path_extname_length); + } + }; -/// modules_length -modules_length: u32 = 0, + pub const JavascriptBundledPackage = struct { + /// name + name: StringPointer, + /// version + version: StringPointer, -pub fn decode(reader: anytype) anyerror!JavascriptBundledPackage { - var this = std.mem.zeroes(JavascriptBundledPackage); + /// hash + hash: u32 = 0, - this.name = try reader.readValue(StringPointer); - this.version = try reader.readValue(StringPointer); - this.hash = try reader.readValue(u32); - this.modules_offset = try reader.readValue(u32); - this.modules_length = try reader.readValue(u32); - return this; -} + /// modules_offset + modules_offset: u32 = 0, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.name); - try writer.writeValue(this.version); - try writer.writeInt(this.hash); - try writer.writeInt(this.modules_offset); - try writer.writeInt(this.modules_length); -} + /// modules_length + modules_length: u32 = 0, -}; + pub fn decode(reader: anytype) anyerror!JavascriptBundledPackage { + var this = std.mem.zeroes(JavascriptBundledPackage); -pub const JavascriptBundle = struct { -/// modules -modules: []const JavascriptBundledModule, + this.name = try reader.readValue(StringPointer); + this.version = try reader.readValue(StringPointer); + this.hash = try reader.readValue(u32); + this.modules_offset = try reader.readValue(u32); + this.modules_length = try reader.readValue(u32); + return this; + } -/// packages -packages: []const JavascriptBundledPackage, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.name); + try writer.writeValue(this.version); + try writer.writeInt(this.hash); + try writer.writeInt(this.modules_offset); + try writer.writeInt(this.modules_length); + } + }; -/// etag -etag: []const u8, + pub const JavascriptBundle = struct { + /// modules + modules: []const JavascriptBundledModule, -/// generated_at -generated_at: u32 = 0, + /// packages + packages: []const JavascriptBundledPackage, -/// app_package_json_dependencies_hash -app_package_json_dependencies_hash: []const u8, + /// etag + etag: []const u8, -/// import_from_name -import_from_name: []const u8, + /// generated_at + generated_at: u32 = 0, -/// manifest_string -manifest_string: []const u8, + /// app_package_json_dependencies_hash + app_package_json_dependencies_hash: []const u8, + /// import_from_name + import_from_name: []const u8, -pub fn decode(reader: anytype) anyerror!JavascriptBundle { - var this = std.mem.zeroes(JavascriptBundle); + /// manifest_string + manifest_string: []const u8, - this.modules = try reader.readArray(JavascriptBundledModule); - this.packages = try reader.readArray(JavascriptBundledPackage); - this.etag = try reader.readArray(u8); - this.generated_at = try reader.readValue(u32); - this.app_package_json_dependencies_hash = try reader.readArray(u8); - this.import_from_name = try reader.readArray(u8); - this.manifest_string = try reader.readArray(u8); - return this; -} + pub fn decode(reader: anytype) anyerror!JavascriptBundle { + var this = std.mem.zeroes(JavascriptBundle); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray(JavascriptBundledModule, this.modules); - try writer.writeArray(JavascriptBundledPackage, this.packages); - try writer.writeArray(u8, this.etag); - try writer.writeInt(this.generated_at); - try writer.writeArray(u8, this.app_package_json_dependencies_hash); - try writer.writeArray(u8, this.import_from_name); - try writer.writeArray(u8, this.manifest_string); -} + this.modules = try reader.readArray(JavascriptBundledModule); + this.packages = try reader.readArray(JavascriptBundledPackage); + this.etag = try reader.readArray(u8); + this.generated_at = try reader.readValue(u32); + this.app_package_json_dependencies_hash = try reader.readArray(u8); + this.import_from_name = try reader.readArray(u8); + this.manifest_string = try reader.readArray(u8); + return this; + } -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(JavascriptBundledModule, this.modules); + try writer.writeArray(JavascriptBundledPackage, this.packages); + try writer.writeArray(u8, this.etag); + try writer.writeInt(this.generated_at); + try writer.writeArray(u8, this.app_package_json_dependencies_hash); + try writer.writeArray(u8, this.import_from_name); + try writer.writeArray(u8, this.manifest_string); + } + }; -pub const JavascriptBundleContainer = struct { -/// bundle_format_version -bundle_format_version: ?u32 = null, - -/// routes -routes: ?LoadedRouteConfig = null, - -/// framework -framework: ?LoadedFramework = null, - -/// bundle -bundle: ?JavascriptBundle = null, - -/// code_length -code_length: ?u32 = null, - - -pub fn decode(reader: anytype) anyerror!JavascriptBundleContainer { - var this = std.mem.zeroes(JavascriptBundleContainer); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.bundle_format_version = try reader.readValue(u32); -}, - 2 => { - this.routes = try reader.readValue(LoadedRouteConfig); -}, - 3 => { - this.framework = try reader.readValue(LoadedFramework); -}, - 4 => { - this.bundle = try reader.readValue(JavascriptBundle); -}, - 5 => { - this.code_length = try reader.readValue(u32); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + pub const JavascriptBundleContainer = struct { + /// bundle_format_version + bundle_format_version: ?u32 = null, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.bundle_format_version) |bundle_format_version| { - try writer.writeFieldID(1); - try writer.writeInt(bundle_format_version); -} -if (this.routes) |routes| { - try writer.writeFieldID(2); - try writer.writeValue(routes); -} -if (this.framework) |framework| { - try writer.writeFieldID(3); - try writer.writeValue(framework); -} -if (this.bundle) |bundle| { - try writer.writeFieldID(4); - try writer.writeValue(bundle); -} -if (this.code_length) |code_length| { - try writer.writeFieldID(5); - try writer.writeInt(code_length); -} -try writer.endMessage(); -} + /// routes + routes: ?LoadedRouteConfig = null, -}; + /// framework + framework: ?LoadedFramework = null, -pub const ScanDependencyMode = enum(u8) { + /// bundle + bundle: ?JavascriptBundle = null, -_none, - /// app - app, + /// code_length + code_length: ?u32 = null, - /// all - all, + pub fn decode(reader: anytype) anyerror!JavascriptBundleContainer { + var this = std.mem.zeroes(JavascriptBundleContainer); -_, + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); + 1 => { + this.bundle_format_version = try reader.readValue(u32); + }, + 2 => { + this.routes = try reader.readValue(LoadedRouteConfig); + }, + 3 => { + this.framework = try reader.readValue(LoadedFramework); + }, + 4 => { + this.bundle = try reader.readValue(JavascriptBundle); + }, + 5 => { + this.code_length = try reader.readValue(u32); + }, + else => { + return error.InvalidMessage; + }, } + } + unreachable; + } - -}; - -pub const ModuleImportType = enum(u8) { - -_none, - /// import - import, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.bundle_format_version) |bundle_format_version| { + try writer.writeFieldID(1); + try writer.writeInt(bundle_format_version); + } + if (this.routes) |routes| { + try writer.writeFieldID(2); + try writer.writeValue(routes); + } + if (this.framework) |framework| { + try writer.writeFieldID(3); + try writer.writeValue(framework); + } + if (this.bundle) |bundle| { + try writer.writeFieldID(4); + try writer.writeValue(bundle); + } + if (this.code_length) |code_length| { + try writer.writeFieldID(5); + try writer.writeInt(code_length); + } + try writer.endMessage(); + } + }; - /// require - require, + pub const ScanDependencyMode = enum(u8) { + _none, + /// app + app, -_, + /// all + all, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } + _, - -}; + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -pub const ModuleImportRecord = struct { -/// kind -kind: ModuleImportType, + pub const ModuleImportType = enum(u8) { + _none, + /// import + import, -/// path -path: []const u8, + /// require + require, -/// dynamic -dynamic: bool = false, + _, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -pub fn decode(reader: anytype) anyerror!ModuleImportRecord { - var this = std.mem.zeroes(ModuleImportRecord); + pub const ModuleImportRecord = struct { + /// kind + kind: ModuleImportType, - this.kind = try reader.readValue(ModuleImportType); - this.path = try reader.readValue([]const u8); - this.dynamic = try reader.readValue(bool); - return this; -} + /// path + path: []const u8, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeEnum(this.kind); - try writer.writeValue(this.path); - try writer.writeInt(@intCast(u8, @boolToInt(this.dynamic))); -} + /// dynamic + dynamic: bool = false, -}; + pub fn decode(reader: anytype) anyerror!ModuleImportRecord { + var this = std.mem.zeroes(ModuleImportRecord); -pub const Module = struct { -/// path -path: []const u8, + this.kind = try reader.readValue(ModuleImportType); + this.path = try reader.readValue([]const u8); + this.dynamic = try reader.readValue(bool); + return this; + } -/// imports -imports: []const ModuleImportRecord, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeEnum(this.kind); + try writer.writeValue(this.path); + try writer.writeInt(@intCast(u8, @boolToInt(this.dynamic))); + } + }; + pub const Module = struct { + /// path + path: []const u8, -pub fn decode(reader: anytype) anyerror!Module { - var this = std.mem.zeroes(Module); + /// imports + imports: []const ModuleImportRecord, - this.path = try reader.readValue([]const u8); - this.imports = try reader.readArray(ModuleImportRecord); - return this; -} + pub fn decode(reader: anytype) anyerror!Module { + var this = std.mem.zeroes(Module); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.path); - try writer.writeArray(ModuleImportRecord, this.imports); -} + this.path = try reader.readValue([]const u8); + this.imports = try reader.readArray(ModuleImportRecord); + return this; + } -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.path); + try writer.writeArray(ModuleImportRecord, this.imports); + } + }; -pub const StringMap = struct { -/// keys -keys: []const []const u8, + pub const StringMap = struct { + /// keys + keys: []const []const u8, -/// values -values: []const []const u8, + /// values + values: []const []const u8, + pub fn decode(reader: anytype) anyerror!StringMap { + var this = std.mem.zeroes(StringMap); -pub fn decode(reader: anytype) anyerror!StringMap { - var this = std.mem.zeroes(StringMap); + this.keys = try reader.readArray([]const u8); + this.values = try reader.readArray([]const u8); + return this; + } - this.keys = try reader.readArray([]const u8); - this.values = try reader.readArray([]const u8); - return this; -} + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray([]const u8, this.keys); + try writer.writeArray([]const u8, this.values); + } + }; -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray([]const u8, this.keys); - try writer.writeArray([]const u8, this.values); -} + pub const LoaderMap = struct { + /// extensions + extensions: []const []const u8, -}; + /// loaders + loaders: []const Loader, -pub const LoaderMap = struct { -/// extensions -extensions: []const []const u8, + pub fn decode(reader: anytype) anyerror!LoaderMap { + var this = std.mem.zeroes(LoaderMap); -/// loaders -loaders: []const Loader, + this.extensions = try reader.readArray([]const u8); + this.loaders = try reader.readArray(Loader); + return this; + } + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray([]const u8, this.extensions); + try writer.writeArray(Loader, this.loaders); + } + }; -pub fn decode(reader: anytype) anyerror!LoaderMap { - var this = std.mem.zeroes(LoaderMap); + pub const DotEnvBehavior = enum(u32) { + _none, + /// disable + disable, - this.extensions = try reader.readArray([]const u8); - this.loaders = try reader.readArray(Loader); - return this; -} + /// prefix + prefix, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray([]const u8, this.extensions); - try writer.writeArray(Loader, this.loaders); -} + /// load_all + load_all, -}; + _, -pub const DotEnvBehavior = enum(u32) { + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -_none, - /// disable - disable, + pub const EnvConfig = struct { + /// prefix + prefix: ?[]const u8 = null, - /// prefix - prefix, + /// defaults + defaults: ?StringMap = null, - /// load_all - load_all, + pub fn decode(reader: anytype) anyerror!EnvConfig { + var this = std.mem.zeroes(EnvConfig); -_, + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); + 1 => { + this.prefix = try reader.readValue([]const u8); + }, + 2 => { + this.defaults = try reader.readValue(StringMap); + }, + else => { + return error.InvalidMessage; + }, } + } + unreachable; + } - -}; - -pub const EnvConfig = struct { -/// prefix -prefix: ?[]const u8 = null, - -/// defaults -defaults: ?StringMap = null, - - -pub fn decode(reader: anytype) anyerror!EnvConfig { - var this = std.mem.zeroes(EnvConfig); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.prefix = try reader.readValue([]const u8); -}, - 2 => { - this.defaults = try reader.readValue(StringMap); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} - -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.prefix) |prefix| { - try writer.writeFieldID(1); - try writer.writeValue(prefix); -} -if (this.defaults) |defaults| { - try writer.writeFieldID(2); - try writer.writeValue(defaults); -} -try writer.endMessage(); -} - -}; - -pub const LoadedEnvConfig = struct { -/// dotenv -dotenv: DotEnvBehavior, - -/// defaults -defaults: StringMap, - -/// prefix -prefix: []const u8, - - -pub fn decode(reader: anytype) anyerror!LoadedEnvConfig { - var this = std.mem.zeroes(LoadedEnvConfig); + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.prefix) |prefix| { + try writer.writeFieldID(1); + try writer.writeValue(prefix); + } + if (this.defaults) |defaults| { + try writer.writeFieldID(2); + try writer.writeValue(defaults); + } + try writer.endMessage(); + } + }; - this.dotenv = try reader.readValue(DotEnvBehavior); - this.defaults = try reader.readValue(StringMap); - this.prefix = try reader.readValue([]const u8); - return this; -} + pub const LoadedEnvConfig = struct { + /// dotenv + dotenv: DotEnvBehavior, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeEnum(this.dotenv); - try writer.writeValue(this.defaults); - try writer.writeValue(this.prefix); -} + /// defaults + defaults: StringMap, -}; + /// prefix + prefix: []const u8, -pub const FrameworkConfig = struct { -/// package -package: ?[]const u8 = null, - -/// client -client: ?FrameworkEntryPointMessage = null, - -/// server -server: ?FrameworkEntryPointMessage = null, - -/// fallback -fallback: ?FrameworkEntryPointMessage = null, - -/// development -development: ?bool = null, - -/// client_css_in_js -client_css_in_js: ?CssInJsBehavior = null, - -/// display_name -display_name: ?[]const u8 = null, - -/// overrideModules -override_modules: ?StringMap = null, - - -pub fn decode(reader: anytype) anyerror!FrameworkConfig { - var this = std.mem.zeroes(FrameworkConfig); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.package = try reader.readValue([]const u8); -}, - 2 => { - this.client = try reader.readValue(FrameworkEntryPointMessage); -}, - 3 => { - this.server = try reader.readValue(FrameworkEntryPointMessage); -}, - 4 => { - this.fallback = try reader.readValue(FrameworkEntryPointMessage); -}, - 5 => { - this.development = try reader.readValue(bool); -}, - 6 => { - this.client_css_in_js = try reader.readValue(CssInJsBehavior); -}, - 7 => { - this.display_name = try reader.readValue([]const u8); -}, - 8 => { - this.override_modules = try reader.readValue(StringMap); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + pub fn decode(reader: anytype) anyerror!LoadedEnvConfig { + var this = std.mem.zeroes(LoadedEnvConfig); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.package) |package| { - try writer.writeFieldID(1); - try writer.writeValue(package); -} -if (this.client) |client| { - try writer.writeFieldID(2); - try writer.writeValue(client); -} -if (this.server) |server| { - try writer.writeFieldID(3); - try writer.writeValue(server); -} -if (this.fallback) |fallback| { - try writer.writeFieldID(4); - try writer.writeValue(fallback); -} -if (this.development) |development| { - try writer.writeFieldID(5); - try writer.writeInt(@intCast(u8, @boolToInt(development))); -} -if (this.client_css_in_js) |client_css_in_js| { - try writer.writeFieldID(6); - try writer.writeEnum(client_css_in_js); -} -if (this.display_name) |display_name| { - try writer.writeFieldID(7); - try writer.writeValue(display_name); -} -if (this.override_modules) |override_modules| { - try writer.writeFieldID(8); - try writer.writeValue(override_modules); -} -try writer.endMessage(); -} - -}; + this.dotenv = try reader.readValue(DotEnvBehavior); + this.defaults = try reader.readValue(StringMap); + this.prefix = try reader.readValue([]const u8); + return this; + } -pub const FrameworkEntryPoint = struct { -/// kind -kind: FrameworkEntryPointType, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeEnum(this.dotenv); + try writer.writeValue(this.defaults); + try writer.writeValue(this.prefix); + } + }; -/// path -path: []const u8, + pub const FrameworkConfig = struct { + /// package + package: ?[]const u8 = null, -/// env -env: LoadedEnvConfig, + /// client + client: ?FrameworkEntryPointMessage = null, + /// server + server: ?FrameworkEntryPointMessage = null, -pub fn decode(reader: anytype) anyerror!FrameworkEntryPoint { - var this = std.mem.zeroes(FrameworkEntryPoint); + /// fallback + fallback: ?FrameworkEntryPointMessage = null, - this.kind = try reader.readValue(FrameworkEntryPointType); - this.path = try reader.readValue([]const u8); - this.env = try reader.readValue(LoadedEnvConfig); - return this; -} + /// development + development: ?bool = null, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeEnum(this.kind); - try writer.writeValue(this.path); - try writer.writeValue(this.env); -} + /// client_css_in_js + client_css_in_js: ?CssInJsBehavior = null, -}; + /// display_name + display_name: ?[]const u8 = null, -pub const FrameworkEntryPointMap = struct { -/// client -client: ?FrameworkEntryPoint = null, - -/// server -server: ?FrameworkEntryPoint = null, - -/// fallback -fallback: ?FrameworkEntryPoint = null, - - -pub fn decode(reader: anytype) anyerror!FrameworkEntryPointMap { - var this = std.mem.zeroes(FrameworkEntryPointMap); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.client = try reader.readValue(FrameworkEntryPoint); -}, - 2 => { - this.server = try reader.readValue(FrameworkEntryPoint); -}, - 3 => { - this.fallback = try reader.readValue(FrameworkEntryPoint); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + /// overrideModules + override_modules: ?StringMap = null, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.client) |client| { - try writer.writeFieldID(1); - try writer.writeValue(client); -} -if (this.server) |server| { - try writer.writeFieldID(2); - try writer.writeValue(server); -} -if (this.fallback) |fallback| { - try writer.writeFieldID(3); - try writer.writeValue(fallback); -} -try writer.endMessage(); -} + pub fn decode(reader: anytype) anyerror!FrameworkConfig { + var this = std.mem.zeroes(FrameworkConfig); -}; + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, -pub const FrameworkEntryPointMessage = struct { -/// path -path: ?[]const u8 = null, - -/// env -env: ?EnvConfig = null, - - -pub fn decode(reader: anytype) anyerror!FrameworkEntryPointMessage { - var this = std.mem.zeroes(FrameworkEntryPointMessage); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.path = try reader.readValue([]const u8); -}, - 2 => { - this.env = try reader.readValue(EnvConfig); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + 1 => { + this.package = try reader.readValue([]const u8); + }, + 2 => { + this.client = try reader.readValue(FrameworkEntryPointMessage); + }, + 3 => { + this.server = try reader.readValue(FrameworkEntryPointMessage); + }, + 4 => { + this.fallback = try reader.readValue(FrameworkEntryPointMessage); + }, + 5 => { + this.development = try reader.readValue(bool); + }, + 6 => { + this.client_css_in_js = try reader.readValue(CssInJsBehavior); + }, + 7 => { + this.display_name = try reader.readValue([]const u8); + }, + 8 => { + this.override_modules = try reader.readValue(StringMap); + }, + else => { + return error.InvalidMessage; + }, + } + } + unreachable; + } -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.path) |path| { - try writer.writeFieldID(1); - try writer.writeValue(path); -} -if (this.env) |env| { - try writer.writeFieldID(2); - try writer.writeValue(env); -} -try writer.endMessage(); -} + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.package) |package| { + try writer.writeFieldID(1); + try writer.writeValue(package); + } + if (this.client) |client| { + try writer.writeFieldID(2); + try writer.writeValue(client); + } + if (this.server) |server| { + try writer.writeFieldID(3); + try writer.writeValue(server); + } + if (this.fallback) |fallback| { + try writer.writeFieldID(4); + try writer.writeValue(fallback); + } + if (this.development) |development| { + try writer.writeFieldID(5); + try writer.writeInt(@intCast(u8, @boolToInt(development))); + } + if (this.client_css_in_js) |client_css_in_js| { + try writer.writeFieldID(6); + try writer.writeEnum(client_css_in_js); + } + if (this.display_name) |display_name| { + try writer.writeFieldID(7); + try writer.writeValue(display_name); + } + if (this.override_modules) |override_modules| { + try writer.writeFieldID(8); + try writer.writeValue(override_modules); + } + try writer.endMessage(); + } + }; -}; + pub const FrameworkEntryPoint = struct { + /// kind + kind: FrameworkEntryPointType, -pub const LoadedFramework = struct { -/// package -package: []const u8, + /// path + path: []const u8, -/// display_name -display_name: []const u8, + /// env + env: LoadedEnvConfig, -/// development -development: bool = false, + pub fn decode(reader: anytype) anyerror!FrameworkEntryPoint { + var this = std.mem.zeroes(FrameworkEntryPoint); -/// entry_points -entry_points: FrameworkEntryPointMap, + this.kind = try reader.readValue(FrameworkEntryPointType); + this.path = try reader.readValue([]const u8); + this.env = try reader.readValue(LoadedEnvConfig); + return this; + } -/// client_css_in_js -client_css_in_js: CssInJsBehavior, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeEnum(this.kind); + try writer.writeValue(this.path); + try writer.writeValue(this.env); + } + }; -/// overrideModules -override_modules: StringMap, + pub const FrameworkEntryPointMap = struct { + /// client + client: ?FrameworkEntryPoint = null, + /// server + server: ?FrameworkEntryPoint = null, -pub fn decode(reader: anytype) anyerror!LoadedFramework { - var this = std.mem.zeroes(LoadedFramework); + /// fallback + fallback: ?FrameworkEntryPoint = null, - this.package = try reader.readValue([]const u8); - this.display_name = try reader.readValue([]const u8); - this.development = try reader.readValue(bool); - this.entry_points = try reader.readValue(FrameworkEntryPointMap); - this.client_css_in_js = try reader.readValue(CssInJsBehavior); - this.override_modules = try reader.readValue(StringMap); - return this; -} + pub fn decode(reader: anytype) anyerror!FrameworkEntryPointMap { + var this = std.mem.zeroes(FrameworkEntryPointMap); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.package); - try writer.writeValue(this.display_name); - try writer.writeInt(@intCast(u8, @boolToInt(this.development))); - try writer.writeValue(this.entry_points); - try writer.writeEnum(this.client_css_in_js); - try writer.writeValue(this.override_modules); -} + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, -}; + 1 => { + this.client = try reader.readValue(FrameworkEntryPoint); + }, + 2 => { + this.server = try reader.readValue(FrameworkEntryPoint); + }, + 3 => { + this.fallback = try reader.readValue(FrameworkEntryPoint); + }, + else => { + return error.InvalidMessage; + }, + } + } + unreachable; + } -pub const LoadedRouteConfig = struct { -/// dir -dir: []const u8, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.client) |client| { + try writer.writeFieldID(1); + try writer.writeValue(client); + } + if (this.server) |server| { + try writer.writeFieldID(2); + try writer.writeValue(server); + } + if (this.fallback) |fallback| { + try writer.writeFieldID(3); + try writer.writeValue(fallback); + } + try writer.endMessage(); + } + }; -/// extensions -extensions: []const []const u8, + pub const FrameworkEntryPointMessage = struct { + /// path + path: ?[]const u8 = null, -/// static_dir -static_dir: []const u8, + /// env + env: ?EnvConfig = null, -/// asset_prefix -asset_prefix: []const u8, + pub fn decode(reader: anytype) anyerror!FrameworkEntryPointMessage { + var this = std.mem.zeroes(FrameworkEntryPointMessage); + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, -pub fn decode(reader: anytype) anyerror!LoadedRouteConfig { - var this = std.mem.zeroes(LoadedRouteConfig); + 1 => { + this.path = try reader.readValue([]const u8); + }, + 2 => { + this.env = try reader.readValue(EnvConfig); + }, + else => { + return error.InvalidMessage; + }, + } + } + unreachable; + } - this.dir = try reader.readValue([]const u8); - this.extensions = try reader.readArray([]const u8); - this.static_dir = try reader.readValue([]const u8); - this.asset_prefix = try reader.readValue([]const u8); - return this; -} + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.path) |path| { + try writer.writeFieldID(1); + try writer.writeValue(path); + } + if (this.env) |env| { + try writer.writeFieldID(2); + try writer.writeValue(env); + } + try writer.endMessage(); + } + }; -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.dir); - try writer.writeArray([]const u8, this.extensions); - try writer.writeValue(this.static_dir); - try writer.writeValue(this.asset_prefix); -} + pub const LoadedFramework = struct { + /// package + package: []const u8, -}; + /// display_name + display_name: []const u8, -pub const RouteConfig = struct { -/// dir -dir: []const []const u8, - -/// extensions -extensions: []const []const u8, - -/// static_dir -static_dir: ?[]const u8 = null, - -/// asset_prefix -asset_prefix: ?[]const u8 = null, - - -pub fn decode(reader: anytype) anyerror!RouteConfig { - var this = std.mem.zeroes(RouteConfig); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.dir = try reader.readArray([]const u8); -}, - 2 => { - this.extensions = try reader.readArray([]const u8); -}, - 3 => { - this.static_dir = try reader.readValue([]const u8); -}, - 4 => { - this.asset_prefix = try reader.readValue([]const u8); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + /// development + development: bool = false, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.dir) |dir| { - try writer.writeFieldID(1); - try writer.writeArray([]const u8, dir); -} -if (this.extensions) |extensions| { - try writer.writeFieldID(2); - try writer.writeArray([]const u8, extensions); -} -if (this.static_dir) |static_dir| { - try writer.writeFieldID(3); - try writer.writeValue(static_dir); -} -if (this.asset_prefix) |asset_prefix| { - try writer.writeFieldID(4); - try writer.writeValue(asset_prefix); -} -try writer.endMessage(); -} + /// entry_points + entry_points: FrameworkEntryPointMap, -}; + /// client_css_in_js + client_css_in_js: CssInJsBehavior, -pub const TransformOptions = struct { -/// jsx -jsx: ?Jsx = null, + /// overrideModules + override_modules: StringMap, -/// tsconfig_override -tsconfig_override: ?[]const u8 = null, + pub fn decode(reader: anytype) anyerror!LoadedFramework { + var this = std.mem.zeroes(LoadedFramework); -/// resolve -resolve: ?ResolveMode = null, + this.package = try reader.readValue([]const u8); + this.display_name = try reader.readValue([]const u8); + this.development = try reader.readValue(bool); + this.entry_points = try reader.readValue(FrameworkEntryPointMap); + this.client_css_in_js = try reader.readValue(CssInJsBehavior); + this.override_modules = try reader.readValue(StringMap); + return this; + } -/// origin -origin: ?[]const u8 = null, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.package); + try writer.writeValue(this.display_name); + try writer.writeInt(@intCast(u8, @boolToInt(this.development))); + try writer.writeValue(this.entry_points); + try writer.writeEnum(this.client_css_in_js); + try writer.writeValue(this.override_modules); + } + }; -/// absolute_working_dir -absolute_working_dir: ?[]const u8 = null, - -/// define -define: ?StringMap = null, - -/// preserve_symlinks -preserve_symlinks: ?bool = null, - -/// entry_points -entry_points: []const []const u8, - -/// write -write: ?bool = null, - -/// inject -inject: []const []const u8, - -/// output_dir -output_dir: ?[]const u8 = null, - -/// external -external: []const []const u8, - -/// loaders -loaders: ?LoaderMap = null, - -/// main_fields -main_fields: []const []const u8, - -/// platform -platform: ?Platform = null, - -/// serve -serve: ?bool = null, - -/// extension_order -extension_order: []const []const u8, - -/// generate_node_module_bundle -generate_node_module_bundle: ?bool = null, - -/// node_modules_bundle_path -node_modules_bundle_path: ?[]const u8 = null, - -/// node_modules_bundle_path_server -node_modules_bundle_path_server: ?[]const u8 = null, - -/// framework -framework: ?FrameworkConfig = null, - -/// router -router: ?RouteConfig = null, - -/// no_summary -no_summary: ?bool = null, - -/// disable_hmr -disable_hmr: ?bool = null, - - -pub fn decode(reader: anytype) anyerror!TransformOptions { - var this = std.mem.zeroes(TransformOptions); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.jsx = try reader.readValue(Jsx); -}, - 2 => { - this.tsconfig_override = try reader.readValue([]const u8); -}, - 3 => { - this.resolve = try reader.readValue(ResolveMode); -}, - 4 => { - this.origin = try reader.readValue([]const u8); -}, - 5 => { - this.absolute_working_dir = try reader.readValue([]const u8); -}, - 6 => { - this.define = try reader.readValue(StringMap); -}, - 7 => { - this.preserve_symlinks = try reader.readValue(bool); -}, - 8 => { - this.entry_points = try reader.readArray([]const u8); -}, - 9 => { - this.write = try reader.readValue(bool); -}, - 10 => { - this.inject = try reader.readArray([]const u8); -}, - 11 => { - this.output_dir = try reader.readValue([]const u8); -}, - 12 => { - this.external = try reader.readArray([]const u8); -}, - 13 => { - this.loaders = try reader.readValue(LoaderMap); -}, - 14 => { - this.main_fields = try reader.readArray([]const u8); -}, - 15 => { - this.platform = try reader.readValue(Platform); -}, - 16 => { - this.serve = try reader.readValue(bool); -}, - 17 => { - this.extension_order = try reader.readArray([]const u8); -}, - 18 => { - this.generate_node_module_bundle = try reader.readValue(bool); -}, - 19 => { - this.node_modules_bundle_path = try reader.readValue([]const u8); -}, - 20 => { - this.node_modules_bundle_path_server = try reader.readValue([]const u8); -}, - 21 => { - this.framework = try reader.readValue(FrameworkConfig); -}, - 22 => { - this.router = try reader.readValue(RouteConfig); -}, - 23 => { - this.no_summary = try reader.readValue(bool); -}, - 24 => { - this.disable_hmr = try reader.readValue(bool); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + pub const LoadedRouteConfig = struct { + /// dir + dir: []const u8, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.jsx) |jsx| { - try writer.writeFieldID(1); - try writer.writeValue(jsx); -} -if (this.tsconfig_override) |tsconfig_override| { - try writer.writeFieldID(2); - try writer.writeValue(tsconfig_override); -} -if (this.resolve) |resolve| { - try writer.writeFieldID(3); - try writer.writeEnum(resolve); -} -if (this.origin) |origin| { - try writer.writeFieldID(4); - try writer.writeValue(origin); -} -if (this.absolute_working_dir) |absolute_working_dir| { - try writer.writeFieldID(5); - try writer.writeValue(absolute_working_dir); -} -if (this.define) |define| { - try writer.writeFieldID(6); - try writer.writeValue(define); -} -if (this.preserve_symlinks) |preserve_symlinks| { - try writer.writeFieldID(7); - try writer.writeInt(@intCast(u8, @boolToInt(preserve_symlinks))); -} -if (this.entry_points) |entry_points| { - try writer.writeFieldID(8); - try writer.writeArray([]const u8, entry_points); -} -if (this.write) |write| { - try writer.writeFieldID(9); - try writer.writeInt(@intCast(u8, @boolToInt(write))); -} -if (this.inject) |inject| { - try writer.writeFieldID(10); - try writer.writeArray([]const u8, inject); -} -if (this.output_dir) |output_dir| { - try writer.writeFieldID(11); - try writer.writeValue(output_dir); -} -if (this.external) |external| { - try writer.writeFieldID(12); - try writer.writeArray([]const u8, external); -} -if (this.loaders) |loaders| { - try writer.writeFieldID(13); - try writer.writeValue(loaders); -} -if (this.main_fields) |main_fields| { - try writer.writeFieldID(14); - try writer.writeArray([]const u8, main_fields); -} -if (this.platform) |platform| { - try writer.writeFieldID(15); - try writer.writeEnum(platform); -} -if (this.serve) |serve| { - try writer.writeFieldID(16); - try writer.writeInt(@intCast(u8, @boolToInt(serve))); -} -if (this.extension_order) |extension_order| { - try writer.writeFieldID(17); - try writer.writeArray([]const u8, extension_order); -} -if (this.generate_node_module_bundle) |generate_node_module_bundle| { - try writer.writeFieldID(18); - try writer.writeInt(@intCast(u8, @boolToInt(generate_node_module_bundle))); -} -if (this.node_modules_bundle_path) |node_modules_bundle_path| { - try writer.writeFieldID(19); - try writer.writeValue(node_modules_bundle_path); -} -if (this.node_modules_bundle_path_server) |node_modules_bundle_path_server| { - try writer.writeFieldID(20); - try writer.writeValue(node_modules_bundle_path_server); -} -if (this.framework) |framework| { - try writer.writeFieldID(21); - try writer.writeValue(framework); -} -if (this.router) |router| { - try writer.writeFieldID(22); - try writer.writeValue(router); -} -if (this.no_summary) |no_summary| { - try writer.writeFieldID(23); - try writer.writeInt(@intCast(u8, @boolToInt(no_summary))); -} -if (this.disable_hmr) |disable_hmr| { - try writer.writeFieldID(24); - try writer.writeInt(@intCast(u8, @boolToInt(disable_hmr))); -} -try writer.endMessage(); -} + /// extensions + extensions: []const []const u8, -}; + /// static_dir + static_dir: []const u8, -pub const FileHandle = struct { -/// path -path: []const u8, + /// asset_prefix + asset_prefix: []const u8, -/// size -size: u32 = 0, + pub fn decode(reader: anytype) anyerror!LoadedRouteConfig { + var this = std.mem.zeroes(LoadedRouteConfig); -/// fd -fd: u32 = 0, + this.dir = try reader.readValue([]const u8); + this.extensions = try reader.readArray([]const u8); + this.static_dir = try reader.readValue([]const u8); + this.asset_prefix = try reader.readValue([]const u8); + return this; + } + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.dir); + try writer.writeArray([]const u8, this.extensions); + try writer.writeValue(this.static_dir); + try writer.writeValue(this.asset_prefix); + } + }; -pub fn decode(reader: anytype) anyerror!FileHandle { - var this = std.mem.zeroes(FileHandle); + pub const RouteConfig = struct { + /// dir + dir: []const []const u8, - this.path = try reader.readValue([]const u8); - this.size = try reader.readValue(u32); - this.fd = try reader.readValue(u32); - return this; -} + /// extensions + extensions: []const []const u8, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.path); - try writer.writeInt(this.size); - try writer.writeInt(this.fd); -} + /// static_dir + static_dir: ?[]const u8 = null, -}; + /// asset_prefix + asset_prefix: ?[]const u8 = null, -pub const Transform = struct { -/// handle -handle: ?FileHandle = null, - -/// path -path: ?[]const u8 = null, - -/// contents -contents: []const u8, - -/// loader -loader: ?Loader = null, - -/// options -options: ?TransformOptions = null, - - -pub fn decode(reader: anytype) anyerror!Transform { - var this = std.mem.zeroes(Transform); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.handle = try reader.readValue(FileHandle); -}, - 2 => { - this.path = try reader.readValue([]const u8); -}, - 3 => { - this.contents = try reader.readArray(u8); -}, - 4 => { - this.loader = try reader.readValue(Loader); -}, - 5 => { - this.options = try reader.readValue(TransformOptions); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + pub fn decode(reader: anytype) anyerror!RouteConfig { + var this = std.mem.zeroes(RouteConfig); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.handle) |handle| { - try writer.writeFieldID(1); - try writer.writeValue(handle); -} -if (this.path) |path| { - try writer.writeFieldID(2); - try writer.writeValue(path); -} -if (this.contents) |contents| { - try writer.writeFieldID(3); - try writer.writeArray(u8, contents); -} -if (this.loader) |loader| { - try writer.writeFieldID(4); - try writer.writeEnum(loader); -} -if (this.options) |options| { - try writer.writeFieldID(5); - try writer.writeValue(options); -} -try writer.endMessage(); -} + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, -}; + 1 => { + this.dir = try reader.readArray([]const u8); + }, + 2 => { + this.extensions = try reader.readArray([]const u8); + }, + 3 => { + this.static_dir = try reader.readValue([]const u8); + }, + 4 => { + this.asset_prefix = try reader.readValue([]const u8); + }, + else => { + return error.InvalidMessage; + }, + } + } + unreachable; + } -pub const TransformResponseStatus = enum(u32) { + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.dir) |dir| { + try writer.writeFieldID(1); + try writer.writeArray([]const u8, dir); + } + if (this.extensions) |extensions| { + try writer.writeFieldID(2); + try writer.writeArray([]const u8, extensions); + } + if (this.static_dir) |static_dir| { + try writer.writeFieldID(3); + try writer.writeValue(static_dir); + } + if (this.asset_prefix) |asset_prefix| { + try writer.writeFieldID(4); + try writer.writeValue(asset_prefix); + } + try writer.endMessage(); + } + }; -_none, - /// success - success, + pub const TransformOptions = struct { + /// jsx + jsx: ?Jsx = null, - /// fail - fail, + /// tsconfig_override + tsconfig_override: ?[]const u8 = null, -_, + /// resolve + resolve: ?ResolveMode = null, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } + /// origin + origin: ?[]const u8 = null, - -}; + /// absolute_working_dir + absolute_working_dir: ?[]const u8 = null, -pub const OutputFile = struct { -/// data -data: []const u8, + /// define + define: ?StringMap = null, -/// path -path: []const u8, + /// preserve_symlinks + preserve_symlinks: ?bool = null, + /// entry_points + entry_points: []const []const u8, -pub fn decode(reader: anytype) anyerror!OutputFile { - var this = std.mem.zeroes(OutputFile); + /// write + write: ?bool = null, - this.data = try reader.readArray(u8); - this.path = try reader.readValue([]const u8); - return this; -} + /// inject + inject: []const []const u8, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray(u8, this.data); - try writer.writeValue(this.path); -} + /// output_dir + output_dir: ?[]const u8 = null, -}; + /// external + external: []const []const u8, -pub const TransformResponse = struct { -/// status -status: TransformResponseStatus, + /// loaders + loaders: ?LoaderMap = null, -/// files -files: []const OutputFile, + /// main_fields + main_fields: []const []const u8, -/// errors -errors: []const Message, + /// platform + platform: ?Platform = null, + /// serve + serve: ?bool = null, -pub fn decode(reader: anytype) anyerror!TransformResponse { - var this = std.mem.zeroes(TransformResponse); + /// extension_order + extension_order: []const []const u8, - this.status = try reader.readValue(TransformResponseStatus); - this.files = try reader.readArray(OutputFile); - this.errors = try reader.readArray(Message); - return this; -} + /// generate_node_module_bundle + generate_node_module_bundle: ?bool = null, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeEnum(this.status); - try writer.writeArray(OutputFile, this.files); - try writer.writeArray(Message, this.errors); -} + /// node_modules_bundle_path + node_modules_bundle_path: ?[]const u8 = null, -}; + /// node_modules_bundle_path_server + node_modules_bundle_path_server: ?[]const u8 = null, -pub const MessageLevel = enum(u32) { + /// framework + framework: ?FrameworkConfig = null, -_none, - /// err - err, + /// router + router: ?RouteConfig = null, - /// warn - warn, + /// no_summary + no_summary: ?bool = null, - /// note - note, + /// disable_hmr + disable_hmr: ?bool = null, - /// debug - debug, + pub fn decode(reader: anytype) anyerror!TransformOptions { + var this = std.mem.zeroes(TransformOptions); -_, + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); + 1 => { + this.jsx = try reader.readValue(Jsx); + }, + 2 => { + this.tsconfig_override = try reader.readValue([]const u8); + }, + 3 => { + this.resolve = try reader.readValue(ResolveMode); + }, + 4 => { + this.origin = try reader.readValue([]const u8); + }, + 5 => { + this.absolute_working_dir = try reader.readValue([]const u8); + }, + 6 => { + this.define = try reader.readValue(StringMap); + }, + 7 => { + this.preserve_symlinks = try reader.readValue(bool); + }, + 8 => { + this.entry_points = try reader.readArray([]const u8); + }, + 9 => { + this.write = try reader.readValue(bool); + }, + 10 => { + this.inject = try reader.readArray([]const u8); + }, + 11 => { + this.output_dir = try reader.readValue([]const u8); + }, + 12 => { + this.external = try reader.readArray([]const u8); + }, + 13 => { + this.loaders = try reader.readValue(LoaderMap); + }, + 14 => { + this.main_fields = try reader.readArray([]const u8); + }, + 15 => { + this.platform = try reader.readValue(Platform); + }, + 16 => { + this.serve = try reader.readValue(bool); + }, + 17 => { + this.extension_order = try reader.readArray([]const u8); + }, + 18 => { + this.generate_node_module_bundle = try reader.readValue(bool); + }, + 19 => { + this.node_modules_bundle_path = try reader.readValue([]const u8); + }, + 20 => { + this.node_modules_bundle_path_server = try reader.readValue([]const u8); + }, + 21 => { + this.framework = try reader.readValue(FrameworkConfig); + }, + 22 => { + this.router = try reader.readValue(RouteConfig); + }, + 23 => { + this.no_summary = try reader.readValue(bool); + }, + 24 => { + this.disable_hmr = try reader.readValue(bool); + }, + else => { + return error.InvalidMessage; + }, } + } + unreachable; + } - -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.jsx) |jsx| { + try writer.writeFieldID(1); + try writer.writeValue(jsx); + } + if (this.tsconfig_override) |tsconfig_override| { + try writer.writeFieldID(2); + try writer.writeValue(tsconfig_override); + } + if (this.resolve) |resolve| { + try writer.writeFieldID(3); + try writer.writeEnum(resolve); + } + if (this.origin) |origin| { + try writer.writeFieldID(4); + try writer.writeValue(origin); + } + if (this.absolute_working_dir) |absolute_working_dir| { + try writer.writeFieldID(5); + try writer.writeValue(absolute_working_dir); + } + if (this.define) |define| { + try writer.writeFieldID(6); + try writer.writeValue(define); + } + if (this.preserve_symlinks) |preserve_symlinks| { + try writer.writeFieldID(7); + try writer.writeInt(@intCast(u8, @boolToInt(preserve_symlinks))); + } + if (this.entry_points) |entry_points| { + try writer.writeFieldID(8); + try writer.writeArray([]const u8, entry_points); + } + if (this.write) |write| { + try writer.writeFieldID(9); + try writer.writeInt(@intCast(u8, @boolToInt(write))); + } + if (this.inject) |inject| { + try writer.writeFieldID(10); + try writer.writeArray([]const u8, inject); + } + if (this.output_dir) |output_dir| { + try writer.writeFieldID(11); + try writer.writeValue(output_dir); + } + if (this.external) |external| { + try writer.writeFieldID(12); + try writer.writeArray([]const u8, external); + } + if (this.loaders) |loaders| { + try writer.writeFieldID(13); + try writer.writeValue(loaders); + } + if (this.main_fields) |main_fields| { + try writer.writeFieldID(14); + try writer.writeArray([]const u8, main_fields); + } + if (this.platform) |platform| { + try writer.writeFieldID(15); + try writer.writeEnum(platform); + } + if (this.serve) |serve| { + try writer.writeFieldID(16); + try writer.writeInt(@intCast(u8, @boolToInt(serve))); + } + if (this.extension_order) |extension_order| { + try writer.writeFieldID(17); + try writer.writeArray([]const u8, extension_order); + } + if (this.generate_node_module_bundle) |generate_node_module_bundle| { + try writer.writeFieldID(18); + try writer.writeInt(@intCast(u8, @boolToInt(generate_node_module_bundle))); + } + if (this.node_modules_bundle_path) |node_modules_bundle_path| { + try writer.writeFieldID(19); + try writer.writeValue(node_modules_bundle_path); + } + if (this.node_modules_bundle_path_server) |node_modules_bundle_path_server| { + try writer.writeFieldID(20); + try writer.writeValue(node_modules_bundle_path_server); + } + if (this.framework) |framework| { + try writer.writeFieldID(21); + try writer.writeValue(framework); + } + if (this.router) |router| { + try writer.writeFieldID(22); + try writer.writeValue(router); + } + if (this.no_summary) |no_summary| { + try writer.writeFieldID(23); + try writer.writeInt(@intCast(u8, @boolToInt(no_summary))); + } + if (this.disable_hmr) |disable_hmr| { + try writer.writeFieldID(24); + try writer.writeInt(@intCast(u8, @boolToInt(disable_hmr))); + } + try writer.endMessage(); + } + }; -pub const Location = struct { -/// file -file: []const u8, + pub const FileHandle = struct { + /// path + path: []const u8, -/// namespace -namespace: []const u8, + /// size + size: u32 = 0, -/// line -line: i32 = 0, + /// fd + fd: u32 = 0, -/// column -column: i32 = 0, + pub fn decode(reader: anytype) anyerror!FileHandle { + var this = std.mem.zeroes(FileHandle); -/// line_text -line_text: []const u8, + this.path = try reader.readValue([]const u8); + this.size = try reader.readValue(u32); + this.fd = try reader.readValue(u32); + return this; + } -/// suggestion -suggestion: []const u8, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.path); + try writer.writeInt(this.size); + try writer.writeInt(this.fd); + } + }; -/// offset -offset: u32 = 0, + pub const Transform = struct { + /// handle + handle: ?FileHandle = null, + /// path + path: ?[]const u8 = null, -pub fn decode(reader: anytype) anyerror!Location { - var this = std.mem.zeroes(Location); + /// contents + contents: []const u8, - this.file = try reader.readValue([]const u8); - this.namespace = try reader.readValue([]const u8); - this.line = try reader.readValue(i32); - this.column = try reader.readValue(i32); - this.line_text = try reader.readValue([]const u8); - this.suggestion = try reader.readValue([]const u8); - this.offset = try reader.readValue(u32); - return this; -} + /// loader + loader: ?Loader = null, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.file); - try writer.writeValue(this.namespace); - try writer.writeInt(this.line); - try writer.writeInt(this.column); - try writer.writeValue(this.line_text); - try writer.writeValue(this.suggestion); - try writer.writeInt(this.offset); -} + /// options + options: ?TransformOptions = null, -}; + pub fn decode(reader: anytype) anyerror!Transform { + var this = std.mem.zeroes(Transform); -pub const MessageData = struct { -/// text -text: ?[]const u8 = null, - -/// location -location: ?Location = null, - - -pub fn decode(reader: anytype) anyerror!MessageData { - var this = std.mem.zeroes(MessageData); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.text = try reader.readValue([]const u8); -}, - 2 => { - this.location = try reader.readValue(Location); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.text) |text| { - try writer.writeFieldID(1); - try writer.writeValue(text); -} -if (this.location) |location| { - try writer.writeFieldID(2); - try writer.writeValue(location); -} -try writer.endMessage(); -} + 1 => { + this.handle = try reader.readValue(FileHandle); + }, + 2 => { + this.path = try reader.readValue([]const u8); + }, + 3 => { + this.contents = try reader.readArray(u8); + }, + 4 => { + this.loader = try reader.readValue(Loader); + }, + 5 => { + this.options = try reader.readValue(TransformOptions); + }, + else => { + return error.InvalidMessage; + }, + } + } + unreachable; + } -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.handle) |handle| { + try writer.writeFieldID(1); + try writer.writeValue(handle); + } + if (this.path) |path| { + try writer.writeFieldID(2); + try writer.writeValue(path); + } + if (this.contents) |contents| { + try writer.writeFieldID(3); + try writer.writeArray(u8, contents); + } + if (this.loader) |loader| { + try writer.writeFieldID(4); + try writer.writeEnum(loader); + } + if (this.options) |options| { + try writer.writeFieldID(5); + try writer.writeValue(options); + } + try writer.endMessage(); + } + }; -pub const MessageMeta = struct { -/// resolve -resolve: ?[]const u8 = null, - -/// build -build: ?bool = null, - - -pub fn decode(reader: anytype) anyerror!MessageMeta { - var this = std.mem.zeroes(MessageMeta); - - while(true) { - switch (try reader.readByte()) { - 0 => { return this; }, - - 1 => { - this.resolve = try reader.readValue([]const u8); -}, - 2 => { - this.build = try reader.readValue(bool); -}, - else => { - return error.InvalidMessage; - }, - } - } -unreachable; -} + pub const TransformResponseStatus = enum(u32) { + _none, + /// success + success, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { -if (this.resolve) |resolve| { - try writer.writeFieldID(1); - try writer.writeValue(resolve); -} -if (this.build) |build| { - try writer.writeFieldID(2); - try writer.writeInt(@intCast(u8, @boolToInt(build))); -} -try writer.endMessage(); -} + /// fail + fail, -}; + _, -pub const Message = struct { -/// level -level: MessageLevel, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -/// data -data: MessageData, + pub const OutputFile = struct { + /// data + data: []const u8, -/// notes -notes: []const MessageData, + /// path + path: []const u8, -/// on -on: MessageMeta, + pub fn decode(reader: anytype) anyerror!OutputFile { + var this = std.mem.zeroes(OutputFile); + this.data = try reader.readArray(u8); + this.path = try reader.readValue([]const u8); + return this; + } -pub fn decode(reader: anytype) anyerror!Message { - var this = std.mem.zeroes(Message); + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(u8, this.data); + try writer.writeValue(this.path); + } + }; - this.level = try reader.readValue(MessageLevel); - this.data = try reader.readValue(MessageData); - this.notes = try reader.readArray(MessageData); - this.on = try reader.readValue(MessageMeta); - return this; -} + pub const TransformResponse = struct { + /// status + status: TransformResponseStatus, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeEnum(this.level); - try writer.writeValue(this.data); - try writer.writeArray(MessageData, this.notes); - try writer.writeValue(this.on); -} + /// files + files: []const OutputFile, -}; + /// errors + errors: []const Message, -pub const Log = struct { -/// warnings -warnings: u32 = 0, + pub fn decode(reader: anytype) anyerror!TransformResponse { + var this = std.mem.zeroes(TransformResponse); -/// errors -errors: u32 = 0, + this.status = try reader.readValue(TransformResponseStatus); + this.files = try reader.readArray(OutputFile); + this.errors = try reader.readArray(Message); + return this; + } -/// msgs -msgs: []const Message, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeEnum(this.status); + try writer.writeArray(OutputFile, this.files); + try writer.writeArray(Message, this.errors); + } + }; + pub const MessageLevel = enum(u32) { + _none, + /// err + err, -pub fn decode(reader: anytype) anyerror!Log { - var this = std.mem.zeroes(Log); + /// warn + warn, - this.warnings = try reader.readValue(u32); - this.errors = try reader.readValue(u32); - this.msgs = try reader.readArray(Message); - return this; -} + /// note + note, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.warnings); - try writer.writeInt(this.errors); - try writer.writeArray(Message, this.msgs); -} + /// debug + debug, -}; + _, -pub const Reloader = enum(u8) { + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -_none, - /// disable - disable, + pub const Location = struct { + /// file + file: []const u8, - /// live - live, + /// namespace + namespace: []const u8, - /// fast_refresh - fast_refresh, + /// line + line: i32 = 0, -_, + /// column + column: i32 = 0, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } + /// line_text + line_text: []const u8, - -}; + /// suggestion + suggestion: []const u8, -pub const WebsocketMessageKind = enum(u8) { + /// offset + offset: u32 = 0, -_none, - /// welcome - welcome, + pub fn decode(reader: anytype) anyerror!Location { + var this = std.mem.zeroes(Location); - /// file_change_notification - file_change_notification, + this.file = try reader.readValue([]const u8); + this.namespace = try reader.readValue([]const u8); + this.line = try reader.readValue(i32); + this.column = try reader.readValue(i32); + this.line_text = try reader.readValue([]const u8); + this.suggestion = try reader.readValue([]const u8); + this.offset = try reader.readValue(u32); + return this; + } - /// build_success - build_success, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.file); + try writer.writeValue(this.namespace); + try writer.writeInt(this.line); + try writer.writeInt(this.column); + try writer.writeValue(this.line_text); + try writer.writeValue(this.suggestion); + try writer.writeInt(this.offset); + } + }; - /// build_fail - build_fail, + pub const MessageData = struct { + /// text + text: ?[]const u8 = null, - /// manifest_success - manifest_success, + /// location + location: ?Location = null, - /// manifest_fail - manifest_fail, + pub fn decode(reader: anytype) anyerror!MessageData { + var this = std.mem.zeroes(MessageData); -_, + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); + 1 => { + this.text = try reader.readValue([]const u8); + }, + 2 => { + this.location = try reader.readValue(Location); + }, + else => { + return error.InvalidMessage; + }, } + } + unreachable; + } - -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.text) |text| { + try writer.writeFieldID(1); + try writer.writeValue(text); + } + if (this.location) |location| { + try writer.writeFieldID(2); + try writer.writeValue(location); + } + try writer.endMessage(); + } + }; -pub const WebsocketCommandKind = enum(u8) { + pub const MessageMeta = struct { + /// resolve + resolve: ?[]const u8 = null, -_none, - /// build - build, + /// build + build: ?bool = null, - /// manifest - manifest, + pub fn decode(reader: anytype) anyerror!MessageMeta { + var this = std.mem.zeroes(MessageMeta); -_, + while (true) { + switch (try reader.readByte()) { + 0 => { + return this; + }, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); + 1 => { + this.resolve = try reader.readValue([]const u8); + }, + 2 => { + this.build = try reader.readValue(bool); + }, + else => { + return error.InvalidMessage; + }, } + } + unreachable; + } - -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + if (this.resolve) |resolve| { + try writer.writeFieldID(1); + try writer.writeValue(resolve); + } + if (this.build) |build| { + try writer.writeFieldID(2); + try writer.writeInt(@intCast(u8, @boolToInt(build))); + } + try writer.endMessage(); + } + }; -pub const WebsocketMessage = struct { -/// timestamp -timestamp: u32 = 0, + pub const Message = struct { + /// level + level: MessageLevel, -/// kind -kind: WebsocketMessageKind, + /// data + data: MessageData, + /// notes + notes: []const MessageData, -pub fn decode(reader: anytype) anyerror!WebsocketMessage { - var this = std.mem.zeroes(WebsocketMessage); + /// on + on: MessageMeta, - this.timestamp = try reader.readValue(u32); - this.kind = try reader.readValue(WebsocketMessageKind); - return this; -} + pub fn decode(reader: anytype) anyerror!Message { + var this = std.mem.zeroes(Message); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.timestamp); - try writer.writeEnum(this.kind); -} + this.level = try reader.readValue(MessageLevel); + this.data = try reader.readValue(MessageData); + this.notes = try reader.readArray(MessageData); + this.on = try reader.readValue(MessageMeta); + return this; + } -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeEnum(this.level); + try writer.writeValue(this.data); + try writer.writeArray(MessageData, this.notes); + try writer.writeValue(this.on); + } + }; -pub const WebsocketMessageWelcome = struct { -/// epoch -epoch: u32 = 0, + pub const Log = struct { + /// warnings + warnings: u32 = 0, -/// javascriptReloader -javascript_reloader: Reloader, + /// errors + errors: u32 = 0, -/// cwd -cwd: []const u8, + /// msgs + msgs: []const Message, + pub fn decode(reader: anytype) anyerror!Log { + var this = std.mem.zeroes(Log); -pub fn decode(reader: anytype) anyerror!WebsocketMessageWelcome { - var this = std.mem.zeroes(WebsocketMessageWelcome); + this.warnings = try reader.readValue(u32); + this.errors = try reader.readValue(u32); + this.msgs = try reader.readArray(Message); + return this; + } - this.epoch = try reader.readValue(u32); - this.javascript_reloader = try reader.readValue(Reloader); - this.cwd = try reader.readValue([]const u8); - return this; -} + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.warnings); + try writer.writeInt(this.errors); + try writer.writeArray(Message, this.msgs); + } + }; -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.epoch); - try writer.writeEnum(this.javascript_reloader); - try writer.writeValue(this.cwd); -} + pub const Reloader = enum(u8) { + _none, + /// disable + disable, -}; + /// live + live, -pub const WebsocketMessageFileChangeNotification = struct { -/// id -id: u32 = 0, + /// fast_refresh + fast_refresh, -/// loader -loader: Loader, + _, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; -pub fn decode(reader: anytype) anyerror!WebsocketMessageFileChangeNotification { - var this = std.mem.zeroes(WebsocketMessageFileChangeNotification); + pub const WebsocketMessageKind = enum(u8) { + _none, + /// welcome + welcome, - this.id = try reader.readValue(u32); - this.loader = try reader.readValue(Loader); - return this; -} + /// file_change_notification + file_change_notification, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.id); - try writer.writeEnum(this.loader); -} + /// build_success + build_success, -}; + /// build_fail + build_fail, -pub const WebsocketCommand = struct { -/// kind -kind: WebsocketCommandKind, + /// manifest_success + manifest_success, -/// timestamp -timestamp: u32 = 0, + /// manifest_fail + manifest_fail, + _, -pub fn decode(reader: anytype) anyerror!WebsocketCommand { - var this = std.mem.zeroes(WebsocketCommand); + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; - this.kind = try reader.readValue(WebsocketCommandKind); - this.timestamp = try reader.readValue(u32); - return this; -} + pub const WebsocketCommandKind = enum(u8) { + _none, + /// build + build, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeEnum(this.kind); - try writer.writeInt(this.timestamp); -} + /// manifest + manifest, -}; + _, -pub const WebsocketCommandBuild = packed struct { -/// id -id: u32 = 0, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; + pub const WebsocketMessage = struct { + /// timestamp + timestamp: u32 = 0, -pub fn decode(reader: anytype) anyerror!WebsocketCommandBuild { - var this = std.mem.zeroes(WebsocketCommandBuild); + /// kind + kind: WebsocketMessageKind, - this.id = try reader.readValue(u32); - return this; -} + pub fn decode(reader: anytype) anyerror!WebsocketMessage { + var this = std.mem.zeroes(WebsocketMessage); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.id); -} + this.timestamp = try reader.readValue(u32); + this.kind = try reader.readValue(WebsocketMessageKind); + return this; + } -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.timestamp); + try writer.writeEnum(this.kind); + } + }; -pub const WebsocketCommandManifest = packed struct { -/// id -id: u32 = 0, + pub const WebsocketMessageWelcome = struct { + /// epoch + epoch: u32 = 0, + /// javascriptReloader + javascript_reloader: Reloader, -pub fn decode(reader: anytype) anyerror!WebsocketCommandManifest { - var this = std.mem.zeroes(WebsocketCommandManifest); + /// cwd + cwd: []const u8, - this.id = try reader.readValue(u32); - return this; -} + pub fn decode(reader: anytype) anyerror!WebsocketMessageWelcome { + var this = std.mem.zeroes(WebsocketMessageWelcome); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.id); -} + this.epoch = try reader.readValue(u32); + this.javascript_reloader = try reader.readValue(Reloader); + this.cwd = try reader.readValue([]const u8); + return this; + } -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.epoch); + try writer.writeEnum(this.javascript_reloader); + try writer.writeValue(this.cwd); + } + }; -pub const WebsocketMessageBuildSuccess = struct { -/// id -id: u32 = 0, + pub const WebsocketMessageFileChangeNotification = struct { + /// id + id: u32 = 0, -/// from_timestamp -from_timestamp: u32 = 0, + /// loader + loader: Loader, -/// loader -loader: Loader, + pub fn decode(reader: anytype) anyerror!WebsocketMessageFileChangeNotification { + var this = std.mem.zeroes(WebsocketMessageFileChangeNotification); -/// module_path -module_path: []const u8, + this.id = try reader.readValue(u32); + this.loader = try reader.readValue(Loader); + return this; + } -/// blob_length -blob_length: u32 = 0, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + try writer.writeEnum(this.loader); + } + }; + pub const WebsocketCommand = struct { + /// kind + kind: WebsocketCommandKind, -pub fn decode(reader: anytype) anyerror!WebsocketMessageBuildSuccess { - var this = std.mem.zeroes(WebsocketMessageBuildSuccess); + /// timestamp + timestamp: u32 = 0, - this.id = try reader.readValue(u32); - this.from_timestamp = try reader.readValue(u32); - this.loader = try reader.readValue(Loader); - this.module_path = try reader.readValue([]const u8); - this.blob_length = try reader.readValue(u32); - return this; -} + pub fn decode(reader: anytype) anyerror!WebsocketCommand { + var this = std.mem.zeroes(WebsocketCommand); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.id); - try writer.writeInt(this.from_timestamp); - try writer.writeEnum(this.loader); - try writer.writeValue(this.module_path); - try writer.writeInt(this.blob_length); -} + this.kind = try reader.readValue(WebsocketCommandKind); + this.timestamp = try reader.readValue(u32); + return this; + } -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeEnum(this.kind); + try writer.writeInt(this.timestamp); + } + }; -pub const WebsocketMessageBuildFailure = struct { -/// id -id: u32 = 0, + pub const WebsocketCommandBuild = packed struct { + /// id + id: u32 = 0, -/// from_timestamp -from_timestamp: u32 = 0, + pub fn decode(reader: anytype) anyerror!WebsocketCommandBuild { + var this = std.mem.zeroes(WebsocketCommandBuild); -/// loader -loader: Loader, + this.id = try reader.readValue(u32); + return this; + } -/// module_path -module_path: []const u8, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + } + }; -/// log -log: Log, + pub const WebsocketCommandManifest = packed struct { + /// id + id: u32 = 0, + pub fn decode(reader: anytype) anyerror!WebsocketCommandManifest { + var this = std.mem.zeroes(WebsocketCommandManifest); -pub fn decode(reader: anytype) anyerror!WebsocketMessageBuildFailure { - var this = std.mem.zeroes(WebsocketMessageBuildFailure); + this.id = try reader.readValue(u32); + return this; + } - this.id = try reader.readValue(u32); - this.from_timestamp = try reader.readValue(u32); - this.loader = try reader.readValue(Loader); - this.module_path = try reader.readValue([]const u8); - this.log = try reader.readValue(Log); - return this; -} + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + } + }; -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.id); - try writer.writeInt(this.from_timestamp); - try writer.writeEnum(this.loader); - try writer.writeValue(this.module_path); - try writer.writeValue(this.log); -} + pub const WebsocketMessageBuildSuccess = struct { + /// id + id: u32 = 0, -}; + /// from_timestamp + from_timestamp: u32 = 0, -pub const DependencyManifest = struct { -/// ids -ids: []const u32, + /// loader + loader: Loader, + /// module_path + module_path: []const u8, -pub fn decode(reader: anytype) anyerror!DependencyManifest { - var this = std.mem.zeroes(DependencyManifest); + /// blob_length + blob_length: u32 = 0, - this.ids = try reader.readArray(u32); - return this; -} + pub fn decode(reader: anytype) anyerror!WebsocketMessageBuildSuccess { + var this = std.mem.zeroes(WebsocketMessageBuildSuccess); -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray(u32, this.ids); -} + this.id = try reader.readValue(u32); + this.from_timestamp = try reader.readValue(u32); + this.loader = try reader.readValue(Loader); + this.module_path = try reader.readValue([]const u8); + this.blob_length = try reader.readValue(u32); + return this; + } -}; + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + try writer.writeInt(this.from_timestamp); + try writer.writeEnum(this.loader); + try writer.writeValue(this.module_path); + try writer.writeInt(this.blob_length); + } + }; -pub const FileList = struct { -/// ptrs -ptrs: []const StringPointer, + pub const WebsocketMessageBuildFailure = struct { + /// id + id: u32 = 0, -/// files -files: []const u8, + /// from_timestamp + from_timestamp: u32 = 0, + /// loader + loader: Loader, -pub fn decode(reader: anytype) anyerror!FileList { - var this = std.mem.zeroes(FileList); + /// module_path + module_path: []const u8, - this.ptrs = try reader.readArray(StringPointer); - this.files = try reader.readValue([]const u8); - return this; -} + /// log + log: Log, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray(StringPointer, this.ptrs); - try writer.writeValue(this.files); -} + pub fn decode(reader: anytype) anyerror!WebsocketMessageBuildFailure { + var this = std.mem.zeroes(WebsocketMessageBuildFailure); -}; + this.id = try reader.readValue(u32); + this.from_timestamp = try reader.readValue(u32); + this.loader = try reader.readValue(Loader); + this.module_path = try reader.readValue([]const u8); + this.log = try reader.readValue(Log); + return this; + } -pub const WebsocketMessageResolveIDs = struct { -/// id -id: []const u32, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + try writer.writeInt(this.from_timestamp); + try writer.writeEnum(this.loader); + try writer.writeValue(this.module_path); + try writer.writeValue(this.log); + } + }; -/// list -list: FileList, + pub const DependencyManifest = struct { + /// ids + ids: []const u32, + pub fn decode(reader: anytype) anyerror!DependencyManifest { + var this = std.mem.zeroes(DependencyManifest); -pub fn decode(reader: anytype) anyerror!WebsocketMessageResolveIDs { - var this = std.mem.zeroes(WebsocketMessageResolveIDs); + this.ids = try reader.readArray(u32); + return this; + } - this.id = try reader.readArray(u32); - this.list = try reader.readValue(FileList); - return this; -} + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(u32, this.ids); + } + }; -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray(u32, this.id); - try writer.writeValue(this.list); -} + pub const FileList = struct { + /// ptrs + ptrs: []const StringPointer, -}; + /// files + files: []const u8, -pub const WebsocketCommandResolveIDs = struct { -/// ptrs -ptrs: []const StringPointer, + pub fn decode(reader: anytype) anyerror!FileList { + var this = std.mem.zeroes(FileList); -/// files -files: []const u8, + this.ptrs = try reader.readArray(StringPointer); + this.files = try reader.readValue([]const u8); + return this; + } + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(StringPointer, this.ptrs); + try writer.writeValue(this.files); + } + }; -pub fn decode(reader: anytype) anyerror!WebsocketCommandResolveIDs { - var this = std.mem.zeroes(WebsocketCommandResolveIDs); + pub const WebsocketMessageResolveIDs = struct { + /// id + id: []const u32, - this.ptrs = try reader.readArray(StringPointer); - this.files = try reader.readValue([]const u8); - return this; -} + /// list + list: FileList, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray(StringPointer, this.ptrs); - try writer.writeValue(this.files); -} + pub fn decode(reader: anytype) anyerror!WebsocketMessageResolveIDs { + var this = std.mem.zeroes(WebsocketMessageResolveIDs); -}; + this.id = try reader.readArray(u32); + this.list = try reader.readValue(FileList); + return this; + } -pub const WebsocketMessageManifestSuccess = struct { -/// id -id: u32 = 0, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(u32, this.id); + try writer.writeValue(this.list); + } + }; -/// module_path -module_path: []const u8, + pub const WebsocketCommandResolveIDs = struct { + /// ptrs + ptrs: []const StringPointer, -/// loader -loader: Loader, + /// files + files: []const u8, -/// manifest -manifest: DependencyManifest, + pub fn decode(reader: anytype) anyerror!WebsocketCommandResolveIDs { + var this = std.mem.zeroes(WebsocketCommandResolveIDs); + this.ptrs = try reader.readArray(StringPointer); + this.files = try reader.readValue([]const u8); + return this; + } -pub fn decode(reader: anytype) anyerror!WebsocketMessageManifestSuccess { - var this = std.mem.zeroes(WebsocketMessageManifestSuccess); + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(StringPointer, this.ptrs); + try writer.writeValue(this.files); + } + }; - this.id = try reader.readValue(u32); - this.module_path = try reader.readValue([]const u8); - this.loader = try reader.readValue(Loader); - this.manifest = try reader.readValue(DependencyManifest); - return this; -} + pub const WebsocketMessageManifestSuccess = struct { + /// id + id: u32 = 0, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.id); - try writer.writeValue(this.module_path); - try writer.writeEnum(this.loader); - try writer.writeValue(this.manifest); -} + /// module_path + module_path: []const u8, -}; + /// loader + loader: Loader, -pub const WebsocketMessageManifestFailure = struct { -/// id -id: u32 = 0, + /// manifest + manifest: DependencyManifest, -/// from_timestamp -from_timestamp: u32 = 0, + pub fn decode(reader: anytype) anyerror!WebsocketMessageManifestSuccess { + var this = std.mem.zeroes(WebsocketMessageManifestSuccess); -/// loader -loader: Loader, + this.id = try reader.readValue(u32); + this.module_path = try reader.readValue([]const u8); + this.loader = try reader.readValue(Loader); + this.manifest = try reader.readValue(DependencyManifest); + return this; + } -/// log -log: Log, + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + try writer.writeValue(this.module_path); + try writer.writeEnum(this.loader); + try writer.writeValue(this.manifest); + } + }; + pub const WebsocketMessageManifestFailure = struct { + /// id + id: u32 = 0, -pub fn decode(reader: anytype) anyerror!WebsocketMessageManifestFailure { - var this = std.mem.zeroes(WebsocketMessageManifestFailure); + /// from_timestamp + from_timestamp: u32 = 0, - this.id = try reader.readValue(u32); - this.from_timestamp = try reader.readValue(u32); - this.loader = try reader.readValue(Loader); - this.log = try reader.readValue(Log); - return this; -} + /// loader + loader: Loader, -pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.id); - try writer.writeInt(this.from_timestamp); - try writer.writeEnum(this.loader); - try writer.writeValue(this.log); -} + /// log + log: Log, -}; + pub fn decode(reader: anytype) anyerror!WebsocketMessageManifestFailure { + var this = std.mem.zeroes(WebsocketMessageManifestFailure); + this.id = try reader.readValue(u32); + this.from_timestamp = try reader.readValue(u32); + this.loader = try reader.readValue(Loader); + this.log = try reader.readValue(Log); + return this; + } + pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.id); + try writer.writeInt(this.from_timestamp); + try writer.writeEnum(this.loader); + try writer.writeValue(this.log); + } + }; }; - const ExamplePackedStruct = packed struct { len: u32 = 0, offset: u32 = 0, diff --git a/src/css_scanner.zig b/src/css_scanner.zig index 41e43c22e..ee2881d4e 100644 --- a/src/css_scanner.zig +++ b/src/css_scanner.zig @@ -1263,12 +1263,11 @@ pub fn NewBundler( if (watcher_index == null) { var file = try std.fs.openFileAbsolute(absolute_path, .{ .read = true }); - + try this.watcher.appendFile(file.handle, absolute_path, hash, .css, 0, null, true); - if (this.watcher.watchloop_handle == null) { + if (this.watcher.watchloop_handle == null) { try this.watcher.start(); } - } try this.import_queue.writeItem(hash); diff --git a/src/fs.zig b/src/fs.zig index 2313dc17b..8a6d4e5f7 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -542,7 +542,7 @@ pub const FileSystem = struct { // Always try to max out how many files we can keep open pub fn adjustUlimit() !usize { - const LIMITS = [_]std.os.rlimit_resource{std.os.rlimit_resource.STACK, std.os.rlimit_resource.NOFILE}; + const LIMITS = [_]std.os.rlimit_resource{ std.os.rlimit_resource.STACK, std.os.rlimit_resource.NOFILE }; inline for (LIMITS) |limit_type, i| { const limit = try std.os.getrlimit(limit_type); @@ -552,7 +552,6 @@ pub const FileSystem = struct { new_limit.max = limit.max; try std.os.setrlimit(limit_type, new_limit); - } if (i == LIMITS.len - 1) return limit.max; diff --git a/src/global.zig b/src/global.zig index b3f648850..651d59590 100644 --- a/src/global.zig +++ b/src/global.zig @@ -2,11 +2,10 @@ const std = @import("std"); pub usingnamespace @import("strings.zig"); pub const Environment = @import("env.zig"); - -pub const default_allocator: *std.mem.Allocator = if (isTest) - std.heap.c_allocator - else - @import("./memory_allocator.zig").c_allocator; +pub const default_allocator: *std.mem.Allocator = if (isTest) + std.heap.c_allocator +else + @import("./memory_allocator.zig").c_allocator; pub const C = @import("c.zig"); diff --git a/src/http.zig b/src/http.zig index 5b43cd9f7..7d47b82cd 100644 --- a/src/http.zig +++ b/src/http.zig @@ -1105,7 +1105,7 @@ pub const RequestContext = struct { pub var javascript_disabled = false; var js_thread: std.Thread = undefined; pub fn spawnThread(handler: *HandlerThread) !void { - js_thread = try std.Thread.spawn(.{.stack_size = 64 * 1024 * 1024}, spawn, .{handler}); + js_thread = try std.Thread.spawn(.{ .stack_size = 64 * 1024 * 1024 }, spawn, .{handler}); js_thread.setName("JavaScript SSR") catch {}; js_thread.detach(); } @@ -1119,7 +1119,6 @@ pub const RequestContext = struct { javascript_disabled = true; } var start_timer = std.time.Timer.start() catch unreachable; - var stdout = std.io.getStdOut(); var stderr = std.io.getStdErr(); @@ -1128,11 +1127,9 @@ pub const RequestContext = struct { Output.Source.set(&output_source); @import("javascript/jsc/JavascriptCore.zig").JSCInitialize(); - js_ast.Stmt.Data.Store.create(std.heap.c_allocator); js_ast.Expr.Data.Store.create(std.heap.c_allocator); - var vm = JavaScript.VirtualMachine.init( std.heap.c_allocator, handler.args, @@ -1948,8 +1945,6 @@ pub const RequestContext = struct { // CSS handles this specially if (loader != .css and client_entry_point_ == null) { if (written.input_fd) |written_fd| { - - try ctx.watcher.addFile( written_fd, result.file.input.text, @@ -1961,9 +1956,8 @@ pub const RequestContext = struct { ); if (ctx.watcher.watchloop_handle == null) { - ctx.watcher.start() catch {}; + ctx.watcher.start() catch {}; } - } } else { if (written.written > 0) { @@ -2499,7 +2493,6 @@ pub const Server = struct { var rfs: *Fs.FileSystem.RealFS = &ctx.bundler.fs.fs; - // It's important that this function does not do any memory allocations // If this blocks, it can cause cascading bad things to happen for (events) |event| { @@ -2556,7 +2549,6 @@ pub const Server = struct { } }, .directory => { - rfs.bustEntriesCache(file_path); ctx.bundler.resolver.dir_cache.remove(file_path); @@ -2574,7 +2566,7 @@ pub const Server = struct { } fn run(server: *Server, comptime features: ConnectionFeatures) !void { - _ = Fs.FileSystem.RealFS.adjustUlimit() catch {}; + _ = Fs.FileSystem.RealFS.adjustUlimit() catch {}; RequestContext.WebsocketHandler.open_websockets = @TypeOf( RequestContext.WebsocketHandler.open_websockets, ).init(server.allocator); @@ -2743,7 +2735,6 @@ pub const Server = struct { var request_arena = server.allocator.create(std.heap.ArenaAllocator) catch unreachable; request_arena.* = std.heap.ArenaAllocator.init(server.allocator); - req_ctx_ = RequestContext.init( req, diff --git a/src/javascript/jsc/JavascriptCore.zig b/src/javascript/jsc/JavascriptCore.zig index dd271d2c0..e6ac23bb7 100644 --- a/src/javascript/jsc/JavascriptCore.zig +++ b/src/javascript/jsc/JavascriptCore.zig @@ -545,6 +545,5 @@ pub const JSString = struct { } }; - // not official api functions pub extern "c" fn JSCInitialize() void; diff --git a/src/javascript/jsc/bindings/headers.zig b/src/javascript/jsc/bindings/headers.zig index a2c111d2d..79aff5a09 100644 --- a/src/javascript/jsc/bindings/headers.zig +++ b/src/javascript/jsc/bindings/headers.zig @@ -37,65 +37,64 @@ pub const __mbstate_t = extern union { pub const __darwin_mbstate_t = __mbstate_t; pub const __darwin_ptrdiff_t = c_long; pub const __darwin_size_t = c_ulong; - + pub const JSC__RegExpPrototype = struct_JSC__RegExpPrototype; - + pub const JSC__GeneratorPrototype = struct_JSC__GeneratorPrototype; - + pub const JSC__ArrayIteratorPrototype = struct_JSC__ArrayIteratorPrototype; - + pub const JSC__StringPrototype = struct_JSC__StringPrototype; pub const WTF__StringView = bWTF__StringView; - + pub const JSC__JSPromisePrototype = struct_JSC__JSPromisePrototype; pub const JSC__CatchScope = bJSC__CatchScope; pub const JSC__ThrowScope = bJSC__ThrowScope; pub const JSC__PropertyName = bJSC__PropertyName; pub const JSC__JSObject = bJSC__JSObject; pub const WTF__ExternalStringImpl = bWTF__ExternalStringImpl; - + pub const JSC__AsyncIteratorPrototype = struct_JSC__AsyncIteratorPrototype; pub const WTF__StringImpl = bWTF__StringImpl; pub const JSC__JSLock = bJSC__JSLock; pub const JSC__JSModuleLoader = bJSC__JSModuleLoader; pub const JSC__VM = bJSC__VM; - + pub const JSC__AsyncGeneratorPrototype = struct_JSC__AsyncGeneratorPrototype; - + pub const JSC__AsyncGeneratorFunctionPrototype = struct_JSC__AsyncGeneratorFunctionPrototype; pub const JSC__JSGlobalObject = bJSC__JSGlobalObject; pub const JSC__JSFunction = bJSC__JSFunction; - + pub const JSC__ArrayPrototype = struct_JSC__ArrayPrototype; - + pub const JSC__AsyncFunctionPrototype = struct_JSC__AsyncFunctionPrototype; pub const JSC__Identifier = bJSC__Identifier; pub const JSC__JSPromise = bJSC__JSPromise; - + pub const JSC__SetIteratorPrototype = struct_JSC__SetIteratorPrototype; pub const JSC__SourceCode = bJSC__SourceCode; pub const JSC__JSCell = bJSC__JSCell; - + pub const JSC__BigIntPrototype = struct_JSC__BigIntPrototype; - + pub const JSC__GeneratorFunctionPrototype = struct_JSC__GeneratorFunctionPrototype; pub const JSC__SourceOrigin = bJSC__SourceOrigin; pub const JSC__JSModuleRecord = bJSC__JSModuleRecord; pub const WTF__String = bWTF__String; pub const WTF__URL = bWTF__URL; - - + pub const JSC__IteratorPrototype = struct_JSC__IteratorPrototype; pub const JSC__JSInternalPromise = bJSC__JSInternalPromise; - + pub const JSC__FunctionPrototype = struct_JSC__FunctionPrototype; pub const Inspector__ScriptArguments = bInspector__ScriptArguments; pub const JSC__Exception = bJSC__Exception; pub const JSC__JSString = bJSC__JSString; - + pub const JSC__ObjectPrototype = struct_JSC__ObjectPrototype; pub const JSC__CallFrame = bJSC__CallFrame; - + pub const JSC__MapIteratorPrototype = struct_JSC__MapIteratorPrototype; pub extern fn JSC__JSObject__create(arg0: [*c]JSC__JSGlobalObject, arg1: usize, arg2: ?*c_void, ArgFn3: ?fn (?*c_void, [*c]JSC__JSObject, [*c]JSC__JSGlobalObject) callconv(.C) void) JSC__JSValue; pub extern fn JSC__JSObject__getArrayLength(arg0: [*c]JSC__JSObject) usize; @@ -155,14 +154,14 @@ pub extern fn JSC__JSInternalPromise__then(arg0: [*c]JSC__JSInternalPromise, arg pub extern fn JSC__SourceOrigin__fromURL(arg0: [*c]const WTF__URL) bJSC__SourceOrigin; pub extern fn JSC__SourceCode__fromString(arg0: [*c]JSC__SourceCode, arg1: [*c]const WTF__String, arg2: [*c]const JSC__SourceOrigin, arg3: [*c]WTF__String, SourceType4: u8) void; pub extern fn JSC__JSFunction__calculatedDisplayName(arg0: [*c]JSC__JSFunction, arg1: [*c]JSC__VM) bWTF__String; -pub extern fn JSC__JSFunction__callWithArguments(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, arg2: [*c]JSC__JSValue, arg3: usize, arg4: *?*JSC__Exception , arg5: [*c]const u8) JSC__JSValue; -pub extern fn JSC__JSFunction__callWithArgumentsAndThis(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: [*c]JSC__JSGlobalObject, arg3: [*c]JSC__JSValue, arg4: usize, arg5: *?*JSC__Exception , arg6: [*c]const u8) JSC__JSValue; -pub extern fn JSC__JSFunction__callWithoutAnyArgumentsOrThis(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, arg2: *?*JSC__Exception , arg3: [*c]const u8) JSC__JSValue; -pub extern fn JSC__JSFunction__callWithThis(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, JSValue2: JSC__JSValue, arg3: *?*JSC__Exception , arg4: [*c]const u8) JSC__JSValue; -pub extern fn JSC__JSFunction__constructWithArguments(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, arg2: [*c]JSC__JSValue, arg3: usize, arg4: *?*JSC__Exception , arg5: [*c]const u8) JSC__JSValue; -pub extern fn JSC__JSFunction__constructWithArgumentsAndNewTarget(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: [*c]JSC__JSGlobalObject, arg3: [*c]JSC__JSValue, arg4: usize, arg5: *?*JSC__Exception , arg6: [*c]const u8) JSC__JSValue; -pub extern fn JSC__JSFunction__constructWithNewTarget(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, JSValue2: JSC__JSValue, arg3: *?*JSC__Exception , arg4: [*c]const u8) JSC__JSValue; -pub extern fn JSC__JSFunction__constructWithoutAnyArgumentsOrNewTarget(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, arg2: *?*JSC__Exception , arg3: [*c]const u8) JSC__JSValue; +pub extern fn JSC__JSFunction__callWithArguments(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, arg2: [*c]JSC__JSValue, arg3: usize, arg4: *?*JSC__Exception, arg5: [*c]const u8) JSC__JSValue; +pub extern fn JSC__JSFunction__callWithArgumentsAndThis(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: [*c]JSC__JSGlobalObject, arg3: [*c]JSC__JSValue, arg4: usize, arg5: *?*JSC__Exception, arg6: [*c]const u8) JSC__JSValue; +pub extern fn JSC__JSFunction__callWithoutAnyArgumentsOrThis(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, arg2: *?*JSC__Exception, arg3: [*c]const u8) JSC__JSValue; +pub extern fn JSC__JSFunction__callWithThis(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, JSValue2: JSC__JSValue, arg3: *?*JSC__Exception, arg4: [*c]const u8) JSC__JSValue; +pub extern fn JSC__JSFunction__constructWithArguments(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, arg2: [*c]JSC__JSValue, arg3: usize, arg4: *?*JSC__Exception, arg5: [*c]const u8) JSC__JSValue; +pub extern fn JSC__JSFunction__constructWithArgumentsAndNewTarget(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: [*c]JSC__JSGlobalObject, arg3: [*c]JSC__JSValue, arg4: usize, arg5: *?*JSC__Exception, arg6: [*c]const u8) JSC__JSValue; +pub extern fn JSC__JSFunction__constructWithNewTarget(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, JSValue2: JSC__JSValue, arg3: *?*JSC__Exception, arg4: [*c]const u8) JSC__JSValue; +pub extern fn JSC__JSFunction__constructWithoutAnyArgumentsOrNewTarget(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSGlobalObject, arg2: *?*JSC__Exception, arg3: [*c]const u8) JSC__JSValue; pub extern fn JSC__JSFunction__createFromNative(arg0: [*c]JSC__JSGlobalObject, arg1: u16, arg2: [*c]const WTF__String, arg3: ?*c_void, ArgFn4: ?fn (?*c_void, [*c]JSC__JSGlobalObject, [*c]JSC__CallFrame) callconv(.C) JSC__JSValue) [*c]JSC__JSFunction; pub extern fn JSC__JSFunction__displayName(arg0: [*c]JSC__JSFunction, arg1: [*c]JSC__VM) bWTF__String; pub extern fn JSC__JSFunction__getName(arg0: [*c]JSC__JSFunction, arg1: [*c]JSC__VM) bWTF__String; diff --git a/src/js_printer.zig b/src/js_printer.zig index 956a00e83..6a303903b 100644 --- a/src/js_printer.zig +++ b/src/js_printer.zig @@ -3975,10 +3975,10 @@ const FileWriterInternal = struct { result = result[written..]; }, else => { - const first = result.ptr[0..result.len / 3]; + const first = result.ptr[0 .. result.len / 3]; const second = result[first.len..][0..first.len]; - const remain = first.len+second.len; - const third: []const u8 = result[remain..]; + const remain = first.len + second.len; + const third: []const u8 = result[remain..]; var vecs = [_]std.os.iovec_const{ .{ @@ -3995,14 +3995,12 @@ const FileWriterInternal = struct { }, }; - const written = try std.os.writev(ctx.file.handle, vecs[0..@as(usize, if(third.len > 0) 3 else 2)]); + const written = try std.os.writev(ctx.file.handle, vecs[0..@as(usize, if (third.len > 0) 3 else 2)]); if (written == 0 or result.len - written == 0) return; result = result[written..]; }, } } - - } pub fn flush( @@ -4250,7 +4248,7 @@ pub fn printCommonJSThreaded( } if (comptime isLinux) { - _ = std.os.system.fallocate(getter.handle, 0, @intCast(i64, result.off), printer.writer.written); + _ = std.os.system.fallocate(getter.handle, 0, @intCast(i64, result.off), printer.writer.written); } } } diff --git a/src/node-fallbacks/package-lock.json b/src/node-fallbacks/package-lock.json index 70a9d0bac..5df702fb2 100644 --- a/src/node-fallbacks/package-lock.json +++ b/src/node-fallbacks/package-lock.json @@ -1,8 +1,1174 @@ { "name": "fallbacks", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "fallbacks", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "assert": "^2.0.0", + "browserify-zlib": "^0.2.0", + "buffer": "^6.0.3", + "console-browserify": "^1.2.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.12.0", + "domain-browser": "^4.22.0", + "esbuild": "^0.12.25", + "events": "^3.3.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "^1.0.1", + "process": "^0.11.10", + "punycode": "^2.1.1", + "querystring-es3": "^0.2.1", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "string_decoder": "^1.3.0", + "timers-browserify": "^2.0.12", + "tty-browserify": "^0.0.1", + "url": "^0.11.0", + "util": "^0.12.4", + "vm-browserify": "^1.1.2" + } + }, + "node_modules/asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/assert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", + "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", + "dependencies": { + "es6-object-assign": "^1.1.0", + "is-nan": "^1.2.1", + "object-is": "^1.0.1", + "util": "^0.12.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-rsa/node_modules/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, + "node_modules/browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dependencies": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "node_modules/browserify-sign/node_modules/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dependencies": { + "pako": "~1.0.5" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" + }, + "node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/domain-browser": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz", + "integrity": "sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/es-abstract": { + "version": "1.18.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz", + "integrity": "sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==", + "dependencies": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.3", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.3", + "is-string": "^1.0.6", + "object-inspect": "^1.11.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es6-object-assign": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", + "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=" + }, + "node_modules/esbuild": { + "version": "0.12.25", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.25.tgz", + "integrity": "sha512-woie0PosbRSoN8gQytrdCzUbS2ByKgO8nD1xCZkEup3D9q92miCze4PqEI9TZDYAuwn6CruEnQpJxgTRWdooAg==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dependencies": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number-object": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", + "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz", + "integrity": "sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-abstract": "^1.18.5", + "foreach": "^2.0.5", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "node_modules/object-inspect": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", + "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, + "node_modules/parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dependencies": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dependencies": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, + "node_modules/stream-http": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", + "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "xtend": "^4.0.2" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "dependencies": { + "setimmediate": "^1.0.4" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==" + }, + "node_modules/unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dependencies": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + }, + "node_modules/util": { + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.4.tgz", + "integrity": "sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw==", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "safe-buffer": "^5.1.2", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz", + "integrity": "sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-abstract": "^1.18.5", + "foreach": "^2.0.5", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + } + }, "dependencies": { "asn1.js": { "version": "5.4.1", @@ -757,6 +1923,14 @@ "xtend": "^4.0.2" } }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, "string.prototype.trimend": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", @@ -775,14 +1949,6 @@ "define-properties": "^1.1.3" } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, "timers-browserify": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", diff --git a/src/runtime.version b/src/runtime.version index 2dcc8c529..57659652b 100644 --- a/src/runtime.version +++ b/src/runtime.version @@ -1 +1 @@ -4d09f9efba49d5ac
\ No newline at end of file +35057197d4ad54bc
\ No newline at end of file diff --git a/src/watcher.zig b/src/watcher.zig index 81fb3ab0f..4a5329ac8 100644 --- a/src/watcher.zig +++ b/src/watcher.zig @@ -96,7 +96,7 @@ pub const INotify = struct { std.debug.assert(loaded_inotify); restart: while (true) { - std.Thread.Futex.wait(&watch_count,0, null) catch unreachable; + std.Thread.Futex.wait(&watch_count, 0, null) catch unreachable; const rc = std.os.system.read( inotify_fd, @ptrCast([*]u8, @alignCast(@alignOf([*]u8), &eventlist)), @@ -129,7 +129,7 @@ pub const INotify = struct { else => unreachable, } - } + } unreachable; } @@ -144,7 +144,7 @@ pub const INotify = struct { const DarwinWatcher = struct { pub const EventListIndex = u32; - const KEvent = std.os.Kevent; + const KEvent = std.c.Kevent; // Internal pub var changelist: [128]KEvent = undefined; @@ -152,7 +152,7 @@ const DarwinWatcher = struct { pub var eventlist: [WATCHER_MAX_LIST]KEvent = undefined; pub var eventlist_index: EventListIndex = 0; - var fd: EventListIndex = 0; + pub var fd: i32 = 0; pub fn init() !void { std.debug.assert(fd == 0); @@ -196,8 +196,8 @@ pub const WatchEvent = struct { index: WatchItemIndex, op: Op, - const KEvent = std.os.Kevent; - + const KEvent = std.c.Kevent; + pub const Sorter = void; pub fn sortByIndex(context: Sorter, event: WatchEvent, rhs: WatchEvent) bool { @@ -370,9 +370,9 @@ pub fn NewWatcher(comptime ContextType: type) type { // close the file descriptors here. this should automatically remove it from being watched too. std.os.close(fds[item]); - if (Environment.isLinux) { - INotify.unwatch(event_list_ids[item]); - } + // if (Environment.isLinux) { + // INotify.unwatch(event_list_ids[item]); + // } last_item = item; } @@ -391,7 +391,7 @@ pub fn NewWatcher(comptime ContextType: type) type { if (Environment.isMac) { std.debug.assert(DarwinWatcher.fd > 0); - const KEvent = std.os.KEvent; + const KEvent = std.c.Kevent; var changelist_array: [1]KEvent = std.mem.zeroes([1]KEvent); var changelist = &changelist_array; @@ -416,7 +416,7 @@ pub fn NewWatcher(comptime ContextType: type) type { this.ctx.onFileUpdate(watchevents, this.watchlist); } } else if (Environment.isLinux) { - restart: while (true) { + restart: while (true) { defer Output.flush(); var events = try INotify.read(); @@ -445,7 +445,7 @@ pub fn NewWatcher(comptime ContextType: type) type { } var all_events = watchevents[0..watch_event_id]; - std.sort.sort(WatchEvent, all_events, void{}, WatchEvent.sortByIndex); + std.sort.sort(WatchEvent, all_events, void{}, WatchEvent.sortByIndex); var last_event_index: usize = 0; var last_event_id: INotify.EventListIndex = std.math.maxInt(INotify.EventListIndex); @@ -458,7 +458,7 @@ pub fn NewWatcher(comptime ContextType: type) type { last_event_id = event.index; } if (all_events.len == 0) continue :restart; - this.ctx.onFileUpdate(all_events[0..last_event_index+1], this.watchlist); + this.ctx.onFileUpdate(all_events[0 .. last_event_index + 1], this.watchlist); remaining_events -= slice.len; } } @@ -509,8 +509,8 @@ pub fn NewWatcher(comptime ContextType: type) type { else file_path; - if (Environment.isMac) { - const KEvent = std.os.Kevent; + if (comptime Environment.isMac) { + const KEvent = std.c.Kevent; index = DarwinWatcher.eventlist_index; // https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/kqueue.2.html @@ -543,13 +543,13 @@ pub fn NewWatcher(comptime ContextType: type) type { 0, null, ); - } else if (Environment.isLinux) { + } else if (comptime Environment.isLinux) { // var file_path_to_use_ = std.mem.trimRight(u8, file_path_, "/"); // var buf: [std.fs.MAX_PATH_BYTES+1]u8 = undefined; // std.mem.copy(u8, &buf, file_path_to_use_); // buf[file_path_to_use_.len] = 0; var buf = file_path_.ptr; - var slice: [:0]const u8 = buf[0..file_path_.len:0]; + var slice: [:0]const u8 = buf[0..file_path_.len :0]; index = try INotify.watchPath(slice); } @@ -594,7 +594,7 @@ pub fn NewWatcher(comptime ContextType: type) type { if (Environment.isMac) { index = DarwinWatcher.eventlist_index; - const KEvent = std.os.Kevent; + const KEvent = std.c.Kevent; // https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/kqueue.2.html var event = std.mem.zeroes(KEvent); @@ -612,7 +612,7 @@ pub fn NewWatcher(comptime ContextType: type) type { // id event.ident = @intCast(usize, fd); - this.eventlist_used += 1; + DarwinWatcher.eventlist_index += 1; // Store the hash for fast filtering later event.udata = @intCast(usize, watchlist_id); DarwinWatcher.eventlist[index] = event; @@ -631,10 +631,10 @@ pub fn NewWatcher(comptime ContextType: type) type { ); } else if (Environment.isLinux) { var file_path_to_use_ = std.mem.trimRight(u8, file_path_, "/"); - var buf: [std.fs.MAX_PATH_BYTES+1]u8 = undefined; + var buf: [std.fs.MAX_PATH_BYTES + 1]u8 = undefined; std.mem.copy(u8, &buf, file_path_to_use_); buf[file_path_to_use_.len] = 0; - var slice: [:0]u8 = buf[0..file_path_to_use_.len:0]; + var slice: [:0]u8 = buf[0..file_path_to_use_.len :0]; index = try INotify.watchDir(slice); } |