@metasession.co/devaudit-cli 0.1.10 → 0.1.12

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/index.js CHANGED
@@ -54,7 +54,7 @@ function emitJsonResult(payload) {
54
54
 
55
55
  // package.json
56
56
  var package_default = {
57
- version: "0.1.10"};
57
+ version: "0.1.12"};
58
58
 
59
59
  // src/lib/version.ts
60
60
  var CLI_VERSION = package_default.version;
@@ -1137,6 +1137,9 @@ async function writeSdlcConfig(ctx, plan) {
1137
1137
  build_env: {},
1138
1138
  e2e_project: "",
1139
1139
  e2e_start_command: "",
1140
+ e2e_seed_command: "",
1141
+ e2e_projects: [],
1142
+ e2e_env: {},
1140
1143
  paths_ignore: pathsIgnore,
1141
1144
  uat: { enabled: false, url: "", required_risk_classes: ["payment", "destructive_migration", "realtime"] },
1142
1145
  approval: { mode: "dual_actor", auto_low_risk_threshold: "LOW" },
@@ -1745,6 +1748,39 @@ function indentEnvBlock(env, indent) {
1745
1748
  const pad = " ".repeat(indent);
1746
1749
  return Object.entries(env).map(([k, v]) => `${pad}${k}: ${v}`).join("\n");
1747
1750
  }
1751
+ function buildAuthenticatedE2eStep(cfg) {
1752
+ const projects = cfg.e2e_projects ?? [];
1753
+ const seed = (cfg.e2e_seed_command ?? "").trim();
1754
+ if (projects.length === 0 && !seed) return "";
1755
+ const env = cfg.e2e_env ?? {};
1756
+ const envBlock = Object.keys(env).length > 0 ? indentEnvBlock({ ...env }, 10) : "";
1757
+ const lines = [];
1758
+ if (seed) {
1759
+ lines.push(
1760
+ "",
1761
+ " - name: Seed E2E test data (report-only)",
1762
+ " if: always()",
1763
+ " continue-on-error: true"
1764
+ );
1765
+ if (envBlock) lines.push(" env:", envBlock);
1766
+ lines.push(` run: ${seed}`);
1767
+ }
1768
+ if (projects.length > 0) {
1769
+ const flags = projects.map((p) => `--project=${p}`).join(" ");
1770
+ lines.push(
1771
+ "",
1772
+ " - name: Authenticated E2E (report-only)",
1773
+ " if: always()",
1774
+ " continue-on-error: true",
1775
+ " env:",
1776
+ " PLAYWRIGHT_HTML_REPORTER_OPEN: never",
1777
+ " PLAYWRIGHT_JSON_OUTPUT_NAME: e2e-auth-results.json"
1778
+ );
1779
+ if (envBlock) lines.push(envBlock);
1780
+ lines.push(` run: npx playwright test ${flags} --reporter=json,html`);
1781
+ }
1782
+ return lines.join("\n");
1783
+ }
1748
1784
  function buildDbUriStep(dbService, dbPort) {
1749
1785
  if (dbService !== "mongodb") return "";
1750
1786
  return [
@@ -1795,7 +1831,8 @@ async function syncCiTemplates(ctx) {
1795
1831
  DATABASE_ENV: cfg.database_env ? indentEnvBlock({ ...cfg.database_env }, 6) : "",
1796
1832
  APP_ENV: cfg.app_env ? indentEnvBlock({ ...cfg.app_env }, 6) : "",
1797
1833
  BUILD_ENV: cfg.build_env ? indentEnvBlock({ ...cfg.build_env }, 10) : "",
1798
- DATABASE_URI_STEP: buildDbUriStep(cfg.database_service, cfg.database_port)
1834
+ DATABASE_URI_STEP: buildDbUriStep(cfg.database_service, cfg.database_port),
1835
+ E2E_AUTHENTICATED_STEP: buildAuthenticatedE2eStep(cfg)
1799
1836
  };
1800
1837
  let count = 0;
1801
1838
  for (const tmpl of CI_TEMPLATES) {