Skip to content

Commit e84f6ac

Browse files
authored
Merge branch 'main' into feat/add-type-parameters-to-class-name
2 parents b10e93b + 991843a commit e84f6ac

File tree

4 files changed

+7
-22
lines changed

4 files changed

+7
-22
lines changed

src/cli/run.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const runTask = async (
138138

139139
switch (task) {
140140
case 'build':
141-
await taskBuild(coreCompiler, strictConfig, sys);
141+
await taskBuild(coreCompiler, strictConfig);
142142
break;
143143

144144
case 'docs':
@@ -163,10 +163,7 @@ export const runTask = async (
163163
break;
164164

165165
case 'telemetry':
166-
// TODO(STENCIL-148) make this parameter no longer optional, remove the surrounding if statement
167-
if (sys) {
168-
await taskTelemetry(strictConfig.flags, sys, strictConfig.logger);
169-
}
166+
await taskTelemetry(strictConfig.flags, sys, strictConfig.logger);
170167
break;
171168

172169
case 'test':

src/cli/task-build.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { startupCompilerLog } from './logs';
66
import { taskWatch } from './task-watch';
77
import { telemetryBuildFinishedAction } from './telemetry/telemetry';
88

9-
export const taskBuild = async (coreCompiler: CoreCompiler, config: d.ValidatedConfig, sys?: d.CompilerSystem) => {
9+
export const taskBuild = async (coreCompiler: CoreCompiler, config: d.ValidatedConfig) => {
1010
if (config.flags.watch) {
1111
// watch build
1212
await taskWatch(coreCompiler, config);
@@ -24,10 +24,7 @@ export const taskBuild = async (coreCompiler: CoreCompiler, config: d.ValidatedC
2424
const compiler = await coreCompiler.createCompiler(config);
2525
const results = await compiler.build();
2626

27-
// TODO(STENCIL-148) make this parameter no longer optional, remove the surrounding if statement
28-
if (sys) {
29-
await telemetryBuildFinishedAction(sys, config, coreCompiler, results);
30-
}
27+
await telemetryBuildFinishedAction(config.sys, config, coreCompiler, results);
3128

3229
await compiler.destroy();
3330

src/cli/task-help.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { taskTelemetry } from './task-telemetry';
99
* @param logger a logging implementation to log the results out to the user
1010
* @param sys the abstraction for interfacing with the operating system
1111
*/
12-
export const taskHelp = async (flags: ConfigFlags, logger: d.Logger, sys?: d.CompilerSystem): Promise<void> => {
12+
export const taskHelp = async (flags: ConfigFlags, logger: d.Logger, sys: d.CompilerSystem): Promise<void> => {
1313
const prompt = logger.dim(sys.details.platform === 'windows' ? '>' : '$');
1414

1515
console.log(`
@@ -42,10 +42,7 @@ export const taskHelp = async (flags: ConfigFlags, logger: d.Logger, sys?: d.Com
4242
4343
`);
4444

45-
// TODO(STENCIL-148) make this parameter no longer optional, remove the surrounding if statement
46-
if (sys) {
47-
await taskTelemetry(flags, sys, logger);
48-
}
45+
await taskTelemetry(flags, sys, logger);
4946

5047
console.log(`
5148
${logger.bold('Examples:')}

src/cli/test/run.spec.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe('run', () => {
181181
await runTask(coreCompiler, unvalidatedConfig, 'build', sys);
182182

183183
expect(taskBuildSpy).toHaveBeenCalledTimes(1);
184-
expect(taskBuildSpy).toHaveBeenCalledWith(coreCompiler, validatedConfig, sys);
184+
expect(taskBuildSpy).toHaveBeenCalledWith(coreCompiler, validatedConfig);
185185
});
186186

187187
it('calls the docs task', async () => {
@@ -235,12 +235,6 @@ describe('run', () => {
235235
expect(taskTelemetrySpy).toHaveBeenCalledTimes(1);
236236
expect(taskTelemetrySpy).toHaveBeenCalledWith(validatedConfig.flags, sys, validatedConfig.logger);
237237
});
238-
239-
it("does not call the telemetry task when a compiler system isn't present", async () => {
240-
await runTask(coreCompiler, unvalidatedConfig, 'telemetry');
241-
242-
expect(taskTelemetrySpy).not.toHaveBeenCalled();
243-
});
244238
});
245239

246240
it('calls the test task', async () => {

0 commit comments

Comments
 (0)