diff --git a/packages/http-client-csharp/emitter/src/code-model-writer.ts b/packages/http-client-csharp/emitter/src/code-model-writer.ts index e60360c32b5..f8b26674d2c 100644 --- a/packages/http-client-csharp/emitter/src/code-model-writer.ts +++ b/packages/http-client-csharp/emitter/src/code-model-writer.ts @@ -4,9 +4,9 @@ import { UsageFlags } from "@azure-tools/typespec-client-generator-core"; import { resolvePath } from "@typespec/compiler"; import { configurationFileName, tspOutputFileName } from "./constants.js"; -import { CSharpEmitterContext } from "./sdk-context.js"; -import { CodeModel } from "./type/code-model.js"; -import { Configuration } from "./type/configuration.js"; +import type { CSharpEmitterContext } from "./sdk-context.js"; +import type { CodeModel } from "./type/code-model.js"; +import type { Configuration } from "./type/configuration.js"; /** * Serializes the code model to a JSON string with reference tracking. diff --git a/packages/http-client-csharp/emitter/src/emit-generate.browser.ts b/packages/http-client-csharp/emitter/src/emit-generate.browser.ts index cb557a2ba6d..4b7006d6900 100644 --- a/packages/http-client-csharp/emitter/src/emit-generate.browser.ts +++ b/packages/http-client-csharp/emitter/src/emit-generate.browser.ts @@ -5,7 +5,7 @@ import { resolvePath } from "@typespec/compiler"; import type { GenerateOptions } from "./emit-generate.js"; -import { CSharpEmitterContext } from "./sdk-context.js"; +import type { CSharpEmitterContext } from "./sdk-context.js"; const SERVER_URL = "https://csharp-playground-server.azurewebsites.net"; const MAX_RESPONSE_SIZE = 10 * 1024 * 1024; // 10 MB diff --git a/packages/http-client-csharp/emitter/src/emit-generate.ts b/packages/http-client-csharp/emitter/src/emit-generate.ts index a6421ca8906..44109e00ed8 100644 --- a/packages/http-client-csharp/emitter/src/emit-generate.ts +++ b/packages/http-client-csharp/emitter/src/emit-generate.ts @@ -3,9 +3,9 @@ // Node.js implementation: runs the .NET generator locally via subprocess. +import type { Diagnostic } from "@typespec/compiler"; import { createDiagnosticCollector, - Diagnostic, getDirectoryPath, joinPaths, NoTarget, @@ -21,7 +21,7 @@ import { } from "./constants.js"; import { execAsync, execCSharpGenerator } from "./lib/exec-utils.js"; import { createDiagnostic } from "./lib/lib.js"; -import { CSharpEmitterContext } from "./sdk-context.js"; +import type { CSharpEmitterContext } from "./sdk-context.js"; export interface GenerateOptions { outputFolder: string; diff --git a/packages/http-client-csharp/emitter/src/emitter.ts b/packages/http-client-csharp/emitter/src/emitter.ts index 9df2a95330b..fe104f0dde9 100644 --- a/packages/http-client-csharp/emitter/src/emitter.ts +++ b/packages/http-client-csharp/emitter/src/emitter.ts @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { createSdkContext, SdkContext } from "@azure-tools/typespec-client-generator-core"; -import { - createDiagnosticCollector, - Diagnostic, - EmitContext, - Program, - resolvePath, -} from "@typespec/compiler"; +import type { SdkContext } from "@azure-tools/typespec-client-generator-core"; +import { createSdkContext } from "@azure-tools/typespec-client-generator-core"; +import type { Diagnostic, EmitContext, Program } from "@typespec/compiler"; +import { createDiagnosticCollector, resolvePath } from "@typespec/compiler"; import { serializeCodeModel } from "./code-model-writer.js"; import { generate } from "./emit-generate.js"; import { createModel } from "./lib/client-model-builder.js"; import { LoggerLevel } from "./lib/logger-level.js"; import { Logger } from "./lib/logger.js"; -import { CSharpEmitterOptions, resolveOptions } from "./options.js"; -import { createCSharpEmitterContext, CSharpEmitterContext } from "./sdk-context.js"; -import { CodeModel } from "./type/code-model.js"; -import { Configuration } from "./type/configuration.js"; +import type { CSharpEmitterOptions } from "./options.js"; +import { resolveOptions } from "./options.js"; +import type { CSharpEmitterContext } from "./sdk-context.js"; +import { createCSharpEmitterContext } from "./sdk-context.js"; +import type { CodeModel } from "./type/code-model.js"; +import type { Configuration } from "./type/configuration.js"; /** * Creates a code model by executing the full emission logic. diff --git a/packages/http-client-csharp/emitter/src/index.ts b/packages/http-client-csharp/emitter/src/index.ts index fb26b5a8b09..42ca3b0703a 100644 --- a/packages/http-client-csharp/emitter/src/index.ts +++ b/packages/http-client-csharp/emitter/src/index.ts @@ -10,18 +10,15 @@ export { createModel } from "./lib/client-model-builder.js"; export { $lib, createDiagnostic, getTracer, reportDiagnostic } from "./lib/lib.js"; export { LoggerLevel } from "./lib/logger-level.js"; export { Logger } from "./lib/logger.js"; -export { - CSharpEmitterOptions, - CSharpEmitterOptionsSchema, - defaultOptions, - resolveOptions, -} from "./options.js"; +export { CSharpEmitterOptionsSchema, defaultOptions, resolveOptions } from "./options.js"; +export type { CSharpEmitterOptions } from "./options.js"; // we export `createCSharpEmitterContext` only for autorest.csharp because it uses the emitter to generate the code model file but not calling the dll here // we could remove this export when in the future we deprecate autorest.csharp export { $dynamicModel, isDynamicModel } from "./lib/decorators.js"; -export { CSharpEmitterContext, createCSharpEmitterContext } from "./sdk-context.js"; -export { CodeModel } from "./type/code-model.js"; -export { InputClient, InputModelType } from "./type/input-type.js"; +export { createCSharpEmitterContext } from "./sdk-context.js"; +export type { CSharpEmitterContext } from "./sdk-context.js"; +export type { CodeModel } from "./type/code-model.js"; +export type { InputClient, InputModelType } from "./type/input-type.js"; /** @internal */ export { $decorators } from "./tsp-index.js"; diff --git a/packages/http-client-csharp/emitter/src/lib/client-converter.ts b/packages/http-client-csharp/emitter/src/lib/client-converter.ts index 2dbab230f56..69a49c614d6 100644 --- a/packages/http-client-csharp/emitter/src/lib/client-converter.ts +++ b/packages/http-client-csharp/emitter/src/lib/client-converter.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { +import type { SdkClientType as SdkClientTypeOfT, SdkCredentialParameter, SdkEndpointParameter, @@ -9,10 +9,11 @@ import { SdkHttpOperation, SdkMethodParameter, } from "@azure-tools/typespec-client-generator-core"; -import { createDiagnosticCollector, Diagnostic, NoTarget } from "@typespec/compiler"; -import { CSharpEmitterContext } from "../sdk-context.js"; +import type { Diagnostic } from "@typespec/compiler"; +import { createDiagnosticCollector, NoTarget } from "@typespec/compiler"; +import type { CSharpEmitterContext } from "../sdk-context.js"; import { InputParameterScope } from "../type/input-parameter-scope.js"; -import { +import type { InputClient, InputEndpointParameter, InputParameter, diff --git a/packages/http-client-csharp/emitter/src/lib/client-model-builder.ts b/packages/http-client-csharp/emitter/src/lib/client-model-builder.ts index f1165eff1a6..72b2047fa85 100644 --- a/packages/http-client-csharp/emitter/src/lib/client-model-builder.ts +++ b/packages/http-client-csharp/emitter/src/lib/client-model-builder.ts @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { +import type { SdkClientType, SdkEnumType, SdkHttpOperation, } from "@azure-tools/typespec-client-generator-core"; -import { createDiagnosticCollector, Diagnostic, NoTarget } from "@typespec/compiler"; -import { CSharpEmitterContext } from "../sdk-context.js"; -import { CodeModel } from "../type/code-model.js"; -import { InputEnumType, InputLiteralType, InputModelType } from "../type/input-type.js"; +import type { Diagnostic } from "@typespec/compiler"; +import { createDiagnosticCollector, NoTarget } from "@typespec/compiler"; +import type { CSharpEmitterContext } from "../sdk-context.js"; +import type { CodeModel } from "../type/code-model.js"; +import type { InputEnumType, InputLiteralType, InputModelType } from "../type/input-type.js"; import { fromSdkClients } from "./client-converter.js"; import { createDiagnostic } from "./lib.js"; import { fromSdkNamespaces } from "./namespace-converter.js"; diff --git a/packages/http-client-csharp/emitter/src/lib/decorators.ts b/packages/http-client-csharp/emitter/src/lib/decorators.ts index 30268ab094f..dfe7bd18522 100644 --- a/packages/http-client-csharp/emitter/src/lib/decorators.ts +++ b/packages/http-client-csharp/emitter/src/lib/decorators.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { SdkContext } from "@azure-tools/typespec-client-generator-core"; -import { +import type { SdkContext } from "@azure-tools/typespec-client-generator-core"; +import type { DecoratedType, DecoratorContext, Model, @@ -10,10 +10,10 @@ import { Operation, Program, Type, - setTypeSpecNamespace, } from "@typespec/compiler"; +import { setTypeSpecNamespace } from "@typespec/compiler"; import type { DynamicModelDecorator } from "../../../generated-defs/TypeSpec.HttpClient.CSharp.js"; -import { ExternalDocs } from "../type/external-docs.js"; +import type { ExternalDocs } from "../type/external-docs.js"; /** * The fully qualified decorator name pattern for the dynamicModel decorator. diff --git a/packages/http-client-csharp/emitter/src/lib/example-converter.ts b/packages/http-client-csharp/emitter/src/lib/example-converter.ts index ce23c24eb70..4605ed20b02 100644 --- a/packages/http-client-csharp/emitter/src/lib/example-converter.ts +++ b/packages/http-client-csharp/emitter/src/lib/example-converter.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { +import type { SdkArrayExampleValue, SdkBooleanExampleValue, SdkDictionaryExampleValue, @@ -16,9 +16,10 @@ import { SdkUnionExampleValue, SdkUnknownExampleValue, } from "@azure-tools/typespec-client-generator-core"; -import { createDiagnosticCollector, Diagnostic } from "@typespec/compiler"; -import { CSharpEmitterContext } from "../sdk-context.js"; -import { +import type { Diagnostic } from "@typespec/compiler"; +import { createDiagnosticCollector } from "@typespec/compiler"; +import type { CSharpEmitterContext } from "../sdk-context.js"; +import type { InputArrayExampleValue, InputBooleanExampleValue, InputDictionaryExampleValue, @@ -33,7 +34,7 @@ import { InputUnknownExampleValue, OperationResponseExample, } from "../type/input-examples.js"; -import { +import type { InputArrayType, InputDictionaryType, InputHttpParameter, diff --git a/packages/http-client-csharp/emitter/src/lib/exec-utils.ts b/packages/http-client-csharp/emitter/src/lib/exec-utils.ts index 8e9684718da..bdc382edab8 100644 --- a/packages/http-client-csharp/emitter/src/lib/exec-utils.ts +++ b/packages/http-client-csharp/emitter/src/lib/exec-utils.ts @@ -5,9 +5,11 @@ // file so that browser bundles (which do not support `child_process`) do not // pull them in transitively via `lib/utils.ts`. -import { NoTarget, Type } from "@typespec/compiler"; -import { spawn, SpawnOptions } from "child_process"; -import { CSharpEmitterContext } from "../sdk-context.js"; +import type { Type } from "@typespec/compiler"; +import { NoTarget } from "@typespec/compiler"; +import type { SpawnOptions } from "child_process"; +import { spawn } from "child_process"; +import type { CSharpEmitterContext } from "../sdk-context.js"; export async function execCSharpGenerator( context: CSharpEmitterContext, diff --git a/packages/http-client-csharp/emitter/src/lib/lib.ts b/packages/http-client-csharp/emitter/src/lib/lib.ts index a3c5c96a649..b82bab80f0b 100644 --- a/packages/http-client-csharp/emitter/src/lib/lib.ts +++ b/packages/http-client-csharp/emitter/src/lib/lib.ts @@ -1,12 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { - createTypeSpecLibrary, - DiagnosticDefinition, - DiagnosticMessages, - paramMessage, -} from "@typespec/compiler"; +import type { DiagnosticDefinition, DiagnosticMessages } from "@typespec/compiler"; +import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler"; import { CSharpEmitterOptionsSchema } from "../options.js"; export type DiagnosticMessagesMap = { diff --git a/packages/http-client-csharp/emitter/src/lib/logger.ts b/packages/http-client-csharp/emitter/src/lib/logger.ts index 8b1682f0c27..258fe0f6c63 100644 --- a/packages/http-client-csharp/emitter/src/lib/logger.ts +++ b/packages/http-client-csharp/emitter/src/lib/logger.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { Program, Tracer } from "@typespec/compiler"; +import type { Program, Tracer } from "@typespec/compiler"; import { getTracer } from "./lib.js"; import { LoggerLevel } from "./logger-level.js"; diff --git a/packages/http-client-csharp/emitter/src/lib/namespace-converter.ts b/packages/http-client-csharp/emitter/src/lib/namespace-converter.ts index cfc2eb761a0..cd71b486754 100644 --- a/packages/http-client-csharp/emitter/src/lib/namespace-converter.ts +++ b/packages/http-client-csharp/emitter/src/lib/namespace-converter.ts @@ -1,7 +1,8 @@ -import { SdkHttpOperation, SdkNamespace } from "@azure-tools/typespec-client-generator-core"; -import { createDiagnosticCollector, Diagnostic } from "@typespec/compiler"; -import { CSharpEmitterContext } from "../sdk-context.js"; -import { InputNamespace } from "../type/input-type.js"; +import type { SdkHttpOperation, SdkNamespace } from "@azure-tools/typespec-client-generator-core"; +import type { Diagnostic } from "@typespec/compiler"; +import { createDiagnosticCollector } from "@typespec/compiler"; +import type { CSharpEmitterContext } from "../sdk-context.js"; +import type { InputNamespace } from "../type/input-type.js"; export function fromSdkNamespaces( sdkContext: CSharpEmitterContext, diff --git a/packages/http-client-csharp/emitter/src/lib/operation-converter.ts b/packages/http-client-csharp/emitter/src/lib/operation-converter.ts index 59f35f75e03..6210a2c7636 100644 --- a/packages/http-client-csharp/emitter/src/lib/operation-converter.ts +++ b/packages/http-client-csharp/emitter/src/lib/operation-converter.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { - getClientNamespace, - getClientOptions, - getHttpOperationParameter, - getParamAlias, - isHttpMetadata, +import type { SdkBodyParameter, SdkBuiltInKinds, SdkContext, @@ -25,25 +20,32 @@ import { SdkServiceMethod, SdkServiceResponseHeader, SdkType, +} from "@azure-tools/typespec-client-generator-core"; +import { + getClientNamespace, + getClientOptions, + getHttpOperationParameter, + getParamAlias, + isHttpMetadata, shouldGenerateConvenient, shouldGenerateProtocol, } from "@azure-tools/typespec-client-generator-core"; +import type { Diagnostic } from "@typespec/compiler"; import { createDiagnosticCollector, - Diagnostic, getDeprecated, isErrorModel, NoTarget, } from "@typespec/compiler"; -import { HttpStatusCodeRange } from "@typespec/http"; +import type { HttpStatusCodeRange } from "@typespec/http"; import { getResourceOperation } from "@typespec/rest"; -import { CSharpEmitterContext } from "../sdk-context.js"; +import type { CSharpEmitterContext } from "../sdk-context.js"; import { collectionFormatToDelimMap } from "../type/collection-format.js"; -import { HttpResponseHeader } from "../type/http-response-header.js"; -import { InputConstant } from "../type/input-constant.js"; -import { InputOperation } from "../type/input-operation.js"; +import type { HttpResponseHeader } from "../type/http-response-header.js"; +import type { InputConstant } from "../type/input-constant.js"; +import type { InputOperation } from "../type/input-operation.js"; import { InputParameterScope } from "../type/input-parameter-scope.js"; -import { +import type { InputBasicServiceMethod, InputContinuationToken, InputLongRunningPagingServiceMethod, @@ -55,7 +57,7 @@ import { InputServiceMethod, InputServiceMethodResponse, } from "../type/input-service-method.js"; -import { +import type { InputBodyParameter, InputHeaderParameter, InputHttpParameter, @@ -65,7 +67,7 @@ import { InputType, } from "../type/input-type.js"; import { convertLroFinalStateVia } from "../type/operation-final-state-via.js"; -import { OperationResponse } from "../type/operation-response.js"; +import type { OperationResponse } from "../type/operation-response.js"; import { RequestLocation } from "../type/request-location.js"; import { parseHttpRequestMethod } from "../type/request-method.js"; import { ResponseLocation } from "../type/response-location.js"; diff --git a/packages/http-client-csharp/emitter/src/lib/service-authentication.ts b/packages/http-client-csharp/emitter/src/lib/service-authentication.ts index 52b1b44de5a..1522822696f 100644 --- a/packages/http-client-csharp/emitter/src/lib/service-authentication.ts +++ b/packages/http-client-csharp/emitter/src/lib/service-authentication.ts @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { +import type { SdkCredentialParameter, SdkCredentialType, SdkHttpOperation, SdkPackage, } from "@azure-tools/typespec-client-generator-core"; -import { createDiagnosticCollector, Diagnostic, NoTarget } from "@typespec/compiler"; -import { Oauth2Auth, OAuth2Flow } from "@typespec/http"; -import { CSharpEmitterContext } from "../sdk-context.js"; -import { InputAuth } from "../type/input-auth.js"; -import { InputOAuth2Flow } from "../type/input-oauth2-auth.js"; +import type { Diagnostic } from "@typespec/compiler"; +import { createDiagnosticCollector, NoTarget } from "@typespec/compiler"; +import type { Oauth2Auth, OAuth2Flow } from "@typespec/http"; +import type { CSharpEmitterContext } from "../sdk-context.js"; +import type { InputAuth } from "../type/input-auth.js"; +import type { InputOAuth2Flow } from "../type/input-oauth2-auth.js"; import { createDiagnostic } from "./lib.js"; export function processServiceAuthentication( diff --git a/packages/http-client-csharp/emitter/src/lib/type-converter.ts b/packages/http-client-csharp/emitter/src/lib/type-converter.ts index f9557af26c2..cb545d8d8e1 100644 --- a/packages/http-client-csharp/emitter/src/lib/type-converter.ts +++ b/packages/http-client-csharp/emitter/src/lib/type-converter.ts @@ -1,10 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { +import type { DecoratorInfo, - getAccessOverride, - isHttpMetadata, SdkArrayType, SdkBuiltInType, SdkConstantType, @@ -18,12 +16,17 @@ import { SdkModelType, SdkType, SdkUnionType, +} from "@azure-tools/typespec-client-generator-core"; +import { + getAccessOverride, + isHttpMetadata, UsageFlags, } from "@azure-tools/typespec-client-generator-core"; -import { createDiagnosticCollector, Diagnostic, Model, NoTarget } from "@typespec/compiler"; +import type { Diagnostic, Model } from "@typespec/compiler"; +import { createDiagnosticCollector, NoTarget } from "@typespec/compiler"; import { _httpFileCrossLanguageDefinitionId } from "../constants.js"; -import { CSharpEmitterContext } from "../sdk-context.js"; -import { +import type { CSharpEmitterContext } from "../sdk-context.js"; +import type { InputArrayType, InputDateTimeType, InputDictionaryType, diff --git a/packages/http-client-csharp/emitter/src/lib/typespec-server.ts b/packages/http-client-csharp/emitter/src/lib/typespec-server.ts index f31b9830dda..d3c914f9a75 100644 --- a/packages/http-client-csharp/emitter/src/lib/typespec-server.ts +++ b/packages/http-client-csharp/emitter/src/lib/typespec-server.ts @@ -2,19 +2,14 @@ // Licensed under the MIT License. See License.txt in the project root for license information. import { getClientType } from "@azure-tools/typespec-client-generator-core"; -import { - createDiagnosticCollector, - Diagnostic, - getDoc, - getSummary, - Value, -} from "@typespec/compiler"; -import { HttpServer } from "@typespec/http"; +import type { Diagnostic, Value } from "@typespec/compiler"; +import { createDiagnosticCollector, getDoc, getSummary } from "@typespec/compiler"; +import type { HttpServer } from "@typespec/http"; import { getExtensions } from "@typespec/openapi"; -import { CSharpEmitterContext } from "../sdk-context.js"; -import { InputConstant } from "../type/input-constant.js"; +import type { CSharpEmitterContext } from "../sdk-context.js"; +import type { InputConstant } from "../type/input-constant.js"; import { InputParameterScope } from "../type/input-parameter-scope.js"; -import { InputEndpointParameter, InputType } from "../type/input-type.js"; +import type { InputEndpointParameter, InputType } from "../type/input-type.js"; import { fromSdkType } from "./type-converter.js"; export interface TypeSpecServer { diff --git a/packages/http-client-csharp/emitter/src/lib/utils.ts b/packages/http-client-csharp/emitter/src/lib/utils.ts index f2831b40ee4..2143609cf44 100644 --- a/packages/http-client-csharp/emitter/src/lib/utils.ts +++ b/packages/http-client-csharp/emitter/src/lib/utils.ts @@ -1,15 +1,18 @@ -import { - listAllServiceNamespaces, +import type { SdkClientType, SdkHttpOperation, SdkHttpParameter, SdkMethodParameter, SdkModelPropertyType, +} from "@azure-tools/typespec-client-generator-core"; +import { + listAllServiceNamespaces, isReadOnly as tcgcIsReadOnly, } from "@azure-tools/typespec-client-generator-core"; -import { getNamespaceFullName, Namespace } from "@typespec/compiler"; +import type { Namespace } from "@typespec/compiler"; +import { getNamespaceFullName } from "@typespec/compiler"; import { Visibility } from "@typespec/http"; -import { CSharpEmitterContext } from "../sdk-context.js"; +import type { CSharpEmitterContext } from "../sdk-context.js"; export function getClientNamespaceString(context: CSharpEmitterContext): string | undefined { const packageName = context.emitContext.options["package-name"]; diff --git a/packages/http-client-csharp/emitter/src/options.ts b/packages/http-client-csharp/emitter/src/options.ts index 6978e355f9b..31bbc75d483 100644 --- a/packages/http-client-csharp/emitter/src/options.ts +++ b/packages/http-client-csharp/emitter/src/options.ts @@ -1,8 +1,6 @@ -import { - CreateSdkContextOptions, - UnbrandedSdkEmitterOptions, -} from "@azure-tools/typespec-client-generator-core"; -import { EmitContext, JSONSchemaType } from "@typespec/compiler"; +import type { CreateSdkContextOptions } from "@azure-tools/typespec-client-generator-core"; +import { UnbrandedSdkEmitterOptions } from "@azure-tools/typespec-client-generator-core"; +import type { EmitContext, JSONSchemaType } from "@typespec/compiler"; import { _defaultGeneratorName } from "./constants.js"; import { DYNAMIC_MODEL_DECORATOR_PATTERN } from "./lib/decorators.js"; import { LoggerLevel } from "./lib/logger-level.js"; diff --git a/packages/http-client-csharp/emitter/src/sdk-context.ts b/packages/http-client-csharp/emitter/src/sdk-context.ts index 1c8d3b03162..d5c96429f60 100644 --- a/packages/http-client-csharp/emitter/src/sdk-context.ts +++ b/packages/http-client-csharp/emitter/src/sdk-context.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { +import type { SdkClientType, SdkConstantType, SdkContext, @@ -14,12 +14,12 @@ import { SdkServiceMethod, SdkType, } from "@azure-tools/typespec-client-generator-core"; -import { Type } from "@typespec/compiler"; -import { Logger } from "./lib/logger.js"; -import { CSharpEmitterOptions } from "./options.js"; -import { InputOperation } from "./type/input-operation.js"; -import { InputServiceMethod } from "./type/input-service-method.js"; -import { +import type { Type } from "@typespec/compiler"; +import type { Logger } from "./lib/logger.js"; +import type { CSharpEmitterOptions } from "./options.js"; +import type { InputOperation } from "./type/input-operation.js"; +import type { InputServiceMethod } from "./type/input-service-method.js"; +import type { InputClient, InputHttpParameter, InputLiteralType, @@ -28,7 +28,7 @@ import { InputNamespace, InputType, } from "./type/input-type.js"; -import { OperationResponse } from "./type/operation-response.js"; +import type { OperationResponse } from "./type/operation-response.js"; /** * The emitter context for the CSharp emitter. diff --git a/packages/http-client-csharp/emitter/src/type/code-model.ts b/packages/http-client-csharp/emitter/src/type/code-model.ts index 0194b920e30..31e6afe3732 100644 --- a/packages/http-client-csharp/emitter/src/type/code-model.ts +++ b/packages/http-client-csharp/emitter/src/type/code-model.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { InputAuth } from "./input-auth.js"; -import { InputClient, InputEnumType, InputLiteralType, InputModelType } from "./input-type.js"; +import type { InputAuth } from "./input-auth.js"; +import type { InputClient, InputEnumType, InputLiteralType, InputModelType } from "./input-type.js"; /** * The code model for the CSharp emitter. diff --git a/packages/http-client-csharp/emitter/src/type/http-response-header.ts b/packages/http-client-csharp/emitter/src/type/http-response-header.ts index 96917e5bb42..9a65866e4b7 100644 --- a/packages/http-client-csharp/emitter/src/type/http-response-header.ts +++ b/packages/http-client-csharp/emitter/src/type/http-response-header.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { InputType } from "./input-type.js"; +import type { InputType } from "./input-type.js"; export interface HttpResponseHeader { name: string; diff --git a/packages/http-client-csharp/emitter/src/type/input-auth.ts b/packages/http-client-csharp/emitter/src/type/input-auth.ts index 511f3e4f81d..7d8a7b0a094 100644 --- a/packages/http-client-csharp/emitter/src/type/input-auth.ts +++ b/packages/http-client-csharp/emitter/src/type/input-auth.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { InputApiKeyAuth } from "./input-api-key-auth.js"; -import { InputOAuth2Auth } from "./input-oauth2-auth.js"; +import type { InputApiKeyAuth } from "./input-api-key-auth.js"; +import type { InputOAuth2Auth } from "./input-oauth2-auth.js"; export interface InputAuth { apiKey?: InputApiKeyAuth; diff --git a/packages/http-client-csharp/emitter/src/type/input-constant.ts b/packages/http-client-csharp/emitter/src/type/input-constant.ts index bca46bcee58..feee82e2675 100644 --- a/packages/http-client-csharp/emitter/src/type/input-constant.ts +++ b/packages/http-client-csharp/emitter/src/type/input-constant.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { InputType } from "./input-type.js"; +import type { InputType } from "./input-type.js"; export interface InputConstant { value?: any; diff --git a/packages/http-client-csharp/emitter/src/type/input-examples.ts b/packages/http-client-csharp/emitter/src/type/input-examples.ts index ef67b45575c..74222c31cb3 100644 --- a/packages/http-client-csharp/emitter/src/type/input-examples.ts +++ b/packages/http-client-csharp/emitter/src/type/input-examples.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { +import type { InputArrayType, InputDictionaryType, InputHttpParameter, @@ -12,7 +12,7 @@ import { InputType, InputUnionType, } from "./input-type.js"; -import { OperationResponse } from "./operation-response.js"; +import type { OperationResponse } from "./operation-response.js"; interface InputExampleBase { kind: string; diff --git a/packages/http-client-csharp/emitter/src/type/input-operation.ts b/packages/http-client-csharp/emitter/src/type/input-operation.ts index cf0adbef5af..809719303e7 100644 --- a/packages/http-client-csharp/emitter/src/type/input-operation.ts +++ b/packages/http-client-csharp/emitter/src/type/input-operation.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { DecoratorInfo } from "@azure-tools/typespec-client-generator-core"; -import { InputHttpOperationExample } from "./input-examples.js"; -import { InputHttpParameter } from "./input-type.js"; -import { OperationResponse } from "./operation-response.js"; -import { RequestMethod } from "./request-method.js"; +import type { DecoratorInfo } from "@azure-tools/typespec-client-generator-core"; +import type { InputHttpOperationExample } from "./input-examples.js"; +import type { InputHttpParameter } from "./input-type.js"; +import type { OperationResponse } from "./operation-response.js"; +import type { RequestMethod } from "./request-method.js"; export interface InputOperation { name: string; diff --git a/packages/http-client-csharp/emitter/src/type/input-service-method.ts b/packages/http-client-csharp/emitter/src/type/input-service-method.ts index b30b6e2291c..124d1b5a73c 100644 --- a/packages/http-client-csharp/emitter/src/type/input-service-method.ts +++ b/packages/http-client-csharp/emitter/src/type/input-service-method.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { InputOperation } from "./input-operation.js"; -import { InputMethodParameter, InputParameter, InputType } from "./input-type.js"; -import { OperationFinalStateVia } from "./operation-final-state-via.js"; -import { OperationResponse } from "./operation-response.js"; -import { ResponseLocation } from "./response-location.js"; +import type { InputOperation } from "./input-operation.js"; +import type { InputMethodParameter, InputParameter, InputType } from "./input-type.js"; +import type { OperationFinalStateVia } from "./operation-final-state-via.js"; +import type { OperationResponse } from "./operation-response.js"; +import type { ResponseLocation } from "./response-location.js"; export type InputServiceMethod = | InputBasicServiceMethod diff --git a/packages/http-client-csharp/emitter/src/type/input-type.ts b/packages/http-client-csharp/emitter/src/type/input-type.ts index 5e32bd2a9b1..168a3da2809 100644 --- a/packages/http-client-csharp/emitter/src/type/input-type.ts +++ b/packages/http-client-csharp/emitter/src/type/input-type.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { +import type { AccessFlags, CollectionFormat, DecoratorInfo, @@ -10,11 +10,11 @@ import { SerializationOptions, UsageFlags, } from "@azure-tools/typespec-client-generator-core"; -import { DateTimeKnownEncoding, DurationKnownEncoding } from "@typespec/compiler"; -import { InputConstant } from "./input-constant.js"; -import { InputParameterScope } from "./input-parameter-scope.js"; -import { InputServiceMethod } from "./input-service-method.js"; -import { RequestLocation } from "./request-location.js"; +import type { DateTimeKnownEncoding, DurationKnownEncoding } from "@typespec/compiler"; +import type { InputConstant } from "./input-constant.js"; +import type { InputParameterScope } from "./input-parameter-scope.js"; +import type { InputServiceMethod } from "./input-service-method.js"; +import type { RequestLocation } from "./request-location.js"; /** * External type information for types that map to external library types. diff --git a/packages/http-client-csharp/emitter/src/type/operation-response.ts b/packages/http-client-csharp/emitter/src/type/operation-response.ts index 6ed674414d2..265b9d9f11e 100644 --- a/packages/http-client-csharp/emitter/src/type/operation-response.ts +++ b/packages/http-client-csharp/emitter/src/type/operation-response.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -import { SerializationOptions } from "@azure-tools/typespec-client-generator-core"; -import { HttpResponseHeader } from "./http-response-header.js"; -import { InputType } from "./input-type.js"; +import type { SerializationOptions } from "@azure-tools/typespec-client-generator-core"; +import type { HttpResponseHeader } from "./http-response-header.js"; +import type { InputType } from "./input-type.js"; export interface OperationResponse { statusCodes: number[]; diff --git a/packages/http-client-csharp/emitter/test/Unit/auth.test.ts b/packages/http-client-csharp/emitter/test/Unit/auth.test.ts index ceac4514668..242ba99f8ea 100644 --- a/packages/http-client-csharp/emitter/test/Unit/auth.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/auth.test.ts @@ -1,6 +1,6 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; diff --git a/packages/http-client-csharp/emitter/test/Unit/client-converter.test.ts b/packages/http-client-csharp/emitter/test/Unit/client-converter.test.ts index 61629b4eab2..720d1f94a1e 100644 --- a/packages/http-client-csharp/emitter/test/Unit/client-converter.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/client-converter.test.ts @@ -1,11 +1,11 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; import { containsMultiServiceClient } from "../../src/lib/utils.js"; -import { InputClient } from "../../src/type/input-type.js"; +import type { InputClient } from "../../src/type/input-type.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/client-initialization.test.ts b/packages/http-client-csharp/emitter/test/Unit/client-initialization.test.ts index a92709bdd4d..63ec63555d5 100644 --- a/packages/http-client-csharp/emitter/test/Unit/client-initialization.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/client-initialization.test.ts @@ -1,10 +1,10 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; -import { InputMethodParameter } from "../../src/type/input-type.js"; +import type { InputMethodParameter } from "../../src/type/input-type.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/client-model-builder.test.ts b/packages/http-client-csharp/emitter/test/Unit/client-model-builder.test.ts index 954a7296b4b..d1b17a0420c 100644 --- a/packages/http-client-csharp/emitter/test/Unit/client-model-builder.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/client-model-builder.test.ts @@ -1,10 +1,10 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; -import { InputEnumType } from "../../src/type/input-type.js"; +import type { InputEnumType } from "../../src/type/input-type.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/constant-type.test.ts b/packages/http-client-csharp/emitter/test/Unit/constant-type.test.ts index 3730f08dbdd..5f030f477be 100644 --- a/packages/http-client-csharp/emitter/test/Unit/constant-type.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/constant-type.test.ts @@ -1,11 +1,11 @@ vi.resetModules(); import { UsageFlags } from "@azure-tools/typespec-client-generator-core"; -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; -import { InputEnumType, InputNullableType } from "../../src/type/input-type.js"; +import type { InputEnumType, InputNullableType } from "../../src/type/input-type.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/decorator-list.test.ts b/packages/http-client-csharp/emitter/test/Unit/decorator-list.test.ts index 53df8aa6e86..14ccf8d5286 100644 --- a/packages/http-client-csharp/emitter/test/Unit/decorator-list.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/decorator-list.test.ts @@ -1,6 +1,6 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { deepStrictEqual, strictEqual } from "assert"; import { ok } from "assert/strict"; import { beforeEach, describe, it, vi } from "vitest"; diff --git a/packages/http-client-csharp/emitter/test/Unit/emitter.test.ts b/packages/http-client-csharp/emitter/test/Unit/emitter.test.ts index b7eb8071e89..f33588dd6bb 100644 --- a/packages/http-client-csharp/emitter/test/Unit/emitter.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/emitter.test.ts @@ -1,12 +1,12 @@ vi.resetModules(); -import { EmitContext, Program } from "@typespec/compiler"; -import { TestHost } from "@typespec/compiler/testing"; +import type { EmitContext, Program } from "@typespec/compiler"; +import type { TestHost } from "@typespec/compiler/testing"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { generate } from "../../src/emit-generate.js"; import { execAsync, execCSharpGenerator } from "../../src/lib/exec-utils.js"; -import { CSharpEmitterOptions } from "../../src/options.js"; -import { CodeModel } from "../../src/type/code-model.js"; +import type { CSharpEmitterOptions } from "../../src/options.js"; +import type { CodeModel } from "../../src/type/code-model.js"; import { createEmitterContext, createEmitterTestHost, diff --git a/packages/http-client-csharp/emitter/test/Unit/encode.test.ts b/packages/http-client-csharp/emitter/test/Unit/encode.test.ts index 6344bd3f4ca..1b1910be63e 100644 --- a/packages/http-client-csharp/emitter/test/Unit/encode.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/encode.test.ts @@ -1,6 +1,6 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; diff --git a/packages/http-client-csharp/emitter/test/Unit/enum-dedup-repro.test.ts b/packages/http-client-csharp/emitter/test/Unit/enum-dedup-repro.test.ts index 95943f34e00..33ff5ae59d3 100644 --- a/packages/http-client-csharp/emitter/test/Unit/enum-dedup-repro.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/enum-dedup-repro.test.ts @@ -1,6 +1,6 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; diff --git a/packages/http-client-csharp/emitter/test/Unit/input-parameter.test.ts b/packages/http-client-csharp/emitter/test/Unit/input-parameter.test.ts index 7e4db98cba1..6353fff468a 100644 --- a/packages/http-client-csharp/emitter/test/Unit/input-parameter.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/input-parameter.test.ts @@ -1,11 +1,11 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; import { InputParameterScope } from "../../src/type/input-parameter-scope.js"; -import { +import type { InputBodyParameter, InputHeaderParameter, InputPathParameter, diff --git a/packages/http-client-csharp/emitter/test/Unit/method-parameter-segments.test.ts b/packages/http-client-csharp/emitter/test/Unit/method-parameter-segments.test.ts index 0940caf23e7..5acb63c1613 100644 --- a/packages/http-client-csharp/emitter/test/Unit/method-parameter-segments.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/method-parameter-segments.test.ts @@ -1,9 +1,9 @@ -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it } from "vitest"; import { createModel } from "../../src/index.js"; -import { InputServiceMethod } from "../../src/type/input-service-method.js"; -import { InputHttpParameter, InputParameter } from "../../src/type/input-type.js"; +import type { InputServiceMethod } from "../../src/type/input-service-method.js"; +import type { InputHttpParameter, InputParameter } from "../../src/type/input-type.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts b/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts index 93065301fd3..204ecbfec07 100644 --- a/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/model-type.test.ts @@ -1,11 +1,11 @@ vi.resetModules(); import { UsageFlags } from "@azure-tools/typespec-client-generator-core"; -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import assert, { deepStrictEqual, ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; -import { InputModelType } from "../../src/type/input-type.js"; +import type { InputModelType } from "../../src/type/input-type.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/namespace-converter.test.ts b/packages/http-client-csharp/emitter/test/Unit/namespace-converter.test.ts index 8179f78486b..f658a414885 100644 --- a/packages/http-client-csharp/emitter/test/Unit/namespace-converter.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/namespace-converter.test.ts @@ -1,8 +1,8 @@ -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it } from "vitest"; import { fromSdkNamespaces } from "../../src/lib/namespace-converter.js"; -import { InputNamespace } from "../../src/type/input-type.js"; +import type { InputNamespace } from "../../src/type/input-type.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/operation-converter.test.ts b/packages/http-client-csharp/emitter/test/Unit/operation-converter.test.ts index 3863f242393..2bf4691df6c 100644 --- a/packages/http-client-csharp/emitter/test/Unit/operation-converter.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/operation-converter.test.ts @@ -1,8 +1,8 @@ -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; -import { InputEnumType } from "../../src/type/input-type.js"; +import type { InputEnumType } from "../../src/type/input-type.js"; import { RequestLocation } from "../../src/type/request-location.js"; import { createCSharpSdkContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/operation-paging.test.ts b/packages/http-client-csharp/emitter/test/Unit/operation-paging.test.ts index 7c2060148ae..613e9b01aec 100644 --- a/packages/http-client-csharp/emitter/test/Unit/operation-paging.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/operation-paging.test.ts @@ -1,6 +1,6 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; diff --git a/packages/http-client-csharp/emitter/test/Unit/options.test.ts b/packages/http-client-csharp/emitter/test/Unit/options.test.ts index be8603adeb0..b2fe38d06b4 100644 --- a/packages/http-client-csharp/emitter/test/Unit/options.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/options.test.ts @@ -1,11 +1,12 @@ vi.resetModules(); import { UnbrandedSdkEmitterOptions } from "@azure-tools/typespec-client-generator-core"; -import { EmitContext, Program } from "@typespec/compiler"; +import type { EmitContext, Program } from "@typespec/compiler"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { createConfiguration } from "../../src/emitter.js"; -import { CSharpEmitterOptions, CSharpEmitterOptionsSchema } from "../../src/options.js"; +import type { CSharpEmitterOptions } from "../../src/options.js"; +import { CSharpEmitterOptionsSchema } from "../../src/options.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts b/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts index e3589538bd3..1a9515465ff 100644 --- a/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts @@ -1,7 +1,7 @@ vi.resetModules(); import { UsageFlags } from "@azure-tools/typespec-client-generator-core"; -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; diff --git a/packages/http-client-csharp/emitter/test/Unit/scalar.test.ts b/packages/http-client-csharp/emitter/test/Unit/scalar.test.ts index cea35899816..acc81f3e708 100644 --- a/packages/http-client-csharp/emitter/test/Unit/scalar.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/scalar.test.ts @@ -1,6 +1,6 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; diff --git a/packages/http-client-csharp/emitter/test/Unit/string-format.test.ts b/packages/http-client-csharp/emitter/test/Unit/string-format.test.ts index 3eea60ca0d1..b439d7aa5d0 100644 --- a/packages/http-client-csharp/emitter/test/Unit/string-format.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/string-format.test.ts @@ -1,6 +1,6 @@ vi.resetModules(); -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; diff --git a/packages/http-client-csharp/emitter/test/Unit/type-converter.test.ts b/packages/http-client-csharp/emitter/test/Unit/type-converter.test.ts index b6fb88bbdf9..7c399bdd299 100644 --- a/packages/http-client-csharp/emitter/test/Unit/type-converter.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/type-converter.test.ts @@ -1,12 +1,12 @@ vi.resetModules(); -import { DecoratorInfo } from "@azure-tools/typespec-client-generator-core"; -import { TestHost } from "@typespec/compiler/testing"; +import type { DecoratorInfo } from "@azure-tools/typespec-client-generator-core"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; import { getAllModelDecorators } from "../../src/lib/type-converter.js"; -import { InputNamespace } from "../../src/type/input-type.js"; +import type { InputNamespace } from "../../src/type/input-type.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/usage.test.ts b/packages/http-client-csharp/emitter/test/Unit/usage.test.ts index ee0923b0174..b08f8a13a97 100644 --- a/packages/http-client-csharp/emitter/test/Unit/usage.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/usage.test.ts @@ -1,7 +1,7 @@ vi.resetModules(); import { UsageFlags } from "@azure-tools/typespec-client-generator-core"; -import { TestHost } from "@typespec/compiler/testing"; +import type { TestHost } from "@typespec/compiler/testing"; import { ok, strictEqual } from "assert"; import { beforeEach, describe, it, vi } from "vitest"; import { createModel } from "../../src/lib/client-model-builder.js"; diff --git a/packages/http-client-csharp/emitter/test/Unit/utils.test.ts b/packages/http-client-csharp/emitter/test/Unit/utils.test.ts index f5d42ff505f..4d68d50075e 100644 --- a/packages/http-client-csharp/emitter/test/Unit/utils.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/utils.test.ts @@ -4,7 +4,7 @@ import { EventEmitter } from "events"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { execCSharpGenerator } from "../../src/lib/exec-utils.js"; import { getClientNamespaceStringHelper } from "../../src/lib/utils.js"; -import { CSharpEmitterContext } from "../../src/sdk-context.js"; +import type { CSharpEmitterContext } from "../../src/sdk-context.js"; import { createCSharpSdkContext, createEmitterContext, diff --git a/packages/http-client-csharp/emitter/test/Unit/utils/test-util.ts b/packages/http-client-csharp/emitter/test/Unit/utils/test-util.ts index 3b6d60db3ca..53ea0b15f77 100644 --- a/packages/http-client-csharp/emitter/test/Unit/utils/test-util.ts +++ b/packages/http-client-csharp/emitter/test/Unit/utils/test-util.ts @@ -1,15 +1,17 @@ import { AzureCoreTestLibrary } from "@azure-tools/typespec-azure-core/testing"; import type { CreateSdkContextOptions } from "@azure-tools/typespec-client-generator-core"; import { SdkTestLibrary } from "@azure-tools/typespec-client-generator-core/testing"; -import { CompilerOptions, EmitContext, Program } from "@typespec/compiler"; -import { createTestHost, TestHost } from "@typespec/compiler/testing"; +import type { CompilerOptions, EmitContext, Program } from "@typespec/compiler"; +import type { TestHost } from "@typespec/compiler/testing"; +import { createTestHost } from "@typespec/compiler/testing"; import { HttpTestLibrary } from "@typespec/http/testing"; import { RestTestLibrary } from "@typespec/rest/testing"; import { VersioningTestLibrary } from "@typespec/versioning/testing"; import { XmlTestLibrary } from "@typespec/xml/testing"; import { LoggerLevel } from "../../../src/lib/logger-level.js"; -import { CSharpEmitterOptions } from "../../../src/options.js"; -import { createCSharpEmitterContext, CSharpEmitterContext } from "../../../src/sdk-context.js"; +import type { CSharpEmitterOptions } from "../../../src/options.js"; +import type { CSharpEmitterContext } from "../../../src/sdk-context.js"; +import { createCSharpEmitterContext } from "../../../src/sdk-context.js"; export async function createEmitterTestHost(): Promise { return createTestHost({ diff --git a/packages/http-client-csharp/emitter/test/Unit/validate-dotnet-sdk.test.ts b/packages/http-client-csharp/emitter/test/Unit/validate-dotnet-sdk.test.ts index 37d801200b1..f8a080c51ed 100644 --- a/packages/http-client-csharp/emitter/test/Unit/validate-dotnet-sdk.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/validate-dotnet-sdk.test.ts @@ -1,9 +1,10 @@ vi.resetModules(); -import { Diagnostic, Program } from "@typespec/compiler"; -import { TestHost } from "@typespec/compiler/testing"; +import type { Diagnostic, Program } from "@typespec/compiler"; +import type { TestHost } from "@typespec/compiler/testing"; import { strictEqual } from "assert"; -import { beforeEach, describe, expect, it, Mock, vi } from "vitest"; +import type { Mock } from "vitest"; +import { beforeEach, describe, expect, it, vi } from "vitest"; import { execAsync } from "../../src/lib/exec-utils.js"; import { createCSharpSdkContext, diff --git a/packages/http-client-csharp/emitter/tsconfig.json b/packages/http-client-csharp/emitter/tsconfig.json index 5bec36bfff7..c6423567066 100644 --- a/packages/http-client-csharp/emitter/tsconfig.json +++ b/packages/http-client-csharp/emitter/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "noEmit": true + "noEmit": true, + "verbatimModuleSyntax": true }, "include": ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts", "../generated-defs/**/*.ts"] }