File tree 3 files changed +43
-5
lines changed
integration-tests/nested-scoped-packages/__snapshots__
3 files changed +43
-5
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,6 @@ patch-package 0.0.0
8
8
• Diffing your files with clean files
9
9
✔ Created file patches/@microsoft+mezzurite-core++@types+angular+1.6.53.patch
10
10
11
- 💡 @types/angular is on GitHub! To draft an issue based on your patch run
12
-
13
- yarn patch-package @microsoft/mezzurite-core/@types/angular --create-issue
14
-
15
11
END SNAPSHOT"
16
12
` ;
17
13
Original file line number Diff line number Diff line change
1
+ import { shouldRecommendIssue } from "./createIssue"
2
+
3
+ describe ( shouldRecommendIssue , ( ) => {
4
+ it ( "Allows most repos" , ( ) => {
5
+ const eigen = shouldRecommendIssue ( {
6
+ org : "artsy" ,
7
+ repo : "eigen" ,
8
+ provider : "GitHub" ,
9
+ } )
10
+ expect ( eigen ) . toBeTruthy ( )
11
+
12
+ const typescript = shouldRecommendIssue ( {
13
+ org : "Microsoft" ,
14
+ repo : "TypeScript" ,
15
+ provider : "GitHub" ,
16
+ } )
17
+ expect ( typescript ) . toBeTruthy ( )
18
+ } )
19
+
20
+ it ( "does not recommend DefinitelyTyped" , ( ) => {
21
+ const typescript = shouldRecommendIssue ( {
22
+ org : "DefinitelyTyped" ,
23
+ repo : "DefinitelyTyped" ,
24
+ provider : "GitHub" ,
25
+ } )
26
+ expect ( typescript ) . toBeFalsy ( )
27
+ } )
28
+ } )
Original file line number Diff line number Diff line change @@ -46,12 +46,26 @@ function getPackageVCSDetails(packageDetails: PackageDetails) {
46
46
}
47
47
}
48
48
49
+ export function shouldRecommendIssue (
50
+ vcsDetails : ReturnType < typeof getPackageVCSDetails > ,
51
+ ) {
52
+ if ( ! vcsDetails ) {
53
+ return true
54
+ }
55
+
56
+ const { repo, org } = vcsDetails
57
+ if ( repo === "DefinitelyTyped" && org === "DefinitelyTyped" ) {
58
+ return false
59
+ }
60
+ return true
61
+ }
62
+
49
63
export function maybePrintIssueCreationPrompt (
50
64
packageDetails : PackageDetails ,
51
65
packageManager : PackageManager ,
52
66
) {
53
67
const vcs = getPackageVCSDetails ( packageDetails )
54
- if ( vcs ) {
68
+ if ( vcs && shouldRecommendIssue ( vcs ) ) {
55
69
console . log ( `💡 ${ chalk . bold ( packageDetails . name ) } is on ${
56
70
vcs . provider
57
71
} ! To draft an issue based on your patch run
You can’t perform that action at this time.
0 commit comments