keycloakify 11.3.30 → 11.3.31

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/40.index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.id = 40;
3
- exports.ids = [40];
3
+ exports.ids = [40,658];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 18040:
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ exports.id = 658;
3
+ exports.ids = [658];
4
+ exports.modules = {
5
+
6
+ /***/ 18040:
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 _shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72138);
14
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
15
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
16
+ /* harmony import */ var _shared_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(173);
17
+ /* harmony import */ var _tools_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(64795);
18
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57147);
19
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_4__);
20
+ /* harmony import */ var _tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89693);
21
+ /* harmony import */ var _tools_transformCodebase__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(60332);
22
+ /* harmony import */ var _tools_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(58822);
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ async function command(params) {
32
+ const { buildContext } = params;
33
+ const { hasBeenHandled } = (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_0__/* .maybeDelegateCommandToCustomHandler */ .q)({
34
+ commandName: "copy-keycloak-resources-to-public",
35
+ buildContext
36
+ });
37
+ if (hasBeenHandled) {
38
+ return;
39
+ }
40
+ const destDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.publicDirPath, _shared_constants__WEBPACK_IMPORTED_MODULE_2__/* .WELL_KNOWN_DIRECTORY_BASE_NAME.KEYCLOAKIFY_DEV_RESOURCES */ .Ju.KEYCLOAKIFY_DEV_RESOURCES);
41
+ const keycloakifyBuildinfoFilePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(destDirPath, "keycloakify.buildinfo");
42
+ const keycloakifyBuildinfoRaw = JSON.stringify({
43
+ keycloakifyVersion: (0,_tools_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_3__/* .readThisNpmPackageVersion */ .K)()
44
+ }, null, 2);
45
+ skip_if_already_done: {
46
+ if (!fs__WEBPACK_IMPORTED_MODULE_4__.existsSync(keycloakifyBuildinfoFilePath)) {
47
+ break skip_if_already_done;
48
+ }
49
+ const keycloakifyBuildinfoRaw_previousRun = fs__WEBPACK_IMPORTED_MODULE_4__.readFileSync(keycloakifyBuildinfoFilePath)
50
+ .toString("utf8");
51
+ if (keycloakifyBuildinfoRaw_previousRun !== keycloakifyBuildinfoRaw) {
52
+ break skip_if_already_done;
53
+ }
54
+ return;
55
+ }
56
+ (0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_5__/* .rmSync */ .a)(destDirPath, { force: true, recursive: true });
57
+ // NOTE: To remove in a while, remove the legacy keycloak-resources directory
58
+ (0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_5__/* .rmSync */ .a)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,path__WEBPACK_IMPORTED_MODULE_1__.dirname)(destDirPath), "keycloak-resources"), {
59
+ force: true,
60
+ recursive: true
61
+ });
62
+ (0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_5__/* .rmSync */ .a)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,path__WEBPACK_IMPORTED_MODULE_1__.dirname)(destDirPath), ".keycloakify"), {
63
+ force: true,
64
+ recursive: true
65
+ });
66
+ fs__WEBPACK_IMPORTED_MODULE_4__.mkdirSync(destDirPath, { recursive: true });
67
+ fs__WEBPACK_IMPORTED_MODULE_4__.writeFileSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(destDirPath, ".gitignore"), Buffer.from("*", "utf8"));
68
+ (0,_tools_transformCodebase__WEBPACK_IMPORTED_MODULE_6__/* .transformCodebase */ .N)({
69
+ srcDirPath: (0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_tools_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_7__/* .getThisCodebaseRootDirPath */ .e)(), "res", "public", _shared_constants__WEBPACK_IMPORTED_MODULE_2__/* .WELL_KNOWN_DIRECTORY_BASE_NAME.KEYCLOAKIFY_DEV_RESOURCES */ .Ju.KEYCLOAKIFY_DEV_RESOURCES),
70
+ destDirPath
71
+ });
72
+ fs__WEBPACK_IMPORTED_MODULE_4__.writeFileSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(destDirPath, "README.txt"), Buffer.from(
73
+ // prettier-ignore
74
+ [
75
+ "This directory is only used in dev mode by Keycloakify",
76
+ "It won't be included in your final build.",
77
+ "Do not modify anything in this directory.",
78
+ ].join("\n")));
79
+ fs__WEBPACK_IMPORTED_MODULE_4__.writeFileSync(keycloakifyBuildinfoFilePath, Buffer.from(keycloakifyBuildinfoRaw, "utf8"));
80
+ }
81
+ //# sourceMappingURL=copy-keycloak-resources-to-public.js.map
82
+
83
+ /***/ }),
84
+
85
+ /***/ 89693:
86
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
87
+
88
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
89
+ /* harmony export */ "a": () => (/* binding */ rmSync)
90
+ /* harmony export */ });
91
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
92
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
93
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
94
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
95
+ /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
96
+
97
+
98
+
99
+ /**
100
+ * Polyfill of fs.rmSync(dirPath, { "recursive": true })
101
+ * For older version of Node
102
+ */
103
+ function rmSync(dirPath, options) {
104
+ if (_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.compare */ .h.compare(_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse(process.version), _SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse("14.14.0")) > 0) {
105
+ fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
106
+ return;
107
+ }
108
+ const { force = true } = options;
109
+ if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
110
+ return;
111
+ }
112
+ const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
113
+ const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
114
+ if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
115
+ removeDir_rec(fileOrDirPath);
116
+ return;
117
+ }
118
+ else {
119
+ fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
120
+ }
121
+ });
122
+ removeDir_rec(dirPath);
123
+ }
124
+ //# sourceMappingURL=fs.rmSync.js.map
125
+
126
+ /***/ }),
127
+
128
+ /***/ 60332:
129
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
130
+
131
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
132
+ /* harmony export */ "N": () => (/* binding */ transformCodebase)
133
+ /* harmony export */ });
134
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
135
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
136
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
137
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
138
+ /* harmony import */ var _crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
139
+ /* harmony import */ var _tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89693);
140
+
141
+
142
+
143
+
144
+ /**
145
+ * Apply a transformation function to every file of directory
146
+ * If source and destination are the same this function can be used to apply the transformation in place
147
+ * like filtering out some files or modifying them.
148
+ * */
149
+ function transformCodebase(params) {
150
+ const { srcDirPath, transformSourceCode } = params;
151
+ const isTargetSameAsSource = path__WEBPACK_IMPORTED_MODULE_1__.relative(srcDirPath, params.destDirPath) === "";
152
+ const destDirPath = isTargetSameAsSource
153
+ ? path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs")
154
+ : params.destDirPath;
155
+ fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(destDirPath, {
156
+ recursive: true
157
+ });
158
+ for (const fileRelativePath of (0,_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
159
+ dirPath: srcDirPath,
160
+ returnedPathsType: "relative to dirPath"
161
+ })) {
162
+ const filePath = path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, fileRelativePath);
163
+ const destFilePath = path__WEBPACK_IMPORTED_MODULE_1__.join(destDirPath, fileRelativePath);
164
+ // NOTE: Optimization, if we don't need to transform the file, just copy
165
+ // it using the lower level implementation.
166
+ if (transformSourceCode === undefined) {
167
+ fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
168
+ recursive: true
169
+ });
170
+ fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync(filePath, destFilePath);
171
+ continue;
172
+ }
173
+ const transformSourceCodeResult = transformSourceCode({
174
+ sourceCode: fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath),
175
+ filePath,
176
+ fileRelativePath
177
+ });
178
+ if (transformSourceCodeResult === undefined) {
179
+ continue;
180
+ }
181
+ fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
182
+ recursive: true
183
+ });
184
+ const { newFileName, modifiedSourceCode } = transformSourceCodeResult;
185
+ fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(path__WEBPACK_IMPORTED_MODULE_1__.join(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), newFileName !== null && newFileName !== void 0 ? newFileName : path__WEBPACK_IMPORTED_MODULE_1__.basename(destFilePath)), modifiedSourceCode);
186
+ }
187
+ if (isTargetSameAsSource) {
188
+ (0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__/* .rmSync */ .a)(srcDirPath, { recursive: true });
189
+ fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(destDirPath, srcDirPath);
190
+ }
191
+ }
192
+ //# sourceMappingURL=transformCodebase.js.map
193
+
194
+ /***/ })
195
+
196
+ };
197
+ ;
package/bin/786.index.js CHANGED
@@ -263,6 +263,13 @@ __webpack_require__.r(__webpack_exports__);
263
263
 
264
264
  async function command(params) {
265
265
  const { buildContext } = params;
266
+ run_copy_assets_to_public: {
267
+ if (buildContext.bundler !== "webpack") {
268
+ break run_copy_assets_to_public;
269
+ }
270
+ const { command } = await __webpack_require__.e(/* import() */ 658).then(__webpack_require__.bind(__webpack_require__, 18040));
271
+ await command({ buildContext });
272
+ }
266
273
  const { hasBeenHandled } = (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_3__/* .maybeDelegateCommandToCustomHandler */ .q)({
267
274
  commandName: "update-kc-gen",
268
275
  buildContext
package/bin/921.index.js CHANGED
@@ -443,6 +443,13 @@ __webpack_require__.r(__webpack_exports__);
443
443
 
444
444
  async function command(params) {
445
445
  const { buildContext } = params;
446
+ run_copy_assets_to_public: {
447
+ if (buildContext.bundler !== "webpack") {
448
+ break run_copy_assets_to_public;
449
+ }
450
+ const { command } = await __webpack_require__.e(/* import() */ 658).then(__webpack_require__.bind(__webpack_require__, 18040));
451
+ await command({ buildContext });
452
+ }
446
453
  const { hasBeenHandled } = (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_3__/* .maybeDelegateCommandToCustomHandler */ .q)({
447
454
  commandName: "update-kc-gen",
448
455
  buildContext
package/bin/main.js CHANGED
@@ -16371,7 +16371,7 @@ program
16371
16371
  program
16372
16372
  .command({
16373
16373
  name: "copy-keycloak-resources-to-public",
16374
- description: "(Webpack/Create-React-App only) Copy Keycloak default theme resources to the public directory."
16374
+ description: "(Internal) Copy Keycloak default theme resources to the public directory."
16375
16375
  })
16376
16376
  .task({
16377
16377
  skip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "11.3.30",
3
+ "version": "11.3.31",
4
4
  "description": "Framework to create custom Keycloak UIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1109,6 +1109,7 @@
1109
1109
  "bin/526.index.js",
1110
1110
  "bin/573.index.js",
1111
1111
  "bin/653.index.js",
1112
+ "bin/658.index.js",
1112
1113
  "bin/720.index.js",
1113
1114
  "bin/735.index.js",
1114
1115
  "bin/743.index.js",
package/src/bin/main.ts CHANGED
@@ -245,7 +245,7 @@ program
245
245
  .command({
246
246
  name: "copy-keycloak-resources-to-public",
247
247
  description:
248
- "(Webpack/Create-React-App only) Copy Keycloak default theme resources to the public directory."
248
+ "(Internal) Copy Keycloak default theme resources to the public directory."
249
249
  })
250
250
  .task({
251
251
  skip,
@@ -9,6 +9,16 @@ import { getIsPrettierAvailable, runPrettier } from "./tools/runPrettier";
9
9
  export async function command(params: { buildContext: BuildContext }) {
10
10
  const { buildContext } = params;
11
11
 
12
+ run_copy_assets_to_public: {
13
+ if (buildContext.bundler !== "webpack") {
14
+ break run_copy_assets_to_public;
15
+ }
16
+
17
+ const { command } = await import("./copy-keycloak-resources-to-public");
18
+
19
+ await command({ buildContext });
20
+ }
21
+
12
22
  const { hasBeenHandled } = maybeDelegateCommandToCustomHandler({
13
23
  commandName: "update-kc-gen",
14
24
  buildContext
@@ -5554,6 +5554,13 @@ var runPrettier = __nccwpck_require__(433);
5554
5554
 
5555
5555
  async function command(params) {
5556
5556
  const { buildContext } = params;
5557
+ run_copy_assets_to_public: {
5558
+ if (buildContext.bundler !== "webpack") {
5559
+ break run_copy_assets_to_public;
5560
+ }
5561
+ const { command } = await Promise.resolve(/* import() */).then(__nccwpck_require__.bind(__nccwpck_require__, 713));
5562
+ await command({ buildContext });
5563
+ }
5557
5564
  const { hasBeenHandled } = (0,customHandler_delegate/* maybeDelegateCommandToCustomHandler */.q)({
5558
5565
  commandName: "update-kc-gen",
5559
5566
  buildContext