watskeburt 4.2.0 → 4.2.2
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 +8 -0
- package/dist/cli.js +5 -0
- package/dist/format/format.js +3 -1
- package/dist/parse-diff-lines.js +1 -2
- package/dist/parse-status-lines.js +1 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -83,9 +83,17 @@ Options:
|
|
83
83
|
-T, --outputType <type> what format to emit (choices: "json", "regex", default: "regex")
|
84
84
|
--trackedOnly only take tracked files into account (default: false)
|
85
85
|
-V, --version output the version number
|
86
|
+
-e, --extensions <list> comma separated list of file extensions to consider
|
87
|
+
- pass "*" to consider all extensions
|
88
|
+
- currently applicable only to the "regex" reporter
|
89
|
+
- defaults to to most popular extensions in the
|
90
|
+
JavaScript/ TypeScript ecosystem
|
86
91
|
-h, --help display help for command
|
87
92
|
```
|
88
93
|
|
94
|
+
Default list of extensions (cli, regex reporter only):
|
95
|
+
`"cjs, cjsx, coffee, csx, cts, js, json, jsx, litcoffee, ls, mjs, mts, svelte, ts, tsx, vue, vuex"`.
|
96
|
+
|
89
97
|
## why?
|
90
98
|
|
91
99
|
I needed something robust to support caching in
|
package/dist/cli.js
CHANGED
@@ -11,6 +11,11 @@ lists files & their statuses since [old-revision] or between [old-revision] and
|
|
11
11
|
Options:
|
12
12
|
-T, --outputType <type> what format to emit (choices: "json", "regex", default: "regex")
|
13
13
|
--trackedOnly only take tracked files into account (default: false)
|
14
|
+
-e, --extensions <list> comma separated list of file extensions to consider
|
15
|
+
- pass "*" to consider all extensions
|
16
|
+
- currently applicable only to the "regex" reporter
|
17
|
+
- defaults to to most popular extensions in the
|
18
|
+
JavaScript/ TypeScript ecosystem
|
14
19
|
-V, --version output the version number
|
15
20
|
-h, --help display help for command${EOL}`;
|
16
21
|
export async function cli(
|
package/dist/format/format.js
CHANGED
@@ -6,7 +6,9 @@ const OUTPUT_TYPE_TO_FUNCTION = new Map([
|
|
6
6
|
]);
|
7
7
|
export function format(pChanges, pOutputType, pExtensions) {
|
8
8
|
const lExtensions = new Set(
|
9
|
-
pExtensions
|
9
|
+
(pExtensions ?? "*")
|
10
|
+
.split(",")
|
11
|
+
.map((pExtension) => `.${pExtension.trim()}`),
|
10
12
|
);
|
11
13
|
return OUTPUT_TYPE_TO_FUNCTION.get(pOutputType)(pChanges, lExtensions);
|
12
14
|
}
|
package/dist/parse-diff-lines.js
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
import { EOL } from "node:os";
|
2
1
|
import { mapChangeType } from "./map-change-type.js";
|
3
2
|
const DIFF_NAME_STATUS_LINE_PATTERN =
|
4
3
|
/^(?<type>[ACDMRTUXB])(?<similarity>\d{3})?[ \t]+(?<name>[^ \t]+)[ \t]*(?<newName>[^ \t]+)?$/;
|
5
4
|
export function parseDiffLines(pString) {
|
6
5
|
return pString
|
7
|
-
.split(
|
6
|
+
.split(/\r?\n/)
|
8
7
|
.filter(Boolean)
|
9
8
|
.map(parseDiffLine)
|
10
9
|
.filter(({ name, type }) => Boolean(name) && Boolean(type));
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import { EOL } from "node:os";
|
2
1
|
import { mapChangeType } from "./map-change-type.js";
|
3
2
|
const DIFF_SHORT_STATUS_LINE_PATTERN =
|
4
3
|
/^(?<stagedType>[ ACDMRTUXB?!])(?<unStagedType>[ ACDMRTUXB?!])[ \t]+(?<name>[^ \t]+)(( -> )(?<newName>[^ \t]+))?$/;
|
5
4
|
export function parseStatusLines(pString) {
|
6
5
|
return pString
|
7
|
-
.split(
|
6
|
+
.split(/\r?\n/)
|
8
7
|
.filter(Boolean)
|
9
8
|
.map(parseStatusLine)
|
10
9
|
.filter(({ name, type }) => Boolean(name) && Boolean(type));
|
package/dist/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = "4.2.
|
1
|
+
export const VERSION = "4.2.2";
|