@graphcommerce/next-config 9.0.0-canary.106 → 9.0.0-canary.107

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.
@@ -5,6 +5,7 @@ import { get, set } from 'lodash'
5
5
  import snakeCase from 'lodash/snakeCase'
6
6
  import type { ZodAny, ZodRawShape, ZodTypeAny } from 'zod'
7
7
  import {
8
+ z,
8
9
  ZodArray,
9
10
  ZodBoolean,
10
11
  ZodDefault,
@@ -15,7 +16,6 @@ import {
15
16
  ZodObject,
16
17
  ZodOptional,
17
18
  ZodString,
18
- z,
19
19
  } from 'zod'
20
20
  import diff from './diff'
21
21
 
@@ -207,7 +207,7 @@ export function formatAppliedEnv(applyResult: ApplyResult) {
207
207
  const lines = applyResult.map(({ from, to, envValue, envVar, dotVar, error, warning }) => {
208
208
  const fromFmt = chalk.red(JSON.stringify(from))
209
209
  const toFmt = chalk.green(JSON.stringify(to))
210
- const envVariableFmt = `${envVar}='${envValue}'`
210
+ const envVariableFmt = `${envVar}`
211
211
  const dotVariableFmt = chalk.bold.underline(`${dotVar}`)
212
212
 
213
213
  const baseLog = `${envVariableFmt} => ${dotVariableFmt}`
@@ -223,11 +223,10 @@ export function formatAppliedEnv(applyResult: ApplyResult) {
223
223
 
224
224
  if (!dotVar) return chalk.red(`${envVariableFmt} => ignored (no matching config)`)
225
225
 
226
- if (from === undefined && to === undefined)
227
- return ` = ${baseLog}: (ignored, no change/wrong format)`
228
- if (from === undefined && to !== undefined) return ` ${chalk.green('+')} ${baseLog}: ${toFmt}`
229
- if (from !== undefined && to === undefined) return ` ${chalk.red('-')} ${baseLog}: ${fromFmt}`
230
- return ` ${chalk.yellowBright('~')} ${baseLog}: ${fromFmt} => ${toFmt}`
226
+ if (from === undefined && to === undefined) return ` = ${baseLog}: (ignored)`
227
+ if (from === undefined && to !== undefined) return ` ${chalk.green('+')} ${baseLog}`
228
+ if (from !== undefined && to === undefined) return ` ${chalk.red('-')} ${baseLog}`
229
+ return ` ${chalk.yellowBright('~')} ${baseLog}`
231
230
  })
232
231
 
233
232
  let header = chalk.blueBright('info')
@@ -215,6 +215,8 @@ export type GraphCommerceConfig = {
215
215
  * To override the value for a specific locale, configure in i18n config.
216
216
  */
217
217
  googleAnalyticsId?: InputMaybe<Scalars['String']['input']>;
218
+ /** To create an assetlinks.json file for the Android app. */
219
+ googlePlaystore?: InputMaybe<GraphCommerceGooglePlaystoreConfig>;
218
220
  /**
219
221
  * Google reCAPTCHA site key.
220
222
  * When using reCAPTCHA, this value is required, even if you are configuring different values for each locale.
@@ -369,6 +371,14 @@ export type GraphCommerceDebugConfig = {
369
371
  webpackDuplicatesPlugin?: InputMaybe<Scalars['Boolean']['input']>;
370
372
  };
371
373
 
374
+ /** See https://developer.android.com/training/app-links/verify-android-applinks#web-assoc */
375
+ export type GraphCommerceGooglePlaystoreConfig = {
376
+ /** The package name of the Android app. */
377
+ packageName: Scalars['String']['input'];
378
+ /** The sha256 certificate fingerprint of the Android app. */
379
+ sha256CertificateFingerprint: Scalars['String']['input'];
380
+ };
381
+
372
382
  /** Permissions input */
373
383
  export type GraphCommercePermissions = {
374
384
  /** Changes the availability of the add to cart buttons and the cart page to either customer only or completely disables it. */
@@ -546,6 +556,7 @@ export function GraphCommerceConfigSchema(): z.ZodObject<Properties<GraphCommerc
546
556
  demoMode: z.boolean().default(true).nullish(),
547
557
  enableGuestCheckoutLogin: z.boolean().nullish(),
548
558
  googleAnalyticsId: z.string().nullish(),
559
+ googlePlaystore: GraphCommerceGooglePlaystoreConfigSchema().nullish(),
549
560
  googleRecaptchaKey: z.string().nullish(),
550
561
  googleTagmanagerId: z.string().nullish(),
551
562
  hygraphEndpoint: z.string().min(1),
@@ -579,6 +590,13 @@ export function GraphCommerceDebugConfigSchema(): z.ZodObject<Properties<GraphCo
579
590
  })
580
591
  }
581
592
 
593
+ export function GraphCommerceGooglePlaystoreConfigSchema(): z.ZodObject<Properties<GraphCommerceGooglePlaystoreConfig>> {
594
+ return z.object({
595
+ packageName: z.string().min(1),
596
+ sha256CertificateFingerprint: z.string().min(1)
597
+ })
598
+ }
599
+
582
600
  export function GraphCommercePermissionsSchema(): z.ZodObject<Properties<GraphCommercePermissions>> {
583
601
  return z.object({
584
602
  cart: CartPermissionsSchema.nullish(),
@@ -67,8 +67,8 @@ export type Interceptor = ResolveDependencyReturn & {
67
67
 
68
68
  export type MaterializedPlugin = Interceptor & { template: string }
69
69
 
70
- export const SOURCE_START = '/** Original source starts here (do not modify!): **/'
71
- export const SOURCE_END = '/** Original source ends here (do not modify!) **/'
70
+ export const SOURCE_START = '/** SOURCE_START */'
71
+ export const SOURCE_END = '/** SOURCE_END */'
72
72
 
73
73
  const originalSuffix = 'Original'
74
74
  const interceptorSuffix = 'Interceptor'
@@ -103,9 +103,7 @@ const generateIdentifyer = (s: string) =>
103
103
  }, 0),
104
104
  ).toString()
105
105
 
106
- /**
107
- * The is on the first line, with the format: \/* hash:${identifer} *\/
108
- */
106
+ /** The is on the first line, with the format: /* hash:${identifer} */
109
107
  function extractIdentifier(source: string | undefined) {
110
108
  if (!source) return null
111
109
  const match = source.match(/\/\* hash:(\d+) \*\//)
@@ -54,10 +54,10 @@ export function withGraphCommerce(nextConfig: NextConfig, cwd: string): NextConf
54
54
 
55
55
  return {
56
56
  ...nextConfig,
57
+ bundlePagesRouterDependencies: true,
57
58
  experimental: {
58
59
  ...nextConfig.experimental,
59
60
  scrollRestoration: true,
60
- bundlePagesExternals: true,
61
61
  swcPlugins: [...(nextConfig.experimental?.swcPlugins ?? []), ['@lingui/swc-plugin', {}]],
62
62
  },
63
63
  i18n: {