@graphcommerce/next-config 8.1.0-canary.41 → 8.1.0-canary.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.1.0-canary.42
4
+
3
5
  ## 8.1.0-canary.41
4
6
 
5
7
  ### Patch Changes
@@ -163,6 +163,14 @@ it('finds plugins', () => {
163
163
  "targetModule": "@graphcommerce/magento-product",
164
164
  "type": "component",
165
165
  },
166
+ {
167
+ "enabled": true,
168
+ "sourceExport": "previewModeDefaults",
169
+ "sourceModule": "@graphcommerce/graphcms-ui/plugins/hygraphPreviewModeDefaults",
170
+ "targetExport": "previewModeDefaults",
171
+ "targetModule": "@graphcommerce/ecommerce-ui",
172
+ "type": "function",
173
+ },
166
174
  {
167
175
  "enabled": true,
168
176
  "sourceExport": "plugin",
@@ -171,6 +179,14 @@ it('finds plugins', () => {
171
179
  "targetModule": "@graphcommerce/graphql",
172
180
  "type": "function",
173
181
  },
182
+ {
183
+ "enabled": true,
184
+ "sourceExport": "PreviewModeToolbar",
185
+ "sourceModule": "@graphcommerce/graphcms-ui/plugins/HygraphPreviewModeToolbar",
186
+ "targetExport": "PreviewModeToolbar",
187
+ "targetModule": "@graphcommerce/ecommerce-ui",
188
+ "type": "component",
189
+ },
174
190
  {
175
191
  "enabled": true,
176
192
  "sourceExport": "plugin",
@@ -397,6 +413,15 @@ it('finds plugins', () => {
397
413
  "targetModule": "@graphcommerce/magento-product",
398
414
  "type": "component",
399
415
  },
416
+ {
417
+ "enabled": false,
418
+ "ifConfig": "previewSecret",
419
+ "sourceExport": "FramerNextPages",
420
+ "sourceModule": "@graphcommerce/ecommerce-ui/plugins/PreviewModeFramerNextPages",
421
+ "targetExport": "FramerNextPages",
422
+ "targetModule": "@graphcommerce/framer-next-pages",
423
+ "type": "component",
424
+ },
400
425
  {
401
426
  "enabled": false,
402
427
  "ifConfig": "googleTagmanagerId",
@@ -405,21 +405,31 @@ it('adds debug logging to interceptors for components', async () => {
405
405
  expectOriginal(interceptors['packages/graphql/config']?.template).toMatchInlineSnapshot(`
406
406
  "import { ApolloLink, TypePolicies } from '@apollo/client'
407
407
  import type { GraphCommerceStorefrontConfig } from '@graphcommerce/next-config'
408
+ import type { SetRequired } from 'type-fest'
408
409
  import { MigrateCache } from './components/GraphQLProvider/migrateCache'
410
+ export interface PreviewData {}
411
+ export type PreviewConfig = {
412
+ preview?: boolean
413
+ previewData?: PreviewData & Record<string, unknown>
414
+ }
409
415
  export type ApolloClientConfigInput = {
410
416
  storefront: GraphCommerceStorefrontConfig
411
417
  links?: ApolloLink[]
412
418
  policies?: TypePolicies[]
413
419
  migrations?: MigrateCache[]
414
- }
415
- export type ApolloClientConfig = Required<ApolloClientConfigInput>
420
+ } & PreviewConfig
421
+ export type ApolloClientConfig = SetRequired<
422
+ ApolloClientConfigInput,
423
+ 'links' | 'policies' | 'migrations'
424
+ >
416
425
  export function graphqlConfigOriginal(config: ApolloClientConfigInput): ApolloClientConfig {
417
- const { storefront, links = [], policies = [], migrations = [] } = config
426
+ const { storefront, links = [], policies = [], migrations = [], ...rest } = config
418
427
  return {
419
428
  storefront,
420
429
  links,
421
430
  policies,
422
431
  migrations,
432
+ ...rest,
423
433
  }
424
434
  }"
425
435
  `)
@@ -48,4 +48,5 @@ exports.demoConfig = {
48
48
  recentlyViewedProducts: { enabled: true, maxCount: 20 },
49
49
  breadcrumbs: false,
50
50
  customerDeleteEnabled: true,
51
+ previewSecret: 'SECRET',
51
52
  };
@@ -47,7 +47,7 @@ function GraphCommerceConfigSchema() {
47
47
  previewSecret: zod_1.z.string().nullish(),
48
48
  productFiltersLayout: exports.ProductFiltersLayoutSchema.default("DEFAULT").nullish(),
49
49
  productFiltersPro: zod_1.z.boolean().nullish(),
50
- productListPaginationVariant: exports.PaginationVariantSchema.nullish(),
50
+ productListPaginationVariant: exports.PaginationVariantSchema.default("COMPACT").nullish(),
51
51
  productRoute: zod_1.z.string().nullish(),
52
52
  recentlyViewedProducts: RecentlyViewedProductsConfigSchema().nullish(),
53
53
  robotsAllow: zod_1.z.boolean().nullish(),
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/next-config",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.1.0-canary.41",
5
+ "version": "8.1.0-canary.42",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
8
8
  "types": "src/index.ts",
@@ -51,4 +51,5 @@ export const demoConfig: PartialDeep<GraphCommerceConfig, { recurseIntoArrays: t
51
51
  recentlyViewedProducts: { enabled: true, maxCount: 20 },
52
52
  breadcrumbs: false,
53
53
  customerDeleteEnabled: true,
54
+ previewSecret: 'SECRET',
54
55
  }
@@ -167,6 +167,7 @@ export type GraphCommerceConfig = {
167
167
  customerCompanyFieldsEnable?: InputMaybe<Scalars['Boolean']['input']>;
168
168
  /** Enable customer account deletion through the account section */
169
169
  customerDeleteEnabled?: InputMaybe<Scalars['Boolean']['input']>;
170
+ /** Datalayer config */
170
171
  dataLayer?: InputMaybe<DatalayerConfig>;
171
172
  /** Debug configuration for GraphCommerce */
172
173
  debug?: InputMaybe<GraphCommerceDebugConfig>;
@@ -512,7 +513,7 @@ export function GraphCommerceConfigSchema(): z.ZodObject<Properties<GraphCommerc
512
513
  previewSecret: z.string().nullish(),
513
514
  productFiltersLayout: ProductFiltersLayoutSchema.default("DEFAULT").nullish(),
514
515
  productFiltersPro: z.boolean().nullish(),
515
- productListPaginationVariant: PaginationVariantSchema.nullish(),
516
+ productListPaginationVariant: PaginationVariantSchema.default("COMPACT").nullish(),
516
517
  productRoute: z.string().nullish(),
517
518
  recentlyViewedProducts: RecentlyViewedProductsConfigSchema().nullish(),
518
519
  robotsAllow: z.boolean().nullish(),