create-sitecore-jss 22.6.0-canary.33 → 22.6.0-canary.34
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.
|
@@ -41,6 +41,7 @@ const inquirer_1 = __importDefault(require("inquirer"));
|
|
|
41
41
|
const prompts_1 = require("./prompts");
|
|
42
42
|
const common_1 = require("../../common");
|
|
43
43
|
const remove_dev_dependencies_1 = require("./remove-dev-dependencies");
|
|
44
|
+
const prompts_2 = require("./prompts");
|
|
44
45
|
inquirer_1.default.registerPrompt('nextjs-checkbox', prompts_1.NextjsCheckbox);
|
|
45
46
|
var PlatformCompatibility;
|
|
46
47
|
(function (PlatformCompatibility) {
|
|
@@ -77,6 +78,7 @@ class NextjsInitializer {
|
|
|
77
78
|
init(args) {
|
|
78
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
80
|
const answers = yield inquirer_1.default.prompt(prompts_1.prompts, args);
|
|
81
|
+
prompts_2.sharedPrerender.prerender = answers.prerender;
|
|
80
82
|
const pkgPath = path_1.default.resolve(`${answers.destination}${path_1.sep}package.json`);
|
|
81
83
|
const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs');
|
|
82
84
|
yield (0, common_1.transform)(templatePath, Object.assign(Object.assign({}, args), answers));
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NextjsCheckbox = exports.prompts = exports.Prerender = void 0;
|
|
6
|
+
exports.NextjsCheckbox = exports.prompts = exports.sharedPrerender = exports.Prerender = void 0;
|
|
7
7
|
const checkbox_1 = __importDefault(require("inquirer/lib/prompts/checkbox"));
|
|
8
8
|
const common_1 = require("../../common");
|
|
9
9
|
var Prerender;
|
|
@@ -12,6 +12,16 @@ var Prerender;
|
|
|
12
12
|
Prerender["SSR"] = "SSR";
|
|
13
13
|
})(Prerender || (exports.Prerender = Prerender = {}));
|
|
14
14
|
const DEFAULT_PRERENDER = Prerender.SSG;
|
|
15
|
+
/*
|
|
16
|
+
* Shared prerender configuration for the selected prerendering strategy (SSG or SSR).
|
|
17
|
+
*
|
|
18
|
+
* This object is initialized with a default prerender value (`SSG`) and is updated
|
|
19
|
+
* dynamically after the primary Next.js initializer's initialization process based on
|
|
20
|
+
* user input collected via prompts without having to re-prompt or duplicate logic.
|
|
21
|
+
*/
|
|
22
|
+
exports.sharedPrerender = {
|
|
23
|
+
prerender: DEFAULT_PRERENDER,
|
|
24
|
+
};
|
|
15
25
|
// still need sxp prompts here until sitecore/config is no longer added to xmc app
|
|
16
26
|
exports.prompts = [
|
|
17
27
|
...common_1.clientAppPrompts,
|
|
@@ -35,6 +35,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
35
35
|
const path_1 = __importStar(require("path"));
|
|
36
36
|
const common_1 = require("../../common");
|
|
37
37
|
const remove_dev_dependencies_1 = require("./remove-dev-dependencies");
|
|
38
|
+
const prompts_1 = require("../nextjs/prompts");
|
|
38
39
|
class NextjsXMCloudInitializer {
|
|
39
40
|
get isBase() {
|
|
40
41
|
return false;
|
|
@@ -43,7 +44,7 @@ class NextjsXMCloudInitializer {
|
|
|
43
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
45
|
var _a, _b, _c, _d;
|
|
45
46
|
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
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
|
+
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, prerender: prompts_1.sharedPrerender.prerender });
|
|
47
48
|
const templatePath = path_1.default.resolve(__dirname, '../../templates/nextjs-xmcloud');
|
|
48
49
|
yield (0, common_1.transform)(templatePath, mergedArgs);
|
|
49
50
|
if (!(0, common_1.isDevEnvironment)(args.destination)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-sitecore-jss",
|
|
3
|
-
"version": "22.6.0-canary.
|
|
3
|
+
"version": "22.6.0-canary.34",
|
|
4
4
|
"description": "Sitecore JSS initializer",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"ts-node": "^10.9.1",
|
|
66
66
|
"typescript": "~5.6.3"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "f26c4f13f6a0c47874e1d1e7ce0926a456788e61"
|
|
69
69
|
}
|