@pkmn/engine 0.1.0-dev.207fa86a → 0.1.0-dev.21a51fe4

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