@@ -16,7 +16,7 @@ import {
1616import { getHooks as getTocHooks } from '~/core/toc' ;
1717import { PAGE_PROCESS_CONCURRENCY , Stage , YFM_CONFIG_FILENAME } from '~/constants' ;
1818import { Command } from '~/core/config' ;
19- import { normalizePath , setExt } from '~/core/utils' ;
19+ import { console , normalizePath , setExt } from '~/core/utils' ;
2020import { Extension as LocalSearchExtension } from '~/extensions/local-search' ;
2121import { Extension as GenericIncluderExtension } from '~/extensions/generic-includer' ;
2222import { Extension as OpenapiIncluderExtension } from '~/extensions/openapi' ;
@@ -170,9 +170,11 @@ export class Build extends BaseProgram<BuildConfig, BuildArgs> {
170170 await getHooks ( this ) . BeforeRun . for ( outputFormat ) . promise ( this . run ) ;
171171
172172 if ( isMainThread ) {
173+ console . log ( 'Prepare build input' ) ;
173174 await this . prepareInput ( ) ;
174175 }
175176
177+ console . log ( 'Prepare build runtime' ) ;
176178 await this . prepareRun ( ) ;
177179
178180 if ( ! isMainThread ) {
@@ -181,6 +183,7 @@ export class Build extends BaseProgram<BuildConfig, BuildArgs> {
181183
182184 await threads . setup ( ) ;
183185
186+ console . log ( 'Collect project files info' ) ;
184187 const ignore = this . run . config . ignore . map ( ( rule ) => rule . replace ( / \/ * $ / g, '/**' ) ) ;
185188 const paths = await this . run . glob ( '**/toc.yaml' , {
186189 cwd : this . run . input ,
@@ -208,6 +211,7 @@ export class Build extends BaseProgram<BuildConfig, BuildArgs> {
208211 const { tocs, entries, copymap} = this . run . toc ;
209212 const vcs = this . run . vcs . getData ( ) ;
210213
214+ console . log ( 'Sync project data' ) ;
211215 await this . sync ( tocs , entries , copymap , vcs ) ;
212216
213217 await this . concurrently ( tocs , async ( raw ) => {
@@ -216,6 +220,7 @@ export class Build extends BaseProgram<BuildConfig, BuildArgs> {
216220 await this . run . write ( join ( this . run . output , toc . path ) , toc . toString ( ) , true ) ;
217221 } ) ;
218222
223+ console . log ( 'Process project files' ) ;
219224 await this . concurrently ( entries , async ( entry ) => {
220225 try {
221226 this . run . logger . proc ( entry ) ;
@@ -234,12 +239,14 @@ export class Build extends BaseProgram<BuildConfig, BuildArgs> {
234239
235240 await handler ( this . run ) ;
236241
242+ console . log ( 'Aggregate build artifacts' ) ;
237243 await this . releaseRun ( ) ;
238244
239245 await getHooks ( this ) . AfterRun . for ( outputFormat ) . promise ( this . run ) ;
240246 await getBaseHooks ( this ) . AfterAnyRun . promise ( this . run ) ;
241247
242- await this . releaseOutput ( ) ;
248+ console . log ( 'Cleanup build results' ) ;
249+ await this . cleanup ( ) ;
243250 }
244251
245252 async concurrently < T > ( items : T [ ] , iterator : ( item : T , index : number ) => Promise < void > ) {
@@ -281,10 +288,6 @@ export class Build extends BaseProgram<BuildConfig, BuildArgs> {
281288 await this . run . copy ( originalInput , input , [ 'node_modules/**' , '*/node_modules/**' ] ) ;
282289 }
283290
284- private async releaseOutput ( ) {
285- await this . cleanup ( ) ;
286- }
287-
288291 private async prepareRun ( ) {
289292 await this . run . vars . init ( ) ;
290293 await this . run . leading . init ( ) ;
0 commit comments