keycloakify 11.3.20 → 11.3.21
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/124.index.js +4 -3
- package/bin/356.index.js +26 -15
- package/bin/tools/crawlAsync.d.ts +1 -1
- package/package.json +1 -1
- package/src/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts +11 -9
- package/src/bin/postinstall/installUiModulesPeerDependencies.ts +2 -1
- package/src/bin/postinstall/managedGitignoreFile.ts +4 -3
- package/src/bin/postinstall/uiModuleMeta.ts +10 -4
- package/src/bin/tools/crawlAsync.ts +6 -6
package/bin/124.index.js
CHANGED
@@ -34,6 +34,8 @@ var same = __webpack_require__(33805);
|
|
34
34
|
var runPrettier = __webpack_require__(48433);
|
35
35
|
// EXTERNAL MODULE: ./dist/bin/tools/npmInstall.js + 1 modules
|
36
36
|
var npmInstall = __webpack_require__(63046);
|
37
|
+
// EXTERNAL MODULE: external "path"
|
38
|
+
var external_path_ = __webpack_require__(71017);
|
37
39
|
;// CONCATENATED MODULE: ./dist/bin/postinstall/installUiModulesPeerDependencies.js
|
38
40
|
|
39
41
|
|
@@ -44,6 +46,7 @@ var npmInstall = __webpack_require__(63046);
|
|
44
46
|
|
45
47
|
|
46
48
|
|
49
|
+
|
47
50
|
(0,assert/* assert */.h)();
|
48
51
|
(0,assert/* assert */.h)();
|
49
52
|
async function installUiModulesPeerDependencies(params) {
|
@@ -126,15 +129,13 @@ async function installUiModulesPeerDependencies(params) {
|
|
126
129
|
}
|
127
130
|
await promises_.writeFile(buildContext.packageJsonFilePath, packageJsonContentStr);
|
128
131
|
(0,npmInstall/* npmInstall */.c)({
|
129
|
-
packageJsonDirPath: buildContext.packageJsonFilePath
|
132
|
+
packageJsonDirPath: (0,external_path_.dirname)(buildContext.packageJsonFilePath)
|
130
133
|
});
|
131
134
|
process.exit(0);
|
132
135
|
}
|
133
136
|
//# sourceMappingURL=installUiModulesPeerDependencies.js.map
|
134
137
|
// EXTERNAL MODULE: ./dist/bin/postinstall/managedGitignoreFile.js
|
135
138
|
var managedGitignoreFile = __webpack_require__(36843);
|
136
|
-
// EXTERNAL MODULE: external "path"
|
137
|
-
var external_path_ = __webpack_require__(71017);
|
138
139
|
// EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
|
139
140
|
var fs_existsAsync = __webpack_require__(43765);
|
140
141
|
;// CONCATENATED MODULE: ./dist/bin/postinstall/postinstall.js
|
package/bin/356.index.js
CHANGED
@@ -29,20 +29,22 @@ async function getUiModuleFileSourceCodeReadyToBeCopied(params) {
|
|
29
29
|
if (isForEjection) {
|
30
30
|
return [
|
31
31
|
`/*`,
|
32
|
-
`This file was ejected from ${uiModuleName} version ${uiModuleVersion}.`,
|
33
|
-
|
32
|
+
` * This file was ejected from ${uiModuleName} version ${uiModuleVersion}.`,
|
33
|
+
` */`
|
34
34
|
].join("\n");
|
35
35
|
}
|
36
36
|
else {
|
37
37
|
return [
|
38
38
|
`/*`,
|
39
|
-
`
|
40
|
-
|
41
|
-
`
|
42
|
-
|
43
|
-
`
|
44
|
-
|
45
|
-
|
39
|
+
` *`,
|
40
|
+
` * WARNING: Before modifying this file run the following command:`,
|
41
|
+
` * `,
|
42
|
+
` * $ npx keycloakify eject-file --file ${fileRelativePath.split(path__WEBPACK_IMPORTED_MODULE_2__.sep).join("/")}`,
|
43
|
+
` * `,
|
44
|
+
` * This file comes from ${uiModuleName} version ${uiModuleVersion}.`,
|
45
|
+
` *`,
|
46
|
+
` */`
|
47
|
+
].join("\n");
|
46
48
|
}
|
47
49
|
})();
|
48
50
|
sourceCode = [comment, ``, sourceCode].join("\n");
|
@@ -94,7 +96,9 @@ async function writeManagedGitignoreFile(params) {
|
|
94
96
|
`# This file is managed by Keycloakify, do not edit it manually.`,
|
95
97
|
``,
|
96
98
|
DELIMITER_START,
|
97
|
-
...ejectedFilesRelativePaths
|
99
|
+
...ejectedFilesRelativePaths
|
100
|
+
.map(fileRelativePath => fileRelativePath.split(path__WEBPACK_IMPORTED_MODULE_1__.sep).join("/"))
|
101
|
+
.map(line => `# ${line}`),
|
98
102
|
DELIMITER_END,
|
99
103
|
``,
|
100
104
|
...uiModuleMetas
|
@@ -147,6 +151,7 @@ async function readManagedGitignoreFile(params) {
|
|
147
151
|
const ejectedFilesRelativePaths = payload
|
148
152
|
.split("\n")
|
149
153
|
.map(line => line.trim())
|
154
|
+
.map(line => line.replace(/^# /, ""))
|
150
155
|
.filter(line => line !== "")
|
151
156
|
.map(line => (0,_tools_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_4__/* .getAbsoluteAndInOsFormatPath */ .c)({
|
152
157
|
cwd: buildContext.themeSrcDirPath,
|
@@ -269,13 +274,13 @@ async function crawlAsync(params) {
|
|
269
274
|
const { dirPath, returnedPathsType, onFileFound } = params;
|
270
275
|
await crawlAsyncRec({
|
271
276
|
dirPath,
|
272
|
-
onFileFound: ({ filePath }) => {
|
277
|
+
onFileFound: async ({ filePath }) => {
|
273
278
|
switch (returnedPathsType) {
|
274
279
|
case "absolute":
|
275
|
-
onFileFound(filePath);
|
280
|
+
await onFileFound(filePath);
|
276
281
|
return;
|
277
282
|
case "relative to dirPath":
|
278
|
-
onFileFound((0,external_path_.relative)(dirPath, filePath));
|
283
|
+
await onFileFound((0,external_path_.relative)(dirPath, filePath));
|
279
284
|
return;
|
280
285
|
}
|
281
286
|
(0,assert/* assert */.h)();
|
@@ -292,7 +297,7 @@ async function crawlAsyncRec(params) {
|
|
292
297
|
await crawlAsyncRec({ dirPath: fileOrDirPath, onFileFound });
|
293
298
|
return;
|
294
299
|
}
|
295
|
-
onFileFound({ filePath: fileOrDirPath });
|
300
|
+
await onFileFound({ filePath: fileOrDirPath });
|
296
301
|
}));
|
297
302
|
}
|
298
303
|
//# sourceMappingURL=crawlAsync.js.map
|
@@ -321,6 +326,7 @@ var constants = __webpack_require__(173);
|
|
321
326
|
|
322
327
|
|
323
328
|
|
329
|
+
|
324
330
|
const zUiModuleMeta = (() => {
|
325
331
|
const zTargetType = lib.z.object({
|
326
332
|
moduleName: lib.z.string(),
|
@@ -364,7 +370,12 @@ async function getUiModuleMetas(params) {
|
|
364
370
|
projectDirPath: buildContext.packageJsonFilePath,
|
365
371
|
filter: ({ moduleName }) => moduleName.includes("keycloakify") && moduleName !== "keycloakify"
|
366
372
|
});
|
367
|
-
return Promise.all(installedModulesWithKeycloakifyInTheName.
|
373
|
+
return (await Promise.all(installedModulesWithKeycloakifyInTheName.map(async (entry) => {
|
374
|
+
if (!(await (0,fs_existsAsync/* existsAsync */.o)((0,external_path_.join)(entry.dirPath, constants/* KEYCLOAK_THEME */.PC)))) {
|
375
|
+
return undefined;
|
376
|
+
}
|
377
|
+
return entry;
|
378
|
+
}))).filter((0,exclude/* exclude */.D)(undefined));
|
368
379
|
})();
|
369
380
|
const cacheContent = await (async () => {
|
370
381
|
if (!(await (0,fs_existsAsync/* existsAsync */.o)(cacheFilePath))) {
|
package/package.json
CHANGED
@@ -36,19 +36,21 @@ export async function getUiModuleFileSourceCodeReadyToBeCopied(params: {
|
|
36
36
|
if (isForEjection) {
|
37
37
|
return [
|
38
38
|
`/*`,
|
39
|
-
`This file was ejected from ${uiModuleName} version ${uiModuleVersion}.`,
|
40
|
-
|
39
|
+
` * This file was ejected from ${uiModuleName} version ${uiModuleVersion}.`,
|
40
|
+
` */`
|
41
41
|
].join("\n");
|
42
42
|
} else {
|
43
43
|
return [
|
44
44
|
`/*`,
|
45
|
-
`
|
46
|
-
|
47
|
-
`
|
48
|
-
|
49
|
-
`
|
50
|
-
|
51
|
-
|
45
|
+
` *`,
|
46
|
+
` * WARNING: Before modifying this file run the following command:`,
|
47
|
+
` * `,
|
48
|
+
` * $ npx keycloakify eject-file --file ${fileRelativePath.split(pathSep).join("/")}`,
|
49
|
+
` * `,
|
50
|
+
` * This file comes from ${uiModuleName} version ${uiModuleVersion}.`,
|
51
|
+
` *`,
|
52
|
+
` */`
|
53
|
+
].join("\n");
|
52
54
|
}
|
53
55
|
})();
|
54
56
|
|
@@ -9,6 +9,7 @@ import { SemVer } from "../tools/SemVer";
|
|
9
9
|
import { same } from "evt/tools/inDepth/same";
|
10
10
|
import { runPrettier, getIsPrettierAvailable } from "../tools/runPrettier";
|
11
11
|
import { npmInstall } from "../tools/npmInstall";
|
12
|
+
import { dirname as pathDirname } from "path";
|
12
13
|
|
13
14
|
export type BuildContextLike = {
|
14
15
|
packageJsonFilePath: string;
|
@@ -150,7 +151,7 @@ export async function installUiModulesPeerDependencies(params: {
|
|
150
151
|
await fsPr.writeFile(buildContext.packageJsonFilePath, packageJsonContentStr);
|
151
152
|
|
152
153
|
npmInstall({
|
153
|
-
packageJsonDirPath: buildContext.packageJsonFilePath
|
154
|
+
packageJsonDirPath: pathDirname(buildContext.packageJsonFilePath)
|
154
155
|
});
|
155
156
|
|
156
157
|
process.exit(0);
|
@@ -38,9 +38,9 @@ export async function writeManagedGitignoreFile(params: {
|
|
38
38
|
`# This file is managed by Keycloakify, do not edit it manually.`,
|
39
39
|
``,
|
40
40
|
DELIMITER_START,
|
41
|
-
...ejectedFilesRelativePaths
|
42
|
-
fileRelativePath.split(pathSep).join("/")
|
43
|
-
|
41
|
+
...ejectedFilesRelativePaths
|
42
|
+
.map(fileRelativePath => fileRelativePath.split(pathSep).join("/"))
|
43
|
+
.map(line => `# ${line}`),
|
44
44
|
DELIMITER_END,
|
45
45
|
``,
|
46
46
|
...uiModuleMetas
|
@@ -122,6 +122,7 @@ export async function readManagedGitignoreFile(params: {
|
|
122
122
|
const ejectedFilesRelativePaths = payload
|
123
123
|
.split("\n")
|
124
124
|
.map(line => line.trim())
|
125
|
+
.map(line => line.replace(/^# /, ""))
|
125
126
|
.filter(line => line !== "")
|
126
127
|
.map(line =>
|
127
128
|
getAbsoluteAndInOsFormatPath({
|
@@ -16,6 +16,7 @@ import {
|
|
16
16
|
} from "./getUiModuleFileSourceCodeReadyToBeCopied";
|
17
17
|
import * as crypto from "crypto";
|
18
18
|
import { KEYCLOAK_THEME } from "../shared/constants";
|
19
|
+
import { exclude } from "tsafe/exclude";
|
19
20
|
|
20
21
|
export type UiModuleMeta = {
|
21
22
|
moduleName: string;
|
@@ -113,11 +114,16 @@ export async function getUiModuleMetas(params: {
|
|
113
114
|
moduleName.includes("keycloakify") && moduleName !== "keycloakify"
|
114
115
|
});
|
115
116
|
|
116
|
-
return
|
117
|
-
|
118
|
-
|
117
|
+
return (
|
118
|
+
await Promise.all(
|
119
|
+
installedModulesWithKeycloakifyInTheName.map(async entry => {
|
120
|
+
if (!(await existsAsync(pathJoin(entry.dirPath, KEYCLOAK_THEME)))) {
|
121
|
+
return undefined;
|
122
|
+
}
|
123
|
+
return entry;
|
124
|
+
})
|
119
125
|
)
|
120
|
-
);
|
126
|
+
).filter(exclude(undefined));
|
121
127
|
})();
|
122
128
|
|
123
129
|
const cacheContent = await (async () => {
|
@@ -6,19 +6,19 @@ import { assert, type Equals } from "tsafe/assert";
|
|
6
6
|
export async function crawlAsync(params: {
|
7
7
|
dirPath: string;
|
8
8
|
returnedPathsType: "absolute" | "relative to dirPath";
|
9
|
-
onFileFound: (filePath: string) => void
|
9
|
+
onFileFound: (filePath: string) => Promise<void>;
|
10
10
|
}) {
|
11
11
|
const { dirPath, returnedPathsType, onFileFound } = params;
|
12
12
|
|
13
13
|
await crawlAsyncRec({
|
14
14
|
dirPath,
|
15
|
-
onFileFound: ({ filePath }) => {
|
15
|
+
onFileFound: async ({ filePath }) => {
|
16
16
|
switch (returnedPathsType) {
|
17
17
|
case "absolute":
|
18
|
-
onFileFound(filePath);
|
18
|
+
await onFileFound(filePath);
|
19
19
|
return;
|
20
20
|
case "relative to dirPath":
|
21
|
-
onFileFound(pathRelative(dirPath, filePath));
|
21
|
+
await onFileFound(pathRelative(dirPath, filePath));
|
22
22
|
return;
|
23
23
|
}
|
24
24
|
assert<Equals<typeof returnedPathsType, never>>();
|
@@ -28,7 +28,7 @@ export async function crawlAsync(params: {
|
|
28
28
|
|
29
29
|
async function crawlAsyncRec(params: {
|
30
30
|
dirPath: string;
|
31
|
-
onFileFound: (params: { filePath: string }) => void
|
31
|
+
onFileFound: (params: { filePath: string }) => Promise<void>;
|
32
32
|
}) {
|
33
33
|
const { dirPath, onFileFound } = params;
|
34
34
|
|
@@ -45,7 +45,7 @@ async function crawlAsyncRec(params: {
|
|
45
45
|
return;
|
46
46
|
}
|
47
47
|
|
48
|
-
onFileFound({ filePath: fileOrDirPath });
|
48
|
+
await onFileFound({ filePath: fileOrDirPath });
|
49
49
|
})
|
50
50
|
);
|
51
51
|
}
|