fix: generate all config/tsconfig.*.json files and update eslint.config.mjs alongside warp.config.yml#3965
fix: generate all config/tsconfig.*.json files and update eslint.config.mjs alongside warp.config.yml#3965Copilot wants to merge 7 commits into
Conversation
…fig.yml Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/5af3f04a-b197-4d6d-8129-f4834853bb1d Co-authored-by: jeremymeng <7583839+jeremymeng@users.noreply.github.com>
|
@copilot Other tsconfig.*.json now should also be generated into the package-level |
…onfig.mjs Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/0d23bcf8-42c8-4c5d-af4c-09d1ef8c40e5 Co-authored-by: jeremymeng <7583839+jeremymeng@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/0d23bcf8-42c8-4c5d-af4c-09d1ef8c40e5 Co-authored-by: jeremymeng <7583839+jeremymeng@users.noreply.github.com>
Done in commit 82a633d (and minor cleanup in 1d07aff):
|
|
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? |
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. |
|
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. |
Good Q and I guess either option is fine - our first goal should be to unblock emitter upgrades again. That can be done via this or #3967 or by doing a single-PR batch update to existing libraries to bring them up to whatever Deya was working towards. looking at the state of the repo, it seems that the majority of packages have not migrated to this pattern yet and I think we probably would undo a lot of this work anyway, So maybe our options are:
|
|
migrate the JS repo to |
warp.config.ymlreferences./config/tsconfig.src.{esm,browser,react-native,cjs}.jsonunder itstargetssection, but neither@azure-tools/typespec-tsnor@autorest/typescriptwas generating those files, causing warp build failures for all TypeSpec-based PRs in azure-rest-api-specs.Changes
packages/rlc-common/src/metadata/buildTsConfig.tsbuildTsLintConfig()that generatesconfig/tsconfig.lint.json(extends../../../../tsconfig.json, includes../srcand../test)packages/rlc-common/src/metadata/buildESLintConfig.tslanguageOptions.parserOptions.project: "./config/tsconfig.lint.json"for type-aware linting, matching the azure-sdk-for-js patternpackages/typespec-ts/src/index.tshasPackageFile && !hasManualConvenienceLayer), addedbuildTsConfig,buildTsSrcEsmConfig,buildTsSrcBrowserConfig,buildTsSrcReactNativeConfig,buildTsSrcCjsConfig,buildTsLintConfig, andbuildTsSampleConfigtoupdateBuildersalongsidebuildWarpConfig.buildTsLintConfigtocommonBuilders.packages/autorest.typescript/src/generators/static/tsConfigFileGenerator.tshighLevelTsConfigInAzureSdkForJsso thattsconfig.jsonat the package root references all configs fromconfig/(test, samples, snippets).generateTsSrcEsmConfig,generateTsSrcBrowserConfig,generateTsSrcReactNativeConfig,generateTsSrcCjsConfigforconfig/tsconfig.src.*.jsonfiles.generateTsSampleConfigandgenerateTsSnippetsConfigto write underconfig/(extending../../../../eng/tsconfigs/).generateTsLintConfig()that generatesconfig/tsconfig.lint.json.packages/autorest.typescript/src/generators/static/tsConfigTestFileGenerator.tsconfig/tsconfig.test.node.jsonandconfig/tsconfig.test.browser.json(extending../../../../eng/tsconfigs/test.*.json).tsconfig.test.jsoncontainer file (no longer needed sincetsconfig.jsondirectly references individual configs fromconfig/).packages/autorest.typescript/src/typescriptGenerator.tsgenerateTsSrcConfigwith four per-target generators and addedgenerateTsLintConfig.The generated
config/directory follows the same pattern as the rest of azure-sdk-for-js (e.g.,sdk/core/core-rest-pipeline/config/):There is now a single
tsconfig.jsonat the package root withfiles: []andreferencespointing to all tsconfig files underconfig/.