safelaunch 1.0.37 → 1.0.39

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/package.json +1 -1
  2. package/src/scan.js +6 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safelaunch",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "Backend Reliability Infrastructure - catch what breaks production before it breaks",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/scan.js CHANGED
@@ -128,12 +128,7 @@ const IMPACTS = {
128
128
  impact: "Known vulnerabilities exist that could be exploited. These should be fixed before deploying.",
129
129
  fix: "Run npm audit fix or check npm audit for manual fixes.",
130
130
  }),
131
- AUDIT_HIGH: (count) => ({
132
- title: `${count} high-severity vulnerability${count > 1 ? "ies" : "y"} in dependencies`,
133
- impact: "Known vulnerabilities exist that could be exploited. These should be fixed before deploying.",
134
- fix: "Run npm audit fix or check npm audit for manual fixes.",
135
- }),
136
- AUDIT_CRITICAL: (count) => ({
131
+ AUDIT_CRITICAL: (count) => ({
137
132
  title: `${count} critical vulnerability${count > 1 ? "ies" : "y"} in dependencies`,
138
133
  impact: "Known exploits exist for these packages. Shipping them puts your users and infrastructure at risk.",
139
134
  fix: "Run npm audit fix or check npm audit for manual fixes.",
@@ -177,8 +172,9 @@ function loadManifest(cwd) {
177
172
 
178
173
  function checkMissingEnvVars(cwd, envVars, manifest) {
179
174
  const issues = [];
180
- if (!manifest || !manifest.required) return issues;
181
- for (const name of manifest.required) {
175
+ if (!manifest || !manifest.envs) return issues;
176
+ for (const [name, meta] of Object.entries(manifest.envs)) {
177
+ if (!meta.required) continue;
182
178
  if (!(name in envVars) && !process.env[name]) {
183
179
  issues.push({ severity: "block", ...IMPACTS.MISSING_ENV_VAR(name) });
184
180
  }
@@ -252,7 +248,7 @@ function checkTypeScript(cwd) {
252
248
  const issues = [];
253
249
  if (!fileExists(path.join(cwd, "tsconfig.json"))) return issues;
254
250
  try {
255
- execSync("npx tsc --noEmit", { cwd, encoding: "utf8", stdio: ["pipe","pipe","pipe"] });
251
+ execSync("npx tsc --noEmit", { cwd, encoding: "utf8", stdio: ["pipe","pipe","pipe"], timeout: 30000 });
256
252
  } catch {
257
253
  issues.push({ severity: "block", ...IMPACTS.TS_ERRORS() });
258
254
  }
@@ -287,7 +283,7 @@ function checkNpmAudit(cwd) {
287
283
  const issues = [];
288
284
  if (!fileExists(path.join(cwd, "package.json"))) return issues;
289
285
  try {
290
- execSync("npm audit --json", { cwd, encoding: "utf8", stdio: ["pipe","pipe","pipe"] });
286
+ execSync("npm audit --json", { cwd, encoding: "utf8", stdio: ["pipe","pipe","pipe"], timeout: 15000 });
291
287
  } catch (e) {
292
288
  try {
293
289
  const data = JSON.parse(e.stdout || "");