@keycloakify/angular 21.0.0-rc.3 → 21.0.0-rc.4

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/671.index.js CHANGED
@@ -908,6 +908,7 @@ async function command(params) {
908
908
  }
909
909
  return (0,external_path_.join)('pages', pageIdOrComponent.replace(/\.ftl$/, ''));
910
910
  })();
911
+ let hasEjectedUserProfileFormFieldsComponent = false;
911
912
  {
912
913
  const componentDirRelativeToThemeTypePaths = [
913
914
  componentDirRelativeToThemeTypePath
@@ -915,6 +916,10 @@ async function command(params) {
915
916
  while (componentDirRelativeToThemeTypePaths.length !== 0) {
916
917
  const componentDirRelativeToThemeTypePath_i = componentDirRelativeToThemeTypePaths.pop();
917
918
  (0,assert/* assert */.v)(componentDirRelativeToThemeTypePath_i !== undefined);
919
+ if (componentDirRelativeToThemeTypePath_i ===
920
+ (0,external_path_.join)('components', 'user-profile-form-fields')) {
921
+ hasEjectedUserProfileFormFieldsComponent = true;
922
+ }
918
923
  const destDirPath = (0,external_path_.join)(buildContext.themeSrcDirPath, themeType, componentDirRelativeToThemeTypePath_i);
919
924
  const dirName = (0,external_path_.basename)(destDirPath);
920
925
  const tsFilePath = (0,external_path_.join)(destDirPath, `${dirName}.component.ts`);
@@ -994,12 +999,21 @@ async function command(params) {
994
999
  }
995
1000
  }
996
1001
  edit_KcFiles: {
997
- if (pageIdOrComponent !== templateValue &&
998
- pageIdOrComponent !== userProfileFormFieldsValue) {
1002
+ const componentRelativeDirPath_posix = (() => {
1003
+ if (pageIdOrComponent === templateValue) {
1004
+ return 'template';
1005
+ }
1006
+ if (pageIdOrComponent === userProfileFormFieldsValue ||
1007
+ hasEjectedUserProfileFormFieldsComponent) {
1008
+ return 'components/user-profile-form-fields';
1009
+ }
1010
+ return undefined;
1011
+ })();
1012
+ if (componentRelativeDirPath_posix === undefined) {
999
1013
  break edit_KcFiles;
1000
1014
  }
1001
1015
  const filesToProcess = ['KcPage.ts', 'KcPageStory.ts'];
1002
- for (let fileName of filesToProcess) {
1016
+ for (const fileName of filesToProcess) {
1003
1017
  const filePath = (0,external_path_.join)(buildContext.themeSrcDirPath, themeType, fileName);
1004
1018
  if (!external_fs_.existsSync(filePath)) {
1005
1019
  console.log(source/* default */.Ay.yellow(`${fileName} not found, skipping`));
@@ -1007,9 +1021,6 @@ async function command(params) {
1007
1021
  }
1008
1022
  const originalCode = external_fs_.readFileSync(filePath).toString('utf8');
1009
1023
  const modifiedCode = await (async () => {
1010
- const componentRelativeDirPath_posix = componentDirRelativeToThemeTypePath
1011
- .split(external_path_.sep)
1012
- .join('/');
1013
1024
  let sourceCode = originalCode.replace(`@keycloakify/angular/${themeType}/${componentRelativeDirPath_posix}`, componentRelativeDirPath_posix_to_componentRelativeFilePath_posix({
1014
1025
  componentRelativeDirPath_posix: `./${componentRelativeDirPath_posix}`
1015
1026
  }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@keycloakify/angular",
3
3
  "type": "module",
4
- "version": "21.0.0-rc.3",
4
+ "version": "21.0.0-rc.4",
5
5
  "peerDependencies": {
6
6
  "keycloakify": "^11.13.0",
7
7
  "@angular/core": "^21.0.0",
@@ -20,7 +20,7 @@ import {
20
20
  posix as pathPosix,
21
21
  basename as pathBase
22
22
  } from 'path';
23
- import { assert, Equals } from 'tsafe/assert';
23
+ import { assert, type Equals } from 'tsafe/assert';
24
24
  import chalk from 'chalk';
25
25
  import { transformCodebase } from './tools/transformCodebase_async';
26
26
  import { kebabCaseToCamelCase } from './tools/kebabCaseToSnakeCase';
@@ -129,6 +129,8 @@ export async function command(params: { buildContext: BuildContext }) {
129
129
  return pathJoin('pages', pageIdOrComponent.replace(/\.ftl$/, ''));
130
130
  })();
131
131
 
132
+ let hasEjectedUserProfileFormFieldsComponent = false;
133
+
132
134
  {
133
135
  const componentDirRelativeToThemeTypePaths = [
134
136
  componentDirRelativeToThemeTypePath
@@ -140,6 +142,13 @@ export async function command(params: { buildContext: BuildContext }) {
140
142
 
141
143
  assert(componentDirRelativeToThemeTypePath_i !== undefined);
142
144
 
145
+ if (
146
+ componentDirRelativeToThemeTypePath_i ===
147
+ pathJoin('components', 'user-profile-form-fields')
148
+ ) {
149
+ hasEjectedUserProfileFormFieldsComponent = true;
150
+ }
151
+
143
152
  const destDirPath = pathJoin(
144
153
  buildContext.themeSrcDirPath,
145
154
  themeType,
@@ -301,16 +310,28 @@ export async function command(params: { buildContext: BuildContext }) {
301
310
  }
302
311
 
303
312
  edit_KcFiles: {
304
- if (
305
- pageIdOrComponent !== templateValue &&
306
- pageIdOrComponent !== userProfileFormFieldsValue
307
- ) {
313
+ const componentRelativeDirPath_posix = (() => {
314
+ if (pageIdOrComponent === templateValue) {
315
+ return 'template';
316
+ }
317
+
318
+ if (
319
+ pageIdOrComponent === userProfileFormFieldsValue ||
320
+ hasEjectedUserProfileFormFieldsComponent
321
+ ) {
322
+ return 'components/user-profile-form-fields';
323
+ }
324
+
325
+ return undefined;
326
+ })();
327
+
328
+ if (componentRelativeDirPath_posix === undefined) {
308
329
  break edit_KcFiles;
309
330
  }
310
331
 
311
332
  const filesToProcess = ['KcPage.ts', 'KcPageStory.ts'];
312
333
 
313
- for (let fileName of filesToProcess) {
334
+ for (const fileName of filesToProcess) {
314
335
  const filePath = pathJoin(buildContext.themeSrcDirPath, themeType, fileName);
315
336
 
316
337
  if (!fs.existsSync(filePath)) {
@@ -321,10 +342,6 @@ export async function command(params: { buildContext: BuildContext }) {
321
342
  const originalCode = fs.readFileSync(filePath).toString('utf8');
322
343
 
323
344
  const modifiedCode = await (async () => {
324
- const componentRelativeDirPath_posix = componentDirRelativeToThemeTypePath
325
- .split(pathSep)
326
- .join('/');
327
-
328
345
  let sourceCode = originalCode.replace(
329
346
  `@keycloakify/angular/${themeType}/${componentRelativeDirPath_posix}`,
330
347
  componentRelativeDirPath_posix_to_componentRelativeFilePath_posix({