Skip to content

fix: generate all config/tsconfig.*.json files and update eslint.config.mjs alongside warp.config.yml#3965

Open
Copilot wants to merge 7 commits into
mainfrom
copilot/fix-config-files-generation
Open

fix: generate all config/tsconfig.*.json files and update eslint.config.mjs alongside warp.config.yml#3965
Copilot wants to merge 7 commits into
mainfrom
copilot/fix-config-files-generation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

warp.config.yml references ./config/tsconfig.src.{esm,browser,react-native,cjs}.json under its targets section, but neither @azure-tools/typespec-ts nor @autorest/typescript was generating those files, causing warp build failures for all TypeSpec-based PRs in azure-rest-api-specs.

Changes

packages/rlc-common/src/metadata/buildTsConfig.ts

  • Added buildTsLintConfig() that generates config/tsconfig.lint.json (extends ../../../../tsconfig.json, includes ../src and ../test)

packages/rlc-common/src/metadata/buildESLintConfig.ts

  • Updated the ESM variant to use the spread export pattern and include languageOptions.parserOptions.project: "./config/tsconfig.lint.json" for type-aware linting, matching the azure-sdk-for-js pattern

packages/typespec-ts/src/index.ts

  • In the update path (hasPackageFile && !hasManualConvenienceLayer), added buildTsConfig, buildTsSrcEsmConfig, buildTsSrcBrowserConfig, buildTsSrcReactNativeConfig, buildTsSrcCjsConfig, buildTsLintConfig, and buildTsSampleConfig to updateBuilders alongside buildWarpConfig.
  • In the new generation path, added buildTsLintConfig to commonBuilders.

packages/autorest.typescript/src/generators/static/tsConfigFileGenerator.ts

  • Updated highLevelTsConfigInAzureSdkForJs so that tsconfig.json at the package root references all configs from config/ (test, samples, snippets).
  • Added generateTsSrcEsmConfig, generateTsSrcBrowserConfig, generateTsSrcReactNativeConfig, generateTsSrcCjsConfig for config/tsconfig.src.*.json files.
  • Moved generateTsSampleConfig and generateTsSnippetsConfig to write under config/ (extending ../../../../eng/tsconfigs/).
  • Added generateTsLintConfig() that generates config/tsconfig.lint.json.

packages/autorest.typescript/src/generators/static/tsConfigTestFileGenerator.ts

  • Moved test tsconfigs to config/tsconfig.test.node.json and config/tsconfig.test.browser.json (extending ../../../../eng/tsconfigs/test.*.json).
  • Removed the legacy tsconfig.test.json container file (no longer needed since tsconfig.json directly references individual configs from config/).

packages/autorest.typescript/src/typescriptGenerator.ts

  • Replaced generateTsSrcConfig with four per-target generators and added generateTsLintConfig.

The generated config/ directory follows the same pattern as the rest of azure-sdk-for-js (e.g., sdk/core/core-rest-pipeline/config/):

// config/tsconfig.src.browser.json
{
  "extends": "../../../../eng/tsconfigs/src.browser.json",
  "include": ["../src/index.ts"]
}

There is now a single tsconfig.json at the package root with files: [] and references pointing to all tsconfig files under config/.

Copilot AI changed the title [WIP] Fix issue with generated JS repo flavor packages fix: generate config/tsconfig.src.*.json files alongside warp.config.yml May 14, 2026
Copilot AI requested a review from jeremymeng May 14, 2026 17:12
@jeremymeng
Copy link
Copy Markdown
Member

@copilot Other tsconfig.*.json now should also be generated into the package-level config/ directory. There should be only one tsconfig.json under package directory, and it references tsconfig files (just src/test/samples/snippets) under config/. The eslint config file (eslint.config.mjs) should be updated to include a rule similar to https://github.com/Azure/azure-sdk-for-js/blob/e27a67644732133358031641557731736e0b4f4b/sdk/core/core-rest-pipeline/eslint.config.mjs#L23-L31

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 14, 2026

@copilot Other tsconfig.*.json now should also be generated into the package-level config/ directory. There should be only one tsconfig.json under package directory, and it references tsconfig fi...

Done in commit 82a633d (and minor cleanup in 1d07aff):

  • All tsconfig.*.json files (test, samples, snippets, lint) now go under config/ for both typespec-ts and autorest.typescript HLC generators
  • tsconfig.json at the package root references only config/tsconfig.*.json files (single root tsconfig, no more tsconfig.test.json container)
  • eslint.config.mjs (ESM variant) updated to include languageOptions.parserOptions.project: "./config/tsconfig.lint.json" — matching the pattern in core-rest-pipeline
  • New config/tsconfig.lint.json extends ../../../../tsconfig.json and includes ../src and ../test

Copilot AI changed the title fix: generate config/tsconfig.src.*.json files alongside warp.config.yml fix: generate all config/tsconfig.*.json files and update eslint.config.mjs alongside warp.config.yml May 14, 2026
@jeremymeng jeremymeng marked this pull request as ready for review May 15, 2026 00:46
@maorleger
Copy link
Copy Markdown
Member

I was looking into this and came up with a small targeted fix that I think should work #3967

I think the issue here is that if we're updating a package we're not generating the config files recently added. Maybe the assumption was that all packages would have migrated already?

Anyway hopefully a smaller fix - do you think that would work?

@jeremymeng
Copy link
Copy Markdown
Member

I was looking into this and came up with a small targeted fix that I think should work #3967

I think the issue here is that if we're updating a package we're not generating the config files recently added. Maybe the assumption was that all packages would have migrated already?

Yes, it appears that copilot made similar fix to the update code path. I asked it to add tsconfig.json and eslint.config.mjs changes too but those can be separate if we want.

@JialinHuang803
Copy link
Copy Markdown
Member

Could we add the missing config files to the sdk repo for the libraries in batch? In this way, we don't need to re-generate these static files each time a package is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

newly generated JS repo flavor packages fail to build

4 participants