create-sitecore-jss 22.2.0-canary.14 → 22.2.0-canary.16
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/dist/bin.js +17 -43
- package/dist/common/processes/next.js +1 -1
- package/dist/common/processes/transform.js +2 -12
- package/dist/common/prompts/base.js +0 -13
- package/dist/common/prompts/proxy.js +35 -0
- package/dist/common/prompts/sxp.js +16 -2
- package/dist/common/utils/helpers.js +27 -2
- package/dist/init-runner.js +4 -2
- package/dist/initializers/angular/prompts.js +4 -4
- package/dist/initializers/angular-xmcloud/index.js +20 -7
- package/dist/initializers/node-xmcloud-proxy/index.js +2 -1
- package/dist/templates/angular-xmcloud/.env +1 -1
- package/package.json +2 -2
package/dist/bin.js
CHANGED
|
@@ -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.main = exports.promptDestination = exports.
|
|
38
|
+
exports.main = exports.promptDestination = exports.getDestination = exports.parseArgs = void 0;
|
|
39
39
|
const fs_1 = __importDefault(require("fs"));
|
|
40
40
|
const path_1 = __importStar(require("path"));
|
|
41
41
|
const chalk_1 = __importDefault(require("chalk"));
|
|
@@ -43,7 +43,6 @@ 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 helpers_1 = require("./common/utils/helpers");
|
|
47
46
|
const parseArgs = () => {
|
|
48
47
|
// parse any command line arguments passed into `init sitecore-jss`
|
|
49
48
|
// to pass to the generator prompts and skip them.
|
|
@@ -71,7 +70,7 @@ const parseArgs = () => {
|
|
|
71
70
|
return args;
|
|
72
71
|
};
|
|
73
72
|
exports.parseArgs = parseArgs;
|
|
74
|
-
const
|
|
73
|
+
const getDestination = (args, templates) => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
74
|
if (templates.length === 0) {
|
|
76
75
|
throw new Error('Unable to get destinations, provided templates are empty');
|
|
77
76
|
}
|
|
@@ -83,30 +82,9 @@ const getDestinations = (args, templates) => __awaiter(void 0, void 0, void 0, f
|
|
|
83
82
|
? defaultBaseDestination
|
|
84
83
|
: yield (0, exports.promptDestination)('Where would you like your new app created?', defaultBaseDestination);
|
|
85
84
|
}
|
|
86
|
-
|
|
87
|
-
const proxyApp = templates.find((template) => template.match(helpers_1.proxyAppMatcher));
|
|
88
|
-
if (proxyApp) {
|
|
89
|
-
// put the proxy alongside main app by default
|
|
90
|
-
const defaultProxyDestination = (0, helpers_1.getDefaultProxyDestination)(destination, proxyApp);
|
|
91
|
-
let proxyAppDestination = args.proxyAppDestination;
|
|
92
|
-
if (!proxyAppDestination) {
|
|
93
|
-
proxyAppDestination = args.yes
|
|
94
|
-
? defaultProxyDestination
|
|
95
|
-
: yield (0, exports.promptDestination)('Where would you like your proxy app created?', defaultProxyDestination);
|
|
96
|
-
}
|
|
97
|
-
while (path_1.default.resolve(proxyAppDestination) === path_1.default.resolve(destination)) {
|
|
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);
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
destination,
|
|
102
|
-
proxyAppDestination,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
destination,
|
|
107
|
-
};
|
|
85
|
+
return destination;
|
|
108
86
|
});
|
|
109
|
-
exports.
|
|
87
|
+
exports.getDestination = getDestination;
|
|
110
88
|
const promptDestination = (prompt, defaultDestination) => __awaiter(void 0, void 0, void 0, function* () {
|
|
111
89
|
return (yield inquirer_1.default.prompt({
|
|
112
90
|
type: 'input',
|
|
@@ -153,24 +131,20 @@ const main = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
153
131
|
});
|
|
154
132
|
templates.push(answer.template);
|
|
155
133
|
}
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
});
|
|
166
|
-
if (!answer.continue) {
|
|
167
|
-
process.exit();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
args.force = true;
|
|
134
|
+
const destination = yield (0, exports.getDestination)(args, templates);
|
|
135
|
+
if (!args.force && fs_1.default.existsSync(destination) && fs_1.default.readdirSync(destination).length > 0) {
|
|
136
|
+
const answer = yield inquirer_1.default.prompt({
|
|
137
|
+
type: 'confirm',
|
|
138
|
+
name: 'continue',
|
|
139
|
+
message: `Directory '${destination}' not empty. Are you sure you want to continue?`,
|
|
140
|
+
});
|
|
141
|
+
if (!answer.continue) {
|
|
142
|
+
process.exit();
|
|
172
143
|
}
|
|
173
144
|
}
|
|
145
|
+
else {
|
|
146
|
+
args.force = true;
|
|
147
|
+
}
|
|
174
148
|
if (!args.yes) {
|
|
175
149
|
if (args.prePushHook === null) {
|
|
176
150
|
const answer = yield inquirer_1.default.prompt({
|
|
@@ -188,7 +162,7 @@ const main = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
188
162
|
}
|
|
189
163
|
}
|
|
190
164
|
try {
|
|
191
|
-
yield (0, init_runner_1.initRunner)(templates.slice(), Object.assign(Object.assign(
|
|
165
|
+
yield (0, init_runner_1.initRunner)(templates.slice(), Object.assign(Object.assign({}, args), { destination, templates }));
|
|
192
166
|
}
|
|
193
167
|
catch (error) {
|
|
194
168
|
console.log(chalk_1.default.red('An error occurred: ', error));
|
|
@@ -51,7 +51,7 @@ const nextSteps = (appNames, nextStepsArr) => __awaiter(void 0, void 0, void 0,
|
|
|
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(s) ${chalk_1.default.green(appNames.join(', '))} is ready!`);
|
|
54
|
+
console.log(`JSS application(s) ${chalk_1.default.green(appNames.join(', '))} ${appNames.length > 1 ? 'are' : 'is'} ready!`);
|
|
55
55
|
console.log();
|
|
56
56
|
console.log(chalk_1.default.yellow('Next steps:'));
|
|
57
57
|
nextStepsArr.forEach((step) => {
|
|
@@ -187,11 +187,6 @@ const populateEjsData = (answers, destination) => {
|
|
|
187
187
|
getPascalCaseName: helpers_1.getPascalCaseName,
|
|
188
188
|
getAppPrefix: helpers_1.getAppPrefix,
|
|
189
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
190
|
return ejsData;
|
|
196
191
|
};
|
|
197
192
|
exports.populateEjsData = populateEjsData;
|
|
@@ -209,16 +204,11 @@ exports.populateEjsData = populateEjsData;
|
|
|
209
204
|
*/
|
|
210
205
|
const transform = (templatePath, answers, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
211
206
|
const { isFileForCopy, isFileForSkip, fileForCopyRegExp = FILE_FOR_COPY_REGEXP } = options;
|
|
212
|
-
|
|
213
|
-
// allow proxy app to be installed separately alongside base app
|
|
214
|
-
if (templatePath.match(/.*node-.+-proxy$/g) && answers.proxyAppDestination) {
|
|
215
|
-
destination = answers.proxyAppDestination;
|
|
216
|
-
}
|
|
217
|
-
const destinationPath = path_1.default.resolve(destination || answers.destination);
|
|
207
|
+
const destinationPath = path_1.default.resolve(answers.destination);
|
|
218
208
|
if (!answers.appPrefix) {
|
|
219
209
|
answers.appPrefix = false;
|
|
220
210
|
}
|
|
221
|
-
const ejsData = (0, exports.populateEjsData)(answers
|
|
211
|
+
const ejsData = (0, exports.populateEjsData)(answers);
|
|
222
212
|
// the templates to be run through ejs render or copied directly
|
|
223
213
|
const files = glob_1.default.sync('**/*', { cwd: templatePath, dot: true, nodir: true });
|
|
224
214
|
for (const file of files) {
|
|
@@ -38,19 +38,6 @@ exports.clientAppPrompts = [
|
|
|
38
38
|
return !answers.appName;
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
|
-
{
|
|
42
|
-
type: 'list',
|
|
43
|
-
name: 'fetchWith',
|
|
44
|
-
message: 'How would you like to fetch Layout and Dictionary data?',
|
|
45
|
-
choices: Object.values(FetchWith),
|
|
46
|
-
default: exports.DEFAULT_FETCHWITH,
|
|
47
|
-
when: (answers) => {
|
|
48
|
-
if (answers.yes && !answers.fetchWith) {
|
|
49
|
-
answers.fetchWith = exports.DEFAULT_FETCHWITH;
|
|
50
|
-
}
|
|
51
|
-
return !answers.fetchWith;
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
41
|
];
|
|
55
42
|
const missingAddonMsg = (source, missingAddon) => chalk_1.default.yellow(`Warning: ${source} add-on cannot be used without the ${missingAddon} add-on. This may cause unexpected results.`);
|
|
56
43
|
exports.missingAddonMsg = missingAddonMsg;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.proxyPrompts = exports.FALLBACK_PROXYNAME = void 0;
|
|
7
|
+
const helpers_1 = require("../utils/helpers");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
exports.FALLBACK_PROXYNAME = 'sitecore-jss-proxy-app';
|
|
10
|
+
/**
|
|
11
|
+
* Set of CLI prompts for an SXP app
|
|
12
|
+
*/
|
|
13
|
+
exports.proxyPrompts = [
|
|
14
|
+
{
|
|
15
|
+
type: 'input',
|
|
16
|
+
name: 'proxyAppDestination',
|
|
17
|
+
message: 'Where would you like your proxy app created?',
|
|
18
|
+
default: (answers) => {
|
|
19
|
+
// default proxy destination should be under same root as main app
|
|
20
|
+
return (0, helpers_1.getDefaultProxyDestination)(answers.destination, answers.proxyName || exports.FALLBACK_PROXYNAME);
|
|
21
|
+
},
|
|
22
|
+
when: (answers) => {
|
|
23
|
+
if (answers.yes && !answers.proxyAppDestination) {
|
|
24
|
+
answers.proxyAppDestination = (0, helpers_1.getDefaultProxyDestination)(answers.destination, answers.proxyName || exports.FALLBACK_PROXYNAME);
|
|
25
|
+
}
|
|
26
|
+
return !answers.proxyAppDestination;
|
|
27
|
+
},
|
|
28
|
+
validate: (input, answers) => {
|
|
29
|
+
if (path_1.default.resolve(input) === path_1.default.resolve(answers.destination)) {
|
|
30
|
+
return 'Paths for main app and proxy cannot match. Please choose another destination';
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sxpPrompts = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
4
5
|
/**
|
|
5
6
|
* Set of CLI prompts for an SXP app
|
|
6
7
|
*/
|
|
@@ -9,12 +10,25 @@ exports.sxpPrompts = [
|
|
|
9
10
|
type: 'input',
|
|
10
11
|
name: 'hostName',
|
|
11
12
|
message: 'What is your Sitecore hostname (used if deployed to Sitecore)?',
|
|
12
|
-
default: (answers) => `${answers.appName}.dev.local`,
|
|
13
|
+
default: (answers) => `${answers.appName || base_1.DEFAULT_APPNAME}.dev.local`,
|
|
13
14
|
when: (answers) => {
|
|
14
15
|
if (answers.yes && !answers.hostName) {
|
|
15
|
-
answers.hostName = `${answers.appName}.dev.local`;
|
|
16
|
+
answers.hostName = `${answers.appName || base_1.DEFAULT_APPNAME}.dev.local`;
|
|
16
17
|
}
|
|
17
18
|
return !answers.hostName;
|
|
18
19
|
},
|
|
19
20
|
},
|
|
21
|
+
{
|
|
22
|
+
type: 'list',
|
|
23
|
+
name: 'fetchWith',
|
|
24
|
+
message: 'How would you like to fetch Layout and Dictionary data?',
|
|
25
|
+
choices: Object.values(base_1.FetchWith),
|
|
26
|
+
default: base_1.DEFAULT_FETCHWITH,
|
|
27
|
+
when: (answers) => {
|
|
28
|
+
if (answers.yes && !answers.fetchWith) {
|
|
29
|
+
answers.fetchWith = base_1.DEFAULT_FETCHWITH;
|
|
30
|
+
}
|
|
31
|
+
return !answers.fetchWith;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
20
34
|
];
|
|
@@ -1,4 +1,27 @@
|
|
|
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
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -12,10 +35,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
36
|
};
|
|
14
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
38
|
+
exports.removeFile = exports.writeFileToPath = exports.getAppPrefix = exports.getBaseTemplates = exports.getAllTemplates = exports.sortKeys = exports.saveConfiguration = exports.writeJsonFile = exports.openJsonFile = exports.getPascalCaseName = exports.isDevEnvironment = exports.getRelativeProxyDestination = exports.getDefaultProxyDestination = exports.proxyAppMatcher = void 0;
|
|
16
39
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
40
|
const fs_1 = __importDefault(require("fs"));
|
|
18
|
-
const path_1 =
|
|
41
|
+
const path_1 = __importStar(require("path"));
|
|
19
42
|
const InitializerFactory_1 = require("../../InitializerFactory");
|
|
20
43
|
// matched for proxy templates
|
|
21
44
|
exports.proxyAppMatcher = /node-headless.+|node-xmcloud.+/g;
|
|
@@ -27,6 +50,8 @@ exports.proxyAppMatcher = /node-headless.+|node-xmcloud.+/g;
|
|
|
27
50
|
*/
|
|
28
51
|
const getDefaultProxyDestination = (mainAppDestination, proxyName) => path_1.default.join(mainAppDestination, '..', proxyName);
|
|
29
52
|
exports.getDefaultProxyDestination = getDefaultProxyDestination;
|
|
53
|
+
const getRelativeProxyDestination = (mainDestination, proxyDestination) => `${path_1.default.relative(path_1.default.resolve(mainDestination), path_1.default.resolve(proxyDestination))}${path_1.sep}`;
|
|
54
|
+
exports.getRelativeProxyDestination = getRelativeProxyDestination;
|
|
30
55
|
/**
|
|
31
56
|
* Determines whether you are in a dev environment.
|
|
32
57
|
* It's `true` if you are inside the monorepo
|
package/dist/init-runner.js
CHANGED
|
@@ -53,8 +53,10 @@ 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
|
-
//
|
|
57
|
-
|
|
56
|
+
// We can have multiple appNames if base template requires to setup an additional standalone app (e.g. XM Cloud proxy)
|
|
57
|
+
if (initializer.isBase) {
|
|
58
|
+
appNames.add(response.appName);
|
|
59
|
+
}
|
|
58
60
|
nextStepsArr = [...nextStepsArr, ...((_a = response.nextSteps) !== null && _a !== void 0 ? _a : [])];
|
|
59
61
|
// process any returned initializers
|
|
60
62
|
if (response.initializers && response.initializers.length > 0) {
|
|
@@ -11,14 +11,14 @@ exports.prompts = [
|
|
|
11
11
|
default: false,
|
|
12
12
|
when: (answers) => {
|
|
13
13
|
// don't prompt if --yes or angular-xmcloud template was specified
|
|
14
|
-
if (answers.
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
else if (answers.templates.includes('angular-xmcloud') &&
|
|
14
|
+
if (answers.templates.includes('angular-xmcloud') &&
|
|
18
15
|
!answers.templates.includes('angular-sxp')) {
|
|
19
16
|
answers.xmcloud = true;
|
|
20
17
|
return false;
|
|
21
18
|
}
|
|
19
|
+
if (answers.yes) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
22
|
return true;
|
|
23
23
|
},
|
|
24
24
|
},
|
|
@@ -31,29 +31,42 @@ 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 proxy_1 = require("../../common/prompts/proxy");
|
|
41
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
37
42
|
const helpers_1 = require("../../common/utils/helpers");
|
|
38
43
|
class AngularXmCloudInitializer {
|
|
39
44
|
get isBase() {
|
|
40
45
|
return false;
|
|
41
46
|
}
|
|
42
47
|
init(args) {
|
|
43
|
-
var _a, _b;
|
|
48
|
+
var _a, _b, _c, _d;
|
|
44
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
50
|
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
46
51
|
const addInitializers = [];
|
|
47
|
-
//
|
|
48
|
-
if (!args.proxyAppDestination) {
|
|
49
|
-
args.proxyAppDestination = (0, helpers_1.getDefaultProxyDestination)(args.destination, 'node-xmcloud-proxy');
|
|
50
|
-
}
|
|
52
|
+
// angular-xmcloud requires node-xmcloud-proxy
|
|
51
53
|
if (!args.templates.includes('node-xmcloud-proxy')) {
|
|
52
54
|
addInitializers.push('node-xmcloud-proxy');
|
|
53
55
|
}
|
|
54
|
-
|
|
56
|
+
// ensure args.proxyAppDestination is populated
|
|
57
|
+
const promptArgs = {
|
|
58
|
+
yes: args.yes,
|
|
59
|
+
destination: args.destination,
|
|
60
|
+
proxyName: 'node-xmcloud-proxy',
|
|
61
|
+
};
|
|
62
|
+
const proxyDetails = yield inquirer_1.default.prompt(proxy_1.proxyPrompts, promptArgs);
|
|
63
|
+
args.proxyAppDestination = proxyDetails.proxyAppDestination;
|
|
64
|
+
const finalArgs = 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 }), proxyDetails), { relativeProxyAppDestination: (0, helpers_1.getRelativeProxyDestination)(args.destination, args.proxyAppDestination) });
|
|
55
65
|
const templatePath = path_1.default.resolve(__dirname, '../../templates/angular-xmcloud');
|
|
56
|
-
yield (0, common_1.transform)(templatePath,
|
|
66
|
+
yield (0, common_1.transform)(templatePath, finalArgs);
|
|
67
|
+
if (args.templates.includes('angular-sxp') || ((_d = (_c = pkg.config) === null || _c === void 0 ? void 0 : _c.templates) === null || _d === void 0 ? void 0 : _d.includes('angular-sxp'))) {
|
|
68
|
+
console.log((0, common_1.incompatibleAddonsMsg)('angular-xmcloud', 'angular-sxp'));
|
|
69
|
+
}
|
|
57
70
|
const response = {
|
|
58
71
|
nextSteps: [],
|
|
59
72
|
appName: args.appName || common_1.DEFAULT_APPNAME,
|
|
@@ -21,7 +21,8 @@ class AngularXmCloudInitializer {
|
|
|
21
21
|
init(args) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
const templatePath = path_1.default.resolve(__dirname, '../../templates/node-xmcloud-proxy');
|
|
24
|
-
|
|
24
|
+
const modifiedArgs = Object.assign(Object.assign({}, args), { destination: args.proxyAppDestination || args.destination });
|
|
25
|
+
yield (0, common_1.transform)(templatePath, modifiedArgs);
|
|
25
26
|
const response = {
|
|
26
27
|
appName: 'node-xmcloud-proxy',
|
|
27
28
|
};
|
|
@@ -11,4 +11,4 @@ SITECORE_EDGE_CONTEXT_ID=
|
|
|
11
11
|
PROXY_HOST=http://localhost:3001
|
|
12
12
|
|
|
13
13
|
# Your XM Cloud Proxy server path is needed to build the app. The build output will be copied to the proxy server path.
|
|
14
|
-
PROXY_BUILD_PATH=<%-
|
|
14
|
+
PROXY_BUILD_PATH=<%- locals.relativeProxyAppDestination.replace(/\\/g, '\\\\') %>dist
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-sitecore-jss",
|
|
3
|
-
"version": "22.2.0-canary.
|
|
3
|
+
"version": "22.2.0-canary.16",
|
|
4
4
|
"description": "Sitecore JSS initializer",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"ts-node": "^10.9.1",
|
|
64
64
|
"typescript": "~4.9.5"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "40fde917c5ffee0244d997612cc638496fd26f10"
|
|
67
67
|
}
|