apex-auditor 0.2.9 → 0.3.3

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/dist/config.js CHANGED
@@ -25,8 +25,15 @@ function normaliseConfig(input, absolutePath) {
25
25
  const pages = pagesInput.map((page, index) => normalisePage(page, index, absolutePath));
26
26
  const baseUrl = maybeConfig.baseUrl.replace(/\/$/, "");
27
27
  const query = typeof maybeConfig.query === "string" ? maybeConfig.query : undefined;
28
+ const buildId = typeof maybeConfig.buildId === "string" && maybeConfig.buildId.length > 0 ? maybeConfig.buildId : undefined;
28
29
  const chromePort = typeof maybeConfig.chromePort === "number" ? maybeConfig.chromePort : undefined;
29
30
  const runs = typeof maybeConfig.runs === "number" && maybeConfig.runs > 0 ? maybeConfig.runs : undefined;
31
+ if (runs !== undefined && runs !== 1) {
32
+ throw new Error(`Invalid config at ${absolutePath}: runs must be 1 (multi-run mode is no longer supported)`);
33
+ }
34
+ const auditTimeoutMs = typeof maybeConfig.auditTimeoutMs === "number" && maybeConfig.auditTimeoutMs > 0
35
+ ? maybeConfig.auditTimeoutMs
36
+ : undefined;
30
37
  const rawLogLevel = maybeConfig.logLevel;
31
38
  const logLevel = rawLogLevel === "silent" || rawLogLevel === "error" || rawLogLevel === "info" || rawLogLevel === "verbose"
32
39
  ? rawLogLevel
@@ -44,17 +51,21 @@ function normaliseConfig(input, absolutePath) {
44
51
  ? rawParallel
45
52
  : undefined;
46
53
  const warmUp = typeof maybeConfig.warmUp === "boolean" ? maybeConfig.warmUp : undefined;
54
+ const incremental = typeof maybeConfig.incremental === "boolean" ? maybeConfig.incremental : undefined;
47
55
  const budgets = normaliseBudgets(maybeConfig.budgets, absolutePath);
48
56
  return {
49
57
  baseUrl,
50
58
  query,
59
+ buildId,
51
60
  chromePort,
52
61
  runs,
62
+ auditTimeoutMs,
53
63
  logLevel,
54
64
  throttlingMethod,
55
65
  cpuSlowdownMultiplier,
56
66
  parallel,
57
67
  warmUp,
68
+ incremental,
58
69
  pages,
59
70
  budgets,
60
71
  };