File tree 8 files changed +16
-17
lines changed
8 files changed +16
-17
lines changed Original file line number Diff line number Diff line change 11
11
"format" : " prettier --write dist songs src test README.md .prettierrc jest.config.js package.json tsconfig.json" ,
12
12
"github" : " ts-node src/github"
13
13
},
14
- "dependencies" : {},
15
14
"devDependencies" : {
16
15
"@types/jest" : " ^29.5.14" ,
17
16
"@types/node" : " ^22.13.10" ,
18
17
"dayjs" : " ^1.11.13" ,
19
18
"gray-matter" : " ^4.0.3" ,
20
19
"jest" : " ^29.7.0" ,
21
20
"jest-expect-message" : " ^1.1.3" ,
22
- "prettier" : " ^2.8.8 " ,
21
+ "prettier" : " ^3.5.3 " ,
23
22
"ts-jest" : " ^29.2.6" ,
24
23
"ts-node" : " ^10.9.2" ,
25
24
"typescript" : " ^5.8.2"
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ import { isoDateRegex } from '../util/regex';
11
11
import createSongs from '../util/createSongs' ;
12
12
import dayjs from 'dayjs' ;
13
13
14
- export default function build ( customUpdatedAt : string | undefined ) : void {
14
+ export default async function build ( customUpdatedAt : string | undefined ) : Promise < void > {
15
15
const updatedAt = customUpdatedAt ?. match ( isoDateRegex )
16
16
? customUpdatedAt
17
17
: dayjs ( ) . format ( 'YYYY-MM-DD' ) ;
18
18
19
19
const buildSongs = createSongs ( updatedAt ) ;
20
20
21
- writeJson ( buildSongs . json ) ;
21
+ writeJson ( await buildSongs . json ) ;
22
22
writeXml ( buildSongs . xml ) ;
23
23
writeXmlWithoutIds ( buildSongs . xmlNoIds ) ;
24
24
console . log ( 'Build complete and saved' ) ;
@@ -31,7 +31,7 @@ export default function build(customUpdatedAt: string | undefined): void {
31
31
} ) ;
32
32
if ( filesToRemove . length )
33
33
console . log (
34
- `Removed ${ filesToRemove . length } unneeded file${ filesToRemove . length !== 1 ? 's' : '' } `
34
+ `Removed ${ filesToRemove . length } unneeded file${ filesToRemove . length !== 1 ? 's' : '' } ` ,
35
35
) ;
36
36
}
37
37
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ function generateDefaultSongFileContent(
33
33
composer,
34
34
tags = [ ] ,
35
35
content,
36
- } : Omit < Song , 'id' | 'title' | 'deleted' | 'content' > & { content ?: string }
36
+ } : Omit < Song , 'id' | 'title' | 'deleted' | 'content' > & { content ?: string } ,
37
37
) : string {
38
38
let contentBuilder = `---\ntitle: ${ title } \n` ;
39
39
contentBuilder += `author: ${ author || '' } \n` ;
@@ -47,7 +47,7 @@ function generateDefaultSongFileContent(
47
47
}
48
48
49
49
function parseArgs (
50
- args : string [ ]
50
+ args : string [ ] ,
51
51
) : Partial < Omit < Song , 'title' | 'deleted' | 'tags' > > & { tags : Tag [ ] } {
52
52
const [ idString ] = getArgValues ( args , 'id' ) ;
53
53
const [ author ] = getArgValues ( args , 'author' ) ;
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export function sortXmlifyableSongs(songs: XmlifyableSong[]): XmlifyableSong[] {
81
81
. sort (
82
82
( a , b ) =>
83
83
LEGACY_ORDER . findIndex ( ( category ) => a . category === category ) -
84
- LEGACY_ORDER . findIndex ( ( category ) => b . category === category )
84
+ LEGACY_ORDER . findIndex ( ( category ) => b . category === category ) ,
85
85
)
86
86
. sort ( ( a , b ) => ( b . sorting || 0 ) - ( a . sorting || 0 ) ) ;
87
87
}
@@ -91,7 +91,7 @@ export function sortSongs(songs: Song[]): Song[] {
91
91
. sort (
92
92
( a , b ) =>
93
93
CATEGORY_ORDER . findIndex ( ( category ) => a . tags [ 0 ] === category ) -
94
- CATEGORY_ORDER . findIndex ( ( category ) => b . tags [ 0 ] === category )
94
+ CATEGORY_ORDER . findIndex ( ( category ) => b . tags [ 0 ] === category ) ,
95
95
)
96
96
. sort ( ( a , b ) => ( b . sorting || 0 ) - ( a . sorting || 0 ) ) ;
97
97
}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function songContentToXml(content: Song['content']): string {
35
35
paragraph
36
36
. split ( '\n' )
37
37
. map ( ( s ) => s . substring ( 2 ) )
38
- . join ( '\n' )
38
+ . join ( '\n' ) ,
39
39
) } </comment>\n`;
40
40
} else {
41
41
xml += `\t\t<p>${ xmlifyParagraph ( paragraph ) } </p>\n` ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ describe('All songs have valid data', () => {
20
20
Object . keys ( metaKeys ) . forEach ( ( metaKey ) => {
21
21
expect (
22
22
validMetaKeys ,
23
- `Value ${ metaKey } not a valid metadata property (found in ${ path } )`
23
+ `Value ${ metaKey } not a valid metadata property (found in ${ path } )` ,
24
24
) . toContain ( metaKey ) ;
25
25
} ) ;
26
26
} ) ;
@@ -43,7 +43,7 @@ describe('All songs have valid data', () => {
43
43
const invalidTag = song . tags . find ( ( tag ) => ! TAGS . includes ( tag ) ) ;
44
44
expect (
45
45
invalidTag ,
46
- `Song with ID=${ song . id } and title '${ song . title } ' contains the invalid tag '${ invalidTag } '`
46
+ `Song with ID=${ song . id } and title '${ song . title } ' contains the invalid tag '${ invalidTag } '` ,
47
47
) . toBeUndefined ( ) ;
48
48
} ) ;
49
49
} ) ;
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ describe('All IDs are valid', () => {
48
48
songs . forEach ( ( song ) => {
49
49
expect (
50
50
song . id ,
51
- `No song ID can be greater than 4095 (found in song with title ${ song . title } )`
51
+ `No song ID can be greater than 4095 (found in song with title ${ song . title } )` ,
52
52
) . toBeLessThanOrEqual ( 4095 ) ;
53
53
} ) ;
54
54
} ) ;
Original file line number Diff line number Diff line change @@ -1927,10 +1927,10 @@ pkg-dir@^4.2.0:
1927
1927
dependencies :
1928
1928
find-up "^4.0.0"
1929
1929
1930
- prettier@^2.8.8 :
1931
- version "2.8.8 "
1932
- resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8 .tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da "
1933
- integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q ==
1930
+ prettier@^3.5.3 :
1931
+ version "3.5.3 "
1932
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.3 .tgz#4fc2ce0d657e7a02e602549f053b239cb7dfe1b5 "
1933
+ integrity sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw ==
1934
1934
1935
1935
pretty-format@^29.0.0, pretty-format@^29.7.0 :
1936
1936
version "29.7.0"
You can’t perform that action at this time.
0 commit comments