@metasession.co/devaudit-cli 0.1.12 → 0.1.13

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.12"};
57
+ version: "0.1.13"};
58
58
 
59
59
  // src/lib/version.ts
60
60
  var CLI_VERSION = package_default.version;
@@ -2383,8 +2383,18 @@ async function main(argv) {
2383
2383
  ...globals.yes !== void 0 ? { yes: Boolean(globals.yes) } : {}
2384
2384
  });
2385
2385
  });
2386
- program.command("update <version> <paths...>").description("Sync framework templates into existing consumer(s) (native TS implementation)").action(async (version, paths2) => {
2387
- await runUpdate({ version, paths: paths2 });
2386
+ program.command("update [version] [paths...]").description(
2387
+ "Sync framework templates into existing consumer(s). Both args are optional: paths default to the current directory, and version is a cosmetic label (defaults to the running CLI version). So a bare `devaudit update` syncs the current project."
2388
+ ).action(async (version, paths2) => {
2389
+ let resolvedVersion = version;
2390
+ let resolvedPaths = paths2 ?? [];
2391
+ const looksLikeVersion = (s) => /^v?\d+(\.\d+)/.test(s);
2392
+ if (resolvedVersion && resolvedPaths.length === 0 && !looksLikeVersion(resolvedVersion)) {
2393
+ resolvedPaths = [resolvedVersion];
2394
+ resolvedVersion = void 0;
2395
+ }
2396
+ if (resolvedPaths.length === 0) resolvedPaths = ["."];
2397
+ await runUpdate({ version: resolvedVersion ?? CLI_VERSION, paths: resolvedPaths });
2388
2398
  });
2389
2399
  program.command("push <project-slug> <requirement-id> <evidence-type> <file>").description("Upload evidence file(s) to DevAudit (port of scripts/upload-evidence.sh)").option("--release <version>", "release version (e.g. v1.0.0)").option("--create-release-if-missing", "auto-create the release as 'draft' if absent").option("--environment <env>", "uat | production").option("--category <cat>", "ci_pipeline | local_dev | planning | test_report | security_scan | release_artifact").option("--git-sha <sha>", "attached to metadata.gitSha").option("--ci-run-id <id>", "attached to metadata.ciRunId").option("--branch <name>", "attached to metadata.branch").option("--base-url <url>", "override portal URL (defaults to DEVAUDIT_BASE_URL env or production)").option("--api-key <key>", "override DEVAUDIT_API_KEY env var").action(
2390
2400
  async (projectSlug, requirementId, evidenceType, file, opts, cmd) => {