flagshark 1.5.0 → 2.1.0

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/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  **Find stale feature flags in your codebase.** Polyglot CLI + GitHub Action. 13 languages, 13 providers, zero config.
4
4
 
5
+ 📚 **CLI documentation: [flagshark.com/docs/getting-started/cli](https://flagshark.com/docs/getting-started/cli/)**
6
+
5
7
  ```bash
6
8
  npx flagshark scan
7
9
  ```
@@ -50,7 +52,7 @@ flagshark scan [options]
50
52
 
51
53
  Scan options:
52
54
  --diff <ref> Only scan files changed since this git ref (e.g. main, HEAD~1)
53
- --threshold <months> Staleness age threshold (default: 6, or config.threshold)
55
+ --threshold <days> Staleness age threshold (default: 30, or config.threshold)
54
56
  --verbose Show all stale flags + effective exclude rules
55
57
 
56
58
  Output:
@@ -66,14 +68,14 @@ Configuration:
66
68
  Example invocations:
67
69
 
68
70
  ```bash
69
- # Scan current directory, default 6-month threshold
71
+ # Scan current directory, default 30-day threshold
70
72
  flagshark scan
71
73
 
72
74
  # Scan only files changed since main
73
75
  flagshark scan --diff main
74
76
 
75
77
  # Stricter threshold + JSON for piping
76
- flagshark scan --threshold 3 --json | jq '.staleFlags'
78
+ flagshark scan --threshold 7 --json | jq '.staleFlags'
77
79
 
78
80
  # Use a custom config file
79
81
  flagshark scan --config ./tooling/flagshark.yml
@@ -106,7 +108,7 @@ examples/
106
108
  ### `.flagshark.yml` — full config
107
109
 
108
110
  ```yaml
109
- threshold: 6
111
+ threshold: 30
110
112
 
111
113
  excludes:
112
114
  paths:
@@ -124,9 +126,9 @@ suppress:
124
126
 
125
127
  paths: # Per-path threshold overrides
126
128
  - match: 'src/critical/**'
127
- threshold: 3
129
+ threshold: 90 # stricter for critical code (days)
128
130
  - match: 'src/experimental/**'
129
- threshold: 12
131
+ threshold: 365 # looser for experiments (days)
130
132
  ```
131
133
 
132
134
  The unconditional baseline — `node_modules`, `.git`, `dist`, `build`, `coverage`, `__pycache__`, `vendor`, `.next`, `.turbo` — is always skipped.
@@ -173,7 +175,7 @@ Building a tool on top of the engine? Use [`@flagshark/core`](https://www.npmjs.
173
175
  ```ts
174
176
  import { scanRepo } from '@flagshark/core'
175
177
 
176
- const result = await scanRepo({ cwd: process.cwd(), threshold: 6 })
178
+ const result = await scanRepo({ cwd: process.cwd(), threshold: 30 })
177
179
  console.log(`${result.staleFlags.length} stale of ${result.totalFlags}`)
178
180
  ```
179
181
 
package/dist/cli.js CHANGED
@@ -14,7 +14,7 @@ flagshark scan [options]
14
14
  Options:
15
15
  --json Output as JSON
16
16
  --diff <ref> Only scan files changed since <ref> (e.g., HEAD~1, main)
17
- --threshold <n> Staleness threshold in months (default: 6)
17
+ --threshold <n> Staleness threshold in days (default: 30)
18
18
  --verbose Show all stale flags (not just top 10)
19
19
  --help Show help
20
20
  --version Show version
@@ -82,7 +82,7 @@ function parseArgs(argv) {
82
82
  i++;
83
83
  args.threshold = parseInt(argv[i], 10);
84
84
  if (isNaN(args.threshold) || args.threshold < 1) {
85
- throw new Error("--threshold requires a positive integer (months)");
85
+ throw new Error("--threshold requires a positive integer (days)");
86
86
  }
87
87
  break;
88
88
  case "--verbose":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flagshark",
3
- "version": "1.5.0",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "description": "Find stale feature flags in your codebase",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  "typecheck": "tsc --noEmit"
24
24
  },
25
25
  "dependencies": {
26
- "@flagshark/core": "1.5.0",
26
+ "@flagshark/core": "2.0.0",
27
27
  "yaml": "^2.4.0",
28
28
  "zod": "^3.23.0"
29
29
  },