@salesforce/pwa-kit-create-app 3.9.2 → 3.10.0-dev

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.
@@ -10,17 +10,32 @@ module.exports = {
10
10
  app: {
11
11
  // Customize how your 'site' and 'locale' are displayed in the url.
12
12
  url: {
13
+ {{#if answers.project.demo.enableDemoSettings}}
13
14
  // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
14
- // site: 'none',
15
+ site: 'path',
15
16
  // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
16
- locale: 'none'
17
+ locale: 'path',
17
18
  // This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false
18
- // showDefaults: true
19
+ showDefaults: true,
20
+ {{else}}
21
+ // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
22
+ site: 'none',
23
+ // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
24
+ locale: 'none',
25
+ // This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false
26
+ showDefaults: false,
27
+ {{/if}}
28
+ // This boolean value dictates whether the plus sign (+) is interpreted as space for query param string. Defaults to: false
29
+ interpretPlusSignAsSpace: false
19
30
  },
20
31
  login: {
21
32
  passwordless: {
22
33
  // Enables or disables passwordless login for the site. Defaults to: false
34
+ {{#if answers.project.demo.enableDemoSettings}}
35
+ enabled: true,
36
+ {{else}}
23
37
  enabled: false,
38
+ {{/if}}
24
39
  // The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer.
25
40
  // Required in 'callback' mode; if missing, passwordless login defaults to 'sms' mode, which requires Marketing Cloud configuration.
26
41
  // If the env var `PASSWORDLESS_LOGIN_CALLBACK_URI` is set, it will override the config value.
@@ -31,7 +46,11 @@ module.exports = {
31
46
  },
32
47
  social: {
33
48
  // Enables or disables social login for the site. Defaults to: false
49
+ {{#if answers.project.demo.enableDemoSettings}}
50
+ enabled: true,
51
+ {{else}}
34
52
  enabled: false,
53
+ {{/if}}
35
54
  // The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default.
36
55
  // Additional IDPs will also need to be added to the IDP_CONFIG in the SocialLogin component.
37
56
  idps: ['google', 'apple'],
@@ -51,9 +70,17 @@ module.exports = {
51
70
  // The default site for your app. This value will be used when a siteRef could not be determined from the url
52
71
  defaultSite: '{{answers.project.commerce.siteId}}',
53
72
  // Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application.
73
+ {{#if answers.project.demo.enableDemoSettings}}
74
+ siteAliases: {
75
+ RefArch: 'us',
76
+ RefArchGlobal: 'global'
77
+ },
78
+ {{else}}
54
79
  // siteAliases: {
55
- // RefArch: 'us'
80
+ // RefArch: 'us',
81
+ // RefArchGlobal: 'global'
56
82
  // },
83
+ {{/if}}
57
84
  // The sites for your app, which is imported from sites.js
58
85
  sites,
59
86
  // Commerce api config
@@ -75,6 +102,11 @@ module.exports = {
75
102
  // By setting this to true, the Einstein activities generated by the environment will appear
76
103
  // in production environment reports
77
104
  isProduction: false
105
+ },
106
+ // Datacloud api config
107
+ dataCloudAPI: {
108
+ appSourceId: '{{answers.project.dataCloud.appSourceId}}',
109
+ tenantId: '{{answers.project.dataCloud.tenantId}}'
78
110
  }
79
111
  },
80
112
  // This list contains server-side only libraries that you don't want to be compiled by webpack
@@ -10,6 +10,59 @@
10
10
  module.exports = [
11
11
  {
12
12
  id: '{{answers.project.commerce.siteId}}',
13
+ {{#if answers.project.demo.enableDemoSettings}}
14
+ l10n: {
15
+ supportedCurrencies: ['USD', 'GBP', 'EUR', 'CNY', 'JPY'],
16
+ defaultCurrency: 'USD',
17
+ defaultLocale: 'en-US',
18
+ supportedLocales: [
19
+ {
20
+ id: 'en-US',
21
+ preferredCurrency: 'USD'
22
+ },
23
+ {
24
+ id: 'en-GB',
25
+ preferredCurrency: 'GBP'
26
+ },
27
+ {
28
+ id: 'de-DE',
29
+ preferredCurrency: 'EUR'
30
+ },
31
+ {
32
+ id: 'es-MX',
33
+ preferredCurrency: 'MXN'
34
+ },
35
+ {
36
+ id: 'fr-FR',
37
+ preferredCurrency: 'EUR'
38
+ },
39
+ {
40
+ id: 'it-IT',
41
+ preferredCurrency: 'EUR'
42
+ },
43
+ {
44
+ id: 'ja-JP',
45
+ preferredCurrency: 'JPY'
46
+ },
47
+ {
48
+ id: 'ko-KR',
49
+ preferredCurrency: 'KRW'
50
+ },
51
+ {
52
+ id: 'pt-BR',
53
+ preferredCurrency: 'BRL'
54
+ },
55
+ {
56
+ id: 'zh-CN',
57
+ preferredCurrency: 'CNY'
58
+ },
59
+ {
60
+ id: 'zh-TW',
61
+ preferredCurrency: 'TWD'
62
+ }
63
+ ]
64
+ }
65
+ {{else}}
13
66
  l10n: {
14
67
  supportedCurrencies: ['USD'],
15
68
  defaultCurrency: 'USD',
@@ -22,5 +75,6 @@ module.exports = [
22
75
  }
23
76
  ]
24
77
  }
78
+ {{/if}}
25
79
  }
26
80
  ]
@@ -82,7 +82,14 @@ const Home = () => {
82
82
  />
83
83
 
84
84
  <Hero
85
+ {{#if answers.project.demo.enableDemoSettings}}
86
+ title={intl.formatMessage({
87
+ defaultMessage: 'The React PWA Starter Store for Retail',
88
+ id: 'home.title.react_starter_store'
89
+ })}
90
+ {{else}}
85
91
  title={CUSTOM_HOME_TITLE}
92
+ {{/if}}
86
93
  img=\{{
87
94
  src: getAssetUrl('static/img/hero.png'),
88
95
  alt: 'npx pwa-kit-create-app'
@@ -297,7 +297,8 @@ const {handler} = runtime.createHandler(options, (app) => {
297
297
  ],
298
298
  'connect-src': [
299
299
  // Connect to Einstein APIs
300
- 'api.cquotient.com'
300
+ 'api.cquotient.com',
301
+ '*.c360a.salesforce.com'
301
302
  ]
302
303
  }
303
304
  }
@@ -297,7 +297,8 @@ const {handler} = runtime.createHandler(options, (app) => {
297
297
  ],
298
298
  'connect-src': [
299
299
  // Connect to Einstein APIs
300
- 'api.cquotient.com'
300
+ 'api.cquotient.com',
301
+ '*.c360a.salesforce.com'
301
302
  ]
302
303
  }
303
304
  }
@@ -10,19 +10,32 @@ module.exports = {
10
10
  app: {
11
11
  // Customize settings for your url
12
12
  url: {
13
+ {{#if answers.project.demo.enableDemoSettings}}
13
14
  // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
14
- // site: 'none',
15
+ site: 'path',
15
16
  // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
16
- locale: 'none',
17
+ locale: 'path',
17
18
  // This boolean value dictates whether default site or locale values are shown in the url. Defaults to: false
18
- // showDefaults: true,
19
+ showDefaults: true,
20
+ {{else}}
21
+ // Determine where the siteRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
22
+ site: 'none',
23
+ // Determine where the localeRef is located. Valid values include 'path|query_param|none'. Defaults to: 'none'
24
+ locale: 'none',
25
+ // This boolean value dictates whether or not default site or locale values are shown in the url. Defaults to: false
26
+ showDefaults: false,
27
+ {{/if}}
19
28
  // This boolean value dictates whether the plus sign (+) is interpreted as space for query param string. Defaults to: false
20
29
  interpretPlusSignAsSpace: false
21
30
  },
22
31
  login: {
23
32
  passwordless: {
24
33
  // Enables or disables passwordless login for the site. Defaults to: false
34
+ {{#if answers.project.demo.enableDemoSettings}}
35
+ enabled: true,
36
+ {{else}}
25
37
  enabled: false,
38
+ {{/if}}
26
39
  // The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer.
27
40
  // Required in 'callback' mode; if missing, passwordless login defaults to 'sms' mode, which requires Marketing Cloud configuration.
28
41
  // If the env var `PASSWORDLESS_LOGIN_CALLBACK_URI` is set, it will override the config value.
@@ -33,7 +46,11 @@ module.exports = {
33
46
  },
34
47
  social: {
35
48
  // Enables or disables social login for the site. Defaults to: false
49
+ {{#if answers.project.demo.enableDemoSettings}}
50
+ enabled: true,
51
+ {{else}}
36
52
  enabled: false,
53
+ {{/if}}
37
54
  // The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default.
38
55
  // Additional IDPs will also need to be added to the IDP_CONFIG in the SocialLogin component.
39
56
  idps: ['google', 'apple'],
@@ -53,9 +70,17 @@ module.exports = {
53
70
  // The default site for your app. This value will be used when a siteRef could not be determined from the url
54
71
  defaultSite: '{{answers.project.commerce.siteId}}',
55
72
  // Provide aliases for your sites. These will be used in place of your site id when generating paths throughout the application.
73
+ {{#if answers.project.demo.enableDemoSettings}}
74
+ siteAliases: {
75
+ RefArch: 'us',
76
+ RefArchGlobal: 'global'
77
+ },
78
+ {{else}}
56
79
  // siteAliases: {
57
- // RefArch: 'us'
80
+ // RefArch: 'us',
81
+ // RefArchGlobal: 'global'
58
82
  // },
83
+ {{/if}}
59
84
  // The sites for your app, which is imported from sites.js
60
85
  sites,
61
86
  // Commerce api config
@@ -77,6 +102,11 @@ module.exports = {
77
102
  // By setting this to true, the Einstein activities generated by the environment will appear
78
103
  // in production environment reports
79
104
  isProduction: false
105
+ },
106
+ // Datacloud api config
107
+ dataCloudAPI: {
108
+ appSourceId: '{{answers.project.dataCloud.appSourceId}}',
109
+ tenantId: '{{answers.project.dataCloud.tenantId}}'
80
110
  }
81
111
  },
82
112
  // This list contains server-side only libraries that you don't want to be compiled by webpack
@@ -10,6 +10,59 @@
10
10
  module.exports = [
11
11
  {
12
12
  id: '{{answers.project.commerce.siteId}}',
13
+ {{#if answers.project.demo.enableDemoSettings}}
14
+ l10n: {
15
+ supportedCurrencies: ['USD', 'GBP', 'EUR', 'CNY', 'JPY'],
16
+ defaultCurrency: 'USD',
17
+ defaultLocale: 'en-US',
18
+ supportedLocales: [
19
+ {
20
+ id: 'en-US',
21
+ preferredCurrency: 'USD'
22
+ },
23
+ {
24
+ id: 'en-GB',
25
+ preferredCurrency: 'GBP'
26
+ },
27
+ {
28
+ id: 'de-DE',
29
+ preferredCurrency: 'EUR'
30
+ },
31
+ {
32
+ id: 'es-MX',
33
+ preferredCurrency: 'MXN'
34
+ },
35
+ {
36
+ id: 'fr-FR',
37
+ preferredCurrency: 'EUR'
38
+ },
39
+ {
40
+ id: 'it-IT',
41
+ preferredCurrency: 'EUR'
42
+ },
43
+ {
44
+ id: 'ja-JP',
45
+ preferredCurrency: 'JPY'
46
+ },
47
+ {
48
+ id: 'ko-KR',
49
+ preferredCurrency: 'KRW'
50
+ },
51
+ {
52
+ id: 'pt-BR',
53
+ preferredCurrency: 'BRL'
54
+ },
55
+ {
56
+ id: 'zh-CN',
57
+ preferredCurrency: 'CNY'
58
+ },
59
+ {
60
+ id: 'zh-TW',
61
+ preferredCurrency: 'TWD'
62
+ }
63
+ ]
64
+ }
65
+ {{else}}
13
66
  l10n: {
14
67
  supportedCurrencies: ['USD'],
15
68
  defaultCurrency: 'USD',
@@ -22,5 +75,6 @@ module.exports = [
22
75
  }
23
76
  ]
24
77
  }
78
+ {{/if}}
25
79
  }
26
80
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/pwa-kit-create-app",
3
- "version": "3.9.2",
3
+ "version": "3.10.0-dev",
4
4
  "description": "Salesforce's project generator tool",
5
5
  "homepage": "https://github.com/SalesforceCommerceCloud/pwa-kit/tree/develop/packages/pwa-kit-create-app#readme",
6
6
  "bugs": {
@@ -33,18 +33,18 @@
33
33
  "handlebars": "^4.7.7",
34
34
  "inquirer": "8.2.5",
35
35
  "semver": "^7.5.2",
36
- "shelljs": "^0.8.5",
36
+ "shelljs": "^0.9.2",
37
37
  "slugify": "^1.6.5",
38
38
  "tar": "^6.2.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@salesforce/pwa-kit-dev": "3.9.2",
42
- "internal-lib-build": "3.9.2",
41
+ "@salesforce/pwa-kit-dev": "3.10.0-dev",
42
+ "internal-lib-build": "3.10.0-dev",
43
43
  "verdaccio": "^5.22.1"
44
44
  },
45
45
  "engines": {
46
46
  "node": "^16.11.0 || ^18.0.0 || ^20.0.0 || ^22.0.0",
47
47
  "npm": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
48
48
  },
49
- "gitHead": "d982971e3a1cc1f65ce296e526c459b2ea5f83fe"
49
+ "gitHead": "d86dc7bea3fe03a0f475ecf1a0ab878374f07026"
50
50
  }
@@ -219,7 +219,7 @@ const RETAIL_REACT_APP_QUESTIONS = [
219
219
  }
220
220
  ]
221
221
 
222
- // Project dictionary describing details and how the gerator should ask questions etc.
222
+ // Project dictionary describing details and how the generator should ask questions etc.
223
223
  const PRESETS = [
224
224
  {
225
225
  id: 'retail-react-app',
@@ -265,11 +265,51 @@ const PRESETS = [
265
265
  ['project.commerce.shortCode']: 'kv7kzm78',
266
266
  ['project.commerce.isSlasPrivate']: false,
267
267
  ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
268
- ['project.einstein.siteId']: 'aaij-MobileFirst'
268
+ ['project.einstein.siteId']: 'aaij-MobileFirst',
269
+ ['project.dataCloud.appSourceId']: 'fb81edab-24c6-4b40-8684-b67334dfdf32',
270
+ ['project.dataCloud.tenantId']: 'mmyw8zrxhfsg09lfmzrd1zjqmg',
271
+ ['project.demo.enableDemoSettings']: false
269
272
  },
270
273
  assets: ['translations'],
271
274
  private: false
272
275
  },
276
+ {
277
+ id: 'retail-react-app-demo-site-internal',
278
+ name: 'Retail React App Demo Store',
279
+ description: `
280
+ Generates a project using the settings for a special B2C Commerce instance that is used
281
+ for demo purposes. The demo site is accessible at https://pwa-kit.mobify-storefront.com/
282
+
283
+ This environment uses a SLAS private client and has social and passwordless login enabled.
284
+ This environment is set up to use multiple locales.
285
+ Future features that are enabled for the demo environment may be added to this preset.
286
+ `,
287
+ shortDescription:
288
+ 'The Retail app with demo Commerce Cloud instance and a private SLAS client',
289
+ templateSource: {
290
+ type: TEMPLATE_SOURCE_NPM,
291
+ id: '@salesforce/retail-react-app'
292
+ },
293
+ questions: [...EXTENSIBILITY_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS],
294
+ answers: {
295
+ ['project.extend']: false, // Intentionally not an extensible project so that the correct logos appear on demo site
296
+ ['project.hybrid']: false,
297
+ ['project.name']: 'demo-storefront',
298
+ ['project.commerce.instanceUrl']: 'https://zzrf-001.dx.commercecloud.salesforce.com',
299
+ ['project.commerce.clientId']: '083859f2-5d93-4209-b999-a112266d63a0',
300
+ ['project.commerce.siteId']: 'RefArchGlobal',
301
+ ['project.commerce.organizationId']: 'f_ecom_zzrf_001',
302
+ ['project.commerce.shortCode']: 'kv7kzm78',
303
+ ['project.commerce.isSlasPrivate']: true,
304
+ ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
305
+ ['project.einstein.siteId']: 'aaij-MobileFirst',
306
+ ['project.dataCloud.appSourceId']: 'fb81edab-24c6-4b40-8684-b67334dfdf32',
307
+ ['project.dataCloud.tenantId']: 'mmyw8zrxhfsg09lfmzrd1zjqmg',
308
+ ['project.demo.enableDemoSettings']: true // True only for presets deployed to demo environments like pwa-kit.mobify-storefront.com
309
+ },
310
+ assets: ['translations'],
311
+ private: true
312
+ },
273
313
  {
274
314
  id: 'retail-react-app-test-project',
275
315
  name: 'Retail React App Test Project',
@@ -290,7 +330,10 @@ const PRESETS = [
290
330
  ['project.commerce.shortCode']: 'kv7kzm78',
291
331
  ['project.commerce.isSlasPrivate']: false,
292
332
  ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
293
- ['project.einstein.siteId']: 'aaij-MobileFirst'
333
+ ['project.einstein.siteId']: 'aaij-MobileFirst',
334
+ ['project.dataCloud.appSourceId']: 'fb81edab-24c6-4b40-8684-b67334dfdf32',
335
+ ['project.dataCloud.tenantId']: 'mmyw8zrxhfsg09lfmzrd1zjqmg',
336
+ ['project.demo.enableDemoSettings']: false
294
337
  },
295
338
  assets: ['translations'],
296
339
  private: true
@@ -315,7 +358,38 @@ const PRESETS = [
315
358
  ['project.commerce.shortCode']: 'kv7kzm78',
316
359
  ['project.commerce.isSlasPrivate']: true,
317
360
  ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
318
- ['project.einstein.siteId']: 'aaij-MobileFirst'
361
+ ['project.einstein.siteId']: 'aaij-MobileFirst',
362
+ ['project.dataCloud.appSourceId']: 'fb81edab-24c6-4b40-8684-b67334dfdf32',
363
+ ['project.dataCloud.tenantId']: 'mmyw8zrxhfsg09lfmzrd1zjqmg',
364
+ ['project.demo.enableDemoSettings']: false
365
+ },
366
+ assets: ['translations'],
367
+ private: true
368
+ },
369
+ {
370
+ id: 'retail-react-app-bug-bounty',
371
+ name: 'Retail React App Bug Bounty Project',
372
+ description: '',
373
+ templateSource: {
374
+ type: TEMPLATE_SOURCE_NPM,
375
+ id: '@salesforce/retail-react-app'
376
+ },
377
+ questions: [...EXTENSIBILITY_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS],
378
+ answers: {
379
+ ['project.extend']: true,
380
+ ['project.hybrid']: false,
381
+ ['project.name']: 'retail-react-app',
382
+ ['project.commerce.instanceUrl']: 'https://zzec-006.dx.commercecloud.salesforce.com',
383
+ ['project.commerce.clientId']: 'b56e7ad3-2237-42c9-8f55-41e63ebca420',
384
+ ['project.commerce.siteId']: 'RefArch',
385
+ ['project.commerce.organizationId']: 'f_ecom_zzec_006',
386
+ ['project.commerce.shortCode']: 'staging-001',
387
+ ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
388
+ ['project.einstein.siteId']: 'aaij-MobileFirst',
389
+ ['project.dataCloud.appSourceId']: 'fb81edab-24c6-4b40-8684-b67334dfdf32',
390
+ ['project.dataCloud.tenantId']: 'mmyw8zrxhfsg09lfmzrd1zjqmg',
391
+ ['project.commerce.isSlasPrivate']: true,
392
+ ['project.demo.enableDemoSettings']: false
319
393
  },
320
394
  assets: ['translations'],
321
395
  private: true
@@ -340,7 +414,10 @@ const PRESETS = [
340
414
  ['project.commerce.shortCode']: 'xitgmcd3',
341
415
  ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
342
416
  ['project.einstein.siteId']: 'aaij-MobileFirst',
343
- ['project.commerce.isSlasPrivate']: true
417
+ ['project.commerce.isSlasPrivate']: true,
418
+ ['project.dataCloud.appSourceId']: 'fb81edab-24c6-4b40-8684-b67334dfdf32',
419
+ ['project.dataCloud.tenantId']: 'mmyw8zrxhfsg09lfmzrd1zjqmg',
420
+ ['project.demo.enableDemoSettings']: false
344
421
  },
345
422
  assets: ['translations'],
346
423
  private: true
@@ -365,7 +442,10 @@ const PRESETS = [
365
442
  ['project.commerce.shortCode']: 'performance-001',
366
443
  ['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
367
444
  ['project.einstein.siteId']: 'aaij-MobileFirst',
368
- ['project.commerce.isSlasPrivate']: false
445
+ ['project.commerce.isSlasPrivate']: false,
446
+ ['project.dataCloud.appSourceId']: 'fb81edab-24c6-4b40-8684-b67334dfdf32',
447
+ ['project.dataCloud.tenantId']: 'mmyw8zrxhfsg09lfmzrd1zjqmg',
448
+ ['project.demo.enableDemoSettings']: false
369
449
  },
370
450
  assets: ['translations'],
371
451
  private: true
@@ -784,6 +864,11 @@ const main = async (opts) => {
784
864
  // Add the preset to the context.
785
865
  context.preset = selectedPreset
786
866
 
867
+ // If using the preset, output the preset name
868
+ if (presetId) {
869
+ console.log(`Using preset "${selectedPreset.name}"`)
870
+ }
871
+
787
872
  if (!OUTPUT_DIR_FLAG_ACTIVE) {
788
873
  outputDir = p.join(process.cwd(), selectedPreset.id)
789
874
  }
Binary file
Binary file
Binary file
Binary file