keycloakify 10.0.0-rc.90 → 10.0.0-rc.91
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/193.index.js +3 -3
- package/bin/{751.index.js → 31.index.js} +180 -131
- package/bin/440.index.js +7 -12
- package/bin/453.index.js +1 -1
- package/bin/526.index.js +78 -65
- package/bin/538.index.js +1 -1
- package/bin/{837.index.js → 893.index.js} +7 -89
- package/bin/932.index.js +2 -2
- package/bin/97.index.js +1 -1
- package/bin/main.js +7 -7
- package/bin/shared/buildContext.d.ts +9 -2
- package/bin/shared/buildContext.js.map +1 -1
- package/bin/shared/copyKeycloakResourcesToPublic.js.map +1 -1
- package/bin/shared/downloadKeycloakDefaultTheme.d.ts +2 -1
- package/bin/shared/downloadKeycloakDefaultTheme.js.map +1 -1
- package/package.json +7 -9
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +14 -10
- package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +2 -1
- package/src/bin/keycloakify/keycloakify.ts +1 -7
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +2 -2
- package/src/bin/shared/buildContext.ts +168 -92
- package/src/bin/shared/copyKeycloakResourcesToPublic.ts +1 -4
- package/src/bin/shared/downloadKeycloakDefaultTheme.ts +2 -2
- package/src/bin/start-keycloak/appBuild.ts +130 -90
- package/src/bin/start-keycloak/keycloakifyBuild.ts +0 -1
- package/src/bin/start-keycloak/start-keycloak.ts +1 -1
- package/src/bin/tools/{downloadAndExtractArchive/downloadAndExtractArchive.ts → downloadAndExtractArchive.ts} +9 -17
- package/src/bin/tools/{downloadAndExtractArchive/fetchProxyOptions.ts → fetchProxyOptions.ts} +52 -60
- package/vite-plugin/index.js +187 -228
- package/src/bin/tools/downloadAndExtractArchive/index.ts +0 -1
- package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +0 -84
package/bin/193.index.js
CHANGED
@@ -47,7 +47,7 @@ async function copyKeycloakResourcesToPublic(params) {
|
|
47
47
|
buildContext: {
|
48
48
|
loginThemeResourcesFromKeycloakVersion: (0,readThisNpmPackageVersion/* readThisNpmPackageVersion */.K)(),
|
49
49
|
cacheDirPath: (0,external_path_.relative)(destDirPath, buildContext.cacheDirPath),
|
50
|
-
|
50
|
+
fetchOptions: buildContext.fetchOptions
|
51
51
|
}
|
52
52
|
}, null, 2);
|
53
53
|
skip_if_already_done: {
|
@@ -90,7 +90,7 @@ async function copyKeycloakResourcesToPublic(params) {
|
|
90
90
|
}
|
91
91
|
//# sourceMappingURL=copyKeycloakResourcesToPublic.js.map
|
92
92
|
// EXTERNAL MODULE: ./dist/bin/shared/buildContext.js + 1 modules
|
93
|
-
var shared_buildContext = __webpack_require__(
|
93
|
+
var shared_buildContext = __webpack_require__(56031);
|
94
94
|
;// CONCATENATED MODULE: ./dist/bin/copy-keycloak-resources-to-public.js
|
95
95
|
|
96
96
|
|
@@ -114,7 +114,7 @@ async function command(params) {
|
|
114
114
|
/* harmony import */ var _tools_transformCodebase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60332);
|
115
115
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
116
116
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
117
|
-
/* harmony import */ var _downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
117
|
+
/* harmony import */ var _downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(77741);
|
118
118
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(173);
|
119
119
|
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88078);
|
120
120
|
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(tsafe_assert__WEBPACK_IMPORTED_MODULE_4__);
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
exports.id =
|
3
|
-
exports.ids = [
|
2
|
+
exports.id = 31;
|
3
|
+
exports.ids = [31];
|
4
4
|
exports.modules = {
|
5
5
|
|
6
|
-
/***/
|
6
|
+
/***/ 56031:
|
7
7
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
8
8
|
|
9
9
|
|
@@ -18,72 +18,14 @@ var external_url_ = __webpack_require__(57310);
|
|
18
18
|
var external_path_ = __webpack_require__(71017);
|
19
19
|
// EXTERNAL MODULE: ./dist/bin/tools/getAbsoluteAndInOsFormatPath.js
|
20
20
|
var getAbsoluteAndInOsFormatPath = __webpack_require__(86644);
|
21
|
-
// EXTERNAL MODULE: external "child_process"
|
22
|
-
var external_child_process_ = __webpack_require__(32081);
|
23
|
-
// EXTERNAL MODULE: ./node_modules/tsafe/assert.js
|
24
|
-
var assert = __webpack_require__(88078);
|
25
|
-
// EXTERNAL MODULE: external "fs"
|
26
|
-
var external_fs_ = __webpack_require__(57147);
|
27
|
-
;// CONCATENATED MODULE: ./dist/bin/tools/getNpmWorkspaceRootDirPath.js
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
function getNpmWorkspaceRootDirPath(params) {
|
33
|
-
const { projectDirPath, dependencyExpected } = params;
|
34
|
-
console.log("DEBUG getNpmWorkspaceRootDirPath:", {
|
35
|
-
projectDirPath,
|
36
|
-
dependencyExpected
|
37
|
-
});
|
38
|
-
const npmWorkspaceRootDirPath = (function callee(depth) {
|
39
|
-
const cwd = (0,external_path_.resolve)((0,external_path_.join)(...[projectDirPath, ...Array(depth).fill("..")]));
|
40
|
-
console.log("DEBUG getNpmWorkspaceRootDirPath:", { cwd });
|
41
|
-
(0,assert.assert)(cwd !== external_path_.sep, "NPM workspace not found");
|
42
|
-
try {
|
43
|
-
external_child_process_.execSync("npm config get", {
|
44
|
-
cwd,
|
45
|
-
stdio: "ignore"
|
46
|
-
});
|
47
|
-
}
|
48
|
-
catch (error) {
|
49
|
-
console.log("DEBUG getNpmWorkspaceRootDirPath: got error npm config get");
|
50
|
-
if (String(error).includes("ENOWORKSPACES")) {
|
51
|
-
return callee(depth + 1);
|
52
|
-
}
|
53
|
-
throw error;
|
54
|
-
}
|
55
|
-
console.log("DEBUG getNpmWorkspaceRootDirPath: npm workspace found");
|
56
|
-
const packageJsonFilePath = (0,external_path_.join)(cwd, "package.json");
|
57
|
-
if (!external_fs_.existsSync(packageJsonFilePath)) {
|
58
|
-
return callee(depth + 1);
|
59
|
-
}
|
60
|
-
(0,assert.assert)(external_fs_.existsSync(packageJsonFilePath));
|
61
|
-
const parsedPackageJson = JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8"));
|
62
|
-
let isExpectedDependencyFound = false;
|
63
|
-
for (const dependenciesOrDevDependencies of [
|
64
|
-
"dependencies",
|
65
|
-
"devDependencies"
|
66
|
-
]) {
|
67
|
-
const dependencies = parsedPackageJson[dependenciesOrDevDependencies];
|
68
|
-
if (dependencies === undefined) {
|
69
|
-
continue;
|
70
|
-
}
|
71
|
-
(0,assert.assert)(dependencies instanceof Object);
|
72
|
-
if (dependencies[dependencyExpected] === undefined) {
|
73
|
-
continue;
|
74
|
-
}
|
75
|
-
isExpectedDependencyFound = true;
|
76
|
-
}
|
77
|
-
if (!isExpectedDependencyFound && parsedPackageJson.name !== dependencyExpected) {
|
78
|
-
return callee(depth + 1);
|
79
|
-
}
|
80
|
-
return cwd;
|
81
|
-
})(0);
|
82
|
-
return { npmWorkspaceRootDirPath };
|
83
|
-
}
|
84
|
-
//# sourceMappingURL=getNpmWorkspaceRootDirPath.js.map
|
85
21
|
// EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
|
86
22
|
var lib = __webpack_require__(52300);
|
23
|
+
// EXTERNAL MODULE: external "fs"
|
24
|
+
var external_fs_ = __webpack_require__(57147);
|
25
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/assert.js
|
26
|
+
var assert = __webpack_require__(88078);
|
27
|
+
// EXTERNAL MODULE: external "child_process"
|
28
|
+
var external_child_process_ = __webpack_require__(32081);
|
87
29
|
// EXTERNAL MODULE: ./dist/bin/shared/constants.js
|
88
30
|
var constants = __webpack_require__(173);
|
89
31
|
// EXTERNAL MODULE: ./node_modules/tsafe/index.js
|
@@ -101,6 +43,70 @@ var symToStr = __webpack_require__(47986);
|
|
101
43
|
// EXTERNAL MODULE: ./node_modules/chalk/source/index.js
|
102
44
|
var source = __webpack_require__(78818);
|
103
45
|
var source_default = /*#__PURE__*/__webpack_require__.n(source);
|
46
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/fetchProxyOptions.js
|
47
|
+
|
48
|
+
|
49
|
+
function getProxyFetchOptions(params) {
|
50
|
+
var _a, _b, _c;
|
51
|
+
const { npmConfigGetCwd } = params;
|
52
|
+
const cfg = (() => {
|
53
|
+
const output = external_child_process_.execSync("npm config get", {
|
54
|
+
cwd: npmConfigGetCwd
|
55
|
+
})
|
56
|
+
.toString("utf8");
|
57
|
+
return output
|
58
|
+
.split("\n")
|
59
|
+
.filter(line => !line.startsWith(";"))
|
60
|
+
.map(line => line.trim())
|
61
|
+
.map(line => line.split("=", 2))
|
62
|
+
.reduce((cfg, [key, value]) => key in cfg
|
63
|
+
? Object.assign(Object.assign({}, cfg), { [key]: [...ensureArray(cfg[key]), value] }) : Object.assign(Object.assign({}, cfg), { [key]: value }), {});
|
64
|
+
})();
|
65
|
+
const proxy = ensureSingleOrNone((_a = cfg["https-proxy"]) !== null && _a !== void 0 ? _a : cfg["proxy"]);
|
66
|
+
const noProxy = (_b = cfg["noproxy"]) !== null && _b !== void 0 ? _b : cfg["no-proxy"];
|
67
|
+
function maybeBoolean(arg0) {
|
68
|
+
return typeof arg0 === "undefined" ? undefined : Boolean(arg0);
|
69
|
+
}
|
70
|
+
const strictSSL = maybeBoolean(ensureSingleOrNone(cfg["strict-ssl"]));
|
71
|
+
const cert = cfg["cert"];
|
72
|
+
const ca = ensureArray((_c = cfg["ca"]) !== null && _c !== void 0 ? _c : cfg["ca[]"]);
|
73
|
+
const cafile = ensureSingleOrNone(cfg["cafile"]);
|
74
|
+
if (typeof cafile !== "undefined" && cafile !== "null") {
|
75
|
+
ca.push(...(() => {
|
76
|
+
const cafileContent = external_fs_.readFileSync(cafile).toString("utf8");
|
77
|
+
const newLinePlaceholder = "NEW_LINE_PLACEHOLDER_xIsPsK23svt";
|
78
|
+
const chunks = (arr, size = 2) => arr
|
79
|
+
.map((_, i) => i % size == 0 && arr.slice(i, i + size))
|
80
|
+
.filter(Boolean);
|
81
|
+
return chunks(cafileContent.split(/(-----END CERTIFICATE-----)/), 2).map(ca => ca
|
82
|
+
.join("")
|
83
|
+
.replace(/\r?\n/g, newLinePlaceholder)
|
84
|
+
.replace(new RegExp(`^${newLinePlaceholder}`), "")
|
85
|
+
.replace(new RegExp(newLinePlaceholder, "g"), "\\n"));
|
86
|
+
})());
|
87
|
+
}
|
88
|
+
return {
|
89
|
+
proxy,
|
90
|
+
noProxy,
|
91
|
+
strictSSL,
|
92
|
+
cert,
|
93
|
+
ca: ca.length === 0 ? undefined : ca
|
94
|
+
};
|
95
|
+
}
|
96
|
+
function ensureArray(arg0) {
|
97
|
+
return Array.isArray(arg0) ? arg0 : typeof arg0 === "undefined" ? [] : [arg0];
|
98
|
+
}
|
99
|
+
function ensureSingleOrNone(arg0) {
|
100
|
+
if (!Array.isArray(arg0))
|
101
|
+
return arg0;
|
102
|
+
if (arg0.length === 0)
|
103
|
+
return undefined;
|
104
|
+
if (arg0.length === 1)
|
105
|
+
return arg0[0];
|
106
|
+
throw new Error("Illegal configuration, expected a single value but found multiple: " +
|
107
|
+
arg0.map(String).join(", "));
|
108
|
+
}
|
109
|
+
//# sourceMappingURL=fetchProxyOptions.js.map
|
104
110
|
;// CONCATENATED MODULE: ./dist/bin/shared/buildContext.js
|
105
111
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
106
112
|
var t = {};
|
@@ -133,17 +139,44 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
133
139
|
function getBuildContext(params) {
|
134
140
|
var _a, _b, _c, _d, _e, _f;
|
135
141
|
const { cliCommandOptions } = params;
|
136
|
-
|
137
|
-
|
138
|
-
if (cliCommandOptions.projectDirPath === undefined) {
|
139
|
-
return process.cwd();
|
140
|
-
}
|
141
|
-
return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
|
142
|
+
const projectDirPath = cliCommandOptions.projectDirPath !== undefined
|
143
|
+
? (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
|
142
144
|
pathIsh: cliCommandOptions.projectDirPath,
|
143
145
|
cwd: process.cwd()
|
144
|
-
})
|
146
|
+
})
|
147
|
+
: process.cwd();
|
148
|
+
const { themeSrcDirPath } = (() => {
|
149
|
+
const srcDirPath = (0,external_path_.join)(projectDirPath, "src");
|
150
|
+
const themeSrcDirPath = (0,crawl/* crawl */.J)({
|
151
|
+
dirPath: srcDirPath,
|
152
|
+
returnedPathsType: "relative to dirPath"
|
153
|
+
})
|
154
|
+
.map(fileRelativePath => {
|
155
|
+
for (const themeSrcDirBasename of ["keycloak-theme", "keycloak_theme"]) {
|
156
|
+
const split = fileRelativePath.split(themeSrcDirBasename);
|
157
|
+
if (split.length === 2) {
|
158
|
+
return (0,external_path_.join)(srcDirPath, split[0] + themeSrcDirBasename);
|
159
|
+
}
|
160
|
+
}
|
161
|
+
return undefined;
|
162
|
+
})
|
163
|
+
.filter((0,tsafe.exclude)(undefined))[0];
|
164
|
+
if (themeSrcDirPath !== undefined) {
|
165
|
+
return { themeSrcDirPath };
|
166
|
+
}
|
167
|
+
for (const themeType of [...constants/* themeTypes */.rO, "email"]) {
|
168
|
+
if (!external_fs_.existsSync((0,external_path_.join)(srcDirPath, themeType))) {
|
169
|
+
continue;
|
170
|
+
}
|
171
|
+
return { themeSrcDirPath: srcDirPath };
|
172
|
+
}
|
173
|
+
console.log(source_default().red([
|
174
|
+
`Can't locate your Keycloak theme source directory in .${external_path_.sep}${(0,external_path_.relative)(process.cwd(), srcDirPath)}`,
|
175
|
+
`Make sure to either use the Keycloakify CLI in the root of your Keycloakify project or use the --project CLI option`,
|
176
|
+
`If you are collocating your Keycloak theme with your app you must have a directory named 'keycloak-theme' or 'keycloak_theme' in your 'src' directory`
|
177
|
+
].join("\n")));
|
178
|
+
process.exit(1);
|
145
179
|
})();
|
146
|
-
console.log("DEBUG:", { projectDirPath });
|
147
180
|
const { resolvedViteConfig } = (() => {
|
148
181
|
if (external_fs_.readdirSync(projectDirPath)
|
149
182
|
.find(fileBasename => fileBasename.startsWith("vite.config")) ===
|
@@ -162,10 +195,31 @@ function getBuildContext(params) {
|
|
162
195
|
const resolvedViteConfig = JSON.parse(resolvedViteConfigStr);
|
163
196
|
return { resolvedViteConfig };
|
164
197
|
})();
|
165
|
-
|
198
|
+
const packageJsonFilePath = (function getPackageJSonDirPath(upCount) {
|
199
|
+
var _a, _b;
|
200
|
+
const dirPath = (0,external_path_.resolve)((0,external_path_.join)(...[projectDirPath, ...Array(upCount).fill("..")]));
|
201
|
+
(0,assert.assert)(dirPath !== external_path_.sep, "Root package.json not found");
|
202
|
+
success: {
|
203
|
+
const packageJsonFilePath = (0,external_path_.join)(dirPath, "package.json");
|
204
|
+
if (!external_fs_.existsSync(packageJsonFilePath)) {
|
205
|
+
break success;
|
206
|
+
}
|
207
|
+
const parsedPackageJson = lib.z.object({
|
208
|
+
dependencies: lib.z.record(lib.z.string()).optional(),
|
209
|
+
devDependencies: lib.z.record(lib.z.string()).optional()
|
210
|
+
})
|
211
|
+
.parse(JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8")));
|
212
|
+
if (((_a = parsedPackageJson.dependencies) === null || _a === void 0 ? void 0 : _a.keycloakify) === undefined &&
|
213
|
+
((_b = parsedPackageJson.devDependencies) === null || _b === void 0 ? void 0 : _b.keycloakify) === undefined) {
|
214
|
+
break success;
|
215
|
+
}
|
216
|
+
return packageJsonFilePath;
|
217
|
+
}
|
218
|
+
return getPackageJSonDirPath(upCount + 1);
|
219
|
+
})(0);
|
166
220
|
const parsedPackageJson = (() => {
|
167
221
|
const zParsedPackageJson = lib.z.object({
|
168
|
-
name: lib.z.string(),
|
222
|
+
name: lib.z.string().optional(),
|
169
223
|
version: lib.z.string().optional(),
|
170
224
|
homepage: lib.z.string().optional(),
|
171
225
|
keycloakify: (0,id.id)((() => {
|
@@ -222,55 +276,29 @@ function getBuildContext(params) {
|
|
222
276
|
{
|
223
277
|
(0,assert.assert)();
|
224
278
|
}
|
225
|
-
|
279
|
+
const configurationPackageJsonFilePath = (() => {
|
280
|
+
const rootPackageJsonFilePath = (0,external_path_.join)(projectDirPath, "package.json");
|
281
|
+
return external_fs_.existsSync(rootPackageJsonFilePath)
|
282
|
+
? rootPackageJsonFilePath
|
283
|
+
: packageJsonFilePath;
|
284
|
+
})();
|
285
|
+
return zParsedPackageJson.parse(JSON.parse(external_fs_.readFileSync(configurationPackageJsonFilePath).toString("utf8")));
|
226
286
|
})();
|
227
|
-
console.log("DEBUG:", { parsedPackageJson });
|
228
287
|
const buildOptions = Object.assign(Object.assign({}, parsedPackageJson.keycloakify), resolvedViteConfig === null || resolvedViteConfig === void 0 ? void 0 : resolvedViteConfig.buildOptions);
|
229
|
-
console.log("DEBUG:", { buildOptions });
|
230
|
-
const { themeSrcDirPath } = (() => {
|
231
|
-
const srcDirPath = (0,external_path_.join)(projectDirPath, "src");
|
232
|
-
const themeSrcDirPath = (0,crawl/* crawl */.J)({
|
233
|
-
dirPath: srcDirPath,
|
234
|
-
returnedPathsType: "relative to dirPath"
|
235
|
-
})
|
236
|
-
.map(fileRelativePath => {
|
237
|
-
for (const themeSrcDirBasename of ["keycloak-theme", "keycloak_theme"]) {
|
238
|
-
const split = fileRelativePath.split(themeSrcDirBasename);
|
239
|
-
if (split.length === 2) {
|
240
|
-
return (0,external_path_.join)(srcDirPath, split[0] + themeSrcDirBasename);
|
241
|
-
}
|
242
|
-
}
|
243
|
-
return undefined;
|
244
|
-
})
|
245
|
-
.filter((0,tsafe.exclude)(undefined))[0];
|
246
|
-
if (themeSrcDirPath !== undefined) {
|
247
|
-
return { themeSrcDirPath };
|
248
|
-
}
|
249
|
-
for (const themeType of [...constants/* themeTypes */.rO, "email"]) {
|
250
|
-
if (!external_fs_.existsSync((0,external_path_.join)(srcDirPath, themeType))) {
|
251
|
-
continue;
|
252
|
-
}
|
253
|
-
return { themeSrcDirPath: srcDirPath };
|
254
|
-
}
|
255
|
-
console.log(source_default().red([
|
256
|
-
"Can't locate your keycloak theme source directory.",
|
257
|
-
"See: https://docs.keycloakify.dev/v/v10/keycloakify-in-my-app/collocation"
|
258
|
-
].join("\n")));
|
259
|
-
process.exit(1);
|
260
|
-
})();
|
261
288
|
const recordIsImplementedByThemeType = (0,objectFromEntries.objectFromEntries)(["login", "account", "email"].map(themeType => [
|
262
289
|
themeType,
|
263
290
|
external_fs_.existsSync((0,external_path_.join)(themeSrcDirPath, themeType))
|
264
291
|
]));
|
265
|
-
console.log("DEBUG:", { themeSrcDirPath });
|
266
292
|
const themeNames = (() => {
|
267
293
|
if (buildOptions.themeName === undefined) {
|
268
|
-
return
|
269
|
-
|
270
|
-
|
271
|
-
.
|
272
|
-
|
273
|
-
|
294
|
+
return parsedPackageJson.name === undefined
|
295
|
+
? ["keycloakify"]
|
296
|
+
: [
|
297
|
+
parsedPackageJson.name
|
298
|
+
.replace(/^@(.*)/, "$1")
|
299
|
+
.split("/")
|
300
|
+
.join("-")
|
301
|
+
];
|
274
302
|
}
|
275
303
|
if (typeof buildOptions.themeName === "string") {
|
276
304
|
return [buildOptions.themeName];
|
@@ -279,7 +307,6 @@ function getBuildContext(params) {
|
|
279
307
|
(0,assert.assert)(mainThemeName !== undefined);
|
280
308
|
return [mainThemeName, ...themeVariantNames];
|
281
309
|
})();
|
282
|
-
console.log("DEBUG:", { themeNames });
|
283
310
|
const projectBuildDirPath = (() => {
|
284
311
|
webpack: {
|
285
312
|
if (resolvedViteConfig !== undefined) {
|
@@ -295,15 +322,21 @@ function getBuildContext(params) {
|
|
295
322
|
}
|
296
323
|
return (0,external_path_.join)(projectDirPath, resolvedViteConfig.buildDir);
|
297
324
|
})();
|
298
|
-
console.log("DEBUG:", { projectBuildDirPath });
|
299
|
-
const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({
|
300
|
-
projectDirPath,
|
301
|
-
dependencyExpected: "keycloakify"
|
302
|
-
});
|
303
|
-
console.log("DEBUG:", { npmWorkspaceRootDirPath });
|
304
325
|
const bundler = resolvedViteConfig !== undefined ? "vite" : "webpack";
|
305
|
-
|
306
|
-
bundler
|
326
|
+
return {
|
327
|
+
bundler: resolvedViteConfig !== undefined
|
328
|
+
? { type: "vite" }
|
329
|
+
: (() => {
|
330
|
+
const { scripts } = lib.z.object({
|
331
|
+
scripts: lib.z.record(lib.z.string()).optional()
|
332
|
+
})
|
333
|
+
.parse(JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8")));
|
334
|
+
return {
|
335
|
+
type: "webpack",
|
336
|
+
packageJsonDirPath: (0,external_path_.dirname)(packageJsonFilePath),
|
337
|
+
packageJsonScripts: scripts !== null && scripts !== void 0 ? scripts : {}
|
338
|
+
};
|
339
|
+
})(),
|
307
340
|
themeVersion: (_b = (_a = buildOptions.themeVersion) !== null && _a !== void 0 ? _a : parsedPackageJson.version) !== null && _b !== void 0 ? _b : "0.0.0",
|
308
341
|
themeNames,
|
309
342
|
extraThemeProperties: buildOptions.extraThemeProperties,
|
@@ -359,7 +392,7 @@ function getBuildContext(params) {
|
|
359
392
|
cwd: process.cwd()
|
360
393
|
});
|
361
394
|
}
|
362
|
-
return (0,external_path_.join)(
|
395
|
+
return (0,external_path_.join)((0,external_path_.dirname)(packageJsonFilePath), "node_modules", ".cache");
|
363
396
|
})(), "keycloakify");
|
364
397
|
return cacheDirPath;
|
365
398
|
})(),
|
@@ -396,7 +429,6 @@ function getBuildContext(params) {
|
|
396
429
|
}
|
397
430
|
return (0,external_path_.join)(projectBuildDirPath, resolvedViteConfig.assetsDir);
|
398
431
|
})(),
|
399
|
-
npmWorkspaceRootDirPath,
|
400
432
|
kcContextExclusionsFtlCode: (() => {
|
401
433
|
if (buildOptions.kcContextExclusionsFtl === undefined) {
|
402
434
|
return undefined;
|
@@ -413,6 +445,25 @@ function getBuildContext(params) {
|
|
413
445
|
environmentVariables: (_f = buildOptions.environmentVariables) !== null && _f !== void 0 ? _f : [],
|
414
446
|
recordIsImplementedByThemeType,
|
415
447
|
themeSrcDirPath,
|
448
|
+
fetchOptions: getProxyFetchOptions({
|
449
|
+
npmConfigGetCwd: (function callee(upCount) {
|
450
|
+
const dirPath = (0,external_path_.resolve)((0,external_path_.join)(...[projectDirPath, ...Array(upCount).fill("..")]));
|
451
|
+
(0,assert.assert)(dirPath !== external_path_.sep, "Couldn't find a place to run 'npm config get'");
|
452
|
+
try {
|
453
|
+
external_child_process_.execSync("npm config get", {
|
454
|
+
cwd: dirPath,
|
455
|
+
stdio: "ignore"
|
456
|
+
});
|
457
|
+
}
|
458
|
+
catch (error) {
|
459
|
+
if (String(error).includes("ENOWORKSPACES")) {
|
460
|
+
return callee(upCount + 1);
|
461
|
+
}
|
462
|
+
throw error;
|
463
|
+
}
|
464
|
+
return dirPath;
|
465
|
+
})(0)
|
466
|
+
}),
|
416
467
|
jarTargets: (() => {
|
417
468
|
const getDefaultJarFileBasename = (range) => `keycloak-theme-for-kc-${range}.jar`;
|
418
469
|
build_for_specific_keycloak_major_version: {
|
@@ -594,8 +645,6 @@ function getBuildContext(params) {
|
|
594
645
|
return jarTargets;
|
595
646
|
})()
|
596
647
|
};
|
597
|
-
console.log("DEBUG:", JSON.stringify({ buildContext }, null, 2));
|
598
|
-
return buildContext;
|
599
648
|
}
|
600
649
|
//# sourceMappingURL=buildContext.js.map
|
601
650
|
|
package/bin/440.index.js
CHANGED
@@ -310,7 +310,7 @@ function replaceImportsInJsCode_webpack(params) {
|
|
310
310
|
function replaceImportsInJsCode(params) {
|
311
311
|
const { jsCode, buildContext } = params;
|
312
312
|
const { fixedJsCode } = (() => {
|
313
|
-
switch (buildContext.bundler) {
|
313
|
+
switch (buildContext.bundler.type) {
|
314
314
|
case "vite":
|
315
315
|
return replaceImportsInJsCode_vite({
|
316
316
|
jsCode,
|
@@ -587,8 +587,8 @@ function readExtraPagesNames(params) {
|
|
587
587
|
//# sourceMappingURL=readExtraPageNames.js.map
|
588
588
|
// EXTERNAL MODULE: ./dist/bin/keycloakify/generateResources/generateMessageProperties.js
|
589
589
|
var generateMessageProperties = __webpack_require__(73817);
|
590
|
-
// EXTERNAL MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme.js +
|
591
|
-
var downloadKeycloakDefaultTheme = __webpack_require__(
|
590
|
+
// EXTERNAL MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme.js + 1 modules
|
591
|
+
var downloadKeycloakDefaultTheme = __webpack_require__(77741);
|
592
592
|
;// CONCATENATED MODULE: ./dist/bin/keycloakify/generateResources/bringInAccountV1.js
|
593
593
|
|
594
594
|
|
@@ -724,7 +724,7 @@ async function generateResourcesForMainTheme(params) {
|
|
724
724
|
{
|
725
725
|
const dirPath = (0,external_path_.join)(buildContext.projectBuildDirPath, constants/* keycloak_resources */.N$);
|
726
726
|
if (external_fs_.existsSync(dirPath)) {
|
727
|
-
(0,assert.assert)(buildContext.bundler === "webpack");
|
727
|
+
(0,assert.assert)(buildContext.bundler.type === "webpack");
|
728
728
|
throw new Error([
|
729
729
|
`Keycloakify build error: The ${constants/* keycloak_resources */.N$} directory shouldn't exist in your build directory.`,
|
730
730
|
`(${(0,external_path_.relative)(process.cwd(), dirPath)}).\n`,
|
@@ -941,7 +941,7 @@ async function generateResources(params) {
|
|
941
941
|
var external_child_process_ = __webpack_require__(32081);
|
942
942
|
var external_child_process_default = /*#__PURE__*/__webpack_require__.n(external_child_process_);
|
943
943
|
// EXTERNAL MODULE: ./dist/bin/shared/buildContext.js + 1 modules
|
944
|
-
var shared_buildContext = __webpack_require__(
|
944
|
+
var shared_buildContext = __webpack_require__(56031);
|
945
945
|
;// CONCATENATED MODULE: ./dist/bin/keycloakify/buildJars/extensionVersions.js
|
946
946
|
// NOTE: v0.5 is a dummy version.
|
947
947
|
const keycloakAccountV1Versions = [null, "0.3", "0.4", "0.6"];
|
@@ -1250,11 +1250,6 @@ var external_os_ = __webpack_require__(22037);
|
|
1250
1250
|
|
1251
1251
|
|
1252
1252
|
async function command(params) {
|
1253
|
-
console.log("DEBUG:", {
|
1254
|
-
__filename,
|
1255
|
-
__dirname,
|
1256
|
-
"process.cwd()": process.cwd()
|
1257
|
-
});
|
1258
1253
|
exit_if_maven_not_installed: {
|
1259
1254
|
let commandOutput = undefined;
|
1260
1255
|
try {
|
@@ -1301,7 +1296,7 @@ async function command(params) {
|
|
1301
1296
|
buildContext
|
1302
1297
|
});
|
1303
1298
|
run_post_build_script: {
|
1304
|
-
if (buildContext.bundler !== "vite") {
|
1299
|
+
if (buildContext.bundler.type !== "vite") {
|
1305
1300
|
break run_post_build_script;
|
1306
1301
|
}
|
1307
1302
|
external_child_process_.execSync("npx vite", {
|
@@ -1335,7 +1330,7 @@ async function command(params) {
|
|
1335
1330
|
/* harmony import */ var _tools_transformCodebase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60332);
|
1336
1331
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
1337
1332
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
1338
|
-
/* harmony import */ var _downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
1333
|
+
/* harmony import */ var _downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(77741);
|
1339
1334
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(173);
|
1340
1335
|
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88078);
|
1341
1336
|
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(tsafe_assert__WEBPACK_IMPORTED_MODULE_4__);
|
package/bin/453.index.js
CHANGED
@@ -22,7 +22,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
22
22
|
/* harmony import */ var _tools_kebabCaseToSnakeCase__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17192);
|
23
23
|
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(88078);
|
24
24
|
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(tsafe_assert__WEBPACK_IMPORTED_MODULE_7__);
|
25
|
-
/* harmony import */ var _shared_buildContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
25
|
+
/* harmony import */ var _shared_buildContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56031);
|
26
26
|
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(78818);
|
27
27
|
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_9__);
|
28
28
|
|