(childTrace: typeof autoTrace)
| 98 | }; |
| 99 | |
| 100 | const publishDistributablesTasks = (childTrace: typeof autoTrace) => [ |
| 101 | { |
| 102 | title: 'Publishing distributables', |
| 103 | task: childTrace<Parameters<ForgeListrTaskFn<PublishContext>>>( |
| 104 | { name: 'publish-distributables', category: '@electron-forge/core' }, |
| 105 | async ( |
| 106 | childTrace, |
| 107 | { dir, forgeConfig, makeResults, publishers }, |
| 108 | task: ForgeListrTask<PublishContext>, |
| 109 | ) => { |
| 110 | if (publishers.length === 0) { |
| 111 | task.output = 'No publishers configured'; |
| 112 | task.skip(); |
| 113 | return; |
| 114 | } |
| 115 | |
| 116 | return delayTraceTillSignal( |
| 117 | childTrace, |
| 118 | task.newListr<never>( |
| 119 | publishers.map((publisher) => ({ |
| 120 | title: `${chalk.cyan(`[publisher-${publisher.name}]`)} Running the ${chalk.yellow('publish')} command`, |
| 121 | task: childTrace<Parameters<ForgeListrTaskFn>>( |
| 122 | { |
| 123 | name: `publish-${publisher.name}`, |
| 124 | category: '@electron-forge/core', |
| 125 | }, |
| 126 | async (childTrace, _, task) => { |
| 127 | const setStatusLine = (s: string) => { |
| 128 | task.output = s; |
| 129 | }; |
| 130 | await publisher.publish({ |
| 131 | dir, |
| 132 | makeResults: makeResults!, |
| 133 | forgeConfig, |
| 134 | setStatusLine, |
| 135 | }); |
| 136 | }, |
| 137 | ), |
| 138 | rendererOptions: { |
| 139 | persistentOutput: true, |
| 140 | }, |
| 141 | })), |
| 142 | { |
| 143 | rendererOptions: { |
| 144 | collapseSubtasks: false, |
| 145 | collapseErrors: false, |
| 146 | }, |
| 147 | }, |
| 148 | ), |
| 149 | 'run', |
| 150 | ); |
| 151 | }, |
| 152 | ), |
| 153 | rendererOptions: { |
| 154 | persistentOutput: true, |
| 155 | }, |
| 156 | }, |
| 157 | ]; |
no test coverage detected