keycloakify 11.8.1 → 11.8.3

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/712.index.js CHANGED
@@ -849,6 +849,7 @@ var isInside = __webpack_require__(90665);
849
849
  (0,assert/* assert */.h)();
850
850
  async function generateResources(params) {
851
851
  var _a;
852
+ const start = Date.now();
852
853
  const { resourcesDirPath, buildContext } = params;
853
854
  const [themeName] = buildContext.themeNames;
854
855
  if (external_fs_default().existsSync(resourcesDirPath)) {
@@ -1254,13 +1255,13 @@ async function generateResources(params) {
1254
1255
  break copy_main_theme_to_theme_variant_theme;
1255
1256
  }
1256
1257
  (0,transformCodebase/* transformCodebase */.N)({
1257
- srcDirPath: (0,external_path_.join)(resourcesDirPath, "theme", themeName),
1258
- destDirPath: (0,external_path_.join)(resourcesDirPath, "theme", themeVariantName),
1258
+ srcDirPath: (0,external_path_.join)(resourcesDirPath, "theme", themeName, themeType),
1259
+ destDirPath: (0,external_path_.join)(resourcesDirPath, "theme", themeVariantName, themeType),
1259
1260
  transformSourceCode: isNative
1260
1261
  ? undefined
1261
1262
  : ({ fileRelativePath, sourceCode }) => {
1262
1263
  if ((0,external_path_.extname)(fileRelativePath) === ".ftl" &&
1263
- fileRelativePath.split(external_path_.sep).length === 2) {
1264
+ fileRelativePath.split(external_path_.sep).length === 1) {
1264
1265
  const modifiedSourceCode = Buffer.from(Buffer.from(sourceCode)
1265
1266
  .toString("utf-8")
1266
1267
  .replace(`"themeName": "${themeName}"`, `"themeName": "${themeVariantName}"`), "utf8");
@@ -1289,7 +1290,7 @@ async function generateResources(params) {
1289
1290
  }
1290
1291
  }
1291
1292
  const emailThemeDirPath = getThemeTypeDirPath({
1292
- themeName,
1293
+ themeName: themeVariantName,
1293
1294
  themeType
1294
1295
  });
1295
1296
  (0,transformCodebase/* transformCodebase */.N)({
@@ -1302,13 +1303,14 @@ async function generateResources(params) {
1302
1303
  return {
1303
1304
  modifiedSourceCode: Buffer.from(sourceCode
1304
1305
  .toString("utf8")
1305
- .replace(/xKeycloakify\.themeName/g, `"${themeName}"`), "utf8")
1306
+ .replace(/xKeycloakify\.themeName/g, `"${themeVariantName}"`), "utf8")
1306
1307
  };
1307
1308
  }
1308
1309
  });
1309
1310
  }
1310
1311
  }
1311
1312
  }
1313
+ console.log(`Generated resources in ${Date.now() - start}ms`);
1312
1314
  }
1313
1315
  //# sourceMappingURL=generateResources.js.map
1314
1316
  ;// CONCATENATED MODULE: ./dist/bin/keycloakify/generateResources/index.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "11.8.1",
3
+ "version": "11.8.3",
4
4
  "description": "Framework to create custom Keycloak UIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,6 +57,8 @@ export async function generateResources(params: {
57
57
  buildContext: BuildContextLike;
58
58
  resourcesDirPath: string;
59
59
  }): Promise<void> {
60
+ const start = Date.now();
61
+
60
62
  const { resourcesDirPath, buildContext } = params;
61
63
 
62
64
  const [themeName] = buildContext.themeNames;
@@ -681,14 +683,19 @@ export async function generateResources(params: {
681
683
  }
682
684
 
683
685
  transformCodebase({
684
- srcDirPath: pathJoin(resourcesDirPath, "theme", themeName),
685
- destDirPath: pathJoin(resourcesDirPath, "theme", themeVariantName),
686
+ srcDirPath: pathJoin(resourcesDirPath, "theme", themeName, themeType),
687
+ destDirPath: pathJoin(
688
+ resourcesDirPath,
689
+ "theme",
690
+ themeVariantName,
691
+ themeType
692
+ ),
686
693
  transformSourceCode: isNative
687
694
  ? undefined
688
695
  : ({ fileRelativePath, sourceCode }) => {
689
696
  if (
690
697
  pathExtname(fileRelativePath) === ".ftl" &&
691
- fileRelativePath.split(pathSep).length === 2
698
+ fileRelativePath.split(pathSep).length === 1
692
699
  ) {
693
700
  const modifiedSourceCode = Buffer.from(
694
701
  Buffer.from(sourceCode)
@@ -737,7 +744,7 @@ export async function generateResources(params: {
737
744
  }
738
745
 
739
746
  const emailThemeDirPath = getThemeTypeDirPath({
740
- themeName,
747
+ themeName: themeVariantName,
741
748
  themeType
742
749
  });
743
750
 
@@ -755,7 +762,7 @@ export async function generateResources(params: {
755
762
  .toString("utf8")
756
763
  .replace(
757
764
  /xKeycloakify\.themeName/g,
758
- `"${themeName}"`
765
+ `"${themeVariantName}"`
759
766
  ),
760
767
  "utf8"
761
768
  )
@@ -765,4 +772,6 @@ export async function generateResources(params: {
765
772
  }
766
773
  }
767
774
  }
775
+
776
+ console.log(`Generated resources in ${Date.now() - start}ms`);
768
777
  }