keycloakify 10.0.0-rc.55 → 10.0.0-rc.56
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/526.index.js +28 -18
- package/package.json +1 -1
- package/src/bin/start-keycloak/start-keycloak.ts +61 -32
package/bin/526.index.js
CHANGED
@@ -615,26 +615,36 @@ async function command(params) {
|
|
615
615
|
cwd: process.cwd()
|
616
616
|
});
|
617
617
|
}
|
618
|
-
const
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
.
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
618
|
+
const internalFilePath = await (async () => {
|
619
|
+
const dirPath = (0,external_path_.join)((0,getThisCodebaseRootDirPath/* getThisCodebaseRootDirPath */.e)(), "src", "bin", "start-keycloak");
|
620
|
+
const filePath = (0,external_path_.join)(dirPath, `myrealm-realm-${keycloakMajorVersionNumber}.json`);
|
621
|
+
if (external_fs_.existsSync(filePath)) {
|
622
|
+
return filePath;
|
623
|
+
}
|
624
|
+
console.log(`${source_default().yellow(`Keycloakify do not have a realm configuration for Keycloak ${keycloakMajorVersionNumber} yet.`)}`);
|
625
|
+
console.log(source_default().cyan("Select what configuration to use:"));
|
626
|
+
const { value } = await dist_default()({
|
627
|
+
values: [
|
628
|
+
...external_fs_.readdirSync(dirPath)
|
629
|
+
.filter(fileBasename => fileBasename.endsWith(".json")),
|
630
|
+
"none"
|
631
|
+
]
|
632
|
+
}).catch(() => {
|
633
|
+
process.exit(-1);
|
634
|
+
});
|
635
|
+
if (value === "none") {
|
636
|
+
return undefined;
|
637
|
+
}
|
638
|
+
return (0,external_path_.join)(dirPath, value);
|
639
|
+
})();
|
640
|
+
if (internalFilePath === undefined) {
|
635
641
|
return undefined;
|
636
642
|
}
|
637
|
-
|
643
|
+
const filePath = (0,external_path_.join)(buildContext.cacheDirPath, (0,external_path_.dirname)(internalFilePath));
|
644
|
+
external_fs_.writeFileSync(filePath, Buffer.from(external_fs_.readFileSync(internalFilePath)
|
645
|
+
.toString("utf8")
|
646
|
+
.replace(/keycloakify\-starter/g, buildContext.themeNames[0])), "utf8");
|
647
|
+
return filePath;
|
638
648
|
})();
|
639
649
|
const jarFilePath = (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, jarFileBasename);
|
640
650
|
async function extractThemeResourcesFromJar() {
|
package/package.json
CHANGED
@@ -9,7 +9,12 @@ import type { KeycloakVersionRange } from "../shared/KeycloakVersionRange";
|
|
9
9
|
import { getJarFileBasename } from "../shared/getJarFileBasename";
|
10
10
|
import { assert, type Equals } from "tsafe/assert";
|
11
11
|
import * as fs from "fs";
|
12
|
-
import {
|
12
|
+
import {
|
13
|
+
join as pathJoin,
|
14
|
+
relative as pathRelative,
|
15
|
+
sep as pathSep,
|
16
|
+
dirname as pathDirname
|
17
|
+
} from "path";
|
13
18
|
import * as child_process from "child_process";
|
14
19
|
import chalk from "chalk";
|
15
20
|
import chokidar from "chokidar";
|
@@ -248,46 +253,70 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|
248
253
|
});
|
249
254
|
}
|
250
255
|
|
251
|
-
const
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
256
|
+
const internalFilePath = await (async () => {
|
257
|
+
const dirPath = pathJoin(
|
258
|
+
getThisCodebaseRootDirPath(),
|
259
|
+
"src",
|
260
|
+
"bin",
|
261
|
+
"start-keycloak"
|
262
|
+
);
|
257
263
|
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
264
|
+
const filePath = pathJoin(
|
265
|
+
dirPath,
|
266
|
+
`myrealm-realm-${keycloakMajorVersionNumber}.json`
|
267
|
+
);
|
262
268
|
|
263
|
-
|
264
|
-
|
265
|
-
|
269
|
+
if (fs.existsSync(filePath)) {
|
270
|
+
return filePath;
|
271
|
+
}
|
266
272
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
273
|
+
console.log(
|
274
|
+
`${chalk.yellow(
|
275
|
+
`Keycloakify do not have a realm configuration for Keycloak ${keycloakMajorVersionNumber} yet.`
|
276
|
+
)}`
|
277
|
+
);
|
272
278
|
|
273
|
-
|
279
|
+
console.log(chalk.cyan("Select what configuration to use:"));
|
280
|
+
|
281
|
+
const { value } = await cliSelect<string>({
|
282
|
+
values: [
|
283
|
+
...fs
|
284
|
+
.readdirSync(dirPath)
|
285
|
+
.filter(fileBasename => fileBasename.endsWith(".json")),
|
286
|
+
"none"
|
287
|
+
]
|
288
|
+
}).catch(() => {
|
289
|
+
process.exit(-1);
|
290
|
+
});
|
274
291
|
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
]
|
282
|
-
}).catch(() => {
|
283
|
-
process.exit(-1);
|
284
|
-
});
|
292
|
+
if (value === "none") {
|
293
|
+
return undefined;
|
294
|
+
}
|
295
|
+
|
296
|
+
return pathJoin(dirPath, value);
|
297
|
+
})();
|
285
298
|
|
286
|
-
if (
|
299
|
+
if (internalFilePath === undefined) {
|
287
300
|
return undefined;
|
288
301
|
}
|
289
302
|
|
290
|
-
|
303
|
+
const filePath = pathJoin(
|
304
|
+
buildContext.cacheDirPath,
|
305
|
+
pathDirname(internalFilePath)
|
306
|
+
);
|
307
|
+
|
308
|
+
fs.writeFileSync(
|
309
|
+
filePath,
|
310
|
+
Buffer.from(
|
311
|
+
fs
|
312
|
+
.readFileSync(internalFilePath)
|
313
|
+
.toString("utf8")
|
314
|
+
.replace(/keycloakify\-starter/g, buildContext.themeNames[0])
|
315
|
+
),
|
316
|
+
"utf8"
|
317
|
+
);
|
318
|
+
|
319
|
+
return filePath;
|
291
320
|
})();
|
292
321
|
|
293
322
|
const jarFilePath = pathJoin(buildContext.keycloakifyBuildDirPath, jarFileBasename);
|