@alimaandev/ripple 0.3.0 → 0.4.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 +12 -3
- package/dist/bin.js +6 -5
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-OOERV74D.js → chunk-LDCFNORX.js} +12 -3
- package/dist/chunk-LDCFNORX.js.map +1 -0
- package/dist/index.d.ts +43 -27
- package/dist/index.js +1 -1
- package/package.json +5 -2
- package/dist/chunk-OOERV74D.js.map +0 -1
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ Everything below is real output against a shipped example project in `tests/fixt
|
|
|
97
97
|
```bash
|
|
98
98
|
npm install -g @alimaandev/ripple
|
|
99
99
|
|
|
100
|
-
ripple version # → 0.
|
|
100
|
+
ripple version # → 0.4.0
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
Or install from source:
|
|
@@ -229,8 +229,8 @@ ripple <command> [options]
|
|
|
229
229
|
| `doctor` | `--no-color` | Disable ANSI colors |
|
|
230
230
|
| `init` | `-f, --force` | Overwrite an existing config |
|
|
231
231
|
| `diff` | `-j, --json` | Emit the JSON report instead of the terminal report |
|
|
232
|
-
| `diff` | `-b, --base <ref>` | Git ref to diff against (default: `origin/main`, `main`, `HEAD~1`) |
|
|
233
|
-
| `diff` | `-g, --gate <level>` | Blocking level: `medium`, `high`, or `critical` (default: `high`)
|
|
232
|
+
| `diff` | `-b, --base <ref>` | Git ref to diff against (default: `origin/main`, `main`, `HEAD~1`, or `diff.base` from config) |
|
|
233
|
+
| `diff` | `-g, --gate <level>` | Blocking level: `medium`, `high`, or `critical` (default: `high`, or `diff.gate` from config) |
|
|
234
234
|
| `diff` | `-d, --depth <n>` | Cap reverse traversal per file |
|
|
235
235
|
| `diff` | `-c, --config <path>` | Use a specific config file |
|
|
236
236
|
| `diff` | `--no-color` | Disable ANSI colors |
|
|
@@ -321,6 +321,10 @@ defaults — every field is optional.
|
|
|
321
321
|
"cycleMembership": 0.1
|
|
322
322
|
},
|
|
323
323
|
"thresholds": { "medium": 30, "high": 55, "critical": 80 }
|
|
324
|
+
},
|
|
325
|
+
"diff": {
|
|
326
|
+
"base": "origin/main",
|
|
327
|
+
"gate": "high"
|
|
324
328
|
}
|
|
325
329
|
}
|
|
326
330
|
```
|
|
@@ -333,9 +337,14 @@ defaults — every field is optional.
|
|
|
333
337
|
| `tsconfigPath` | `tsconfig.json` | tsconfig to read for `paths` |
|
|
334
338
|
| `risk.weights` | see example | Risk signal weights |
|
|
335
339
|
| `risk.thresholds` | 30 / 55 / 80 | Score thresholds for MEDIUM / HIGH / CRITICAL |
|
|
340
|
+
| `diff.base` | `origin/main` → `main` → `HEAD~1` | Git ref to diff against when `--base` is not given |
|
|
341
|
+
| `diff.gate` | `high` | Blocking level when `--gate` is not given |
|
|
336
342
|
|
|
337
343
|
`node_modules` is always excluded, regardless of config.
|
|
338
344
|
|
|
345
|
+
The `diff` block sets command defaults only — `--base`/`--gate` flags always
|
|
346
|
+
win over the config file, which wins over the built-in defaults.
|
|
347
|
+
|
|
339
348
|
## Risk scoring
|
|
340
349
|
|
|
341
350
|
The score is a weighted sum of seven signals, normalized to 0–1. Affected
|
package/dist/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_CONFIG, rippleConfigSchema, formatSchemaIssues } from './chunk-
|
|
2
|
+
import { DEFAULT_CONFIG, rippleConfigSchema, formatSchemaIssues } from './chunk-LDCFNORX.js';
|
|
3
3
|
import { CommanderError, Command } from 'commander';
|
|
4
4
|
import { createJiti } from 'jiti';
|
|
5
5
|
import path8 from 'path';
|
|
@@ -1834,12 +1834,13 @@ function riskySummary(counts, gate) {
|
|
|
1834
1834
|
async function diffCommand(options, ctx2) {
|
|
1835
1835
|
const style = { color: resolveColor(options.color) };
|
|
1836
1836
|
const tracker = createStageTracker(!options.json);
|
|
1837
|
-
const gate = options.gate ?? "high";
|
|
1838
1837
|
const started = Date.now();
|
|
1838
|
+
const context = await loadProjectContext(ctx2.cwd, options.config);
|
|
1839
|
+
const gate = options.gate ?? context.config.diff.gate ?? "high";
|
|
1840
|
+
const base = options.base ?? context.config.diff.base;
|
|
1839
1841
|
tracker.next("Resolving git changes");
|
|
1840
|
-
const changed = changedFiles(ctx2.cwd,
|
|
1842
|
+
const changed = changedFiles(ctx2.cwd, base);
|
|
1841
1843
|
tracker.next("Analyzing changed files");
|
|
1842
|
-
const context = await loadProjectContext(ctx2.cwd, options.config);
|
|
1843
1844
|
const { graph, entryPoints } = await runPipeline(context);
|
|
1844
1845
|
const byRel = /* @__PURE__ */ new Map();
|
|
1845
1846
|
const skipped = [];
|
|
@@ -2125,7 +2126,7 @@ async function run({ argv, ctx: ctx2 }) {
|
|
|
2125
2126
|
|
|
2126
2127
|
// package.json
|
|
2127
2128
|
var package_default = {
|
|
2128
|
-
version: "0.
|
|
2129
|
+
version: "0.4.0"};
|
|
2129
2130
|
|
|
2130
2131
|
// src/cli/bin.ts
|
|
2131
2132
|
var ctx = {
|