Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-type-parameters-to-class-name
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio authored Jul 29, 2022
2 parents b10e93b + 991843a commit e84f6ac
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
7 changes: 2 additions & 5 deletions src/cli/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const runTask = async (

switch (task) {
case 'build':
await taskBuild(coreCompiler, strictConfig, sys);
await taskBuild(coreCompiler, strictConfig);
break;

case 'docs':
Expand All @@ -163,10 +163,7 @@ export const runTask = async (
break;

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

case 'test':
Expand Down
7 changes: 2 additions & 5 deletions src/cli/task-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { startupCompilerLog } from './logs';
import { taskWatch } from './task-watch';
import { telemetryBuildFinishedAction } from './telemetry/telemetry';

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

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

await compiler.destroy();

Expand Down
7 changes: 2 additions & 5 deletions src/cli/task-help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { taskTelemetry } from './task-telemetry';
* @param logger a logging implementation to log the results out to the user
* @param sys the abstraction for interfacing with the operating system
*/
export const taskHelp = async (flags: ConfigFlags, logger: d.Logger, sys?: d.CompilerSystem): Promise<void> => {
export const taskHelp = async (flags: ConfigFlags, logger: d.Logger, sys: d.CompilerSystem): Promise<void> => {
const prompt = logger.dim(sys.details.platform === 'windows' ? '>' : '$');

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

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

console.log(`
${logger.bold('Examples:')}
Expand Down
8 changes: 1 addition & 7 deletions src/cli/test/run.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('run', () => {
await runTask(coreCompiler, unvalidatedConfig, 'build', sys);

expect(taskBuildSpy).toHaveBeenCalledTimes(1);
expect(taskBuildSpy).toHaveBeenCalledWith(coreCompiler, validatedConfig, sys);
expect(taskBuildSpy).toHaveBeenCalledWith(coreCompiler, validatedConfig);
});

it('calls the docs task', async () => {
Expand Down Expand Up @@ -235,12 +235,6 @@ describe('run', () => {
expect(taskTelemetrySpy).toHaveBeenCalledTimes(1);
expect(taskTelemetrySpy).toHaveBeenCalledWith(validatedConfig.flags, sys, validatedConfig.logger);
});

it("does not call the telemetry task when a compiler system isn't present", async () => {
await runTask(coreCompiler, unvalidatedConfig, 'telemetry');

expect(taskTelemetrySpy).not.toHaveBeenCalled();
});
});

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

0 comments on commit e84f6ac

Please sign in to comment.