@keycloakify/angular 0.0.8 → 0.0.9
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/bin/338.index.js +27 -11
- package/bin/758.index.js +27 -11
- package/bin/main.js +7 -0
- package/package.json +14 -14
- package/src/bin/update-kc-gen.ts +143 -124
package/bin/338.index.js
CHANGED
|
@@ -251,20 +251,24 @@ function runFormat(params) {
|
|
|
251
251
|
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
252
252
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(928);
|
|
253
253
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
|
254
|
-
/* harmony import */ var
|
|
254
|
+
/* harmony import */ var _tools_runFormat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49);
|
|
255
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(982);
|
|
256
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_2__);
|
|
257
|
+
|
|
255
258
|
|
|
256
259
|
|
|
257
260
|
|
|
258
261
|
function command(params) {
|
|
259
262
|
const { buildContext } = params;
|
|
260
263
|
const filePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.themeSrcDirPath, 'kc.gen.ts');
|
|
261
|
-
const currentContent = fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(filePath)
|
|
262
|
-
? fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath)
|
|
263
|
-
: undefined;
|
|
264
264
|
const implementedThemeTypes = ['login', 'account'].filter(themeType => buildContext.implementedThemeTypes[themeType].isImplemented);
|
|
265
|
-
const newContent =
|
|
265
|
+
const newContent = [
|
|
266
|
+
``,
|
|
267
|
+
`/* eslint-disable */`,
|
|
268
|
+
``,
|
|
269
|
+
`// @ts-nocheck`,
|
|
266
270
|
``,
|
|
267
|
-
`//
|
|
271
|
+
`// noinspection JSUnusedGlobalSymbols`,
|
|
268
272
|
``,
|
|
269
273
|
`import type { ComponentRef, EnvironmentProviders, Type } from "@angular/core";`,
|
|
270
274
|
``,
|
|
@@ -289,7 +293,6 @@ function command(params) {
|
|
|
289
293
|
`}`,
|
|
290
294
|
``,
|
|
291
295
|
`type ApplicationRefLike = {`,
|
|
292
|
-
` // eslint-disable-next-line @typescript-eslint/no-explicit-any`,
|
|
293
296
|
` components: ComponentRef<any>[];`,
|
|
294
297
|
`};`,
|
|
295
298
|
``,
|
|
@@ -364,12 +367,25 @@ function command(params) {
|
|
|
364
367
|
` }`,
|
|
365
368
|
`}`,
|
|
366
369
|
``
|
|
367
|
-
].join('\n')
|
|
368
|
-
|
|
370
|
+
].join('\n');
|
|
371
|
+
const hash = crypto__WEBPACK_IMPORTED_MODULE_2__.createHash('sha256').update(newContent).digest('hex');
|
|
372
|
+
skip_if_no_changes: {
|
|
373
|
+
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(filePath)) {
|
|
374
|
+
break skip_if_no_changes;
|
|
375
|
+
}
|
|
376
|
+
const currentContent = fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath).toString('utf8');
|
|
377
|
+
if (!currentContent.includes(hash)) {
|
|
378
|
+
break skip_if_no_changes;
|
|
379
|
+
}
|
|
369
380
|
return;
|
|
370
381
|
}
|
|
371
|
-
fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(filePath,
|
|
372
|
-
|
|
382
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(filePath, Buffer.from([
|
|
383
|
+
`// This file is auto-generated by keycloakify. Do not edit it manually.`,
|
|
384
|
+
`// Hash: ${hash}`,
|
|
385
|
+
``,
|
|
386
|
+
newContent
|
|
387
|
+
].join('\n'), 'utf8'));
|
|
388
|
+
(0,_tools_runFormat__WEBPACK_IMPORTED_MODULE_3__/* .runFormat */ .J)({ packageJsonFilePath: buildContext.packageJsonFilePath });
|
|
373
389
|
}
|
|
374
390
|
|
|
375
391
|
|
package/bin/758.index.js
CHANGED
|
@@ -79,20 +79,24 @@ function runFormat(params) {
|
|
|
79
79
|
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
80
80
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(928);
|
|
81
81
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
|
82
|
-
/* harmony import */ var
|
|
82
|
+
/* harmony import */ var _tools_runFormat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49);
|
|
83
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(982);
|
|
84
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_2__);
|
|
85
|
+
|
|
83
86
|
|
|
84
87
|
|
|
85
88
|
|
|
86
89
|
function command(params) {
|
|
87
90
|
const { buildContext } = params;
|
|
88
91
|
const filePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.themeSrcDirPath, 'kc.gen.ts');
|
|
89
|
-
const currentContent = fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(filePath)
|
|
90
|
-
? fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath)
|
|
91
|
-
: undefined;
|
|
92
92
|
const implementedThemeTypes = ['login', 'account'].filter(themeType => buildContext.implementedThemeTypes[themeType].isImplemented);
|
|
93
|
-
const newContent =
|
|
93
|
+
const newContent = [
|
|
94
|
+
``,
|
|
95
|
+
`/* eslint-disable */`,
|
|
96
|
+
``,
|
|
97
|
+
`// @ts-nocheck`,
|
|
94
98
|
``,
|
|
95
|
-
`//
|
|
99
|
+
`// noinspection JSUnusedGlobalSymbols`,
|
|
96
100
|
``,
|
|
97
101
|
`import type { ComponentRef, EnvironmentProviders, Type } from "@angular/core";`,
|
|
98
102
|
``,
|
|
@@ -117,7 +121,6 @@ function command(params) {
|
|
|
117
121
|
`}`,
|
|
118
122
|
``,
|
|
119
123
|
`type ApplicationRefLike = {`,
|
|
120
|
-
` // eslint-disable-next-line @typescript-eslint/no-explicit-any`,
|
|
121
124
|
` components: ComponentRef<any>[];`,
|
|
122
125
|
`};`,
|
|
123
126
|
``,
|
|
@@ -192,12 +195,25 @@ function command(params) {
|
|
|
192
195
|
` }`,
|
|
193
196
|
`}`,
|
|
194
197
|
``
|
|
195
|
-
].join('\n')
|
|
196
|
-
|
|
198
|
+
].join('\n');
|
|
199
|
+
const hash = crypto__WEBPACK_IMPORTED_MODULE_2__.createHash('sha256').update(newContent).digest('hex');
|
|
200
|
+
skip_if_no_changes: {
|
|
201
|
+
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(filePath)) {
|
|
202
|
+
break skip_if_no_changes;
|
|
203
|
+
}
|
|
204
|
+
const currentContent = fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath).toString('utf8');
|
|
205
|
+
if (!currentContent.includes(hash)) {
|
|
206
|
+
break skip_if_no_changes;
|
|
207
|
+
}
|
|
197
208
|
return;
|
|
198
209
|
}
|
|
199
|
-
fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(filePath,
|
|
200
|
-
|
|
210
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(filePath, Buffer.from([
|
|
211
|
+
`// This file is auto-generated by keycloakify. Do not edit it manually.`,
|
|
212
|
+
`// Hash: ${hash}`,
|
|
213
|
+
``,
|
|
214
|
+
newContent
|
|
215
|
+
].join('\n'), 'utf8'));
|
|
216
|
+
(0,_tools_runFormat__WEBPACK_IMPORTED_MODULE_3__/* .runFormat */ .J)({ packageJsonFilePath: buildContext.packageJsonFilePath });
|
|
201
217
|
}
|
|
202
218
|
|
|
203
219
|
|
package/bin/main.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keycloakify/angular",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"keycloakify": "^11.3.
|
|
5
|
+
"keycloakify": "^11.3.11",
|
|
6
6
|
"@angular/core": "^18.0.0",
|
|
7
7
|
"@angular/common": "^18.0.0",
|
|
8
8
|
"@angular/platform-browser": "^18.0.0"
|
|
@@ -231,6 +231,12 @@
|
|
|
231
231
|
"esm": "./esm2022/login/classes/component-reference/keycloakify-angular-login-classes-component-reference.mjs",
|
|
232
232
|
"default": "./fesm2022/keycloakify-angular-login-classes-component-reference.mjs"
|
|
233
233
|
},
|
|
234
|
+
"./login/containers/template": {
|
|
235
|
+
"types": "./login/containers/template/index.d.ts",
|
|
236
|
+
"esm2022": "./esm2022/login/containers/template/keycloakify-angular-login-containers-template.mjs",
|
|
237
|
+
"esm": "./esm2022/login/containers/template/keycloakify-angular-login-containers-template.mjs",
|
|
238
|
+
"default": "./fesm2022/keycloakify-angular-login-containers-template.mjs"
|
|
239
|
+
},
|
|
234
240
|
"./login/components/add-remove-buttons-multi-valued-attribute": {
|
|
235
241
|
"types": "./login/components/add-remove-buttons-multi-valued-attribute/index.d.ts",
|
|
236
242
|
"esm2022": "./esm2022/login/components/add-remove-buttons-multi-valued-attribute/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs",
|
|
@@ -297,24 +303,12 @@
|
|
|
297
303
|
"esm": "./esm2022/login/components/user-profile-form-fields/keycloakify-angular-login-components-user-profile-form-fields.mjs",
|
|
298
304
|
"default": "./fesm2022/keycloakify-angular-login-components-user-profile-form-fields.mjs"
|
|
299
305
|
},
|
|
300
|
-
"./login/containers/template": {
|
|
301
|
-
"types": "./login/containers/template/index.d.ts",
|
|
302
|
-
"esm2022": "./esm2022/login/containers/template/keycloakify-angular-login-containers-template.mjs",
|
|
303
|
-
"esm": "./esm2022/login/containers/template/keycloakify-angular-login-containers-template.mjs",
|
|
304
|
-
"default": "./fesm2022/keycloakify-angular-login-containers-template.mjs"
|
|
305
|
-
},
|
|
306
306
|
"./login/directives/kc-class": {
|
|
307
307
|
"types": "./login/directives/kc-class/index.d.ts",
|
|
308
308
|
"esm2022": "./esm2022/login/directives/kc-class/keycloakify-angular-login-directives-kc-class.mjs",
|
|
309
309
|
"esm": "./esm2022/login/directives/kc-class/keycloakify-angular-login-directives-kc-class.mjs",
|
|
310
310
|
"default": "./fesm2022/keycloakify-angular-login-directives-kc-class.mjs"
|
|
311
311
|
},
|
|
312
|
-
"./login/providers/keycloakify-angular": {
|
|
313
|
-
"types": "./login/providers/keycloakify-angular/index.d.ts",
|
|
314
|
-
"esm2022": "./esm2022/login/providers/keycloakify-angular/keycloakify-angular-login-providers-keycloakify-angular.mjs",
|
|
315
|
-
"esm": "./esm2022/login/providers/keycloakify-angular/keycloakify-angular-login-providers-keycloakify-angular.mjs",
|
|
316
|
-
"default": "./fesm2022/keycloakify-angular-login-providers-keycloakify-angular.mjs"
|
|
317
|
-
},
|
|
318
312
|
"./login/pages/code": {
|
|
319
313
|
"types": "./login/pages/code/index.d.ts",
|
|
320
314
|
"esm2022": "./esm2022/login/pages/code/keycloakify-angular-login-pages-code.mjs",
|
|
@@ -531,6 +525,12 @@
|
|
|
531
525
|
"esm": "./esm2022/login/pages/webauthn-register/keycloakify-angular-login-pages-webauthn-register.mjs",
|
|
532
526
|
"default": "./fesm2022/keycloakify-angular-login-pages-webauthn-register.mjs"
|
|
533
527
|
},
|
|
528
|
+
"./login/providers/keycloakify-angular": {
|
|
529
|
+
"types": "./login/providers/keycloakify-angular/index.d.ts",
|
|
530
|
+
"esm2022": "./esm2022/login/providers/keycloakify-angular/keycloakify-angular-login-providers-keycloakify-angular.mjs",
|
|
531
|
+
"esm": "./esm2022/login/providers/keycloakify-angular/keycloakify-angular-login-providers-keycloakify-angular.mjs",
|
|
532
|
+
"default": "./fesm2022/keycloakify-angular-login-providers-keycloakify-angular.mjs"
|
|
533
|
+
},
|
|
534
534
|
"./login/services/i18n": {
|
|
535
535
|
"types": "./login/services/i18n/index.d.ts",
|
|
536
536
|
"esm2022": "./esm2022/login/services/i18n/keycloakify-angular-login-services-i18n.mjs",
|
package/src/bin/update-kc-gen.ts
CHANGED
|
@@ -2,145 +2,164 @@ import type { BuildContext } from './core';
|
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import { join as pathJoin } from 'path';
|
|
4
4
|
import { runFormat } from './tools/runFormat';
|
|
5
|
+
import * as crypto from 'crypto';
|
|
5
6
|
|
|
6
7
|
export function command(params: { buildContext: BuildContext }) {
|
|
7
8
|
const { buildContext } = params;
|
|
8
9
|
|
|
9
10
|
const filePath = pathJoin(buildContext.themeSrcDirPath, 'kc.gen.ts');
|
|
10
11
|
|
|
11
|
-
const currentContent = fs.existsSync(filePath)
|
|
12
|
-
? fs.readFileSync(filePath)
|
|
13
|
-
: undefined;
|
|
14
|
-
|
|
15
12
|
const implementedThemeTypes = (['login', 'account'] as const).filter(
|
|
16
13
|
themeType => buildContext.implementedThemeTypes[themeType].isImplemented
|
|
17
14
|
);
|
|
18
15
|
|
|
19
|
-
const newContent =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
2
|
|
42
|
-
)};`,
|
|
43
|
-
``,
|
|
44
|
-
`export type KcContext =`,
|
|
45
|
-
...implementedThemeTypes.map(
|
|
46
|
-
themeType => ` | import("./${themeType}/KcContext").KcContext`
|
|
47
|
-
),
|
|
48
|
-
` ;`,
|
|
49
|
-
``,
|
|
50
|
-
`declare global {`,
|
|
51
|
-
` interface Window {`,
|
|
52
|
-
` kcContext?: KcContext;`,
|
|
53
|
-
` }`,
|
|
54
|
-
`}`,
|
|
55
|
-
``,
|
|
56
|
-
`type ApplicationRefLike = {`,
|
|
57
|
-
` // eslint-disable-next-line @typescript-eslint/no-explicit-any`,
|
|
58
|
-
` components: ComponentRef<any>[];`,
|
|
59
|
-
`};`,
|
|
60
|
-
``,
|
|
61
|
-
`export async function bootstrapKcApplication(params: {`,
|
|
62
|
-
` kcContext: KcContext;`,
|
|
63
|
-
` bootstrapApplication: (params: {`,
|
|
64
|
-
` KcRootComponent: Type<unknown>;`,
|
|
65
|
-
` kcProvider: EnvironmentProviders;`,
|
|
66
|
-
` }) => Promise<ApplicationRefLike>;`,
|
|
67
|
-
`}) {`,
|
|
68
|
-
` const { kcContext, bootstrapApplication } = params;`,
|
|
69
|
-
``,
|
|
70
|
-
` switch (kcContext.themeType) {`,
|
|
71
|
-
...(['login', 'account'] as const)
|
|
72
|
-
.filter(
|
|
73
|
-
themeType =>
|
|
74
|
-
buildContext.implementedThemeTypes[themeType].isImplemented
|
|
16
|
+
const newContent = [
|
|
17
|
+
``,
|
|
18
|
+
`/* eslint-disable */`,
|
|
19
|
+
``,
|
|
20
|
+
`// @ts-nocheck`,
|
|
21
|
+
``,
|
|
22
|
+
`// noinspection JSUnusedGlobalSymbols`,
|
|
23
|
+
``,
|
|
24
|
+
`import type { ComponentRef, EnvironmentProviders, Type } from "@angular/core";`,
|
|
25
|
+
``,
|
|
26
|
+
`export type ThemeName = ${buildContext.themeNames.map(themeName => `"${themeName}"`).join(' | ')};`,
|
|
27
|
+
``,
|
|
28
|
+
`export const themeNames: ThemeName[] = [${buildContext.themeNames.map(themeName => `"${themeName}"`).join(', ')}];`,
|
|
29
|
+
``,
|
|
30
|
+
`export type KcEnvName = ${buildContext.environmentVariables.length === 0 ? 'never' : buildContext.environmentVariables.map(({ name }) => `"${name}"`).join(' | ')};`,
|
|
31
|
+
``,
|
|
32
|
+
`export const kcEnvNames: KcEnvName[] = [${buildContext.environmentVariables.map(({ name }) => `"${name}"`).join(', ')}];`,
|
|
33
|
+
``,
|
|
34
|
+
`export const kcEnvDefaults: Record<KcEnvName, string> = ${JSON.stringify(
|
|
35
|
+
Object.fromEntries(
|
|
36
|
+
buildContext.environmentVariables.map(
|
|
37
|
+
({ name, default: defaultValue }) => [name, defaultValue]
|
|
75
38
|
)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
39
|
+
),
|
|
40
|
+
null,
|
|
41
|
+
2
|
|
42
|
+
)};`,
|
|
43
|
+
``,
|
|
44
|
+
`export type KcContext =`,
|
|
45
|
+
...implementedThemeTypes.map(
|
|
46
|
+
themeType => ` | import("./${themeType}/KcContext").KcContext`
|
|
47
|
+
),
|
|
48
|
+
` ;`,
|
|
49
|
+
``,
|
|
50
|
+
`declare global {`,
|
|
51
|
+
` interface Window {`,
|
|
52
|
+
` kcContext?: KcContext;`,
|
|
53
|
+
` }`,
|
|
54
|
+
`}`,
|
|
55
|
+
``,
|
|
56
|
+
`type ApplicationRefLike = {`,
|
|
57
|
+
` components: ComponentRef<any>[];`,
|
|
58
|
+
`};`,
|
|
59
|
+
``,
|
|
60
|
+
`export async function bootstrapKcApplication(params: {`,
|
|
61
|
+
` kcContext: KcContext;`,
|
|
62
|
+
` bootstrapApplication: (params: {`,
|
|
63
|
+
` KcRootComponent: Type<unknown>;`,
|
|
64
|
+
` kcProvider: EnvironmentProviders;`,
|
|
65
|
+
` }) => Promise<ApplicationRefLike>;`,
|
|
66
|
+
`}) {`,
|
|
67
|
+
` const { kcContext, bootstrapApplication } = params;`,
|
|
68
|
+
``,
|
|
69
|
+
` switch (kcContext.themeType) {`,
|
|
70
|
+
...(['login', 'account'] as const)
|
|
71
|
+
.filter(
|
|
72
|
+
themeType => buildContext.implementedThemeTypes[themeType].isImplemented
|
|
73
|
+
)
|
|
74
|
+
.map(themeType => [
|
|
75
|
+
` case "${themeType}":`,
|
|
76
|
+
` {`,
|
|
77
|
+
` const [`,
|
|
78
|
+
` { provideKeycloakifyAngular },`,
|
|
79
|
+
` { getI18n },`,
|
|
80
|
+
` {`,
|
|
81
|
+
` PageComponent,`,
|
|
82
|
+
` TemplateComponent,`,
|
|
83
|
+
` doUseDefaultCss,`,
|
|
84
|
+
` classes,`,
|
|
85
|
+
...(themeType === 'login'
|
|
86
|
+
? [
|
|
87
|
+
` UserProfileFormFieldsComponent,`,
|
|
88
|
+
` doMakeUserConfirmPassword,`
|
|
89
|
+
]
|
|
90
|
+
: []),
|
|
91
|
+
` },`,
|
|
92
|
+
` ] = await Promise.all([`,
|
|
93
|
+
` import('@keycloakify/angular/login/providers/keycloakify-angular'),`,
|
|
94
|
+
` import('./${themeType}/i18n'),`,
|
|
95
|
+
` import('./${themeType}/KcPage').then(({ getKcPage }) => getKcPage(kcContext.pageId)),`,
|
|
96
|
+
` ] as const);`,
|
|
97
|
+
``,
|
|
98
|
+
` const appRef = await bootstrapApplication({`,
|
|
99
|
+
` KcRootComponent: TemplateComponent,`,
|
|
100
|
+
` kcProvider: provideKeycloakifyAngular({`,
|
|
101
|
+
` kcContext,`,
|
|
102
|
+
` classes,`,
|
|
103
|
+
` getI18n,`,
|
|
104
|
+
` doUseDefaultCss,`,
|
|
105
|
+
...(themeType === 'login'
|
|
106
|
+
? [` doMakeUserConfirmPassword,`]
|
|
107
|
+
: []),
|
|
108
|
+
` })`,
|
|
109
|
+
` });`,
|
|
110
|
+
``,
|
|
111
|
+
` appRef.components.forEach(componentRef => {`,
|
|
112
|
+
` if ("page" in componentRef.instance) {`,
|
|
113
|
+
` componentRef.setInput("page", PageComponent);`,
|
|
114
|
+
` }`,
|
|
115
|
+
...(themeType === 'login'
|
|
116
|
+
? [
|
|
117
|
+
` if ("userProfileFormFields" in componentRef.instance) {`,
|
|
118
|
+
` componentRef.setInput(`,
|
|
119
|
+
` "userProfileFormFields",`,
|
|
120
|
+
` UserProfileFormFieldsComponent`,
|
|
121
|
+
` );`,
|
|
122
|
+
` }`
|
|
123
|
+
]
|
|
124
|
+
: []),
|
|
125
|
+
` });`,
|
|
126
|
+
` }`,
|
|
127
|
+
` break;`
|
|
128
|
+
])
|
|
129
|
+
.flat(),
|
|
130
|
+
` }`,
|
|
131
|
+
`}`,
|
|
132
|
+
``
|
|
133
|
+
].join('\n');
|
|
134
|
+
|
|
135
|
+
const hash = crypto.createHash('sha256').update(newContent).digest('hex');
|
|
136
|
+
|
|
137
|
+
skip_if_no_changes: {
|
|
138
|
+
if (!fs.existsSync(filePath)) {
|
|
139
|
+
break skip_if_no_changes;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const currentContent = fs.readFileSync(filePath).toString('utf8');
|
|
143
|
+
|
|
144
|
+
if (!currentContent.includes(hash)) {
|
|
145
|
+
break skip_if_no_changes;
|
|
146
|
+
}
|
|
138
147
|
|
|
139
|
-
if (currentContent !== undefined && currentContent.equals(newContent)) {
|
|
140
148
|
return;
|
|
141
149
|
}
|
|
142
150
|
|
|
143
|
-
fs.writeFileSync(
|
|
151
|
+
fs.writeFileSync(
|
|
152
|
+
filePath,
|
|
153
|
+
Buffer.from(
|
|
154
|
+
[
|
|
155
|
+
`// This file is auto-generated by keycloakify. Do not edit it manually.`,
|
|
156
|
+
`// Hash: ${hash}`,
|
|
157
|
+
``,
|
|
158
|
+
newContent
|
|
159
|
+
].join('\n'),
|
|
160
|
+
'utf8'
|
|
161
|
+
)
|
|
162
|
+
);
|
|
144
163
|
|
|
145
164
|
runFormat({ packageJsonFilePath: buildContext.packageJsonFilePath });
|
|
146
165
|
}
|