watskeburt 0.11.3 → 0.11.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -1
- package/dist/esm/version.js +1 -1
- package/package.json +10 -10
- package/types/watskeburt.d.ts +62 -7
package/README.md
CHANGED
@@ -82,7 +82,8 @@ The array of changes this returns looks like this:
|
|
82
82
|
|
83
83
|
### :shell: cli
|
84
84
|
|
85
|
-
For now there's also a simple command line interface
|
85
|
+
For now there's also a simple command line interface (which works from node ^16.19 and
|
86
|
+
node >=18.11).
|
86
87
|
|
87
88
|
```shell
|
88
89
|
# list all JavaScript-ish files changed since main in a regular expression
|
package/dist/esm/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = "0.11.
|
1
|
+
export const VERSION = "0.11.5";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "watskeburt",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.5",
|
4
4
|
"description": "List files changed since a git revision",
|
5
5
|
"keywords": [
|
6
6
|
"git",
|
@@ -45,12 +45,12 @@
|
|
45
45
|
],
|
46
46
|
"devDependencies": {
|
47
47
|
"@types/mocha": "10.0.1",
|
48
|
-
"@types/node": "20.
|
49
|
-
"@typescript-eslint/eslint-plugin": "5.
|
50
|
-
"c8": "
|
51
|
-
"dependency-cruiser": "13.0.
|
52
|
-
"esbuild": "0.
|
53
|
-
"eslint": "8.
|
48
|
+
"@types/node": "20.3.1",
|
49
|
+
"@typescript-eslint/eslint-plugin": "5.60.0",
|
50
|
+
"c8": "8.0.0",
|
51
|
+
"dependency-cruiser": "13.0.3",
|
52
|
+
"esbuild": "0.18.5",
|
53
|
+
"eslint": "8.43.0",
|
54
54
|
"eslint-config-moving-meadow": "4.0.2",
|
55
55
|
"eslint-config-prettier": "8.8.0",
|
56
56
|
"eslint-plugin-budapestian": "5.0.1",
|
@@ -64,11 +64,11 @@
|
|
64
64
|
"npm-run-all": "4.1.5",
|
65
65
|
"prettier": "2.8.8",
|
66
66
|
"ts-node": "10.9.1",
|
67
|
-
"typescript": "5.
|
68
|
-
"upem": "
|
67
|
+
"typescript": "5.1.3",
|
68
|
+
"upem": "8.0.0"
|
69
69
|
},
|
70
70
|
"engines": {
|
71
|
-
"node": "^16.
|
71
|
+
"node": "^16.14||>=18"
|
72
72
|
},
|
73
73
|
"scripts": {
|
74
74
|
"build": "npm-run-all --sequential build:clean build:version build:dist",
|
package/types/watskeburt.d.ts
CHANGED
@@ -29,12 +29,12 @@ export interface IChange {
|
|
29
29
|
|
30
30
|
export type outputTypeType = "regex" | "json" | "object";
|
31
31
|
|
32
|
-
export interface
|
32
|
+
export interface IFormatOptions {
|
33
33
|
/**
|
34
34
|
* The type of output to deliver. Defaults to "object" - in which case
|
35
35
|
* the listSync function returns an IChange[] object
|
36
36
|
*/
|
37
|
-
outputType
|
37
|
+
outputType: "regex" | "json";
|
38
38
|
/**
|
39
39
|
* When true _only_ takes already tracked files into account.
|
40
40
|
* When false also takes untracked files into account.
|
@@ -44,6 +44,23 @@ export interface IOptions {
|
|
44
44
|
trackedOnly?: boolean;
|
45
45
|
}
|
46
46
|
|
47
|
+
export interface IInternalOptions {
|
48
|
+
/**
|
49
|
+
* The type of output to deliver. Defaults to "object" - in which case
|
50
|
+
* the listSync function returns an IChange[] object
|
51
|
+
*/
|
52
|
+
outputType?: "object";
|
53
|
+
/**
|
54
|
+
* When true _only_ takes already tracked files into account.
|
55
|
+
* When false also takes untracked files into account.
|
56
|
+
*
|
57
|
+
* Defaults to false.
|
58
|
+
*/
|
59
|
+
trackedOnly?: boolean;
|
60
|
+
}
|
61
|
+
|
62
|
+
export type IOptions = IFormatOptions | IInternalOptions;
|
63
|
+
|
47
64
|
/**
|
48
65
|
* returns a list of files changed since pOldRevision.
|
49
66
|
*
|
@@ -59,11 +76,49 @@ export interface IOptions {
|
|
59
76
|
export function listSync(
|
60
77
|
pOldRevision?: string,
|
61
78
|
pNewRevision?: string,
|
62
|
-
pOptions?:
|
63
|
-
): IChange[]
|
79
|
+
pOptions?: IInternalOptions
|
80
|
+
): IChange[];
|
64
81
|
|
65
82
|
/**
|
66
|
-
* returns a list of files changed since pOldRevision
|
83
|
+
* returns a list of files changed since pOldRevision formatted into a string
|
84
|
+
* as pOptions.outputType
|
85
|
+
*
|
86
|
+
* @param pOldRevision The revision against which to compare. E.g. a commit-hash,
|
87
|
+
* a branch or a tag. When not passed defaults to the _current_
|
88
|
+
* commit hash (if there's any)
|
89
|
+
* @param pNewRevision Newer revision against which to compare. Leave out or pass
|
90
|
+
* null when you want to compare against the working tree
|
91
|
+
* @param pOptions Options that influence how the changes are returned and that
|
92
|
+
* filter what is returned and
|
93
|
+
* @throws {Error}
|
94
|
+
*/
|
95
|
+
export function listSync(
|
96
|
+
pOldRevision?: string,
|
97
|
+
pNewRevision?: string,
|
98
|
+
pOptions?: IFormatOptions
|
99
|
+
): string;
|
100
|
+
|
101
|
+
/**
|
102
|
+
* returns promise of a list of files changed since pOldRevision.
|
103
|
+
*
|
104
|
+
* @param pOldRevision The revision against which to compare. E.g. a commit-hash,
|
105
|
+
* a branch or a tag. When not passed defaults to the _current_
|
106
|
+
* commit hash (if there's any)
|
107
|
+
* @param pNewRevision Newer revision against which to compare. Leave out or pass
|
108
|
+
* null when you want to compare against the working tree
|
109
|
+
* @param pOptions Options that influence how the changes are returned and that
|
110
|
+
* filter what is returned and
|
111
|
+
* @throws {Error}
|
112
|
+
*/
|
113
|
+
export function list(
|
114
|
+
pOldRevision?: string,
|
115
|
+
pNewRevision?: string,
|
116
|
+
pOptions?: IInternalOptions
|
117
|
+
): Promise<IChange[]>;
|
118
|
+
|
119
|
+
/**
|
120
|
+
* returns promise a list of files changed since pOldRevision, formatted into a
|
121
|
+
* string as a pOptions.outputType
|
67
122
|
*
|
68
123
|
* @param pOldRevision The revision against which to compare. E.g. a commit-hash,
|
69
124
|
* a branch or a tag. When not passed defaults to the _current_
|
@@ -77,8 +132,8 @@ export function listSync(
|
|
77
132
|
export function list(
|
78
133
|
pOldRevision?: string,
|
79
134
|
pNewRevision?: string,
|
80
|
-
pOptions?:
|
81
|
-
): Promise<
|
135
|
+
pOptions?: IFormatOptions
|
136
|
+
): Promise<string>;
|
82
137
|
|
83
138
|
/**
|
84
139
|
* Returns the SHA1 of the current HEAD
|