@embeddable.com/sdk-core 3.9.3 → 3.9.4

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/lib/index.esm.js CHANGED
@@ -669,6 +669,19 @@ const getSDKVersions = () => {
669
669
  }, {});
670
670
  return sdkVersions;
671
671
  };
672
+ const hrtimeToISO8601 = (hrtime) => {
673
+ if (hrtime === null || hrtime === undefined) {
674
+ return "";
675
+ }
676
+ const seconds = hrtime[0];
677
+ const nanoseconds = hrtime[1];
678
+ // Convert time components
679
+ const totalSeconds = seconds + nanoseconds / 1e9;
680
+ const minutes = Math.floor(totalSeconds / 60);
681
+ const remainingSeconds = totalSeconds % 60;
682
+ // Format ISO 8601 duration without hours
683
+ return `PT${minutes > 0 ? minutes + "M" : ""}${remainingSeconds.toFixed(3)}S`;
684
+ };
672
685
 
673
686
  var cleanup = async (ctx) => {
674
687
  await extractBuild(ctx);
@@ -703,6 +716,9 @@ async function createManifest({ ctx, typesFileName, metaFileName, editorsMetaFil
703
716
  sdkVersions,
704
717
  packageManager,
705
718
  packageManagerVersion,
719
+ metrics: {
720
+ buildTime: hrtimeToISO8601(ctx.buildTime),
721
+ },
706
722
  },
707
723
  };
708
724
  await fs.writeFile(path.join(ctx.client.tmpDir, "embeddable-manifest.json"), JSON.stringify(manifest));
@@ -21289,6 +21305,7 @@ var build = async () => {
21289
21305
  await initLogger("build");
21290
21306
  const breadcrumbs = [];
21291
21307
  try {
21308
+ const startTime = process.hrtime();
21292
21309
  checkNodeVersion();
21293
21310
  breadcrumbs.push("checkNodeVersion");
21294
21311
  removeBuildSuccessFlag();
@@ -21308,6 +21325,8 @@ var build = async () => {
21308
21325
  // NOTE: likely this will be called inside the loop above if we decide to support clients with mixed frameworks simultaneously.
21309
21326
  breadcrumbs.push("generate");
21310
21327
  await generate(config, "sdk-react");
21328
+ // Calculating build time in seconds
21329
+ config.buildTime = process.hrtime(startTime);
21311
21330
  breadcrumbs.push("cleanup");
21312
21331
  await cleanup(config);
21313
21332
  await storeBuildSuccessFlag();
@@ -21922,7 +21941,7 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
21922
21941
  };
21923
21942
 
21924
21943
  var name = "@embeddable.com/sdk-core";
21925
- var version = "3.9.3";
21944
+ var version = "3.9.4";
21926
21945
  var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
21927
21946
  var keywords = [
21928
21947
  "embeddable",