forged-cli 0.4.1 → 0.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forged-cli",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "A complete dev environment toolkit — shell, workflows, and project scaffolding in one install.",
5
5
  "keywords": [
6
6
  "cli",
@@ -122,6 +122,13 @@ export async function scanCommand(cwd = process.cwd(), opts = {}) {
122
122
 
123
123
  // 1. Parse package.json
124
124
  const { deps, scripts, error, name: pkgName, version: pkgVersion } = checkPackageJson(cwd);
125
+
126
+ // Not a Node project: nothing to scan. Return before writing the scan
127
+ // cache, so the dotfiles badge keeps the last real result.
128
+ if (!existsSync(join(cwd, 'package.json'))) {
129
+ console.log(`${yellow}ℹ No package.json here — not a Node project, nothing to scan.${reset}\n`);
130
+ return null;
131
+ }
125
132
  if (error) findings.errors.push({ message: error });
126
133
 
127
134
  // 2. Dangerous scripts
@@ -258,7 +265,10 @@ export async function scanCommand(cwd = process.cwd(), opts = {}) {
258
265
  writeFileSync(
259
266
  join(homedir(), '.forged-scan-cache.json'),
260
267
  JSON.stringify({
261
- safe: findings.errors.length === 0 && findings.warnings.length === 0,
268
+ // safe = no errors; warnings (e.g. a very fresh release) are advisory
269
+ safe: findings.errors.length === 0,
270
+ errors: findings.errors.length,
271
+ warnings: findings.warnings.length,
262
272
  packages: packagesVerified,
263
273
  flagged,
264
274
  checked_at: new Date().toISOString(),