create-sitecore-jss 22.2.0-canary.5 → 22.2.0-canary.7

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.
Files changed (112) hide show
  1. package/dist/bin.js +5 -4
  2. package/dist/common/index.js +5 -3
  3. package/dist/common/processes/install.js +1 -1
  4. package/dist/common/processes/next.js +3 -3
  5. package/dist/common/processes/transform.js +24 -14
  6. package/dist/common/prompts/base.js +0 -12
  7. package/dist/common/prompts/sxp.js +20 -0
  8. package/dist/common/utils/helpers.js +28 -43
  9. package/dist/init-runner.js +4 -3
  10. package/dist/initializers/angular/index.js +0 -3
  11. package/dist/initializers/angular/prompts.js +2 -2
  12. package/dist/initializers/angular-sxp/index.js +8 -2
  13. package/dist/initializers/angular-xmcloud/index.js +11 -1
  14. package/dist/initializers/nextjs/index.js +2 -2
  15. package/dist/initializers/nextjs/prompts.js +2 -0
  16. package/dist/initializers/nextjs/remove-dev-dependencies.js +2 -2
  17. package/dist/initializers/nextjs-multisite/index.js +1 -1
  18. package/dist/initializers/nextjs-styleguide/index.js +1 -1
  19. package/dist/initializers/nextjs-styleguide-tracking/index.js +1 -1
  20. package/dist/initializers/nextjs-sxa/index.js +1 -1
  21. package/dist/initializers/nextjs-xmcloud/index.js +1 -1
  22. package/dist/initializers/react/index.js +3 -3
  23. package/dist/initializers/react/prompts.js +1 -1
  24. package/dist/initializers/react-native/prompts.js +1 -0
  25. package/dist/initializers/vue/prompts.js +1 -1
  26. package/dist/templates/angular-xmcloud/.env +1 -1
  27. package/dist/templates/angular-xmcloud/angular.json +34 -0
  28. package/dist/templates/angular-xmcloud/package.json +15 -10
  29. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_component.scss +48 -0
  30. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_container.scss +64 -0
  31. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_fonts.scss +3 -0
  32. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_footer.scss +31 -0
  33. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_header.scss +49 -0
  34. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_navigation.scss +150 -0
  35. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_promo.scss +58 -0
  36. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_rich-text.scss +11 -0
  37. package/dist/templates/angular-xmcloud/src/assets/styles/basic/_variables.scss +10 -0
  38. package/dist/templates/angular-xmcloud/src/assets/styles/basic/main.scss +8 -0
  39. package/dist/templates/angular-xmcloud/src/assets/styles/main.scss +4 -0
  40. package/dist/templates/angular-xmcloud/src/assets/styles/sass/_app.scss +103 -0
  41. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_functions.scss +8 -0
  42. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_mixins.scss +121 -0
  43. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/_vars.scss +3 -0
  44. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_colors.scss +283 -0
  45. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_fontSizes.scss +16 -0
  46. package/dist/templates/angular-xmcloud/src/assets/styles/sass/abstracts/vars/_margins.scss +11 -0
  47. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/_fonts.scss +1 -0
  48. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/fonts/index.scss +1 -0
  49. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/index.scss +3 -0
  50. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/_link-button.scss +26 -0
  51. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/links/index.scss +1 -0
  52. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_inputs.scss +58 -0
  53. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_links.scss +14 -0
  54. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/reset/_ui-datepicker.scss +7 -0
  55. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext-files-icons.scss +86 -0
  56. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/_richtext.scss +101 -0
  57. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/richtext/index.scss +2 -0
  58. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/_typehead.scss +95 -0
  59. package/dist/templates/angular-xmcloud/src/assets/styles/sass/base/typehead/index.scss +1 -0
  60. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-column-splitter.scss +14 -0
  61. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-container.scss +27 -0
  62. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-image.scss +18 -0
  63. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-navigation.scss +51 -0
  64. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-promo.scss +42 -0
  65. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/_component-richtext-content.scss +19 -0
  66. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_alignment.scss +26 -0
  67. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_boxed.scss +16 -0
  68. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_clearfix.scss +11 -0
  69. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_highlighted.scss +63 -0
  70. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_link-button.scss +16 -0
  71. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/_promoted-box.scss +3 -0
  72. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/common/index.scss +6 -0
  73. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_bordered.scss +24 -0
  74. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/_title-row-box.scss +66 -0
  75. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/container/index.scss +1 -0
  76. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/_image-default-size.scss +6 -0
  77. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image/index.scss +1 -0
  78. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-left.scss +3 -0
  79. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/image-alignment/_image-right.scss +3 -0
  80. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/index.scss +17 -0
  81. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_acaindent.scss +5 -0
  82. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/_background.scss +27 -0
  83. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/layout/index.scss +1 -0
  84. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_component-link-list.scss +45 -0
  85. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/_list-vertical.scss +20 -0
  86. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/link-list/index.scss +2 -0
  87. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-fat.scss +58 -0
  88. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-main-horizontal-vertical.scss +176 -0
  89. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-mobile.scss +85 -0
  90. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_navigation-sidebar.scss +29 -0
  91. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/_sitemap-navigation.scss +20 -0
  92. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/navigation/index.scss +5 -0
  93. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_absolute-bottom-link.scss +8 -0
  94. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-hero.scss +40 -0
  95. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/_promo-shadow.scss +42 -0
  96. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/promo/index.scss +3 -0
  97. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/_rich-text-lists.scss +63 -0
  98. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/rich-text/index.scss +1 -0
  99. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_background-colors.scss +14 -0
  100. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/_indent.scss +13 -0
  101. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/spacing/index.scss +2 -0
  102. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/_component-title.scss +30 -0
  103. package/dist/templates/angular-xmcloud/src/assets/styles/sass/components/title/index.scss +1 -0
  104. package/dist/templates/angular-xmcloud/src/assets/styles/sass/main.scss +4 -0
  105. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/index.scss +6 -0
  106. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/link-list/index.scss +0 -0
  107. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/navigation/index.scss +0 -0
  108. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/page-content/index.scss +0 -0
  109. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/promo/index.scss +0 -0
  110. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/rich-text/index.scss +0 -0
  111. package/dist/templates/angular-xmcloud/src/assets/styles/sass/variants/title/index.scss +0 -0
  112. package/package.json +2 -2
package/dist/bin.js CHANGED
@@ -43,7 +43,7 @@ const inquirer_1 = __importDefault(require("inquirer"));
43
43
  const init_runner_1 = require("./init-runner");
44
44
  const minimist_1 = __importDefault(require("minimist"));
45
45
  const common_1 = require("./common");
46
- const proxyAppMatcher = /node-.+-proxy/g;
46
+ const helpers_1 = require("./common/utils/helpers");
47
47
  const parseArgs = () => {
48
48
  // parse any command line arguments passed into `init sitecore-jss`
49
49
  // to pass to the generator prompts and skip them.
@@ -84,16 +84,17 @@ const getDestinations = (args, templates) => __awaiter(void 0, void 0, void 0, f
84
84
  : yield (0, exports.promptDestination)('Where would you like your new app created?', defaultBaseDestination);
85
85
  }
86
86
  // work with node-proxy destination if needed
87
- const proxyApp = templates.find((template) => template.match(proxyAppMatcher));
87
+ const proxyApp = templates.find((template) => template.match(helpers_1.proxyAppMatcher));
88
88
  if (proxyApp) {
89
- const defaultProxyDestination = proxyApp && `${process.cwd()}${path_1.sep}${proxyApp}`;
89
+ // put the proxy alongside main app by default
90
+ const defaultProxyDestination = (0, helpers_1.getDefaultProxyDestination)(destination, proxyApp);
90
91
  let proxyAppDestination = args.proxyAppDestination;
91
92
  if (!proxyAppDestination) {
92
93
  proxyAppDestination = args.yes
93
94
  ? defaultProxyDestination
94
95
  : yield (0, exports.promptDestination)('Where would you like your proxy app created?', defaultProxyDestination);
95
96
  }
96
- while (proxyAppDestination === destination) {
97
+ while (path_1.default.resolve(proxyAppDestination) === path_1.default.resolve(destination)) {
97
98
  proxyAppDestination = yield (0, exports.promptDestination)('Proxy app and base app cannot be located in the same folder. Please input another path for proxy', defaultProxyDestination);
98
99
  }
99
100
  return {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installPrePushHook = exports.lintFix = exports.installPackages = exports.nextSteps = exports.transform = exports.removeFile = exports.saveConfiguration = exports.getBaseTemplates = exports.getAllTemplates = exports.writePackageJson = exports.openPackageJson = exports.isDevEnvironment = exports.styleguidePrompts = exports.missingAddonMsg = exports.incompatibleAddonsMsg = exports.DEFAULT_APPNAME = exports.clientAppPrompts = void 0;
3
+ exports.installPrePushHook = exports.lintFix = exports.installPackages = exports.nextSteps = exports.transform = exports.removeFile = exports.saveConfiguration = exports.getBaseTemplates = exports.getAllTemplates = exports.writeJsonFile = exports.openJsonFile = exports.isDevEnvironment = exports.sxpPrompts = exports.styleguidePrompts = exports.missingAddonMsg = exports.incompatibleAddonsMsg = exports.DEFAULT_APPNAME = exports.clientAppPrompts = void 0;
4
4
  var base_1 = require("./prompts/base");
5
5
  Object.defineProperty(exports, "clientAppPrompts", { enumerable: true, get: function () { return base_1.clientAppPrompts; } });
6
6
  Object.defineProperty(exports, "DEFAULT_APPNAME", { enumerable: true, get: function () { return base_1.DEFAULT_APPNAME; } });
@@ -8,10 +8,12 @@ Object.defineProperty(exports, "incompatibleAddonsMsg", { enumerable: true, get:
8
8
  Object.defineProperty(exports, "missingAddonMsg", { enumerable: true, get: function () { return base_1.missingAddonMsg; } });
9
9
  var styleguide_1 = require("./prompts/styleguide");
10
10
  Object.defineProperty(exports, "styleguidePrompts", { enumerable: true, get: function () { return styleguide_1.styleguidePrompts; } });
11
+ var sxp_1 = require("./prompts/sxp");
12
+ Object.defineProperty(exports, "sxpPrompts", { enumerable: true, get: function () { return sxp_1.sxpPrompts; } });
11
13
  var helpers_1 = require("./utils/helpers");
12
14
  Object.defineProperty(exports, "isDevEnvironment", { enumerable: true, get: function () { return helpers_1.isDevEnvironment; } });
13
- Object.defineProperty(exports, "openPackageJson", { enumerable: true, get: function () { return helpers_1.openPackageJson; } });
14
- Object.defineProperty(exports, "writePackageJson", { enumerable: true, get: function () { return helpers_1.writePackageJson; } });
15
+ Object.defineProperty(exports, "openJsonFile", { enumerable: true, get: function () { return helpers_1.openJsonFile; } });
16
+ Object.defineProperty(exports, "writeJsonFile", { enumerable: true, get: function () { return helpers_1.writeJsonFile; } });
15
17
  Object.defineProperty(exports, "getAllTemplates", { enumerable: true, get: function () { return helpers_1.getAllTemplates; } });
16
18
  Object.defineProperty(exports, "getBaseTemplates", { enumerable: true, get: function () { return helpers_1.getBaseTemplates; } });
17
19
  Object.defineProperty(exports, "saveConfiguration", { enumerable: true, get: function () { return helpers_1.saveConfiguration; } });
@@ -85,5 +85,5 @@ const installPrePushHook = (destination, silent) => __awaiter(void 0, void 0, vo
85
85
  exports.installPrePushHook = installPrePushHook;
86
86
  const getPackageJson = (projectFolder) => {
87
87
  const packagePath = path_1.default.join(projectFolder, 'package.json');
88
- return (0, helpers_1.openPackageJson)(packagePath);
88
+ return (0, helpers_1.openJsonFile)(packagePath);
89
89
  };
@@ -16,10 +16,10 @@ exports.nextSteps = void 0;
16
16
  const chalk_1 = __importDefault(require("chalk"));
17
17
  /**
18
18
  * Logs app creation completion message and next steps
19
- * @param {string} appName application name for the new app
19
+ * @param {string[]} appNames application name(s) for the new app
20
20
  * @param {string[]} nextStepsArr next steps to be performed after app is created
21
21
  */
22
- const nextSteps = (appName, nextStepsArr) => __awaiter(void 0, void 0, void 0, function* () {
22
+ const nextSteps = (appNames, nextStepsArr) => __awaiter(void 0, void 0, void 0, function* () {
23
23
  console.log(chalk_1.default.red(' -/oyhdmNNNNmdhyo/- '));
24
24
  console.log(chalk_1.default.red(' :sdMMMMMMMMMMMMMMMMMMMMds: '));
25
25
  console.log(chalk_1.default.red(' :yNMMMMMMMMMMMMMMMMMMMMMMMMMMNy: '));
@@ -51,7 +51,7 @@ const nextSteps = (appName, nextStepsArr) => __awaiter(void 0, void 0, void 0, f
51
51
  console.log(chalk_1.default.white(' / // /\\ \\_\\ \\ '));
52
52
  console.log(chalk_1.default.white(' \\___/___/___/'));
53
53
  console.log();
54
- console.log(`JSS application ${chalk_1.default.green(appName)} is ready!`);
54
+ console.log(`JSS application(s) ${chalk_1.default.green(appNames.join(', '))} is ready!`);
55
55
  console.log();
56
56
  console.log(chalk_1.default.yellow('Next steps:'));
57
57
  nextStepsArr.forEach((step) => {
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
36
  };
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.transform = exports.diffAndWriteFiles = exports.diffFiles = exports.mergeEnv = exports.merge = exports.transformFilename = void 0;
38
+ exports.transform = exports.populateEjsData = exports.diffAndWriteFiles = exports.diffFiles = exports.mergeEnv = exports.merge = exports.transformFilename = void 0;
39
39
  const chalk_1 = __importDefault(require("chalk"));
40
40
  const fs_extra_1 = __importDefault(require("fs-extra"));
41
41
  const glob_1 = __importDefault(require("glob"));
@@ -180,6 +180,21 @@ const diffAndWriteFiles = ({ rendered, pathToNewFile, answers, }) => __awaiter(v
180
180
  }
181
181
  });
182
182
  exports.diffAndWriteFiles = diffAndWriteFiles;
183
+ const populateEjsData = (answers, destination) => {
184
+ // pass in helper to answers object
185
+ const ejsData = Object.assign(Object.assign({}, answers), { helper: {
186
+ isDev: (0, helpers_1.isDevEnvironment)(destination || answers.destination),
187
+ getPascalCaseName: helpers_1.getPascalCaseName,
188
+ getAppPrefix: helpers_1.getAppPrefix,
189
+ } });
190
+ // When SPA application and XM Cloud proxy is used we need to calculate relative path between SPA app and proxy to apply that in EJS template
191
+ // Absolute path can't be used across all the machines
192
+ if (answers.proxyAppDestination) {
193
+ ejsData.helper.relativeProxyAppDestination = `${path_1.default.relative(path_1.default.resolve(answers.destination), path_1.default.resolve(answers.proxyAppDestination))}${path_1.sep}`;
194
+ }
195
+ return ejsData;
196
+ };
197
+ exports.populateEjsData = populateEjsData;
183
198
  /**
184
199
  * Handles each template file and applies ejs renderer, also:
185
200
  * * determines files for copy
@@ -196,19 +211,14 @@ const transform = (templatePath, answers, options = {}) => __awaiter(void 0, voi
196
211
  const { isFileForCopy, isFileForSkip, fileForCopyRegExp = FILE_FOR_COPY_REGEXP } = options;
197
212
  let destination = undefined;
198
213
  // allow proxy app to be installed separately alongside base app
199
- if (templatePath.match(/.*node-.+-proxy$/g)) {
214
+ if (templatePath.match(/.*node-.+-proxy$/g) && answers.proxyAppDestination) {
200
215
  destination = answers.proxyAppDestination;
201
216
  }
202
217
  const destinationPath = path_1.default.resolve(destination || answers.destination);
203
218
  if (!answers.appPrefix) {
204
219
  answers.appPrefix = false;
205
220
  }
206
- // pass in helper to answers object
207
- const ejsData = Object.assign(Object.assign({}, answers), { helper: {
208
- isDev: (0, helpers_1.isDevEnvironment)(destination || answers.destination),
209
- getPascalCaseName: helpers_1.getPascalCaseName,
210
- getAppPrefix: helpers_1.getAppPrefix,
211
- } });
221
+ const ejsData = (0, exports.populateEjsData)(answers, destination);
212
222
  // the templates to be run through ejs render or copied directly
213
223
  const files = glob_1.default.sync('**/*', { cwd: templatePath, dot: true, nodir: true });
214
224
  for (const file of files) {
@@ -233,13 +243,13 @@ const transform = (templatePath, answers, options = {}) => __awaiter(void 0, voi
233
243
  fs_extra_1.default.copySync(pathToTemplate, pathToNewFile);
234
244
  continue;
235
245
  }
236
- if (file.endsWith('package.json') && fs_extra_1.default.existsSync(pathToNewFile)) {
237
- // we treat package.json a bit differently
238
- // read the current package.json and the template package.json (rendered with ejs)
239
- const currentPkg = (0, helpers_1.openPackageJson)(pathToNewFile);
240
- const templatePkg = JSON.parse(yield (0, ejs_1.renderFile)(path_1.default.resolve(pathToTemplate), ejsData));
246
+ if (file.endsWith('.json') && fs_extra_1.default.existsSync(pathToNewFile)) {
247
+ // we treat a .json a bit differently
248
+ // read the current .json and the template .json (rendered with ejs)
249
+ const currentJson = (0, helpers_1.openJsonFile)(pathToNewFile);
250
+ const templateJson = JSON.parse(yield (0, ejs_1.renderFile)(path_1.default.resolve(pathToTemplate), ejsData));
241
251
  // merge them and set the result to str which will then go through diff
242
- const merged = (0, exports.merge)(currentPkg, templatePkg);
252
+ const merged = (0, exports.merge)(currentJson, templateJson);
243
253
  str = JSON.stringify(merged, null, 2);
244
254
  }
245
255
  if (file.endsWith('.env') && fs_extra_1.default.existsSync(pathToNewFile)) {
@@ -38,18 +38,6 @@ exports.clientAppPrompts = [
38
38
  return !answers.appName;
39
39
  },
40
40
  },
41
- {
42
- type: 'input',
43
- name: 'hostName',
44
- message: 'What is your Sitecore hostname (used if deployed to Sitecore)?',
45
- default: (answers) => `${answers.appName}.dev.local`,
46
- when: (answers) => {
47
- if (answers.yes && !answers.hostName) {
48
- answers.hostName = `${answers.appName}.dev.local`;
49
- }
50
- return !answers.hostName;
51
- },
52
- },
53
41
  {
54
42
  type: 'list',
55
43
  name: 'fetchWith',
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sxpPrompts = void 0;
4
+ /**
5
+ * Set of CLI prompts for an SXP app
6
+ */
7
+ exports.sxpPrompts = [
8
+ {
9
+ type: 'input',
10
+ name: 'hostName',
11
+ message: 'What is your Sitecore hostname (used if deployed to Sitecore)?',
12
+ default: (answers) => `${answers.appName}.dev.local`,
13
+ when: (answers) => {
14
+ if (answers.yes && !answers.hostName) {
15
+ answers.hostName = `${answers.appName}.dev.local`;
16
+ }
17
+ return !answers.hostName;
18
+ },
19
+ },
20
+ ];
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,11 +12,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
13
  };
37
14
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.removeFile = exports.writeFileToPath = exports.getAppPrefix = exports.getBaseTemplates = exports.getAllTemplates = exports.sortKeys = exports.saveConfiguration = exports.writePackageJson = exports.openPackageJson = exports.getPascalCaseName = exports.isDevEnvironment = void 0;
15
+ exports.removeFile = exports.writeFileToPath = exports.getAppPrefix = exports.getBaseTemplates = exports.getAllTemplates = exports.sortKeys = exports.saveConfiguration = exports.writeJsonFile = exports.openJsonFile = exports.getPascalCaseName = exports.isDevEnvironment = exports.getDefaultProxyDestination = exports.proxyAppMatcher = void 0;
39
16
  const chalk_1 = __importDefault(require("chalk"));
40
17
  const fs_1 = __importDefault(require("fs"));
41
- const path_1 = __importStar(require("path"));
18
+ const path_1 = __importDefault(require("path"));
42
19
  const InitializerFactory_1 = require("../../InitializerFactory");
20
+ // matched for proxy templates
21
+ exports.proxyAppMatcher = /node-headless.+|node-xmcloud.+/g;
22
+ /**
23
+ * Returns the default path for proxy app initialized alongside main JSS tempalates.
24
+ * @param {string} mainAppDestination target destination for main app
25
+ * @param {string} proxyName name of for the proxy app folder
26
+ * @returns {string} target path for proxy app
27
+ */
28
+ const getDefaultProxyDestination = (mainAppDestination, proxyName) => path_1.default.join(mainAppDestination, '..', proxyName);
29
+ exports.getDefaultProxyDestination = getDefaultProxyDestination;
43
30
  /**
44
31
  * Determines whether you are in a dev environment.
45
32
  * It's `true` if you are inside the monorepo
@@ -61,46 +48,44 @@ const getPascalCaseName = (name) => {
61
48
  };
62
49
  exports.getPascalCaseName = getPascalCaseName;
63
50
  /**
64
- * Provides `package.json` data
65
- * @param {string} [pkgPath] path to `package.json`. Default is './package.json'.
66
- * @returns `package.json` data
51
+ * Provides json data from a file
52
+ * @param {string} jsonFilePath path to the .json file.
53
+ * @returns json data
67
54
  */
68
- const openPackageJson = (pkgPath) => {
69
- const filePath = path_1.default.resolve(pkgPath !== null && pkgPath !== void 0 ? pkgPath : `.${path_1.sep}package.json`);
55
+ const openJsonFile = (jsonFilePath) => {
70
56
  try {
71
- const data = fs_1.default.readFileSync(filePath, 'utf8');
57
+ const data = fs_1.default.readFileSync(jsonFilePath, 'utf8');
72
58
  return data ? JSON.parse(data) : undefined;
73
59
  }
74
60
  catch (error) {
75
- console.log(chalk_1.default.red(`The following error occurred while trying to read ${filePath}:`));
61
+ console.log(chalk_1.default.red(`The following error occurred while trying to read ${jsonFilePath}:`));
76
62
  console.log(chalk_1.default.red(error));
77
63
  }
78
64
  };
79
- exports.openPackageJson = openPackageJson;
65
+ exports.openJsonFile = openJsonFile;
80
66
  /**
81
- * Creates `package.json` file and inserts provided data
82
- * @param {Object} data data to be written into package.json
83
- * @param {string} [pkgPath] a path to a file. Default is './package.json'.
67
+ * Creates a .json file and inserts provided data
68
+ * @param {Object} data data to be written into the .json file
69
+ * @param {string} jsonFilePath a path to a file.
84
70
  */
85
- const writePackageJson = (data, pkgPath) => {
86
- const filePath = path_1.default.resolve(pkgPath !== null && pkgPath !== void 0 ? pkgPath : `.${path_1.sep}package.json`);
71
+ const writeJsonFile = (data, jsonFilePath) => {
87
72
  try {
88
- fs_1.default.writeFileSync(filePath, JSON.stringify(data, null, 2), { encoding: 'utf8' });
73
+ fs_1.default.writeFileSync(jsonFilePath, JSON.stringify(data, null, 2), { encoding: 'utf8' });
89
74
  }
90
75
  catch (error) {
91
- console.log(chalk_1.default.red(`The following error occurred while trying to write ${filePath}:`));
76
+ console.log(chalk_1.default.red(`The following error occurred while trying to write ${jsonFilePath}:`));
92
77
  console.log(chalk_1.default.red(error));
93
78
  }
94
79
  };
95
- exports.writePackageJson = writePackageJson;
80
+ exports.writeJsonFile = writeJsonFile;
96
81
  /**
97
82
  * Save configuration params to the package.json
98
83
  * @param {string[]} templates templates applied to the sample
99
84
  * @param {string} [pkgPath] path to the package.json
100
85
  */
101
86
  const saveConfiguration = (templates, pkgPath) => {
102
- const pkg = (0, exports.openPackageJson)(pkgPath);
103
- (0, exports.writePackageJson)(Object.assign(Object.assign({}, pkg), { config: Object.assign(Object.assign({}, pkg.config), { templates }) }), pkgPath);
87
+ const pkg = (0, exports.openJsonFile)(pkgPath);
88
+ (0, exports.writeJsonFile)(Object.assign(Object.assign({}, pkg), { config: Object.assign(Object.assign({}, pkg.config), { templates }) }), pkgPath);
104
89
  };
105
90
  exports.saveConfiguration = saveConfiguration;
106
91
  const sortKeys = (obj) => {
@@ -42,7 +42,7 @@ const common_1 = require("./common");
42
42
  const InitializerFactory_1 = require("./InitializerFactory");
43
43
  const initRunner = (initializers, args) => __awaiter(void 0, void 0, void 0, function* () {
44
44
  let nextStepsArr = [];
45
- let appName;
45
+ const appNames = new Set([]);
46
46
  const initFactory = new InitializerFactory_1.InitializerFactory();
47
47
  const runner = (inits) => __awaiter(void 0, void 0, void 0, function* () {
48
48
  var _a;
@@ -53,7 +53,8 @@ const initRunner = (initializers, args) => __awaiter(void 0, void 0, void 0, fun
53
53
  }
54
54
  args.silent || console.log(chalk_1.default.cyan(`Initializing '${init}'...`));
55
55
  const response = yield initializer.init(args);
56
- appName = response.appName;
56
+ // App names can be multiple if the base template requires to setup additional standalone app (e.g. XM Cloud proxy)
57
+ appNames.add(response.appName);
57
58
  nextStepsArr = [...nextStepsArr, ...((_a = response.nextSteps) !== null && _a !== void 0 ? _a : [])];
58
59
  // process any returned initializers
59
60
  if (response.initializers && response.initializers.length > 0) {
@@ -81,7 +82,7 @@ const initRunner = (initializers, args) => __awaiter(void 0, void 0, void 0, fun
81
82
  }
82
83
  }
83
84
  if (!args.silent) {
84
- (0, common_1.nextSteps)(appName || '', nextStepsArr);
85
+ (0, common_1.nextSteps)([...appNames], nextStepsArr);
85
86
  }
86
87
  });
87
88
  exports.initRunner = initRunner;
@@ -32,9 +32,6 @@ class AngularInitializer {
32
32
  if (!args.templates.includes('angular-xmcloud')) {
33
33
  addInitializers.push('angular-xmcloud');
34
34
  }
35
- if (!args.templates.includes('node-xmcloud-proxy')) {
36
- addInitializers.push('node-xmcloud-proxy');
37
- }
38
35
  }
39
36
  else {
40
37
  // invoke default non-XMC init
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prompts = void 0;
4
4
  const common_1 = require("../../common");
5
5
  exports.prompts = [
6
- ...common_1.clientAppPrompts,
6
+ // XMCloud answer defines init behavior. Prompt must go first
7
7
  {
8
8
  type: 'confirm',
9
9
  name: 'xmcloud',
@@ -22,5 +22,5 @@ exports.prompts = [
22
22
  return true;
23
23
  },
24
24
  },
25
- ...common_1.styleguidePrompts,
25
+ ...common_1.clientAppPrompts,
26
26
  ];
@@ -31,9 +31,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
32
32
  });
33
33
  };
34
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
34
37
  Object.defineProperty(exports, "__esModule", { value: true });
35
38
  const path_1 = __importStar(require("path"));
36
39
  const common_1 = require("../../common");
40
+ const inquirer_1 = __importDefault(require("inquirer"));
37
41
  class AngularSxpInitializer {
38
42
  get isBase() {
39
43
  return false;
@@ -41,8 +45,10 @@ class AngularSxpInitializer {
41
45
  init(args) {
42
46
  var _a, _b;
43
47
  return __awaiter(this, void 0, void 0, function* () {
44
- const pkg = (0, common_1.openPackageJson)(`${args.destination}${path_1.sep}package.json`);
45
- const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
48
+ const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
49
+ const answers = yield inquirer_1.default.prompt(common_1.sxpPrompts, args);
50
+ const styleguideAnswers = yield inquirer_1.default.prompt(common_1.styleguidePrompts, args);
51
+ const mergedArgs = Object.assign(Object.assign(Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false }), answers), styleguideAnswers);
46
52
  const templatePath = path_1.default.resolve(__dirname, '../../templates/angular-sxp');
47
53
  yield (0, common_1.transform)(templatePath, mergedArgs);
48
54
  const response = {
@@ -34,6 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  const path_1 = __importStar(require("path"));
36
36
  const common_1 = require("../../common");
37
+ const helpers_1 = require("../../common/utils/helpers");
37
38
  class AngularXmCloudInitializer {
38
39
  get isBase() {
39
40
  return false;
@@ -41,13 +42,22 @@ class AngularXmCloudInitializer {
41
42
  init(args) {
42
43
  var _a, _b;
43
44
  return __awaiter(this, void 0, void 0, function* () {
44
- const pkg = (0, common_1.openPackageJson)(`${args.destination}${path_1.sep}package.json`);
45
+ const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
46
+ const addInitializers = [];
47
+ // when installing proxy alongside main app, have a separate path ready
48
+ if (!args.proxyAppDestination) {
49
+ args.proxyAppDestination = (0, helpers_1.getDefaultProxyDestination)(args.destination, 'node-xmcloud-proxy');
50
+ }
51
+ if (!args.templates.includes('node-xmcloud-proxy')) {
52
+ addInitializers.push('node-xmcloud-proxy');
53
+ }
45
54
  const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
46
55
  const templatePath = path_1.default.resolve(__dirname, '../../templates/angular-xmcloud');
47
56
  yield (0, common_1.transform)(templatePath, mergedArgs);
48
57
  const response = {
49
58
  nextSteps: [],
50
59
  appName: args.appName || common_1.DEFAULT_APPNAME,
60
+ initializers: addInitializers,
51
61
  };
52
62
  return response;
53
63
  });
@@ -105,9 +105,9 @@ class NextjsInitializer {
105
105
  }
106
106
  if (!addInitializers.includes('nextjs-styleguide') &&
107
107
  !args.templates.includes('nextjs-styleguide')) {
108
- const pkg = (0, common_1.openPackageJson)(pkgPath);
108
+ const pkg = (0, common_1.openJsonFile)(pkgPath);
109
109
  pkg.scripts.bootstrap = pkg.scripts.bootstrap.replace(' && graphql-let', '');
110
- (0, common_1.writePackageJson)(pkg, pkgPath);
110
+ (0, common_1.writeJsonFile)(pkg, pkgPath);
111
111
  }
112
112
  const response = {
113
113
  nextSteps: [`* Connect to Sitecore with ${chalk_1.default.green('jss setup')} (optional)`],
@@ -12,8 +12,10 @@ var Prerender;
12
12
  Prerender["SSR"] = "SSR";
13
13
  })(Prerender = exports.Prerender || (exports.Prerender = {}));
14
14
  const DEFAULT_PRERENDER = Prerender.SSG;
15
+ // still need sxp prompts here until sitecore/config is no longer added to xmc app
15
16
  exports.prompts = [
16
17
  ...common_1.clientAppPrompts,
18
+ ...common_1.sxpPrompts,
17
19
  {
18
20
  type: 'list',
19
21
  name: 'prerender',
@@ -10,10 +10,10 @@ const common_1 = require("../../common");
10
10
  const removeDevDependencies = (projectPath) => {
11
11
  // remove `next-transpile-modules` dependency
12
12
  const packagePath = path_1.default.join(projectPath, 'package.json');
13
- const pkg = (0, common_1.openPackageJson)(packagePath);
13
+ const pkg = (0, common_1.openJsonFile)(packagePath);
14
14
  if (pkg === null || pkg === void 0 ? void 0 : pkg.devDependencies['next-transpile-modules']) {
15
15
  delete pkg.devDependencies['next-transpile-modules'];
16
- (0, common_1.writePackageJson)(pkg, packagePath);
16
+ (0, common_1.writeJsonFile)(pkg, packagePath);
17
17
  }
18
18
  // remove monorepo next.config.js plugin
19
19
  const monorepoPlugin = path_1.default.join(projectPath, 'src/lib/next-config/plugins/monorepo.js');
@@ -41,7 +41,7 @@ class NextjsMultisiteInitializer {
41
41
  init(args) {
42
42
  var _a, _b;
43
43
  return __awaiter(this, void 0, void 0, function* () {
44
- const pkg = (0, common_1.openPackageJson)(`${args.destination}${path_1.sep}package.json`);
44
+ const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
45
45
  const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
46
46
  const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs-multisite');
47
47
  yield (0, common_1.transform)(templatePath, mergedArgs);
@@ -46,7 +46,7 @@ class NextjsStyleguideInitializer {
46
46
  init(args) {
47
47
  var _a, _b;
48
48
  return __awaiter(this, void 0, void 0, function* () {
49
- const pkg = (0, common_1.openPackageJson)(`${args.destination}${path_1.sep}package.json`);
49
+ const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
50
50
  const answers = yield inquirer_1.default.prompt(common_1.styleguidePrompts, args);
51
51
  const mergedArgs = Object.assign(Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false }), answers);
52
52
  const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs-styleguide');
@@ -41,7 +41,7 @@ class NextjsStyleguideInitializer {
41
41
  init(args) {
42
42
  var _a, _b, _c, _d, _e, _f;
43
43
  return __awaiter(this, void 0, void 0, function* () {
44
- const pkg = (0, common_1.openPackageJson)(`${args.destination}${path_1.sep}package.json`);
44
+ const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
45
45
  const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
46
46
  const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs-styleguide-tracking');
47
47
  yield (0, common_1.transform)(templatePath, mergedArgs);
@@ -41,7 +41,7 @@ class NextjsSxaInitializer {
41
41
  init(args) {
42
42
  var _a, _b, _c, _d;
43
43
  return __awaiter(this, void 0, void 0, function* () {
44
- const pkg = (0, common_1.openPackageJson)(`${args.destination}${path_1.sep}package.json`);
44
+ const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
45
45
  // TODO: prompts for SXA
46
46
  // const answers = await prompt<StyleguideAnswer>(styleguidePrompts, args);
47
47
  const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
@@ -42,7 +42,7 @@ class NextjsXMCloudInitializer {
42
42
  init(args) {
43
43
  var _a, _b, _c, _d;
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
- const pkg = (0, common_1.openPackageJson)(`${args.destination}${path_1.sep}package.json`);
45
+ const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
46
46
  const mergedArgs = Object.assign(Object.assign({}, args), { appName: args.appName || ((_a = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _a === void 0 ? void 0 : _a.appName) || common_1.DEFAULT_APPNAME, appPrefix: args.appPrefix || ((_b = pkg === null || pkg === void 0 ? void 0 : pkg.config) === null || _b === void 0 ? void 0 : _b.prefix) || false });
47
47
  const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs-xmcloud');
48
48
  yield (0, common_1.transform)(templatePath, mergedArgs);
@@ -52,7 +52,7 @@ class ReactInitializer {
52
52
  yield (0, common_1.transform)(templatePath, mergedArgs);
53
53
  const isDev = (0, common_1.isDevEnvironment)(args.destination);
54
54
  const pkgPath = path_1.default.resolve(`${args.destination}${path_1.sep}package.json`);
55
- const pkg = (0, common_1.openPackageJson)(pkgPath);
55
+ const pkg = (0, common_1.openJsonFile)(pkgPath);
56
56
  if (isDev) {
57
57
  Object.entries(pkg.scripts).forEach(([key, value]) => {
58
58
  // Can't rewire `eject` script
@@ -61,14 +61,14 @@ class ReactInitializer {
61
61
  // It's required to start each command using `react-app-rewired`, to solve duplicate `react` issue
62
62
  pkg.scripts[key] = value.replace('react-scripts', 'react-app-rewired');
63
63
  });
64
- (0, common_1.writePackageJson)(pkg, pkgPath);
64
+ (0, common_1.writeJsonFile)(pkg, pkgPath);
65
65
  }
66
66
  else {
67
67
  // Don't need to rewire anything if we are not in the dev env
68
68
  delete pkg.devDependencies['react-app-rewired'];
69
69
  // Remove webpack overrides
70
70
  (0, common_1.removeFile)(path_1.default.resolve(`${args.destination}${path_1.sep}config-overrides.js`));
71
- (0, common_1.writePackageJson)(pkg, pkgPath);
71
+ (0, common_1.writeJsonFile)(pkg, pkgPath);
72
72
  }
73
73
  const response = {
74
74
  nextSteps: [`* Connect to Sitecore with ${chalk_1.default.green('jss setup')} (optional)`],
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prompts = void 0;
4
4
  const common_1 = require("../../common");
5
- exports.prompts = [...common_1.clientAppPrompts, ...common_1.styleguidePrompts];
5
+ exports.prompts = [...common_1.clientAppPrompts, ...common_1.sxpPrompts, ...common_1.styleguidePrompts];
@@ -4,5 +4,6 @@ exports.prompts = void 0;
4
4
  const common_1 = require("../../common");
5
5
  exports.prompts = [
6
6
  ...common_1.clientAppPrompts.filter((p) => p.name !== 'fetchWith'),
7
+ ...common_1.sxpPrompts,
7
8
  ...common_1.styleguidePrompts,
8
9
  ];
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prompts = void 0;
4
4
  const common_1 = require("../../common");
5
- exports.prompts = [...common_1.clientAppPrompts, ...common_1.styleguidePrompts];
5
+ exports.prompts = [...common_1.clientAppPrompts, ...common_1.sxpPrompts, ...common_1.styleguidePrompts];
@@ -5,4 +5,4 @@
5
5
  PROXY_HOST=http://localhost:3001
6
6
 
7
7
  # Your XM Cloud Proxy server path is needed to build the app. The build output will be copied to the proxy server path.
8
- PROXY_BUILD_PATH=<%- proxyAppDestination %>/dist
8
+ PROXY_BUILD_PATH=<%- helper.relativeProxyAppDestination %>dist
@@ -0,0 +1,34 @@
1
+ {
2
+ "projects": {
3
+ "<%- appName %>": {
4
+ "architect": {
5
+ "build": {
6
+ "options": {
7
+ "styles": [
8
+ "node_modules/bootstrap/dist/css/bootstrap.min.css",
9
+ "src/styles.css",
10
+ "src/assets/styles/main.scss"
11
+ ],
12
+ "stylePreprocessorOptions": {
13
+ "includePaths": ["src/assets/styles", "node_modules"]
14
+ }
15
+ }
16
+ },
17
+ "test": {
18
+ "options": {
19
+ "styles": ["src/styles.css", "src/assets/styles/main.scss"],
20
+ "stylePreprocessorOptions": {
21
+ "includePaths": ["src/assets/styles", "node_modules"]
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
27
+ },
28
+ "schematics": {
29
+ "@schematics/angular:component": {
30
+ "prefix": "app",
31
+ "style": "scss"
32
+ }
33
+ }
34
+ }