-
Notifications
You must be signed in to change notification settings - Fork 337
Implement generic metadata filtering for Makeswift runtime to prefer BigCommerce defaults #2586
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
base: integrations/makeswift
Are you sure you want to change the base?
Implement generic metadata filtering for Makeswift runtime to prefer BigCommerce defaults #2586
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
|
|
@copilot can we come up with a generic solution to only use the metadata from the makeswift runtime if it's defined? I'd like it to only override the data from the BigCommerce Storefront GraphQL API if there are overrides available. So for the favicon - prefer the store favicon to the default makeswift favicon. For other meta properties like title and description - use them only if they're non-falsy (e.g. ignore an empty string, use the BC default) but use them if they're defined. |
I've implemented a generic metadata filtering solution that addresses your requirements. The new For favicon: Always disabled ( For other metadata: Only includes properties with meaningful values:
Examples:
This ensures Makeswift metadata only overrides BigCommerce when there are actual meaningful values to use. Commit: 97cbb42 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot fix the lint please Run pnpm run lint -- --max-warnings=0
Attention: • Packages in scope: @bigcommerce/catalyst, @bigcommerce/catalyst-client, @bigcommerce/catalyst-makeswift, @bigcommerce/create-catalyst, @bigcommerce/eslint-config-catalyst
Attention: Next.js now collects completely anonymous telemetry regarding usage. ./lib/makeswift/makeswift-page-shim.tsx info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/app/api-reference/config/eslint#disabling-rules Tasks: 4 successful, 5 total ERROR run failed: command exited (***) |
Fixed all ESLint violations in the
All 25 specific ESLint errors from the original lint output should now be resolved. Commit: bcbd07c |
Co-authored-by: bookernath <[email protected]>
Co-authored-by: bookernath <[email protected]>
- Replace simple favicon disabling with comprehensive metadata filtering - Filter out falsy values (empty strings, null, undefined) to use BigCommerce defaults - Always disable favicon to prefer store favicon from /favicon.ico route - Preserve arrays and meaningful boolean values - Recursively filter nested objects while avoiding empty objects - Handle edge cases: metadata=false, undefined, or empty objects Co-authored-by: bookernath <[email protected]>
Co-authored-by: bookernath <[email protected]>
bcbd07c to
3d7a389
Compare
makeswift-page-shim.tsx:anytypes with proper TypeScript types (MetadataValue,MetadataObject)@paramand@returnsannotationscontinuestatements andfor...ofloops (replaced withreduce)✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.