create-sitecore-jss 22.3.0-canary.12 → 22.3.0-canary.13
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/InitializerFactory.js +2 -2
- package/dist/common/processes/transform.js +8 -8
- package/dist/common/prompts/base.js +1 -1
- package/dist/common/utils/helpers.js +1 -1
- package/dist/initializers/angular-sxp/index.js +1 -1
- package/dist/initializers/angular-xmcloud/index.js +1 -1
- package/dist/initializers/nextjs/prompts.js +1 -1
- package/dist/initializers/nextjs-multisite/index.js +1 -1
- package/dist/initializers/nextjs-styleguide/index.js +1 -1
- package/dist/initializers/nextjs-styleguide-tracking/index.js +1 -1
- package/dist/initializers/nextjs-sxa/index.js +1 -1
- package/dist/initializers/nextjs-xmcloud/index.js +1 -1
- package/dist/templates/angular/package.json +4 -4
- package/dist/templates/angular/src/tsconfig.app.json +1 -2
- package/dist/templates/angular/src/tsconfig.server.json +1 -2
- package/dist/templates/angular/tsconfig.json +1 -0
- package/dist/templates/nextjs/.eslintrc +6 -1
- package/dist/templates/nextjs/package.json +6 -6
- package/dist/templates/nextjs/scripts/config/index.ts +1 -1
- package/dist/templates/nextjs/scripts/config/plugins/scjssconfig.ts +1 -0
- package/dist/templates/nextjs/scripts/generate-component-builder/index.ts +1 -1
- package/dist/templates/nextjs/scripts/scaffold-component/index.ts +1 -1
- package/dist/templates/nextjs/scripts/utils.ts +1 -1
- package/dist/templates/nextjs/tsconfig.json +1 -0
- package/dist/templates/nextjs-styleguide/src/lib/sitemap-fetcher/plugins/disconnected-sitemap-service.ts +1 -1
- package/dist/templates/nextjs-xmcloud/src/lib/page-props-factory/plugins/content-styles.ts +1 -1
- package/dist/templates/node-headless-ssr-experience-edge/package.json +1 -1
- package/dist/templates/node-headless-ssr-proxy/package.json +2 -2
- package/dist/templates/node-xmcloud-proxy/package.json +1 -1
- package/dist/templates/react/.eslintrc +2 -0
- package/dist/templates/react/package.json +1 -1
- package/dist/templates/vue/package.json +1 -1
- package/package.json +9 -9
|
@@ -46,10 +46,10 @@ class InitializerFactory {
|
|
|
46
46
|
}
|
|
47
47
|
create(name) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
var _a;
|
|
50
49
|
try {
|
|
51
|
-
const { default: Initializer } = yield (
|
|
50
|
+
const { default: Initializer } = yield Promise.resolve(`${path_1.default.resolve(this.rootPath, 'initializers', name, 'index')}`).then(s => __importStar(require(s)));
|
|
52
51
|
return new Initializer();
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
53
53
|
}
|
|
54
54
|
catch (error) {
|
|
55
55
|
return undefined;
|
|
@@ -151,7 +151,7 @@ const diffFiles = (sourceFileContent, targetFilePath) => __awaiter(void 0, void
|
|
|
151
151
|
return answer.choice;
|
|
152
152
|
});
|
|
153
153
|
exports.diffFiles = diffFiles;
|
|
154
|
-
const diffAndWriteFiles = (
|
|
154
|
+
const diffAndWriteFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ rendered, pathToNewFile, answers, }) {
|
|
155
155
|
const targetFilePath = (0, exports.transformFilename)(pathToNewFile, answers);
|
|
156
156
|
const choice = yield (0, exports.diffFiles)(rendered, targetFilePath);
|
|
157
157
|
switch (choice) {
|
|
@@ -192,17 +192,17 @@ const populateEjsData = (answers, destination) => {
|
|
|
192
192
|
exports.populateEjsData = populateEjsData;
|
|
193
193
|
/**
|
|
194
194
|
* Handles each template file and applies ejs renderer, also:
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
195
|
+
* - Determines files for copy.
|
|
196
|
+
* - Determines files for skip.
|
|
197
|
+
* if some files already exist:
|
|
198
|
+
* - merges package.json files
|
|
199
|
+
* - concatenates .env files
|
|
200
|
+
* - compares diffs
|
|
201
201
|
* @param {string} templatePath path to the template
|
|
202
202
|
* @param {BaseArgs} answers CLI arguments
|
|
203
203
|
* @param {TransformOptions} options custom options
|
|
204
204
|
*/
|
|
205
|
-
const transform = (
|
|
205
|
+
const transform = (templatePath_1, answers_1, ...args_1) => __awaiter(void 0, [templatePath_1, answers_1, ...args_1], void 0, function* (templatePath, answers, options = {}) {
|
|
206
206
|
const { isFileForCopy, isFileForSkip, fileForCopyRegExp = FILE_FOR_COPY_REGEXP } = options;
|
|
207
207
|
const destinationPath = path_1.default.resolve(answers.destination);
|
|
208
208
|
if (!answers.appPrefix) {
|
|
@@ -9,7 +9,7 @@ var FetchWith;
|
|
|
9
9
|
(function (FetchWith) {
|
|
10
10
|
FetchWith["GraphQL"] = "GraphQL";
|
|
11
11
|
FetchWith["REST"] = "REST";
|
|
12
|
-
})(FetchWith
|
|
12
|
+
})(FetchWith || (exports.FetchWith = FetchWith = {}));
|
|
13
13
|
/**
|
|
14
14
|
* Default app name for the new app
|
|
15
15
|
*/
|
|
@@ -90,7 +90,7 @@ const openJsonFile = (jsonFilePath) => {
|
|
|
90
90
|
exports.openJsonFile = openJsonFile;
|
|
91
91
|
/**
|
|
92
92
|
* Creates a .json file and inserts provided data
|
|
93
|
-
* @param {
|
|
93
|
+
* @param {object} data data to be written into the .json file
|
|
94
94
|
* @param {string} jsonFilePath a path to a file.
|
|
95
95
|
*/
|
|
96
96
|
const writeJsonFile = (data, jsonFilePath) => {
|
|
@@ -43,8 +43,8 @@ class AngularSxpInitializer {
|
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
init(args) {
|
|
46
|
-
var _a, _b;
|
|
47
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
var _a, _b;
|
|
48
48
|
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
49
49
|
const answers = yield inquirer_1.default.prompt(common_1.sxpPrompts, args);
|
|
50
50
|
const styleguideAnswers = yield inquirer_1.default.prompt(common_1.styleguidePrompts, args);
|
|
@@ -45,8 +45,8 @@ class AngularXmCloudInitializer {
|
|
|
45
45
|
return false;
|
|
46
46
|
}
|
|
47
47
|
init(args) {
|
|
48
|
-
var _a, _b, _c, _d;
|
|
49
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
var _a, _b, _c, _d;
|
|
50
50
|
const pkg = (0, common_1.openJsonFile)(`${args.destination}${path_1.sep}package.json`);
|
|
51
51
|
const addInitializers = [];
|
|
52
52
|
// angular-xmcloud requires node-xmcloud-proxy
|
|
@@ -10,7 +10,7 @@ var Prerender;
|
|
|
10
10
|
(function (Prerender) {
|
|
11
11
|
Prerender["SSG"] = "SSG";
|
|
12
12
|
Prerender["SSR"] = "SSR";
|
|
13
|
-
})(Prerender
|
|
13
|
+
})(Prerender || (exports.Prerender = Prerender = {}));
|
|
14
14
|
const DEFAULT_PRERENDER = Prerender.SSG;
|
|
15
15
|
// still need sxp prompts here until sitecore/config is no longer added to xmc app
|
|
16
16
|
exports.prompts = [
|
|
@@ -39,8 +39,8 @@ class NextjsMultisiteInitializer {
|
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
init(args) {
|
|
42
|
-
var _a, _b;
|
|
43
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
var _a, _b;
|
|
44
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');
|
|
@@ -44,8 +44,8 @@ class NextjsStyleguideInitializer {
|
|
|
44
44
|
return false;
|
|
45
45
|
}
|
|
46
46
|
init(args) {
|
|
47
|
-
var _a, _b;
|
|
48
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
var _a, _b;
|
|
49
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);
|
|
@@ -39,8 +39,8 @@ class NextjsStyleguideInitializer {
|
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
init(args) {
|
|
42
|
-
var _a, _b, _c, _d, _e, _f;
|
|
43
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
var _a, _b, _c, _d, _e, _f;
|
|
44
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');
|
|
@@ -39,8 +39,8 @@ class NextjsSxaInitializer {
|
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
init(args) {
|
|
42
|
-
var _a, _b, _c, _d;
|
|
43
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
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);
|
|
@@ -40,8 +40,8 @@ class NextjsXMCloudInitializer {
|
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
42
|
init(args) {
|
|
43
|
-
var _a, _b, _c, _d;
|
|
44
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
var _a, _b, _c, _d;
|
|
45
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');
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"@sitecore-jss/sitecore-jss-dev-tools": "~22.3.0-canary",
|
|
84
84
|
"@types/jasmine": "~3.6.7",
|
|
85
85
|
"@types/jasminewd2": "~2.0.8",
|
|
86
|
-
"@types/node": "~
|
|
87
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
88
|
-
"@typescript-eslint/parser": "^
|
|
86
|
+
"@types/node": "~22.9.0",
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "^8.14.0",
|
|
88
|
+
"@typescript-eslint/parser": "^8.14.0",
|
|
89
89
|
"chalk": "~4.1.0",
|
|
90
90
|
"chokidar": "^3.5.2",
|
|
91
91
|
"codelyzer": "~6.0.1",
|
|
@@ -110,6 +110,6 @@
|
|
|
110
110
|
"npm-run-all": "~4.1.5",
|
|
111
111
|
"protractor": "^7.0.0",
|
|
112
112
|
"ts-node": "~10.9.2",
|
|
113
|
-
"typescript": "~5.
|
|
113
|
+
"typescript": "~5.4.0"
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -19,7 +19,12 @@
|
|
|
19
19
|
"@next/next/no-img-element": "off", // Don't force next/image
|
|
20
20
|
"jsx-a11y/alt-text": ["warn", { "elements": ["img"] }], // Don't force alt for <Image/> (sourced from Sitecore media)
|
|
21
21
|
"no-unused-vars": "off",
|
|
22
|
-
"@typescript-eslint/no-unused-vars":
|
|
22
|
+
"@typescript-eslint/no-unused-vars": [
|
|
23
|
+
"error",
|
|
24
|
+
{
|
|
25
|
+
"caughtErrorsIgnorePattern": "."
|
|
26
|
+
}
|
|
27
|
+
],
|
|
23
28
|
"@typescript-eslint/no-explicit-any": "error",
|
|
24
29
|
"jsx-quotes": ["error", "prefer-double"]
|
|
25
30
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@sitecore-jss/sitecore-jss-nextjs": "~22.3.0-canary",
|
|
29
29
|
"graphql": "~15.8.0",
|
|
30
30
|
"graphql-tag": "^2.12.6",
|
|
31
|
-
"next": "^14.2.
|
|
31
|
+
"next": "^14.2.18",
|
|
32
32
|
"next-localization": "^0.12.0",
|
|
33
33
|
"react": "^18.2.0",
|
|
34
34
|
"react-dom": "^18.2.0",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
46
46
|
"@sitecore-jss/sitecore-jss-cli": "~22.3.0-canary",
|
|
47
47
|
"@sitecore-jss/sitecore-jss-dev-tools": "~22.3.0-canary",
|
|
48
|
-
"@types/node": "^
|
|
48
|
+
"@types/node": "^22.9.0",
|
|
49
49
|
"@types/react": "^18.2.22",
|
|
50
50
|
"@types/react-dom": "^18.0.5",
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
52
|
-
"@typescript-eslint/parser": "^
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^8.14.0",
|
|
52
|
+
"@typescript-eslint/parser": "^8.14.0",
|
|
53
53
|
"chalk": "~4.1.2",
|
|
54
54
|
"chokidar": "~3.5.3",
|
|
55
55
|
"constant-case": "^3.0.4",
|
|
56
56
|
"cross-env": "~7.0.3",
|
|
57
57
|
"dotenv-flow": "^4.1.0",
|
|
58
|
-
"eslint": "^8.
|
|
58
|
+
"eslint": "^8.56.0",
|
|
59
59
|
"eslint-config-next": "^13.1.5",
|
|
60
60
|
"eslint-config-prettier": "^8.6.0",
|
|
61
61
|
"eslint-plugin-prettier": "^4.2.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"prettier": "^2.8.3",
|
|
67
67
|
"ts-node": "^10.9.1",
|
|
68
68
|
"tsconfig-paths": "^4.1.2",
|
|
69
|
-
"typescript": "~4.
|
|
69
|
+
"typescript": "~5.4.0",
|
|
70
70
|
"yaml-loader": "^0.8.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
@@ -12,6 +12,7 @@ class ScJssConfigPlugin implements ConfigPlugin {
|
|
|
12
12
|
async exec(config: JssConfig) {
|
|
13
13
|
let scJssConfig;
|
|
14
14
|
try {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
15
16
|
scJssConfig = require('scjssconfig.json');
|
|
16
17
|
} catch (e) {
|
|
17
18
|
return config;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
2
2
|
const plugins = require('scripts/temp/generate-component-builder-plugins');
|
|
3
3
|
import { PackageDefinition, ComponentFile } from '@sitecore-jss/sitecore-jss-dev-tools';
|
|
4
4
|
|
|
@@ -23,7 +23,7 @@ generatePlugins({
|
|
|
23
23
|
Edit this script if you wish to use your own conventions for component storage in your JSS app.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
27
27
|
const plugins = require('scripts/temp/scaffold-component-plugins');
|
|
28
28
|
|
|
29
29
|
export interface ScaffoldComponentPluginConfig {
|
|
@@ -19,7 +19,7 @@ class DisconnectedSitemapServicePlugin implements SitemapFetcherPlugin {
|
|
|
19
19
|
if (process.env.JSS_MODE !== constants.JSS_MODE.DISCONNECTED) return null;
|
|
20
20
|
|
|
21
21
|
try {
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
23
23
|
const manifest = require('sitecore/manifest/sitecore-import.json');
|
|
24
24
|
|
|
25
25
|
return manifest;
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@types/compression": "^1.7.2",
|
|
32
32
|
"@types/express": "^4.17.17",
|
|
33
33
|
"@types/memory-cache": "^0.2.2",
|
|
34
|
-
"@types/node": "^
|
|
34
|
+
"@types/node": "^22.9.0",
|
|
35
35
|
"ts-node": "^10.9.1",
|
|
36
|
-
"typescript": "~
|
|
36
|
+
"typescript": "~5.6.3"
|
|
37
37
|
},
|
|
38
38
|
"private": true
|
|
39
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-sitecore-jss",
|
|
3
|
-
"version": "22.3.0-canary.
|
|
3
|
+
"version": "22.3.0-canary.13",
|
|
4
4
|
"description": "Sitecore JSS initializer",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"coverage": "nyc npm test"
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
15
|
+
"node": ">=22"
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
@@ -49,19 +49,19 @@
|
|
|
49
49
|
"@types/inquirer": "^9.0.3",
|
|
50
50
|
"@types/minimist": "^1.2.2",
|
|
51
51
|
"@types/mocha": "^10.0.1",
|
|
52
|
-
"@types/node": "^
|
|
53
|
-
"@types/sinon": "
|
|
54
|
-
"@types/sinon-chai": "^
|
|
52
|
+
"@types/node": "^22.9.0",
|
|
53
|
+
"@types/sinon": "17.0.3",
|
|
54
|
+
"@types/sinon-chai": "^4.0.0",
|
|
55
55
|
"chai": "^4.3.7",
|
|
56
56
|
"chokidar": "^3.5.3",
|
|
57
57
|
"del-cli": "^5.0.0",
|
|
58
|
-
"eslint": "^8.
|
|
58
|
+
"eslint": "^8.56.0",
|
|
59
59
|
"mocha": "^10.2.0",
|
|
60
60
|
"nyc": "^15.1.0",
|
|
61
|
-
"sinon": "^
|
|
61
|
+
"sinon": "^18.0.0",
|
|
62
62
|
"sinon-chai": "^3.7.0",
|
|
63
63
|
"ts-node": "^10.9.1",
|
|
64
|
-
"typescript": "~
|
|
64
|
+
"typescript": "~5.6.3"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "3594160e4faebace2e135b19675ae9583992a405"
|
|
67
67
|
}
|