Skip to content

Commit f573a24

Browse files
maorlegerCopilot
andcommitted
fix: generate config/ tsconfig files in the update path alongside warp.config.yml
The update path (existing package with package.json) was generating warp.config.yml with ./config/tsconfig.src.*.json references but not generating the config/ directory or tsconfig.json with the matching references. This caused warp build failures for all TypeSpec-based SDK validation runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 679311a commit f573a24

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

packages/rlc-common/test/integration/warpConfig.spec.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
import { describe, it, expect } from "vitest";
55

66
import { buildWarpConfig } from "../../src/metadata/buildWarpConfig.js";
7+
import {
8+
buildTsSrcEsmConfig,
9+
buildTsSrcBrowserConfig,
10+
buildTsSrcReactNativeConfig,
11+
buildTsSrcCjsConfig
12+
} from "../../src/metadata/buildTsConfig.js";
713
import { createMockModel } from "./mockHelper.js";
814

915
describe("warp.config.yml generation", () => {
@@ -127,4 +133,28 @@ describe("warp.config.yml generation", () => {
127133
expect(result!.content).toContain("name: commonjs");
128134
});
129135
});
136+
137+
describe("tsconfig path consistency", () => {
138+
it("warp config references every config/ tsconfig that the builders produce", () => {
139+
const model = createMockModel({
140+
moduleKind: "esm",
141+
isMonorepo: true,
142+
flavor: "azure"
143+
});
144+
145+
const warpContent = buildWarpConfig(model)!.content;
146+
147+
const configBuilders = [
148+
buildTsSrcEsmConfig,
149+
buildTsSrcBrowserConfig,
150+
buildTsSrcReactNativeConfig,
151+
buildTsSrcCjsConfig
152+
];
153+
154+
for (const builder of configBuilders) {
155+
const tsconfigPath = `./${builder().path}`;
156+
expect(warpContent).toContain(tsconfigPath);
157+
}
158+
});
159+
});
130160
});

packages/typespec-ts/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,16 @@ export async function $onEmit(context: EmitContext) {
640640
);
641641
}
642642

643-
// Update warp.config.yml for Azure monorepo packages
643+
// Update warp.config.yml and config/ tsconfig files for Azure monorepo packages
644644
if (option.azureSdkForJs) {
645645
updateBuilders.push((model: RLCModel) =>
646646
buildWarpConfig(model, modularPackageInfo)
647647
);
648+
updateBuilders.push(buildTsConfig);
649+
updateBuilders.push(buildTsSrcEsmConfig);
650+
updateBuilders.push(buildTsSrcBrowserConfig);
651+
updateBuilders.push(buildTsSrcReactNativeConfig);
652+
updateBuilders.push(buildTsSrcCjsConfig);
648653
}
649654

650655
// If the client name changed, regenerate the README and snippets completely;

0 commit comments

Comments
 (0)