create-sitecore-jss 22.10.0-canary.9 → 22.11.0-canary.2
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/angular/angular.json +133 -133
- package/dist/templates/angular/package.json +118 -119
- package/dist/templates/angular/scripts/generate-component-factory/template.ts +1 -3
- package/dist/templates/angular/server.bundle.ts +3 -2
- package/dist/templates/angular/src/app/ViewBag.ts +4 -0
- package/dist/templates/angular/src/app/app.component.ts +10 -9
- package/dist/templates/angular/src/app/app.module.ts +3 -1
- package/dist/templates/angular/src/app/app.server.module.ts +4 -5
- package/dist/templates/angular/src/app/components/app-components.shared.module.ts +16 -3
- package/dist/templates/angular/src/app/components/content-block/content-block.component.ts +2 -1
- package/dist/templates/angular/src/app/i18n/jss-translation-client-loader.service.ts +3 -2
- package/dist/templates/angular/src/app/i18n/jss-translation-server-loader.service.ts +6 -4
- package/dist/templates/angular/src/app/injection-tokens.ts +13 -0
- package/dist/templates/angular/src/app/jss-context.server-side.service.ts +8 -10
- package/dist/templates/angular/src/app/jss-context.service.ts +6 -4
- package/dist/templates/angular/src/app/jss-graphql.module.ts +58 -48
- package/dist/templates/angular/src/app/jss-graphql.service.ts +6 -6
- package/dist/templates/angular/src/app/jss-meta.service.ts +3 -2
- package/dist/templates/angular/src/app/routing/layout/layout.component.ts +10 -4
- package/dist/templates/angular/src/app/routing/navigation/navigation.component.ts +3 -0
- package/dist/templates/angular/src/app/routing/not-found/not-found.component.ts +1 -1
- package/dist/templates/angular/src/app/routing/routing.module.ts +3 -4
- package/dist/templates/angular/src/app/routing/scripts/scripts.module.ts +1 -1
- package/dist/templates/angular-sxp/src/app/components/app-components.shared.module.ts +1 -3
- package/dist/templates/angular-sxp/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.html +41 -39
- package/dist/templates/angular-sxp/src/app/components/graph-ql-connected-demo/graph-ql-connected-demo.component.ts +5 -3
- package/dist/templates/angular-sxp/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.html +6 -4
- package/dist/templates/angular-sxp/src/app/components/graph-ql-integrated-demo/graph-ql-integrated-demo.component.ts +4 -4
- package/dist/templates/angular-sxp/src/app/components/graph-ql-layout/graph-ql-layout.component.html +3 -4
- package/dist/templates/angular-sxp/src/app/components/graph-ql-layout/graph-ql-layout.component.ts +4 -4
- package/dist/templates/angular-sxp/src/app/components/shared/styleguide-specimen/styleguide-specimen.component.ts +3 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.component.ts +5 -5
- package/dist/templates/angular-sxp/src/app/components/styleguide-angular-lazy-loading/styleguide-angular-lazy-loading.module.ts +2 -5
- package/dist/templates/angular-sxp/src/app/components/styleguide-component-params/styleguide-component-params.component.html +8 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-component-params/styleguide-component-params.component.ts +2 -2
- package/dist/templates/angular-sxp/src/app/components/styleguide-custom-route-type/styleguide-custom-route-type.component.ts +5 -5
- package/dist/templates/angular-sxp/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.html +7 -3
- package/dist/templates/angular-sxp/src/app/components/styleguide-edit-frame/styleguide-edit-frame.component.ts +13 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-checkbox/styleguide-field-usage-checkbox.component.ts +2 -2
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.html +20 -16
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-content-list/styleguide-field-usage-content-list.component.ts +20 -3
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-custom/styleguide-field-usage-custom.component.ts +2 -0
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-date/styleguide-field-usage-date.component.ts +4 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-file/styleguide-field-usage-file.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-image/styleguide-field-usage-image.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.html +4 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-item-link/styleguide-field-usage-item-link.component.ts +4 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-link/styleguide-field-usage-link.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-number/styleguide-field-usage-number.component.ts +2 -0
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-rich-text/styleguide-field-usage-rich-text.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-field-usage-text/styleguide-field-usage-text.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout/styleguide-layout.component.html +12 -8
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout/styleguide-layout.component.ts +2 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-reuse/styleguide-layout-reuse.component.ts +3 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.html +18 -15
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs/styleguide-layout-tabs.component.ts +6 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.html +2 -2
- package/dist/templates/angular-sxp/src/app/components/styleguide-layout-tabs-tab/styleguide-layout-tabs-tab.component.ts +4 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-multilingual/styleguide-multilingual.component.ts +7 -3
- package/dist/templates/angular-sxp/src/app/components/styleguide-route-fields/styleguide-route-fields.component.ts +5 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-section/styleguide-section.component.ts +2 -1
- package/dist/templates/angular-sxp/src/app/components/styleguide-sitecore-context/styleguide-sitecore-context.component.ts +7 -4
- package/dist/templates/angular-sxp/src/app/components/styleguide-tracking/styleguide-tracking.component.html +6 -2
- package/dist/templates/angular-sxp/src/app/components/styleguide-tracking/styleguide-tracking.component.ts +12 -12
- package/dist/templates/angular-sxp/src/app/jss-data-fetcher.service.ts +4 -2
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.component.ts +10 -0
- package/dist/templates/angular-sxp/src/app/routing/scripts/scripts.module.ts +1 -1
- package/dist/templates/angular-sxp/src/app/routing/scripts/visitor-identification/visitor-identification.component.ts +6 -3
- package/dist/templates/angular-xmcloud/scripts/generate-component-factory/template.ts +1 -3
- package/dist/templates/angular-xmcloud/src/app/components/app-components.shared.module.ts +1 -2
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.html +6 -4
- package/dist/templates/angular-xmcloud/src/app/components/column-splitter/column-splitter.component.ts +4 -1
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.html +14 -5
- package/dist/templates/angular-xmcloud/src/app/components/container/container.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.html +21 -23
- package/dist/templates/angular-xmcloud/src/app/components/image/image.component.ts +5 -5
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.html +11 -10
- package/dist/templates/angular-xmcloud/src/app/components/link-list/link-list.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.html +14 -17
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation-item.component.ts +3 -3
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.html +3 -6
- package/dist/templates/angular-xmcloud/src/app/components/navigation/navigation.component.ts +8 -5
- package/dist/templates/angular-xmcloud/src/app/components/page-content/page-content.component.ts +4 -4
- package/dist/templates/angular-xmcloud/src/app/components/partial-design-dynamic-placeholder/partial-design-dynamic-placeholder.component.ts +2 -0
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.html +4 -6
- package/dist/templates/angular-xmcloud/src/app/components/promo/promo.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.html +3 -4
- package/dist/templates/angular-xmcloud/src/app/components/richtext/richtext.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.html +10 -9
- package/dist/templates/angular-xmcloud/src/app/components/row-splitter/row-splitter.component.ts +3 -0
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.html +4 -5
- package/dist/templates/angular-xmcloud/src/app/components/title/title.component.ts +5 -5
- package/dist/templates/angular-xmcloud/src/app/jss-link.service.ts +2 -2
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.html +38 -36
- package/dist/templates/angular-xmcloud/src/app/routing/layout/layout.component.ts +10 -6
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cdp-page-view.component.ts +2 -3
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/cloud-sdk-init.component.ts +2 -2
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.component.ts +13 -0
- package/dist/templates/angular-xmcloud/src/app/routing/scripts/scripts.module.ts +1 -2
- package/package.json +2 -2
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
-
"cli": {
|
|
4
|
-
"analytics": false
|
|
5
|
-
},
|
|
6
|
-
"version": 1,
|
|
7
|
-
"newProjectRoot": "projects",
|
|
8
|
-
"projects": {
|
|
9
|
-
"<%- appName %>": {
|
|
10
|
-
"root": ".",
|
|
11
|
-
"sourceRoot": "src",
|
|
12
|
-
"projectType": "application",
|
|
13
|
-
"architect": {
|
|
14
|
-
"build": {
|
|
15
|
-
"builder": "@angular-builders/custom-webpack:browser",
|
|
16
|
-
"options": {
|
|
17
|
-
"outputPath": "dist/browser/",
|
|
18
|
-
"index": "src/index.html",
|
|
19
|
-
"main": "src/main.ts",
|
|
20
|
-
"tsConfig": "src/tsconfig.app.json",
|
|
21
|
-
"polyfills": "src/polyfills.ts",
|
|
22
|
-
"assets": ["src/assets", "src/favicon.ico"],
|
|
23
|
-
"styles": ["src/styles.css"],
|
|
24
|
-
"scripts": [],
|
|
25
|
-
"allowedCommonJsDependencies": [
|
|
26
|
-
"zen-observable",
|
|
27
|
-
"js-sha256",
|
|
28
|
-
"url-parse",
|
|
29
|
-
"graphql-request",
|
|
30
|
-
"debug"
|
|
31
|
-
],
|
|
32
|
-
"customWebpackConfig": {
|
|
33
|
-
"path": "./webpack.config.js"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"configurations": {
|
|
37
|
-
"production": {
|
|
38
|
-
"budgets": [
|
|
39
|
-
{
|
|
40
|
-
"type": "anyComponentStyle",
|
|
41
|
-
"maximumWarning": "6kb"
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
"baseHref": "/",
|
|
45
|
-
"aot": true,
|
|
46
|
-
"optimization": true,
|
|
47
|
-
"outputHashing": "all",
|
|
48
|
-
"sourceMap": false,
|
|
49
|
-
"namedChunks": false,
|
|
50
|
-
"extractLicenses": true,
|
|
51
|
-
"vendorChunk": false,
|
|
52
|
-
"buildOptimizer": true,
|
|
53
|
-
"fileReplacements": [
|
|
54
|
-
{
|
|
55
|
-
"replace": "src/environments/environment.js",
|
|
56
|
-
"with": "src/environments/environment.prod.js"
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"serve": {
|
|
63
|
-
"builder": "@angular-builders/custom-webpack:dev-server",
|
|
64
|
-
"options": {
|
|
65
|
-
"buildTarget": "<%- appName %>:build",
|
|
66
|
-
"port": 3000,
|
|
67
|
-
"proxyConfig": "proxy.conf.js"
|
|
68
|
-
},
|
|
69
|
-
"configurations": {
|
|
70
|
-
"production": {
|
|
71
|
-
"buildTarget": "<%- appName %>:build:production"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"extract-i18n": {
|
|
76
|
-
"builder": "@angular-devkit/build-angular:extract-i18n",
|
|
77
|
-
"options": {
|
|
78
|
-
"buildTarget": "<%- appName %>:build"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"test": {
|
|
82
|
-
"builder": "@angular-devkit/build-angular:karma",
|
|
83
|
-
"options": {
|
|
84
|
-
"main": "src/test.ts",
|
|
85
|
-
"karmaConfig": "./karma.conf.js",
|
|
86
|
-
"polyfills": "src/polyfills.ts",
|
|
87
|
-
"tsConfig": "src/tsconfig.spec.json",
|
|
88
|
-
"scripts": [],
|
|
89
|
-
"styles": ["src/styles.css"],
|
|
90
|
-
"assets": ["src/assets", "src/favicon.ico"]
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"lint": {
|
|
94
|
-
"builder": "@angular-eslint/builder:lint",
|
|
95
|
-
"options": {
|
|
96
|
-
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
"server": {
|
|
100
|
-
"builder": "@angular-devkit/build-angular:server",
|
|
101
|
-
"options": {
|
|
102
|
-
"main": "server.bundle.ts",
|
|
103
|
-
"tsConfig": "src/tsconfig.server.json",
|
|
104
|
-
"deleteOutputPath": false,
|
|
105
|
-
"outputHashing": "none"
|
|
106
|
-
},
|
|
107
|
-
"configurations": {
|
|
108
|
-
"production": {
|
|
109
|
-
"outputHashing": "media",
|
|
110
|
-
"sourceMap": false,
|
|
111
|
-
"optimization": true,
|
|
112
|
-
"fileReplacements": [
|
|
113
|
-
{
|
|
114
|
-
"replace": "src/environments/environment.js",
|
|
115
|
-
"with": "src/environments/environment.prod.js"
|
|
116
|
-
}
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
"schematics": {
|
|
125
|
-
"@schematics/angular:component": {
|
|
126
|
-
"prefix": "app",
|
|
127
|
-
"style": "css"
|
|
128
|
-
},
|
|
129
|
-
"@schematics/angular:directive": {
|
|
130
|
-
"prefix": "app"
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"cli": {
|
|
4
|
+
"analytics": false
|
|
5
|
+
},
|
|
6
|
+
"version": 1,
|
|
7
|
+
"newProjectRoot": "projects",
|
|
8
|
+
"projects": {
|
|
9
|
+
"<%- appName %>": {
|
|
10
|
+
"root": ".",
|
|
11
|
+
"sourceRoot": "src",
|
|
12
|
+
"projectType": "application",
|
|
13
|
+
"architect": {
|
|
14
|
+
"build": {
|
|
15
|
+
"builder": "@angular-builders/custom-webpack:browser",
|
|
16
|
+
"options": {
|
|
17
|
+
"outputPath": "dist/browser/",
|
|
18
|
+
"index": "src/index.html",
|
|
19
|
+
"main": "src/main.ts",
|
|
20
|
+
"tsConfig": "src/tsconfig.app.json",
|
|
21
|
+
"polyfills": "src/polyfills.ts",
|
|
22
|
+
"assets": ["src/assets", "src/favicon.ico"],
|
|
23
|
+
"styles": ["src/styles.css"],
|
|
24
|
+
"scripts": [],
|
|
25
|
+
"allowedCommonJsDependencies": [
|
|
26
|
+
"zen-observable",
|
|
27
|
+
"js-sha256",
|
|
28
|
+
"url-parse",
|
|
29
|
+
"graphql-request",
|
|
30
|
+
"debug"
|
|
31
|
+
],
|
|
32
|
+
"customWebpackConfig": {
|
|
33
|
+
"path": "./webpack.config.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"configurations": {
|
|
37
|
+
"production": {
|
|
38
|
+
"budgets": [
|
|
39
|
+
{
|
|
40
|
+
"type": "anyComponentStyle",
|
|
41
|
+
"maximumWarning": "6kb"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"baseHref": "/",
|
|
45
|
+
"aot": true,
|
|
46
|
+
"optimization": true,
|
|
47
|
+
"outputHashing": "all",
|
|
48
|
+
"sourceMap": false,
|
|
49
|
+
"namedChunks": false,
|
|
50
|
+
"extractLicenses": true,
|
|
51
|
+
"vendorChunk": false,
|
|
52
|
+
"buildOptimizer": true,
|
|
53
|
+
"fileReplacements": [
|
|
54
|
+
{
|
|
55
|
+
"replace": "src/environments/environment.js",
|
|
56
|
+
"with": "src/environments/environment.prod.js"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"serve": {
|
|
63
|
+
"builder": "@angular-builders/custom-webpack:dev-server",
|
|
64
|
+
"options": {
|
|
65
|
+
"buildTarget": "<%- appName %>:build",
|
|
66
|
+
"port": 3000,
|
|
67
|
+
"proxyConfig": "proxy.conf.js"
|
|
68
|
+
},
|
|
69
|
+
"configurations": {
|
|
70
|
+
"production": {
|
|
71
|
+
"buildTarget": "<%- appName %>:build:production"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"extract-i18n": {
|
|
76
|
+
"builder": "@angular-devkit/build-angular:extract-i18n",
|
|
77
|
+
"options": {
|
|
78
|
+
"buildTarget": "<%- appName %>:build"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"test": {
|
|
82
|
+
"builder": "@angular-devkit/build-angular:karma",
|
|
83
|
+
"options": {
|
|
84
|
+
"main": "src/test.ts",
|
|
85
|
+
"karmaConfig": "./karma.conf.js",
|
|
86
|
+
"polyfills": "src/polyfills.ts",
|
|
87
|
+
"tsConfig": "src/tsconfig.spec.json",
|
|
88
|
+
"scripts": [],
|
|
89
|
+
"styles": ["src/styles.css"],
|
|
90
|
+
"assets": ["src/assets", "src/favicon.ico"]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"lint": {
|
|
94
|
+
"builder": "@angular-eslint/builder:lint",
|
|
95
|
+
"options": {
|
|
96
|
+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"server": {
|
|
100
|
+
"builder": "@angular-devkit/build-angular:server",
|
|
101
|
+
"options": {
|
|
102
|
+
"main": "server.bundle.ts",
|
|
103
|
+
"tsConfig": "src/tsconfig.server.json",
|
|
104
|
+
"deleteOutputPath": false,
|
|
105
|
+
"outputHashing": "none"
|
|
106
|
+
},
|
|
107
|
+
"configurations": {
|
|
108
|
+
"production": {
|
|
109
|
+
"outputHashing": "media",
|
|
110
|
+
"sourceMap": false,
|
|
111
|
+
"optimization": true,
|
|
112
|
+
"fileReplacements": [
|
|
113
|
+
{
|
|
114
|
+
"replace": "src/environments/environment.js",
|
|
115
|
+
"with": "src/environments/environment.prod.js"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"schematics": {
|
|
125
|
+
"@schematics/angular:component": {
|
|
126
|
+
"prefix": "app",
|
|
127
|
+
"style": "css"
|
|
128
|
+
},
|
|
129
|
+
"@schematics/angular:directive": {
|
|
130
|
+
"prefix": "app"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -1,119 +1,118 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%- appName %>",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "Application utilizing Sitecore JavaScript Services and Angular (angular-cli).",
|
|
5
|
-
"config": {
|
|
6
|
-
"appName": "<%- appName %>",
|
|
7
|
-
"rootPlaceholders": [
|
|
8
|
-
"<%- helper.getAppPrefix(appPrefix, appName) %>jss-main"
|
|
9
|
-
],
|
|
10
|
-
"sitecoreDistPath": "/dist/<%- appName %>",
|
|
11
|
-
"sitecoreConfigPath": "/App_Config/Include/zzz",
|
|
12
|
-
"buildArtifactsPath": "./dist",
|
|
13
|
-
"graphQLEndpointPath": "/sitecore/api/graph/edge",
|
|
14
|
-
"language": "en"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"ng": "ng",
|
|
18
|
-
"lint": "ng lint <%- appName %> --fix",
|
|
19
|
-
"jss": "jss",
|
|
20
|
-
"start:connected": "npm-run-all --serial bootstrap start:angular start:watch-components",
|
|
21
|
-
"build": "npm-run-all --serial bootstrap build:client build:server",
|
|
22
|
-
"scaffold": "ng generate @sitecore-jss/sitecore-jss-angular-schematics:jss-component --no-manifest",
|
|
23
|
-
"start:angular": "ng serve -o",
|
|
24
|
-
"start:watch-components": "ts-node --project src/tsconfig.webpack-server.json scripts/generate-component-factory/index.ts --watch",
|
|
25
|
-
"build:client": "cross-env-shell ng build --configuration=production --base-href $npm_package_config_sitecoreDistPath/browser/ --output-path=$npm_package_config_buildArtifactsPath/browser/",
|
|
26
|
-
"build:server": "cross-env-shell ng run <%- appName %>:server:production --output-path=$npm_package_config_buildArtifactsPath",
|
|
27
|
-
"postbuild:server": "move-cli ./dist/main.js ./dist/server.bundle.js",
|
|
28
|
-
"bootstrap": "ts-node --project src/tsconfig.webpack-server.json scripts/bootstrap.ts",
|
|
29
|
-
"graphql:update": "ts-node --project src/tsconfig.webpack-server.json ./scripts/update-graphql-fragment-data.ts",
|
|
30
|
-
"install-pre-push-hook": "ts-node --project src/tsconfig.webpack-server.json ./scripts/install-pre-push-hook.ts"
|
|
31
|
-
},
|
|
32
|
-
"private": true,
|
|
33
|
-
"author": {
|
|
34
|
-
"name": "Sitecore Corporation",
|
|
35
|
-
"url": "https://jss.sitecore.com"
|
|
36
|
-
},
|
|
37
|
-
"repository": {
|
|
38
|
-
"type": "git",
|
|
39
|
-
"url": "git+https://github.com/sitecore/jss.git"
|
|
40
|
-
},
|
|
41
|
-
"bugs": {
|
|
42
|
-
"url": "https://github.com/sitecore/jss/issues"
|
|
43
|
-
},
|
|
44
|
-
"homepage": "https://jss.sitecore.com",
|
|
45
|
-
"license": "Apache-2.0",
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"@angular/animations": "~
|
|
48
|
-
"@angular/common": "~
|
|
49
|
-
"@angular/compiler": "~
|
|
50
|
-
"@angular/core": "~
|
|
51
|
-
"@angular/forms": "~
|
|
52
|
-
"@angular/platform-browser": "~
|
|
53
|
-
"@angular/platform-browser-dynamic": "~
|
|
54
|
-
"@angular/platform-server": "~
|
|
55
|
-
"@angular/router": "~
|
|
56
|
-
"@apollo/client": "^3.12.9",
|
|
57
|
-
"@ngx-translate/core": "~15.0.0",
|
|
58
|
-
"@ngx-translate/http-loader": "~8.0.0",
|
|
59
|
-
"@sitecore-jss/sitecore-jss-angular": "<%- version %>",
|
|
60
|
-
"apollo-angular": "~
|
|
61
|
-
"bootstrap": "^5.3.3",
|
|
62
|
-
"core-js": "~3.45.0",
|
|
63
|
-
"graphql": "
|
|
64
|
-
"graphql-tag": "
|
|
65
|
-
"rxjs": "~7.8.2",
|
|
66
|
-
"tslib": "^2.8.1",
|
|
67
|
-
"zone.js": "~0.
|
|
68
|
-
"reflect-metadata": "^0.2.2"
|
|
69
|
-
},
|
|
70
|
-
"devDependencies": {
|
|
71
|
-
"@angular-builders/custom-webpack": "^
|
|
72
|
-
"@angular-devkit/build-angular": "^
|
|
73
|
-
"@angular-eslint/builder": "^
|
|
74
|
-
"@angular-eslint/eslint-plugin": "^
|
|
75
|
-
"@angular-eslint/eslint-plugin-template": "^
|
|
76
|
-
"@angular-eslint/schematics": "^
|
|
77
|
-
"@angular-eslint/template-parser": "^
|
|
78
|
-
"@angular/cli": "~
|
|
79
|
-
"@angular/compiler-cli": "~
|
|
80
|
-
"@angular/language-service": "~
|
|
81
|
-
"@sitecore-jss/sitecore-jss-angular-schematics": "<%- version %>",
|
|
82
|
-
"@sitecore-jss/sitecore-jss-cli": "<%- version %>",
|
|
83
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "<%- version %>",
|
|
84
|
-
"@types/jasmine": "~3.6.7",
|
|
85
|
-
"@types/node": "~22.9.0",
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^8.14.0",
|
|
87
|
-
"@typescript-eslint/parser": "^8.14.0",
|
|
88
|
-
"chalk": "~4.1.0",
|
|
89
|
-
"chokidar": "^4.0.3",
|
|
90
|
-
"codelyzer": "~6.0.1",
|
|
91
|
-
"constant-case": "^3.0.4",
|
|
92
|
-
"cross-env": "~7.0.3",
|
|
93
|
-
"del-cli": "^5.0.0",
|
|
94
|
-
"dotenv": "^17.2.1",
|
|
95
|
-
"dotenv-webpack": "^8.1.1",
|
|
96
|
-
"eslint": "^8.56.0",
|
|
97
|
-
"eslint-plugin-import": "2.29.1",
|
|
98
|
-
"eslint-plugin-jsdoc": "48.7.0",
|
|
99
|
-
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
100
|
-
"jasmine-core": "~3.7.1",
|
|
101
|
-
"jasmine-spec-reporter": "~6.0.0",
|
|
102
|
-
"karma": "^6.3.2",
|
|
103
|
-
"karma-chrome-launcher": "~3.1.0",
|
|
104
|
-
"karma-cli": "~2.0.0",
|
|
105
|
-
"karma-coverage-istanbul-reporter": "~3.0.3",
|
|
106
|
-
"karma-jasmine": "~4.0.1",
|
|
107
|
-
"karma-jasmine-html-reporter": "~1.5.4",
|
|
108
|
-
"move-cli": "^2.0.0",
|
|
109
|
-
"npm-run-all2": "^7.0.1",
|
|
110
|
-
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "<%- appName %>",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Application utilizing Sitecore JavaScript Services and Angular (angular-cli).",
|
|
5
|
+
"config": {
|
|
6
|
+
"appName": "<%- appName %>",
|
|
7
|
+
"rootPlaceholders": [
|
|
8
|
+
"<%- helper.getAppPrefix(appPrefix, appName) %>jss-main"
|
|
9
|
+
],
|
|
10
|
+
"sitecoreDistPath": "/dist/<%- appName %>",
|
|
11
|
+
"sitecoreConfigPath": "/App_Config/Include/zzz",
|
|
12
|
+
"buildArtifactsPath": "./dist",
|
|
13
|
+
"graphQLEndpointPath": "/sitecore/api/graph/edge",
|
|
14
|
+
"language": "en"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"ng": "ng",
|
|
18
|
+
"lint": "ng lint <%- appName %> --fix",
|
|
19
|
+
"jss": "jss",
|
|
20
|
+
"start:connected": "npm-run-all --serial bootstrap start:angular start:watch-components",
|
|
21
|
+
"build": "npm-run-all --serial bootstrap build:client build:server",
|
|
22
|
+
"scaffold": "ng generate @sitecore-jss/sitecore-jss-angular-schematics:jss-component --no-manifest",
|
|
23
|
+
"start:angular": "ng serve -o",
|
|
24
|
+
"start:watch-components": "ts-node --project src/tsconfig.webpack-server.json scripts/generate-component-factory/index.ts --watch",
|
|
25
|
+
"build:client": "cross-env-shell ng build --configuration=production --base-href $npm_package_config_sitecoreDistPath/browser/ --output-path=$npm_package_config_buildArtifactsPath/browser/",
|
|
26
|
+
"build:server": "cross-env-shell ng run <%- appName %>:server:production --output-path=$npm_package_config_buildArtifactsPath",
|
|
27
|
+
"postbuild:server": "move-cli ./dist/main.js ./dist/server.bundle.js",
|
|
28
|
+
"bootstrap": "ts-node --project src/tsconfig.webpack-server.json scripts/bootstrap.ts",
|
|
29
|
+
"graphql:update": "ts-node --project src/tsconfig.webpack-server.json ./scripts/update-graphql-fragment-data.ts",
|
|
30
|
+
"install-pre-push-hook": "ts-node --project src/tsconfig.webpack-server.json ./scripts/install-pre-push-hook.ts"
|
|
31
|
+
},
|
|
32
|
+
"private": true,
|
|
33
|
+
"author": {
|
|
34
|
+
"name": "Sitecore Corporation",
|
|
35
|
+
"url": "https://jss.sitecore.com"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/sitecore/jss.git"
|
|
40
|
+
},
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/sitecore/jss/issues"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://jss.sitecore.com",
|
|
45
|
+
"license": "Apache-2.0",
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@angular/animations": "~20.3.10",
|
|
48
|
+
"@angular/common": "~20.3.10",
|
|
49
|
+
"@angular/compiler": "~20.3.10",
|
|
50
|
+
"@angular/core": "~20.3.10",
|
|
51
|
+
"@angular/forms": "~20.3.10",
|
|
52
|
+
"@angular/platform-browser": "~20.3.10",
|
|
53
|
+
"@angular/platform-browser-dynamic": "~20.3.10",
|
|
54
|
+
"@angular/platform-server": "~20.3.10",
|
|
55
|
+
"@angular/router": "~20.3.10",
|
|
56
|
+
"@apollo/client": "^3.12.9",
|
|
57
|
+
"@ngx-translate/core": "~15.0.0",
|
|
58
|
+
"@ngx-translate/http-loader": "~8.0.0",
|
|
59
|
+
"@sitecore-jss/sitecore-jss-angular": "<%- version %>",
|
|
60
|
+
"apollo-angular": "~11.0.0",
|
|
61
|
+
"bootstrap": "^5.3.3",
|
|
62
|
+
"core-js": "~3.45.0",
|
|
63
|
+
"graphql": "~16.11.0",
|
|
64
|
+
"graphql-tag": "^2.12.6",
|
|
65
|
+
"rxjs": "~7.8.2",
|
|
66
|
+
"tslib": "^2.8.1",
|
|
67
|
+
"zone.js": "~0.15.0",
|
|
68
|
+
"reflect-metadata": "^0.2.2"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@angular-builders/custom-webpack": "^20.0.0",
|
|
72
|
+
"@angular-devkit/build-angular": "^20.3.9",
|
|
73
|
+
"@angular-eslint/builder": "^20.5.1",
|
|
74
|
+
"@angular-eslint/eslint-plugin": "^20.5.1",
|
|
75
|
+
"@angular-eslint/eslint-plugin-template": "^20.5.1",
|
|
76
|
+
"@angular-eslint/schematics": "^20.5.1",
|
|
77
|
+
"@angular-eslint/template-parser": "^20.5.1",
|
|
78
|
+
"@angular/cli": "~20.3.9",
|
|
79
|
+
"@angular/compiler-cli": "~20.3.10",
|
|
80
|
+
"@angular/language-service": "~20.3.10",
|
|
81
|
+
"@sitecore-jss/sitecore-jss-angular-schematics": "<%- version %>",
|
|
82
|
+
"@sitecore-jss/sitecore-jss-cli": "<%- version %>",
|
|
83
|
+
"@sitecore-jss/sitecore-jss-dev-tools": "<%- version %>",
|
|
84
|
+
"@types/jasmine": "~3.6.7",
|
|
85
|
+
"@types/node": "~22.9.0",
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^8.14.0",
|
|
87
|
+
"@typescript-eslint/parser": "^8.14.0",
|
|
88
|
+
"chalk": "~4.1.0",
|
|
89
|
+
"chokidar": "^4.0.3",
|
|
90
|
+
"codelyzer": "~6.0.1",
|
|
91
|
+
"constant-case": "^3.0.4",
|
|
92
|
+
"cross-env": "~7.0.3",
|
|
93
|
+
"del-cli": "^5.0.0",
|
|
94
|
+
"dotenv": "^17.2.1",
|
|
95
|
+
"dotenv-webpack": "^8.1.1",
|
|
96
|
+
"eslint": "^8.56.0",
|
|
97
|
+
"eslint-plugin-import": "2.29.1",
|
|
98
|
+
"eslint-plugin-jsdoc": "48.7.0",
|
|
99
|
+
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
100
|
+
"jasmine-core": "~3.7.1",
|
|
101
|
+
"jasmine-spec-reporter": "~6.0.0",
|
|
102
|
+
"karma": "^6.3.2",
|
|
103
|
+
"karma-chrome-launcher": "~3.1.0",
|
|
104
|
+
"karma-cli": "~2.0.0",
|
|
105
|
+
"karma-coverage-istanbul-reporter": "~3.0.3",
|
|
106
|
+
"karma-jasmine": "~4.0.1",
|
|
107
|
+
"karma-jasmine-html-reporter": "~1.5.4",
|
|
108
|
+
"move-cli": "^2.0.0",
|
|
109
|
+
"npm-run-all2": "^7.0.1",
|
|
110
|
+
"ts-node": "~10.9.2",
|
|
111
|
+
"typescript": "~5.8.0"
|
|
112
|
+
},
|
|
113
|
+
"overrides": {
|
|
114
|
+
"request": {
|
|
115
|
+
"form-data": "^2.5.5"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -28,6 +28,7 @@ export const components = [
|
|
|
28
28
|
@NgModule({
|
|
29
29
|
imports: [
|
|
30
30
|
AppComponentsSharedModule,
|
|
31
|
+
${declarations.join('\n ')}
|
|
31
32
|
JssModule.withComponents([
|
|
32
33
|
${registrations.join('\n ')}
|
|
33
34
|
], [
|
|
@@ -38,9 +39,6 @@ export const components = [
|
|
|
38
39
|
JssModule,
|
|
39
40
|
AppComponentsSharedModule,
|
|
40
41
|
],
|
|
41
|
-
declarations: [
|
|
42
|
-
${declarations.join('\n ')}
|
|
43
|
-
],
|
|
44
42
|
})
|
|
45
43
|
export class AppComponentsModule { }
|
|
46
44
|
`;
|
|
@@ -5,6 +5,7 @@ import 'reflect-metadata';
|
|
|
5
5
|
import 'zone.js';
|
|
6
6
|
import { JssRouteBuilderService } from './src/app/routing/jss-route-builder.service';
|
|
7
7
|
import { AppServerModule, renderModule } from './src/main.server';
|
|
8
|
+
import { JSS_SERVER_LAYOUT_DATA, JSS_SERVER_VIEWBAG } from './src/app/injection-tokens';
|
|
8
9
|
|
|
9
10
|
export * from './src/main.server';
|
|
10
11
|
|
|
@@ -73,8 +74,8 @@ function renderView(
|
|
|
73
74
|
url: path,
|
|
74
75
|
extraProviders: [
|
|
75
76
|
// custom injection with the initial state that SSR should utilize
|
|
76
|
-
{ provide:
|
|
77
|
-
{ provide:
|
|
77
|
+
{ provide: JSS_SERVER_LAYOUT_DATA, useValue: transferState },
|
|
78
|
+
{ provide: JSS_SERVER_VIEWBAG, useValue: state.viewBag },
|
|
78
79
|
],
|
|
79
80
|
})
|
|
80
81
|
.then((html) => callback(null, { html }))
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { Component, OnDestroy } from '@angular/core';
|
|
1
|
+
import { Component, OnDestroy, OnInit, inject } from '@angular/core';
|
|
2
2
|
import { TranslateService } from '@ngx-translate/core';
|
|
3
3
|
import { JssContextService } from './jss-context.service';
|
|
4
4
|
import { Subscription } from 'rxjs';
|
|
5
5
|
|
|
6
6
|
@Component({
|
|
7
7
|
selector: 'app-root',
|
|
8
|
-
templateUrl: './app.component.html'
|
|
8
|
+
templateUrl: './app.component.html',
|
|
9
|
+
/* eslint-disable-next-line @angular-eslint/prefer-standalone */
|
|
10
|
+
standalone: false,
|
|
9
11
|
})
|
|
10
|
-
export class AppComponent implements OnDestroy {
|
|
12
|
+
export class AppComponent implements OnInit, OnDestroy {
|
|
11
13
|
private contextSubscription: Subscription;
|
|
14
|
+
private translate = inject(TranslateService);
|
|
15
|
+
private jssContextService = inject(JssContextService);
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
jssContextService: JssContextService,
|
|
16
|
-
) {
|
|
17
|
-
this.contextSubscription = jssContextService.state.subscribe(jssState => {
|
|
17
|
+
ngOnInit() {
|
|
18
|
+
this.contextSubscription = this.jssContextService.state.subscribe((jssState: { language: string }) => {
|
|
18
19
|
// listen for language changes
|
|
19
20
|
if (jssState.language) {
|
|
20
|
-
translate.use(jssState.language);
|
|
21
|
+
this.translate.use(jssState.language);
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
}
|
|
@@ -13,6 +13,9 @@ import { JssMetaService } from './jss-meta.service';
|
|
|
13
13
|
import { JssContextService } from './jss-context.service';
|
|
14
14
|
|
|
15
15
|
@NgModule({
|
|
16
|
+
declarations: [
|
|
17
|
+
AppComponent,
|
|
18
|
+
],
|
|
16
19
|
imports: [
|
|
17
20
|
HttpClientModule,
|
|
18
21
|
GraphQLModule,
|
|
@@ -37,7 +40,6 @@ import { JssContextService } from './jss-context.service';
|
|
|
37
40
|
// the Sitecore Experience Editor will not work correctly when a base tag is used.
|
|
38
41
|
{ provide: APP_BASE_HREF, useValue: '/' },
|
|
39
42
|
],
|
|
40
|
-
declarations: [AppComponent],
|
|
41
43
|
bootstrap: [AppComponent],
|
|
42
44
|
})
|
|
43
45
|
export class AppModule {}
|
|
@@ -7,6 +7,8 @@ import { AppComponent } from './app.component';
|
|
|
7
7
|
import { JssContextService } from './jss-context.service';
|
|
8
8
|
import { JssContextServerSideService } from './jss-context.server-side.service';
|
|
9
9
|
import { JssTranslationServerLoaderService } from './i18n/jss-translation-server-loader.service';
|
|
10
|
+
import { JSS_SERVER_VIEWBAG } from './injection-tokens';
|
|
11
|
+
import { ViewBag } from './ViewBag';
|
|
10
12
|
|
|
11
13
|
@NgModule({
|
|
12
14
|
imports: [
|
|
@@ -19,13 +21,10 @@ import { JssTranslationServerLoaderService } from './i18n/jss-translation-server
|
|
|
19
21
|
loader: {
|
|
20
22
|
provide: TranslateLoader,
|
|
21
23
|
useFactory: (
|
|
22
|
-
ssrViewBag:
|
|
23
|
-
[key: string]: unknown;
|
|
24
|
-
dictionary: { [key: string]: string };
|
|
25
|
-
},
|
|
24
|
+
ssrViewBag: ViewBag,
|
|
26
25
|
transferState: TransferState
|
|
27
26
|
) => new JssTranslationServerLoaderService(ssrViewBag, transferState),
|
|
28
|
-
deps: [
|
|
27
|
+
deps: [JSS_SERVER_VIEWBAG, TransferState],
|
|
29
28
|
},
|
|
30
29
|
}),
|
|
31
30
|
],
|