@commitlint/read 6.1.2 → 7.1.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/CHANGELOG.md +8 -0
- package/lib/index.js +10 -13
- package/lib/index.js.map +1 -1
- package/lib/index.test.js +165 -174
- package/lib/index.test.js.map +1 -1
- package/license.md +21 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
<a name="7.1.2"></a>
|
|
7
|
+
## [7.1.2](https://github.com/marionebl/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @commitlint/read
|
|
13
|
+
|
|
6
14
|
<a name="6.1.1"></a>
|
|
7
15
|
## [6.1.1](https://github.com/marionebl/commitlint/compare/v6.1.0...v6.1.1) (2018-02-22)
|
|
8
16
|
|
package/lib/index.js
CHANGED
|
@@ -31,10 +31,10 @@ exports.default = getCommitMessages;
|
|
|
31
31
|
|
|
32
32
|
function getCommitMessages(settings) {
|
|
33
33
|
return new Promise(function ($return, $error) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const cwd = settings.cwd,
|
|
35
|
+
from = settings.from,
|
|
36
|
+
to = settings.to,
|
|
37
|
+
edit = settings.edit;
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
if (edit) {
|
|
@@ -47,14 +47,10 @@ function getCommitMessages(settings) {
|
|
|
47
47
|
|
|
48
48
|
// Get commit messages from history
|
|
49
49
|
// Object => Promise<string[]>
|
|
50
|
-
function getHistoryCommits(options) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var data = [];
|
|
55
|
-
(0, _gitRawCommits2.default)(options, { cwd: opts.cwd }).on('data', function (chunk) {
|
|
56
|
-
return data.push(chunk.toString('utf-8'));
|
|
57
|
-
}).on('error', reject).on('end', function () {
|
|
50
|
+
function getHistoryCommits(options, opts = {}) {
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
const data = [];
|
|
53
|
+
(0, _gitRawCommits2.default)(options, { cwd: opts.cwd }).on('data', chunk => data.push(chunk.toString('utf-8'))).on('error', reject).on('end', () => {
|
|
58
54
|
resolve(data);
|
|
59
55
|
});
|
|
60
56
|
});
|
|
@@ -69,15 +65,16 @@ function getEditCommit(cwd, edit) {
|
|
|
69
65
|
try {
|
|
70
66
|
top = $await_1;
|
|
71
67
|
|
|
68
|
+
|
|
72
69
|
if (typeof top !== 'string') {
|
|
73
70
|
return $error(new TypeError(`Could not find git root from ${cwd}`));
|
|
74
71
|
}
|
|
75
72
|
|
|
76
73
|
editFilePath = typeof edit === 'string' ? _path2.default.resolve(top, edit) : _path2.default.join(top, '.git/COMMIT_EDITMSG');
|
|
77
|
-
|
|
78
74
|
return Promise.resolve(sander.readFile(editFilePath)).then(function ($await_2) {
|
|
79
75
|
try {
|
|
80
76
|
editFile = $await_2;
|
|
77
|
+
|
|
81
78
|
return $return([`${editFile.toString('utf-8')}\n`]);
|
|
82
79
|
} catch ($boundEx) {
|
|
83
80
|
return $error($boundEx);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["sander","getCommitMessages","settings","cwd","from","to","edit","getEditCommit","getHistoryCommits","options","opts","Promise","resolve","reject","data","on","
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["sander","getCommitMessages","settings","cwd","from","to","edit","getEditCommit","getHistoryCommits","options","opts","Promise","resolve","reject","data","on","chunk","push","toString","top","TypeError","editFilePath","join","readFile","editFile"],"mappings":";;;;;;AAAA;;;;AACA;;;;AACA;;IAAYA,M;;AAEZ;;;;;;;;kBAEeC,iB;;AAE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GAAV,EAAe,qBAAf,CATQ;AAWK,2BAAMnB,OAAOuB,QAAP,CAAgBF,YAAhB,CAAN;AAAA;AAAXG,cAAW;;AACjB,qBAAO,CAAE,GAAEA,SAASN,QAAT,CAAkB,OAAlB,CAA2B,IAA/B,CAAP;AADiB;AAAA;AAAA;AAAA;AAXL;AAAA;AAAA;AAAA;AADb;AAAA","file":"index.js","sourcesContent":["import path from 'path';\nimport gitRawCommits from 'git-raw-commits';\nimport * as sander from '@marionebl/sander';\n\nimport toplevel from '@commitlint/top-level';\n\nexport default getCommitMessages;\n\n// Get commit messages\n// Object => Promise<Array<String>>\nasync function getCommitMessages(settings) {\n\tconst {cwd, from, to, edit} = settings;\n\n\tif (edit) {\n\t\treturn getEditCommit(cwd, edit);\n\t}\n\n\treturn getHistoryCommits({from, to}, {cwd});\n}\n\n// Get commit messages from history\n// Object => Promise<string[]>\nfunction getHistoryCommits(options, opts = {}) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst data = [];\n\t\tgitRawCommits(options, {cwd: opts.cwd})\n\t\t\t.on('data', chunk => data.push(chunk.toString('utf-8')))\n\t\t\t.on('error', reject)\n\t\t\t.on('end', () => {\n\t\t\t\tresolve(data);\n\t\t\t});\n\t});\n}\n\n// Get recently edited commit message\n// (cwd: string, edit: any) => Promise<Array<String>>\nasync function getEditCommit(cwd, edit) {\n\tconst top = await toplevel(cwd);\n\n\tif (typeof top !== 'string') {\n\t\tthrow new TypeError(`Could not find git root from ${cwd}`);\n\t}\n\n\tconst editFilePath =\n\t\ttypeof edit === 'string'\n\t\t\t? path.resolve(top, edit)\n\t\t\t: path.join(top, '.git/COMMIT_EDITMSG');\n\n\tconst editFile = await sander.readFile(editFilePath);\n\treturn [`${editFile.toString('utf-8')}\\n`];\n}\n"]}
|
package/lib/index.test.js
CHANGED
|
@@ -22,178 +22,169 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
22
22
|
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
24
|
|
|
25
|
-
(0, _ava2.default)('get edit commit message specified by the `edit` flag', function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return $error($boundEx);
|
|
191
|
-
}
|
|
192
|
-
}.bind(this), $error);
|
|
193
|
-
} catch ($boundEx) {
|
|
194
|
-
return $error($boundEx);
|
|
195
|
-
}
|
|
196
|
-
}.bind(this), $error);
|
|
197
|
-
}.bind(this));
|
|
198
|
-
});
|
|
25
|
+
(0, _ava2.default)('get edit commit message specified by the `edit` flag', t => new Promise(function ($return, $error) {
|
|
26
|
+
var cwd, expected, actual;
|
|
27
|
+
return Promise.resolve(_test.git.bootstrap()).then(function ($await_1) {
|
|
28
|
+
try {
|
|
29
|
+
cwd = $await_1;
|
|
30
|
+
return Promise.resolve(sander.writeFile(cwd, 'commit-msg-file', 'foo')).then(function ($await_2) {
|
|
31
|
+
try {
|
|
32
|
+
expected = ['foo\n'];
|
|
33
|
+
return Promise.resolve((0, _2.default)({ edit: 'commit-msg-file', cwd })).then(function ($await_3) {
|
|
34
|
+
try {
|
|
35
|
+
actual = $await_3;
|
|
36
|
+
|
|
37
|
+
t.deepEqual(actual, expected);
|
|
38
|
+
return $return();
|
|
39
|
+
} catch ($boundEx) {
|
|
40
|
+
return $error($boundEx);
|
|
41
|
+
}
|
|
42
|
+
}.bind(this), $error);
|
|
43
|
+
} catch ($boundEx) {
|
|
44
|
+
return $error($boundEx);
|
|
45
|
+
}
|
|
46
|
+
}.bind(this), $error);
|
|
47
|
+
} catch ($boundEx) {
|
|
48
|
+
return $error($boundEx);
|
|
49
|
+
}
|
|
50
|
+
}.bind(this), $error);
|
|
51
|
+
}.bind(this)));
|
|
52
|
+
|
|
53
|
+
(0, _ava2.default)('get edit commit message from git root', t => new Promise(function ($return, $error) {
|
|
54
|
+
var cwd, expected, actual;
|
|
55
|
+
return Promise.resolve(_test.git.bootstrap()).then(function ($await_4) {
|
|
56
|
+
try {
|
|
57
|
+
cwd = $await_4;
|
|
58
|
+
return Promise.resolve(sander.writeFile(cwd, 'alpha.txt', 'alpha')).then(function ($await_5) {
|
|
59
|
+
try {
|
|
60
|
+
return Promise.resolve((0, _execa2.default)('git', ['add', '.'], { cwd })).then(function ($await_6) {
|
|
61
|
+
try {
|
|
62
|
+
return Promise.resolve((0, _execa2.default)('git', ['commit', '-m', 'alpha'], { cwd })).then(function ($await_7) {
|
|
63
|
+
try {
|
|
64
|
+
expected = ['alpha\n\n'];
|
|
65
|
+
return Promise.resolve((0, _2.default)({ edit: true, cwd })).then(function ($await_8) {
|
|
66
|
+
try {
|
|
67
|
+
actual = $await_8;
|
|
68
|
+
|
|
69
|
+
t.deepEqual(actual, expected);
|
|
70
|
+
return $return();
|
|
71
|
+
} catch ($boundEx) {
|
|
72
|
+
return $error($boundEx);
|
|
73
|
+
}
|
|
74
|
+
}.bind(this), $error);
|
|
75
|
+
} catch ($boundEx) {
|
|
76
|
+
return $error($boundEx);
|
|
77
|
+
}
|
|
78
|
+
}.bind(this), $error);
|
|
79
|
+
} catch ($boundEx) {
|
|
80
|
+
return $error($boundEx);
|
|
81
|
+
}
|
|
82
|
+
}.bind(this), $error);
|
|
83
|
+
} catch ($boundEx) {
|
|
84
|
+
return $error($boundEx);
|
|
85
|
+
}
|
|
86
|
+
}.bind(this), $error);
|
|
87
|
+
} catch ($boundEx) {
|
|
88
|
+
return $error($boundEx);
|
|
89
|
+
}
|
|
90
|
+
}.bind(this), $error);
|
|
91
|
+
}.bind(this)));
|
|
92
|
+
|
|
93
|
+
(0, _ava2.default)('get history commit messages', t => new Promise(function ($return, $error) {
|
|
94
|
+
var cwd, expected, actual;
|
|
95
|
+
return Promise.resolve(_test.git.bootstrap()).then(function ($await_9) {
|
|
96
|
+
try {
|
|
97
|
+
cwd = $await_9;
|
|
98
|
+
return Promise.resolve(sander.writeFile(cwd, 'alpha.txt', 'alpha')).then(function ($await_10) {
|
|
99
|
+
try {
|
|
100
|
+
return Promise.resolve((0, _execa2.default)('git', ['add', 'alpha.txt'], { cwd })).then(function ($await_11) {
|
|
101
|
+
try {
|
|
102
|
+
return Promise.resolve((0, _execa2.default)('git', ['commit', '-m', 'alpha'], { cwd })).then(function ($await_12) {
|
|
103
|
+
try {
|
|
104
|
+
return Promise.resolve((0, _execa2.default)('git', ['rm', 'alpha.txt'], { cwd })).then(function ($await_13) {
|
|
105
|
+
try {
|
|
106
|
+
return Promise.resolve((0, _execa2.default)('git', ['commit', '-m', 'remove alpha'], { cwd })).then(function ($await_14) {
|
|
107
|
+
try {
|
|
108
|
+
expected = ['remove alpha\n\n', 'alpha\n\n'];
|
|
109
|
+
return Promise.resolve((0, _2.default)({ cwd })).then(function ($await_15) {
|
|
110
|
+
try {
|
|
111
|
+
actual = $await_15;
|
|
112
|
+
|
|
113
|
+
t.deepEqual(actual, expected);
|
|
114
|
+
return $return();
|
|
115
|
+
} catch ($boundEx) {
|
|
116
|
+
return $error($boundEx);
|
|
117
|
+
}
|
|
118
|
+
}.bind(this), $error);
|
|
119
|
+
} catch ($boundEx) {
|
|
120
|
+
return $error($boundEx);
|
|
121
|
+
}
|
|
122
|
+
}.bind(this), $error);
|
|
123
|
+
} catch ($boundEx) {
|
|
124
|
+
return $error($boundEx);
|
|
125
|
+
}
|
|
126
|
+
}.bind(this), $error);
|
|
127
|
+
} catch ($boundEx) {
|
|
128
|
+
return $error($boundEx);
|
|
129
|
+
}
|
|
130
|
+
}.bind(this), $error);
|
|
131
|
+
} catch ($boundEx) {
|
|
132
|
+
return $error($boundEx);
|
|
133
|
+
}
|
|
134
|
+
}.bind(this), $error);
|
|
135
|
+
} catch ($boundEx) {
|
|
136
|
+
return $error($boundEx);
|
|
137
|
+
}
|
|
138
|
+
}.bind(this), $error);
|
|
139
|
+
} catch ($boundEx) {
|
|
140
|
+
return $error($boundEx);
|
|
141
|
+
}
|
|
142
|
+
}.bind(this), $error);
|
|
143
|
+
}.bind(this)));
|
|
144
|
+
|
|
145
|
+
(0, _ava2.default)('get edit commit message from git subdirectory', t => new Promise(function ($return, $error) {
|
|
146
|
+
var cwd, expected, actual;
|
|
147
|
+
return Promise.resolve(_test.git.bootstrap()).then(function ($await_16) {
|
|
148
|
+
try {
|
|
149
|
+
cwd = $await_16;
|
|
150
|
+
return Promise.resolve(sander.mkdir(cwd, 'beta')).then(function ($await_17) {
|
|
151
|
+
try {
|
|
152
|
+
return Promise.resolve(sander.writeFile(cwd, 'beta/beta.txt', 'beta')).then(function ($await_18) {
|
|
153
|
+
try {
|
|
154
|
+
return Promise.resolve((0, _execa2.default)('git', ['add', '.'], { cwd })).then(function ($await_19) {
|
|
155
|
+
try {
|
|
156
|
+
return Promise.resolve((0, _execa2.default)('git', ['commit', '-m', 'beta'], { cwd })).then(function ($await_20) {
|
|
157
|
+
try {
|
|
158
|
+
expected = ['beta\n\n'];
|
|
159
|
+
return Promise.resolve((0, _2.default)({ edit: true, cwd })).then(function ($await_21) {
|
|
160
|
+
try {
|
|
161
|
+
actual = $await_21;
|
|
162
|
+
|
|
163
|
+
t.deepEqual(actual, expected);
|
|
164
|
+
return $return();
|
|
165
|
+
} catch ($boundEx) {
|
|
166
|
+
return $error($boundEx);
|
|
167
|
+
}
|
|
168
|
+
}.bind(this), $error);
|
|
169
|
+
} catch ($boundEx) {
|
|
170
|
+
return $error($boundEx);
|
|
171
|
+
}
|
|
172
|
+
}.bind(this), $error);
|
|
173
|
+
} catch ($boundEx) {
|
|
174
|
+
return $error($boundEx);
|
|
175
|
+
}
|
|
176
|
+
}.bind(this), $error);
|
|
177
|
+
} catch ($boundEx) {
|
|
178
|
+
return $error($boundEx);
|
|
179
|
+
}
|
|
180
|
+
}.bind(this), $error);
|
|
181
|
+
} catch ($boundEx) {
|
|
182
|
+
return $error($boundEx);
|
|
183
|
+
}
|
|
184
|
+
}.bind(this), $error);
|
|
185
|
+
} catch ($boundEx) {
|
|
186
|
+
return $error($boundEx);
|
|
187
|
+
}
|
|
188
|
+
}.bind(this), $error);
|
|
189
|
+
}.bind(this)));
|
|
199
190
|
//# sourceMappingURL=index.test.js.map
|
package/lib/index.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.test.js"],"names":["sander","t","bootstrap","cwd","writeFile","expected","edit","actual","deepEqual","mkdir"],"mappings":";;AAAA;;AACA;;;;AACA;;;;AACA;;IAAYA,M;;AAEZ;;;;;;;;AAEA,mBAAK,sDAAL,
|
|
1
|
+
{"version":3,"sources":["../src/index.test.js"],"names":["sander","t","bootstrap","cwd","writeFile","expected","edit","actual","deepEqual","mkdir"],"mappings":";;AAAA;;AACA;;;;AACA;;;;AACA;;IAAYA,M;;AAEZ;;;;;;;;AAEA,mBAAK,sDAAL,EAAmEC,CAAN;AAAA;AAChD,wBAAM,UAAIC,SAAJ,EAAN;AAAA;AAANC,MAAM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AAA;AAEME,mBAFN,GAEiB,CAAC,UAAD,CAFjB;AAGe,kCAAM,gBAAK,EAACC,MAAM,IAAP,EAAaH,GAAb,EAAL,CAAN;AAAA;AAATI,mBAAS;;AACfN,eAAEO,SAAF,CAAYD,MAAZ,EAAoBF,QAApB;AADe;AAAA;AAAA;AAAA;AAAA;AAHf;AAAA;AAAA;AAAA;AADA;AAAA;AAAA;AAAA;AAFA;AAAA;AAAA;AAAA;AADA;AAAA;AAAA;AAAA;AADY;AAAA;AAAA;AAAA;AADyC,aAAtD","file":"index.test.js","sourcesContent":["import {git} from '@commitlint/test';\nimport test from 'ava';\nimport execa from 'execa';\nimport * as sander from '@marionebl/sander';\n\nimport read from '.';\n\ntest('get edit commit message specified by the `edit` flag', async t => {\n\tconst cwd = await git.bootstrap();\n\n\tawait sander.writeFile(cwd, 'commit-msg-file', 'foo');\n\n\tconst expected = ['foo\\n'];\n\tconst actual = await read({edit: 'commit-msg-file', cwd});\n\tt.deepEqual(actual, expected);\n});\n\ntest('get edit commit message from git root', async t => {\n\tconst cwd = await git.bootstrap();\n\n\tawait sander.writeFile(cwd, 'alpha.txt', 'alpha');\n\tawait execa('git', ['add', '.'], {cwd});\n\tawait execa('git', ['commit', '-m', 'alpha'], {cwd});\n\tconst expected = ['alpha\\n\\n'];\n\tconst actual = await read({edit: true, cwd});\n\tt.deepEqual(actual, expected);\n});\n\ntest('get history commit messages', async t => {\n\tconst cwd = await git.bootstrap();\n\tawait sander.writeFile(cwd, 'alpha.txt', 'alpha');\n\tawait execa('git', ['add', 'alpha.txt'], {cwd});\n\tawait execa('git', ['commit', '-m', 'alpha'], {cwd});\n\tawait execa('git', ['rm', 'alpha.txt'], {cwd});\n\tawait execa('git', ['commit', '-m', 'remove alpha'], {cwd});\n\n\tconst expected = ['remove alpha\\n\\n', 'alpha\\n\\n'];\n\tconst actual = await read({cwd});\n\tt.deepEqual(actual, expected);\n});\n\ntest('get edit commit message from git subdirectory', async t => {\n\tconst cwd = await git.bootstrap();\n\tawait sander.mkdir(cwd, 'beta');\n\tawait sander.writeFile(cwd, 'beta/beta.txt', 'beta');\n\n\tawait execa('git', ['add', '.'], {cwd});\n\tawait execa('git', ['commit', '-m', 'beta'], {cwd});\n\n\tconst expected = ['beta\\n\\n'];\n\tconst actual = await read({edit: true, cwd});\n\tt.deepEqual(actual, expected);\n});\n"]}
|
package/license.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 - present Mario Nebl
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/read",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "Read commit messages from a specified range or last edit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
},
|
|
60
60
|
"license": "MIT",
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@commitlint/test": "^
|
|
63
|
-
"@commitlint/utils": "^
|
|
62
|
+
"@commitlint/test": "^7.1.2",
|
|
63
|
+
"@commitlint/utils": "^7.1.2",
|
|
64
64
|
"ava": "0.22.0",
|
|
65
65
|
"babel-cli": "6.26.0",
|
|
66
|
-
"babel-preset-commitlint": "^
|
|
66
|
+
"babel-preset-commitlint": "^7.1.2",
|
|
67
67
|
"babel-register": "6.26.0",
|
|
68
68
|
"concurrently": "3.5.1",
|
|
69
69
|
"cross-env": "5.1.1",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"xo": "0.20.3"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@commitlint/top-level": "^
|
|
75
|
+
"@commitlint/top-level": "^7.1.2",
|
|
76
76
|
"@marionebl/sander": "^0.6.0",
|
|
77
77
|
"babel-runtime": "^6.23.0",
|
|
78
78
|
"git-raw-commits": "^1.3.0"
|