@pkmn/engine 0.1.0-dev.207fa86a → 0.1.0-dev.2c13d3ec
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 +62 -31
- 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 +16 -13
- package/build/pkg/index.js +1 -1
- package/build/pkg/index.js.map +1 -1
- package/build/pkg/protocol.d.ts +4 -2
- package/build/pkg/protocol.js +5 -3
- 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 +56 -51
- package/package.json +47 -35
- package/src/bin/install-pkmn-engine +68 -36
- 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/data.zig +11 -11
- package/src/lib/common/debug.zig +74 -0
- package/src/lib/common/options.zig +12 -3
- package/src/lib/common/protocol.zig +239 -178
- package/src/lib/common/rng.zig +10 -10
- package/src/lib/gen1/README.md +131 -94
- 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 +65 -44
- package/src/lib/gen1/helpers.zig +439 -36
- package/src/lib/gen1/mechanics.zig +1085 -628
- 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,15 +1,20 @@
|
|
|
1
1
|
const std = @import("std");
|
|
2
2
|
const builtin = @import("builtin");
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
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, "
|
|
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(
|
|
39
|
+
const cmd = b.findProgram(&.{"strip"}, &.{}) catch null;
|
|
34
40
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
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
|
|
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, "
|
|
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
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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/
|
|
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
|
|
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 =
|
|
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(
|
|
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 =
|
|
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(
|
|
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.
|
|
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
|
-
|
|
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 =
|
|
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.
|
|
3
|
+
"version": "0.1.0-dev.2c13d3ec",
|
|
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,96 @@
|
|
|
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",
|
|
15
37
|
"src/lib/common/data.zig",
|
|
38
|
+
"src/lib/common/debug.zig",
|
|
16
39
|
"src/lib/common/options.zig",
|
|
17
40
|
"src/lib/common/protocol.zig",
|
|
18
41
|
"src/lib/common/rng.zig",
|
|
42
|
+
"src/lib/gen1/data.zig",
|
|
19
43
|
"src/lib/gen1/data/moves.zig",
|
|
20
44
|
"src/lib/gen1/data/species.zig",
|
|
21
45
|
"src/lib/gen1/data/types.zig",
|
|
22
|
-
"src/lib/gen1/data.zig",
|
|
23
46
|
"src/lib/gen1/helpers.zig",
|
|
24
47
|
"src/lib/gen1/mechanics.zig",
|
|
48
|
+
"src/lib/gen2/data.zig",
|
|
25
49
|
"src/lib/gen2/data/items.zig",
|
|
26
50
|
"src/lib/gen2/data/moves.zig",
|
|
27
51
|
"src/lib/gen2/data/species.zig",
|
|
28
52
|
"src/lib/gen2/data/types.zig",
|
|
29
|
-
"src/lib/gen2/data.zig",
|
|
30
53
|
"src/lib/gen2/helpers.zig",
|
|
31
54
|
"src/lib/gen2/mechanics.zig",
|
|
32
55
|
"src/lib/pkmn.zig",
|
|
33
|
-
"
|
|
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"
|
|
56
|
+
"src/test/display/pkmn.html.tmpl"
|
|
48
57
|
],
|
|
49
58
|
"engines": {
|
|
50
59
|
"node": ">=16.0.0"
|
|
51
60
|
},
|
|
52
61
|
"bin": {
|
|
53
|
-
"install-pkmn-engine": "src/bin/install-pkmn-engine"
|
|
62
|
+
"install-pkmn-engine": "src/bin/install-pkmn-engine",
|
|
63
|
+
"pkmn-debug": "src/bin/pkmn-debug"
|
|
54
64
|
},
|
|
55
65
|
"publishConfig": {
|
|
56
66
|
"access": "public"
|
|
57
67
|
},
|
|
58
68
|
"dependencies": {
|
|
59
|
-
"@pkmn/data": "^0.7.
|
|
60
|
-
"@pkmn/protocol": "^0.6.
|
|
69
|
+
"@pkmn/data": "^0.7.44",
|
|
70
|
+
"@pkmn/protocol": "^0.6.12"
|
|
61
71
|
},
|
|
62
72
|
"devDependencies": {
|
|
63
|
-
"@pkmn/eslint-config": "^3.
|
|
64
|
-
"@pkmn/img": "^0.2.
|
|
73
|
+
"@pkmn/eslint-config": "^3.2.0",
|
|
74
|
+
"@pkmn/img": "^0.2.12",
|
|
65
75
|
"@pkmn/sets": "^5.0.4",
|
|
66
|
-
"@pkmn/sim": "0.7.
|
|
76
|
+
"@pkmn/sim": "0.7.44",
|
|
67
77
|
"@types/html-minifier": "^4.0.2",
|
|
68
|
-
"@types/jest": "^29.5.
|
|
78
|
+
"@types/jest": "^29.5.2",
|
|
69
79
|
"@types/minimist": "^1.2.2",
|
|
70
80
|
"@types/mustache": "^4.2.2",
|
|
71
|
-
"@types/node": "^
|
|
72
|
-
"@vitest/coverage-c8": "^0.
|
|
73
|
-
"binaryen": "^
|
|
74
|
-
"eslint": "^8.
|
|
81
|
+
"@types/node": "^20.3.1",
|
|
82
|
+
"@vitest/coverage-c8": "^0.32.2",
|
|
83
|
+
"binaryen": "^113.0.0",
|
|
84
|
+
"eslint": "^8.43.0",
|
|
75
85
|
"html-minifier": "^4.0.0",
|
|
76
86
|
"json-stringify-pretty-compact": "3.0.0",
|
|
77
87
|
"minimist": "^1.2.8",
|
|
78
88
|
"mustache": "^4.2.0",
|
|
79
89
|
"source-map-support": "^0.5.21",
|
|
80
90
|
"trakr": "^0.2.0",
|
|
81
|
-
"typescript": "^5.
|
|
82
|
-
"vitest": "^0.
|
|
91
|
+
"typescript": "^5.1.3",
|
|
92
|
+
"vitest": "^0.32.2"
|
|
83
93
|
},
|
|
84
94
|
"scripts": {
|
|
85
|
-
"lint": "eslint --cache src --ext ts,js && eslint src/bin
|
|
86
|
-
"fix": "eslint --fix src --ext ts,js && eslint --fix src/bin
|
|
95
|
+
"lint": "eslint --cache src --ext ts,js && eslint src/bin/*",
|
|
96
|
+
"fix": "eslint --fix src --ext ts,js && eslint --fix src/bin/*",
|
|
87
97
|
"compile": "tsc -p .",
|
|
88
98
|
"build": "npm run compile",
|
|
89
99
|
"test": "vitest src/pkg",
|
|
90
100
|
"test:integration": "vitest src/test",
|
|
101
|
+
"debug": "npm run compile && node build/tools/debug",
|
|
91
102
|
"fuzz": "npm run compile && node build/test/fuzz",
|
|
92
103
|
"generate": "npm run compile && node build/tools/generate",
|
|
93
104
|
"release": "npm run compile && node build/tools/release",
|
|
@@ -150,7 +161,8 @@
|
|
|
150
161
|
},
|
|
151
162
|
{
|
|
152
163
|
"files": [
|
|
153
|
-
"src/test/*.test.ts"
|
|
164
|
+
"src/test/*.test.ts",
|
|
165
|
+
"src/test/regression/*.test.ts"
|
|
154
166
|
],
|
|
155
167
|
"rules": {
|
|
156
168
|
"jest/no-standalone-expect": "off"
|
|
@@ -188,4 +200,4 @@
|
|
|
188
200
|
}
|
|
189
201
|
]
|
|
190
202
|
}
|
|
191
|
-
}
|
|
203
|
+
}
|