Skip to content
Draft
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@google-cloud/bigquery": "^8.3.1",
"@google-cloud/firestore": "^7.6.0",
"@opentelemetry/api": "^1.7.0",
"@paypal/paypal-js": "10.0.1",
"@sentry/node": "^9.2.0",
"@tpluscode/sparql-builder": "^0.3.12",
"@types/bindings": "^1.3.0",
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions test/integration/paypal-js-sdk-v6.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Regression test for https://github.com/vercel/nft/issues/599
// @paypal/paypal-js@10.0.1 exposes ./sdk-v6 with only "types" + "import"
// conditions. Tracing must include dist/v6/esm/paypal-js.js so the named
// export loadCoreSdkScript resolves at runtime after packaging.
import { loadCoreSdkScript } from '@paypal/paypal-js/sdk-v6';

if (typeof loadCoreSdkScript !== 'function') {
throw new Error(
`Expected loadCoreSdkScript to be a function, got ${typeof loadCoreSdkScript}`,
);
}
3 changes: 2 additions & 1 deletion test/unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ for (const { testName, isRoot } of unitTests) {
testName === 'module-create-require-named-require' ||
testName === 'module-create-require-named-import' ||
testName === 'module-create-require-ignore-other' ||
testName === 'module-create-require-destructure'
testName === 'module-create-require-destructure' ||
testName === 'paypal-js-sdk-v6'
) {
inputFileNames = ['input.mjs'];
}
Expand Down
3 changes: 3 additions & 0 deletions test/unit/paypal-js-sdk-v6/input.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { loadCoreSdkScript } from '@paypal/paypal-js/sdk-v6';

console.log(typeof loadCoreSdkScript);
5 changes: 5 additions & 0 deletions test/unit/paypal-js-sdk-v6/output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
"node_modules/@paypal/paypal-js/dist/v6/esm/paypal-js.js",
"node_modules/@paypal/paypal-js/package.json",
"test/unit/paypal-js-sdk-v6/input.mjs"
]
Loading