@@ -7,7 +7,7 @@ import fs from "fs-extra";
7
7
// import { createBuilder } from "@angular-devkit/architect";
8
8
import { WorkspaceNodeModulesArchitectHost } from "@angular-devkit/architect/node" ;
9
9
import { NodeJsSyncHost } from "@angular-devkit/core/node" ;
10
- import { workspaces } from "@angular-devkit/core" ;
10
+ import { workspaces , logging } from "@angular-devkit/core" ;
11
11
import { Architect } from "@angular-devkit/architect" ;
12
12
// import {
13
13
// ApplicationBuilderOptions,
@@ -293,35 +293,45 @@ class ServerlessReact {
293
293
294
294
console . log ( "!!! projectMetadata" , projectMetadata ) ;
295
295
296
- const targetOptions = await architectHost . getOptionsForTarget ( {
297
- project : projectName ,
298
- target : "build" ,
299
- } ) ;
300
-
301
- if ( ! targetOptions ) {
302
- throw new Error ( `targetOptions does not exist` ) ;
303
- }
304
-
305
- console . log ( "!!! targetOptions" , targetOptions ) ;
306
-
307
- // const scheduleTargetRun = await architect.scheduleTarget({
296
+ // const targetOptions = await architectHost.getOptionsForTarget({
297
+ // configuration: "",
308
298
// project: projectName,
309
299
// target: "build",
310
300
// });
311
301
312
- // console.log("!!! scheduleTargetRun", scheduleTargetRun);
313
- // const scheduleTargetLastOutput = await scheduleTargetRun.lastOutput;
314
- // console.log("!!! scheduleTargetLastOutput", scheduleTargetLastOutput);
302
+ // if (!targetOptions) {
303
+ // throw new Error(`targetOptions does not exist`);
304
+ // }
305
+
306
+ // console.log("!!! targetOptions", targetOptions);
307
+
308
+ const logger = new logging . Logger ( PLUGIN_NAME ) ;
309
+ logger . subscribe ( ( entry ) => {
310
+ console . log ( entry . message ) ;
311
+ } ) ;
315
312
316
- const scheduleBuilderRun = await architect . scheduleBuilder (
317
- buildTarget . builder ,
318
- targetOptions ,
319
- JSON . parse ( JSON . stringify ( { target : projectName } ) ) // skip type checking
313
+ const scheduleTargetRun = await architect . scheduleTarget (
314
+ {
315
+ configuration : "" ,
316
+ project : projectName ,
317
+ target : "build" ,
318
+ } ,
319
+ { } ,
320
+ { logger }
320
321
) ;
321
322
322
- console . log ( "!!! scheduleBuilderRun" , scheduleBuilderRun ) ;
323
- const scheduleBuilderLastOutput = await scheduleBuilderRun . lastOutput ;
324
- console . log ( "!!! scheduleBuilderLastOutput" , scheduleBuilderLastOutput ) ;
323
+ console . log ( "!!! scheduleTargetRun" , scheduleTargetRun ) ;
324
+ const scheduleTargetLastOutput = await scheduleTargetRun . lastOutput ;
325
+ console . log ( "!!! scheduleTargetLastOutput" , scheduleTargetLastOutput ) ;
326
+
327
+ // const scheduleBuilderRun = await architect.scheduleBuilder(
328
+ // buildTarget.builder,
329
+ // targetOptions
330
+ // );
331
+
332
+ // console.log("!!! scheduleBuilderRun", scheduleBuilderRun);
333
+ // const scheduleBuilderLastOutput = await scheduleBuilderRun.lastOutput;
334
+ // console.log("!!! scheduleBuilderLastOutput", scheduleBuilderLastOutput);
325
335
326
336
// const host = workspaces.createWorkspaceHost(new NodeJsSyncHost());
327
337
0 commit comments