| author | |
| committer | |
| log | 26b16273bda24a08741ddc60a9be0a62473dd653 |
| tree | 66539182e81dc36722a831cf6a8a86b427aca1b1 |
| parent | 25a046c27248b925e38c8ef4e2dd62c9d96f0ded |
11 files changed, 80 insertions(+), 58 deletions(-)
deps.zig+15-1| ... | @@ -63,6 +63,8 @@ pub fn fetch(exe: *std.Build.Step.Compile) *std.Build.Step { | ... | @@ -63,6 +63,8 @@ pub fn fetch(exe: *std.Build.Step.Compile) *std.Build.Step { |
| 63 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "74f0ddb0a4dfa7921739b88cc381951a6b6e73ce").step); | 63 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "74f0ddb0a4dfa7921739b88cc381951a6b6e73ce").step); |
| 64 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-git", "103f4e419c35b88f802bb8234ece1c0a9aa40c03").step); | 64 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-git", "103f4e419c35b88f802bb8234ece1c0a9aa40c03").step); |
| 65 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-inquirer", "cf43dd6c9f328073f7468b5341c69ed0bb185db3").step); | 65 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-inquirer", "cf43dd6c9f328073f7468b5341c69ed0bb185db3").step); |
| 66 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-intrusive-parser", "2336d8b767eb7378762e1ba63635ca44accbd2ca").step); | ||
| 67 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-json", "29587071de6dd3338e8eb76d4e0307af69a2d61a").step); | ||
| 66 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-leven", "e5481b297b6023d446d835156591ba5ce88c17be").step); | 68 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-leven", "e5481b297b6023d446d835156591ba5ce88c17be").step); |
| 67 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses", "f46d9f774df929885eef66c733a1e2a46bf16aec").step); | 69 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses", "f46d9f774df929885eef66c733a1e2a46bf16aec").step); |
| 68 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses-text", "b01e5a2dffcc564bddd8f514fe64bab9b5c52572").step); | 70 | step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-licenses-text", "b01e5a2dffcc564bddd8f514fe64bab9b5c52572").step); |
| ... | @@ -202,6 +204,12 @@ pub const package_data = struct { | ... | @@ -202,6 +204,12 @@ pub const package_data = struct { |
| 202 | .entry = "/git/github.com/nektro/zig-inquirer/cf43dd6c9f328073f7468b5341c69ed0bb185db3/src/lib.zig", | 204 | .entry = "/git/github.com/nektro/zig-inquirer/cf43dd6c9f328073f7468b5341c69ed0bb185db3/src/lib.zig", |
| 203 | .deps = &[_]*Package{ &_s84v9o48ucb0 }, | 205 | .deps = &[_]*Package{ &_s84v9o48ucb0 }, |
| 204 | }; | 206 | }; |
| 207 | pub var _7l3oxw6nqqws = Package{ | ||
| 208 | .store = "/git/github.com/nektro/zig-intrusive-parser/2336d8b767eb7378762e1ba63635ca44accbd2ca", | ||
| 209 | .name = "intrusive-parser", | ||
| 210 | .entry = "/git/github.com/nektro/zig-intrusive-parser/2336d8b767eb7378762e1ba63635ca44accbd2ca/intrusive_parser.zig", | ||
| 211 | .deps = &[_]*Package{ &_f7dubzb7cyqe }, | ||
| 212 | }; | ||
| 205 | pub var _96h80ezrvj7i = Package{ | 213 | pub var _96h80ezrvj7i = Package{ |
| 206 | .store = "/git/github.com/nektro/zig-leven/e5481b297b6023d446d835156591ba5ce88c17be", | 214 | .store = "/git/github.com/nektro/zig-leven/e5481b297b6023d446d835156591ba5ce88c17be", |
| 207 | .name = "leven", | 215 | .name = "leven", |
| ... | @@ -241,6 +249,12 @@ pub const package_data = struct { | ... | @@ -241,6 +249,12 @@ pub const package_data = struct { |
| 241 | .entry = "/git/github.com/nektro/zig-git/103f4e419c35b88f802bb8234ece1c0a9aa40c03/git.zig", | 249 | .entry = "/git/github.com/nektro/zig-git/103f4e419c35b88f802bb8234ece1c0a9aa40c03/git.zig", |
| 242 | .deps = &[_]*Package{ &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_ede2wygpe1iy }, | 250 | .deps = &[_]*Package{ &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_ede2wygpe1iy }, |
| 243 | }; | 251 | }; |
| 252 | pub var _ocmr9rtohgcc = Package{ | ||
| 253 | .store = "/git/github.com/nektro/zig-json/29587071de6dd3338e8eb76d4e0307af69a2d61a", | ||
| 254 | .name = "json", | ||
| 255 | .entry = "/git/github.com/nektro/zig-json/29587071de6dd3338e8eb76d4e0307af69a2d61a/json.zig", | ||
| 256 | .deps = &[_]*Package{ &_f7dubzb7cyqe, &_ede2wygpe1iy, &_7l3oxw6nqqws }, | ||
| 257 | }; | ||
| 244 | pub var _g982zq6e8wsv = Package{ | 258 | pub var _g982zq6e8wsv = Package{ |
| 245 | .store = "/git/github.com/nektro/zig-yaml/0d17fb99cba338aedc1abac12d78d5e5f04f0b6b", | 259 | .store = "/git/github.com/nektro/zig-yaml/0d17fb99cba338aedc1abac12d78d5e5f04f0b6b", |
| 246 | .name = "yaml", | 260 | .name = "yaml", |
| ... | @@ -266,7 +280,7 @@ pub const package_data = struct { | ... | @@ -266,7 +280,7 @@ pub const package_data = struct { |
| 266 | pub var _89ujp8gq842x = Package{ | 280 | pub var _89ujp8gq842x = Package{ |
| 267 | .name = "zigmod", | 281 | .name = "zigmod", |
| 268 | .entry = "/../..//src/lib.zig", | 282 | .entry = "/../..//src/lib.zig", |
| 269 | .deps = &[_]*Package{ &_g982zq6e8wsv, &_s84v9o48ucb0, &_2ta738wrqbaq, &_0npcrzfdlrvk, &_ejw82j2ipa0e, &_2ovav391ivak, &_c1xirp1ota5p, &_u7sysdckdymi, &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_0k64oe2nuzvj }, | 283 | .deps = &[_]*Package{ &_g982zq6e8wsv, &_s84v9o48ucb0, &_2ta738wrqbaq, &_0npcrzfdlrvk, &_ejw82j2ipa0e, &_2ovav391ivak, &_c1xirp1ota5p, &_u7sysdckdymi, &_iecwp4b3bsfm, &_f7dubzb7cyqe, &_0k64oe2nuzvj, &_ocmr9rtohgcc }, |
| 270 | }; | 284 | }; |
| 271 | pub var _root = Package{ | 285 | pub var _root = Package{ |
| 272 | }; | 286 | }; |
licenses.txt+5| ... | @@ -10,6 +10,7 @@ MIT: | ... | @@ -10,6 +10,7 @@ MIT: |
| 10 | - git https://github.com/nektro/zig-extras | 10 | - git https://github.com/nektro/zig-extras |
| 11 | - git https://github.com/nektro/zig-git | 11 | - git https://github.com/nektro/zig-git |
| 12 | - git https://github.com/nektro/zig-inquirer | 12 | - git https://github.com/nektro/zig-inquirer |
| 13 | - git https://github.com/nektro/zig-json | ||
| 13 | - git https://github.com/nektro/zig-leven | 14 | - git https://github.com/nektro/zig-leven |
| 14 | - git https://github.com/nektro/zig-licenses | 15 | - git https://github.com/nektro/zig-licenses |
| 15 | - git https://github.com/nektro/zig-licenses-text | 16 | - git https://github.com/nektro/zig-licenses-text |
| ... | @@ -19,3 +20,7 @@ MIT: | ... | @@ -19,3 +20,7 @@ MIT: |
| 19 | - git https://github.com/truemedian/hzzp | 20 | - git https://github.com/truemedian/hzzp |
| 20 | - git https://github.com/ziglibs/known-folders | 21 | - git https://github.com/ziglibs/known-folders |
| 21 | - git https://github.com/yaml/libyaml | 22 | - git https://github.com/yaml/libyaml |
| 23 | |||
| 24 | MPL-2.0: | ||
| 25 | = https://spdx.org/licenses/MPL-2.0 | ||
| 26 | - git https://github.com/nektro/zig-intrusive-parser |
src/cmd/aq.zig+8-7| ... | @@ -3,6 +3,7 @@ const string = []const u8; | ... | @@ -3,6 +3,7 @@ const string = []const u8; |
| 3 | const gpa = std.heap.c_allocator; | 3 | const gpa = std.heap.c_allocator; |
| 4 | const zfetch = @import("zfetch"); | 4 | const zfetch = @import("zfetch"); |
| 5 | const extras = @import("extras"); | 5 | const extras = @import("extras"); |
| 6 | const json = @import("json"); | ||
| 6 | 7 | ||
| 7 | const u = @import("./../util/index.zig"); | 8 | const u = @import("./../util/index.zig"); |
| 8 | 9 | ||
| ... | @@ -43,7 +44,7 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { | ... | @@ -43,7 +44,7 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { |
| 43 | u.fail("unknown command \"{s}\" for \"zigmod aq\"", .{args[0]}); | 44 | u.fail("unknown command \"{s}\" for \"zigmod aq\"", .{args[0]}); |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | pub fn server_fetch(url: string) !std.json.Parsed(std.json.Value) { | 47 | pub fn server_fetch(url: string) !json.Document { |
| 47 | const req = try zfetch.Request.init(gpa, url, null); | 48 | const req = try zfetch.Request.init(gpa, url, null); |
| 48 | defer req.deinit(); | 49 | defer req.deinit(); |
| 49 | 50 | ||
| ... | @@ -53,13 +54,13 @@ pub fn server_fetch(url: string) !std.json.Parsed(std.json.Value) { | ... | @@ -53,13 +54,13 @@ pub fn server_fetch(url: string) !std.json.Parsed(std.json.Value) { |
| 53 | 54 | ||
| 54 | try req.do(.GET, headers, null); | 55 | try req.do(.GET, headers, null); |
| 55 | 56 | ||
| 56 | const r = req.reader(); | 57 | const doc = try json.parse(gpa, "", req.reader(), .{ .support_trailing_commas = true, .maximum_depth = 100 }); |
| 57 | const body_content = try r.readAllAlloc(gpa, std.math.maxInt(usize)); | 58 | doc.acquire(); |
| 58 | const val = try extras.parse_json(gpa, body_content); | 59 | defer doc.release(); |
| 59 | 60 | ||
| 60 | if (val.value.object.get("message")) |msg| { | 61 | if (doc.root.object().getS("message")) |msg| { |
| 61 | std.log.err("server: {s}", .{msg.string}); | 62 | std.log.err("server: {s}", .{msg}); |
| 62 | return error.AquilaBadResponse; | 63 | return error.AquilaBadResponse; |
| 63 | } | 64 | } |
| 64 | return val; | 65 | return doc; |
| 65 | } | 66 | } |
src/cmd/aquila/add.zig+5-3| ... | @@ -18,11 +18,13 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { | ... | @@ -18,11 +18,13 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { |
| 18 | 18 | ||
| 19 | pub fn do(dir: std.fs.Dir, pkg_id: string) !string { | 19 | pub fn do(dir: std.fs.Dir, pkg_id: string) !string { |
| 20 | const url = try std.mem.join(gpa, "/", &.{ aq.server_root, pkg_id }); | 20 | const url = try std.mem.join(gpa, "/", &.{ aq.server_root, pkg_id }); |
| 21 | const val = try aq.server_fetch(url); | 21 | const doc = try aq.server_fetch(url); |
| 22 | doc.acquire(); | ||
| 23 | defer doc.release(); | ||
| 22 | 24 | ||
| 23 | const pkg_url = try std.fmt.allocPrint(gpa, "https://{s}/{s}", .{ | 25 | const pkg_url = try std.fmt.allocPrint(gpa, "https://{s}/{s}", .{ |
| 24 | val.value.object.get("repo").?.object.get("domain").?.string, | 26 | doc.root.object().getO("repo").?.getS("domain").?, |
| 25 | val.value.object.get("package").?.object.get("remote_name").?.string, | 27 | doc.root.object().getO("package").?.getS("remote_name").?, |
| 26 | }); | 28 | }); |
| 27 | 29 | ||
| 28 | const m = try zigmod.ModFile.from_dir(gpa, dir); | 30 | const m = try zigmod.ModFile.from_dir(gpa, dir); |
src/cmd/aquila/showjson.zig+4-2| ... | @@ -12,7 +12,9 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { | ... | @@ -12,7 +12,9 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { |
| 12 | const out = std.io.getStdOut().writer(); | 12 | const out = std.io.getStdOut().writer(); |
| 13 | 13 | ||
| 14 | const url = try std.mem.join(gpa, "/", &.{ aq.server_root, args[0] }); | 14 | const url = try std.mem.join(gpa, "/", &.{ aq.server_root, args[0] }); |
| 15 | const val = try aq.server_fetch(url); | 15 | const doc = try aq.server_fetch(url); |
| 16 | doc.acquire(); | ||
| 17 | defer doc.release(); | ||
| 16 | 18 | ||
| 17 | try out.print("{}\n", .{val}); | 19 | try out.print("{}\n", .{doc}); |
| 18 | } | 20 | } |
src/cmd/zpm.zig+26-31| ... | @@ -3,6 +3,7 @@ const string = []const u8; | ... | @@ -3,6 +3,7 @@ const string = []const u8; |
| 3 | const gpa = std.heap.c_allocator; | 3 | const gpa = std.heap.c_allocator; |
| 4 | const zfetch = @import("zfetch"); | 4 | const zfetch = @import("zfetch"); |
| 5 | const extras = @import("extras"); | 5 | const extras = @import("extras"); |
| 6 | const json = @import("json"); | ||
| 6 | 7 | ||
| 7 | const u = @import("./../util/index.zig"); | 8 | const u = @import("./../util/index.zig"); |
| 8 | 9 | ||
| ... | @@ -26,7 +27,7 @@ pub const Package = struct { | ... | @@ -26,7 +27,7 @@ pub const Package = struct { |
| 26 | root_file: string, | 27 | root_file: string, |
| 27 | description: string, | 28 | description: string, |
| 28 | source: u32, | 29 | source: u32, |
| 29 | links: []const ?string, | 30 | links: []const string, |
| 30 | }; | 31 | }; |
| 31 | 32 | ||
| 32 | pub fn execute(self_name: []const u8, args: [][]u8) !void { | 33 | pub fn execute(self_name: []const u8, args: [][]u8) !void { |
| ... | @@ -55,60 +56,54 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { | ... | @@ -55,60 +56,54 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { |
| 55 | u.fail("unknown command \"{s}\" for \"zigmod zpm\"", .{args[0]}); | 56 | u.fail("unknown command \"{s}\" for \"zigmod zpm\"", .{args[0]}); |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | pub fn server_fetch(url: string) !std.json.Parsed(std.json.Value) { | 59 | pub fn server_fetch(url: string) !json.Document { |
| 59 | const req = try zfetch.Request.init(gpa, url, null); | 60 | const req = try zfetch.Request.init(gpa, url, null); |
| 60 | defer req.deinit(); | 61 | defer req.deinit(); |
| 61 | try req.do(.GET, null, null); | 62 | try req.do(.GET, null, null); |
| 62 | const r = req.reader(); | 63 | return json.parse(gpa, "", req.reader(), .{ .support_trailing_commas = true, .maximum_depth = 100 }); |
| 63 | const body_content = try r.readAllAlloc(gpa, std.math.maxInt(usize)); | ||
| 64 | return extras.parse_json(gpa, body_content); | ||
| 65 | } | 64 | } |
| 66 | 65 | ||
| 67 | pub fn server_fetchArray(url: string) ![]const Package { | 66 | pub fn server_fetchArray(url: string) ![]const Package { |
| 68 | const val = try server_fetch(url); | 67 | const doc = try server_fetch(url); |
| 68 | doc.acquire(); | ||
| 69 | defer doc.release(); | ||
| 69 | var list = std.ArrayList(Package).init(gpa); | 70 | var list = std.ArrayList(Package).init(gpa); |
| 70 | errdefer list.deinit(); | 71 | errdefer list.deinit(); |
| 71 | 72 | ||
| 72 | for (val.value.array.items) |item| { | 73 | for (doc.root.array()) |item| { |
| 73 | if (get(item, "root_file") == null) continue; | 74 | const obj = item.object(); |
| 75 | if (obj.getS("root_file") == null) continue; | ||
| 74 | try list.append(Package{ | 76 | try list.append(Package{ |
| 75 | .name = item.object.get("name").?.string, | 77 | .name = obj.getS("name").?, |
| 76 | .author = item.object.get("author").?.string, | 78 | .author = obj.getS("author").?, |
| 77 | .description = item.object.get("description").?.string, | 79 | .description = obj.getS("description").?, |
| 78 | .tags = try valueStrArray(item.object.get("tags").?.array.items), | 80 | .tags = try valueStrArray(obj.getA("tags").?), |
| 79 | .git = item.object.get("git").?.string, | 81 | .git = obj.getS("git").?, |
| 80 | .root_file = item.object.get("root_file").?.string, | 82 | .root_file = obj.getS("root_file").?, |
| 81 | .source = @intCast(item.object.get("source").?.integer), | 83 | .source = obj.getN("source").?.get(u32), |
| 82 | .links = try valueLinks(item.object.get("links").?), | 84 | .links = try valueLinks(obj.getO("links").?), |
| 83 | }); | 85 | }); |
| 84 | } | 86 | } |
| 85 | return list.toOwnedSlice(); | 87 | return list.toOwnedSlice(); |
| 86 | } | 88 | } |
| 87 | 89 | ||
| 88 | fn valueStrArray(vals: []std.json.Value) ![]string { | 90 | fn valueStrArray(vals: json.Array) ![]string { |
| 89 | var list = std.ArrayList(string).init(gpa); | 91 | var list = std.ArrayList(string).init(gpa); |
| 90 | errdefer list.deinit(); | 92 | errdefer list.deinit(); |
| 91 | 93 | ||
| 92 | for (vals) |item| { | 94 | for (vals) |item| { |
| 93 | if (item != .string) continue; | 95 | if (item.v() != .string) continue; |
| 94 | try list.append(item.string); | 96 | try list.append(item.string()); |
| 95 | } | 97 | } |
| 96 | return list.toOwnedSlice(); | 98 | return list.toOwnedSlice(); |
| 97 | } | 99 | } |
| 98 | 100 | ||
| 99 | fn valueLinks(vals: std.json.Value) ![]?string { | 101 | fn valueLinks(vals: json.ObjectIndex) ![]string { |
| 100 | var list = std.ArrayList(?string).init(gpa); | 102 | var list = std.ArrayList(string).init(gpa); |
| 101 | errdefer list.deinit(); | 103 | errdefer list.deinit(); |
| 102 | 104 | ||
| 103 | if (get(vals, "github")) |x| try list.append(x.string); | 105 | if (vals.getS("github")) |x| try list.append(x); |
| 104 | if (get(vals, "aquila")) |x| try list.append(x.string); | 106 | if (vals.getS("aquila")) |x| try list.append(x); |
| 105 | if (get(vals, "astrolabe")) |x| try list.append(x.string); | 107 | if (vals.getS("astrolabe")) |x| try list.append(x); |
| 106 | return list.toOwnedSlice(); | 108 | return list.toOwnedSlice(); |
| 107 | } | 109 | } |
| 108 | |||
| 109 | fn get(obj: std.json.Value, key: string) ?std.json.Value { | ||
| 110 | const v = obj.object.get(key); | ||
| 111 | if (v == null) return null; | ||
| 112 | if (v.? == .null) return null; | ||
| 113 | return v.?; | ||
| 114 | } |
src/cmd/zpm/showjson.zig+4-2| ... | @@ -12,7 +12,9 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { | ... | @@ -12,7 +12,9 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { |
| 12 | const out = std.io.getStdOut().writer(); | 12 | const out = std.io.getStdOut().writer(); |
| 13 | 13 | ||
| 14 | const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, args[0] }); | 14 | const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, args[0] }); |
| 15 | const val = try zpm.server_fetch(url); | 15 | const doc = try zpm.server_fetch(url); |
| 16 | doc.acquire(); | ||
| 17 | defer doc.release(); | ||
| 16 | 18 | ||
| 17 | try out.print("{}\n", .{val}); | 19 | try out.print("{}\n", .{doc}); |
| 18 | } | 20 | } |
src/cmd/zpm/tags.zig+8-6| ... | @@ -14,12 +14,14 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { | ... | @@ -14,12 +14,14 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { |
| 14 | const out = std.io.getStdOut().writer(); | 14 | const out = std.io.getStdOut().writer(); |
| 15 | 15 | ||
| 16 | const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, "tags" }); | 16 | const url = try std.mem.join(gpa, "/", &.{ zpm.server_root, "tags" }); |
| 17 | const val = try zpm.server_fetch(url); | 17 | const doc = try zpm.server_fetch(url); |
| 18 | doc.acquire(); | ||
| 19 | defer doc.release(); | ||
| 18 | 20 | ||
| 19 | const name_col_width = blk: { | 21 | const name_col_width = blk: { |
| 20 | var w: usize = 4; | 22 | var w: usize = 4; |
| 21 | for (val.value.array.items) |tag| { | 23 | for (doc.root.array()) |tag| { |
| 22 | const len = tag.object.get("name").?.string.len; | 24 | const len = tag.object().getS("name").?.len; |
| 23 | if (len > w) { | 25 | if (len > w) { |
| 24 | w = len; | 26 | w = len; |
| 25 | } | 27 | } |
| ... | @@ -31,11 +33,11 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { | ... | @@ -31,11 +33,11 @@ pub fn execute(self_name: []const u8, args: [][]u8) !void { |
| 31 | try print_c_n(out, ' ', name_col_width - 4); | 33 | try print_c_n(out, ' ', name_col_width - 4); |
| 32 | try out.writeAll("DESCRIPTION\n"); | 34 | try out.writeAll("DESCRIPTION\n"); |
| 33 | 35 | ||
| 34 | for (val.value.array.items) |tag| { | 36 | for (doc.root.array()) |tag| { |
| 35 | const name = tag.object.get("name").?.string; | 37 | const name = tag.object().getS("name").?; |
| 36 | try out.writeAll(name); | 38 | try out.writeAll(name); |
| 37 | try print_c_n(out, ' ', name_col_width - name.len); | 39 | try print_c_n(out, ' ', name_col_width - name.len); |
| 38 | try out.writeAll(tag.object.get("description").?.string); | 40 | try out.writeAll(tag.object().getS("description").?); |
| 39 | try out.writeAll("\n"); | 41 | try out.writeAll("\n"); |
| 40 | } | 42 | } |
| 41 | } | 43 | } |
src/util/modfile.zig+2-6| ... | @@ -90,7 +90,6 @@ pub const ModFile = struct { | ... | @@ -90,7 +90,6 @@ pub const ModFile = struct { |
| 90 | var dtype: string = undefined; | 90 | var dtype: string = undefined; |
| 91 | var path: string = undefined; | 91 | var path: string = undefined; |
| 92 | var version: ?string = null; | 92 | var version: ?string = null; |
| 93 | var name = item.mapping.get_string("name") orelse ""; | ||
| 94 | var main = item.mapping.get_string("main") orelse ""; | 93 | var main = item.mapping.get_string("main") orelse ""; |
| 95 | 94 | ||
| 96 | if (item.mapping.get("src")) |val| { | 95 | if (item.mapping.get("src")) |val| { |
| ... | @@ -112,10 +111,6 @@ pub const ModFile = struct { | ... | @@ -112,10 +111,6 @@ pub const ModFile = struct { |
| 112 | } | 111 | } |
| 113 | const dep_type = std.meta.stringToEnum(zigmod.Dep.Type, dtype).?; | 112 | const dep_type = std.meta.stringToEnum(zigmod.Dep.Type, dtype).?; |
| 114 | if (dep_type == .local) { | 113 | if (dep_type == .local) { |
| 115 | if (path.len > 0) { | ||
| 116 | name = path; | ||
| 117 | path = ""; | ||
| 118 | } | ||
| 119 | if (version.?.len > 0) { | 114 | if (version.?.len > 0) { |
| 120 | main = version.?; | 115 | main = version.?; |
| 121 | version = ""; | 116 | version = ""; |
| ... | @@ -129,7 +124,7 @@ pub const ModFile = struct { | ... | @@ -129,7 +124,7 @@ pub const ModFile = struct { |
| 129 | .type = dep_type, | 124 | .type = dep_type, |
| 130 | .path = path, | 125 | .path = path, |
| 131 | .id = id, | 126 | .id = id, |
| 132 | .name = name, | 127 | .name = item.mapping.get_string("name") orelse "", |
| 133 | .main = main, | 128 | .main = main, |
| 134 | .version = version.?, | 129 | .version = version.?, |
| 135 | .c_include_dirs = try item.mapping.get_string_array(alloc, "c_include_dirs"), | 130 | .c_include_dirs = try item.mapping.get_string_array(alloc, "c_include_dirs"), |
| ... | @@ -142,6 +137,7 @@ pub const ModFile = struct { | ... | @@ -142,6 +137,7 @@ pub const ModFile = struct { |
| 142 | .keep = std.mem.eql(u8, "true", item.mapping.get_string("keep") orelse ""), | 137 | .keep = std.mem.eql(u8, "true", item.mapping.get_string("keep") orelse ""), |
| 143 | .for_build = for_build, | 138 | .for_build = for_build, |
| 144 | }); | 139 | }); |
| 140 | // const d = &dep_list.getLast(); | ||
| 145 | } | 141 | } |
| 146 | } | 142 | } |
| 147 | } | 143 | } |
zig.mod+1| ... | @@ -16,6 +16,7 @@ dependencies: | ... | @@ -16,6 +16,7 @@ dependencies: |
| 16 | - src: git https://github.com/nektro/zig-time | 16 | - src: git https://github.com/nektro/zig-time |
| 17 | - src: git https://github.com/nektro/zig-extras | 17 | - src: git https://github.com/nektro/zig-extras |
| 18 | - src: git https://github.com/nektro/zig-git | 18 | - src: git https://github.com/nektro/zig-git |
| 19 | - src: git https://github.com/nektro/zig-json | ||
| 19 | 20 | ||
| 20 | root_dependencies: | 21 | root_dependencies: |
| 21 | - src: git https://github.com/marlersoft/zigwin32 | 22 | - src: git https://github.com/marlersoft/zigwin32 |
zigmod.lock+2| ... | @@ -8,6 +8,8 @@ git https://github.com/nektro/zig-detect-license commit-3ff57d0681b7bd7f8ca9bd09 | ... | @@ -8,6 +8,8 @@ git https://github.com/nektro/zig-detect-license commit-3ff57d0681b7bd7f8ca9bd09 |
| 8 | git https://github.com/nektro/zig-extras commit-74f0ddb0a4dfa7921739b88cc381951a6b6e73ce | 8 | git https://github.com/nektro/zig-extras commit-74f0ddb0a4dfa7921739b88cc381951a6b6e73ce |
| 9 | git https://github.com/nektro/zig-git commit-103f4e419c35b88f802bb8234ece1c0a9aa40c03 | 9 | git https://github.com/nektro/zig-git commit-103f4e419c35b88f802bb8234ece1c0a9aa40c03 |
| 10 | git https://github.com/nektro/zig-inquirer commit-cf43dd6c9f328073f7468b5341c69ed0bb185db3 | 10 | git https://github.com/nektro/zig-inquirer commit-cf43dd6c9f328073f7468b5341c69ed0bb185db3 |
| 11 | git https://github.com/nektro/zig-intrusive-parser commit-2336d8b767eb7378762e1ba63635ca44accbd2ca | ||
| 12 | git https://github.com/nektro/zig-json commit-29587071de6dd3338e8eb76d4e0307af69a2d61a | ||
| 11 | git https://github.com/nektro/zig-leven commit-e5481b297b6023d446d835156591ba5ce88c17be | 13 | git https://github.com/nektro/zig-leven commit-e5481b297b6023d446d835156591ba5ce88c17be |
| 12 | git https://github.com/nektro/zig-licenses commit-f46d9f774df929885eef66c733a1e2a46bf16aec | 14 | git https://github.com/nektro/zig-licenses commit-f46d9f774df929885eef66c733a1e2a46bf16aec |
| 13 | git https://github.com/nektro/zig-licenses-text commit-b01e5a2dffcc564bddd8f514fe64bab9b5c52572 | 15 | git https://github.com/nektro/zig-licenses-text commit-b01e5a2dffcc564bddd8f514fe64bab9b5c52572 |