@ship-safe/cli 1.1.10 → 1.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.
Files changed (2) hide show
  1. package/dist/index.js +20 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -7,6 +7,9 @@ var __export = (target, all) => {
7
7
 
8
8
  // src/index.ts
9
9
  import { Command, InvalidArgumentError, Option } from "commander";
10
+ import { readFileSync as readFileSync6 } from "fs";
11
+ import { fileURLToPath } from "url";
12
+ import { dirname, join as join5 } from "path";
10
13
 
11
14
  // src/commands/scan.ts
12
15
  import { resolve as resolve2, join as join4 } from "path";
@@ -7277,7 +7280,7 @@ function formatSarifOutput(result) {
7277
7280
  tool: {
7278
7281
  driver: {
7279
7282
  name: "ShipSafe",
7280
- version: "0.1.0",
7283
+ version: "1.1.11",
7281
7284
  rules: result.findings.map((f) => ({
7282
7285
  id: f.ruleId,
7283
7286
  shortDescription: { text: f.title },
@@ -8076,6 +8079,21 @@ function initCommand() {
8076
8079
  }
8077
8080
 
8078
8081
  // src/index.ts
8082
+ function getVersion() {
8083
+ try {
8084
+ let dir = dirname(fileURLToPath(import.meta.url));
8085
+ for (let i = 0; i < 5; i++) {
8086
+ try {
8087
+ const pkg = JSON.parse(readFileSync6(join5(dir, "package.json"), "utf-8"));
8088
+ if (pkg.name === "@ship-safe/cli") return pkg.version;
8089
+ } catch {
8090
+ }
8091
+ dir = dirname(dir);
8092
+ }
8093
+ } catch {
8094
+ }
8095
+ return "1.1.11";
8096
+ }
8079
8097
  function validateApiUrl(value) {
8080
8098
  let parsed;
8081
8099
  try {
@@ -8089,7 +8107,7 @@ function validateApiUrl(value) {
8089
8107
  return value;
8090
8108
  }
8091
8109
  var program = new Command();
8092
- program.name("shipsafe").description("Security scanner for AI-generated code").version("0.1.0");
8110
+ program.name("shipsafe").description("Security scanner for AI-generated code").version(getVersion());
8093
8111
  program.command("scan").description("Scan a directory or file for security vulnerabilities").argument("[path]", "Path to scan", ".").addOption(
8094
8112
  new Option("-o, --output <format>", "Output format: table, json, sarif").choices(["table", "json", "sarif"]).default("table")
8095
8113
  ).addOption(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ship-safe/cli",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Security scanner for AI-generated code — find vulnerabilities before you ship",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -51,8 +51,8 @@
51
51
  "@types/node": "^22",
52
52
  "tsup": "^8",
53
53
  "typescript": "^5.7",
54
- "@shipsafe/scanner": "0.1.0",
55
- "@shipsafe/shared": "0.1.0"
54
+ "@shipsafe/shared": "0.1.0",
55
+ "@shipsafe/scanner": "0.1.0"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsup",