Skip to content

Commit 56ab0c0

Browse files
authored
Merge pull request #10 from fingerprintjs/feat/platform-bullet-points
This PR updates the release notes formatting to list dependency version ranges as markdown bullet points
2 parents 6312ffa + d1f5457 commit 56ab0c0

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ Example generated release notes:
8282

8383
### Supported Native SDK Version Range
8484

85-
Fingerprint Android SDK Version Range: `>= 2.7.0 and < 3.0.0`
86-
87-
Fingerprint iOS SDK Version Range: `>= 2.7.0 and < 3.0.0`
85+
* Fingerprint Android SDK Version Range: `>= 2.7.0 and < 3.0.0`
86+
* Fingerprint iOS SDK Version Range: `>= 2.7.0 and < 3.0.0`
8887
```
8988

9089
## Requirements

src/generateNotes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const formatter = (platforms: { displayName: string; versionRange: string }[], h
1212

1313
result += platforms
1414
.map(({ displayName, versionRange }) => {
15-
return `${displayName} Version Range: **\`${versionRange}\`**`
15+
return `* ${displayName} Version Range: **\`${versionRange}\`**`
1616
})
17-
.join('\n\n')
17+
.join('\n')
1818

1919
return result
2020
}

test/index.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('index', () => {
4242
},
4343
generateNotesContext
4444
)
45-
).resolves.toBe(`${android.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`)
45+
).resolves.toBe(`* ${android.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`)
4646
}, 30000)
4747
it('resolves android version (backport)', async () => {
4848
const android = pluginConfig.platforms.android
@@ -54,7 +54,7 @@ describe('index', () => {
5454
},
5555
generateNotesContext
5656
)
57-
).resolves.toBe(`${android.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`)
57+
).resolves.toBe(`* ${android.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`)
5858
}, 30000)
5959
it('resolves iOS version', async () => {
6060
const iOS = pluginConfig.platforms.iOS
@@ -68,7 +68,7 @@ describe('index', () => {
6868
},
6969
generateNotesContext
7070
)
71-
).resolves.toBe(`${iOS.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`)
71+
).resolves.toBe(`* ${iOS.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`)
7272
})
7373
it('resolves iOS version (backport)', async () => {
7474
const iOS = pluginConfig.platforms.iOS
@@ -80,7 +80,7 @@ describe('index', () => {
8080
},
8181
generateNotesContext
8282
)
83-
).resolves.toBe(`${iOS.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`)
83+
).resolves.toBe(`* ${iOS.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`)
8484
})
8585
it('throws error on cwd not set', async () => {
8686
const testGenerateNotesContext = {
@@ -112,22 +112,22 @@ describe('index', () => {
112112
const heading = 'Example Heading'
113113
const { iOS, android } = pluginConfig.platforms
114114

115-
const expectedHeading = `### ${heading}`
116-
const expectedAndroid = `${android.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`
117-
const expectedIOS = `${iOS.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`
115+
const expectedHeading = `### ${heading}\n`
116+
const expectedAndroid = `* ${android.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`
117+
const expectedIOS = `* ${iOS.displayName} Version Range: **\`>= 1.2.3 and < 4.5.6\`**`
118118

119119
const subTestCases = [
120120
{
121121
platforms: { iOS, android },
122-
expected: [expectedHeading, expectedAndroid, expectedIOS].join('\n\n'),
122+
expected: [expectedHeading, expectedAndroid, expectedIOS].join('\n'),
123123
},
124124
{
125125
platforms: { iOS },
126-
expected: [expectedHeading, expectedIOS].join('\n\n'),
126+
expected: [expectedHeading, expectedIOS].join('\n'),
127127
},
128128
{
129129
platforms: { android },
130-
expected: [expectedHeading, expectedAndroid].join('\n\n'),
130+
expected: [expectedHeading, expectedAndroid].join('\n'),
131131
},
132132
]
133133

0 commit comments

Comments
 (0)