Commit 0d83022 1 parent 4307dfd commit 0d83022 Copy full SHA for 0d83022
File tree 3 files changed +25
-0
lines changed
3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -506,6 +506,7 @@ export class Application extends AbstractComponent<
506
506
507
507
let successFinished = true ;
508
508
let currentProgram : ts . Program | undefined ;
509
+ let watches : ts . FileWatcher [ ] = [ ]
509
510
510
511
const runSuccess = ( ) => {
511
512
if ( ! currentProgram ) {
@@ -528,6 +529,24 @@ export class Application extends AbstractComponent<
528
529
return ;
529
530
}
530
531
const project = this . converter . convert ( entryPoints ) ;
532
+ watches . forEach ( w => w . close ( ) )
533
+ watches = [ ]
534
+ const lastProgram = currentProgram ;
535
+ const addWatch = ( path : string ) => void watches . push ( host . watchFile ( path , ( ) => {
536
+ if ( ! currentProgram ) {
537
+ currentProgram = lastProgram
538
+ if ( successFinished ) runSuccess ( )
539
+ }
540
+ } ) )
541
+ for ( const d of project . documents || [ ] ) {
542
+ const path = project . files . getReflectionPath ( d )
543
+ if ( path ) addWatch ( path )
544
+ }
545
+ const css = this . options . getValue ( "customCss" )
546
+ if ( css ) addWatch ( css )
547
+ const js = this . options . getValue ( "customJs" )
548
+ if ( js ) addWatch ( js )
549
+ if ( project . readmeFile ) addWatch ( project . readmeFile )
531
550
currentProgram = undefined ;
532
551
successFinished = false ;
533
552
void success ( project ) . then ( ( ) => {
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ export class PackagePlugin extends ConverterComponent {
135
135
) ;
136
136
137
137
project . readme = content ;
138
+ project . readmeFile = this . readmeFile
138
139
139
140
// This isn't ideal, but seems better than figuring out the readme
140
141
// path over in the include plugin...
Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ export class ProjectReflection extends ContainerReflection {
68
68
*/
69
69
readme ?: CommentDisplayPart [ ] ;
70
70
71
+ /**
72
+ * The path to the readme.md file, if found
73
+ */
74
+ readmeFile ?: string
75
+
71
76
/**
72
77
* Object which describes where to find content for relative links.
73
78
*/
You can’t perform that action at this time.
0 commit comments