Skip to content
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Don't change the generated code manually! You should run npm run smoke-test under packages/typespec-test to update the smoke tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already fixed in 107b86c - reverted all manual changes and regenerated using npm run smoke-test in packages/typespec-test. The blob/index.ts is now properly generated by the emitter.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

export { BlobClient } from "./blobClient.js";
export { BlobContext, BlobClientOptionalParams, DownloadOptionalParams } from "./api/index.js";
11 changes: 8 additions & 3 deletions packages/typespec-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ import { emitLoggerFile } from "./modular/emitLoggerFile.js";
import { emitTypes } from "./modular/emitModels.js";
import { existsSync } from "fs";
import { getModuleExports } from "./modular/buildProjectFiles.js";
import { getClientHierarchyMap, getRLCClients } from "./utils/clientUtils.js";
import {
getClientHierarchyMap,
getRLCClients,
getModularClientOptions
} from "./utils/clientUtils.js";
import { join } from "path";
import { loadStaticHelpers } from "./framework/load-static-helpers.js";
import { packageUsesXmlSerialization } from "./modular/serialization/buildXmlSerializerFunction.js";
Expand Down Expand Up @@ -319,7 +323,6 @@ export async function $onEmit(context: EmitContext) {
}
);

const isMultiClients = dpgContext.sdkPackage.clients.length > 1;
emitTypes(dpgContext, { sourceRoot: modularSourcesRoot });
buildSubpathIndexFile(modularEmitterOptions, "models", undefined, {
recursive: true
Expand Down Expand Up @@ -353,7 +356,9 @@ export async function $onEmit(context: EmitContext) {
exportIndex: true,
interfaceOnly: true
});
if (isMultiClients) {
const { subfolder } = getModularClientOptions(subClient);
// Generate index file for clients with subfolders (multi-client scenarios and nested clients)
if (subfolder) {
buildSubClientIndexFile(dpgContext, subClient, modularEmitterOptions);
}
buildRootIndex(
Expand Down
Loading