@repometry/cli 0.2.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.
Files changed (88) hide show
  1. package/README.md +5 -2
  2. package/package.json +2 -2
  3. package/target/main/resources/language-catalog.json +54 -0
  4. package/target/main/resources/licenses/spdx.json +746 -0
  5. package/target/main/resources/report/json/config-v2.schema.json +2 -1
  6. package/target/main/resources/report/json/file-metrics-v1.schema.json +2 -0
  7. package/target/main/resources/report/json/report-v2.schema.json +6 -3
  8. package/target/main/resources/report/json/repository-summary-v1.schema.json +14 -0
  9. package/target/main/resources/viewer/index.html +4 -0
  10. package/target/main/resources/viewer/styles.css +7 -2
  11. package/target/main/ts/api/git/git.d.ts +2 -1
  12. package/target/main/ts/api/git/git.js +4 -4
  13. package/target/main/ts/api/git/inspection-source.js +2 -2
  14. package/target/main/ts/api/git/local.d.ts +1 -1
  15. package/target/main/ts/api/git/local.js +5 -4
  16. package/target/main/ts/api/import/finding-import.js +2 -9
  17. package/target/main/ts/api/import/license-import.d.ts +2 -0
  18. package/target/main/ts/api/import/license-import.js +36 -0
  19. package/target/main/ts/api/import/repository-path.d.ts +1 -0
  20. package/target/main/ts/api/import/repository-path.js +10 -0
  21. package/target/main/ts/cli/imports.d.ts +2 -0
  22. package/target/main/ts/cli/imports.js +6 -2
  23. package/target/main/ts/cli/run.js +10 -4
  24. package/target/main/ts/compose/analysis-report.js +5 -2
  25. package/target/main/ts/compose/analysis-results.d.ts +3 -2
  26. package/target/main/ts/compose/analysis-results.js +15 -6
  27. package/target/main/ts/compose/analysis-steps.js +3 -0
  28. package/target/main/ts/compose/analyze-snapshot.d.ts +1 -1
  29. package/target/main/ts/compose/analyze-snapshot.js +7 -4
  30. package/target/main/ts/compose/built-ins.d.ts +2 -2
  31. package/target/main/ts/compose/built-ins.js +2 -2
  32. package/target/main/ts/compose/inspect.d.ts +2 -0
  33. package/target/main/ts/compose/inspect.js +7 -4
  34. package/target/main/ts/compose/language-discovery.js +3 -1
  35. package/target/main/ts/compose/load-plugins.js +4 -2
  36. package/target/main/ts/compose/phases.d.ts +7 -3
  37. package/target/main/ts/compose/phases.js +26 -10
  38. package/target/main/ts/plugins/built-in.d.ts +2 -0
  39. package/target/main/ts/plugins/built-in.js +4 -1
  40. package/target/main/ts/plugins/duplication/duplication.d.ts +1 -2
  41. package/target/main/ts/plugins/duplication/duplication.js +18 -17
  42. package/target/main/ts/plugins/json-spans.d.ts +11 -0
  43. package/target/main/ts/plugins/json-spans.js +86 -0
  44. package/target/main/ts/plugins/language-js/babel-provider.d.ts +34 -2
  45. package/target/main/ts/plugins/language-js/babel-provider.js +39 -35
  46. package/target/main/ts/plugins/language-js/js-security.d.ts +17 -2
  47. package/target/main/ts/plugins/language-js/js-security.js +24 -23
  48. package/target/main/ts/plugins/language-js/structural-observations.d.ts +2 -1
  49. package/target/main/ts/plugins/language-js/structural-observations.js +2 -2
  50. package/target/main/ts/plugins/legal/composer-lock.d.ts +2 -0
  51. package/target/main/ts/plugins/legal/composer-lock.js +24 -0
  52. package/target/main/ts/plugins/legal/dependencies.d.ts +73 -0
  53. package/target/main/ts/plugins/legal/dependencies.js +27 -0
  54. package/target/main/ts/plugins/legal/licenses.d.ts +19 -0
  55. package/target/main/ts/plugins/legal/licenses.js +112 -0
  56. package/target/main/ts/plugins/legal/npm-lock.d.ts +3 -0
  57. package/target/main/ts/plugins/legal/npm-lock.js +30 -0
  58. package/target/main/ts/plugins/legal/policy.d.ts +72 -0
  59. package/target/main/ts/plugins/legal/policy.js +149 -0
  60. package/target/main/ts/plugins/legal/sbom.d.ts +3 -0
  61. package/target/main/ts/plugins/legal/sbom.js +131 -0
  62. package/target/main/ts/plugins/legal/unverified-lock.d.ts +1 -0
  63. package/target/main/ts/plugins/legal/unverified-lock.js +21 -0
  64. package/target/main/ts/plugins/maintainability/maintainability.d.ts +1 -2
  65. package/target/main/ts/plugins/maintainability/maintainability.js +34 -33
  66. package/target/main/ts/plugins/maintainability/structural-smells.d.ts +1 -2
  67. package/target/main/ts/plugins/maintainability/structural-smells.js +5 -5
  68. package/target/main/ts/plugins/security/actions-security.d.ts +17 -2
  69. package/target/main/ts/plugins/security/actions-security.js +21 -16
  70. package/target/main/ts/plugins/security/dockerfile.d.ts +17 -2
  71. package/target/main/ts/plugins/security/dockerfile.js +23 -18
  72. package/target/main/ts/plugins/security/npm-supply-chain.d.ts +17 -2
  73. package/target/main/ts/plugins/security/npm-supply-chain.js +32 -110
  74. package/target/main/ts/plugins/security/secrets.d.ts +18 -6
  75. package/target/main/ts/plugins/security/secrets.js +27 -23
  76. package/target/main/ts/plugins/source/forges.js +25 -32
  77. package/target/main/ts/report/html/app/viewer-issue-group.js +1 -1
  78. package/target/main/ts/report/html/app/viewer-metric-registry.js +1 -1
  79. package/target/main/ts/report/html/app/viewer-metrics.d.ts +2 -1
  80. package/target/main/ts/report/html/app/viewer-metrics.js +7 -2
  81. package/target/main/ts/report/html/app/viewer-overview-cards.d.ts +1 -0
  82. package/target/main/ts/report/html/app/viewer-overview-cards.js +20 -1
  83. package/target/main/ts/report/html/app/viewer-overview-lead.js +4 -1
  84. package/target/main/ts/report/html/app/viewer-shell.js +3 -1
  85. package/target/main/ts/report/html/app/viewer-tokenizer.js +37 -9
  86. package/target/main/ts/report/html/app/viewer-trend-data.js +1 -0
  87. package/target/main/ts/report/html/app/viewer.js +5 -2
  88. package/target/main/ts/report/json/validation/report.js +2 -2
package/README.md CHANGED
@@ -15,6 +15,9 @@
15
15
 
16
16
  Git can serve as a project’s single source of truth for code, tests, docs, and CI configuration. Repometry lets you keep coverage and maintainability metrics alongside your code, commit by commit.
17
17
 
18
+ Repometry checks dependency licenses from npm and Composer lockfiles or an imported SBOM.
19
+ Configure a policy and record package exceptions. [License checks](docs/cli.md#license-checks)
20
+
18
21
  ## Demo
19
22
  [https://idleware.github.io/repometry/](https://idleware.github.io/repometry/)
20
23
 
@@ -22,7 +25,7 @@ Git can serve as a project’s single source of truth for code, tests, docs, and
22
25
 
23
26
  Node.js >=24
24
27
 
25
- Repometry analyses JavaScript, TypeScript, Go, Python, Java and PHP with no extra tools. Ruby, Kotlin, HCL (Terraform), Lua, Scala, Elixir and Rust come with `@repometry/all` or as plugins. C#, C, C++ and Swift are separate plugins. See [Languages](docs/native-languages.md). Generating coverage uses your project's own test tools.
28
+ Repometry analyses JavaScript, TypeScript, Go, Python, Java and PHP with no extra tools. Ruby, Kotlin, HCL (Terraform), Lua, Scala, Elixir, Rust, R, Zig, OCaml and Perl come with `@repometry/all` or as plugins. C#, C, C++, Swift, Bash and Dart are separate plugins. See [Languages](docs/native-languages.md). Generating coverage uses your project's own test tools.
26
29
 
27
30
  ## Install
28
31
 
@@ -40,7 +43,7 @@ npm install --global repometry
40
43
  | --- | --- | --- | --- |
41
44
  | `@repometry/cli` | `repometry-cli` | JavaScript, TypeScript | about 8 MB |
42
45
  | `repometry` | `repometry` | The above, Go, Python, Java, PHP | about 15 MB |
43
- | `@repometry/all` | `repometry-all` | The above, Ruby, Kotlin, HCL, Lua, Scala, Elixir, Rust | about 28 MB |
46
+ | `@repometry/all` | `repometry-all` | The above, Ruby, Kotlin, HCL, Lua, Scala, Elixir, Rust, R, Zig, OCaml, Perl | about 33 MB |
44
47
 
45
48
  To add a language to `@repometry/cli`, install its `@repometry/language-*` package with your package manager and list it in `plugins`. Repometry never installs a plugin. See [Packages](docs/cli.md#packages).
46
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repometry/cli",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Track repository metrics without SaaS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -67,7 +67,7 @@
67
67
  "dependencies": {
68
68
  "@babel/parser": "7.29.15",
69
69
  "@babel/types": "7.29.15",
70
- "@repometry/core": "0.5.0",
70
+ "@repometry/core": "0.7.0",
71
71
  "ajv": "8.20.0",
72
72
  "semver": "7.8.6"
73
73
  },
@@ -1,4 +1,14 @@
1
1
  [
2
+ {
3
+ "language": "bash",
4
+ "label": "Bash",
5
+ "package": "@repometry/language-bash",
6
+ "experimental": true,
7
+ "extensions": [
8
+ ".sh",
9
+ ".bash"
10
+ ]
11
+ },
2
12
  {
3
13
  "language": "c",
4
14
  "label": "C",
@@ -30,6 +40,15 @@
30
40
  ".cs"
31
41
  ]
32
42
  },
43
+ {
44
+ "language": "dart",
45
+ "label": "Dart",
46
+ "package": "@repometry/language-dart",
47
+ "experimental": true,
48
+ "extensions": [
49
+ ".dart"
50
+ ]
51
+ },
33
52
  {
34
53
  "language": "elixir",
35
54
  "label": "Elixir",
@@ -82,6 +101,24 @@
82
101
  ".lua"
83
102
  ]
84
103
  },
104
+ {
105
+ "language": "ocaml",
106
+ "label": "OCaml",
107
+ "package": "@repometry/language-ocaml",
108
+ "extensions": [
109
+ ".ml",
110
+ ".mli"
111
+ ]
112
+ },
113
+ {
114
+ "language": "perl",
115
+ "label": "Perl",
116
+ "package": "@repometry/language-perl",
117
+ "extensions": [
118
+ ".pl",
119
+ ".pm"
120
+ ]
121
+ },
85
122
  {
86
123
  "language": "php",
87
124
  "label": "PHP",
@@ -98,6 +135,15 @@
98
135
  ".py"
99
136
  ]
100
137
  },
138
+ {
139
+ "language": "r",
140
+ "label": "R",
141
+ "package": "@repometry/language-r",
142
+ "extensions": [
143
+ ".r",
144
+ ".R"
145
+ ]
146
+ },
101
147
  {
102
148
  "language": "ruby",
103
149
  "label": "Ruby",
@@ -130,5 +176,13 @@
130
176
  "extensions": [
131
177
  ".swift"
132
178
  ]
179
+ },
180
+ {
181
+ "language": "zig",
182
+ "label": "Zig",
183
+ "package": "@repometry/language-zig",
184
+ "extensions": [
185
+ ".zig"
186
+ ]
133
187
  }
134
188
  ]