Skip to content

Commit ff21740

Browse files
xirzecCopilot
andauthored
Remove branded and flavor emitter options from typespec-ts (#4668)
## Summary Removes the `branded` and `flavor` emitter options from `@azure-tools/typespec-ts`. This package now only generates Azure-branded packages — unbranded emit moves to `@typespec/http-client-js`. This is a **breaking change** to the emitter's public options. ## Changes **Public surface** - `lib.ts`: removed `flavor` and `branded` from `EmitterOptions` + the options JSON schema; reworded the `azure-sdk-for-js` description. - `interfaces.ts`: deleted the `PackageFlavor` type and `flavor?` from `RLCOptions`. **Internal cleanup** - Removed the `PackageFlavor` plumbing and the `isAzurePackage()` helper, collapsing every `flavor === "azure"` / `isAzurePackage(...)` branch to its Azure behavior and deleting all unbranded (`flavor !== "azure"`) code paths across ~26 source files. - Deleted the now-dead `build-flavorless-package.ts` and the orphaned `commonPackageDependencies`. - `isAzureMonorepoPackage` = `azureSdkForJs`, `isAzureStandalonePackage` = `!azureSdkForJs` (mutually exclusive, covering all cases). **Tests** - Updated 6 unit test files: dropped `flavor`/`branded`/`PackageFlavor`, removed the non-Azure / "Flavorless lib" cases, and changed `buildRuntimeImports()` to take no args. - Deleted the obsolete `apiKeyCredentialClient.md` scenario sample — key-credential sample generation was an unbranded-only behavior that no longer exists. **Test suite dedup** The integration suite previously covered `{modular, rlc} × {branded, unbranded}` combinations. With unbranded emit gone, the non-Azure (standard) integration folders were redundant subsets of their Azure variants, so they've been removed: - Deleted `test/modular-integration/` entirely and the non-Azure tests + generated baselines under `test/integration/` (kept the shared `test/integration/typespec/` specs that `copy:typespec` feeds into Azure generation). - Removed the `integration-rlc` / `integration-modular` vitest projects and all non-Azure integration scripts from `package.json`. - Removed the `rlcTsps` / `modularTsps` lists from `spector-list.js` and their cases in `gen-spector.js`; collapsed the `run.ts` output-path mapping to Azure-only. - Regenerated the Azure `encode/duration` baselines (new upstream-spec "Lossy" duration ops) so the e2e `check:tree` stays clean. **Docs** - Regenerated the emitter reference (`reference/emitter.md` + package `README.md`) so the documented options match. ## Verification - `tsc -p .` builds clean - `test-next` suite: **267/267 pass** - Unit tests: `unit-test:rlc` (316 pass) + `unit-test:modular` (652 pass) - Azure integration (spector) tests: `azure-modular` (934 pass) + `azure-rlc` (783 pass) - `eslint` clean (`--max-warnings=0`) - `chronus verify` passes (breaking changeset added for `@azure-tools/typespec-ts`) - Code-review pass over the diff surfaced no issues Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c6afbe3 commit ff21740

440 files changed

Lines changed: 250 additions & 30625 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
3+
changeKind: breaking
4+
packages:
5+
- "@azure-tools/typespec-ts"
6+
---
7+
8+
Remove the `branded` and `flavor` emitter options. `@azure-tools/typespec-ts` now only generates Azure-branded packages; use `@typespec/http-client-js` for unbranded emit.

packages/typespec-ts/README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Whether to generate sample files, for basic samples of your generated sdks. Defa
149149

150150
**Type:** `boolean`
151151

152-
This is used to indicate your project is generated in [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) repo or not. If your package is located in that repo we'll leverage `dev-tool` to accelerate our building and testing, however if not we'll remove the dependency for that tool. Defaults to `undefined`. Services with Flavor equal to 'Azure' default to 'true'.
152+
This is used to indicate your project is generated in [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) repo or not. If your package is located in that repo we'll leverage `dev-tool` to accelerate our building and testing, however if not we'll remove the dependency for that tool. Defaults to `undefined`.
153153

154154
### `azure-output-directory`
155155

@@ -239,18 +239,6 @@ Provides an option to add the model namespace to model names in case of conflict
239239

240240
An option to organize the client in a hierarchical way as defined by `@clientInitialization`. This is true by default.
241241

242-
### `branded`
243-
244-
**Type:** `boolean`
245-
246-
A section of flavor
247-
248-
### `flavor`
249-
250-
**Type:** `string`
251-
252-
The flavor of the SDK.
253-
254242
### `module-kind`
255243

256244
**Type:** `"esm"`

packages/typespec-ts/package.json

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,26 @@
2121
"build": "tsc -p .",
2222
"test": "npm run test-next && npm run unit-test && npm run integration-test-ci",
2323
"test:azure": "npm run test-next && npm run copy:typespec && npm run integration-test-ci:azure-rlc && npm run integration-test-ci:azure-modular",
24-
"test:standard": "npm run test-next && npm run copy:typespec && npm run unit-test&& npm run integration-test-ci:rlc && npm run integration-test-ci:modular",
2524
"lint": "eslint . --ext .ts --max-warnings=0",
2625
"lint:fix": "eslint . --fix --ext .ts",
2726
"check:tree": "tsx ./test/commands/check-clean-tree.ts",
2827
"test:ts:e2e": "npm run copy:typespec && npm run integration-test-ci:azure-rlc && npm run integration-test-ci:azure-modular",
29-
"integration-test-ci": "npm-run-all copy:typespec integration-test-ci:rlc integration-test-ci:azure-rlc integration-test-ci:modular integration-test-ci:azure-modular",
30-
"integration-test-ci:sequential": "npm-run-all --serial copy:typespec integration-test-ci:modular && npm run integration-test-ci:modular",
31-
"integration-test-ci:rlc": "npm-run-all --silent -p start-test-server:rlc --race generate-and-run:rlc",
28+
"integration-test-ci": "npm-run-all copy:typespec integration-test-ci:azure-rlc integration-test-ci:azure-modular",
29+
"integration-test-ci:sequential": "npm-run-all --serial copy:typespec integration-test-ci:azure-modular && npm run integration-test-ci:azure-modular",
3230
"integration-test-ci:azure-rlc": "npm-run-all --silent -p start-test-server:azure-rlc --race generate-and-run:azure-rlc",
33-
"integration-test-ci:modular": "npm-run-all --silent -p start-test-server:modular --race generate-and-run:modular",
3431
"integration-test-ci:azure-modular": "npm-run-all --silent -p start-test-server:azure-modular --race generate-and-run:azure-modular",
3532
"start-test-server": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@typespec/http-specs/specs --coverageFile ./coverage/spector-coverage-typescript.json",
36-
"start-test-server:rlc": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@typespec/http-specs/specs --coverageFile ./coverage/spector-coverage-typescript-rlc-standard.json",
3733
"start-test-server:azure-rlc": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@azure-tools/azure-http-specs/specs ./node_modules/@typespec/http-specs/specs --coverageFile ./coverage/spector-coverage-typescript-rlc-azure.json",
38-
"start-test-server:modular": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@typespec/http-specs/specs --port 3002 --coverageFile ./coverage/spector-coverage-typescript-modular-standard.json",
3934
"start-test-server:azure-modular": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@azure-tools/azure-http-specs/specs ./node_modules/@typespec/http-specs/specs --port 3002 --coverageFile ./coverage/spector-coverage-typescript-modular-azure.json",
4035
"copy:typespec": "rm -rf temp && mkdirp -p temp/specs && mkdirp -p temp/assets && cp -r ./node_modules/@typespec/http-specs/specs/* ./temp/specs && cp -r ./node_modules/@azure-tools/azure-http-specs/specs/* ./temp/specs && cp -r ./test/integration/typespec/* ./temp/specs && cp -r ./node_modules/@typespec/http-specs/assets/* ./temp/assets",
41-
"generate-and-run:rlc": "npm run generate-tsp-only:rlc && npm run integration-test:alone:rlc && npm run stop-test-server -- -p 3000",
4236
"generate-and-run:azure-rlc": "npm run generate-tsp-only:azure-rlc && npm run integration-test:alone:azure-rlc && npm run stop-test-server -- -p 3000",
43-
"generate-and-run:modular": "npm run generate-tsp-only:modular && npm run integration-test:alone:modular && npm run stop-test-server -- -p 3002",
4437
"generate-and-run:azure-modular": "npm run generate-tsp-only:azure-modular && npm run integration-test:alone:azure-modular && npm run stop-test-server -- -p 3002",
45-
"generate-tsp-only": "npm run generate-tsp-only:azure-rlc && npm run generate-tsp-only:rlc &&npm run generate-tsp-only:azure-modular && npm run generate-tsp-only:modular",
46-
"generate-tsp-only:rlc": "npx tsx ./test/commands/gen-spector.js --tag=rlc",
38+
"generate-tsp-only": "npm run generate-tsp-only:azure-rlc && npm run generate-tsp-only:azure-modular",
4739
"generate-tsp-only:azure-rlc": "npx tsx ./test/commands/gen-spector.js --tag=azure-rlc",
48-
"generate-tsp-only:modular": "npx tsx ./test/commands/gen-spector.js --tag=modular",
4940
"generate-tsp-only:azure-modular": "npx tsx ./test/commands/gen-spector.js --tag=azure-modular",
5041
"regen-test-baselines": "npm run generate-tsp-only",
51-
"integration-test:alone": "npm run integration-test:alone:rlc && npm run integration-test:alone:azure-rlc && npm run integration-test:alone:modular && npm run integration-test:alone:azure-modular",
52-
"integration-test:alone:rlc": "vitest run --project integration-rlc",
42+
"integration-test:alone": "npm run integration-test:alone:azure-rlc && npm run integration-test:alone:azure-modular",
5343
"integration-test:alone:azure-rlc": "vitest run --project integration-azure-rlc",
54-
"integration-test:alone:modular": "vitest run --project integration-modular",
5544
"integration-test:alone:azure-modular": "vitest run --project integration-azure-modular",
5645
"stop-test-server": "npx tsp-spector server stop",
5746
"unit-test": "npm-run-all --parallel unit-test:rlc unit-test:modular",

packages/typespec-ts/src/framework/load-static-helpers.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
} from "ts-morph";
1111
import { reportDiagnostic } from "../lib.js";
1212
import { ModularEmitterOptions } from "../modular/interfaces.js";
13-
import { isAzurePackage } from "../rlc-common/index.js";
1413
import { resolveProjectRoot } from "../utils/resolve-project-root.js";
1514
import { refkey } from "./refkey.js";
1615
export const SourceFileSymbol = Symbol("SourceFile");
@@ -73,10 +72,7 @@ export async function loadStaticHelpers(
7372
);
7473
await loadFiles(filesInSources, options.sourcesDir ?? "");
7574
// Load static helpers used in testing code (only when loadTestHelpers is enabled)
76-
if (
77-
options.loadTestHelpers ??
78-
(options.options?.generateTest && isAzurePackage({ options: options.options }))
79-
) {
75+
if (options.loadTestHelpers ?? options.options?.generateTest) {
8076
const defaultTestingHelpersPath = joinPaths(packageRoot, DEFAULT_SOURCES_TESTING_HELPERS_PATH);
8177
const filesInTestings = await traverseDirectory(
8278
defaultTestingHelpersPath,
@@ -99,14 +95,6 @@ export async function loadStaticHelpers(
9995
overwrite: true,
10096
});
10197
addedFile.getImportDeclarations().map((i) => {
102-
if (!isAzurePackage({ options: options.options })) {
103-
if (i.getModuleSpecifier().getFullText().includes("@azure/core-rest-pipeline")) {
104-
i.setModuleSpecifier("@typespec/ts-http-runtime");
105-
}
106-
if (i.getModuleSpecifier().getFullText().includes("@azure-rest/core-client")) {
107-
i.setModuleSpecifier("@typespec/ts-http-runtime");
108-
}
109-
}
11098
// Rewrite relative platform-types imports to #platform/ specifiers
11199
// so that browser/react-native variants are resolved via subpath imports.
112100
// Only rewrite imports to the default variant (not -browser/-react-native variants

packages/typespec-ts/src/index.ts

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
AzureIdentityDependencies,
1818
AzurePollingDependencies,
1919
AzureTestDependencies,
20-
DefaultCoreDependencies,
2120
} from "./modular/external-dependencies.js";
2221
import {
2322
CloudSettingHelpers,
@@ -73,7 +72,6 @@ import {
7372
getClientName,
7473
hasClientNameChanged,
7574
hasUnexpectedHelper,
76-
isAzurePackage,
7775
updatePackageFile,
7876
updateReadmeFile,
7977
} from "./rlc-common/index.js";
@@ -178,14 +176,12 @@ export async function $onEmit(context: EmitContext) {
178176
packageRoot: emitterPackageRoot,
179177
},
180178
);
181-
const extraDependencies = isAzurePackage({ options: rlcOptions })
182-
? {
183-
...AzurePollingDependencies,
184-
...AzureCoreDependencies,
185-
...AzureIdentityDependencies,
186-
...AzureTestDependencies,
187-
}
188-
: { ...DefaultCoreDependencies };
179+
const extraDependencies = {
180+
...AzurePollingDependencies,
181+
...AzureCoreDependencies,
182+
...AzureIdentityDependencies,
183+
...AzureTestDependencies,
184+
};
189185
const binder = provideBinder(outputProject, {
190186
staticHelpers,
191187
dependencies: {
@@ -241,8 +237,7 @@ export async function $onEmit(context: EmitContext) {
241237
options.generateTest =
242238
options.generateTest === true ||
243239
(options.generateTest === undefined &&
244-
(!hasTestFolder || (options.azureSdkForJs && options.azureArm)) &&
245-
isAzurePackage({ options: options }));
240+
(!hasTestFolder || (options.azureSdkForJs && options.azureArm)));
246241
dpgContext.rlcOptions = options;
247242
}
248243

@@ -471,7 +466,6 @@ export async function $onEmit(context: EmitContext) {
471466
// warp.config.yml, and snippets.spec.ts. metadata.json is still updated.
472467
const sourcesDir = dpgContext.generationPathDetail?.modularSourcesDir ?? "";
473468
const hasManualConvenienceLayer = getBaseFileName(sourcesDir) === "generated";
474-
const isAzureFlavor = isAzurePackage({ options: option });
475469
// Generate metadata
476470
const existingPackageFilePath = joinPaths(
477471
dpgContext.generationPathDetail?.metadataDir ?? "",
@@ -523,9 +517,7 @@ export async function $onEmit(context: EmitContext) {
523517
commonBuilders.push((model) => buildTestBrowserTsConfig(model));
524518
commonBuilders.push((model) => buildTestNodeTsConfig(model));
525519
}
526-
if (isAzureFlavor) {
527-
commonBuilders.push(buildEsLintConfig);
528-
}
520+
commonBuilders.push(buildEsLintConfig);
529521
if (!hasChangelogFile) {
530522
commonBuilders.push(buildChangelogFile);
531523
}
@@ -543,25 +535,16 @@ export async function $onEmit(context: EmitContext) {
543535
};
544536
// Build dependencies
545537
const dependencies: Record<string, string> = {};
546-
if (isAzureFlavor) {
547-
dependencies["@azure/core-util"] = "^1.9.2";
548-
}
538+
dependencies["@azure/core-util"] = "^1.9.2";
549539
// Add fast-xml-parser if XML serialization is used
550540
if (packageUsesXmlSerialization(dpgContext.sdkPackage)) {
551541
dependencies["fast-xml-parser"] = "^4.5.0";
552542
}
553-
if (isAzureFlavor) {
554-
modularPackageInfo = {
555-
...modularPackageInfo,
556-
dependencies,
557-
clientContextPaths: getRelativeContextPaths(context, modularEmitterOptions),
558-
};
559-
} else if (Object.keys(dependencies).length > 0) {
560-
modularPackageInfo = {
561-
...modularPackageInfo,
562-
dependencies,
563-
};
564-
}
543+
modularPackageInfo = {
544+
...modularPackageInfo,
545+
dependencies,
546+
clientContextPaths: getRelativeContextPaths(context, modularEmitterOptions),
547+
};
565548
}
566549
commonBuilders.push((model) => buildPackageFile(model, modularPackageInfo));
567550
// Generate warp.config.yml for Azure monorepo ESM packages
@@ -579,9 +562,7 @@ export async function $onEmit(context: EmitContext) {
579562
if (option.generateSample) {
580563
commonBuilders.push(buildTsSampleConfig);
581564
}
582-
if (isAzureFlavor) {
583-
commonBuilders.push(buildTsLintConfig);
584-
}
565+
commonBuilders.push(buildTsLintConfig);
585566
}
586567

587568
// TODO: need support snippets generation for multi-client cases. https://github.com/Azure/autorest.typescript/issues/3048
@@ -683,14 +664,12 @@ export async function $onEmit(context: EmitContext) {
683664
dpgContext.generationPathDetail?.metadataDir,
684665
);
685666
}
686-
if (isAzureFlavor) {
687-
await emitContentByBuilder(
688-
program,
689-
buildMetadataJson,
690-
rlcClient,
691-
dpgContext.generationPathDetail?.metadataDir,
692-
);
693-
}
667+
await emitContentByBuilder(
668+
program,
669+
buildMetadataJson,
670+
rlcClient,
671+
dpgContext.generationPathDetail?.metadataDir,
672+
);
694673

695674
// Generate test relevant files
696675
if (option.generateTest && !hasTestFolder) {

packages/typespec-ts/src/lib.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { createTypeSpecLibrary, JSONSchemaType, paramMessage } from "@typespec/compiler";
55
import { Options } from "prettier";
6-
import { DependencyInfo, PackageDetails, PackageFlavor, ServiceInfo } from "./rlc-common/index.js";
6+
import { DependencyInfo, PackageDetails, ServiceInfo } from "./rlc-common/index.js";
77

88
export interface EmitterOptions {
99
/**
@@ -54,7 +54,6 @@ export interface EmitterOptions {
5454
"is-modular-library"?: boolean;
5555
"module-kind"?: "esm";
5656
"enable-operation-group"?: boolean;
57-
flavor?: PackageFlavor;
5857
"enable-model-namespace"?: boolean;
5958
"hierarchy-client"?: boolean;
6059
"compatibility-mode"?: boolean;
@@ -63,7 +62,6 @@ export interface EmitterOptions {
6362
"clear-output-folder"?: boolean;
6463
"ignore-property-name-normalize"?: boolean;
6564
"compatibility-query-multi-format"?: boolean;
66-
branded?: boolean;
6765
"typespec-title-map"?: Record<string, string>;
6866
"ignore-enum-member-name-normalize"?: boolean;
6967
"default-value-object"?: boolean;
@@ -210,7 +208,7 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
210208
type: "boolean",
211209
nullable: true,
212210
description:
213-
"This is used to indicate your project is generated in [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) repo or not. If your package is located in that repo we'll leverage `dev-tool` to accelerate our building and testing, however if not we'll remove the dependency for that tool. Defaults to `undefined`. Services with Flavor equal to 'Azure' default to 'true'. ",
211+
"This is used to indicate your project is generated in [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) repo or not. If your package is located in that repo we'll leverage `dev-tool` to accelerate our building and testing, however if not we'll remove the dependency for that tool. Defaults to `undefined`. ",
214212
},
215213
"azure-output-directory": {
216214
type: "string",
@@ -288,16 +286,6 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
288286
description:
289287
"An option to organize the client in a hierarchical way as defined by `@clientInitialization`. This is true by default.",
290288
},
291-
branded: {
292-
type: "boolean",
293-
nullable: true,
294-
description: "A section of flavor",
295-
},
296-
flavor: {
297-
type: "string",
298-
nullable: true,
299-
description: "The flavor of the SDK.",
300-
},
301289
"module-kind": {
302290
type: "string",
303291
nullable: true,

packages/typespec-ts/src/modular/build-client-context.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NameType, isAzurePackage, normalizeName } from "../rlc-common/index.js";
1+
import { NameType, normalizeName } from "../rlc-common/index.js";
22
import {
33
buildGetClientCredentialParam,
44
buildGetClientEndpointParam,
@@ -164,13 +164,10 @@ export function buildClientContext(
164164
});
165165

166166
// TODO use binder here
167-
// (for now) now logger for unbranded pkgs
168-
if (isAzurePackage(emitterOptions)) {
169-
clientContextFile.addImportDeclaration({
170-
moduleSpecifier: "../".repeat(hierarchy.length + 1) + "logger.js",
171-
namedImports: ["logger"],
172-
});
173-
}
167+
clientContextFile.addImportDeclaration({
168+
moduleSpecifier: "../".repeat(hierarchy.length + 1) + "logger.js",
169+
namedImports: ["logger"],
170+
});
174171

175172
const factoryFunction = clientContextFile.addFunction({
176173
docs: getDocsFromDescription(client.doc),
@@ -241,15 +238,10 @@ export function buildClientContext(
241238
if (!apiVersionInEndpoint && apiVersionParam.clientDefaultValue) {
242239
apiVersionStatement += `const ${apiVersionParamName} = options.${apiVersionParamName};`;
243240
}
244-
} else if (isAzurePackage(emitterOptions)) {
245-
apiVersionStatement += `
246-
if (options.apiVersion) {
247-
logger.warning("This client does not support client api-version, please change it at the operation level");
248-
}`;
249241
} else {
250242
apiVersionStatement += `
251243
if (options.apiVersion) {
252-
console.warn("This client does not support client api-version, please change it at the operation level");
244+
logger.warning("This client does not support client api-version, please change it at the operation level");
253245
}`;
254246
}
255247
factoryFunction.addStatements(apiVersionStatement);

packages/typespec-ts/src/modular/build-root-index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Project, SourceFile } from "ts-morph";
44
import { useContext } from "../context-manager.js";
55
import { resolveReference } from "../framework/reference.js";
66
import { reportDiagnostic } from "../lib.js";
7-
import { isAzurePackage, NameType, normalizeName } from "../rlc-common/index.js";
7+
import { NameType, normalizeName } from "../rlc-common/index.js";
88
import { getModularClientOptions } from "../utils/client-utils.js";
99
import { SdkContext } from "../utils/interfaces.js";
1010
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
@@ -28,7 +28,7 @@ export function buildRootIndex(
2828
if (!clientMap) {
2929
// we still need to export the models if no client is provided
3030
exportModels(emitterOptions, rootIndexFile);
31-
exportRestErrorTypes(context, rootIndexFile);
31+
exportRestErrorTypes(rootIndexFile);
3232
return;
3333
}
3434
const project = useContext("outputProject");
@@ -71,7 +71,7 @@ export function buildRootIndex(
7171
exportPagingTypes(context, rootIndexFile);
7272
exportFileContentsType(context, rootIndexFile);
7373
exportAzureCloudTypes(context, rootIndexFile);
74-
exportRestErrorTypes(context, rootIndexFile);
74+
exportRestErrorTypes(rootIndexFile);
7575
}
7676

7777
function exportModels(
@@ -105,10 +105,7 @@ function exportAzureCloudTypes(context: SdkContext, rootIndexFile: SourceFile) {
105105
}
106106
}
107107

108-
function exportRestErrorTypes(context: SdkContext, rootIndexFile: SourceFile) {
109-
if (!isAzurePackage({ options: context.rlcOptions })) {
110-
return;
111-
}
108+
function exportRestErrorTypes(rootIndexFile: SourceFile) {
112109
const existingExports = getExistingExports(rootIndexFile);
113110
const namedExports = ["RestError", "isRestError"].filter((name) => !existingExports.has(name));
114111
if (namedExports.length > 0) {

packages/typespec-ts/src/modular/emit-logger-file.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import { ModularEmitterOptions } from "./interfaces.js";
33

44
export function emitLoggerFile(emitterOptions: ModularEmitterOptions, srcPath: string = "src") {
55
const project = useContext("outputProject");
6-
if (emitterOptions.options.flavor !== "azure") {
7-
return;
8-
}
96

107
const sourceFile = project.createSourceFile(`${srcPath}/logger.ts`, "", {
118
overwrite: true,

0 commit comments

Comments
 (0)