@devasign/verify 1.2.0 → 1.3.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.
Files changed (2) hide show
  1. package/dist/cli.js +17 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -7422,6 +7422,15 @@ function readText(root, rel) {
7422
7422
  return null;
7423
7423
  }
7424
7424
  }
7425
+ function manifestNames(text) {
7426
+ if (!text) return [];
7427
+ try {
7428
+ const j = JSON.parse(text);
7429
+ return [...Object.keys(j?.dependencies || {}), ...Object.keys(j?.devDependencies || {}), ...typeof j?.name === "string" ? [j.name] : []];
7430
+ } catch {
7431
+ return [];
7432
+ }
7433
+ }
7425
7434
  function envVarNames(text) {
7426
7435
  if (!text) return [];
7427
7436
  const out = /* @__PURE__ */ new Set();
@@ -7463,6 +7472,11 @@ async function detectSetup(root, opts = {}) {
7463
7472
  }
7464
7473
  const deps = { ...pkg?.dependencies || {}, ...pkg?.devDependencies || {} };
7465
7474
  const dep = (name) => name in deps ? String(deps[name]).replace(/^[\^~>=<\s]+/, "") : void 0;
7475
+ const dependencies = pkg ? [
7476
+ ...new Set(
7477
+ paths.filter((p) => /^[^/]+\/[^/]+\/package\.json$/.test(p)).reduce((acc, p) => acc.concat(manifestNames(readText(root, p))), Object.keys(deps))
7478
+ )
7479
+ ].sort() : void 0;
7466
7480
  const langCounts = /* @__PURE__ */ new Map();
7467
7481
  for (const p of paths) {
7468
7482
  const lang = LANG_BY_EXT[p.split(".").pop()?.toLowerCase() || ""];
@@ -7509,6 +7523,7 @@ async function detectSetup(root, opts = {}) {
7509
7523
  packageManager,
7510
7524
  monorepo,
7511
7525
  frameworks,
7526
+ dependencies,
7512
7527
  testCommands,
7513
7528
  envExampleVars: envVars,
7514
7529
  existingWorkflows: paths.filter((p) => /^\.github\/workflows\/[^/]+\.ya?ml$/.test(p)),
@@ -7852,7 +7867,7 @@ var ASSERTION = {
7852
7867
  go: /^--- FAIL\b|^FAIL\b/m,
7853
7868
  playwright: /expect\(|Timed out .* expect|toBeVisible|toHaveText|toContainText|toHaveURL|toBeChecked|toHaveValue|toHaveCount|Expected:|Received:/m
7854
7869
  };
7855
- var INFRA = /Cannot find module|ERR_MODULE_NOT_FOUND|MODULE_NOT_FOUND|SyntaxError|ImportError|ModuleNotFoundError|command not found|ENOENT|no test files|no tests found|No tests found|collected 0 items|\[build failed\]|Executable doesn't exist|browserType\.launch|net::ERR_|ECONNREFUSED|Process from config\.webServer|Timed out waiting .* from config\.webServer/i;
7870
+ var INFRA = /Cannot find module|Cannot find package|Failed to load url|Failed to resolve import|ERR_MODULE_NOT_FOUND|MODULE_NOT_FOUND|ERR_PACKAGE_PATH_NOT_EXPORTED|SyntaxError|ImportError|ModuleNotFoundError|command not found|ENOENT|no test files|no tests found|No tests found|collected 0 items|\[build failed\]|Executable doesn't exist|browserType\.launch|net::ERR_|ECONNREFUSED|Process from config\.webServer|Timed out waiting .* from config\.webServer/i;
7856
7871
  function classifyAttempt(runner, r) {
7857
7872
  r = { ...r, output: (r.output || "").replace(/\u001b\[[0-9;]*m/g, "") };
7858
7873
  if (r.spawnError) return { status: "error", error: `could not start test runner: ${r.spawnError}` };
@@ -8016,7 +8031,7 @@ async function runFileTests(args) {
8016
8031
  log.info(`attempt ${n}/${max}: ${c.status}${c.error ? ` \u2014 ${c.error}` : ""}`);
8017
8032
  if (c.status === "pass" && n === 1) break;
8018
8033
  if (c.status === "pass" && n > 1) break;
8019
- if (c.status === "error" && max > 1 && n === 1 && /could not start|ENOENT|Cannot find module/.test(c.error || "")) break;
8034
+ if (c.status === "error" && max > 1 && n === 1 && /could not start|ENOENT|Cannot find module|Cannot find package|Failed to (?:load url|resolve import)/.test(c.error || "")) break;
8020
8035
  }
8021
8036
  log.endGroup();
8022
8037
  const status = aggregateAttempts(attempts.map((a) => a.status));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devasign/verify",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Runs DevAsign's generated acceptance tests inside your CI and reports per-criterion evidence.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "type": "module",