Skip to content

Commit

Permalink
Merge pull request #325 from betwixt-labs/import-fix
Browse files Browse the repository at this point in the history
fix(ts): don't import tempo if services 'none'
  • Loading branch information
andrewmd5 authored Mar 29, 2024
2 parents 1d6165f + ca26b1d commit 664b39e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Core/Generators/TypeScript/TypeScriptGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ public override ValueTask<string> Compile(BebopSchema schema, GeneratorConfig co
builder.AppendLine(GeneratorUtils.GetXmlAutoGeneratedNotice());
}
builder.AppendLine("import { BebopView, BebopRuntimeError, BebopRecord, BebopJson, BebopTypeGuard, Guid, GuidMap } from \"bebop\";");
if (Schema.Definitions.Values.OfType<ServiceDefinition>().Any())
if (Schema.Definitions.Values.OfType<ServiceDefinition>().Any() && Config.Services is not TempoServices.None)
{
builder.AppendLine("import { Metadata, MethodType } from \"@tempojs/common\";");
if (Config.Services is TempoServices.Client or TempoServices.Both)
Expand Down Expand Up @@ -885,7 +885,6 @@ public override ValueTask<string> Compile(BebopSchema schema, GeneratorConfig co
{
if (!string.IsNullOrWhiteSpace(service.Documentation))
{

builder.AppendLine(FormatDocumentation(service.Documentation, service.DeprecatedDecorator, 0));
}
builder.CodeBlock($"export abstract class {service.BaseClassName()} extends BaseService", indentStep, () =>
Expand Down

0 comments on commit 664b39e

Please sign in to comment.