MCPcopy Index your code
hub / github.com/angular/angular-cli / onInput

Function onInput

packages/angular_devkit/architect/src/create-builder.ts:93–242  ·  view source on GitHub ↗
(i: BuilderInput)

Source from the content-addressed store, hash-verified

91 });
92
93 function onInput(i: BuilderInput) {
94 const builder = i.info as BuilderInfo;
95 const loggerName = i.target ? targetStringFromTarget(i.target) : builder.builderName;
96 const logger = new logging.Logger(loggerName);
97
98 subscriptions.push(logger.subscribe((entry) => log(entry)));
99
100 const context: BuilderContext = {
101 builder,
102 workspaceRoot: i.workspaceRoot,
103 currentDirectory: i.currentDirectory,
104 target: i.target,
105 logger: logger,
106 id: i.id,
107 async scheduleTarget(
108 target: Target,
109 overrides: json.JsonObject = {},
110 scheduleOptions: ScheduleOptions = {},
111 ) {
112 const run = await scheduleByTarget(target, overrides, {
113 scheduler,
114 logger: scheduleOptions.logger || logger.createChild(''),
115 workspaceRoot: i.workspaceRoot,
116 currentDirectory: i.currentDirectory,
117 });
118
119 // We don't want to subscribe errors and complete.
120 subscriptions.push(run.progress.subscribe((event) => progressChannel.next(event)));
121
122 return run;
123 },
124 async scheduleBuilder(
125 builderName: string,
126 options: json.JsonObject = {},
127 scheduleOptions: ScheduleOptions = {},
128 ) {
129 const run = await scheduleByName(builderName, options, {
130 scheduler,
131 target: scheduleOptions.target,
132 logger: scheduleOptions.logger || logger.createChild(''),
133 workspaceRoot: i.workspaceRoot,
134 currentDirectory: i.currentDirectory,
135 });
136
137 // We don't want to subscribe errors and complete.
138 subscriptions.push(run.progress.subscribe((event) => progressChannel.next(event)));
139
140 return run;
141 },
142 async getTargetOptions(target: Target) {
143 return firstValueFrom(
144 scheduler.schedule<Target, json.JsonValue, json.JsonObject>(
145 '..getTargetOptions',
146 target,
147 ).output,
148 );
149 },
150 async getProjectMetadata(target: Target | string) {

Callers 1

createBuilderFunction · 0.85

Calls 13

subscribeMethod · 0.95
targetStringFromTargetFunction · 0.90
isBuilderOutputFunction · 0.90
fromAsyncIterableFunction · 0.90
fnFunction · 0.85
progressFunction · 0.85
nextMethod · 0.80
completeMethod · 0.80
logFunction · 0.70
isAsyncIterableFunction · 0.70
reportRunningMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected