@shipi18n/cli 2.5.0 → 2.5.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @shipi18n/cli
2
2
 
3
+ ## 2.5.1
4
+
5
+ - New: every check finding now links to its rule page. The human reporter prints
6
+ `<rule> → https://shipi18n.com/docs/rules/<rule>` for each finding type seen, and the SARIF
7
+ reporter sets a per-rule `helpUri` — so GitHub's inline PR annotations link to the page that
8
+ explains the rule, what triggers it, how to fix it, and how to silence it.
9
+
3
10
  ## 2.5.0
4
11
 
5
12
  - New: `--base-url <url>` on `translate` and `check` — run against any OpenAI-compatible endpoint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipi18n/cli",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "Catch broken translations before you ship: dropped placeholders, missing keys, collapsed plurals and — with your own LLM key — mistranslations the structure checks cannot see. CI-ready (SARIF, JUnit, exit codes). Translates too.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,7 +31,12 @@
31
31
  "openai",
32
32
  "anthropic",
33
33
  "localization",
34
- "bring-your-own-key"
34
+ "bring-your-own-key",
35
+ "linter",
36
+ "icu",
37
+ "i18next",
38
+ "l10n",
39
+ "check"
35
40
  ],
36
41
  "license": "Apache-2.0",
37
42
  "author": "Shipi18n",
package/src/reporters.js CHANGED
@@ -6,6 +6,10 @@
6
6
  */
7
7
  import chalk from 'chalk'
8
8
 
9
+ /** Every rule has a documentation page; SARIF helpUri and the human footer
10
+ * point at it. Ids must match RULE_META below and the site's checkRules.js. */
11
+ const ruleUrl = (type) => `https://shipi18n.com/docs/rules/${type}`
12
+
9
13
  /* ------------------------------------------------------------------ human */
10
14
 
11
15
  export function humanReport(result, verdictResult) {
@@ -28,6 +32,13 @@ export function humanReport(result, verdictResult) {
28
32
  }
29
33
  if (all.length > 50) lines.push(chalk.gray(` … and ${all.length - 50} more`))
30
34
  }
35
+ const seenTypes = [
36
+ ...new Set(result.languages.flatMap((l) => l.namespaces.flatMap((n) => n.findings.map((f) => f.type)))),
37
+ ].sort()
38
+ if (seenTypes.length > 0) {
39
+ lines.push('')
40
+ for (const t of seenTypes) lines.push(chalk.gray(` ${t} → ${ruleUrl(t)}`))
41
+ }
31
42
  lines.push('')
32
43
  lines.push(
33
44
  verdictResult.ok
@@ -94,7 +105,7 @@ export function sarifReport(result, _verdictResult, { toolVersion = '0.0.0' } =
94
105
  rules: usedTypes.map((t) => ({
95
106
  id: t,
96
107
  shortDescription: { text: RULE_META[t] || t },
97
- helpUri: 'https://shipi18n.com/docs/cli/commands',
108
+ helpUri: ruleUrl(t),
98
109
  })),
99
110
  },
100
111
  },