keycloakify 10.0.0-rc.64 → 10.0.0-rc.66

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.
Files changed (49) hide show
  1. package/account/KcContext/KcContext.d.ts +1 -0
  2. package/account/KcContext/KcContext.js.map +1 -1
  3. package/account/KcContext/kcContextMocks.js +2 -1
  4. package/account/KcContext/kcContextMocks.js.map +1 -1
  5. package/account/pages/Totp.js +2 -7
  6. package/account/pages/Totp.js.map +1 -1
  7. package/bin/193.index.js +0 -501
  8. package/bin/246.index.js +371 -75118
  9. package/bin/363.index.js +36 -665
  10. package/bin/453.index.js +603 -23
  11. package/bin/{890.index.js → 456.index.js} +1831 -3
  12. package/bin/490.index.js +75195 -0
  13. package/bin/526.index.js +311 -166
  14. package/bin/538.index.js +1 -509
  15. package/bin/{240.index.js → 751.index.js} +306 -322
  16. package/bin/772.index.js +1 -1
  17. package/bin/837.index.js +787 -0
  18. package/bin/932.index.js +1 -574
  19. package/bin/97.index.js +594 -14
  20. package/bin/main.js +8 -8
  21. package/bin/shared/buildContext.d.ts +16 -0
  22. package/bin/shared/constants.d.ts +1 -1
  23. package/bin/shared/constants.js +1 -1
  24. package/bin/shared/constants.js.map +1 -1
  25. package/package.json +5 -9
  26. package/src/account/KcContext/KcContext.ts +1 -0
  27. package/src/account/KcContext/kcContextMocks.ts +2 -1
  28. package/src/account/pages/Totp.tsx +1 -7
  29. package/src/bin/add-story.ts +1 -6
  30. package/src/bin/eject-page.ts +7 -8
  31. package/src/bin/initialize-email-theme.ts +1 -6
  32. package/src/bin/keycloakify/buildJars/buildJars.ts +23 -49
  33. package/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl +8 -6
  34. package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +15 -20
  35. package/src/bin/keycloakify/keycloakify.ts +6 -8
  36. package/src/bin/shared/buildContext.ts +434 -42
  37. package/src/bin/shared/constants.ts +2 -1
  38. package/src/bin/shared/downloadKeycloakDefaultTheme.ts +135 -108
  39. package/src/bin/shared/generateKcGenTs.ts +2 -6
  40. package/src/bin/start-keycloak/keycloakifyBuild.ts +4 -4
  41. package/src/bin/start-keycloak/start-keycloak.ts +40 -83
  42. package/src/vite-plugin/vite-plugin.ts +5 -4
  43. package/vite-plugin/index.js +410 -187
  44. package/bin/480.index.js +0 -466
  45. package/bin/818.index.js +0 -1802
  46. package/bin/827.index.js +0 -1094
  47. package/src/bin/shared/getImplementedThemeTypes.ts +0 -23
  48. package/src/bin/shared/getJarFileBasename.ts +0 -11
  49. package/src/bin/shared/getThemeSrcDirPath.ts +0 -62
package/bin/363.index.js CHANGED
@@ -678,8 +678,6 @@ async function bringInAccountV1(params) {
678
678
  ].join("\n"), "utf8"));
679
679
  }
680
680
  //# sourceMappingURL=bringInAccountV1.js.map
681
- // EXTERNAL MODULE: ./dist/bin/shared/getThemeSrcDirPath.js
682
- var getThemeSrcDirPath = __webpack_require__(39216);
683
681
  // EXTERNAL MODULE: ./dist/bin/tools/fs.rmSync.js
684
682
  var fs_rmSync = __webpack_require__(89693);
685
683
  // EXTERNAL MODULE: ./dist/bin/tools/readThisNpmPackageVersion.js
@@ -709,8 +707,6 @@ function writeMetaInfKeycloakThemes(params) {
709
707
  var objectEntries = __webpack_require__(39612);
710
708
  // EXTERNAL MODULE: ./dist/bin/tools/escapeStringForPropertiesFile.js
711
709
  var escapeStringForPropertiesFile = __webpack_require__(27190);
712
- // EXTERNAL MODULE: ./dist/bin/shared/getImplementedThemeTypes.js
713
- var getImplementedThemeTypes = __webpack_require__(64409);
714
710
  ;// CONCATENATED MODULE: ./dist/bin/keycloakify/generateResources/generateResourcesForMainTheme.js
715
711
 
716
712
 
@@ -730,25 +726,17 @@ var getImplementedThemeTypes = __webpack_require__(64409);
730
726
 
731
727
 
732
728
 
733
-
734
-
735
729
  (0,assert.assert)();
736
730
  async function generateResourcesForMainTheme(params) {
737
731
  var _a;
738
732
  const { themeName, resourcesDirPath, buildContext } = params;
739
- const { themeSrcDirPath } = (0,getThemeSrcDirPath/* getThemeSrcDirPath */.f)({
740
- projectDirPath: buildContext.projectDirPath
741
- });
742
- const { implementedThemeTypes } = (0,getImplementedThemeTypes/* getImplementedThemeTypes */.C)({
743
- projectDirPath: buildContext.projectDirPath
744
- });
745
733
  const getThemeTypeDirPath = (params) => {
746
734
  const { themeType } = params;
747
735
  return (0,external_path_.join)(resourcesDirPath, "theme", themeName, themeType);
748
736
  };
749
737
  const cssGlobalsToDefine = {};
750
738
  for (const themeType of ["login", "account"]) {
751
- if (!implementedThemeTypes[themeType]) {
739
+ if (!buildContext.recordIsImplementedByThemeType[themeType]) {
752
740
  continue;
753
741
  }
754
742
  const themeTypeDirPath = getThemeTypeDirPath({ themeType });
@@ -756,7 +744,8 @@ async function generateResourcesForMainTheme(params) {
756
744
  const destDirPath = (0,external_path_.join)(themeTypeDirPath, "resources", constants/* basenameOfTheKeycloakifyResourcesDir */.M);
757
745
  // NOTE: Prevent accumulation of files in the assets dir, as names are hashed they pile up.
758
746
  (0,fs_rmSync/* rmSync */.a)(destDirPath, { recursive: true, force: true });
759
- if (themeType === "account" && implementedThemeTypes.login) {
747
+ if (themeType === "account" &&
748
+ buildContext.recordIsImplementedByThemeType.login) {
760
749
  // NOTE: We prevent doing it twice, it has been done for the login theme.
761
750
  (0,transformCodebase/* transformCodebase */.N)({
762
751
  srcDirPath: (0,external_path_.join)(getThemeTypeDirPath({
@@ -816,7 +805,7 @@ async function generateResourcesForMainTheme(params) {
816
805
  keycloakifyVersion: (0,readThisNpmPackageVersion/* readThisNpmPackageVersion */.K)(),
817
806
  themeType,
818
807
  fieldNames: readFieldNameUsage({
819
- themeSrcDirPath,
808
+ themeSrcDirPath: buildContext.themeSrcDirPath,
820
809
  themeType
821
810
  })
822
811
  });
@@ -831,14 +820,14 @@ async function generateResourcesForMainTheme(params) {
831
820
  })(),
832
821
  ...readExtraPagesNames({
833
822
  themeType,
834
- themeSrcDirPath
823
+ themeSrcDirPath: buildContext.themeSrcDirPath
835
824
  })
836
825
  ].forEach(pageId => {
837
826
  const { ftlCode } = generateFtlFilesCode({ pageId });
838
827
  external_fs_.writeFileSync((0,external_path_.join)(themeTypeDirPath, pageId), Buffer.from(ftlCode, "utf8"));
839
828
  });
840
829
  (0,generateMessageProperties/* generateMessageProperties */.k)({
841
- themeSrcDirPath,
830
+ themeSrcDirPath: buildContext.themeSrcDirPath,
842
831
  themeType
843
832
  }).forEach(({ languageTag, propertiesFileSource }) => {
844
833
  const messagesDirPath = (0,external_path_.join)(themeTypeDirPath, "messages");
@@ -876,16 +865,16 @@ async function generateResourcesForMainTheme(params) {
876
865
  ].join("\n\n"), "utf8"));
877
866
  }
878
867
  email: {
879
- if (!implementedThemeTypes.email) {
868
+ if (!buildContext.recordIsImplementedByThemeType.email) {
880
869
  break email;
881
870
  }
882
- const emailThemeSrcDirPath = (0,external_path_.join)(themeSrcDirPath, "email");
871
+ const emailThemeSrcDirPath = (0,external_path_.join)(buildContext.themeSrcDirPath, "email");
883
872
  (0,transformCodebase/* transformCodebase */.N)({
884
873
  srcDirPath: emailThemeSrcDirPath,
885
874
  destDirPath: getThemeTypeDirPath({ themeType: "email" })
886
875
  });
887
876
  }
888
- if (implementedThemeTypes.account) {
877
+ if (buildContext.recordIsImplementedByThemeType.account) {
889
878
  await bringInAccountV1({
890
879
  resourcesDirPath,
891
880
  buildContext
@@ -895,11 +884,11 @@ async function generateResourcesForMainTheme(params) {
895
884
  const metaInfKeycloakThemes = { themes: [] };
896
885
  metaInfKeycloakThemes.themes.push({
897
886
  name: themeName,
898
- types: (0,objectEntries.objectEntries)(implementedThemeTypes)
887
+ types: (0,objectEntries.objectEntries)(buildContext.recordIsImplementedByThemeType)
899
888
  .filter(([, isImplemented]) => isImplemented)
900
889
  .map(([themeType]) => themeType)
901
890
  });
902
- if (implementedThemeTypes.account) {
891
+ if (buildContext.recordIsImplementedByThemeType.account) {
903
892
  metaInfKeycloakThemes.themes.push({
904
893
  name: constants/* accountV1ThemeName */.y_,
905
894
  types: ["account"]
@@ -989,8 +978,6 @@ var external_child_process_ = __webpack_require__(32081);
989
978
  var external_child_process_default = /*#__PURE__*/__webpack_require__.n(external_child_process_);
990
979
  // EXTERNAL MODULE: ./dist/bin/shared/buildContext.js + 1 modules
991
980
  var shared_buildContext = __webpack_require__(87751);
992
- // EXTERNAL MODULE: ./node_modules/tsafe/exclude.js
993
- var exclude = __webpack_require__(41370);
994
981
  ;// CONCATENATED MODULE: ./dist/bin/keycloakify/buildJars/extensionVersions.js
995
982
  // NOTE: v0.5 is a dummy version.
996
983
  const keycloakAccountV1Versions = [null, "0.3", "0.4", "0.6"];
@@ -1244,22 +1231,15 @@ async function buildJar(params) {
1244
1231
  (0,fs_rmSync/* rmSync */.a)(keycloakifyBuildTmpDirPath, { recursive: true });
1245
1232
  }
1246
1233
  //# sourceMappingURL=buildJar.js.map
1247
- // EXTERNAL MODULE: ./dist/bin/shared/getJarFileBasename.js
1248
- var getJarFileBasename = __webpack_require__(2323);
1249
1234
  ;// CONCATENATED MODULE: ./dist/bin/keycloakify/buildJars/buildJars.js
1250
1235
 
1251
1236
 
1252
1237
 
1253
1238
 
1254
-
1255
-
1256
-
1257
1239
  (0,assert.assert)();
1258
1240
  async function buildJars(params) {
1259
- const { onlyBuildJarFileBasename, resourcesDirPath, buildContext } = params;
1260
- const doesImplementAccountTheme = (0,getImplementedThemeTypes/* getImplementedThemeTypes */.C)({
1261
- projectDirPath: buildContext.projectDirPath
1262
- }).implementedThemeTypes.account;
1241
+ const { resourcesDirPath, buildContext } = params;
1242
+ const doesImplementAccountTheme = buildContext.recordIsImplementedByThemeType.account;
1263
1243
  await Promise.all(keycloakAccountV1Versions.map(keycloakAccountV1Version => keycloakThemeAdditionalInfoExtensionVersions.map(keycloakThemeAdditionalInfoExtensionVersion => {
1264
1244
  const keycloakVersionRange = getKeycloakVersionRangeForJar({
1265
1245
  doesImplementAccountTheme,
@@ -1269,33 +1249,19 @@ async function buildJars(params) {
1269
1249
  if (keycloakVersionRange === undefined) {
1270
1250
  return undefined;
1271
1251
  }
1272
- return {
1273
- keycloakThemeAdditionalInfoExtensionVersion,
1274
- keycloakVersionRange
1275
- };
1276
- })
1277
- .filter((0,exclude.exclude)(undefined))
1278
- .map(({ keycloakThemeAdditionalInfoExtensionVersion, keycloakVersionRange }) => {
1279
- const { jarFileBasename } = (0,getJarFileBasename/* getJarFileBasename */.m)({
1280
- keycloakVersionRange
1281
- });
1282
- if (onlyBuildJarFileBasename !== undefined &&
1283
- onlyBuildJarFileBasename !== jarFileBasename) {
1252
+ const jarTarget = buildContext.jarTargets.find(jarTarget => jarTarget.keycloakVersionRange === keycloakVersionRange);
1253
+ if (jarTarget === undefined) {
1284
1254
  return undefined;
1285
1255
  }
1286
- return {
1256
+ const { jarFileBasename } = jarTarget;
1257
+ return buildJar({
1258
+ jarFileBasename,
1259
+ keycloakAccountV1Version,
1287
1260
  keycloakThemeAdditionalInfoExtensionVersion,
1288
- jarFileBasename
1289
- };
1290
- })
1291
- .filter((0,exclude.exclude)(undefined))
1292
- .map(({ keycloakThemeAdditionalInfoExtensionVersion, jarFileBasename }) => buildJar({
1293
- jarFileBasename,
1294
- keycloakAccountV1Version,
1295
- keycloakThemeAdditionalInfoExtensionVersion,
1296
- resourcesDirPath,
1297
- buildContext
1298
- })))
1261
+ resourcesDirPath,
1262
+ buildContext
1263
+ });
1264
+ }))
1299
1265
  .flat());
1300
1266
  }
1301
1267
  //# sourceMappingURL=buildJars.js.map
@@ -1371,13 +1337,15 @@ async function command(params) {
1371
1337
  }
1372
1338
  external_child_process_.execSync("npx vite", {
1373
1339
  cwd: buildContext.projectDirPath,
1374
- env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.runPostBuildScript */.fe.runPostBuildScript]: JSON.stringify(buildContext) })
1340
+ env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.runPostBuildScript */.fe.runPostBuildScript]: JSON.stringify({
1341
+ resourcesDirPath,
1342
+ buildContext
1343
+ }) })
1375
1344
  });
1376
1345
  }
1377
1346
  await buildJars({
1378
1347
  resourcesDirPath,
1379
- buildContext,
1380
- onlyBuildJarFileBasename: process.env[constants/* onlyBuildJarFileBasenameEnvName */.Dv]
1348
+ buildContext
1381
1349
  });
1382
1350
  (0,fs_rmSync/* rmSync */.a)(resourcesDirPath, { recursive: true });
1383
1351
  console.log(source_default().green(`✓ keycloak theme built in ${((Date.now() - startTime) / 1000).toFixed(2)}s`));
@@ -1389,396 +1357,6 @@ async function command(params) {
1389
1357
 
1390
1358
  /***/ }),
1391
1359
 
1392
- /***/ 47802:
1393
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1394
-
1395
-
1396
- // EXPORTS
1397
- __webpack_require__.d(__webpack_exports__, {
1398
- "x": () => (/* binding */ downloadKeycloakDefaultTheme)
1399
- });
1400
-
1401
- // EXTERNAL MODULE: external "path"
1402
- var external_path_ = __webpack_require__(71017);
1403
- // EXTERNAL MODULE: ./node_modules/tsafe/assert.js
1404
- var assert = __webpack_require__(88078);
1405
- // EXTERNAL MODULE: ./dist/bin/shared/constants.js
1406
- var constants = __webpack_require__(173);
1407
- // EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
1408
- var lib = __webpack_require__(9525);
1409
- var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
1410
- // EXTERNAL MODULE: external "fs/promises"
1411
- var promises_ = __webpack_require__(73292);
1412
- // EXTERNAL MODULE: ./dist/bin/tools/extractArchive.js
1413
- var extractArchive = __webpack_require__(29121);
1414
- // EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
1415
- var fs_existsAsync = __webpack_require__(43765);
1416
- // EXTERNAL MODULE: external "child_process"
1417
- var external_child_process_ = __webpack_require__(32081);
1418
- // EXTERNAL MODULE: external "util"
1419
- var external_util_ = __webpack_require__(73837);
1420
- ;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/fetchProxyOptions.js
1421
-
1422
-
1423
-
1424
- function ensureArray(arg0) {
1425
- return Array.isArray(arg0) ? arg0 : typeof arg0 === "undefined" ? [] : [arg0];
1426
- }
1427
- function ensureSingleOrNone(arg0) {
1428
- if (!Array.isArray(arg0))
1429
- return arg0;
1430
- if (arg0.length === 0)
1431
- return undefined;
1432
- if (arg0.length === 1)
1433
- return arg0[0];
1434
- throw new Error("Illegal configuration, expected a single value but found multiple: " +
1435
- arg0.map(String).join(", "));
1436
- }
1437
- /**
1438
- * Get npm configuration as map
1439
- */
1440
- async function getNmpConfig(params) {
1441
- const { npmWorkspaceRootDirPath } = params;
1442
- const exec = (0,external_util_.promisify)(external_child_process_.exec);
1443
- const stdout = await exec("npm config get", {
1444
- encoding: "utf8",
1445
- cwd: npmWorkspaceRootDirPath
1446
- }).then(({ stdout }) => stdout);
1447
- const npmConfigReducer = (cfg, [key, value]) => key in cfg
1448
- ? Object.assign(Object.assign({}, cfg), { [key]: [...ensureArray(cfg[key]), value] }) : Object.assign(Object.assign({}, cfg), { [key]: value });
1449
- return stdout
1450
- .split("\n")
1451
- .filter(line => !line.startsWith(";"))
1452
- .map(line => line.trim())
1453
- .map(line => line.split("=", 2))
1454
- .reduce(npmConfigReducer, {});
1455
- }
1456
- async function getProxyFetchOptions(params) {
1457
- var _a, _b, _c;
1458
- const { npmWorkspaceRootDirPath } = params;
1459
- const cfg = await getNmpConfig({ npmWorkspaceRootDirPath });
1460
- const proxy = ensureSingleOrNone((_a = cfg["https-proxy"]) !== null && _a !== void 0 ? _a : cfg["proxy"]);
1461
- const noProxy = (_b = cfg["noproxy"]) !== null && _b !== void 0 ? _b : cfg["no-proxy"];
1462
- function maybeBoolean(arg0) {
1463
- return typeof arg0 === "undefined" ? undefined : Boolean(arg0);
1464
- }
1465
- const strictSSL = maybeBoolean(ensureSingleOrNone(cfg["strict-ssl"]));
1466
- const cert = cfg["cert"];
1467
- const ca = ensureArray((_c = cfg["ca"]) !== null && _c !== void 0 ? _c : cfg["ca[]"]);
1468
- const cafile = ensureSingleOrNone(cfg["cafile"]);
1469
- if (typeof cafile !== "undefined" && cafile !== "null") {
1470
- ca.push(...(await (async () => {
1471
- function chunks(arr, size = 2) {
1472
- return arr
1473
- .map((_, i) => i % size == 0 && arr.slice(i, i + size))
1474
- .filter(Boolean);
1475
- }
1476
- const cafileContent = await (0,promises_.readFile)(cafile, "utf-8");
1477
- const newLinePlaceholder = "NEW_LINE_PLACEHOLDER_xIsPsK23svt";
1478
- return chunks(cafileContent.split(/(-----END CERTIFICATE-----)/), 2).map(ca => ca
1479
- .join("")
1480
- .replace(/\r?\n/g, newLinePlaceholder)
1481
- .replace(new RegExp(`^${newLinePlaceholder}`), "")
1482
- .replace(new RegExp(newLinePlaceholder, "g"), "\\n"));
1483
- })()));
1484
- }
1485
- return {
1486
- proxy,
1487
- noProxy,
1488
- strictSSL,
1489
- cert,
1490
- ca: ca.length === 0 ? undefined : ca
1491
- };
1492
- }
1493
- //# sourceMappingURL=fetchProxyOptions.js.map
1494
- // EXTERNAL MODULE: external "crypto"
1495
- var external_crypto_ = __webpack_require__(6113);
1496
- // EXTERNAL MODULE: ./dist/bin/tools/fs.rm.js
1497
- var fs_rm = __webpack_require__(8699);
1498
- ;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/downloadAndExtractArchive.js
1499
-
1500
-
1501
-
1502
-
1503
-
1504
-
1505
-
1506
-
1507
-
1508
- async function downloadAndExtractArchive(params) {
1509
- var _a;
1510
- const { url, uniqueIdOfOnOnArchiveFile, onArchiveFile, cacheDirPath, npmWorkspaceRootDirPath } = params;
1511
- const archiveFileBasename = url.split("?")[0].split("/").reverse()[0];
1512
- const archiveFilePath = (0,external_path_.join)(cacheDirPath, archiveFileBasename);
1513
- download: {
1514
- if (await (0,fs_existsAsync/* existsAsync */.o)(archiveFilePath)) {
1515
- const isDownloaded = await SuccessTracker.getIsDownloaded({
1516
- cacheDirPath,
1517
- archiveFileBasename
1518
- });
1519
- if (isDownloaded) {
1520
- break download;
1521
- }
1522
- await (0,promises_.unlink)(archiveFilePath);
1523
- await SuccessTracker.removeFromDownloaded({
1524
- cacheDirPath,
1525
- archiveFileBasename
1526
- });
1527
- }
1528
- await (0,promises_.mkdir)((0,external_path_.dirname)(archiveFilePath), { recursive: true });
1529
- const response = await lib_default()(url, await getProxyFetchOptions({ npmWorkspaceRootDirPath }));
1530
- (_a = response.body) === null || _a === void 0 ? void 0 : _a.setMaxListeners(Number.MAX_VALUE);
1531
- (0,assert.assert)(typeof response.body !== "undefined" && response.body != null);
1532
- await (0,promises_.writeFile)(archiveFilePath, response.body);
1533
- await SuccessTracker.markAsDownloaded({
1534
- cacheDirPath,
1535
- archiveFileBasename
1536
- });
1537
- }
1538
- const extractDirBasename = `${archiveFileBasename.split(".")[0]}_${uniqueIdOfOnOnArchiveFile}_${external_crypto_.createHash("sha256")
1539
- .update(onArchiveFile.toString())
1540
- .digest("hex")
1541
- .substring(0, 5)}`;
1542
- await Promise.all((await (0,promises_.readdir)(cacheDirPath))
1543
- .filter((() => {
1544
- const prefix = extractDirBasename
1545
- .split("_")
1546
- .reverse()
1547
- .slice(1)
1548
- .reverse()
1549
- .join("_");
1550
- return basename => basename !== extractDirBasename && basename.startsWith(prefix);
1551
- })())
1552
- .map(async (extractDirBasename) => {
1553
- await (0,fs_rm.rm)((0,external_path_.join)(cacheDirPath, extractDirBasename), { recursive: true });
1554
- await SuccessTracker.removeFromExtracted({
1555
- cacheDirPath,
1556
- extractDirBasename
1557
- });
1558
- }));
1559
- const extractedDirPath = (0,external_path_.join)(cacheDirPath, extractDirBasename);
1560
- extract_and_transform: {
1561
- if (await (0,fs_existsAsync/* existsAsync */.o)(extractedDirPath)) {
1562
- const isExtracted = await SuccessTracker.getIsExtracted({
1563
- cacheDirPath,
1564
- extractDirBasename
1565
- });
1566
- if (isExtracted) {
1567
- break extract_and_transform;
1568
- }
1569
- await (0,fs_rm.rm)(extractedDirPath, { recursive: true });
1570
- await SuccessTracker.removeFromExtracted({
1571
- cacheDirPath,
1572
- extractDirBasename
1573
- });
1574
- }
1575
- await (0,extractArchive/* extractArchive */.N)({
1576
- archiveFilePath,
1577
- onArchiveFile: async ({ relativeFilePathInArchive, readFile, writeFile }) => onArchiveFile({
1578
- fileRelativePath: relativeFilePathInArchive,
1579
- readFile,
1580
- writeFile: ({ fileRelativePath, modifiedData }) => writeFile({
1581
- filePath: (0,external_path_.join)(extractedDirPath, fileRelativePath),
1582
- modifiedData
1583
- })
1584
- })
1585
- });
1586
- await SuccessTracker.markAsExtracted({
1587
- cacheDirPath,
1588
- extractDirBasename
1589
- });
1590
- }
1591
- return { extractedDirPath };
1592
- }
1593
- var SuccessTracker;
1594
- (function (SuccessTracker) {
1595
- async function read(params) {
1596
- const { cacheDirPath } = params;
1597
- const filePath = (0,external_path_.join)(cacheDirPath, "downloadAndExtractArchive.json");
1598
- if (!(await (0,fs_existsAsync/* existsAsync */.o)(filePath))) {
1599
- return { archiveFileBasenames: [], extractDirBasenames: [] };
1600
- }
1601
- return JSON.parse((await (0,promises_.readFile)(filePath)).toString("utf8"));
1602
- }
1603
- async function write(params) {
1604
- const { cacheDirPath, successTracker } = params;
1605
- const filePath = (0,external_path_.join)(cacheDirPath, "downloadAndExtractArchive.json");
1606
- {
1607
- const dirPath = (0,external_path_.dirname)(filePath);
1608
- if (!(await (0,fs_existsAsync/* existsAsync */.o)(dirPath))) {
1609
- await (0,promises_.mkdir)(dirPath, { recursive: true });
1610
- }
1611
- }
1612
- await (0,promises_.writeFile)(filePath, JSON.stringify(successTracker));
1613
- }
1614
- async function markAsDownloaded(params) {
1615
- const { cacheDirPath, archiveFileBasename } = params;
1616
- const successTracker = await read({ cacheDirPath });
1617
- successTracker.archiveFileBasenames.push(archiveFileBasename);
1618
- await write({ cacheDirPath, successTracker });
1619
- }
1620
- SuccessTracker.markAsDownloaded = markAsDownloaded;
1621
- async function getIsDownloaded(params) {
1622
- const { cacheDirPath, archiveFileBasename } = params;
1623
- const successTracker = await read({ cacheDirPath });
1624
- return successTracker.archiveFileBasenames.includes(archiveFileBasename);
1625
- }
1626
- SuccessTracker.getIsDownloaded = getIsDownloaded;
1627
- async function removeFromDownloaded(params) {
1628
- const { cacheDirPath, archiveFileBasename } = params;
1629
- const successTracker = await read({ cacheDirPath });
1630
- successTracker.archiveFileBasenames = successTracker.archiveFileBasenames.filter(basename => basename !== archiveFileBasename);
1631
- await write({ cacheDirPath, successTracker });
1632
- }
1633
- SuccessTracker.removeFromDownloaded = removeFromDownloaded;
1634
- async function markAsExtracted(params) {
1635
- const { cacheDirPath, extractDirBasename } = params;
1636
- const successTracker = await read({ cacheDirPath });
1637
- successTracker.extractDirBasenames.push(extractDirBasename);
1638
- await write({ cacheDirPath, successTracker });
1639
- }
1640
- SuccessTracker.markAsExtracted = markAsExtracted;
1641
- async function getIsExtracted(params) {
1642
- const { cacheDirPath, extractDirBasename } = params;
1643
- const successTracker = await read({ cacheDirPath });
1644
- return successTracker.extractDirBasenames.includes(extractDirBasename);
1645
- }
1646
- SuccessTracker.getIsExtracted = getIsExtracted;
1647
- async function removeFromExtracted(params) {
1648
- const { cacheDirPath, extractDirBasename } = params;
1649
- const successTracker = await read({ cacheDirPath });
1650
- successTracker.extractDirBasenames = successTracker.extractDirBasenames.filter(basename => basename !== extractDirBasename);
1651
- await write({ cacheDirPath, successTracker });
1652
- }
1653
- SuccessTracker.removeFromExtracted = removeFromExtracted;
1654
- })(SuccessTracker || (SuccessTracker = {}));
1655
- //# sourceMappingURL=downloadAndExtractArchive.js.map
1656
- ;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/index.js
1657
-
1658
- //# sourceMappingURL=index.js.map
1659
- // EXTERNAL MODULE: ./dist/bin/tools/isInside.js
1660
- var isInside = __webpack_require__(90665);
1661
- ;// CONCATENATED MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme.js
1662
-
1663
-
1664
-
1665
-
1666
-
1667
- (0,assert.assert)();
1668
- async function downloadKeycloakDefaultTheme(params) {
1669
- const { keycloakVersion, buildContext } = params;
1670
- const { extractedDirPath } = await downloadAndExtractArchive({
1671
- url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
1672
- cacheDirPath: buildContext.cacheDirPath,
1673
- npmWorkspaceRootDirPath: buildContext.npmWorkspaceRootDirPath,
1674
- uniqueIdOfOnOnArchiveFile: "downloadKeycloakDefaultTheme",
1675
- onArchiveFile: async (params) => {
1676
- if (!(0,isInside/* isInside */.V)({ dirPath: "theme", filePath: params.fileRelativePath })) {
1677
- return;
1678
- }
1679
- const { readFile, writeFile } = params;
1680
- const fileRelativePath = (0,external_path_.relative)("theme", params.fileRelativePath);
1681
- skip_keycloak_v2: {
1682
- if (!(0,isInside/* isInside */.V)({
1683
- dirPath: (0,external_path_.join)("keycloak.v2"),
1684
- filePath: fileRelativePath
1685
- })) {
1686
- break skip_keycloak_v2;
1687
- }
1688
- return;
1689
- }
1690
- last_account_v1_transformations: {
1691
- if (constants/* lastKeycloakVersionWithAccountV1 */.v$ !== keycloakVersion) {
1692
- break last_account_v1_transformations;
1693
- }
1694
- patch_account_css: {
1695
- if (fileRelativePath !==
1696
- (0,external_path_.join)("keycloak", "account", "resources", "css", "account.css")) {
1697
- break patch_account_css;
1698
- }
1699
- await writeFile({
1700
- fileRelativePath,
1701
- modifiedData: Buffer.from((await readFile())
1702
- .toString("utf8")
1703
- .replace("top: -34px;", "top: -34px !important;"), "utf8")
1704
- });
1705
- return;
1706
- }
1707
- skip_web_modules: {
1708
- if (!(0,isInside/* isInside */.V)({
1709
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "web_modules"),
1710
- filePath: fileRelativePath
1711
- })) {
1712
- break skip_web_modules;
1713
- }
1714
- return;
1715
- }
1716
- skip_unused_node_modules: {
1717
- const nodeModulesDirPath = (0,external_path_.join)("keycloak", "common", "resources", "node_modules");
1718
- if (!(0,isInside/* isInside */.V)({
1719
- dirPath: nodeModulesDirPath,
1720
- filePath: fileRelativePath
1721
- })) {
1722
- break skip_unused_node_modules;
1723
- }
1724
- const toKeepPrefixes = [
1725
- ...[
1726
- "patternfly.min.css",
1727
- "patternfly-additions.min.css",
1728
- "patternfly-additions.min.css"
1729
- ].map(fileBasename => (0,external_path_.join)(nodeModulesDirPath, "patternfly", "dist", "css", fileBasename)),
1730
- (0,external_path_.join)(nodeModulesDirPath, "patternfly", "dist", "fonts")
1731
- ];
1732
- if (toKeepPrefixes.find(prefix => fileRelativePath.startsWith(prefix)) !== undefined) {
1733
- break skip_unused_node_modules;
1734
- }
1735
- return;
1736
- }
1737
- }
1738
- skip_unused_resources: {
1739
- if (keycloakVersion !== "24.0.4") {
1740
- break skip_unused_resources;
1741
- }
1742
- for (const dirBasename of [
1743
- "@patternfly-v5",
1744
- "@rollup",
1745
- "rollup",
1746
- "react",
1747
- "react-dom",
1748
- "shx",
1749
- ".pnpm"
1750
- ]) {
1751
- if ((0,isInside/* isInside */.V)({
1752
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "node_modules", dirBasename),
1753
- filePath: fileRelativePath
1754
- })) {
1755
- return;
1756
- }
1757
- }
1758
- for (const dirBasename of ["react", "react-dom"]) {
1759
- if ((0,isInside/* isInside */.V)({
1760
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "vendor", dirBasename),
1761
- filePath: fileRelativePath
1762
- })) {
1763
- return;
1764
- }
1765
- }
1766
- if ((0,isInside/* isInside */.V)({
1767
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "node_modules", "@patternfly", "react-core"),
1768
- filePath: fileRelativePath
1769
- })) {
1770
- return;
1771
- }
1772
- }
1773
- await writeFile({ fileRelativePath });
1774
- }
1775
- });
1776
- return { defaultThemeDirPath: extractedDirPath };
1777
- }
1778
- //# sourceMappingURL=downloadKeycloakDefaultTheme.js.map
1779
-
1780
- /***/ }),
1781
-
1782
1360
  /***/ 62190:
1783
1361
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1784
1362
 
@@ -1830,119 +1408,6 @@ async function downloadKeycloakStaticResources(params) {
1830
1408
 
1831
1409
  /***/ }),
1832
1410
 
1833
- /***/ 64409:
1834
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1835
-
1836
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1837
- /* harmony export */ "C": () => (/* binding */ getImplementedThemeTypes)
1838
- /* harmony export */ });
1839
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
1840
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
1841
- /* harmony import */ var tsafe_objectFromEntries__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68634);
1842
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57147);
1843
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_2__);
1844
- /* harmony import */ var _getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39216);
1845
-
1846
-
1847
-
1848
-
1849
- function getImplementedThemeTypes(params) {
1850
- const { projectDirPath } = params;
1851
- const { themeSrcDirPath } = (0,_getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_3__/* .getThemeSrcDirPath */ .f)({
1852
- projectDirPath
1853
- });
1854
- const implementedThemeTypes = (0,tsafe_objectFromEntries__WEBPACK_IMPORTED_MODULE_1__.objectFromEntries)(["login", "account", "email"].map(themeType => [
1855
- themeType,
1856
- fs__WEBPACK_IMPORTED_MODULE_2__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_0__.join)(themeSrcDirPath, themeType))
1857
- ]));
1858
- return { implementedThemeTypes };
1859
- }
1860
- //# sourceMappingURL=getImplementedThemeTypes.js.map
1861
-
1862
- /***/ }),
1863
-
1864
- /***/ 2323:
1865
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1866
-
1867
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1868
- /* harmony export */ "m": () => (/* binding */ getJarFileBasename)
1869
- /* harmony export */ });
1870
- function getJarFileBasename(params) {
1871
- const { keycloakVersionRange } = params;
1872
- const jarFileBasename = `keycloak-theme-for-kc-${keycloakVersionRange}.jar`;
1873
- return { jarFileBasename };
1874
- }
1875
- //# sourceMappingURL=getJarFileBasename.js.map
1876
-
1877
- /***/ }),
1878
-
1879
- /***/ 39216:
1880
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1881
-
1882
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1883
- /* harmony export */ "f": () => (/* binding */ getThemeSrcDirPath)
1884
- /* harmony export */ });
1885
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
1886
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
1887
- /* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1666);
1888
- /* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tsafe__WEBPACK_IMPORTED_MODULE_1__);
1889
- /* harmony import */ var _tools_crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
1890
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71017);
1891
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
1892
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(173);
1893
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(78818);
1894
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_5__);
1895
-
1896
-
1897
-
1898
-
1899
-
1900
-
1901
- let cache = undefined;
1902
- /** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
1903
- function getThemeSrcDirPath(params) {
1904
- const { projectDirPath } = params;
1905
- if (cache !== undefined && cache.projectDirPath === projectDirPath) {
1906
- const { themeSrcDirPath } = cache;
1907
- return { themeSrcDirPath };
1908
- }
1909
- cache = undefined;
1910
- const { themeSrcDirPath } = (() => {
1911
- const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(projectDirPath, "src");
1912
- const themeSrcDirPath = (0,_tools_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
1913
- dirPath: srcDirPath,
1914
- returnedPathsType: "relative to dirPath"
1915
- })
1916
- .map(fileRelativePath => {
1917
- for (const themeSrcDirBasename of themeSrcDirBasenames) {
1918
- const split = fileRelativePath.split(themeSrcDirBasename);
1919
- if (split.length === 2) {
1920
- return (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, split[0] + themeSrcDirBasename);
1921
- }
1922
- }
1923
- return undefined;
1924
- })
1925
- .filter((0,tsafe__WEBPACK_IMPORTED_MODULE_1__.exclude)(undefined))[0];
1926
- if (themeSrcDirPath !== undefined) {
1927
- return { themeSrcDirPath };
1928
- }
1929
- for (const themeType of [..._constants__WEBPACK_IMPORTED_MODULE_4__/* .themeTypes */ .rO, "email"]) {
1930
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, themeType))) {
1931
- continue;
1932
- }
1933
- return { themeSrcDirPath: srcDirPath };
1934
- }
1935
- console.log(chalk__WEBPACK_IMPORTED_MODULE_5___default().red("Can't locate your theme source directory. It should be either: "));
1936
- process.exit(-1);
1937
- })();
1938
- cache = { projectDirPath, themeSrcDirPath };
1939
- return { themeSrcDirPath };
1940
- }
1941
- const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
1942
- //# sourceMappingURL=getThemeSrcDirPath.js.map
1943
-
1944
- /***/ }),
1945
-
1946
1411
  /***/ 27190:
1947
1412
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1948
1413
 
@@ -2016,114 +1481,20 @@ function escapeStringForPropertiesFile(str) {
2016
1481
 
2017
1482
  /***/ }),
2018
1483
 
2019
- /***/ 89693:
1484
+ /***/ 90665:
2020
1485
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2021
1486
 
2022
1487
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2023
- /* harmony export */ "a": () => (/* binding */ rmSync)
1488
+ /* harmony export */ "V": () => (/* binding */ isInside)
2024
1489
  /* harmony export */ });
2025
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
2026
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
2027
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
2028
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
2029
- /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
2030
-
2031
-
2032
-
2033
- /**
2034
- * Polyfill of fs.rmSync(dirPath, { "recursive": true })
2035
- * For older version of Node
2036
- */
2037
- function rmSync(dirPath, options) {
2038
- if (_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.compare */ .h.compare(_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse(process.version), _SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse("14.14.0")) > 0) {
2039
- fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
2040
- return;
2041
- }
2042
- const { force = true } = options;
2043
- if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
2044
- return;
2045
- }
2046
- const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
2047
- const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
2048
- if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
2049
- removeDir_rec(fileOrDirPath);
2050
- return;
2051
- }
2052
- else {
2053
- fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
2054
- }
2055
- });
2056
- removeDir_rec(dirPath);
2057
- }
2058
- //# sourceMappingURL=fs.rmSync.js.map
2059
-
2060
- /***/ }),
2061
-
2062
- /***/ 60332:
2063
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2064
-
2065
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2066
- /* harmony export */ "N": () => (/* binding */ transformCodebase)
2067
- /* harmony export */ });
2068
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
2069
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
2070
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
2071
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
2072
- /* harmony import */ var _crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
2073
- /* harmony import */ var _tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89693);
2074
-
2075
-
2076
-
1490
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
1491
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
2077
1492
 
2078
- /**
2079
- * Apply a transformation function to every file of directory
2080
- * If source and destination are the same this function can be used to apply the transformation in place
2081
- * like filtering out some files or modifying them.
2082
- * */
2083
- function transformCodebase(params) {
2084
- const { srcDirPath, transformSourceCode } = params;
2085
- const isTargetSameAsSource = path__WEBPACK_IMPORTED_MODULE_1__.relative(srcDirPath, params.destDirPath) === "";
2086
- const destDirPath = isTargetSameAsSource
2087
- ? path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs")
2088
- : params.destDirPath;
2089
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(destDirPath, {
2090
- recursive: true
2091
- });
2092
- for (const fileRelativePath of (0,_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
2093
- dirPath: srcDirPath,
2094
- returnedPathsType: "relative to dirPath"
2095
- })) {
2096
- const filePath = path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, fileRelativePath);
2097
- const destFilePath = path__WEBPACK_IMPORTED_MODULE_1__.join(destDirPath, fileRelativePath);
2098
- // NOTE: Optimization, if we don't need to transform the file, just copy
2099
- // it using the lower level implementation.
2100
- if (transformSourceCode === undefined) {
2101
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
2102
- recursive: true
2103
- });
2104
- fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync(filePath, destFilePath);
2105
- continue;
2106
- }
2107
- const transformSourceCodeResult = transformSourceCode({
2108
- sourceCode: fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath),
2109
- filePath,
2110
- fileRelativePath
2111
- });
2112
- if (transformSourceCodeResult === undefined) {
2113
- continue;
2114
- }
2115
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
2116
- recursive: true
2117
- });
2118
- const { newFileName, modifiedSourceCode } = transformSourceCodeResult;
2119
- fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(path__WEBPACK_IMPORTED_MODULE_1__.join(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), newFileName !== null && newFileName !== void 0 ? newFileName : path__WEBPACK_IMPORTED_MODULE_1__.basename(destFilePath)), modifiedSourceCode);
2120
- }
2121
- if (isTargetSameAsSource) {
2122
- (0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__/* .rmSync */ .a)(srcDirPath, { recursive: true });
2123
- fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(destDirPath, srcDirPath);
2124
- }
1493
+ function isInside(params) {
1494
+ const { dirPath, filePath } = params;
1495
+ return !(0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(dirPath, filePath).startsWith("..");
2125
1496
  }
2126
- //# sourceMappingURL=transformCodebase.js.map
1497
+ //# sourceMappingURL=isInside.js.map
2127
1498
 
2128
1499
  /***/ })
2129
1500