keycloakify 11.6.0 → 11.6.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.
Files changed (49) hide show
  1. package/bin/{805.index.js → 174.index.js} +111 -2
  2. package/bin/363.index.js +1528 -0
  3. package/bin/453.index.js +1 -1
  4. package/bin/{33.index.js → 568.index.js} +2 -113
  5. package/bin/735.index.js +53 -24
  6. package/bin/{653.index.js → 840.index.js} +387 -213
  7. package/bin/921.index.js +1 -1
  8. package/bin/930.index.js +165 -0
  9. package/bin/946.index.js +20 -0
  10. package/bin/initialize-admin-theme.d.ts +4 -0
  11. package/bin/main.js +72 -18
  12. package/bin/{eject-file.d.ts → own.d.ts} +2 -1
  13. package/bin/shared/addSyncExtensionsToPostinstallScript.d.ts +10 -0
  14. package/bin/shared/customHandler.d.ts +1 -1
  15. package/bin/shared/customHandler.js.map +1 -1
  16. package/bin/{postinstall/uiModuleMeta.d.ts → sync-extensions/extensionModuleMeta.d.ts} +5 -5
  17. package/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.d.ts +12 -0
  18. package/bin/sync-extensions/index.d.ts +1 -0
  19. package/bin/{postinstall/installUiModulesPeerDependencies.d.ts → sync-extensions/installExtensionModulesPeerDependencies.d.ts} +3 -3
  20. package/bin/{postinstall → sync-extensions}/managedGitignoreFile.d.ts +4 -4
  21. package/bin/tools/isKnownByGit.d.ts +3 -0
  22. package/bin/tools/npmInstall.d.ts +1 -1
  23. package/package.json +27 -22
  24. package/src/bin/eject-page.ts +1 -3
  25. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +3 -1
  26. package/src/bin/initialize-admin-theme.ts +146 -0
  27. package/src/bin/main.ts +76 -17
  28. package/src/bin/own.ts +209 -0
  29. package/src/bin/shared/addSyncExtensionsToPostinstallScript.ts +70 -0
  30. package/src/bin/shared/customHandler.ts +1 -0
  31. package/src/bin/{postinstall/uiModuleMeta.ts → sync-extensions/extensionModuleMeta.ts} +55 -43
  32. package/src/bin/{postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts → sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts} +32 -21
  33. package/src/bin/sync-extensions/index.ts +1 -0
  34. package/src/bin/{postinstall/installUiModulesPeerDependencies.ts → sync-extensions/installExtensionModulesPeerDependencies.ts} +16 -14
  35. package/src/bin/{postinstall → sync-extensions}/managedGitignoreFile.ts +18 -18
  36. package/src/bin/{postinstall/postinstall.ts → sync-extensions/sync-extension.ts} +14 -26
  37. package/src/bin/tools/isKnownByGit.ts +45 -0
  38. package/src/bin/tools/listInstalledModules.ts +2 -2
  39. package/src/bin/tools/npmInstall.ts +46 -9
  40. package/src/bin/tools/untrackFromGit.ts +19 -3
  41. package/bin/356.index.js +0 -755
  42. package/bin/854.index.js +0 -68
  43. package/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.d.ts +0 -12
  44. package/bin/postinstall/index.d.ts +0 -1
  45. package/bin/tools/isTrackedByGit.d.ts +0 -3
  46. package/src/bin/eject-file.ts +0 -68
  47. package/src/bin/postinstall/index.ts +0 -1
  48. package/src/bin/tools/isTrackedByGit.ts +0 -29
  49. /package/bin/{postinstall/postinstall.d.ts → sync-extensions/sync-extension.d.ts} +0 -0
package/bin/921.index.js CHANGED
@@ -160,7 +160,7 @@ async function command(params) {
160
160
  break;
161
161
  case "Single-Page":
162
162
  {
163
- const { initializeAccountTheme_singlePage } = await Promise.all(/* import() */[__webpack_require__.e(805), __webpack_require__.e(525), __webpack_require__.e(375), __webpack_require__.e(735)]).then(__webpack_require__.bind(__webpack_require__, 84735));
163
+ const { initializeAccountTheme_singlePage } = await Promise.all(/* import() */[__webpack_require__.e(174), __webpack_require__.e(525), __webpack_require__.e(375), __webpack_require__.e(735)]).then(__webpack_require__.bind(__webpack_require__, 84735));
164
164
  await initializeAccountTheme_singlePage({
165
165
  accountThemeSrcDirPath,
166
166
  buildContext
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ exports.id = 930;
3
+ exports.ids = [930];
4
+ exports.modules = {
5
+
6
+ /***/ 71930:
7
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
+
9
+ __webpack_require__.r(__webpack_exports__);
10
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
+ /* harmony export */ "command": () => (/* binding */ command)
12
+ /* harmony export */ });
13
+ /* harmony import */ var _sync_extensions_getExtensionModuleFileSourceCodeReadyToBeCopied__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2237);
14
+ /* harmony import */ var _sync_extensions_sync_extension__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28363);
15
+ /* harmony import */ var _sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69674);
16
+ /* harmony import */ var _sync_extensions_extensionModuleMeta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53090);
17
+ /* harmony import */ var _tools_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84794);
18
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71017);
19
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_5__);
20
+ /* harmony import */ var _tools_getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(21022);
21
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(73292);
22
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_7__);
23
+ /* harmony import */ var _tools_isInside__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90665);
24
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(78818);
25
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_9__);
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+ async function command(params) {
37
+ const { buildContext, cliCommandOptions } = params;
38
+ const extensionModuleMetas = await (0,_sync_extensions_extensionModuleMeta__WEBPACK_IMPORTED_MODULE_3__/* .getExtensionModuleMetas */ .f)({ buildContext });
39
+ const { targetFileRelativePathsByExtensionModuleMeta } = await (async () => {
40
+ const fileOrDirectoryRelativePath = (0,path__WEBPACK_IMPORTED_MODULE_5__.relative)(buildContext.themeSrcDirPath, (0,_tools_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_4__/* .getAbsoluteAndInOsFormatPath */ .c)({
41
+ cwd: buildContext.themeSrcDirPath,
42
+ pathIsh: cliCommandOptions.path
43
+ }));
44
+ const arr = extensionModuleMetas
45
+ .map(extensionModuleMeta => ({
46
+ extensionModuleMeta,
47
+ fileRelativePaths: extensionModuleMeta.files
48
+ .map(({ fileRelativePath }) => fileRelativePath)
49
+ .filter(fileRelativePath => fileRelativePath === fileOrDirectoryRelativePath ||
50
+ (0,_tools_isInside__WEBPACK_IMPORTED_MODULE_8__/* .isInside */ .V)({
51
+ dirPath: fileOrDirectoryRelativePath,
52
+ filePath: fileRelativePath
53
+ }))
54
+ }))
55
+ .filter(({ fileRelativePaths }) => fileRelativePaths.length !== 0);
56
+ const targetFileRelativePathsByExtensionModuleMeta = new Map();
57
+ for (const { extensionModuleMeta, fileRelativePaths } of arr) {
58
+ targetFileRelativePathsByExtensionModuleMeta.set(extensionModuleMeta, fileRelativePaths);
59
+ }
60
+ return { targetFileRelativePathsByExtensionModuleMeta };
61
+ })();
62
+ if (targetFileRelativePathsByExtensionModuleMeta.size === 0) {
63
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().yellow("There is no Keycloakify extension modules files matching the provided path."));
64
+ process.exit(1);
65
+ }
66
+ const { ownedFilesRelativePaths: ownedFilesRelativePaths_current } = await (0,_sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__/* .readManagedGitignoreFile */ .w)({
67
+ buildContext
68
+ });
69
+ await (cliCommandOptions.isRevert ? command_revert : command_own)({
70
+ extensionModuleMetas,
71
+ targetFileRelativePathsByExtensionModuleMeta,
72
+ ownedFilesRelativePaths_current,
73
+ buildContext
74
+ });
75
+ }
76
+ async function command_own(params) {
77
+ const { extensionModuleMetas, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
78
+ await (0,_sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFile */ .Y)({
79
+ buildContext,
80
+ extensionModuleMetas,
81
+ ownedFilesRelativePaths: [
82
+ ...ownedFilesRelativePaths_current,
83
+ ...Array.from(targetFileRelativePathsByExtensionModuleMeta.values())
84
+ .flat()
85
+ .filter(fileRelativePath => !ownedFilesRelativePaths_current.includes(fileRelativePath))
86
+ ]
87
+ });
88
+ const writeActions = [];
89
+ for (const [extensionModuleMeta, fileRelativePaths] of targetFileRelativePathsByExtensionModuleMeta.entries()) {
90
+ const extensionModuleDirPath = await (0,_tools_getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getInstalledModuleDirPath */ .p)({
91
+ moduleName: extensionModuleMeta.moduleName,
92
+ packageJsonDirPath: (0,path__WEBPACK_IMPORTED_MODULE_5__.dirname)(buildContext.packageJsonFilePath),
93
+ projectDirPath: buildContext.projectDirPath
94
+ });
95
+ for (const fileRelativePath of fileRelativePaths) {
96
+ if (ownedFilesRelativePaths_current.includes(fileRelativePath)) {
97
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().grey(`You already have ownership over '${fileRelativePath}'.`));
98
+ continue;
99
+ }
100
+ writeActions.push(async () => {
101
+ const sourceCode = await (0,_sync_extensions_getExtensionModuleFileSourceCodeReadyToBeCopied__WEBPACK_IMPORTED_MODULE_0__/* .getExtensionModuleFileSourceCodeReadyToBeCopied */ .p)({
102
+ buildContext,
103
+ fileRelativePath,
104
+ isOwnershipAction: true,
105
+ extensionModuleName: extensionModuleMeta.moduleName,
106
+ extensionModuleDirPath,
107
+ extensionModuleVersion: extensionModuleMeta.version
108
+ });
109
+ await fs_promises__WEBPACK_IMPORTED_MODULE_7__.writeFile((0,path__WEBPACK_IMPORTED_MODULE_5__.join)(buildContext.themeSrcDirPath, fileRelativePath), sourceCode);
110
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().green(`Ownership over '${fileRelativePath}' claimed.`));
111
+ });
112
+ }
113
+ }
114
+ if (writeActions.length === 0) {
115
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().yellow("No new file claimed."));
116
+ return;
117
+ }
118
+ await Promise.all(writeActions.map(action => action()));
119
+ }
120
+ async function command_revert(params) {
121
+ const { extensionModuleMetas, targetFileRelativePathsByExtensionModuleMeta, ownedFilesRelativePaths_current, buildContext } = params;
122
+ const ownedFilesRelativePaths_toRemove = Array.from(targetFileRelativePathsByExtensionModuleMeta.values())
123
+ .flat()
124
+ .filter(fileRelativePath => {
125
+ if (!ownedFilesRelativePaths_current.includes(fileRelativePath)) {
126
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().grey(`Ownership over '${fileRelativePath}' wasn't claimed.`));
127
+ return false;
128
+ }
129
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().green(`Ownership over '${fileRelativePath}' relinquished.`));
130
+ return true;
131
+ });
132
+ if (ownedFilesRelativePaths_toRemove.length === 0) {
133
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_9___default().yellow("No file relinquished."));
134
+ return;
135
+ }
136
+ await (0,_sync_extensions_managedGitignoreFile__WEBPACK_IMPORTED_MODULE_2__/* .writeManagedGitignoreFile */ .Y)({
137
+ buildContext,
138
+ extensionModuleMetas,
139
+ ownedFilesRelativePaths: ownedFilesRelativePaths_current.filter(fileRelativePath => !ownedFilesRelativePaths_toRemove.includes(fileRelativePath))
140
+ });
141
+ await (0,_sync_extensions_sync_extension__WEBPACK_IMPORTED_MODULE_1__/* .command */ .W)({ buildContext });
142
+ }
143
+ //# sourceMappingURL=own.js.map
144
+
145
+ /***/ }),
146
+
147
+ /***/ 90665:
148
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
149
+
150
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
151
+ /* harmony export */ "V": () => (/* binding */ isInside)
152
+ /* harmony export */ });
153
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
154
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
155
+
156
+ function isInside(params) {
157
+ const { dirPath, filePath } = params;
158
+ return !(0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(dirPath, filePath).startsWith("..");
159
+ }
160
+ //# sourceMappingURL=isInside.js.map
161
+
162
+ /***/ })
163
+
164
+ };
165
+ ;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ exports.id = 946;
3
+ exports.ids = [946];
4
+ exports.modules = {
5
+
6
+ /***/ 74946:
7
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
+
9
+ __webpack_require__.r(__webpack_exports__);
10
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
+ /* harmony export */ "command": () => (/* reexport safe */ _sync_extension__WEBPACK_IMPORTED_MODULE_0__.W)
12
+ /* harmony export */ });
13
+ /* harmony import */ var _sync_extension__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28363);
14
+
15
+ //# sourceMappingURL=index.js.map
16
+
17
+ /***/ })
18
+
19
+ };
20
+ ;
@@ -0,0 +1,4 @@
1
+ import type { BuildContext } from "./shared/buildContext";
2
+ export declare function command(params: {
3
+ buildContext: BuildContext;
4
+ }): Promise<void>;
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(805), __nccwpck_require__.e(525), __nccwpck_require__.e(33), __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(174), __nccwpck_require__.e(525), __nccwpck_require__.e(568), __nccwpck_require__.e(503), __nccwpck_require__.e(153)]).then(__nccwpck_require__.bind(__nccwpck_require__, 43153));
16205
16205
  await command({
16206
16206
  buildContext: getBuildContext({ projectDirPath }),
16207
16207
  cliCommandOptions: {
@@ -16244,14 +16244,14 @@ program
16244
16244
  .task({
16245
16245
  skip,
16246
16246
  handler: async ({ projectDirPath }) => {
16247
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(805), __nccwpck_require__.e(525), __nccwpck_require__.e(375), __nccwpck_require__.e(33), __nccwpck_require__.e(490)]).then(__nccwpck_require__.bind(__nccwpck_require__, 23490));
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));
16248
16248
  await command({ buildContext: getBuildContext({ projectDirPath }) });
16249
16249
  }
16250
16250
  });
16251
16251
  program
16252
16252
  .command({
16253
16253
  name: "initialize-account-theme",
16254
- description: "Initialize the account theme."
16254
+ description: "Initialize an Account Single-Page or Multi-Page custom Account UI."
16255
16255
  })
16256
16256
  .task({
16257
16257
  skip,
@@ -16260,6 +16260,18 @@ program
16260
16260
  await command({ buildContext: getBuildContext({ projectDirPath }) });
16261
16261
  }
16262
16262
  });
16263
+ program
16264
+ .command({
16265
+ name: "initialize-admin-theme",
16266
+ description: "Initialize an Admin Console custom UI."
16267
+ })
16268
+ .task({
16269
+ skip,
16270
+ handler: async ({ projectDirPath }) => {
16271
+ const { command } = await __nccwpck_require__.e(/* import() */ 840).then(__nccwpck_require__.bind(__nccwpck_require__, 48840));
16272
+ await command({ buildContext: getBuildContext({ projectDirPath }) });
16273
+ }
16274
+ });
16263
16275
  program
16264
16276
  .command({
16265
16277
  name: "copy-keycloak-resources-to-public",
@@ -16286,44 +16298,86 @@ program
16286
16298
  });
16287
16299
  program
16288
16300
  .command({
16289
- name: "postinstall",
16290
- 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")
16291
16320
  })
16292
16321
  .task({
16293
16322
  skip,
16294
16323
  handler: async ({ projectDirPath }) => {
16295
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(805), __nccwpck_require__.e(356), __nccwpck_require__.e(653)]).then(__nccwpck_require__.bind(__nccwpck_require__, 2653));
16324
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(174), __nccwpck_require__.e(363), __nccwpck_require__.e(946)]).then(__nccwpck_require__.bind(__nccwpck_require__, 74946));
16296
16325
  await command({ buildContext: getBuildContext({ projectDirPath }) });
16297
16326
  }
16298
16327
  });
16299
16328
  program
16300
16329
  .command({
16301
- name: "eject-file",
16330
+ name: "own",
16302
16331
  description: [
16303
- "WARNING: Not usable yet, will be used for future features",
16304
- "Take ownership over a given file"
16305
- ].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")
16306
16346
  })
16307
16347
  .option({
16308
- key: "file",
16348
+ key: "path",
16309
16349
  name: (() => {
16310
- const long = "file";
16311
- const short = "f";
16350
+ const long = "path";
16351
+ const short = "p";
16312
16352
  optionsKeys.push(long, short);
16313
16353
  return { long, short };
16314
16354
  })(),
16315
16355
  description: [
16316
- "Relative path of the file relative to the directory of your keycloak theme source",
16317
- "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'`"
16318
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
16319
16373
  })
16320
16374
  .task({
16321
16375
  skip,
16322
- handler: async ({ projectDirPath, file }) => {
16323
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(356), __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(174), __nccwpck_require__.e(363), __nccwpck_require__.e(930)]).then(__nccwpck_require__.bind(__nccwpck_require__, 71930));
16324
16378
  await command({
16325
16379
  buildContext: getBuildContext({ projectDirPath }),
16326
- cliCommandOptions: { file }
16380
+ cliCommandOptions: { path, isRevert: revert }
16327
16381
  });
16328
16382
  }
16329
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>;
@@ -0,0 +1,10 @@
1
+ export type BuildContextLike = {
2
+ projectDirPath: string;
3
+ packageJsonFilePath: string;
4
+ };
5
+ export declare function addSyncExtensionsToPostinstallScript(params: {
6
+ parsedPackageJson: {
7
+ scripts?: Record<string, string | undefined>;
8
+ };
9
+ buildContext: BuildContextLike;
10
+ }): void;
@@ -1,7 +1,7 @@
1
1
  import type { BuildContext } from "./buildContext";
2
2
  export declare const BIN_NAME = "_keycloakify-custom-handler";
3
3
  export declare const NOT_IMPLEMENTED_EXIT_CODE = 78;
4
- export type CommandName = "update-kc-gen" | "eject-page" | "add-story" | "initialize-account-theme" | "initialize-admin-theme" | "initialize-email-theme" | "copy-keycloak-resources-to-public";
4
+ export type CommandName = "update-kc-gen" | "eject-page" | "add-story" | "initialize-account-theme" | "initialize-admin-theme" | "initialize-admin-theme" | "initialize-email-theme" | "copy-keycloak-resources-to-public";
5
5
  export type ApiVersion = "v1";
6
6
  export declare function readParams(params: {
7
7
  apiVersion: ApiVersion;
@@ -1 +1 @@
1
- {"version":3,"file":"customHandler.js","sourceRoot":"","sources":["../../src/bin/shared/customHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAa5C,MAAM,UAAU,UAAU,CAAC,MAAkC;IACzD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAE9B,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC;IAE5B,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE;QACtB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC;QAEpE,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QAE/B,OAAO,QAAuB,CAAC;IACnC,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAErE,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAiB,CAAC;IAChD,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACzC,CAAC"}
1
+ {"version":3,"file":"customHandler.js","sourceRoot":"","sources":["../../src/bin/shared/customHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAc5C,MAAM,UAAU,UAAU,CAAC,MAAkC;IACzD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAE9B,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC;IAE5B,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE;QACtB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC;QAEpE,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QAE/B,OAAO,QAAuB,CAAC;IACnC,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE;QACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAErE,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAiB,CAAC;IAChD,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACzC,CAAC"}
@@ -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
  }>;
@@ -0,0 +1,3 @@
1
+ export declare function getIsKnownByGit(params: {
2
+ filePath: string;
3
+ }): Promise<boolean>;
@@ -1,3 +1,3 @@
1
1
  export declare function npmInstall(params: {
2
2
  packageJsonDirPath: string;
3
- }): void;
3
+ }): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "11.6.0",
3
+ "version": "11.6.2",
4
4
  "description": "Framework to create custom Keycloak UIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -647,7 +647,6 @@
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
651
  "src/bin/initialize-account-theme/copyBoilerplate.ts",
653
652
  "src/bin/initialize-account-theme/index.ts",
@@ -661,6 +660,7 @@
661
660
  "src/bin/initialize-account-theme/src/single-page/KcContext.ts",
662
661
  "src/bin/initialize-account-theme/src/single-page/KcPage.tsx",
663
662
  "src/bin/initialize-account-theme/updateAccountThemeImplementationInConfig.ts",
663
+ "src/bin/initialize-admin-theme.ts",
664
664
  "src/bin/initialize-email-theme.ts",
665
665
  "src/bin/keycloakify/buildJars/buildJar.ts",
666
666
  "src/bin/keycloakify/buildJars/buildJars.ts",
@@ -684,13 +684,9 @@
684
684
  "src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts",
685
685
  "src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts",
686
686
  "src/bin/main.ts",
687
- "src/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts",
688
- "src/bin/postinstall/index.ts",
689
- "src/bin/postinstall/installUiModulesPeerDependencies.ts",
690
- "src/bin/postinstall/managedGitignoreFile.ts",
691
- "src/bin/postinstall/postinstall.ts",
692
- "src/bin/postinstall/uiModuleMeta.ts",
687
+ "src/bin/own.ts",
693
688
  "src/bin/shared/KeycloakVersionRange.ts",
689
+ "src/bin/shared/addSyncExtensionsToPostinstallScript.ts",
694
690
  "src/bin/shared/buildContext.ts",
695
691
  "src/bin/shared/constants.ts",
696
692
  "src/bin/shared/customHandler.ts",
@@ -725,6 +721,12 @@
725
721
  "src/bin/start-keycloak/realmConfig/realmConfig.ts",
726
722
  "src/bin/start-keycloak/start-keycloak.ts",
727
723
  "src/bin/start-keycloak/startViteDevServer.ts",
724
+ "src/bin/sync-extensions/extensionModuleMeta.ts",
725
+ "src/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts",
726
+ "src/bin/sync-extensions/index.ts",
727
+ "src/bin/sync-extensions/installExtensionModulesPeerDependencies.ts",
728
+ "src/bin/sync-extensions/managedGitignoreFile.ts",
729
+ "src/bin/sync-extensions/sync-extension.ts",
728
730
  "src/bin/tools/OptionalIfCanBeUndefined.ts",
729
731
  "src/bin/tools/SemVer.ts",
730
732
  "src/bin/tools/String.prototype.replaceAll.ts",
@@ -747,7 +749,7 @@
747
749
  "src/bin/tools/getInstalledModuleDirPath.ts",
748
750
  "src/bin/tools/getThisCodebaseRootDirPath.ts",
749
751
  "src/bin/tools/isInside.ts",
750
- "src/bin/tools/isTrackedByGit.ts",
752
+ "src/bin/tools/isKnownByGit.ts",
751
753
  "src/bin/tools/kebabCaseToSnakeCase.ts",
752
754
  "src/bin/tools/listInstalledModules.ts",
753
755
  "src/bin/tools/nodeModulesBinDirPath.ts",
@@ -1034,7 +1036,6 @@
1034
1036
  "tools/waitForElementMountedOnDom.js.map",
1035
1037
  "bin/add-story.d.ts",
1036
1038
  "bin/copy-keycloak-resources-to-public.d.ts",
1037
- "bin/eject-file.d.ts",
1038
1039
  "bin/eject-page.d.ts",
1039
1040
  "bin/initialize-account-theme/copyBoilerplate.d.ts",
1040
1041
  "bin/initialize-account-theme/index.d.ts",
@@ -1042,6 +1043,7 @@
1042
1043
  "bin/initialize-account-theme/initializeAccountTheme_multiPage.d.ts",
1043
1044
  "bin/initialize-account-theme/initializeAccountTheme_singlePage.d.ts",
1044
1045
  "bin/initialize-account-theme/updateAccountThemeImplementationInConfig.d.ts",
1046
+ "bin/initialize-admin-theme.d.ts",
1045
1047
  "bin/initialize-email-theme.d.ts",
1046
1048
  "bin/keycloakify/buildJars/buildJar.d.ts",
1047
1049
  "bin/keycloakify/buildJars/buildJars.d.ts",
@@ -1064,12 +1066,8 @@
1064
1066
  "bin/keycloakify/replacers/replaceImportsInJsCode/vite.d.ts",
1065
1067
  "bin/keycloakify/replacers/replaceImportsInJsCode/webpack.d.ts",
1066
1068
  "bin/main.d.ts",
1067
- "bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.d.ts",
1068
- "bin/postinstall/index.d.ts",
1069
- "bin/postinstall/installUiModulesPeerDependencies.d.ts",
1070
- "bin/postinstall/managedGitignoreFile.d.ts",
1071
- "bin/postinstall/postinstall.d.ts",
1072
- "bin/postinstall/uiModuleMeta.d.ts",
1069
+ "bin/own.d.ts",
1070
+ "bin/shared/addSyncExtensionsToPostinstallScript.d.ts",
1073
1071
  "bin/shared/buildContext.d.ts",
1074
1072
  "bin/shared/constants.d.ts",
1075
1073
  "bin/shared/customHandler_delegate.d.ts",
@@ -1095,6 +1093,12 @@
1095
1093
  "bin/start-keycloak/realmConfig/realmConfig.d.ts",
1096
1094
  "bin/start-keycloak/start-keycloak.d.ts",
1097
1095
  "bin/start-keycloak/startViteDevServer.d.ts",
1096
+ "bin/sync-extensions/extensionModuleMeta.d.ts",
1097
+ "bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.d.ts",
1098
+ "bin/sync-extensions/index.d.ts",
1099
+ "bin/sync-extensions/installExtensionModulesPeerDependencies.d.ts",
1100
+ "bin/sync-extensions/managedGitignoreFile.d.ts",
1101
+ "bin/sync-extensions/sync-extension.d.ts",
1098
1102
  "bin/tools/assertNoPnpmDlx.d.ts",
1099
1103
  "bin/tools/canonicalStringify.d.ts",
1100
1104
  "bin/tools/crawl.d.ts",
@@ -1113,7 +1117,7 @@
1113
1117
  "bin/tools/getInstalledModuleDirPath.d.ts",
1114
1118
  "bin/tools/getThisCodebaseRootDirPath.d.ts",
1115
1119
  "bin/tools/isInside.d.ts",
1116
- "bin/tools/isTrackedByGit.d.ts",
1120
+ "bin/tools/isKnownByGit.d.ts",
1117
1121
  "bin/tools/kebabCaseToSnakeCase.d.ts",
1118
1122
  "bin/tools/listInstalledModules.d.ts",
1119
1123
  "bin/tools/nodeModulesBinDirPath.d.ts",
@@ -1134,28 +1138,29 @@
1134
1138
  "bin/update-kc-gen.d.ts",
1135
1139
  "bin/main.js",
1136
1140
  "bin/153.index.js",
1141
+ "bin/174.index.js",
1137
1142
  "bin/266.index.js",
1138
1143
  "bin/304.index.js",
1139
- "bin/33.index.js",
1140
- "bin/356.index.js",
1144
+ "bin/363.index.js",
1141
1145
  "bin/375.index.js",
1142
1146
  "bin/40.index.js",
1143
1147
  "bin/453.index.js",
1144
1148
  "bin/490.index.js",
1145
1149
  "bin/503.index.js",
1146
1150
  "bin/525.index.js",
1147
- "bin/653.index.js",
1151
+ "bin/568.index.js",
1148
1152
  "bin/658.index.js",
1149
1153
  "bin/720.index.js",
1150
1154
  "bin/735.index.js",
1151
1155
  "bin/743.index.js",
1152
1156
  "bin/783.index.js",
1153
1157
  "bin/786.index.js",
1154
- "bin/805.index.js",
1155
- "bin/854.index.js",
1158
+ "bin/840.index.js",
1156
1159
  "bin/877.index.js",
1157
1160
  "bin/880.index.js",
1158
1161
  "bin/921.index.js",
1162
+ "bin/930.index.js",
1163
+ "bin/946.index.js",
1159
1164
  "bin/97.index.js",
1160
1165
  "bin/shared/constants.js",
1161
1166
  "bin/shared/constants.js.map",
@@ -67,9 +67,7 @@ export async function command(params: { buildContext: BuildContext }) {
67
67
  })();
68
68
 
69
69
  if (themeType === "admin") {
70
- console.log(
71
- "Use `npx keycloakify eject-file` command instead, see documentation"
72
- );
70
+ console.log("Use `npx keycloakify own` command instead, see documentation");
73
71
 
74
72
  process.exit(-1);
75
73
  }