-
Notifications
You must be signed in to change notification settings - Fork 215
chore: Upgrade to TypeScript 6.0.3 and API Extractor 7.x #3315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bc-0dp
wants to merge
4
commits into
bigcommerce:master
Choose a base branch
from
bc-0dp:typescript-6-upgrade
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
61c6d6f
chore: Upgrade to TypeScript 6.0.3 and API Extractor 7.x
6e96f5e
fix: Await hosted-form-v2 api-extractor runs before stripping .d.ts
169c6ac
chore: Use es6 target in API Extractor tsconfig overrides
eb1229f
fix: propagate dts extractor exit codes and scope eslint peer
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| { | ||
| "extends": "./checkout-sdk.json", | ||
| "project": { | ||
| "entryPointSourceFile": "../../temp/core/src/bundles/checkout-button.d.ts" | ||
| }, | ||
| "mainEntryPointFilePath": "<projectFolder>/../../temp/core/src/bundles/checkout-button.d.ts", | ||
| "dtsRollup": { | ||
| "mainDtsRollupPath": "types/checkout-button.d.ts" | ||
| "enabled": true, | ||
| "untrimmedFilePath": "<projectFolder>/../../dist/types/checkout-button.d.ts" | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,64 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "mainEntryPointFilePath": "<projectFolder>/../../temp/core/src/bundles/checkout-sdk.d.ts", | ||
| "bundledPackages": [], | ||
| "compiler": { | ||
| "configType": "tsconfig", | ||
| "rootFolder": "." | ||
| "overrideTsconfig": { | ||
| "compilerOptions": { | ||
| "target": "es6", | ||
| "module": "esnext", | ||
| "moduleResolution": "node", | ||
| "lib": ["dom", "dom.iterable", "esnext", "scripthost"], | ||
| "experimentalDecorators": true, | ||
| "esModuleInterop": true, | ||
| "allowSyntheticDefaultImports": true, | ||
| "skipLibCheck": true, | ||
| "strict": true, | ||
| "stripInternal": true | ||
| }, | ||
| "include": ["../../temp/**/*.d.ts"] | ||
| } | ||
| }, | ||
| "project": { | ||
| "entryPointSourceFile": "../../temp/core/src/bundles/checkout-sdk.d.ts" | ||
| }, | ||
| "validationRules": { | ||
| "missingReleaseTags": "allow" | ||
| "apiReport": { | ||
| "enabled": false | ||
| }, | ||
| "apiReviewFile": { | ||
| "docModel": { | ||
| "enabled": false | ||
| }, | ||
| "apiJsonFile": { | ||
| "tsdocMetadata": { | ||
| "enabled": false | ||
| }, | ||
| "dtsRollup": { | ||
| "enabled": true, | ||
| "mainDtsRollupPath": "types/checkout-sdk.d.ts" | ||
| "untrimmedFilePath": "<projectFolder>/../../dist/types/checkout-sdk.d.ts" | ||
| }, | ||
| "messages": { | ||
| "compilerMessageReporting": { | ||
| "default": { | ||
| "logLevel": "warning" | ||
| } | ||
| }, | ||
| "extractorMessageReporting": { | ||
| "default": { | ||
| "logLevel": "warning" | ||
| }, | ||
| "ae-wrong-input-file-type": { | ||
| "logLevel": "none" | ||
| }, | ||
| "ae-missing-release-tag": { | ||
| "logLevel": "none" | ||
| }, | ||
| "ae-forgotten-export": { | ||
| "logLevel": "none" | ||
| }, | ||
| "ae-unresolved-link": { | ||
| "logLevel": "none" | ||
| } | ||
| }, | ||
| "tsdocMessageReporting": { | ||
| "default": { | ||
| "logLevel": "none" | ||
| } | ||
| } | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| { | ||
| "extends": "./checkout-sdk.json", | ||
| "project": { | ||
| "entryPointSourceFile": "../../temp/core/src/bundles/embedded-checkout.d.ts" | ||
| }, | ||
| "mainEntryPointFilePath": "<projectFolder>/../../temp/core/src/bundles/embedded-checkout.d.ts", | ||
| "dtsRollup": { | ||
| "mainDtsRollupPath": "types/embedded-checkout.d.ts" | ||
| "enabled": true, | ||
| "untrimmedFilePath": "<projectFolder>/../../dist/types/embedded-checkout.d.ts" | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| { | ||
| "extends": "./checkout-sdk.json", | ||
| "project": { | ||
| "entryPointSourceFile": "../../temp/core/src/bundles/internal-mappers.d.ts" | ||
| }, | ||
| "mainEntryPointFilePath": "<projectFolder>/../../temp/core/src/bundles/internal-mappers.d.ts", | ||
| "dtsRollup": { | ||
| "mainDtsRollupPath": "types/internal-mappers.d.ts" | ||
| "enabled": true, | ||
| "untrimmedFilePath": "<projectFolder>/../../dist/types/internal-mappers.d.ts" | ||
| } | ||
| } |
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
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
62 changes: 52 additions & 10 deletions
62
packages/hosted-form-v2/api-extractor/hosted-form-v2-iframe-content.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,64 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "mainEntryPointFilePath": "<projectFolder>/../../temp/hosted-form-v2/src/bundles/hosted-form-v2-iframe-content.d.ts", | ||
| "bundledPackages": [], | ||
| "compiler": { | ||
| "configType": "tsconfig", | ||
| "rootFolder": "." | ||
| "overrideTsconfig": { | ||
| "compilerOptions": { | ||
| "target": "es6", | ||
| "module": "esnext", | ||
| "moduleResolution": "node", | ||
| "lib": ["dom", "dom.iterable", "esnext", "scripthost"], | ||
| "experimentalDecorators": true, | ||
| "esModuleInterop": true, | ||
| "allowSyntheticDefaultImports": true, | ||
| "skipLibCheck": true, | ||
| "strict": true, | ||
| "stripInternal": true | ||
| }, | ||
| "include": ["../../temp/**/*.d.ts"] | ||
| } | ||
| }, | ||
| "project": { | ||
| "entryPointSourceFile": "../../temp/hosted-form-v2/src/bundles/hosted-form-v2-iframe-content.d.ts" | ||
| }, | ||
| "validationRules": { | ||
| "missingReleaseTags": "allow" | ||
| "apiReport": { | ||
| "enabled": false | ||
| }, | ||
| "apiReviewFile": { | ||
| "docModel": { | ||
| "enabled": false | ||
| }, | ||
| "apiJsonFile": { | ||
| "tsdocMetadata": { | ||
| "enabled": false | ||
| }, | ||
| "dtsRollup": { | ||
| "enabled": true, | ||
| "mainDtsRollupPath": "hosted-form-v2-iframe-content.d.ts" | ||
| "untrimmedFilePath": "<projectFolder>/../../dist/hosted-form-v2-iframe-content.d.ts" | ||
| }, | ||
| "messages": { | ||
| "compilerMessageReporting": { | ||
| "default": { | ||
| "logLevel": "warning" | ||
| } | ||
| }, | ||
| "extractorMessageReporting": { | ||
| "default": { | ||
| "logLevel": "warning" | ||
| }, | ||
| "ae-wrong-input-file-type": { | ||
| "logLevel": "none" | ||
| }, | ||
| "ae-missing-release-tag": { | ||
| "logLevel": "none" | ||
| }, | ||
| "ae-forgotten-export": { | ||
| "logLevel": "none" | ||
| }, | ||
| "ae-unresolved-link": { | ||
| "logLevel": "none" | ||
| } | ||
| }, | ||
| "tsdocMessageReporting": { | ||
| "default": { | ||
| "logLevel": "none" | ||
| } | ||
| } | ||
| } | ||
| } |
62 changes: 52 additions & 10 deletions
62
packages/hosted-form-v2/api-extractor/hosted-form-v2-iframe-host.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,64 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "mainEntryPointFilePath": "<projectFolder>/../../temp/hosted-form-v2/src/bundles/hosted-form-v2-iframe-host.d.ts", | ||
| "bundledPackages": [], | ||
| "compiler": { | ||
| "configType": "tsconfig", | ||
| "rootFolder": "." | ||
| "overrideTsconfig": { | ||
| "compilerOptions": { | ||
| "target": "es6", | ||
| "module": "esnext", | ||
| "moduleResolution": "node", | ||
| "lib": ["dom", "dom.iterable", "esnext", "scripthost"], | ||
| "experimentalDecorators": true, | ||
| "esModuleInterop": true, | ||
| "allowSyntheticDefaultImports": true, | ||
| "skipLibCheck": true, | ||
| "strict": true, | ||
| "stripInternal": true | ||
| }, | ||
| "include": ["../../temp/**/*.d.ts"] | ||
| } | ||
| }, | ||
| "project": { | ||
| "entryPointSourceFile": "../../temp/hosted-form-v2/src/bundles/hosted-form-v2-iframe-host.d.ts" | ||
| }, | ||
| "validationRules": { | ||
| "missingReleaseTags": "allow" | ||
| "apiReport": { | ||
| "enabled": false | ||
| }, | ||
| "apiReviewFile": { | ||
| "docModel": { | ||
| "enabled": false | ||
| }, | ||
| "apiJsonFile": { | ||
| "tsdocMetadata": { | ||
| "enabled": false | ||
| }, | ||
| "dtsRollup": { | ||
| "enabled": true, | ||
| "mainDtsRollupPath": "hosted-form-v2-iframe-host.d.ts" | ||
| "untrimmedFilePath": "<projectFolder>/../../dist/hosted-form-v2-iframe-host.d.ts" | ||
| }, | ||
| "messages": { | ||
| "compilerMessageReporting": { | ||
| "default": { | ||
| "logLevel": "warning" | ||
| } | ||
| }, | ||
| "extractorMessageReporting": { | ||
| "default": { | ||
| "logLevel": "warning" | ||
| }, | ||
| "ae-wrong-input-file-type": { | ||
| "logLevel": "none" | ||
| }, | ||
| "ae-missing-release-tag": { | ||
| "logLevel": "none" | ||
| }, | ||
| "ae-forgotten-export": { | ||
| "logLevel": "none" | ||
| }, | ||
| "ae-unresolved-link": { | ||
| "logLevel": "none" | ||
| } | ||
| }, | ||
| "tsdocMessageReporting": { | ||
| "default": { | ||
| "logLevel": "none" | ||
| } | ||
| } | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran
build-dtson this branch to check the new output — the regex here catches more than the trailingexport { }. API Extractor 7 also emits real exports in this form (no semicolon), and the raw output hasexport { createTimeout }in bothcheckout-sdk.d.tsandcheckout-button.d.ts. The perl step deletes those too, so createTimeout disappears from the published typings. Funnily enough, v7 was actually fixing this — the current typings have the import but no export, and this strip reverts the fix.Anchoring it to the empty marker fixes it:
perl -i -ne 'print unless /^export \{\s*\}\s*$/'Same change needed in hosted-form-v2's
project.json.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richapatel1510 I think I need a bit of guidance on this one.
When I try your suggestion
perl -i -ne 'print unless /^export \{\s*\}\s*$/', only 20 typedoc files are output vs 590 - anyexport { … }block (evenexport { createTimeout }) flips the entry file into explicit-export mode, so typedoc stops documenting the bare declares.If I apply the narrow strip to the types only (a hybrid),
createTimeout()gets exported and the docs stay at 590. Consumer imports are unaffected either way.If I keep the broad strip as-is,
createTimeout()isn't exported - but am I wrong in saying it's also not exported on main today?So I'm leaning toward the hybrid. Does that work for you, or would you rather handle it differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @bc-0dp ,
Dug into this properly and you're right — keeping the broad strip is correct. Any surviving
export { ... }statement (even from my suggested regex) flips the.d.tsout of implicit-export mode, and I confirmed withtscthat the narrow version breaks imports of most public types, while your version matches the exact surface published today. So: as-is is right, withdrawing my suggestion.On createTimeout — confirmed it's already missing on main, so nothing for this PR. (For a follow-up:
"bundledPackages": ["@bigcommerce/request-sender"]incheckout-sdk.jsonmakes API Extractor inline it and would fix it properly.)