File tree Expand file tree Collapse file tree 3 files changed +43
-5
lines changed
integration-tests/nested-scoped-packages/__snapshots__ Expand file tree Collapse file tree 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
88• Diffing your files with clean files
99✔ Created file patches/@microsoft+mezzurite-core++@types+angular+1.6.53.patch
1010
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-
1511END SNAPSHOT"
1612` ;
1713
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) {
4646 }
4747}
4848
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+
4963export function maybePrintIssueCreationPrompt (
5064 packageDetails : PackageDetails ,
5165 packageManager : PackageManager ,
5266) {
5367 const vcs = getPackageVCSDetails ( packageDetails )
54- if ( vcs ) {
68+ if ( vcs && shouldRecommendIssue ( vcs ) ) {
5569 console . log ( `💡 ${ chalk . bold ( packageDetails . name ) } is on ${
5670 vcs . provider
5771 } ! To draft an issue based on your patch run
You can’t perform that action at this time.
0 commit comments