as-test 1.0.16 → 1.1.0
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/CHANGELOG.md +48 -0
- package/README.md +45 -4
- package/as-test.config.schema.json +5 -0
- package/assembly/util/wipc.ts +11 -4
- package/bin/commands/clean-core.js +92 -0
- package/bin/commands/clean.js +6 -0
- package/bin/commands/init-core.js +33 -225
- package/bin/commands/run-core.js +433 -289
- package/bin/commands/web-runner-source.js +14 -700
- package/bin/commands/web-session.js +1144 -0
- package/bin/index.js +390 -78
- package/bin/types.js +1 -0
- package/bin/util.js +16 -1
- package/lib/build/index.d.ts +1 -0
- package/lib/build/index.js +1098 -0
- package/lib/build/web-runner/client.d.ts +1 -0
- package/lib/build/web-runner/client.js +167 -0
- package/lib/build/web-runner/html.d.ts +1 -0
- package/lib/build/web-runner/html.js +201 -0
- package/lib/build/web-runner/worker.d.ts +1 -0
- package/lib/build/web-runner/worker.js +271 -0
- package/lib/src/index.ts +1248 -0
- package/package.json +14 -4
- package/transform/lib/mock.js +50 -27
package/bin/types.js
CHANGED
package/bin/util.js
CHANGED
|
@@ -175,7 +175,7 @@ const FUZZ_OPTION_KEYS = new Set([
|
|
|
175
175
|
"corpusDir",
|
|
176
176
|
"crashDir",
|
|
177
177
|
]);
|
|
178
|
-
const MODE_KEYS = new Set([...TOP_LEVEL_KEYS].filter((key) => key != "modes"));
|
|
178
|
+
const MODE_KEYS = new Set([...TOP_LEVEL_KEYS, "default"].filter((key) => key != "modes"));
|
|
179
179
|
function validateConfig(raw, configPath) {
|
|
180
180
|
const issues = [];
|
|
181
181
|
validateUnknownKeys(raw, TOP_LEVEL_KEYS, "$", issues);
|
|
@@ -653,6 +653,13 @@ function validateModesField(raw, key, pathPrefix, issues) {
|
|
|
653
653
|
validateUnknownKeys(modeObj, MODE_KEYS, modePath, issues);
|
|
654
654
|
validateStringField(modeObj, "$schema", modePath, issues);
|
|
655
655
|
validateInputField(modeObj, "input", modePath, issues);
|
|
656
|
+
if ("default" in modeObj && typeof modeObj.default != "boolean") {
|
|
657
|
+
issues.push({
|
|
658
|
+
path: `${modePath}.default`,
|
|
659
|
+
message: "must be a boolean",
|
|
660
|
+
fix: 'set "default" to true or false',
|
|
661
|
+
});
|
|
662
|
+
}
|
|
656
663
|
validateOutputField(modeObj, "output", modePath, issues);
|
|
657
664
|
validateStringField(modeObj, "outDir", modePath, issues);
|
|
658
665
|
validateStringField(modeObj, "logs", modePath, issues);
|
|
@@ -799,6 +806,9 @@ function parseModes(raw, configDir) {
|
|
|
799
806
|
}
|
|
800
807
|
if (!value || typeof value != "object" || Array.isArray(value))
|
|
801
808
|
continue;
|
|
809
|
+
mode.default =
|
|
810
|
+
!("default" in value) ||
|
|
811
|
+
Boolean(value.default);
|
|
802
812
|
mode.config = parseConfigRaw(value, join(configDir, `__mode__.${name}.json`));
|
|
803
813
|
out[name] = mode;
|
|
804
814
|
}
|
|
@@ -1172,6 +1182,11 @@ export function resolveModeNames(rawArgs) {
|
|
|
1172
1182
|
}
|
|
1173
1183
|
return [...new Set(names)];
|
|
1174
1184
|
}
|
|
1185
|
+
export function getDefaultModeNames(config) {
|
|
1186
|
+
return Object.entries(config.modes)
|
|
1187
|
+
.filter(([, mode]) => mode.default !== false)
|
|
1188
|
+
.map(([name]) => name);
|
|
1189
|
+
}
|
|
1175
1190
|
function appendModeTokens(out, value) {
|
|
1176
1191
|
for (const token of value.split(",")) {
|
|
1177
1192
|
const mode = token.trim();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function instantiate(imports: WebAssembly.Imports): Promise<WebAssembly.Instance>;
|