@pkmn/engine 0.1.0-dev.729b1e87 → 0.1.0-dev.7963b917

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +91 -60
  2. package/build/pkg/addon.d.ts +7 -0
  3. package/build/pkg/addon.js +112 -0
  4. package/build/pkg/addon.js.map +1 -0
  5. package/build/pkg/data/layout.json +25 -3
  6. package/build/pkg/data.d.ts +1 -2
  7. package/build/pkg/data.js +3 -5
  8. package/build/pkg/data.js.map +1 -1
  9. package/build/pkg/gen1.d.ts +5 -4
  10. package/build/pkg/gen1.js +47 -31
  11. package/build/pkg/gen1.js.map +1 -1
  12. package/build/pkg/index.d.ts +15 -12
  13. package/build/pkg/index.js.map +1 -1
  14. package/build/pkg/protocol.d.ts +4 -2
  15. package/build/pkg/protocol.js +5 -3
  16. package/build/pkg/protocol.js.map +1 -1
  17. package/build/test/display.js +400 -0
  18. package/build/test/display.js.map +1 -0
  19. package/build/tools/debug.js +133 -0
  20. package/build/tools/debug.js.map +1 -0
  21. package/build.zig +76 -78
  22. package/package.json +56 -36
  23. package/src/bin/install-pkmn-engine +68 -36
  24. package/src/bin/pkmn-debug +62 -0
  25. package/src/lib/binding/node.zig +46 -141
  26. package/src/lib/binding/wasm.zig +6 -4
  27. package/src/lib/common/battle.zig +17 -0
  28. package/src/lib/common/data.zig +11 -11
  29. package/src/lib/common/debug.zig +21 -11
  30. package/src/lib/common/js.zig +118 -0
  31. package/src/lib/common/optional.zig +60 -0
  32. package/src/lib/common/options.zig +12 -3
  33. package/src/lib/common/protocol.zig +242 -178
  34. package/src/lib/common/rational.zig +353 -0
  35. package/src/lib/common/rng.zig +10 -10
  36. package/src/lib/common/util.zig +12 -0
  37. package/src/lib/gen1/README.md +197 -163
  38. package/src/lib/gen1/calc.zig +427 -0
  39. package/src/lib/gen1/chance.zig +1044 -0
  40. package/src/lib/gen1/data/moves.zig +10 -10
  41. package/src/lib/gen1/data/species.zig +2 -2
  42. package/src/lib/gen1/data/types.zig +3 -3
  43. package/src/lib/gen1/data.zig +70 -44
  44. package/src/lib/gen1/helpers.zig +439 -36
  45. package/src/lib/gen1/mechanics.zig +1040 -625
  46. package/src/lib/gen2/README.md +12 -13
  47. package/src/lib/gen2/data/items.zig +3 -3
  48. package/src/lib/gen2/data/moves.zig +1 -1
  49. package/src/lib/gen2/data/species.zig +1 -1
  50. package/src/lib/gen2/data/types.zig +3 -3
  51. package/src/lib/gen2/data.zig +37 -26
  52. package/src/lib/gen2/helpers.zig +9 -11
  53. package/src/lib/gen2/mechanics.zig +5 -4
  54. package/src/lib/pkmn.zig +68 -9
  55. package/src/test/display/pkmn.html.tmpl +368 -0
package/build.zig CHANGED
@@ -1,15 +1,20 @@
1
1
  const std = @import("std");
2
2
  const builtin = @import("builtin");
3
3
 
4
- const NativeTargetInfo = std.zig.system.NativeTargetInfo;
5
-
6
- pub const Options = struct { showdown: ?bool = null, trace: ?bool = null };
4
+ pub const Options = struct {
5
+ showdown: ?bool = null,
6
+ log: ?bool = null,
7
+ chance: ?bool = null,
8
+ calc: ?bool = null,
9
+ };
7
10
 
8
11
  pub fn module(b: *std.Build, options: Options) *std.Build.Module {
9
12
  const dirname = comptime std.fs.path.dirname(@src().file) orelse ".";
10
13
  const build_options = b.addOptions();
11
14
  build_options.addOption(?bool, "showdown", options.showdown);
12
- build_options.addOption(?bool, "trace", options.trace);
15
+ build_options.addOption(?bool, "log", options.log);
16
+ build_options.addOption(?bool, "chance", options.chance);
17
+ build_options.addOption(?bool, "calc", options.calc);
13
18
  return b.createModule(.{
14
19
  .source_file = .{ .path = dirname ++ "/src/lib/pkmn.zig" },
15
20
  .dependencies = &.{.{ .name = "build_options", .module = build_options.createModule() }},
@@ -29,25 +34,30 @@ pub fn build(b: *std.Build) !void {
29
34
  const dynamic = b.option(bool, "dynamic", "Build a dynamic library") orelse false;
30
35
  const strip = b.option(bool, "strip", "Strip debugging symbols from binary") orelse false;
31
36
  const pic = b.option(bool, "pic", "Force position independent code") orelse false;
37
+ const emit_asm = b.option(bool, "emit-asm", "Output .s (assembly code)") orelse false;
38
+ const emit_ll = b.option(bool, "emit-ll", "Output .ll (LLVM IR)") orelse false;
32
39
 
33
- const cmd = b.findProgram(&[_][]const u8{"strip"}, &[_][]const u8{}) catch null;
40
+ const cmd = b.findProgram(&.{"strip"}, &.{}) catch null;
34
41
 
35
- var parser = std.json.Parser.init(b.allocator, false);
36
- defer parser.deinit();
37
- var tree = try parser.parse(@embedFile("package.json"));
38
- defer tree.deinit();
39
- const version = tree.root.Object.get("version").?.String;
40
- const description = tree.root.Object.get("description").?.String;
41
- var repository = std.mem.split(u8, tree.root.Object.get("repository").?.String, ":");
42
+ const json = @embedFile("package.json");
43
+ var parsed = try std.json.parseFromSlice(std.json.Value, b.allocator, json, .{});
44
+ defer parsed.deinit();
45
+ const version = parsed.value.object.get("version").?.string;
46
+ const description = parsed.value.object.get("description").?.string;
47
+ var repository = std.mem.split(u8, parsed.value.object.get("repository").?.string, ":");
42
48
  std.debug.assert(std.mem.eql(u8, repository.first(), "github"));
43
49
 
44
50
  const showdown =
45
51
  b.option(bool, "showdown", "Enable Pokémon Showdown compatibility mode") orelse false;
46
- const trace = b.option(bool, "trace", "Enable trace logs") orelse false;
52
+ const log = b.option(bool, "log", "Enable protocol message logging") orelse false;
53
+ const chance = b.option(bool, "chance", "Enable update probability tracking") orelse false;
54
+ const calc = b.option(bool, "calc", "Enable damage calculator support") orelse false;
47
55
 
48
56
  const options = b.addOptions();
49
57
  options.addOption(?bool, "showdown", showdown);
50
- options.addOption(?bool, "trace", trace);
58
+ options.addOption(?bool, "log", log);
59
+ options.addOption(?bool, "chance", chance);
60
+ options.addOption(?bool, "calc", calc);
51
61
 
52
62
  const name = if (showdown) "pkmn-showdown" else "pkmn";
53
63
 
@@ -66,7 +76,7 @@ pub fn build(b: *std.Build) !void {
66
76
  lib.linkLibC();
67
77
  if (node_import_lib) |il| {
68
78
  lib.addObjectFile(il);
69
- } else if ((try NativeTargetInfo.detect(target)).target.os.tag == .windows) {
79
+ } else if ((try std.zig.system.NativeTargetInfo.detect(target)).target.os.tag == .windows) {
70
80
  try std.io.getStdErr().writeAll("Must provide --node-import-library path on Windows\n");
71
81
  std.process.exit(1);
72
82
  }
@@ -74,14 +84,14 @@ pub fn build(b: *std.Build) !void {
74
84
  maybeStrip(b, lib, b.getInstallStep(), strip, cmd);
75
85
  if (pic) lib.force_pic = pic;
76
86
  // Always emit to build/lib because this is where the driver code expects to find it
77
- // TODO(ziglang/zig#2231): using the following used to work (though be hacky):
87
+ // TODO(ziglang/zig#2231): using the following used to work (though was hacky):
78
88
  //
79
89
  // lib.emit_bin = .{ .emit_to = b.fmt("build/lib/{s}", .{addon}) };
80
90
  // b.getInstallStep().dependOn(&lib.step);
81
91
  //
82
92
  // But ziglang/zig#14647 broke this so we now need to do an install() and then manually
83
93
  // rename the file ourself in install-pkmn-engine
84
- lib.install();
94
+ b.installArtifact(lib);
85
95
  } else if (wasm) {
86
96
  const lib = b.addSharedLibrary(.{
87
97
  .name = name,
@@ -98,24 +108,21 @@ pub fn build(b: *std.Build) !void {
98
108
  lib.rdynamic = true;
99
109
  lib.strip = strip;
100
110
  if (pic) lib.force_pic = pic;
101
- const opt = b.findProgram(
102
- &[_][]const u8{"wasm-opt"},
103
- &[_][]const u8{"./node_modules/.bin"},
104
- ) catch null;
111
+ const opt = b.findProgram(&.{"wasm-opt"}, &.{"./node_modules/.bin"}) catch null;
105
112
  if (optimize != .Debug and opt != null) {
106
113
  const out = b.fmt("build/lib/{s}.wasm", .{name});
107
- const sh = b.addSystemCommand(&[_][]const u8{ opt.?, "-O4" });
114
+ const sh = b.addSystemCommand(&.{ opt.?, "-O4" });
108
115
  sh.addArtifactArg(lib);
109
116
  sh.addArg("-o");
110
117
  sh.addFileSourceArg(.{ .path = out });
111
118
  b.getInstallStep().dependOn(&sh.step);
112
119
  }
113
- lib.install();
120
+ b.installArtifact(lib);
114
121
  } else if (dynamic) {
115
122
  const lib = b.addSharedLibrary(.{
116
123
  .name = name,
117
124
  .root_source_file = .{ .path = "src/lib/binding/c.zig" },
118
- .version = try std.builtin.Version.parse(version),
125
+ .version = try std.SemanticVersion.parse(version),
119
126
  .optimize = optimize,
120
127
  .target = target,
121
128
  });
@@ -124,7 +131,7 @@ pub fn build(b: *std.Build) !void {
124
131
  lib.addIncludePath("src/include");
125
132
  maybeStrip(b, lib, b.getInstallStep(), strip, cmd);
126
133
  if (pic) lib.force_pic = pic;
127
- lib.install();
134
+ b.installArtifact(lib);
128
135
  c = true;
129
136
  } else {
130
137
  const lib = b.addStaticLibrary(.{
@@ -139,7 +146,9 @@ pub fn build(b: *std.Build) !void {
139
146
  lib.bundle_compiler_rt = true;
140
147
  maybeStrip(b, lib, b.getInstallStep(), strip, cmd);
141
148
  if (pic) lib.force_pic = pic;
142
- lib.install();
149
+ if (emit_asm) lib.emit_asm = .emit;
150
+ if (emit_ll) lib.emit_llvm_ir = .emit;
151
+ b.installArtifact(lib);
143
152
  c = true;
144
153
  }
145
154
 
@@ -181,14 +190,20 @@ pub fn build(b: *std.Build) !void {
181
190
  .strip = strip,
182
191
  .cmd = cmd,
183
192
  };
193
+
194
+ // TODO: tests can be run multiple times due to @imports
184
195
  const tests = TestStep.create(b, options, config);
185
196
 
186
197
  var exes = std.ArrayList(*std.Build.CompileStep).init(b.allocator);
187
198
  const tools: ToolConfig = .{
199
+ .options = .{
200
+ .showdown = showdown,
201
+ .log = log,
202
+ .chance = chance,
203
+ .calc = calc,
204
+ },
188
205
  .general = config,
189
206
  .tool = .{
190
- .showdown = showdown,
191
- .trace = trace,
192
207
  .tests = if (tests.build) tests else null,
193
208
  .exes = &exes,
194
209
  },
@@ -202,23 +217,21 @@ pub fn build(b: *std.Build) !void {
202
217
  var fuzz_config = tools;
203
218
  fuzz_config.general.strip = false;
204
219
  fuzz_config.tool.name = "fuzz";
205
- const fuzz = tool(b, "src/test/benchmark.zig", fuzz_config);
220
+ const fuzz = tool(b, "src/test/fuzz.zig", fuzz_config);
206
221
 
222
+ const copies = tool(b, "src/tools/copies.zig", tools);
223
+ const dump = tool(b, "src/tools/dump.zig", tools);
207
224
  const serde = tool(b, "src/tools/serde.zig", tools);
208
- const protocol = tool(b, "src/tools/protocol.zig", tools);
209
-
210
- const lint_exe =
211
- b.addExecutable(.{ .name = "lint", .root_source_file = .{ .path = "src/tools/lint.zig" } });
212
- if (tests.build) tests.step.dependOn(&lint_exe.step);
213
- const lint = lint_exe.run();
225
+ const transitions = tool(b, "src/tools/transitions.zig", tools);
214
226
 
227
+ b.step("copies", "Run copy detector").dependOn(&copies.step);
215
228
  b.step("benchmark", "Run benchmark code").dependOn(&benchmark.step);
229
+ b.step("dump", "Run protocol dump tool").dependOn(&dump.step);
216
230
  b.step("fuzz", "Run fuzz tester").dependOn(&fuzz.step);
217
- b.step("lint", "Lint source files").dependOn(&lint.step);
218
- b.step("protocol", "Run protocol dump tool").dependOn(&protocol.step);
219
231
  b.step("serde", "Run serialization/deserialization tool").dependOn(&serde.step);
220
232
  b.step("test", "Run all tests").dependOn(&tests.step);
221
233
  b.step("tools", "Install tools").dependOn(&ToolsStep.create(b, &exes).step);
234
+ b.step("transitions", "Visualize transitions algorithm search").dependOn(&transitions.step);
222
235
  }
223
236
 
224
237
  fn maybeStrip(
@@ -235,7 +248,7 @@ fn maybeStrip(
235
248
  if (mac and artifact.isDynamicLibrary()) return;
236
249
  // Assuming GNU strip, which complains "illegal pathname found in archive member"...
237
250
  if (!mac and artifact.isStaticLibrary()) return;
238
- const sh = b.addSystemCommand(&[_][]const u8{ cmd.?, if (mac) "-x" else "-s" });
251
+ const sh = b.addSystemCommand(&.{ cmd.?, if (mac) "-x" else "-s" });
239
252
  sh.addArtifactArg(artifact);
240
253
  step.dependOn(&sh.step);
241
254
  }
@@ -248,12 +261,6 @@ const Config = struct {
248
261
  cmd: ?[]const u8,
249
262
  };
250
263
 
251
- const TESTS = [_][]const u8{
252
- "src/lib/common/test.zig",
253
- "src/lib/gen1/test.zig",
254
- "src/lib/gen2/test.zig",
255
- };
256
-
257
264
  const TestStep = struct {
258
265
  step: std.Build.Step,
259
266
  build: bool,
@@ -261,49 +268,42 @@ const TestStep = struct {
261
268
  pub fn create(b: *std.Build, options: *std.Build.OptionsStep, config: Config) *TestStep {
262
269
  const coverage = b.option([]const u8, "test-coverage", "Generate test coverage");
263
270
  const test_file = b.option([]const u8, "test-file", "Input file for test");
264
- const test_bin = b.option([]const u8, "test-bin", "Emit test binary to");
265
271
  const test_filter =
266
272
  b.option([]const u8, "test-filter", "Skip tests that do not match filter");
267
- const test_no_exec =
268
- b.option(bool, "test-no-exec", "Compiles test binary without running it") orelse false;
269
273
 
270
274
  const self = b.allocator.create(TestStep) catch @panic("OOM");
271
275
  const step = std.Build.Step.init(.{ .id = .custom, .name = "Run all tests", .owner = b });
272
276
  self.* = TestStep{ .step = step, .build = test_filter == null };
273
277
 
274
- const paths: []const []const u8 =
275
- if (test_file) |t| &.{t} else if (coverage != null) &.{"src/lib/test.zig"} else &TESTS;
276
- for (paths) |path| {
277
- const tests = b.addTest(.{
278
- .name = std.fs.path.basename(std.fs.path.dirname(path).?),
279
- .root_source_file = .{ .path = path },
280
- .optimize = config.optimize,
281
- .target = config.target,
282
- });
283
- tests.setMainPkgPath("./");
284
- tests.setFilter(test_filter);
285
- tests.addOptions("build_options", options);
286
- tests.single_threaded = true;
287
- maybeStrip(b, tests, &tests.step, config.strip, config.cmd);
288
- if (config.pic) tests.force_pic = config.pic;
289
- if (test_bin) |bin| {
290
- tests.name = std.fs.path.basename(bin);
291
- if (std.fs.path.dirname(bin)) |dir| tests.setOutputDir(dir);
292
- }
293
- if (coverage) |c| {
294
- tests.setExecCmd(&.{ "kcov", "--include-pattern=src/lib", c, null });
295
- }
296
- self.step.dependOn(if (test_no_exec) &tests.step else &tests.run().step);
278
+ const path = test_file orelse "src/lib/test.zig";
279
+ const tests = b.addTest(.{
280
+ .name = b.fmt("{s}-{s}", .{
281
+ std.fs.path.basename(std.fs.path.dirname(path).?),
282
+ std.fs.path.stem(std.fs.path.basename(path)),
283
+ }),
284
+ .root_source_file = .{ .path = path },
285
+ .optimize = config.optimize,
286
+ .target = config.target,
287
+ .filter = test_filter,
288
+ });
289
+ tests.setMainPkgPath("./");
290
+ tests.addOptions("build_options", options);
291
+ tests.single_threaded = true;
292
+ maybeStrip(b, tests, &tests.step, config.strip, config.cmd);
293
+ if (config.pic) tests.force_pic = config.pic;
294
+ if (coverage) |c| {
295
+ tests.setExecCmd(&.{ "kcov", "--include-pattern=src/lib", c, null });
297
296
  }
297
+ self.step.dependOn(&b.addRunArtifact(tests).step);
298
+
298
299
  return self;
299
300
  }
300
301
  };
301
302
 
302
303
  const ToolConfig = struct {
304
+ options: Options,
303
305
  general: Config,
304
306
  tool: struct {
305
- showdown: bool,
306
- trace: bool,
307
307
  tests: ?*TestStep,
308
308
  name: ?[]const u8 = null,
309
309
  exes: *std.ArrayList(*std.Build.CompileStep),
@@ -314,7 +314,7 @@ fn tool(b: *std.Build, path: []const u8, config: ToolConfig) *std.Build.RunStep
314
314
  var name = config.tool.name orelse std.fs.path.basename(path);
315
315
  const index = std.mem.lastIndexOfScalar(u8, name, '.');
316
316
  if (index) |i| name = name[0..i];
317
- if (config.tool.showdown) name = b.fmt("{s}-showdown", .{name});
317
+ if (config.options.showdown orelse false) name = b.fmt("{s}-showdown", .{name});
318
318
 
319
319
  const exe = b.addExecutable(.{
320
320
  .name = name,
@@ -322,16 +322,14 @@ fn tool(b: *std.Build, path: []const u8, config: ToolConfig) *std.Build.RunStep
322
322
  .target = config.general.target,
323
323
  .optimize = config.general.optimize,
324
324
  });
325
- exe.addModule("pkmn", module(b, .{
326
- .showdown = config.tool.showdown,
327
- .trace = config.tool.trace,
328
- }));
325
+ exe.addModule("pkmn", module(b, config.options));
326
+
329
327
  exe.single_threaded = true;
330
328
  if (config.general.pic) exe.force_pic = config.general.pic;
331
329
  if (config.tool.tests) |ts| ts.step.dependOn(&exe.step);
332
330
  config.tool.exes.append(exe) catch @panic("OOM");
333
331
 
334
- const run = exe.run();
332
+ const run = b.addRunArtifact(exe);
335
333
  maybeStrip(b, exe, &run.step, config.general.strip, config.general.cmd);
336
334
  if (b.args) |args| run.addArgs(args);
337
335
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pkmn/engine",
3
- "version": "0.1.0-dev.729b1e87",
3
+ "version": "0.1.0-dev.7963b917",
4
4
  "description": "A minimal, complete, Pokémon battle simulation engine optimized for performance",
5
5
  "repository": "github:pkmn/engine",
6
6
  "license": "MIT",
@@ -9,86 +9,103 @@
9
9
  "types": "build/pkg/index.d.ts",
10
10
  "files": [
11
11
  "build.zig",
12
+ "build/pkg/data.d.ts",
13
+ "build/pkg/data.js.map",
14
+ "build/pkg/addon.d.ts",
15
+ "build/pkg/addon.js.map",
16
+ "build/pkg/addon.js",
17
+ "build/pkg/data.js",
18
+ "build/pkg/data/ids.json",
19
+ "build/pkg/data/layout.json",
20
+ "build/pkg/data/protocol.json",
21
+ "build/pkg/gen1.d.ts",
22
+ "build/pkg/gen1.js.map",
23
+ "build/pkg/gen1.js",
24
+ "build/pkg/index.d.ts",
25
+ "build/pkg/index.js.map",
26
+ "build/pkg/index.js",
27
+ "build/pkg/protocol.d.ts",
28
+ "build/pkg/protocol.js.map",
29
+ "build/pkg/protocol.js",
30
+ "build/test/display.js.map",
31
+ "build/test/display.js",
32
+ "build/tools/debug.js.map",
33
+ "build/tools/debug.js",
12
34
  "src/bin/install-pkmn-engine",
13
35
  "src/lib/binding/node.zig",
14
36
  "src/lib/binding/wasm.zig",
37
+ "src/lib/common/battle.zig",
15
38
  "src/lib/common/data.zig",
16
39
  "src/lib/common/debug.zig",
40
+ "src/lib/common/js.zig",
41
+ "src/lib/common/optional.zig",
17
42
  "src/lib/common/options.zig",
18
43
  "src/lib/common/protocol.zig",
44
+ "src/lib/common/rational.zig",
19
45
  "src/lib/common/rng.zig",
46
+ "src/lib/common/util.zig",
47
+ "src/lib/gen1/calc.zig",
48
+ "src/lib/gen1/chance.zig",
49
+ "src/lib/gen1/data.zig",
20
50
  "src/lib/gen1/data/moves.zig",
21
51
  "src/lib/gen1/data/species.zig",
22
52
  "src/lib/gen1/data/types.zig",
23
- "src/lib/gen1/data.zig",
24
53
  "src/lib/gen1/helpers.zig",
25
54
  "src/lib/gen1/mechanics.zig",
55
+ "src/lib/gen2/data.zig",
26
56
  "src/lib/gen2/data/items.zig",
27
57
  "src/lib/gen2/data/moves.zig",
28
58
  "src/lib/gen2/data/species.zig",
29
59
  "src/lib/gen2/data/types.zig",
30
- "src/lib/gen2/data.zig",
31
60
  "src/lib/gen2/helpers.zig",
32
61
  "src/lib/gen2/mechanics.zig",
33
62
  "src/lib/pkmn.zig",
34
- "build/pkg/data/ids.json",
35
- "build/pkg/data/layout.json",
36
- "build/pkg/data/protocol.json",
37
- "build/pkg/data.d.ts",
38
- "build/pkg/data.js",
39
- "build/pkg/data.js.map",
40
- "build/pkg/gen1.d.ts",
41
- "build/pkg/gen1.js",
42
- "build/pkg/gen1.js.map",
43
- "build/pkg/index.d.ts",
44
- "build/pkg/index.js",
45
- "build/pkg/index.js.map",
46
- "build/pkg/protocol.d.ts",
47
- "build/pkg/protocol.js",
48
- "build/pkg/protocol.js.map"
63
+ "src/test/display/pkmn.html.tmpl"
49
64
  ],
50
65
  "engines": {
51
66
  "node": ">=16.0.0"
52
67
  },
53
68
  "bin": {
54
- "install-pkmn-engine": "src/bin/install-pkmn-engine"
69
+ "install-pkmn-engine": "src/bin/install-pkmn-engine",
70
+ "pkmn-debug": "src/bin/pkmn-debug"
55
71
  },
56
72
  "publishConfig": {
57
73
  "access": "public"
58
74
  },
59
75
  "dependencies": {
60
- "@pkmn/data": "^0.7.34",
61
- "@pkmn/protocol": "^0.6.11"
76
+ "@pkmn/data": "^0.7.46",
77
+ "@pkmn/protocol": "^0.6.12"
62
78
  },
63
79
  "devDependencies": {
64
- "@pkmn/eslint-config": "^3.0.0-alpha.0",
65
- "@pkmn/img": "^0.2.8",
80
+ "@pkmn/eslint-config": "^5.0.0",
81
+ "@pkmn/img": "^0.2.13",
66
82
  "@pkmn/sets": "^5.0.4",
67
- "@pkmn/sim": "0.7.34",
83
+ "@pkmn/sim": "0.7.46",
68
84
  "@types/html-minifier": "^4.0.2",
69
- "@types/jest": "^29.5.0",
85
+ "@types/jest": "^29.5.3",
70
86
  "@types/minimist": "^1.2.2",
71
87
  "@types/mustache": "^4.2.2",
72
- "@types/node": "^18.15.11",
73
- "@vitest/coverage-c8": "^0.29.8",
74
- "binaryen": "^112.0.0",
75
- "eslint": "^8.37.0",
88
+ "@types/node": "^20.4.2",
89
+ "@vitest/coverage-c8": "^0.33.0",
90
+ "binaryen": "^114.0.0",
91
+ "eslint": "^8.44.0",
76
92
  "html-minifier": "^4.0.0",
77
93
  "json-stringify-pretty-compact": "3.0.0",
78
94
  "minimist": "^1.2.8",
79
95
  "mustache": "^4.2.0",
80
96
  "source-map-support": "^0.5.21",
81
97
  "trakr": "^0.2.0",
82
- "typescript": "^5.0.2",
83
- "vitest": "^0.29.8"
98
+ "typescript": "^5.1.6",
99
+ "vitest": "^0.33.0"
84
100
  },
85
101
  "scripts": {
86
- "lint": "eslint --cache src --ext ts,js && eslint src/bin/install-pkmn-engine",
87
- "fix": "eslint --fix src --ext ts,js && eslint --fix src/bin/install-pkmn-engine",
102
+ "lint": "eslint --cache src --ext ts,js && eslint src/bin/*",
103
+ "fix": "eslint --fix src --ext ts,js && eslint --fix src/bin/*",
88
104
  "compile": "tsc -p .",
89
105
  "build": "npm run compile",
90
106
  "test": "vitest src/pkg",
91
107
  "test:integration": "vitest src/test",
108
+ "debug": "npm run compile && node build/tools/debug",
92
109
  "fuzz": "npm run compile && node build/test/fuzz",
93
110
  "generate": "npm run compile && node build/tools/generate",
94
111
  "release": "npm run compile && node build/tools/release",
@@ -130,7 +147,8 @@
130
147
  "rules": {
131
148
  "no-control-regex": "off",
132
149
  "@typescript-eslint/no-empty-interface": "off",
133
- "@typescript-eslint/no-shadow": "off"
150
+ "@typescript-eslint/no-shadow": "off",
151
+ "@typescript-eslint/no-unsafe-declaration-merging": "off"
134
152
  }
135
153
  },
136
154
  {
@@ -146,12 +164,14 @@
146
164
  "src/test/benchmark*.ts"
147
165
  ],
148
166
  "rules": {
149
- "@typescript-eslint/no-unused-vars": "off"
167
+ "@typescript-eslint/no-unused-vars": "off",
168
+ "@typescript-eslint/no-redundant-type-constituents": "off"
150
169
  }
151
170
  },
152
171
  {
153
172
  "files": [
154
- "src/test/*.test.ts"
173
+ "src/test/*.test.ts",
174
+ "src/test/regression/*.test.ts"
155
175
  ],
156
176
  "rules": {
157
177
  "jest/no-standalone-expect": "off"