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 CHANGED
@@ -615,26 +615,36 @@ async function command(params) {
615
615
  cwd: process.cwd()
616
616
  });
617
617
  }
618
- const dirPath = (0,external_path_.join)((0,getThisCodebaseRootDirPath/* getThisCodebaseRootDirPath */.e)(), "src", "bin", "start-keycloak");
619
- const filePath = (0,external_path_.join)(dirPath, `myrealm-realm-${keycloakMajorVersionNumber}.json`);
620
- if (external_fs_.existsSync(filePath)) {
621
- return filePath;
622
- }
623
- console.log(`${source_default().yellow(`Keycloakify do not have a realm configuration for Keycloak ${keycloakMajorVersionNumber} yet.`)}`);
624
- console.log(source_default().cyan("Select what configuration to use:"));
625
- const { value } = await dist_default()({
626
- values: [
627
- ...external_fs_.readdirSync(dirPath)
628
- .filter(fileBasename => fileBasename.endsWith(".json")),
629
- "none"
630
- ]
631
- }).catch(() => {
632
- process.exit(-1);
633
- });
634
- if (value === "none") {
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
- return (0,external_path_.join)(dirPath, value);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "10.0.0-rc.55",
3
+ "version": "10.0.0-rc.56",
4
4
  "description": "Create Keycloak themes using React",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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 { join as pathJoin, relative as pathRelative, sep as pathSep } from "path";
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 dirPath = pathJoin(
252
- getThisCodebaseRootDirPath(),
253
- "src",
254
- "bin",
255
- "start-keycloak"
256
- );
256
+ const internalFilePath = await (async () => {
257
+ const dirPath = pathJoin(
258
+ getThisCodebaseRootDirPath(),
259
+ "src",
260
+ "bin",
261
+ "start-keycloak"
262
+ );
257
263
 
258
- const filePath = pathJoin(
259
- dirPath,
260
- `myrealm-realm-${keycloakMajorVersionNumber}.json`
261
- );
264
+ const filePath = pathJoin(
265
+ dirPath,
266
+ `myrealm-realm-${keycloakMajorVersionNumber}.json`
267
+ );
262
268
 
263
- if (fs.existsSync(filePath)) {
264
- return filePath;
265
- }
269
+ if (fs.existsSync(filePath)) {
270
+ return filePath;
271
+ }
266
272
 
267
- console.log(
268
- `${chalk.yellow(
269
- `Keycloakify do not have a realm configuration for Keycloak ${keycloakMajorVersionNumber} yet.`
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
- console.log(chalk.cyan("Select what configuration to use:"));
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
- const { value } = await cliSelect<string>({
276
- values: [
277
- ...fs
278
- .readdirSync(dirPath)
279
- .filter(fileBasename => fileBasename.endsWith(".json")),
280
- "none"
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 (value === "none") {
299
+ if (internalFilePath === undefined) {
287
300
  return undefined;
288
301
  }
289
302
 
290
- return pathJoin(dirPath, value);
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);