Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,153 changes: 1,415 additions & 4,738 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"@graphql-codegen/cli": "^5.0.7",
"@graphql-codegen/client-preset": "^4.8.1",
"@graphql-typed-document-node/core": "^3.2.0",
"@microsoft/api-extractor": "^6.3.0",
"@microsoft/api-extractor": "^7.58.9",
"@nx/devkit": "19.8.9",
"@nx/eslint": "19.8.9",
"@nx/eslint-plugin": "19.8.9",
Expand Down Expand Up @@ -151,7 +151,7 @@
"ts-loader": "^9.5.1",
"typedoc": "^0.28.19",
"typedoc-plugin-markdown": "^4.11.0",
"typescript": "~5.8.3",
"typescript": "6.0.3",
"webpack": "^5.101.3",
"webpack-assets-manifest": "^5.1.0",
"webpack-bundle-analyzer": "^4.5.0",
Expand All @@ -161,6 +161,12 @@
"optionalDependencies": {
"@swc/core-linux-x64-gnu": "^1.5.29"
},
"overrides": {
"@types/minimatch": "5.1.2",
"@bigcommerce/eslint-config": {
"typescript": "$typescript"
}
},
"standard-version": {
"scripts": {
"prebump": "./scripts/standard-version/prebump.js"
Expand Down
7 changes: 3 additions & 4 deletions packages/core/api-extractor/checkout-button.json
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"
}
}
62 changes: 52 additions & 10 deletions packages/core/api-extractor/checkout-sdk.json
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"
}
}
}
}
7 changes: 3 additions & 4 deletions packages/core/api-extractor/embedded-checkout.json
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"
}
}
7 changes: 3 additions & 4 deletions packages/core/api-extractor/internal-mappers.json
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"
}
}
4 changes: 2 additions & 2 deletions packages/core/auto-export.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
],
"apiExtractorConfig": {
"entryPointSourceFile": "../../temp/core/src/generated/integrations/<moduleName>/index.d.ts",
"mainDtsRollupPath": "types/integrations/<moduleName>.d.ts"
"entryPointSourceFile": "<projectFolder>/../../temp/core/src/generated/integrations/<moduleName>/index.d.ts",
"mainDtsRollupPath": "<projectFolder>/../../dist/types/integrations/<moduleName>.d.ts"
}
}
5 changes: 3 additions & 2 deletions packages/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@
"cwd": "packages/core",
"parallel": false,
"commands": [
"tsc --outDir ../../temp --declaration --emitDeclarationOnly",
"api-extractor run --config api-extractor/checkout-sdk.json & api-extractor run --config api-extractor/checkout-button.json & api-extractor run --config api-extractor/embedded-checkout.json & api-extractor run --config api-extractor/internal-mappers.json & wait",
"tsc --outDir ../../temp --rootDir .. --declaration --emitDeclarationOnly",
"api-extractor run --config api-extractor/checkout-sdk.json & pid1=$!; api-extractor run --config api-extractor/checkout-button.json & pid2=$!; api-extractor run --config api-extractor/embedded-checkout.json & pid3=$!; api-extractor run --config api-extractor/internal-mappers.json & pid4=$!; wait $pid1 && wait $pid2 && wait $pid3 && wait $pid4",
"find src/generated/integrations -name 'api-extractor.json' | xargs -I {} -P 8 sh -c 'cd \"$(dirname \"{}\")\" && npx api-extractor run --config api-extractor.json'",
"find ../../dist/types -name '*.d.ts' -type f -exec perl -i -ne 'print unless /^export \\{.*\\}\\s*$/' {} +",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran build-dts on this branch to check the new output — the regex here catches more than the trailing export { }. API Extractor 7 also emits real exports in this form (no semicolon), and the raw output has export { createTimeout } in both checkout-sdk.d.ts and checkout-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.

Copy link
Copy Markdown
Collaborator Author

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 - any export { … } block (even export { 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?

Copy link
Copy Markdown
Contributor

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.ts out of implicit-export mode, and I confirmed with tsc that 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"] in checkout-sdk.json makes API Extractor inline it and would fix it properly.)

"rm -rf ../../temp",
"nx run hosted-form-v2:build-dts"
]
Expand Down
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"
}
}
}
}
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"
}
}
}
}
5 changes: 3 additions & 2 deletions packages/hosted-form-v2/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"cwd": "packages/hosted-form-v2",
"parallel": false,
"commands": [
"tsc --outDir ../../temp --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",
"tsc --outDir ../../temp --rootDir .. --declaration --emitDeclarationOnly",
"api-extractor run --config api-extractor/hosted-form-v2-iframe-content.json & pid1=$!; api-extractor run --config api-extractor/hosted-form-v2-iframe-host.json & pid2=$!; wait $pid1 && wait $pid2",
"find ../../dist -maxdepth 1 -name 'hosted-form-v2-iframe-*.d.ts' -type f -exec perl -i -ne 'print unless /^export \\{.*\\}\\s*$/' {} +",
Comment thread
cursor[bot] marked this conversation as resolved.
"rm -rf ../../temp"
]
}
Expand Down
Loading