@pkmn/engine 0.1.0-dev.84cc1a02 → 0.1.0-dev.90d6c14c
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.
- package/README.md +85 -54
- package/build/pkg/addon.d.ts +7 -0
- package/build/pkg/addon.js +112 -0
- package/build/pkg/addon.js.map +1 -0
- package/build/pkg/data/layout.json +25 -3
- package/build/pkg/data.d.ts +1 -2
- package/build/pkg/data.js +3 -5
- package/build/pkg/data.js.map +1 -1
- package/build/pkg/gen1.d.ts +5 -4
- package/build/pkg/gen1.js +47 -31
- package/build/pkg/gen1.js.map +1 -1
- package/build/pkg/index.d.ts +15 -12
- package/build/pkg/index.js.map +1 -1
- package/build/pkg/protocol.d.ts +4 -2
- package/build/pkg/protocol.js +4 -2
- package/build/pkg/protocol.js.map +1 -1
- package/build/test/display.js +400 -0
- package/build/test/display.js.map +1 -0
- package/build/tools/debug.js +133 -0
- package/build/tools/debug.js.map +1 -0
- package/build.zig +55 -48
- package/package.json +56 -36
- package/src/bin/install-pkmn-engine +55 -31
- package/src/bin/pkmn-debug +62 -0
- package/src/lib/binding/node.zig +46 -141
- package/src/lib/binding/wasm.zig +6 -4
- package/src/lib/common/battle.zig +17 -0
- package/src/lib/common/data.zig +11 -11
- package/src/lib/common/debug.zig +21 -11
- package/src/lib/common/js.zig +118 -0
- package/src/lib/common/optional.zig +60 -0
- package/src/lib/common/options.zig +12 -3
- package/src/lib/common/protocol.zig +239 -178
- package/src/lib/common/rational.zig +353 -0
- package/src/lib/common/rng.zig +10 -10
- package/src/lib/common/util.zig +12 -0
- package/src/lib/gen1/README.md +213 -179
- package/src/lib/gen1/calc.zig +427 -0
- package/src/lib/gen1/chance.zig +1044 -0
- package/src/lib/gen1/data/moves.zig +10 -10
- package/src/lib/gen1/data/species.zig +2 -2
- package/src/lib/gen1/data/types.zig +3 -3
- package/src/lib/gen1/data.zig +64 -43
- package/src/lib/gen1/helpers.zig +439 -32
- package/src/lib/gen1/mechanics.zig +1003 -612
- package/src/lib/gen2/README.md +12 -13
- package/src/lib/gen2/data/items.zig +3 -3
- package/src/lib/gen2/data/moves.zig +1 -1
- package/src/lib/gen2/data/species.zig +1 -1
- package/src/lib/gen2/data/types.zig +3 -3
- package/src/lib/gen2/data.zig +37 -26
- package/src/lib/gen2/helpers.zig +9 -11
- package/src/lib/gen2/mechanics.zig +5 -4
- package/src/lib/pkmn.zig +68 -9
- package/src/test/display/pkmn.html.tmpl +368 -0
package/build.zig
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
const std = @import("std");
|
|
2
2
|
const builtin = @import("builtin");
|
|
3
3
|
|
|
4
|
-
pub const Options = struct {
|
|
4
|
+
pub const Options = struct {
|
|
5
|
+
showdown: ?bool = null,
|
|
6
|
+
log: ?bool = null,
|
|
7
|
+
chance: ?bool = null,
|
|
8
|
+
calc: ?bool = null,
|
|
9
|
+
};
|
|
5
10
|
|
|
6
11
|
pub fn module(b: *std.Build, options: Options) *std.Build.Module {
|
|
7
12
|
const dirname = comptime std.fs.path.dirname(@src().file) orelse ".";
|
|
8
13
|
const build_options = b.addOptions();
|
|
9
14
|
build_options.addOption(?bool, "showdown", options.showdown);
|
|
10
|
-
build_options.addOption(?bool, "
|
|
15
|
+
build_options.addOption(?bool, "log", options.log);
|
|
16
|
+
build_options.addOption(?bool, "chance", options.chance);
|
|
17
|
+
build_options.addOption(?bool, "calc", options.calc);
|
|
11
18
|
return b.createModule(.{
|
|
12
19
|
.source_file = .{ .path = dirname ++ "/src/lib/pkmn.zig" },
|
|
13
20
|
.dependencies = &.{.{ .name = "build_options", .module = build_options.createModule() }},
|
|
@@ -27,25 +34,29 @@ pub fn build(b: *std.Build) !void {
|
|
|
27
34
|
const dynamic = b.option(bool, "dynamic", "Build a dynamic library") orelse false;
|
|
28
35
|
const strip = b.option(bool, "strip", "Strip debugging symbols from binary") orelse false;
|
|
29
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;
|
|
30
38
|
|
|
31
|
-
const cmd = b.findProgram(
|
|
39
|
+
const cmd = b.findProgram(&.{"strip"}, &.{}) catch null;
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
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, ":");
|
|
40
47
|
std.debug.assert(std.mem.eql(u8, repository.first(), "github"));
|
|
41
48
|
|
|
42
49
|
const showdown =
|
|
43
50
|
b.option(bool, "showdown", "Enable Pokémon Showdown compatibility mode") orelse false;
|
|
44
|
-
const
|
|
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;
|
|
45
54
|
|
|
46
55
|
const options = b.addOptions();
|
|
47
56
|
options.addOption(?bool, "showdown", showdown);
|
|
48
|
-
options.addOption(?bool, "
|
|
57
|
+
options.addOption(?bool, "log", log);
|
|
58
|
+
options.addOption(?bool, "chance", chance);
|
|
59
|
+
options.addOption(?bool, "calc", calc);
|
|
49
60
|
|
|
50
61
|
const name = if (showdown) "pkmn-showdown" else "pkmn";
|
|
51
62
|
|
|
@@ -72,14 +83,14 @@ pub fn build(b: *std.Build) !void {
|
|
|
72
83
|
maybeStrip(b, lib, b.getInstallStep(), strip, cmd);
|
|
73
84
|
if (pic) lib.force_pic = pic;
|
|
74
85
|
// Always emit to build/lib because this is where the driver code expects to find it
|
|
75
|
-
// TODO(ziglang/zig#2231): using the following used to work (though
|
|
86
|
+
// TODO(ziglang/zig#2231): using the following used to work (though was hacky):
|
|
76
87
|
//
|
|
77
88
|
// lib.emit_bin = .{ .emit_to = b.fmt("build/lib/{s}", .{addon}) };
|
|
78
89
|
// b.getInstallStep().dependOn(&lib.step);
|
|
79
90
|
//
|
|
80
91
|
// But ziglang/zig#14647 broke this so we now need to do an install() and then manually
|
|
81
92
|
// rename the file ourself in install-pkmn-engine
|
|
82
|
-
|
|
93
|
+
b.installArtifact(lib);
|
|
83
94
|
} else if (wasm) {
|
|
84
95
|
const lib = b.addSharedLibrary(.{
|
|
85
96
|
.name = name,
|
|
@@ -96,24 +107,21 @@ pub fn build(b: *std.Build) !void {
|
|
|
96
107
|
lib.rdynamic = true;
|
|
97
108
|
lib.strip = strip;
|
|
98
109
|
if (pic) lib.force_pic = pic;
|
|
99
|
-
const opt = b.findProgram(
|
|
100
|
-
&[_][]const u8{"wasm-opt"},
|
|
101
|
-
&[_][]const u8{"./node_modules/.bin"},
|
|
102
|
-
) catch null;
|
|
110
|
+
const opt = b.findProgram(&.{"wasm-opt"}, &.{"./node_modules/.bin"}) catch null;
|
|
103
111
|
if (optimize != .Debug and opt != null) {
|
|
104
112
|
const out = b.fmt("build/lib/{s}.wasm", .{name});
|
|
105
|
-
const sh = b.addSystemCommand(
|
|
113
|
+
const sh = b.addSystemCommand(&.{ opt.?, "-O4" });
|
|
106
114
|
sh.addArtifactArg(lib);
|
|
107
115
|
sh.addArg("-o");
|
|
108
116
|
sh.addFileSourceArg(.{ .path = out });
|
|
109
117
|
b.getInstallStep().dependOn(&sh.step);
|
|
110
118
|
}
|
|
111
|
-
|
|
119
|
+
b.installArtifact(lib);
|
|
112
120
|
} else if (dynamic) {
|
|
113
121
|
const lib = b.addSharedLibrary(.{
|
|
114
122
|
.name = name,
|
|
115
123
|
.root_source_file = .{ .path = "src/lib/binding/c.zig" },
|
|
116
|
-
.version = try std.
|
|
124
|
+
.version = try std.SemanticVersion.parse(version),
|
|
117
125
|
.optimize = optimize,
|
|
118
126
|
.target = target,
|
|
119
127
|
});
|
|
@@ -122,7 +130,7 @@ pub fn build(b: *std.Build) !void {
|
|
|
122
130
|
lib.addIncludePath("src/include");
|
|
123
131
|
maybeStrip(b, lib, b.getInstallStep(), strip, cmd);
|
|
124
132
|
if (pic) lib.force_pic = pic;
|
|
125
|
-
|
|
133
|
+
b.installArtifact(lib);
|
|
126
134
|
c = true;
|
|
127
135
|
} else {
|
|
128
136
|
const lib = b.addStaticLibrary(.{
|
|
@@ -137,7 +145,8 @@ pub fn build(b: *std.Build) !void {
|
|
|
137
145
|
lib.bundle_compiler_rt = true;
|
|
138
146
|
maybeStrip(b, lib, b.getInstallStep(), strip, cmd);
|
|
139
147
|
if (pic) lib.force_pic = pic;
|
|
140
|
-
lib.
|
|
148
|
+
if (emit_asm) lib.emit_asm = .emit;
|
|
149
|
+
b.installArtifact(lib);
|
|
141
150
|
c = true;
|
|
142
151
|
}
|
|
143
152
|
|
|
@@ -179,14 +188,20 @@ pub fn build(b: *std.Build) !void {
|
|
|
179
188
|
.strip = strip,
|
|
180
189
|
.cmd = cmd,
|
|
181
190
|
};
|
|
191
|
+
|
|
192
|
+
// TODO: tests can be run multiple times due to @imports
|
|
182
193
|
const tests = TestStep.create(b, options, config);
|
|
183
194
|
|
|
184
195
|
var exes = std.ArrayList(*std.Build.CompileStep).init(b.allocator);
|
|
185
196
|
const tools: ToolConfig = .{
|
|
197
|
+
.options = .{
|
|
198
|
+
.showdown = showdown,
|
|
199
|
+
.log = log,
|
|
200
|
+
.chance = chance,
|
|
201
|
+
.calc = calc,
|
|
202
|
+
},
|
|
186
203
|
.general = config,
|
|
187
204
|
.tool = .{
|
|
188
|
-
.showdown = showdown,
|
|
189
|
-
.trace = trace,
|
|
190
205
|
.tests = if (tests.build) tests else null,
|
|
191
206
|
.exes = &exes,
|
|
192
207
|
},
|
|
@@ -200,23 +215,25 @@ pub fn build(b: *std.Build) !void {
|
|
|
200
215
|
var fuzz_config = tools;
|
|
201
216
|
fuzz_config.general.strip = false;
|
|
202
217
|
fuzz_config.tool.name = "fuzz";
|
|
203
|
-
const fuzz = tool(b, "src/test/
|
|
218
|
+
const fuzz = tool(b, "src/test/fuzz.zig", fuzz_config);
|
|
204
219
|
|
|
220
|
+
const dump = tool(b, "src/tools/dump.zig", tools);
|
|
205
221
|
const serde = tool(b, "src/tools/serde.zig", tools);
|
|
206
|
-
const
|
|
222
|
+
const transitions = tool(b, "src/tools/transitions.zig", tools);
|
|
207
223
|
|
|
208
224
|
const lint_exe =
|
|
209
225
|
b.addExecutable(.{ .name = "lint", .root_source_file = .{ .path = "src/tools/lint.zig" } });
|
|
210
226
|
if (tests.build) tests.step.dependOn(&lint_exe.step);
|
|
211
|
-
const lint =
|
|
227
|
+
const lint = b.addRunArtifact(lint_exe);
|
|
212
228
|
|
|
213
229
|
b.step("benchmark", "Run benchmark code").dependOn(&benchmark.step);
|
|
230
|
+
b.step("dump", "Run protocol dump tool").dependOn(&dump.step);
|
|
214
231
|
b.step("fuzz", "Run fuzz tester").dependOn(&fuzz.step);
|
|
215
232
|
b.step("lint", "Lint source files").dependOn(&lint.step);
|
|
216
|
-
b.step("protocol", "Run protocol dump tool").dependOn(&protocol.step);
|
|
217
233
|
b.step("serde", "Run serialization/deserialization tool").dependOn(&serde.step);
|
|
218
234
|
b.step("test", "Run all tests").dependOn(&tests.step);
|
|
219
235
|
b.step("tools", "Install tools").dependOn(&ToolsStep.create(b, &exes).step);
|
|
236
|
+
b.step("transitions", "Visualize transitions algorithm search").dependOn(&transitions.step);
|
|
220
237
|
}
|
|
221
238
|
|
|
222
239
|
fn maybeStrip(
|
|
@@ -233,7 +250,7 @@ fn maybeStrip(
|
|
|
233
250
|
if (mac and artifact.isDynamicLibrary()) return;
|
|
234
251
|
// Assuming GNU strip, which complains "illegal pathname found in archive member"...
|
|
235
252
|
if (!mac and artifact.isStaticLibrary()) return;
|
|
236
|
-
const sh = b.addSystemCommand(
|
|
253
|
+
const sh = b.addSystemCommand(&.{ cmd.?, if (mac) "-x" else "-s" });
|
|
237
254
|
sh.addArtifactArg(artifact);
|
|
238
255
|
step.dependOn(&sh.step);
|
|
239
256
|
}
|
|
@@ -246,7 +263,7 @@ const Config = struct {
|
|
|
246
263
|
cmd: ?[]const u8,
|
|
247
264
|
};
|
|
248
265
|
|
|
249
|
-
const TESTS =
|
|
266
|
+
const TESTS = .{
|
|
250
267
|
"src/lib/common/test.zig",
|
|
251
268
|
"src/lib/gen1/test.zig",
|
|
252
269
|
"src/lib/gen2/test.zig",
|
|
@@ -259,11 +276,8 @@ const TestStep = struct {
|
|
|
259
276
|
pub fn create(b: *std.Build, options: *std.Build.OptionsStep, config: Config) *TestStep {
|
|
260
277
|
const coverage = b.option([]const u8, "test-coverage", "Generate test coverage");
|
|
261
278
|
const test_file = b.option([]const u8, "test-file", "Input file for test");
|
|
262
|
-
const test_bin = b.option([]const u8, "test-bin", "Emit test binary to");
|
|
263
279
|
const test_filter =
|
|
264
280
|
b.option([]const u8, "test-filter", "Skip tests that do not match filter");
|
|
265
|
-
const test_no_exec =
|
|
266
|
-
b.option(bool, "test-no-exec", "Compiles test binary without running it") orelse false;
|
|
267
281
|
|
|
268
282
|
const self = b.allocator.create(TestStep) catch @panic("OOM");
|
|
269
283
|
const step = std.Build.Step.init(.{ .id = .custom, .name = "Run all tests", .owner = b });
|
|
@@ -277,31 +291,26 @@ const TestStep = struct {
|
|
|
277
291
|
.root_source_file = .{ .path = path },
|
|
278
292
|
.optimize = config.optimize,
|
|
279
293
|
.target = config.target,
|
|
294
|
+
.filter = test_filter,
|
|
280
295
|
});
|
|
281
296
|
tests.setMainPkgPath("./");
|
|
282
|
-
tests.setFilter(test_filter);
|
|
283
297
|
tests.addOptions("build_options", options);
|
|
284
298
|
tests.single_threaded = true;
|
|
285
299
|
maybeStrip(b, tests, &tests.step, config.strip, config.cmd);
|
|
286
300
|
if (config.pic) tests.force_pic = config.pic;
|
|
287
|
-
if (test_bin) |bin| {
|
|
288
|
-
tests.name = std.fs.path.basename(bin);
|
|
289
|
-
if (std.fs.path.dirname(bin)) |dir| tests.setOutputDir(dir);
|
|
290
|
-
}
|
|
291
301
|
if (coverage) |c| {
|
|
292
302
|
tests.setExecCmd(&.{ "kcov", "--include-pattern=src/lib", c, null });
|
|
293
303
|
}
|
|
294
|
-
self.step.dependOn(
|
|
304
|
+
self.step.dependOn(&b.addRunArtifact(tests).step);
|
|
295
305
|
}
|
|
296
306
|
return self;
|
|
297
307
|
}
|
|
298
308
|
};
|
|
299
309
|
|
|
300
310
|
const ToolConfig = struct {
|
|
311
|
+
options: Options,
|
|
301
312
|
general: Config,
|
|
302
313
|
tool: struct {
|
|
303
|
-
showdown: bool,
|
|
304
|
-
trace: bool,
|
|
305
314
|
tests: ?*TestStep,
|
|
306
315
|
name: ?[]const u8 = null,
|
|
307
316
|
exes: *std.ArrayList(*std.Build.CompileStep),
|
|
@@ -312,7 +321,7 @@ fn tool(b: *std.Build, path: []const u8, config: ToolConfig) *std.Build.RunStep
|
|
|
312
321
|
var name = config.tool.name orelse std.fs.path.basename(path);
|
|
313
322
|
const index = std.mem.lastIndexOfScalar(u8, name, '.');
|
|
314
323
|
if (index) |i| name = name[0..i];
|
|
315
|
-
if (config.
|
|
324
|
+
if (config.options.showdown orelse false) name = b.fmt("{s}-showdown", .{name});
|
|
316
325
|
|
|
317
326
|
const exe = b.addExecutable(.{
|
|
318
327
|
.name = name,
|
|
@@ -320,16 +329,14 @@ fn tool(b: *std.Build, path: []const u8, config: ToolConfig) *std.Build.RunStep
|
|
|
320
329
|
.target = config.general.target,
|
|
321
330
|
.optimize = config.general.optimize,
|
|
322
331
|
});
|
|
323
|
-
exe.addModule("pkmn", module(b, .
|
|
324
|
-
|
|
325
|
-
.trace = config.tool.trace,
|
|
326
|
-
}));
|
|
332
|
+
exe.addModule("pkmn", module(b, config.options));
|
|
333
|
+
|
|
327
334
|
exe.single_threaded = true;
|
|
328
335
|
if (config.general.pic) exe.force_pic = config.general.pic;
|
|
329
336
|
if (config.tool.tests) |ts| ts.step.dependOn(&exe.step);
|
|
330
337
|
config.tool.exes.append(exe) catch @panic("OOM");
|
|
331
338
|
|
|
332
|
-
const run =
|
|
339
|
+
const run = b.addRunArtifact(exe);
|
|
333
340
|
maybeStrip(b, exe, &run.step, config.general.strip, config.general.cmd);
|
|
334
341
|
if (b.args) |args| run.addArgs(args);
|
|
335
342
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pkmn/engine",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.90d6c14c",
|
|
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
|
-
"
|
|
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.
|
|
61
|
-
"@pkmn/protocol": "^0.6.
|
|
76
|
+
"@pkmn/data": "^0.7.46",
|
|
77
|
+
"@pkmn/protocol": "^0.6.12"
|
|
62
78
|
},
|
|
63
79
|
"devDependencies": {
|
|
64
|
-
"@pkmn/eslint-config": "^
|
|
65
|
-
"@pkmn/img": "^0.2.
|
|
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.
|
|
83
|
+
"@pkmn/sim": "0.7.46",
|
|
68
84
|
"@types/html-minifier": "^4.0.2",
|
|
69
|
-
"@types/jest": "^29.5.
|
|
85
|
+
"@types/jest": "^29.5.3",
|
|
70
86
|
"@types/minimist": "^1.2.2",
|
|
71
87
|
"@types/mustache": "^4.2.2",
|
|
72
|
-
"@types/node": "^
|
|
73
|
-
"@vitest/coverage-c8": "^0.
|
|
74
|
-
"binaryen": "^
|
|
75
|
-
"eslint": "^8.
|
|
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.
|
|
83
|
-
"vitest": "^0.
|
|
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
|
|
87
|
-
"fix": "eslint --fix src --ext ts,js && eslint --fix src/bin
|
|
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"
|