keycloakify 11.6.1 → 11.7.0

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.
Files changed (96) hide show
  1. package/bin/{653.index.js → 288.index.js} +221 -201
  2. package/bin/313.index.js +377 -0
  3. package/bin/{174.index.js → 33.index.js} +37 -2
  4. package/bin/{615.index.js → 355.index.js} +353 -102
  5. package/bin/363.index.js +1537 -0
  6. package/bin/453.index.js +6 -42
  7. package/bin/{503.index.js → 678.index.js} +577 -53
  8. package/bin/{921.index.js → 780.index.js} +54 -45
  9. package/bin/880.index.js +206 -21
  10. package/bin/9.index.js +850 -0
  11. package/bin/{525.index.js → 911.index.js} +1302 -2
  12. package/bin/930.index.js +164 -0
  13. package/bin/946.index.js +20 -0
  14. package/bin/{153.index.js → 947.index.js} +22 -797
  15. package/bin/main.js +61 -19
  16. package/bin/{eject-file.d.ts → own.d.ts} +2 -1
  17. package/bin/shared/{addPostinstallScriptIfNotPresent.d.ts → initializeSpa/addSyncExtensionsToPostinstallScript.d.ts} +1 -1
  18. package/bin/shared/initializeSpa/index.d.ts +1 -0
  19. package/bin/shared/initializeSpa/initializeSpa.d.ts +9 -0
  20. package/bin/{postinstall/uiModuleMeta.d.ts → sync-extensions/extensionModuleMeta.d.ts} +5 -5
  21. package/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.d.ts +12 -0
  22. package/bin/sync-extensions/index.d.ts +1 -0
  23. package/bin/{postinstall/installUiModulesPeerDependencies.d.ts → sync-extensions/installExtensionModulesPeerDependencies.d.ts} +3 -3
  24. package/bin/{postinstall → sync-extensions}/managedGitignoreFile.d.ts +4 -4
  25. package/bin/tools/getInstalledModuleDirPath.d.ts +0 -1
  26. package/bin/tools/isKnownByGit.d.ts +3 -0
  27. package/bin/tools/isRootPath.d.ts +1 -0
  28. package/bin/tools/listInstalledModules.d.ts +0 -1
  29. package/package.json +41 -63
  30. package/src/bin/eject-page.ts +8 -84
  31. package/src/bin/initialize-account-theme/initialize-account-theme.ts +15 -14
  32. package/src/bin/initialize-admin-theme.ts +17 -124
  33. package/src/bin/initialize-email-theme.ts +10 -34
  34. package/src/bin/keycloakify/generateResources/generateResources.ts +49 -21
  35. package/src/bin/main.ts +61 -16
  36. package/src/bin/own.ts +208 -0
  37. package/src/bin/shared/{addPostinstallScriptIfNotPresent.ts → initializeSpa/addSyncExtensionsToPostinstallScript.ts} +4 -4
  38. package/src/bin/shared/initializeSpa/index.ts +1 -0
  39. package/src/bin/shared/initializeSpa/initializeSpa.ts +149 -0
  40. package/src/bin/{postinstall/uiModuleMeta.ts → sync-extensions/extensionModuleMeta.ts} +48 -43
  41. package/src/bin/{postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts → sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts} +32 -21
  42. package/src/bin/sync-extensions/index.ts +1 -0
  43. package/src/bin/{postinstall/installUiModulesPeerDependencies.ts → sync-extensions/installExtensionModulesPeerDependencies.ts} +15 -13
  44. package/src/bin/{postinstall → sync-extensions}/managedGitignoreFile.ts +18 -18
  45. package/src/bin/{postinstall/postinstall.ts → sync-extensions/sync-extension.ts} +14 -26
  46. package/src/bin/tools/getInstalledModuleDirPath.ts +24 -22
  47. package/src/bin/tools/isKnownByGit.ts +45 -0
  48. package/src/bin/tools/isRootPath.ts +22 -0
  49. package/src/bin/tools/listInstalledModules.ts +4 -6
  50. package/src/bin/tools/npmInstall.ts +1 -1
  51. package/src/bin/tools/untrackFromGit.ts +19 -3
  52. package/src/bin/tsconfig.json +1 -1
  53. package/bin/300.index.js +0 -770
  54. package/bin/375.index.js +0 -4089
  55. package/bin/490.index.js +0 -1108
  56. package/bin/568.index.js +0 -1867
  57. package/bin/735.index.js +0 -907
  58. package/bin/743.index.js +0 -69
  59. package/bin/854.index.js +0 -68
  60. package/bin/initialize-account-theme/copyBoilerplate.d.ts +0 -4
  61. package/bin/initialize-account-theme/initializeAccountTheme_multiPage.d.ts +0 -3
  62. package/bin/initialize-account-theme/initializeAccountTheme_singlePage.d.ts +0 -11
  63. package/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.d.ts +0 -12
  64. package/bin/postinstall/index.d.ts +0 -1
  65. package/bin/shared/getLatestsSemVersionedTag.d.ts +0 -15
  66. package/bin/shared/promptKeycloakVersion.d.ts +0 -10
  67. package/bin/tools/OptionalIfCanBeUndefined.d.ts +0 -14
  68. package/bin/tools/crc32.d.ts +0 -9
  69. package/bin/tools/deflate.d.ts +0 -24
  70. package/bin/tools/isTrackedByGit.d.ts +0 -3
  71. package/bin/tools/octokit-addons/getLatestsSemVersionedTag.d.ts +0 -15
  72. package/bin/tools/octokit-addons/listTags.d.ts +0 -13
  73. package/bin/tools/tee.d.ts +0 -3
  74. package/bin/tools/trimIndent.d.ts +0 -5
  75. package/src/bin/eject-file.ts +0 -68
  76. package/src/bin/initialize-account-theme/copyBoilerplate.ts +0 -32
  77. package/src/bin/initialize-account-theme/initializeAccountTheme_multiPage.ts +0 -21
  78. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +0 -142
  79. package/src/bin/initialize-account-theme/src/single-page/KcContext.ts +0 -7
  80. package/src/bin/initialize-account-theme/src/single-page/KcPage.tsx +0 -11
  81. package/src/bin/postinstall/index.ts +0 -1
  82. package/src/bin/shared/getLatestsSemVersionedTag.ts +0 -201
  83. package/src/bin/shared/promptKeycloakVersion.ts +0 -72
  84. package/src/bin/tools/OptionalIfCanBeUndefined.ts +0 -12
  85. package/src/bin/tools/crc32.ts +0 -73
  86. package/src/bin/tools/deflate.ts +0 -61
  87. package/src/bin/tools/isTrackedByGit.ts +0 -29
  88. package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +0 -47
  89. package/src/bin/tools/octokit-addons/listTags.ts +0 -60
  90. package/src/bin/tools/tee.ts +0 -39
  91. package/src/bin/tools/trimIndent.ts +0 -49
  92. /package/bin/{postinstall/postinstall.d.ts → sync-extensions/sync-extension.d.ts} +0 -0
  93. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcContext.ts +0 -0
  94. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPage.tsx +0 -0
  95. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPageStory.tsx +0 -0
  96. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/i18n.ts +0 -0
package/bin/main.js CHANGED
@@ -16201,7 +16201,7 @@ program
16201
16201
  .task({
16202
16202
  skip,
16203
16203
  handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
16204
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(174), __nccwpck_require__.e(525), __nccwpck_require__.e(568), __nccwpck_require__.e(503), __nccwpck_require__.e(153)]).then(__nccwpck_require__.bind(__nccwpck_require__, 43153));
16204
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(33), __nccwpck_require__.e(911), __nccwpck_require__.e(678), __nccwpck_require__.e(9), __nccwpck_require__.e(947)]).then(__nccwpck_require__.bind(__nccwpck_require__, 32947));
16205
16205
  await command({
16206
16206
  buildContext: getBuildContext({ projectDirPath }),
16207
16207
  cliCommandOptions: {
@@ -16244,7 +16244,7 @@ program
16244
16244
  .task({
16245
16245
  skip,
16246
16246
  handler: async ({ projectDirPath }) => {
16247
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(174), __nccwpck_require__.e(525), __nccwpck_require__.e(375), __nccwpck_require__.e(568), __nccwpck_require__.e(490)]).then(__nccwpck_require__.bind(__nccwpck_require__, 23490));
16247
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(911), __nccwpck_require__.e(9), __nccwpck_require__.e(313)]).then(__nccwpck_require__.bind(__nccwpck_require__, 16932));
16248
16248
  await command({ buildContext: getBuildContext({ projectDirPath }) });
16249
16249
  }
16250
16250
  });
@@ -16256,7 +16256,7 @@ program
16256
16256
  .task({
16257
16257
  skip,
16258
16258
  handler: async ({ projectDirPath }) => {
16259
- const { command } = await __nccwpck_require__.e(/* import() */ 921).then(__nccwpck_require__.bind(__nccwpck_require__, 21921));
16259
+ const { command } = await __nccwpck_require__.e(/* import() */ 780).then(__nccwpck_require__.bind(__nccwpck_require__, 75780));
16260
16260
  await command({ buildContext: getBuildContext({ projectDirPath }) });
16261
16261
  }
16262
16262
  });
@@ -16268,7 +16268,7 @@ program
16268
16268
  .task({
16269
16269
  skip,
16270
16270
  handler: async ({ projectDirPath }) => {
16271
- const { command } = await __nccwpck_require__.e(/* import() */ 615).then(__nccwpck_require__.bind(__nccwpck_require__, 61615));
16271
+ const { command } = await __nccwpck_require__.e(/* import() */ 355).then(__nccwpck_require__.bind(__nccwpck_require__, 60355));
16272
16272
  await command({ buildContext: getBuildContext({ projectDirPath }) });
16273
16273
  }
16274
16274
  });
@@ -16298,44 +16298,86 @@ program
16298
16298
  });
16299
16299
  program
16300
16300
  .command({
16301
- name: "postinstall",
16302
- description: "Initialize all the Keycloakify UI modules installed in the project."
16301
+ name: "sync-extensions",
16302
+ description: [
16303
+ "Synchronizes all installed Keycloakify extension modules with your project.",
16304
+ "",
16305
+ "Example of extension modules: '@keycloakify/keycloak-account-ui', '@keycloakify/keycloak-admin-ui', '@keycloakify/keycloak-ui-shared'",
16306
+ "",
16307
+ "This command ensures that:",
16308
+ "- All required files from installed extensions are copied into your project.",
16309
+ "- The copied files are correctly ignored by Git to help you distinguish between your custom source files",
16310
+ " and those provided by the extensions.",
16311
+ "- Peer dependencies declared by the extensions are automatically added to your package.json.",
16312
+ "",
16313
+ "You can safely run this command multiple times. It will only update the files and dependencies if needed,",
16314
+ "ensuring your project stays in sync with the installed extensions.",
16315
+ "",
16316
+ "Typical usage:",
16317
+ "- Should be run as a postinstall script of your project.",
16318
+ ""
16319
+ ].join("\n")
16303
16320
  })
16304
16321
  .task({
16305
16322
  skip,
16306
16323
  handler: async ({ projectDirPath }) => {
16307
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(174), __nccwpck_require__.e(300), __nccwpck_require__.e(653)]).then(__nccwpck_require__.bind(__nccwpck_require__, 2653));
16324
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(33), __nccwpck_require__.e(363), __nccwpck_require__.e(946)]).then(__nccwpck_require__.bind(__nccwpck_require__, 74946));
16308
16325
  await command({ buildContext: getBuildContext({ projectDirPath }) });
16309
16326
  }
16310
16327
  });
16311
16328
  program
16312
16329
  .command({
16313
- name: "eject-file",
16330
+ name: "own",
16314
16331
  description: [
16315
- "WARNING: Not usable yet, will be used for future features",
16316
- "Take ownership over a given file"
16317
- ].join(" ")
16332
+ "Manages ownership of auto-generated files provided by Keycloakify extensions.",
16333
+ "",
16334
+ "This command allows you to take ownership of a specific file or directory generated",
16335
+ "by an extension. Once owned, you can freely modify and version-control the file.",
16336
+ "",
16337
+ "You can also use the --revert flag to relinquish ownership and restore the file",
16338
+ "or directory to its original auto-generated state.",
16339
+ "",
16340
+ "For convenience, the exact command to take ownership of any file is included as a comment",
16341
+ "in the header of each extension-generated file.",
16342
+ "",
16343
+ "Examples:",
16344
+ "$ npx keycloakify own --path admin/KcPage.tsx"
16345
+ ].join("\n")
16318
16346
  })
16319
16347
  .option({
16320
- key: "file",
16348
+ key: "path",
16321
16349
  name: (() => {
16322
- const long = "file";
16323
- const short = "f";
16350
+ const long = "path";
16351
+ const short = "p";
16324
16352
  optionsKeys.push(long, short);
16325
16353
  return { long, short };
16326
16354
  })(),
16327
16355
  description: [
16328
- "Relative path of the file relative to the directory of your keycloak theme source",
16329
- "Example `--file src/login/page/Login.tsx`"
16356
+ "Specifies the relative path of the file or directory to take ownership of.",
16357
+ "This path should be relative to your theme directory.",
16358
+ "Example: `--path 'admin/KcPage.tsx'`"
16330
16359
  ].join(" ")
16360
+ })
16361
+ .option({
16362
+ key: "revert",
16363
+ name: (() => {
16364
+ const name = "revert";
16365
+ optionsKeys.push(name);
16366
+ return name;
16367
+ })(),
16368
+ description: [
16369
+ "Restores a file or directory to its original auto-generated state,",
16370
+ "removing your ownership claim and reverting any modifications."
16371
+ ].join(" "),
16372
+ defaultValue: false
16331
16373
  })
16332
16374
  .task({
16333
16375
  skip,
16334
- handler: async ({ projectDirPath, file }) => {
16335
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(300), __nccwpck_require__.e(854)]).then(__nccwpck_require__.bind(__nccwpck_require__, 85854));
16376
+ handler: async ({ projectDirPath, path, revert }) => {
16377
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(33), __nccwpck_require__.e(363), __nccwpck_require__.e(930)]).then(__nccwpck_require__.bind(__nccwpck_require__, 71930));
16336
16378
  await command({
16337
16379
  buildContext: getBuildContext({ projectDirPath }),
16338
- cliCommandOptions: { file }
16380
+ cliCommandOptions: { path, isRevert: revert }
16339
16381
  });
16340
16382
  }
16341
16383
  });
@@ -2,6 +2,7 @@ import type { BuildContext } from "./shared/buildContext";
2
2
  export declare function command(params: {
3
3
  buildContext: BuildContext;
4
4
  cliCommandOptions: {
5
- file: string;
5
+ path: string;
6
+ isRevert: boolean;
6
7
  };
7
8
  }): Promise<void>;
@@ -2,7 +2,7 @@ export type BuildContextLike = {
2
2
  projectDirPath: string;
3
3
  packageJsonFilePath: string;
4
4
  };
5
- export declare function addPostinstallScriptIfNotPresent(params: {
5
+ export declare function addSyncExtensionsToPostinstallScript(params: {
6
6
  parsedPackageJson: {
7
7
  scripts?: Record<string, string | undefined>;
8
8
  };
@@ -0,0 +1 @@
1
+ export * from "./initializeSpa";
@@ -0,0 +1,9 @@
1
+ import { type BuildContextLike as BuildContextLike_addSyncExtensionsToPostinstallScript } from "./addSyncExtensionsToPostinstallScript";
2
+ export type BuildContextLike = BuildContextLike_addSyncExtensionsToPostinstallScript & {
3
+ themeSrcDirPath: string;
4
+ packageJsonFilePath: string;
5
+ };
6
+ export declare function initializeSpa(params: {
7
+ themeType: "account" | "admin";
8
+ buildContext: BuildContextLike;
9
+ }): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
- import { type BuildContextLike as BuildContextLike_getUiModuleFileSourceCodeReadyToBeCopied } from "./getUiModuleFileSourceCodeReadyToBeCopied";
3
- export type UiModuleMeta = {
2
+ import { type BuildContextLike as BuildContextLike_getExtensionModuleFileSourceCodeReadyToBeCopied } from "./getExtensionModuleFileSourceCodeReadyToBeCopied";
3
+ export type ExtensionModuleMeta = {
4
4
  moduleName: string;
5
5
  version: string;
6
6
  files: {
@@ -10,12 +10,12 @@ export type UiModuleMeta = {
10
10
  }[];
11
11
  peerDependencies: Record<string, string>;
12
12
  };
13
- export type BuildContextLike = BuildContextLike_getUiModuleFileSourceCodeReadyToBeCopied & {
13
+ export type BuildContextLike = BuildContextLike_getExtensionModuleFileSourceCodeReadyToBeCopied & {
14
14
  cacheDirPath: string;
15
15
  packageJsonFilePath: string;
16
16
  projectDirPath: string;
17
17
  };
18
- export declare function getUiModuleMetas(params: {
18
+ export declare function getExtensionModuleMetas(params: {
19
19
  buildContext: BuildContextLike;
20
- }): Promise<UiModuleMeta[]>;
20
+ }): Promise<ExtensionModuleMeta[]>;
21
21
  export declare function computeHash(data: Buffer): string;
@@ -0,0 +1,12 @@
1
+ /// <reference types="node" />
2
+ export type BuildContextLike = {
3
+ themeSrcDirPath: string;
4
+ };
5
+ export declare function getExtensionModuleFileSourceCodeReadyToBeCopied(params: {
6
+ buildContext: BuildContextLike;
7
+ fileRelativePath: string;
8
+ isOwnershipAction: boolean;
9
+ extensionModuleDirPath: string;
10
+ extensionModuleName: string;
11
+ extensionModuleVersion: string;
12
+ }): Promise<Buffer>;
@@ -0,0 +1 @@
1
+ export * from "./sync-extension";
@@ -1,11 +1,11 @@
1
1
  export type BuildContextLike = {
2
2
  packageJsonFilePath: string;
3
3
  };
4
- export type UiModuleMetaLike = {
4
+ export type ExtensionModuleMetaLike = {
5
5
  moduleName: string;
6
6
  peerDependencies: Record<string, string>;
7
7
  };
8
- export declare function installUiModulesPeerDependencies(params: {
8
+ export declare function installExtensionModulesPeerDependencies(params: {
9
9
  buildContext: BuildContextLike;
10
- uiModuleMetas: UiModuleMetaLike[];
10
+ extensionModuleMetas: ExtensionModuleMetaLike[];
11
11
  }): Promise<void | never>;
@@ -1,14 +1,14 @@
1
- import type { UiModuleMeta } from "./uiModuleMeta";
1
+ import type { ExtensionModuleMeta } from "./extensionModuleMeta";
2
2
  export type BuildContextLike = {
3
3
  themeSrcDirPath: string;
4
4
  };
5
5
  export declare function writeManagedGitignoreFile(params: {
6
6
  buildContext: BuildContextLike;
7
- uiModuleMetas: UiModuleMeta[];
8
- ejectedFilesRelativePaths: string[];
7
+ extensionModuleMetas: ExtensionModuleMeta[];
8
+ ownedFilesRelativePaths: string[];
9
9
  }): Promise<void>;
10
10
  export declare function readManagedGitignoreFile(params: {
11
11
  buildContext: BuildContextLike;
12
12
  }): Promise<{
13
- ejectedFilesRelativePaths: string[];
13
+ ownedFilesRelativePaths: string[];
14
14
  }>;
@@ -1,5 +1,4 @@
1
1
  export declare function getInstalledModuleDirPath(params: {
2
2
  moduleName: string;
3
3
  packageJsonDirPath: string;
4
- projectDirPath: string;
5
4
  }): Promise<string>;
@@ -0,0 +1,3 @@
1
+ export declare function getIsKnownByGit(params: {
2
+ filePath: string;
3
+ }): Promise<boolean>;
@@ -0,0 +1 @@
1
+ export declare function getIsRootPath(filePath: string): boolean;
@@ -1,6 +1,5 @@
1
1
  export declare function listInstalledModules(params: {
2
2
  packageJsonFilePath: string;
3
- projectDirPath: string;
4
3
  filter: (params: {
5
4
  moduleName: string;
6
5
  }) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "11.6.1",
3
+ "version": "11.7.0",
4
4
  "description": "Framework to create custom Keycloak UIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -647,19 +647,13 @@
647
647
  "src/account/pages/Totp.tsx",
648
648
  "src/bin/add-story.ts",
649
649
  "src/bin/copy-keycloak-resources-to-public.ts",
650
- "src/bin/eject-file.ts",
651
650
  "src/bin/eject-page.ts",
652
- "src/bin/initialize-account-theme/copyBoilerplate.ts",
653
651
  "src/bin/initialize-account-theme/index.ts",
654
652
  "src/bin/initialize-account-theme/initialize-account-theme.ts",
655
- "src/bin/initialize-account-theme/initializeAccountTheme_multiPage.ts",
656
- "src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts",
657
- "src/bin/initialize-account-theme/src/multi-page/KcContext.ts",
658
- "src/bin/initialize-account-theme/src/multi-page/KcPage.tsx",
659
- "src/bin/initialize-account-theme/src/multi-page/KcPageStory.tsx",
660
- "src/bin/initialize-account-theme/src/multi-page/i18n.ts",
661
- "src/bin/initialize-account-theme/src/single-page/KcContext.ts",
662
- "src/bin/initialize-account-theme/src/single-page/KcPage.tsx",
653
+ "src/bin/initialize-account-theme/multi-page-boilerplate/KcContext.ts",
654
+ "src/bin/initialize-account-theme/multi-page-boilerplate/KcPage.tsx",
655
+ "src/bin/initialize-account-theme/multi-page-boilerplate/KcPageStory.tsx",
656
+ "src/bin/initialize-account-theme/multi-page-boilerplate/i18n.ts",
663
657
  "src/bin/initialize-account-theme/updateAccountThemeImplementationInConfig.ts",
664
658
  "src/bin/initialize-admin-theme.ts",
665
659
  "src/bin/initialize-email-theme.ts",
@@ -685,22 +679,17 @@
685
679
  "src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts",
686
680
  "src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts",
687
681
  "src/bin/main.ts",
688
- "src/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts",
689
- "src/bin/postinstall/index.ts",
690
- "src/bin/postinstall/installUiModulesPeerDependencies.ts",
691
- "src/bin/postinstall/managedGitignoreFile.ts",
692
- "src/bin/postinstall/postinstall.ts",
693
- "src/bin/postinstall/uiModuleMeta.ts",
682
+ "src/bin/own.ts",
694
683
  "src/bin/shared/KeycloakVersionRange.ts",
695
- "src/bin/shared/addPostinstallScriptIfNotPresent.ts",
696
684
  "src/bin/shared/buildContext.ts",
697
685
  "src/bin/shared/constants.ts",
698
686
  "src/bin/shared/customHandler.ts",
699
687
  "src/bin/shared/customHandler_delegate.ts",
700
688
  "src/bin/shared/exitIfUncommittedChanges.ts",
701
- "src/bin/shared/getLatestsSemVersionedTag.ts",
689
+ "src/bin/shared/initializeSpa/addSyncExtensionsToPostinstallScript.ts",
690
+ "src/bin/shared/initializeSpa/index.ts",
691
+ "src/bin/shared/initializeSpa/initializeSpa.ts",
702
692
  "src/bin/shared/metaInfKeycloakThemes.ts",
703
- "src/bin/shared/promptKeycloakVersion.ts",
704
693
  "src/bin/start-keycloak/appBuild.ts",
705
694
  "src/bin/start-keycloak/getSupportedDockerImageTags.ts",
706
695
  "src/bin/start-keycloak/index.ts",
@@ -727,7 +716,12 @@
727
716
  "src/bin/start-keycloak/realmConfig/realmConfig.ts",
728
717
  "src/bin/start-keycloak/start-keycloak.ts",
729
718
  "src/bin/start-keycloak/startViteDevServer.ts",
730
- "src/bin/tools/OptionalIfCanBeUndefined.ts",
719
+ "src/bin/sync-extensions/extensionModuleMeta.ts",
720
+ "src/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts",
721
+ "src/bin/sync-extensions/index.ts",
722
+ "src/bin/sync-extensions/installExtensionModulesPeerDependencies.ts",
723
+ "src/bin/sync-extensions/managedGitignoreFile.ts",
724
+ "src/bin/sync-extensions/sync-extension.ts",
731
725
  "src/bin/tools/SemVer.ts",
732
726
  "src/bin/tools/String.prototype.replaceAll.ts",
733
727
  "src/bin/tools/Stringifyable.ts",
@@ -735,9 +729,7 @@
735
729
  "src/bin/tools/canonicalStringify.ts",
736
730
  "src/bin/tools/crawl.ts",
737
731
  "src/bin/tools/crawlAsync.ts",
738
- "src/bin/tools/crc32.ts",
739
732
  "src/bin/tools/createObjectThatThrowsIfAccessed.ts",
740
- "src/bin/tools/deflate.ts",
741
733
  "src/bin/tools/downloadAndExtractArchive.ts",
742
734
  "src/bin/tools/escapeStringForPropertiesFile.ts",
743
735
  "src/bin/tools/extractArchive.ts",
@@ -749,19 +741,16 @@
749
741
  "src/bin/tools/getInstalledModuleDirPath.ts",
750
742
  "src/bin/tools/getThisCodebaseRootDirPath.ts",
751
743
  "src/bin/tools/isInside.ts",
752
- "src/bin/tools/isTrackedByGit.ts",
744
+ "src/bin/tools/isKnownByGit.ts",
745
+ "src/bin/tools/isRootPath.ts",
753
746
  "src/bin/tools/kebabCaseToSnakeCase.ts",
754
747
  "src/bin/tools/listInstalledModules.ts",
755
748
  "src/bin/tools/nodeModulesBinDirPath.ts",
756
749
  "src/bin/tools/npmInstall.ts",
757
- "src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts",
758
- "src/bin/tools/octokit-addons/listTags.ts",
759
750
  "src/bin/tools/partitionPromiseSettledResults.ts",
760
751
  "src/bin/tools/readThisNpmPackageVersion.ts",
761
752
  "src/bin/tools/runPrettier.ts",
762
- "src/bin/tools/tee.ts",
763
753
  "src/bin/tools/transformCodebase.ts",
764
- "src/bin/tools/trimIndent.ts",
765
754
  "src/bin/tools/untrackFromGit.ts",
766
755
  "src/bin/tsconfig.json",
767
756
  "src/bin/update-kc-gen.ts",
@@ -1036,13 +1025,9 @@
1036
1025
  "tools/waitForElementMountedOnDom.js.map",
1037
1026
  "bin/add-story.d.ts",
1038
1027
  "bin/copy-keycloak-resources-to-public.d.ts",
1039
- "bin/eject-file.d.ts",
1040
1028
  "bin/eject-page.d.ts",
1041
- "bin/initialize-account-theme/copyBoilerplate.d.ts",
1042
1029
  "bin/initialize-account-theme/index.d.ts",
1043
1030
  "bin/initialize-account-theme/initialize-account-theme.d.ts",
1044
- "bin/initialize-account-theme/initializeAccountTheme_multiPage.d.ts",
1045
- "bin/initialize-account-theme/initializeAccountTheme_singlePage.d.ts",
1046
1031
  "bin/initialize-account-theme/updateAccountThemeImplementationInConfig.d.ts",
1047
1032
  "bin/initialize-admin-theme.d.ts",
1048
1033
  "bin/initialize-email-theme.d.ts",
@@ -1067,22 +1052,17 @@
1067
1052
  "bin/keycloakify/replacers/replaceImportsInJsCode/vite.d.ts",
1068
1053
  "bin/keycloakify/replacers/replaceImportsInJsCode/webpack.d.ts",
1069
1054
  "bin/main.d.ts",
1070
- "bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.d.ts",
1071
- "bin/postinstall/index.d.ts",
1072
- "bin/postinstall/installUiModulesPeerDependencies.d.ts",
1073
- "bin/postinstall/managedGitignoreFile.d.ts",
1074
- "bin/postinstall/postinstall.d.ts",
1075
- "bin/postinstall/uiModuleMeta.d.ts",
1076
- "bin/shared/addPostinstallScriptIfNotPresent.d.ts",
1055
+ "bin/own.d.ts",
1077
1056
  "bin/shared/buildContext.d.ts",
1078
1057
  "bin/shared/constants.d.ts",
1079
1058
  "bin/shared/customHandler_delegate.d.ts",
1080
1059
  "bin/shared/customHandler.d.ts",
1081
1060
  "bin/shared/exitIfUncommittedChanges.d.ts",
1082
- "bin/shared/getLatestsSemVersionedTag.d.ts",
1061
+ "bin/shared/initializeSpa/addSyncExtensionsToPostinstallScript.d.ts",
1062
+ "bin/shared/initializeSpa/index.d.ts",
1063
+ "bin/shared/initializeSpa/initializeSpa.d.ts",
1083
1064
  "bin/shared/KeycloakVersionRange.d.ts",
1084
1065
  "bin/shared/metaInfKeycloakThemes.d.ts",
1085
- "bin/shared/promptKeycloakVersion.d.ts",
1086
1066
  "bin/start-keycloak/appBuild.d.ts",
1087
1067
  "bin/start-keycloak/getSupportedDockerImageTags.d.ts",
1088
1068
  "bin/start-keycloak/index.d.ts",
@@ -1099,13 +1079,17 @@
1099
1079
  "bin/start-keycloak/realmConfig/realmConfig.d.ts",
1100
1080
  "bin/start-keycloak/start-keycloak.d.ts",
1101
1081
  "bin/start-keycloak/startViteDevServer.d.ts",
1082
+ "bin/sync-extensions/extensionModuleMeta.d.ts",
1083
+ "bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.d.ts",
1084
+ "bin/sync-extensions/index.d.ts",
1085
+ "bin/sync-extensions/installExtensionModulesPeerDependencies.d.ts",
1086
+ "bin/sync-extensions/managedGitignoreFile.d.ts",
1087
+ "bin/sync-extensions/sync-extension.d.ts",
1102
1088
  "bin/tools/assertNoPnpmDlx.d.ts",
1103
1089
  "bin/tools/canonicalStringify.d.ts",
1104
1090
  "bin/tools/crawl.d.ts",
1105
1091
  "bin/tools/crawlAsync.d.ts",
1106
- "bin/tools/crc32.d.ts",
1107
1092
  "bin/tools/createObjectThatThrowsIfAccessed.d.ts",
1108
- "bin/tools/deflate.d.ts",
1109
1093
  "bin/tools/downloadAndExtractArchive.d.ts",
1110
1094
  "bin/tools/escapeStringForPropertiesFile.d.ts",
1111
1095
  "bin/tools/extractArchive.d.ts",
@@ -1117,50 +1101,44 @@
1117
1101
  "bin/tools/getInstalledModuleDirPath.d.ts",
1118
1102
  "bin/tools/getThisCodebaseRootDirPath.d.ts",
1119
1103
  "bin/tools/isInside.d.ts",
1120
- "bin/tools/isTrackedByGit.d.ts",
1104
+ "bin/tools/isKnownByGit.d.ts",
1105
+ "bin/tools/isRootPath.d.ts",
1121
1106
  "bin/tools/kebabCaseToSnakeCase.d.ts",
1122
1107
  "bin/tools/listInstalledModules.d.ts",
1123
1108
  "bin/tools/nodeModulesBinDirPath.d.ts",
1124
1109
  "bin/tools/npmInstall.d.ts",
1125
- "bin/tools/octokit-addons/getLatestsSemVersionedTag.d.ts",
1126
- "bin/tools/octokit-addons/listTags.d.ts",
1127
- "bin/tools/OptionalIfCanBeUndefined.d.ts",
1128
1110
  "bin/tools/partitionPromiseSettledResults.d.ts",
1129
1111
  "bin/tools/readThisNpmPackageVersion.d.ts",
1130
1112
  "bin/tools/runPrettier.d.ts",
1131
1113
  "bin/tools/SemVer.d.ts",
1132
1114
  "bin/tools/String.prototype.replaceAll.d.ts",
1133
1115
  "bin/tools/Stringifyable.d.ts",
1134
- "bin/tools/tee.d.ts",
1135
1116
  "bin/tools/transformCodebase.d.ts",
1136
- "bin/tools/trimIndent.d.ts",
1137
1117
  "bin/tools/untrackFromGit.d.ts",
1138
1118
  "bin/update-kc-gen.d.ts",
1139
1119
  "bin/main.js",
1140
- "bin/153.index.js",
1141
- "bin/174.index.js",
1142
1120
  "bin/266.index.js",
1143
- "bin/300.index.js",
1121
+ "bin/288.index.js",
1144
1122
  "bin/304.index.js",
1145
- "bin/375.index.js",
1123
+ "bin/313.index.js",
1124
+ "bin/33.index.js",
1125
+ "bin/355.index.js",
1126
+ "bin/363.index.js",
1146
1127
  "bin/40.index.js",
1147
1128
  "bin/453.index.js",
1148
- "bin/490.index.js",
1149
- "bin/503.index.js",
1150
- "bin/525.index.js",
1151
- "bin/568.index.js",
1152
- "bin/615.index.js",
1153
- "bin/653.index.js",
1154
1129
  "bin/658.index.js",
1130
+ "bin/678.index.js",
1155
1131
  "bin/720.index.js",
1156
- "bin/735.index.js",
1157
- "bin/743.index.js",
1132
+ "bin/780.index.js",
1158
1133
  "bin/783.index.js",
1159
1134
  "bin/786.index.js",
1160
- "bin/854.index.js",
1161
1135
  "bin/877.index.js",
1162
1136
  "bin/880.index.js",
1163
- "bin/921.index.js",
1137
+ "bin/9.index.js",
1138
+ "bin/911.index.js",
1139
+ "bin/930.index.js",
1140
+ "bin/946.index.js",
1141
+ "bin/947.index.js",
1164
1142
  "bin/97.index.js",
1165
1143
  "bin/shared/constants.js",
1166
1144
  "bin/shared/constants.js.map",
@@ -11,12 +11,7 @@ import {
11
11
  } from "./shared/constants";
12
12
  import { capitalize } from "tsafe/capitalize";
13
13
  import * as fs from "fs";
14
- import {
15
- join as pathJoin,
16
- relative as pathRelative,
17
- dirname as pathDirname,
18
- basename as pathBasename
19
- } from "path";
14
+ import { join as pathJoin, relative as pathRelative, dirname as pathDirname } from "path";
20
15
  import { kebabCaseToCamelCase } from "./tools/kebabCaseToSnakeCase";
21
16
  import { assert, Equals } from "tsafe/assert";
22
17
  import type { BuildContext } from "./shared/buildContext";
@@ -67,9 +62,7 @@ export async function command(params: { buildContext: BuildContext }) {
67
62
  })();
68
63
 
69
64
  if (themeType === "admin") {
70
- console.log(
71
- "Use `npx keycloakify eject-file` command instead, see documentation"
72
- );
65
+ console.log("Use `npx keycloakify own` command instead, see documentation");
73
66
 
74
67
  process.exit(-1);
75
68
  }
@@ -79,85 +72,16 @@ export async function command(params: { buildContext: BuildContext }) {
79
72
  (assert(buildContext.implementedThemeTypes.account.isImplemented),
80
73
  buildContext.implementedThemeTypes.account.type === "Single-Page")
81
74
  ) {
82
- const srcDirPath = pathJoin(
83
- pathDirname(buildContext.packageJsonFilePath),
84
- "node_modules",
85
- "@keycloakify",
86
- `keycloak-account-ui`,
87
- "src"
88
- );
89
-
90
75
  console.log(
91
- [
92
- `There isn't an interactive CLI to eject components of the Account SPA UI.`,
93
- `You can however copy paste into your codebase the any file or directory from the following source directory:`,
94
- ``,
95
- `${chalk.bold(pathJoin(pathRelative(process.cwd(), srcDirPath)))}`,
96
- ``
97
- ].join("\n")
98
- );
99
-
100
- eject_entrypoint: {
101
- const kcUiTsxFileRelativePath = `KcAccountUi.tsx` as const;
102
-
103
- const themeSrcDirPath = pathJoin(buildContext.themeSrcDirPath, "account");
104
-
105
- const targetFilePath = pathJoin(themeSrcDirPath, kcUiTsxFileRelativePath);
106
-
107
- if (fs.existsSync(targetFilePath)) {
108
- break eject_entrypoint;
109
- }
110
-
111
- fs.cpSync(pathJoin(srcDirPath, kcUiTsxFileRelativePath), targetFilePath);
112
-
113
- {
114
- const kcPageTsxFilePath = pathJoin(themeSrcDirPath, "KcPage.tsx");
115
-
116
- const kcPageTsxCode = fs.readFileSync(kcPageTsxFilePath).toString("utf8");
117
-
118
- const componentName = pathBasename(kcUiTsxFileRelativePath).replace(
119
- /.tsx$/,
120
- ""
121
- );
122
-
123
- let modifiedKcPageTsxCode = kcPageTsxCode.replace(
124
- `@keycloakify/keycloak-account-ui/${componentName}`,
125
- `./${componentName}`
126
- );
127
-
128
- run_prettier: {
129
- if (!(await getIsPrettierAvailable())) {
130
- break run_prettier;
131
- }
132
-
133
- modifiedKcPageTsxCode = await runPrettier({
134
- filePath: kcPageTsxFilePath,
135
- sourceCode: modifiedKcPageTsxCode
136
- });
137
- }
138
-
139
- fs.writeFileSync(
140
- kcPageTsxFilePath,
141
- Buffer.from(modifiedKcPageTsxCode, "utf8")
142
- );
143
- }
144
-
145
- const routesTsxFilePath = pathRelative(
146
- process.cwd(),
147
- pathJoin(srcDirPath, "routes.tsx")
148
- );
149
-
150
- console.log(
76
+ chalk.yellow(
151
77
  [
152
- `To help you get started ${chalk.bold(pathRelative(process.cwd(), targetFilePath))} has been copied into your project.`,
153
- `The next step is usually to eject ${chalk.bold(routesTsxFilePath)}`,
154
- `with \`cp ${routesTsxFilePath} ${pathRelative(process.cwd(), themeSrcDirPath)}\``,
155
- `then update the import of routes in ${kcUiTsxFileRelativePath}.`
78
+ "You are implementing a Single-Page Account theme.",
79
+ "The eject-page command isn't applicable in this context"
156
80
  ].join("\n")
157
- );
158
- }
81
+ )
82
+ );
159
83
 
160
- process.exit(0);
84
+ process.exit(1);
161
85
  return;
162
86
  }
163
87