@all-contributors/cli 7.1.0 β 7.2.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.
- package/README.md +31 -8
- package/dist/cli.js +124 -73
- package/dist/contributors/add.js +1 -1
- package/dist/contributors/index.js +18 -17
- package/dist/contributors/prompt.js +46 -53
- package/dist/generate/start-generation.js +20 -7
- package/dist/init/index.js +6 -0
- package/dist/init/prompt.js +109 -107
- package/dist/util/cliStatuses.js +5 -0
- package/package.json +14 -11
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</tbody>
|
|
43
43
|
</table>
|
|
44
44
|
|
|
45
|
-
[](https://github.com/michaelfaith/mfaith-create/blob/main/LICENSE.md)
|
|
46
46
|
[](https://codecov.io/gh/all-contributors/cli)
|
|
47
47
|
[](https://www.npmjs.com/package/@all-contributors/cli)
|
|
48
48
|
[](#contributors-)
|
|
@@ -79,7 +79,7 @@ Thanks goes to these wonderful people
|
|
|
79
79
|
<tbody>
|
|
80
80
|
<tr>
|
|
81
81
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/jfmengels"><img src="https://avatars.githubusercontent.com/u/3869412?v=3&size=100" width="100px" height="100px" alt="Jeroen Engels"/><br /><sub><b>Jeroen Engels</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=jfmengels" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/commits?author=jfmengels" title="Documentation">π</a> <a href="https://github.com/all-contributors/cli/commits?author=jfmengels" title="Tests">β οΈ</a> <a href="#ideas-jfmengels" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
82
|
-
<td align="center" valign="top" width="16.66%"><a href="http://kentcdodds.com/"><img src="https://avatars.githubusercontent.com/u/1500684?v=3&size=100" width="100px" height="100px" alt="Kent C. Dodds"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=kentcdodds" title="
|
|
82
|
+
<td align="center" valign="top" width="16.66%"><a href="http://kentcdodds.com/"><img src="https://avatars.githubusercontent.com/u/1500684?v=3&size=100" width="100px" height="100px" alt="Kent C. Dodds"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=kentcdodds" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/commits?author=kentcdodds" title="Documentation">π</a> <a href="#ideas-kentcdodds" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
83
83
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/jccguimaraes"><img src="https://avatars.githubusercontent.com/u/14871650?v=3&size=100" width="100px" height="100px" alt="JoΓ£o GuimarΓ£es"/><br /><sub><b>JoΓ£o GuimarΓ£es</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=jccguimaraes" title="Code">π»</a></td>
|
|
84
84
|
<td align="center" valign="top" width="16.66%"><a href="http://beneb.info"><img src="https://avatars.githubusercontent.com/u/1282980?v=3&size=100" width="100px" height="100px" alt="Ben Briggs"/><br /><sub><b>Ben Briggs</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=ben-eb" title="Code">π»</a></td>
|
|
85
85
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/itaisteinherz"><img src="https://avatars.githubusercontent.com/u/22768990?v=3&size=100" width="100px" height="100px" alt="Itai Steinherz"/><br /><sub><b>Itai Steinherz</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=itaisteinherz" title="Documentation">π</a> <a href="https://github.com/all-contributors/cli/commits?author=itaisteinherz" title="Code">π»</a></td>
|
|
@@ -90,7 +90,7 @@ Thanks goes to these wonderful people
|
|
|
90
90
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/kevinjalbert"><img src="https://avatars1.githubusercontent.com/u/574871?v=3&size=100" width="100px" height="100px" alt="Kevin Jalbert"/><br /><sub><b>Kevin Jalbert</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=kevinjalbert" title="Code">π»</a></td>
|
|
91
91
|
<td align="center" valign="top" width="16.66%"><a href="https://i.am.charlike.online"><img src="https://avatars3.githubusercontent.com/u/5038030?v=4&size=100" width="100px" height="100px" alt="tunnckoCore"/><br /><sub><b>tunnckoCore</b></sub></a><br /><a href="#tool-charlike" title="Tools">π§</a></td>
|
|
92
92
|
<td align="center" valign="top" width="16.66%"><a href="https://machour.idk.tn/"><img src="https://avatars2.githubusercontent.com/u/304450?v=4&size=100" width="100px" height="100px" alt="Mehdi Achour"/><br /><sub><b>Mehdi Achour</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=machour" title="Code">π»</a></td>
|
|
93
|
-
<td align="center" valign="top" width="16.66%"><a href="https://codsen.com"><img src="https://avatars1.githubusercontent.com/u/8344688?v=4&size=100" width="100px" height="100px" alt="Roy Revelt"/><br /><sub><b>Roy Revelt</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Arevelt" title="Bug reports">π</a></td>
|
|
93
|
+
<td align="center" valign="top" width="16.66%"><a href="https://codsen.com"><img src="https://avatars1.githubusercontent.com/u/8344688?v=4&size=100" width="100px" height="100px" alt="Roy Revelt"/><br /><sub><b>Roy Revelt</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Arevelt" title="Bug reports">π</a> <a href="https://github.com/all-contributors/cli/commits?author=revelt" title="Code">π»</a></td>
|
|
94
94
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/chrisinajar"><img src="https://avatars1.githubusercontent.com/u/422331?v=4&size=100" width="100px" height="100px" alt="Chris Vickery"/><br /><sub><b>Chris Vickery</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=chrisinajar" title="Code">π»</a></td>
|
|
95
95
|
</tr>
|
|
96
96
|
<tr>
|
|
@@ -98,7 +98,7 @@ Thanks goes to these wonderful people
|
|
|
98
98
|
<td align="center" valign="top" width="16.66%"><a href="http://www.jmeas.com"><img src="https://avatars3.githubusercontent.com/u/2322305?v=4&size=100" width="100px" height="100px" alt="James, please"/><br /><sub><b>James, please</b></sub></a><br /><a href="#ideas-jmeas" title="Ideas, Planning, & Feedback">π€</a> <a href="https://github.com/all-contributors/cli/commits?author=jmeas" title="Code">π»</a></td>
|
|
99
99
|
<td align="center" valign="top" width="16.66%"><a href="http://www.spyros.io"><img src="https://avatars3.githubusercontent.com/u/1057324?v=4&size=100" width="100px" height="100px" alt="Spyros Ioakeimidis"/><br /><sub><b>Spyros Ioakeimidis</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=spirosikmd" title="Code">π»</a></td>
|
|
100
100
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/fadc80"><img src="https://avatars3.githubusercontent.com/u/12335761?v=4&size=100" width="100px" height="100px" alt="Fernando Costa"/><br /><sub><b>Fernando Costa</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=fadc80" title="Code">π»</a></td>
|
|
101
|
-
<td align="center" valign="top" width="16.66%"><a href="https://snipe.net"><img src="https://avatars0.githubusercontent.com/u/197404?v=4&size=100" width="100px" height="100px" alt="snipe"/><br /><sub><b>snipe</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=snipe" title="Documentation">π</a></td>
|
|
101
|
+
<td align="center" valign="top" width="16.66%"><a href="https://snipe.net"><img src="https://avatars0.githubusercontent.com/u/197404?v=4&size=100" width="100px" height="100px" alt="snipe"/><br /><sub><b>snipe</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=snipe" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/commits?author=snipe" title="Documentation">π</a></td>
|
|
102
102
|
<td align="center" valign="top" width="16.66%"><a href="http://gantlaborde.com/"><img src="https://avatars0.githubusercontent.com/u/997157?v=4&size=100" width="100px" height="100px" alt="Gant Laborde"/><br /><sub><b>Gant Laborde</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=GantMan" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/issues?q=author%3AGantMan" title="Bug reports">π</a></td>
|
|
103
103
|
</tr>
|
|
104
104
|
<tr>
|
|
@@ -110,7 +110,7 @@ Thanks goes to these wonderful people
|
|
|
110
110
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/xuchaoying"><img src="https://avatars2.githubusercontent.com/u/8073251?v=4&size=100" width="100px" height="100px" alt="C.Y.Xu"/><br /><sub><b>C.Y.Xu</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=xuchaoying" title="Code">π»</a></td>
|
|
111
111
|
</tr>
|
|
112
112
|
<tr>
|
|
113
|
-
<td align="center" valign="top" width="16.66%"><a href="https://github.com/chris-dura"><img src="https://avatars3.githubusercontent.com/u/3680914?v=4&size=100" width="100px" height="100px" alt="Dura"/><br /><sub><b>Dura</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=chris-dura" title="Documentation">π</a></td>
|
|
113
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/chris-dura"><img src="https://avatars3.githubusercontent.com/u/3680914?v=4&size=100" width="100px" height="100px" alt="Dura"/><br /><sub><b>Dura</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=chris-dura" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/commits?author=chris-dura" title="Documentation">π</a></td>
|
|
114
114
|
<td align="center" valign="top" width="16.66%"><a href="https://jakebolam.com"><img src="https://avatars2.githubusercontent.com/u/3534236?v=4&size=100" width="100px" height="100px" alt="Jake Bolam"/><br /><sub><b>Jake Bolam</b></sub></a><br /><a href="#infra-jakebolam" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="https://github.com/all-contributors/cli/commits?author=jakebolam" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/commits?author=jakebolam" title="Documentation">π</a> <a href="https://github.com/all-contributors/cli/commits?author=jakebolam" title="Tests">β οΈ</a> <a href="https://github.com/all-contributors/cli/pulls?q=is%3Apr+reviewed-by%3Ajakebolam" title="Reviewed Pull Requests">π</a> <a href="#question-jakebolam" title="Answering Questions">π¬</a> <a href="#ideas-jakebolam" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
115
115
|
<td align="center" valign="top" width="16.66%"><a href="http://maxcubing.wordpress.com"><img src="https://avatars0.githubusercontent.com/u/8260834?v=4&size=100" width="100px" height="100px" alt="Maximilian Berkmann"/><br /><sub><b>Maximilian Berkmann</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=Berkmann18" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/commits?author=Berkmann18" title="Tests">β οΈ</a> <a href="https://github.com/all-contributors/cli/commits?author=Berkmann18" title="Documentation">π</a> <a href="#tool-Berkmann18" title="Tools">π§</a> <a href="#maintenance-Berkmann18" title="Maintenance">π§</a> <a href="https://github.com/all-contributors/cli/pulls?q=is%3Apr+reviewed-by%3ABerkmann18" title="Reviewed Pull Requests">π</a> <a href="#question-Berkmann18" title="Answering Questions">π¬</a></td>
|
|
116
116
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/tbenning"><img src="https://avatars2.githubusercontent.com/u/7265547?v=4&size=100" width="100px" height="100px" alt="tbenning"/><br /><sub><b>tbenning</b></sub></a><br /><a href="#design-tbenning" title="Design">π¨</a></td>
|
|
@@ -122,7 +122,7 @@ Thanks goes to these wonderful people
|
|
|
122
122
|
<td align="center" valign="top" width="16.66%"><a href="https://cezaraugusto.net/"><img src="https://avatars0.githubusercontent.com/u/4672033?v=4&size=100" width="100px" height="100px" alt="Cezar Augusto"/><br /><sub><b>Cezar Augusto</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=cezaraugusto" title="Documentation">π</a></td>
|
|
123
123
|
<td align="center" valign="top" width="16.66%"><a href="https://reinhold.is"><img src="https://avatars1.githubusercontent.com/u/5678122?v=4&size=100" width="100px" height="100px" alt="Jeppe Reinhold"/><br /><sub><b>Jeppe Reinhold</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=JReinhold" title="Code">π»</a></td>
|
|
124
124
|
<td align="center" valign="top" width="16.66%"><a href="https://rachelcarmena.github.io"><img src="https://avatars0.githubusercontent.com/u/22792183?v=4&size=100" width="100px" height="100px" alt="Rachel M. Carmena"/><br /><sub><b>Rachel M. Carmena</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=rachelcarmena" title="Code">π»</a> <a href="#ideas-rachelcarmena" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
125
|
-
<td align="center" valign="top" width="16.66%"><a href="https://github.com/simon300000"><img src="https://avatars1.githubusercontent.com/u/12656264?v=4&size=100" width="100px" height="100px" alt="simon3000"/><br /><sub><b>simon3000</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=simon300000" title="Tests">β οΈ</a></td>
|
|
125
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/simon300000"><img src="https://avatars1.githubusercontent.com/u/12656264?v=4&size=100" width="100px" height="100px" alt="simon3000"/><br /><sub><b>simon3000</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Asimon300000" title="Bug reports">π</a> <a href="https://github.com/all-contributors/cli/commits?author=simon300000" title="Tests">β οΈ</a></td>
|
|
126
126
|
<td align="center" valign="top" width="16.66%"><a href="https://sno2wman.dev/"><img src="https://avatars3.githubusercontent.com/u/15155608?v=4&size=100" width="100px" height="100px" alt="SnOβWMaN"/><br /><sub><b>SnOβWMaN</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=SnO2WMaN" title="Code">π»</a></td>
|
|
127
127
|
</tr>
|
|
128
128
|
<tr>
|
|
@@ -168,13 +168,13 @@ Thanks goes to these wonderful people
|
|
|
168
168
|
<tr>
|
|
169
169
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/schweden1997"><img src="https://avatars.githubusercontent.com/u/6765735?v=4&size=100" width="100px" height="100px" alt="Marco De Gaetano"/><br /><sub><b>Marco De Gaetano</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Aschweden1997" title="Bug reports">π</a> <a href="https://github.com/all-contributors/cli/commits?author=schweden1997" title="Code">π»</a></td>
|
|
170
170
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/marcelpanse"><img src="https://avatars.githubusercontent.com/u/418984?v=4&size=100" width="100px" height="100px" alt="Marcel Panse"/><br /><sub><b>Marcel Panse</b></sub></a><br /><a href="#security-marcelpanse" title="Security">π‘οΈ</a></td>
|
|
171
|
-
<td align="center" valign="top" width="16.66%"><a href="http://www.leahwasser.com"><img src="https://avatars.githubusercontent.com/u/7649194?v=4&size=100" width="100px" height="100px" alt="Leah Wasser"/><br /><sub><b>Leah Wasser</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=lwasser" title="Documentation">π</a> <a href="#security-lwasser" title="Security">π‘οΈ</a></td>
|
|
171
|
+
<td align="center" valign="top" width="16.66%"><a href="http://www.leahwasser.com"><img src="https://avatars.githubusercontent.com/u/7649194?v=4&size=100" width="100px" height="100px" alt="Leah Wasser"/><br /><sub><b>Leah Wasser</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=lwasser" title="Documentation">π</a> <a href="#maintenance-lwasser" title="Maintenance">π§</a> <a href="#security-lwasser" title="Security">π‘οΈ</a> <a href="https://github.com/all-contributors/cli/commits?author=lwasser" title="Code">π»</a></td>
|
|
172
172
|
<td align="center" valign="top" width="16.66%"><a href="http://www.davepagurek.com"><img src="https://avatars.githubusercontent.com/u/5315059?v=4&size=100" width="100px" height="100px" alt="Dave Pagurek"/><br /><sub><b>Dave Pagurek</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Adavepagurek" title="Bug reports">π</a></td>
|
|
173
173
|
<td align="center" valign="top" width="16.66%"><a href="https://blog.jmadge.com"><img src="https://avatars.githubusercontent.com/u/23616154?v=4&size=100" width="100px" height="100px" alt="Jim Madge"/><br /><sub><b>Jim Madge</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=JimMadge" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/pulls?q=is%3Apr+reviewed-by%3AJimMadge" title="Reviewed Pull Requests">π</a></td>
|
|
174
174
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/KibbeWater"><img src="https://avatars.githubusercontent.com/u/35224538?v=4&size=100" width="100px" height="100px" alt="Snow"/><br /><sub><b>Snow</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=KibbeWater" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/issues?q=author%3AKibbeWater" title="Bug reports">π</a></td>
|
|
175
175
|
</tr>
|
|
176
176
|
<tr>
|
|
177
|
-
<td align="center" valign="top" width="16.66%"><a href="https://github.com/michaelfaith"><img src="https://avatars.githubusercontent.com/u/8071845?v=4&size=100" width="100px" height="100px" alt="michael faith"/><br /><sub><b>michael faith</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Amichaelfaith" title="Bug reports">π</a> <a href="https://github.com/all-contributors/cli/pulls?q=is%3Apr+reviewed-by%3Amichaelfaith" title="Reviewed Pull Requests">π</a> <a href="https://github.com/all-contributors/cli/commits?author=michaelfaith" title="Code">π»</a> <a href="#maintenance-michaelfaith" title="Maintenance">π§</a> <a href="#infra-michaelfaith" title="Infrastructure (Hosting, Build-Tools, etc)">π</a></td>
|
|
177
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/michaelfaith"><img src="https://avatars.githubusercontent.com/u/8071845?v=4&size=100" width="100px" height="100px" alt="michael faith"/><br /><sub><b>michael faith</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Amichaelfaith" title="Bug reports">π</a> <a href="https://github.com/all-contributors/cli/pulls?q=is%3Apr+reviewed-by%3Amichaelfaith" title="Reviewed Pull Requests">π</a> <a href="https://github.com/all-contributors/cli/commits?author=michaelfaith" title="Code">π»</a> <a href="#maintenance-michaelfaith" title="Maintenance">π§</a> <a href="#infra-michaelfaith" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="#ideas-michaelfaith" title="Ideas, Planning, & Feedback">π€</a> <a href="https://github.com/all-contributors/cli/commits?author=michaelfaith" title="Documentation">π</a></td>
|
|
178
178
|
<td align="center" valign="top" width="16.66%"><a href="http://brandonalenz.com"><img src="https://avatars.githubusercontent.com/u/15805554?v=4&size=100" width="100px" height="100px" alt="Brandon Lenz"/><br /><sub><b>Brandon Lenz</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Abrandonlenz" title="Bug reports">π</a> <a href="https://github.com/all-contributors/cli/commits?author=brandonlenz" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/commits?author=brandonlenz" title="Documentation">π</a></td>
|
|
179
179
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/davidpavlovschi"><img src="https://avatars.githubusercontent.com/u/154081173?v=4&size=100" width="100px" height="100px" alt="David Pavlovschii"/><br /><sub><b>David Pavlovschii</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=davidpavlovschi" title="Code">π»</a></td>
|
|
180
180
|
<td align="center" valign="top" width="16.66%"><a href="http://vincentborgers.nl"><img src="https://avatars.githubusercontent.com/u/88669109?v=4&size=100" width="100px" height="100px" alt="Vincent Borgers"/><br /><sub><b>Vincent Borgers</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=VincentBorgers" title="Code">π»</a> <a href="https://github.com/all-contributors/cli/issues?q=author%3AVincentBorgers" title="Bug reports">π</a></td>
|
|
@@ -187,6 +187,29 @@ Thanks goes to these wonderful people
|
|
|
187
187
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/andreww2012"><img src="https://avatars.githubusercontent.com/u/6554045?v=4&size=100" width="100px" height="100px" alt="Andrew Kazakov"/><br /><sub><b>Andrew Kazakov</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Aandreww2012" title="Bug reports">π</a> <a href="https://github.com/all-contributors/cli/commits?author=andreww2012" title="Code">π»</a></td>
|
|
188
188
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/MaxonT"><img src="https://avatars.githubusercontent.com/u/173550318?v=4&size=100" width="100px" height="100px" alt="Ming "/><br /><sub><b>Ming </b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=MaxonT" title="Documentation">π</a></td>
|
|
189
189
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/hpierre74"><img src="https://avatars.githubusercontent.com/u/25172711?v=4&size=100" width="100px" height="100px" alt="Pierre Huyghe"/><br /><sub><b>Pierre Huyghe</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=hpierre74" title="Code">π»</a></td>
|
|
190
|
+
<td align="center" valign="top" width="16.66%"><a href="https://alexwlchan.net"><img src="https://avatars.githubusercontent.com/u/301220?v=4&size=100" width="100px" height="100px" alt="Alex Chan"/><br /><sub><b>Alex Chan</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=alexwlchan" title="Code">π»</a> <a href="#ideas-alexwlchan" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
191
|
+
</tr>
|
|
192
|
+
<tr>
|
|
193
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/crd477"><img src="https://avatars.githubusercontent.com/u/1130035?v=4&size=100" width="100px" height="100px" alt="Chad Dougherty"/><br /><sub><b>Chad Dougherty</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=crd477" title="Code">π»</a></td>
|
|
194
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/davidmenendez"><img src="https://avatars.githubusercontent.com/u/6370760?v=4&size=100" width="100px" height="100px" alt="David Menendez"/><br /><sub><b>David Menendez</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=davidmenendez" title="Code">π»</a></td>
|
|
195
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/dayjoyx"><img src="https://avatars.githubusercontent.com/u/8073251?v=4&size=100" width="100px" height="100px" alt="dayjoy"/><br /><sub><b>dayjoy</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=dayjoyx" title="Code">π»</a></td>
|
|
196
|
+
<td align="center" valign="top" width="16.66%"><a href="https://frank.taillandier.me"><img src="https://avatars.githubusercontent.com/u/103008?v=4&size=100" width="100px" height="100px" alt="Frank Taillandier"/><br /><sub><b>Frank Taillandier</b></sub></a><br /><a href="#ideas-dirtyf" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
197
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/jamesplease"><img src="https://avatars.githubusercontent.com/u/2322305?v=4&size=100" width="100px" height="100px" alt="James Please"/><br /><sub><b>James Please</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=jamesplease" title="Code">π»</a></td>
|
|
198
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/jas0ncn"><img src="https://avatars.githubusercontent.com/u/3380894?v=4&size=100" width="100px" height="100px" alt="Jason Chen"/><br /><sub><b>Jason Chen</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=jas0ncn" title="Documentation">π</a></td>
|
|
199
|
+
</tr>
|
|
200
|
+
<tr>
|
|
201
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/jgsmarques"><img src="https://avatars.githubusercontent.com/u/15315098?v=4&size=100&size=100" width="100px" height="100px" alt="JoΓ£o Marques"/><br /><sub><b>JoΓ£o Marques</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=jgsmarques" title="Code">π»</a></td>
|
|
202
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/jtoar"><img src="https://avatars.githubusercontent.com/u/32992335?v=4&size=100" width="100px" height="100px" alt="Dominic Saadi"/><br /><sub><b>Dominic Saadi</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=jtoar" title="Code">π»</a></td>
|
|
203
|
+
<td align="center" valign="top" width="16.66%"><a href="https://www.vangelder.tech"><img src="https://avatars.githubusercontent.com/u/1771152?v=4&size=100&size=100" width="100px" height="100px" alt="Kevin VanGelder"/><br /><sub><b>Kevin VanGelder</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=kevinvangelder" title="Code">π»</a></td>
|
|
204
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/KirstieJane"><img src="https://avatars.githubusercontent.com/u/3626306?v=4&size=100" width="100px" height="100px" alt="Kirstie Whitaker"/><br /><sub><b>Kirstie Whitaker</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=kirstiejane" title="Code">π»</a></td>
|
|
205
|
+
<td align="center" valign="top" width="16.66%"><a href="http://about.me/hkpanda"><img src="https://avatars.githubusercontent.com/u/781818?v=4&size=100&size=100" width="100px" height="100px" alt="Hrusikesh Panda"/><br /><sub><b>Hrusikesh Panda</b></sub></a><br /><a href="#ideas-mrchief" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
206
|
+
<td align="center" valign="top" width="16.66%"><a href="https://spencercorwin.com"><img src="https://avatars.githubusercontent.com/u/29364457?v=4&size=100&size=100" width="100px" height="100px" alt="Spencer Corwin"/><br /><sub><b>Spencer Corwin</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=spencercorwin" title="Code">π»</a></td>
|
|
207
|
+
</tr>
|
|
208
|
+
<tr>
|
|
209
|
+
<td align="center" valign="top" width="16.66%"><a href="https://terrymun.com"><img src="https://avatars.githubusercontent.com/u/5593067?v=4&size=100" width="100px" height="100px" alt="Terry Mun-Andersen"/><br /><sub><b>Terry Mun-Andersen</b></sub></a><br /><a href="https://github.com/all-contributors/cli/issues?q=author%3Aterrymun" title="Bug reports">π</a></td>
|
|
210
|
+
<td align="center" valign="top" width="16.66%"><a href="https://felixs.dev"><img src="https://avatars.githubusercontent.com/u/99918022?v=4&size=100" width="100px" height="100px" alt="Felix Schneider"/><br /><sub><b>Felix Schneider</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=trueberryless" title="Code">π»</a> <a href="#maintenance-trueberryless" title="Maintenance">π§</a></td>
|
|
211
|
+
<td align="center" valign="top" width="16.66%"><a href="https://calldata.space"><img src="https://avatars.githubusercontent.com/u/5038030?v=4&size=100" width="100px" height="100px" alt="Charlike Mike Reagent"/><br /><sub><b>Charlike Mike Reagent</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=tunnckocore" title="Code">π»</a></td>
|
|
212
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/tyler-reitz"><img src="https://avatars.githubusercontent.com/u/8248045?v=4&size=100" width="100px" height="100px" alt="Tyler Reitz"/><br /><sub><b>Tyler Reitz</b></sub></a><br /><a href="https://github.com/all-contributors/cli/commits?author=tyler-reitz" title="Code">π»</a></td>
|
|
190
213
|
</tr>
|
|
191
214
|
</tbody>
|
|
192
215
|
</table>
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { cancel, intro, isCancel, log, outro, select, spinner } from '@clack/prompts';
|
|
6
6
|
import yargs from 'yargs';
|
|
7
7
|
import { hideBin } from 'yargs/helpers';
|
|
8
8
|
import * as YoctoColors from 'yoctocolors';
|
|
@@ -12,25 +12,48 @@ import { addContributor } from './contributors/index.js';
|
|
|
12
12
|
import { startGeneration } from './generate/start-generation.js';
|
|
13
13
|
import { init } from './init/index.js';
|
|
14
14
|
import * as repo from './repo/index.js';
|
|
15
|
+
import { cliStatuses } from './util/cliStatuses.js';
|
|
15
16
|
import * as util from './util/index.js';
|
|
16
17
|
|
|
17
18
|
const cwd = process.cwd();
|
|
18
19
|
const defaultRCFile = path.join(cwd, '.all-contributorsrc');
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
const defaultOptions = {
|
|
22
|
+
contributors: [],
|
|
23
|
+
contributorsPerLine: 7,
|
|
24
|
+
contributorsSortAlphabetically: false,
|
|
25
|
+
files: ['README.md'],
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function getCliArgs() {
|
|
21
29
|
return yargs(hideBin(process.argv))
|
|
22
30
|
.scriptName('all-contributors')
|
|
31
|
+
.option('commit', {
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
description: 'Whether or not to automatically commit changes made by the cli',
|
|
34
|
+
})
|
|
23
35
|
.option('config', {
|
|
24
36
|
alias: 'c',
|
|
25
37
|
type: 'string',
|
|
26
38
|
default: defaultRCFile,
|
|
27
39
|
description: 'Path to config file',
|
|
28
40
|
})
|
|
41
|
+
.option('contributors', {
|
|
42
|
+
type: 'array',
|
|
43
|
+
description: 'List of contributors',
|
|
44
|
+
})
|
|
45
|
+
.option('contributorsPerLine', {
|
|
46
|
+
type: 'number',
|
|
47
|
+
description: 'The number of contributors in one row of the table',
|
|
48
|
+
})
|
|
29
49
|
.option('contributorsSortAlphabetically', {
|
|
30
50
|
type: 'boolean',
|
|
31
|
-
default: false,
|
|
32
51
|
description: 'Sort the list of contributors alphabetically in the generated list',
|
|
33
52
|
})
|
|
53
|
+
.option('files', {
|
|
54
|
+
type: 'array',
|
|
55
|
+
description: 'The files that contain the table and the badge, at most 25',
|
|
56
|
+
})
|
|
34
57
|
.help('help')
|
|
35
58
|
.alias('h', 'help')
|
|
36
59
|
.alias('v', 'version')
|
|
@@ -48,11 +71,7 @@ function getArgs() {
|
|
|
48
71
|
.command(
|
|
49
72
|
'check',
|
|
50
73
|
`Compare contributors from the repository with the ones credited in .all-contributorsrc'\n\nUSAGE: all-contributors check`,
|
|
51
|
-
)
|
|
52
|
-
.boolean('commit')
|
|
53
|
-
.default('files', ['README.md'])
|
|
54
|
-
.default('contributorsPerLine', 7)
|
|
55
|
-
.default('contributors', []).argv;
|
|
74
|
+
).argv;
|
|
56
75
|
}
|
|
57
76
|
|
|
58
77
|
async function addContribution(argv) {
|
|
@@ -61,6 +80,9 @@ async function addContribution(argv) {
|
|
|
61
80
|
|
|
62
81
|
// Add or update contributor in the config file
|
|
63
82
|
const data = await addContributor(argv, username, contributions);
|
|
83
|
+
if (data === undefined) {
|
|
84
|
+
return cliStatuses.cancelled;
|
|
85
|
+
}
|
|
64
86
|
|
|
65
87
|
argv.contributors = data.contributors;
|
|
66
88
|
|
|
@@ -68,101 +90,123 @@ async function addContribution(argv) {
|
|
|
68
90
|
|
|
69
91
|
// Commit if configured
|
|
70
92
|
if (argv.commit) {
|
|
71
|
-
|
|
93
|
+
await util.git.commit(argv, data);
|
|
72
94
|
}
|
|
95
|
+
return cliStatuses.success;
|
|
73
96
|
}
|
|
74
97
|
|
|
75
98
|
async function checkContributors(argv) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
const s = spinner();
|
|
100
|
+
s.start('Checking contributors');
|
|
101
|
+
|
|
102
|
+
const repoContributors = await repo;
|
|
103
|
+
|
|
104
|
+
s.stop('Validation complete');
|
|
105
|
+
|
|
106
|
+
const checkKey = repo.getCheckKey(argv.repoType);
|
|
107
|
+
const knownContributions = argv.contributors.reduce((obj, item) => {
|
|
108
|
+
obj[item[checkKey]] = item.contributions;
|
|
109
|
+
return obj;
|
|
110
|
+
}, {});
|
|
111
|
+
const knownContributors = argv.contributors.map((contributor) => contributor[checkKey]);
|
|
112
|
+
|
|
113
|
+
const missingInConfig = repoContributors.filter((key) => !knownContributors.includes(key));
|
|
114
|
+
const missingFromRepo = knownContributors.filter((key) => {
|
|
115
|
+
return (
|
|
116
|
+
!repoContributors.includes(key) &&
|
|
117
|
+
(knownContributions[key].includes('code') || knownContributions[key].includes('test'))
|
|
118
|
+
);
|
|
119
|
+
});
|
|
93
120
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
121
|
+
if (missingInConfig.length) {
|
|
122
|
+
log.info(
|
|
123
|
+
YoctoColors.bold('Missing contributors in .all-contributorsrc:\n') +
|
|
124
|
+
`${missingInConfig.join(', ')}`,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
98
127
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
});
|
|
128
|
+
if (missingFromRepo.length) {
|
|
129
|
+
log.info(
|
|
130
|
+
YoctoColors.bold('Unknown contributors found in .all-contributorsrc:\n') +
|
|
131
|
+
`${missingFromRepo.join(', ')}\n`,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
return cliStatuses.success;
|
|
107
135
|
}
|
|
108
136
|
|
|
109
|
-
function promptForCommand(
|
|
110
|
-
const
|
|
137
|
+
async function promptForCommand() {
|
|
138
|
+
const options = [
|
|
111
139
|
{
|
|
112
|
-
|
|
140
|
+
label: 'Add new contributor or edit contribution type',
|
|
113
141
|
value: 'add',
|
|
114
142
|
},
|
|
115
143
|
{
|
|
116
|
-
|
|
144
|
+
label: 'Re-generate the contributors list',
|
|
117
145
|
value: 'generate',
|
|
118
146
|
},
|
|
119
147
|
{
|
|
120
|
-
|
|
148
|
+
label: 'Compare contributors from the repository with the credited ones',
|
|
121
149
|
value: 'check',
|
|
122
150
|
},
|
|
123
151
|
];
|
|
124
|
-
const questions = [
|
|
125
|
-
{
|
|
126
|
-
type: 'select',
|
|
127
|
-
name: 'command',
|
|
128
|
-
message: 'What do you want to do?',
|
|
129
|
-
choices: choices,
|
|
130
|
-
when: !argv._[0],
|
|
131
|
-
default: choices[0].value,
|
|
132
|
-
},
|
|
133
|
-
];
|
|
134
152
|
|
|
135
|
-
return
|
|
136
|
-
|
|
153
|
+
return select({
|
|
154
|
+
message: 'What do you want to do?',
|
|
155
|
+
options,
|
|
137
156
|
});
|
|
138
157
|
}
|
|
139
158
|
|
|
159
|
+
const getOptions = async () => {
|
|
160
|
+
const args = getCliArgs();
|
|
161
|
+
|
|
162
|
+
// Load and merge config file data into argv
|
|
163
|
+
try {
|
|
164
|
+
const configData = await util.configFile.readConfig(args.config);
|
|
165
|
+
return {
|
|
166
|
+
...defaultOptions,
|
|
167
|
+
...configData,
|
|
168
|
+
...args,
|
|
169
|
+
};
|
|
170
|
+
} catch (error) {
|
|
171
|
+
if (args.config !== defaultRCFile || error.cause?.code !== 'ENOENT') {
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
// If default config file doesn't exist, that's okay
|
|
175
|
+
}
|
|
176
|
+
return { ...defaultOptions, ...args };
|
|
177
|
+
};
|
|
178
|
+
|
|
140
179
|
async function run() {
|
|
141
180
|
try {
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
181
|
+
const options = await getOptions();
|
|
182
|
+
|
|
183
|
+
let command;
|
|
184
|
+
if (options._[0]) {
|
|
185
|
+
command = options._[0];
|
|
186
|
+
} else {
|
|
187
|
+
command = await promptForCommand();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (isCancel(command)) {
|
|
191
|
+
return;
|
|
153
192
|
}
|
|
154
193
|
|
|
155
|
-
|
|
194
|
+
intro('all-contributors-cli');
|
|
195
|
+
let status = cliStatuses.success;
|
|
156
196
|
|
|
157
197
|
switch (command) {
|
|
158
198
|
case 'init':
|
|
159
|
-
|
|
199
|
+
status = await init();
|
|
200
|
+
break;
|
|
160
201
|
case 'generate':
|
|
161
|
-
|
|
202
|
+
status = await startGeneration(options);
|
|
203
|
+
break;
|
|
162
204
|
case 'add':
|
|
163
|
-
|
|
205
|
+
status = await addContribution(options);
|
|
206
|
+
break;
|
|
164
207
|
case 'check':
|
|
165
|
-
|
|
208
|
+
status = await checkContributors(options);
|
|
209
|
+
break;
|
|
166
210
|
default:
|
|
167
211
|
throw new util.UserError(
|
|
168
212
|
`Unknown command: ${command}\n` +
|
|
@@ -170,13 +214,20 @@ async function run() {
|
|
|
170
214
|
'Run `all-contributors --help` for more details.',
|
|
171
215
|
);
|
|
172
216
|
}
|
|
217
|
+
|
|
218
|
+
if (status === cliStatuses.cancelled) {
|
|
219
|
+
return;
|
|
220
|
+
} else {
|
|
221
|
+
outro("You're all set!");
|
|
222
|
+
}
|
|
173
223
|
} catch (e) {
|
|
174
224
|
if (e instanceof util.UserError) {
|
|
175
|
-
|
|
225
|
+
log.error(e.message);
|
|
176
226
|
} else {
|
|
177
|
-
|
|
227
|
+
log.error(e.stack || e.message || e);
|
|
178
228
|
}
|
|
179
229
|
process.exitCode = 1;
|
|
230
|
+
cancel('Oops! There was an error.');
|
|
180
231
|
}
|
|
181
232
|
}
|
|
182
233
|
|
package/dist/contributors/add.js
CHANGED
|
@@ -53,7 +53,7 @@ function addNewContributor(options, username, contributions, infoFetcher) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export function add(options, username, contributions, infoFetcher) {
|
|
56
|
+
export async function add(options, username, contributions, infoFetcher) {
|
|
57
57
|
// case insensitive find
|
|
58
58
|
const exists = options.contributors.find((contributor) => {
|
|
59
59
|
return contributor.login && contributor.login.toLowerCase() === username.toLowerCase();
|
|
@@ -7,24 +7,25 @@ function isNewContributor(contributorList, username) {
|
|
|
7
7
|
return !contributorList.find((contributor) => contributor.login === username);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function addContributor(options, username, contributions) {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export async function addContributor(options, username, contributions) {
|
|
11
|
+
const answers = await prompt(options, username, contributions);
|
|
12
|
+
if (answers === undefined) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const contributors = await add(
|
|
17
|
+
options,
|
|
18
|
+
answers.username,
|
|
19
|
+
answers.contributions,
|
|
20
|
+
repo.getUserInfo,
|
|
18
21
|
);
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
});
|
|
23
|
+
await util.configFile.writeContributors(options.config, contributors);
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
username: answers.username,
|
|
27
|
+
contributions: answers.contributions,
|
|
28
|
+
contributors,
|
|
29
|
+
newContributor: isNewContributor(options.contributors, answers.username),
|
|
30
|
+
};
|
|
30
31
|
}
|
|
@@ -1,66 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isCancel, multiselect, text } from '@clack/prompts';
|
|
2
2
|
|
|
3
3
|
import * as repo from '../repo/index.js';
|
|
4
4
|
import * as util from '../util/index.js';
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
function contributionOptions(options) {
|
|
7
7
|
const types = util.contributionTypes(options);
|
|
8
8
|
const pairs = Object.entries(types);
|
|
9
9
|
const sorted = pairs.sort((a, b) => a[1].description.localeCompare(b[1].description));
|
|
10
10
|
return sorted.map((pair) => ({
|
|
11
|
-
|
|
11
|
+
label: `${pair[1].symbol} ${pair[1].description}`,
|
|
12
12
|
value: pair[0],
|
|
13
13
|
}));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export function getQuestions(options, username, contributions) {
|
|
17
|
-
return [
|
|
18
|
-
{
|
|
19
|
-
type: 'input',
|
|
20
|
-
name: 'username',
|
|
21
|
-
message: `What is the contributor's ${repo.getTypeName(options.repoType)} username?`,
|
|
22
|
-
when: !username,
|
|
23
|
-
validate: function validate(input) {
|
|
24
|
-
if (!input) {
|
|
25
|
-
return 'Username not provided';
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: 'checkbox',
|
|
32
|
-
name: 'contributions',
|
|
33
|
-
message: 'What are the contribution types?',
|
|
34
|
-
when: !contributions,
|
|
35
|
-
default: function (answers) {
|
|
36
|
-
// default values for contributions when updating existing users
|
|
37
|
-
answers.username = answers.username || username;
|
|
38
|
-
return options.contributors
|
|
39
|
-
.filter(
|
|
40
|
-
(entry) => entry.login && entry.login.toLowerCase() === answers.username.toLowerCase(),
|
|
41
|
-
)
|
|
42
|
-
.reduce((allEntries, entry) => allEntries.concat(entry.contributions), []);
|
|
43
|
-
},
|
|
44
|
-
choices: contributionChoices(options),
|
|
45
|
-
validate: function (input, answers) {
|
|
46
|
-
answers.username = answers.username || username;
|
|
47
|
-
const previousContributions = options.contributors
|
|
48
|
-
.filter(
|
|
49
|
-
(entry) => entry.login && entry.login.toLowerCase() === answers.username.toLowerCase(),
|
|
50
|
-
)
|
|
51
|
-
.reduce((allEntries, entry) => allEntries.concat(entry.contributions), []);
|
|
52
|
-
|
|
53
|
-
if (!input.length) {
|
|
54
|
-
return 'Use space to select at least one contribution type.';
|
|
55
|
-
} else if (JSON.stringify(input.sort()) === JSON.stringify(previousContributions.sort())) {
|
|
56
|
-
return 'Nothing changed, use space to select contribution types.';
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
16
|
function getValidUserContributions(options, contributions) {
|
|
65
17
|
const validContributionTypes = util.contributionTypes(options);
|
|
66
18
|
const userContributions = contributions && contributions.split(',');
|
|
@@ -79,12 +31,53 @@ function getValidUserContributions(options, contributions) {
|
|
|
79
31
|
return validUserContributions;
|
|
80
32
|
}
|
|
81
33
|
|
|
34
|
+
async function promptForAnswers(options, username, contributions, defaults) {
|
|
35
|
+
let promptedUsername = username;
|
|
36
|
+
if (promptedUsername === undefined) {
|
|
37
|
+
promptedUsername = await text({
|
|
38
|
+
message: `What is the contributor's ${repo.getTypeName(options.repoType)} username?`,
|
|
39
|
+
validate(inputValue) {
|
|
40
|
+
if (!inputValue) {
|
|
41
|
+
return 'Username is required';
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
if (isCancel(promptedUsername)) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let promptedContributions = defaults.contributions;
|
|
51
|
+
if (contributions === undefined) {
|
|
52
|
+
const previousContributions = options.contributors
|
|
53
|
+
.filter(
|
|
54
|
+
(entry) => entry.login && entry.login.toLowerCase() === promptedUsername.toLowerCase(),
|
|
55
|
+
)
|
|
56
|
+
.reduce((allEntries, entry) => allEntries.concat(entry.contributions), []);
|
|
57
|
+
|
|
58
|
+
promptedContributions = await multiselect({
|
|
59
|
+
message: 'What are the contribution types?',
|
|
60
|
+
initialValues: previousContributions,
|
|
61
|
+
options: contributionOptions(options),
|
|
62
|
+
required: true,
|
|
63
|
+
});
|
|
64
|
+
if (isCancel(promptedContributions)) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return { username: promptedUsername, contributions: promptedContributions };
|
|
70
|
+
}
|
|
71
|
+
|
|
82
72
|
export function prompt(options, username, contributions) {
|
|
83
73
|
const defaults = {
|
|
84
74
|
username,
|
|
85
75
|
contributions:
|
|
86
76
|
contributions === undefined ? [] : getValidUserContributions(options, contributions),
|
|
87
77
|
};
|
|
88
|
-
|
|
89
|
-
|
|
78
|
+
if (username !== undefined && contributions !== undefined) {
|
|
79
|
+
return Promise.resolve(defaults);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return promptForAnswers(options, username, contributions, defaults);
|
|
90
83
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { promises as fs } from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
|
+
import { spinner } from '@clack/prompts';
|
|
5
|
+
|
|
6
|
+
import { cliStatuses } from '../util/cliStatuses.js';
|
|
4
7
|
import { UserError } from '../util/user-error.js';
|
|
5
8
|
import { generate } from './index.js';
|
|
6
9
|
|
|
@@ -19,12 +22,22 @@ async function readFileToUpdate(file, cwd) {
|
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
export async function startGeneration(options, cwd = process.cwd()) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
const s = spinner();
|
|
26
|
+
s.start('Generating contributor list');
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
await Promise.all(
|
|
30
|
+
options.files.map(async (file) => {
|
|
31
|
+
const fileContent = await readFileToUpdate(file, cwd);
|
|
32
|
+
const newFileContent = generate(options, options.contributors, fileContent);
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
await fs.writeFile(path.join(cwd, file), newFileContent);
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
s.error('Uh oh! Something went wrong.');
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
s.stop('Generation complete');
|
|
42
|
+
return cliStatuses.success;
|
|
30
43
|
}
|
package/dist/init/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { promises as fs } from 'fs';
|
|
2
2
|
|
|
3
|
+
import { cliStatuses } from '../util/cliStatuses.js';
|
|
3
4
|
import { configFile } from '../util/index.js';
|
|
4
5
|
import { addBadge, addContributorsList } from './init-content.js';
|
|
5
6
|
import { prompt } from './prompt.js';
|
|
@@ -23,6 +24,10 @@ async function injectInFile(file, fn) {
|
|
|
23
24
|
export async function init() {
|
|
24
25
|
const promptResult = await prompt();
|
|
25
26
|
|
|
27
|
+
if (promptResult === undefined) {
|
|
28
|
+
return cliStatuses.cancelled;
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
await configFile.writeConfig('.all-contributorsrc', promptResult.config);
|
|
27
32
|
|
|
28
33
|
await ensureFileExists(promptResult.contributorFile);
|
|
@@ -32,4 +37,5 @@ export async function init() {
|
|
|
32
37
|
if (promptResult.badgeFile) {
|
|
33
38
|
await injectInFile(promptResult.badgeFile, addBadge);
|
|
34
39
|
}
|
|
40
|
+
return cliStatuses.success;
|
|
35
41
|
}
|
package/dist/init/prompt.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { confirm, isCancel, select, text } from '@clack/prompts';
|
|
2
2
|
|
|
3
3
|
import { git } from '../util/index.js';
|
|
4
4
|
import { conventions } from './commit-conventions.js';
|
|
@@ -7,122 +7,124 @@ function uniqueFiles(files) {
|
|
|
7
7
|
return [...new Set(files.filter(Boolean))];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export
|
|
11
|
-
{
|
|
12
|
-
type: 'input',
|
|
13
|
-
name: 'projectName',
|
|
10
|
+
export async function createPrompts(repoInfo) {
|
|
11
|
+
const projectName = await text({
|
|
14
12
|
message: "What's the name of the repository?",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
initialValue: repoInfo?.projectName,
|
|
14
|
+
});
|
|
15
|
+
if (isCancel(projectName)) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const projectOwner = await text({
|
|
19
20
|
message: 'Who is the owner of the repository?',
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
initialValue: repoInfo?.projectOwner,
|
|
22
|
+
});
|
|
23
|
+
if (isCancel(projectOwner)) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const repoType = await select({
|
|
24
28
|
message: 'What is the repository type?',
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
name: 'GitHub',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
value: 'gitlab',
|
|
32
|
-
name: 'GitLab',
|
|
33
|
-
},
|
|
29
|
+
options: [
|
|
30
|
+
{ label: 'GitHub', value: 'github' },
|
|
31
|
+
{ label: 'GitLab', value: 'gitlab' },
|
|
34
32
|
],
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
initialValue: 'github',
|
|
34
|
+
});
|
|
35
|
+
if (isCancel(repoType)) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const repoHost = await text({
|
|
40
40
|
message: "Where is the repository hosted? Hit Enter if it's on GitHub or GitLab",
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
type: 'input',
|
|
51
|
-
name: 'contributorFile',
|
|
41
|
+
initialValue: repoType === 'gitlab' ? 'https://gitlab.com' : 'https://github.com',
|
|
42
|
+
});
|
|
43
|
+
if (isCancel(repoHost)) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const contributorFile = await text({
|
|
52
48
|
message: 'In which file should contributors be listed?',
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
initialValue: 'README.md',
|
|
50
|
+
});
|
|
51
|
+
if (isCancel(contributorFile)) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const needBadge = await confirm({
|
|
58
56
|
message: 'Do you want a badge tallying the number of contributors?',
|
|
59
|
-
}
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
57
|
+
});
|
|
58
|
+
if (isCancel(needBadge)) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const badgeFile = needBadge
|
|
63
|
+
? await text({
|
|
64
|
+
message: 'In which file should the badge be shown?',
|
|
65
|
+
initialValue: contributorFile,
|
|
66
|
+
})
|
|
67
|
+
: undefined;
|
|
68
|
+
if (isCancel(badgeFile)) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const imageSize = await text({
|
|
74
73
|
message: 'How big should the avatars be? (in px)',
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
initialValue: '100',
|
|
75
|
+
});
|
|
76
|
+
if (isCancel(imageSize)) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const commit = await confirm({
|
|
81
81
|
message: 'Do you want this badge to auto-commit when contributors are added?',
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
initialValue: true,
|
|
83
|
+
});
|
|
84
|
+
if (isCancel(commit)) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const commitConvention = await select({
|
|
87
89
|
message: 'What commit convention would you want it to use?',
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
options: Object.entries(conventions).map(([value, convention]) => ({
|
|
91
|
+
label: convention.name,
|
|
92
|
+
value,
|
|
93
|
+
})),
|
|
94
|
+
initialValue: 'angular',
|
|
95
|
+
});
|
|
96
|
+
if (isCancel(commitConvention)) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const linkToUsage = await confirm({
|
|
94
101
|
message: 'Do you want to add a footer with link to usage?',
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
102
|
+
initialValue: true,
|
|
103
|
+
});
|
|
104
|
+
if (isCancel(linkToUsage)) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
config: {
|
|
110
|
+
projectName,
|
|
111
|
+
projectOwner,
|
|
112
|
+
repoType,
|
|
113
|
+
repoHost,
|
|
114
|
+
files: uniqueFiles([contributorFile, badgeFile]),
|
|
115
|
+
imageSize: parseInt(imageSize, 10),
|
|
116
|
+
commit,
|
|
117
|
+
commitConvention,
|
|
118
|
+
contributors: [],
|
|
119
|
+
contributorsPerLine: 7,
|
|
120
|
+
linkToUsage,
|
|
121
|
+
},
|
|
122
|
+
contributorFile,
|
|
123
|
+
badgeFile,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
98
126
|
|
|
99
|
-
export function prompt() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
.then((repoInfo) => {
|
|
103
|
-
if (repoInfo) {
|
|
104
|
-
questions[0].default = repoInfo.projectName;
|
|
105
|
-
questions[1].default = repoInfo.projectOwner;
|
|
106
|
-
}
|
|
107
|
-
return inquirer.prompt(questions);
|
|
108
|
-
})
|
|
109
|
-
.then((answers) => {
|
|
110
|
-
return {
|
|
111
|
-
config: {
|
|
112
|
-
projectName: answers.projectName,
|
|
113
|
-
projectOwner: answers.projectOwner,
|
|
114
|
-
repoType: answers.repoType,
|
|
115
|
-
repoHost: answers.repoHost,
|
|
116
|
-
files: uniqueFiles([answers.contributorFile, answers.badgeFile]),
|
|
117
|
-
imageSize: answers.imageSize,
|
|
118
|
-
commit: answers.commit,
|
|
119
|
-
commitConvention: answers.commitConvention,
|
|
120
|
-
contributors: [],
|
|
121
|
-
contributorsPerLine: 7,
|
|
122
|
-
linkToUsage: answers.linkToUsage,
|
|
123
|
-
},
|
|
124
|
-
contributorFile: answers.contributorFile,
|
|
125
|
-
badgeFile: answers.badgeFile,
|
|
126
|
-
};
|
|
127
|
-
});
|
|
127
|
+
export async function prompt() {
|
|
128
|
+
const repoInfo = await git.getRepoInfo();
|
|
129
|
+
return createPrompts(repoInfo);
|
|
128
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@all-contributors/cli",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Tool to easily add recognition for new contributors",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"all-contributors",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
+
"@clack/prompts": "^1.9.0",
|
|
46
47
|
"eta": "^4.5.1",
|
|
47
|
-
"inquirer": "^14.0.2",
|
|
48
48
|
"json-fixer": "^1.6.8",
|
|
49
49
|
"yargs": "^18.0.0",
|
|
50
50
|
"yoctocolors": "^2.1.2"
|
|
@@ -52,24 +52,24 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@eslint/js": "10.0.1",
|
|
54
54
|
"@eslint/markdown": "9.0.0",
|
|
55
|
-
"@types/node": "26.6.
|
|
56
|
-
"@vitest/coverage-v8": "5.1.
|
|
55
|
+
"@types/node": "26.6.11",
|
|
56
|
+
"@vitest/coverage-v8": "5.1.2",
|
|
57
57
|
"@vitest/eslint-plugin": "1.6.28",
|
|
58
|
-
"eslint": "10.
|
|
58
|
+
"eslint": "10.16.0",
|
|
59
59
|
"eslint-plugin-import-x": "4.18.1",
|
|
60
60
|
"eslint-plugin-jsonc": "3.4.2",
|
|
61
61
|
"eslint-plugin-package-json": "1.14.0",
|
|
62
62
|
"eslint-plugin-perfectionist": "5.14.0",
|
|
63
|
-
"eslint-plugin-yml": "3.10.
|
|
63
|
+
"eslint-plugin-yml": "3.10.1",
|
|
64
64
|
"git-cz": "4.9.0",
|
|
65
65
|
"globals": "17.14.0",
|
|
66
|
-
"knip": "6.
|
|
67
|
-
"lint-staged": "17.6.
|
|
68
|
-
"nock": "15.0.
|
|
69
|
-
"oxfmt": "0.
|
|
66
|
+
"knip": "6.49.0",
|
|
67
|
+
"lint-staged": "17.6.3",
|
|
68
|
+
"nock": "15.0.7",
|
|
69
|
+
"oxfmt": "0.80.0",
|
|
70
70
|
"prettier": "3.10.1",
|
|
71
71
|
"simple-git-hooks": "2.14.0",
|
|
72
|
-
"vitest": "5.1.
|
|
72
|
+
"vitest": "5.1.2"
|
|
73
73
|
},
|
|
74
74
|
"optionalDependencies": {
|
|
75
75
|
"prettier": "^3"
|
|
@@ -77,6 +77,9 @@
|
|
|
77
77
|
"engines": {
|
|
78
78
|
"node": ">=22.22.0"
|
|
79
79
|
},
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"access": "public"
|
|
82
|
+
},
|
|
80
83
|
"scripts": {
|
|
81
84
|
"add-contributor": "node src/cli.js add",
|
|
82
85
|
"build": "node scripts/build.ts",
|