chore: Upgrade to TypeScript 6.0.3 and API Extractor 7.x - #3315
Open
bc-0dp wants to merge 1 commit into
Open
Conversation
Move from TypeScript 5.8 to 6.0.3 (via a 5.9 checkpoint) and migrate the declaration rollup from api-extractor 6.3.0 to 7.58.9. Adjustments for TS 6.0 breaking changes: - tsconfig.base.json: set "ignoreDeprecations": "6.0" (baseUrl, moduleResolution node10, target es5) and "types": ["*"] to restore the pre-6.0 automatic @types global inclusion. - ts-loader now uses an explicit configFile with onlyCompileBundledFiles so the webpack build type-checks only bundled files, not the whole repo. - build-dts passes --rootDir .. (TS 6.0 no longer infers rootDir) and strips api-extractor 7.x "export { }" markers so consumers can import the SDK's bare-declared types, matching the long-standing published .d.ts shape. - Migrated 6 api-extractor configs and the auto-export generator to the 7.x schema. - .npmrc legacy-peer-deps=true works around @bigcommerce/eslint-config's stale optional typescript peer (^4 || ^5); added @bigcommerce/eslint-plugin as a direct devDep so ESLint resolves it.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 1774427. Configure here.
| "tsc --outDir ../../temp --declaration --emitDeclarationOnly", | ||
| "tsc --outDir ../../temp --rootDir .. --declaration --emitDeclarationOnly", | ||
| "api-extractor run --config api-extractor/hosted-form-v2-iframe-content.json & api-extractor run --config api-extractor/hosted-form-v2-iframe-host.json", | ||
| "find ../../dist -maxdepth 1 -name 'hosted-form-v2-iframe-*.d.ts' -type f -exec perl -i -ne 'print unless /^export \\{.*\\}\\s*$/' {} +", |
There was a problem hiding this comment.
Missing wait before declaration strip
Medium Severity
The new perl step that strips export { } lines runs as the next Nx command while both api-extractor processes are still backgrounded (&) with no trailing wait. The strip (and following rm -rf ../../temp) can run before rollups finish, yielding incomplete .d.ts files or deleting temp while extractors still read it.
Reviewed by Cursor Bugbot for commit 1774427. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What/Why?
Upgrade the SDK from TypeScript 5.8 to 6.0.3 (via a 5.9 checkpoint), ahead of the eventual TypeScript 7 (native) move. TS 6.0 is a transitional release; its breaking changes are handled here. Also migrates the declaration rollup from
@microsoft/api-extractor6.3.0 (bundled TS 3.1) to 7.58.9.Key changes:
tsconfig.base.json:"ignoreDeprecations": "6.0"(silencesbaseUrl,moduleResolutionnode10, andtargetes5 pending the TS 7 migration) and"types": ["*"]to restore the pre-6.0 automatic@typesglobal inclusion.configFilewithonlyCompileBundledFiles, so the webpack build type-checks only bundled files, not the whole repo (TS 6.0 defaultsstrict: trueandtypes: []).build-dtspasses--rootDir ..(TS 6.0 no longer infers rootDir for the multi-package emit) and strips api-extractor 7.xexport { }markers, so consumers keep importing the SDK's bare-declared types, matching the long-standing published.d.tsshape.auto-exportgenerator to the 7.x schema..npmrclegacy-peer-deps=trueworks around@bigcommerce/eslint-config's stale optionaltypescriptpeer (^4 || ^5); added@bigcommerce/eslint-pluginas a direct devDep so ESLint resolves it.Reviewer note: the
docs/diff includes api-extractor 7.x numeric disambiguation renames (e.g.Omit.mdbecomesOmit_2.md,PaymentProviderCustomerTypebecomesPaymentProviderCustomer_2). Content is unchanged; only the internal collision labels differ.Rollout/Rollback
Tooling and build-config change only. No runtime feature flags, experiments, or migrations. The published JS bundles are behavior-equivalent (Babel still targets the existing browserslist); only the
.d.tsstructure and build config change. Rollback is a straight revert of this branch.Testing
lint(52 projects),test(core 2478 tests plus 51 other projects),build,bundle-dts,docs(587 files),build-cdn.typecheckoutput is byte-identical to the published-SDK baseline (214 pre-existing errors on itsmaster, 0 new).TS2459"declared locally but not exported" count is 0, confirming theexport { }strip.buildpasses; the test suite reports 1324 pass with 2 pre-existing failures unrelated to the SDK.Note
Medium Risk
Published
.d.tsshape and the declaration rollup pipeline change with a major TypeScript and API Extractor jump; runtime JS is unchanged but downstream typecheck compatibility is the main regression surface.Overview
Upgrades the monorepo toolchain from TypeScript ~5.8 to 6.0.3 and @microsoft/api-extractor from 6.3 to 7.58.9, with lockfile and devDependency updates (
@bigcommerce/eslint-plugin, api-extractor’s Rushstack stack).TypeScript 6 compatibility:
tsconfig.base.jsonaddsignoreDeprecations: "6.0"andtypes: ["*"]so global@typesbehavior matches pre-6.0. Webpackts-loadernow points attsconfig.base.jsonwithonlyCompileBundledFiles: trueso bundles are type-checked without pulling the whole repo under TS 6 defaults.Declaration build:
build-dtsusestsc --rootDir ..for multi-package emits, rolls up.d.tsvia API Extractor 7 (mainEntryPointFilePath,untrimmedFilePath,overrideTsconfig, suppressed extractor messages), and strips api-extractor 7export { }lines so published typings stay consumer-friendly. The same pattern applies to core, hosted-form-v2, and auto-export–generated integration configs.npm:
.npmrcsetslegacy-peer-deps=trueuntil@bigcommerce/eslint-configdeclares a TypeScript 6 peer range.Reviewed by Cursor Bugbot for commit 1774427. Bugbot is set up for automated code reviews on this repo. Configure here.