create-sitecore-jss 22.12.1 → 22.12.3
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/templates/nextjs/eslint.config.mjs +16 -18
- package/dist/templates/nextjs/package.json +2 -3
- package/dist/templates/nextjs/tsconfig.json +3 -1
- package/dist/templates/nextjs-styleguide/src/components/graphql/GraphQL-ConnectedDemo.dynamic.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Image.tsx +3 -3
- package/dist/templates/nextjs-sxa/src/components/Title.tsx +11 -9
- package/package.json +3 -3
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ESLint flat config for JSS Next.js apps.
|
|
3
|
-
*
|
|
3
|
+
* Loads eslint-config-next's published flat bundle (no FlatCompat) to avoid circular
|
|
4
|
+
* plugin graphs when ESLint 9 validates legacy eslintrc through @eslint/eslintrc.
|
|
4
5
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
import { FlatCompat } from '@eslint/eslintrc';
|
|
6
|
+
import { createRequire } from 'module';
|
|
8
7
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
8
|
+
import prettierPlugin from 'eslint-plugin-prettier';
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const compat = new FlatCompat({ baseDirectory: __dirname });
|
|
13
|
-
|
|
14
|
-
const nextAndPrettierLegacy = compat.extends(
|
|
15
|
-
'next',
|
|
16
|
-
'next/core-web-vitals',
|
|
17
|
-
'plugin:@typescript-eslint/recommended',
|
|
18
|
-
'prettier',
|
|
19
|
-
'plugin:yaml/recommended',
|
|
20
|
-
'plugin:prettier/recommended'
|
|
21
|
-
);
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
const coreWebVitals = require('eslint-config-next/core-web-vitals');
|
|
22
12
|
|
|
23
13
|
export default [
|
|
24
|
-
{
|
|
25
|
-
|
|
14
|
+
{
|
|
15
|
+
ignores: ['.generated/**', '**/*.d.ts', '**/*.js', 'node_modules', '.next', 'out'],
|
|
16
|
+
},
|
|
17
|
+
...coreWebVitals,
|
|
26
18
|
{
|
|
27
19
|
files: ['**/*.ts', '**/*.tsx'],
|
|
28
20
|
rules: {
|
|
@@ -37,5 +29,11 @@ export default [
|
|
|
37
29
|
'jsx-quotes': ['error', 'prefer-double'],
|
|
38
30
|
},
|
|
39
31
|
},
|
|
32
|
+
{
|
|
33
|
+
plugins: { prettier: prettierPlugin },
|
|
34
|
+
rules: {
|
|
35
|
+
'prettier/prettier': 'warn',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
40
38
|
eslintConfigPrettier,
|
|
41
39
|
];
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@sitecore-jss/sitecore-jss-nextjs": "<%- version %>",
|
|
29
|
-
"next": "^16.
|
|
29
|
+
"next": "^16.2.0",
|
|
30
30
|
"next-localization": "^0.12.0",
|
|
31
31
|
"react": "^19.1.0",
|
|
32
32
|
"react-dom": "^19.1.0",
|
|
@@ -45,9 +45,8 @@
|
|
|
45
45
|
"constant-case": "^3.0.4",
|
|
46
46
|
"cross-env": "~10.0.0",
|
|
47
47
|
"dotenv-flow": "^4.1.0",
|
|
48
|
-
"@eslint/eslintrc": "^3.2.0",
|
|
49
48
|
"eslint": "^9.15.0",
|
|
50
|
-
"eslint-config-next": "^
|
|
49
|
+
"eslint-config-next": "^16.2.0",
|
|
51
50
|
"eslint-config-prettier": "^8.6.0",
|
|
52
51
|
"eslint-plugin-prettier": "^4.2.1",
|
|
53
52
|
"eslint-plugin-react": "^7.37.5",
|
|
@@ -72,17 +72,17 @@ export const Default = (props: ImageProps): JSX.Element => {
|
|
|
72
72
|
const { sitecoreContext } = useSitecoreContext();
|
|
73
73
|
|
|
74
74
|
if (props.fields) {
|
|
75
|
-
const Image = () => <JssImage field={props.fields.Image} />;
|
|
76
75
|
const id = props.params.RenderingIdentifier;
|
|
76
|
+
const imageField = props.fields.Image;
|
|
77
77
|
|
|
78
78
|
return (
|
|
79
79
|
<div className={`component image ${props?.params?.styles}`} id={id ? id : undefined}>
|
|
80
80
|
<div className="component-content">
|
|
81
81
|
{sitecoreContext.pageState === 'edit' || !props.fields.TargetUrl?.value?.href ? (
|
|
82
|
-
<
|
|
82
|
+
<JssImage field={imageField} />
|
|
83
83
|
) : (
|
|
84
84
|
<JssLink field={props.fields.TargetUrl}>
|
|
85
|
-
<
|
|
85
|
+
<JssImage field={imageField} />
|
|
86
86
|
</JssLink>
|
|
87
87
|
)}
|
|
88
88
|
<Text
|
|
@@ -64,28 +64,30 @@ export const Default = (props: TitleProps): JSX.Element => {
|
|
|
64
64
|
const datasource = props.fields?.data?.datasource || props.fields?.data?.contextItem;
|
|
65
65
|
const { sitecoreContext } = useSitecoreContext();
|
|
66
66
|
const text: TextField = datasource?.field?.jsonValue || {};
|
|
67
|
-
const
|
|
67
|
+
const linkValue: NonNullable<LinkField['value']> = {
|
|
68
68
|
value: {
|
|
69
69
|
href: datasource?.url?.path,
|
|
70
70
|
title: datasource?.field?.jsonValue?.value,
|
|
71
71
|
},
|
|
72
|
-
};
|
|
72
|
+
}.value;
|
|
73
|
+
|
|
74
|
+
const displayText: TextField =
|
|
75
|
+
sitecoreContext.pageState !== 'normal' && !text?.value ? { ...text, value: 'Title field' } : text;
|
|
76
|
+
|
|
73
77
|
if (sitecoreContext.pageState !== 'normal') {
|
|
74
|
-
|
|
75
|
-
if (!
|
|
76
|
-
text.value = 'Title field';
|
|
77
|
-
link.value.href = '#';
|
|
78
|
-
}
|
|
78
|
+
linkValue.querystring = `sc_site=${datasource?.url?.siteName}`;
|
|
79
|
+
if (!displayText?.value) linkValue.href = '#';
|
|
79
80
|
}
|
|
81
|
+
const link: LinkField = { value: linkValue };
|
|
80
82
|
|
|
81
83
|
return (
|
|
82
84
|
<ComponentContent styles={props?.params?.styles} id={props?.params?.RenderingIdentifier}>
|
|
83
85
|
<>
|
|
84
86
|
{sitecoreContext.pageEditing ? (
|
|
85
|
-
<Text field={
|
|
87
|
+
<Text field={displayText} />
|
|
86
88
|
) : (
|
|
87
89
|
<Link field={link}>
|
|
88
|
-
<Text field={
|
|
90
|
+
<Text field={displayText} />
|
|
89
91
|
</Link>
|
|
90
92
|
)}
|
|
91
93
|
</>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-sitecore-jss",
|
|
3
|
-
"version": "22.12.
|
|
3
|
+
"version": "22.12.3",
|
|
4
4
|
"description": "Sitecore JSS initializer",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dotenv": "^17.2.1",
|
|
36
36
|
"ejs": "^3.1.10",
|
|
37
37
|
"fs-extra": "^11.3.1",
|
|
38
|
-
"glob": "^
|
|
38
|
+
"glob": "^13.0.6",
|
|
39
39
|
"inquirer": "^8.2.4",
|
|
40
40
|
"minimist": "^1.2.8"
|
|
41
41
|
},
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"ts-node": "^10.9.2",
|
|
64
64
|
"typescript": "~5.9.2"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "90ccd80a8796bed90ab5500f27e9c35b90b114be"
|
|
67
67
|
}
|