keycloakify 11.6.1 → 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.
- package/bin/363.index.js +1528 -0
- package/bin/453.index.js +1 -1
- package/bin/735.index.js +1 -1
- package/bin/{615.index.js → 840.index.js} +9 -9
- package/bin/930.index.js +165 -0
- package/bin/946.index.js +20 -0
- package/bin/main.js +58 -16
- package/bin/{eject-file.d.ts → own.d.ts} +2 -1
- package/bin/shared/{addPostinstallScriptIfNotPresent.d.ts → addSyncExtensionsToPostinstallScript.d.ts} +1 -1
- package/bin/{postinstall/uiModuleMeta.d.ts → sync-extensions/extensionModuleMeta.d.ts} +5 -5
- package/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.d.ts +12 -0
- package/bin/sync-extensions/index.d.ts +1 -0
- package/bin/{postinstall/installUiModulesPeerDependencies.d.ts → sync-extensions/installExtensionModulesPeerDependencies.d.ts} +3 -3
- package/bin/{postinstall → sync-extensions}/managedGitignoreFile.d.ts +4 -4
- package/bin/tools/isKnownByGit.d.ts +3 -0
- package/package.json +23 -23
- package/src/bin/eject-page.ts +1 -3
- package/src/bin/initialize-admin-theme.ts +2 -2
- package/src/bin/main.ts +61 -16
- package/src/bin/own.ts +209 -0
- package/src/bin/shared/{addPostinstallScriptIfNotPresent.ts → addSyncExtensionsToPostinstallScript.ts} +2 -2
- package/src/bin/{postinstall/uiModuleMeta.ts → sync-extensions/extensionModuleMeta.ts} +48 -42
- package/src/bin/{postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts → sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts} +32 -21
- package/src/bin/sync-extensions/index.ts +1 -0
- package/src/bin/{postinstall/installUiModulesPeerDependencies.ts → sync-extensions/installExtensionModulesPeerDependencies.ts} +15 -13
- package/src/bin/{postinstall → sync-extensions}/managedGitignoreFile.ts +18 -18
- package/src/bin/{postinstall/postinstall.ts → sync-extensions/sync-extension.ts} +14 -26
- package/src/bin/tools/isKnownByGit.ts +45 -0
- package/src/bin/tools/listInstalledModules.ts +2 -2
- package/src/bin/tools/npmInstall.ts +1 -1
- package/src/bin/tools/untrackFromGit.ts +19 -3
- package/bin/300.index.js +0 -770
- package/bin/653.index.js +0 -753
- package/bin/854.index.js +0 -68
- package/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.d.ts +0 -12
- package/bin/postinstall/index.d.ts +0 -1
- package/bin/tools/isTrackedByGit.d.ts +0 -3
- package/src/bin/eject-file.ts +0 -68
- package/src/bin/postinstall/index.ts +0 -1
- package/src/bin/tools/isTrackedByGit.ts +0 -29
- /package/bin/{postinstall/postinstall.d.ts → sync-extensions/sync-extension.d.ts} +0 -0
package/bin/453.index.js
CHANGED
@@ -70,7 +70,7 @@ async function command(params) {
|
|
70
70
|
return value;
|
71
71
|
})();
|
72
72
|
if (themeType === "admin") {
|
73
|
-
console.log("Use `npx keycloakify
|
73
|
+
console.log("Use `npx keycloakify own` command instead, see documentation");
|
74
74
|
process.exit(-1);
|
75
75
|
}
|
76
76
|
if (themeType === "account" &&
|
package/bin/735.index.js
CHANGED
@@ -636,7 +636,7 @@ async function runPackageManagerInstall(params) {
|
|
636
636
|
});
|
637
637
|
child.stdout.on("data", data => process.stdout.write(data));
|
638
638
|
child.stderr.on("data", data => {
|
639
|
-
if (data.toString("utf8").includes("
|
639
|
+
if (data.toString("utf8").includes("peer dependency")) {
|
640
640
|
return;
|
641
641
|
}
|
642
642
|
process.stderr.write(data);
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
exports.id =
|
3
|
-
exports.ids = [
|
2
|
+
exports.id = 840;
|
3
|
+
exports.ids = [840];
|
4
4
|
exports.modules = {
|
5
5
|
|
6
|
-
/***/
|
6
|
+
/***/ 48840:
|
7
7
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
8
8
|
|
9
9
|
// ESM COMPAT FLAG
|
@@ -24,14 +24,14 @@ var customHandler_delegate = __webpack_require__(72138);
|
|
24
24
|
var assert = __webpack_require__(29041);
|
25
25
|
// EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
|
26
26
|
var id = __webpack_require__(38469);
|
27
|
-
;// CONCATENATED MODULE: ./dist/bin/shared/
|
27
|
+
;// CONCATENATED MODULE: ./dist/bin/shared/addSyncExtensionsToPostinstallScript.js
|
28
28
|
|
29
29
|
|
30
30
|
(0,assert/* assert */.h)();
|
31
|
-
function
|
31
|
+
function addSyncExtensionsToPostinstallScript(params) {
|
32
32
|
var _a;
|
33
33
|
const { parsedPackageJson, buildContext } = params;
|
34
|
-
const cmd_base = "keycloakify
|
34
|
+
const cmd_base = "keycloakify sync-extensions";
|
35
35
|
const projectCliOptionValue = (() => {
|
36
36
|
const packageJsonDirPath = (0,external_path_.dirname)(buildContext.packageJsonFilePath);
|
37
37
|
const relativePath = (0,external_path_.relative)(packageJsonDirPath, buildContext.projectDirPath);
|
@@ -64,7 +64,7 @@ function addPostinstallScriptIfNotPresent(params) {
|
|
64
64
|
}
|
65
65
|
parsedPackageJson.scripts = Object.assign({ postinstall: generateCmd({ cmd_preexisting: undefined }) }, parsedPackageJson.scripts);
|
66
66
|
}
|
67
|
-
//# sourceMappingURL=
|
67
|
+
//# sourceMappingURL=addSyncExtensionsToPostinstallScript.js.map
|
68
68
|
// EXTERNAL MODULE: ./dist/bin/tools/runPrettier.js
|
69
69
|
var runPrettier = __webpack_require__(48433);
|
70
70
|
// EXTERNAL MODULE: ./dist/bin/tools/npmInstall.js
|
@@ -121,7 +121,7 @@ async function command(params) {
|
|
121
121
|
(0,assert/* assert */.h)((0,assert.is)(parsedPackageJson));
|
122
122
|
return parsedPackageJson;
|
123
123
|
})();
|
124
|
-
|
124
|
+
addSyncExtensionsToPostinstallScript({
|
125
125
|
parsedPackageJson,
|
126
126
|
buildContext
|
127
127
|
});
|
@@ -510,7 +510,7 @@ async function runPackageManagerInstall(params) {
|
|
510
510
|
});
|
511
511
|
child.stdout.on("data", data => process.stdout.write(data));
|
512
512
|
child.stderr.on("data", data => {
|
513
|
-
if (data.toString("utf8").includes("
|
513
|
+
if (data.toString("utf8").includes("peer dependency")) {
|
514
514
|
return;
|
515
515
|
}
|
516
516
|
process.stderr.write(data);
|
package/bin/930.index.js
ADDED
@@ -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
|
+
;
|
package/bin/946.index.js
ADDED
@@ -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
|
+
;
|
package/bin/main.js
CHANGED
@@ -16268,7 +16268,7 @@ program
|
|
16268
16268
|
.task({
|
16269
16269
|
skip,
|
16270
16270
|
handler: async ({ projectDirPath }) => {
|
16271
|
-
const { command } = await __nccwpck_require__.e(/* import() */
|
16271
|
+
const { command } = await __nccwpck_require__.e(/* import() */ 840).then(__nccwpck_require__.bind(__nccwpck_require__, 48840));
|
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: "
|
16302
|
-
description:
|
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(
|
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));
|
16308
16325
|
await command({ buildContext: getBuildContext({ projectDirPath }) });
|
16309
16326
|
}
|
16310
16327
|
});
|
16311
16328
|
program
|
16312
16329
|
.command({
|
16313
|
-
name: "
|
16330
|
+
name: "own",
|
16314
16331
|
description: [
|
16315
|
-
"
|
16316
|
-
"
|
16317
|
-
|
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: "
|
16348
|
+
key: "path",
|
16321
16349
|
name: (() => {
|
16322
|
-
const long = "
|
16323
|
-
const short = "
|
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
|
-
"
|
16329
|
-
"
|
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,
|
16335
|
-
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(
|
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));
|
16336
16378
|
await command({
|
16337
16379
|
buildContext: getBuildContext({ projectDirPath }),
|
16338
|
-
cliCommandOptions: {
|
16380
|
+
cliCommandOptions: { path, isRevert: revert }
|
16339
16381
|
});
|
16340
16382
|
}
|
16341
16383
|
});
|
@@ -2,7 +2,7 @@ export type BuildContextLike = {
|
|
2
2
|
projectDirPath: string;
|
3
3
|
packageJsonFilePath: string;
|
4
4
|
};
|
5
|
-
export declare function
|
5
|
+
export declare function addSyncExtensionsToPostinstallScript(params: {
|
6
6
|
parsedPackageJson: {
|
7
7
|
scripts?: Record<string, string | undefined>;
|
8
8
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import { type BuildContextLike as
|
3
|
-
export type
|
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 =
|
13
|
+
export type BuildContextLike = BuildContextLike_getExtensionModuleFileSourceCodeReadyToBeCopied & {
|
14
14
|
cacheDirPath: string;
|
15
15
|
packageJsonFilePath: string;
|
16
16
|
projectDirPath: string;
|
17
17
|
};
|
18
|
-
export declare function
|
18
|
+
export declare function getExtensionModuleMetas(params: {
|
19
19
|
buildContext: BuildContextLike;
|
20
|
-
}): Promise<
|
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
|
4
|
+
export type ExtensionModuleMetaLike = {
|
5
5
|
moduleName: string;
|
6
6
|
peerDependencies: Record<string, string>;
|
7
7
|
};
|
8
|
-
export declare function
|
8
|
+
export declare function installExtensionModulesPeerDependencies(params: {
|
9
9
|
buildContext: BuildContextLike;
|
10
|
-
|
10
|
+
extensionModuleMetas: ExtensionModuleMetaLike[];
|
11
11
|
}): Promise<void | never>;
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import type {
|
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
|
-
|
8
|
-
|
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
|
-
|
13
|
+
ownedFilesRelativePaths: string[];
|
14
14
|
}>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "keycloakify",
|
3
|
-
"version": "11.6.
|
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",
|
@@ -685,14 +684,9 @@
|
|
685
684
|
"src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts",
|
686
685
|
"src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts",
|
687
686
|
"src/bin/main.ts",
|
688
|
-
"src/bin/
|
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",
|
687
|
+
"src/bin/own.ts",
|
694
688
|
"src/bin/shared/KeycloakVersionRange.ts",
|
695
|
-
"src/bin/shared/
|
689
|
+
"src/bin/shared/addSyncExtensionsToPostinstallScript.ts",
|
696
690
|
"src/bin/shared/buildContext.ts",
|
697
691
|
"src/bin/shared/constants.ts",
|
698
692
|
"src/bin/shared/customHandler.ts",
|
@@ -727,6 +721,12 @@
|
|
727
721
|
"src/bin/start-keycloak/realmConfig/realmConfig.ts",
|
728
722
|
"src/bin/start-keycloak/start-keycloak.ts",
|
729
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",
|
730
730
|
"src/bin/tools/OptionalIfCanBeUndefined.ts",
|
731
731
|
"src/bin/tools/SemVer.ts",
|
732
732
|
"src/bin/tools/String.prototype.replaceAll.ts",
|
@@ -749,7 +749,7 @@
|
|
749
749
|
"src/bin/tools/getInstalledModuleDirPath.ts",
|
750
750
|
"src/bin/tools/getThisCodebaseRootDirPath.ts",
|
751
751
|
"src/bin/tools/isInside.ts",
|
752
|
-
"src/bin/tools/
|
752
|
+
"src/bin/tools/isKnownByGit.ts",
|
753
753
|
"src/bin/tools/kebabCaseToSnakeCase.ts",
|
754
754
|
"src/bin/tools/listInstalledModules.ts",
|
755
755
|
"src/bin/tools/nodeModulesBinDirPath.ts",
|
@@ -1036,7 +1036,6 @@
|
|
1036
1036
|
"tools/waitForElementMountedOnDom.js.map",
|
1037
1037
|
"bin/add-story.d.ts",
|
1038
1038
|
"bin/copy-keycloak-resources-to-public.d.ts",
|
1039
|
-
"bin/eject-file.d.ts",
|
1040
1039
|
"bin/eject-page.d.ts",
|
1041
1040
|
"bin/initialize-account-theme/copyBoilerplate.d.ts",
|
1042
1041
|
"bin/initialize-account-theme/index.d.ts",
|
@@ -1067,13 +1066,8 @@
|
|
1067
1066
|
"bin/keycloakify/replacers/replaceImportsInJsCode/vite.d.ts",
|
1068
1067
|
"bin/keycloakify/replacers/replaceImportsInJsCode/webpack.d.ts",
|
1069
1068
|
"bin/main.d.ts",
|
1070
|
-
"bin/
|
1071
|
-
"bin/
|
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",
|
1069
|
+
"bin/own.d.ts",
|
1070
|
+
"bin/shared/addSyncExtensionsToPostinstallScript.d.ts",
|
1077
1071
|
"bin/shared/buildContext.d.ts",
|
1078
1072
|
"bin/shared/constants.d.ts",
|
1079
1073
|
"bin/shared/customHandler_delegate.d.ts",
|
@@ -1099,6 +1093,12 @@
|
|
1099
1093
|
"bin/start-keycloak/realmConfig/realmConfig.d.ts",
|
1100
1094
|
"bin/start-keycloak/start-keycloak.d.ts",
|
1101
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",
|
1102
1102
|
"bin/tools/assertNoPnpmDlx.d.ts",
|
1103
1103
|
"bin/tools/canonicalStringify.d.ts",
|
1104
1104
|
"bin/tools/crawl.d.ts",
|
@@ -1117,7 +1117,7 @@
|
|
1117
1117
|
"bin/tools/getInstalledModuleDirPath.d.ts",
|
1118
1118
|
"bin/tools/getThisCodebaseRootDirPath.d.ts",
|
1119
1119
|
"bin/tools/isInside.d.ts",
|
1120
|
-
"bin/tools/
|
1120
|
+
"bin/tools/isKnownByGit.d.ts",
|
1121
1121
|
"bin/tools/kebabCaseToSnakeCase.d.ts",
|
1122
1122
|
"bin/tools/listInstalledModules.d.ts",
|
1123
1123
|
"bin/tools/nodeModulesBinDirPath.d.ts",
|
@@ -1140,8 +1140,8 @@
|
|
1140
1140
|
"bin/153.index.js",
|
1141
1141
|
"bin/174.index.js",
|
1142
1142
|
"bin/266.index.js",
|
1143
|
-
"bin/300.index.js",
|
1144
1143
|
"bin/304.index.js",
|
1144
|
+
"bin/363.index.js",
|
1145
1145
|
"bin/375.index.js",
|
1146
1146
|
"bin/40.index.js",
|
1147
1147
|
"bin/453.index.js",
|
@@ -1149,18 +1149,18 @@
|
|
1149
1149
|
"bin/503.index.js",
|
1150
1150
|
"bin/525.index.js",
|
1151
1151
|
"bin/568.index.js",
|
1152
|
-
"bin/615.index.js",
|
1153
|
-
"bin/653.index.js",
|
1154
1152
|
"bin/658.index.js",
|
1155
1153
|
"bin/720.index.js",
|
1156
1154
|
"bin/735.index.js",
|
1157
1155
|
"bin/743.index.js",
|
1158
1156
|
"bin/783.index.js",
|
1159
1157
|
"bin/786.index.js",
|
1160
|
-
"bin/
|
1158
|
+
"bin/840.index.js",
|
1161
1159
|
"bin/877.index.js",
|
1162
1160
|
"bin/880.index.js",
|
1163
1161
|
"bin/921.index.js",
|
1162
|
+
"bin/930.index.js",
|
1163
|
+
"bin/946.index.js",
|
1164
1164
|
"bin/97.index.js",
|
1165
1165
|
"bin/shared/constants.js",
|
1166
1166
|
"bin/shared/constants.js.map",
|
package/src/bin/eject-page.ts
CHANGED
@@ -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
|
}
|
@@ -4,7 +4,7 @@ import * as fs from "fs";
|
|
4
4
|
import { maybeDelegateCommandToCustomHandler } from "./shared/customHandler_delegate";
|
5
5
|
import { assert, is, type Equals } from "tsafe/assert";
|
6
6
|
import { id } from "tsafe/id";
|
7
|
-
import {
|
7
|
+
import { addSyncExtensionsToPostinstallScript } from "./shared/addSyncExtensionsToPostinstallScript";
|
8
8
|
import { getIsPrettierAvailable, runPrettier } from "./tools/runPrettier";
|
9
9
|
import { npmInstall } from "./tools/npmInstall";
|
10
10
|
import * as child_process from "child_process";
|
@@ -74,7 +74,7 @@ export async function command(params: { buildContext: BuildContext }) {
|
|
74
74
|
return parsedPackageJson;
|
75
75
|
})();
|
76
76
|
|
77
|
-
|
77
|
+
addSyncExtensionsToPostinstallScript({
|
78
78
|
parsedPackageJson,
|
79
79
|
buildContext
|
80
80
|
});
|