@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.js CHANGED
@@ -697,6 +697,19 @@ const getSDKVersions = () => {
697
697
  }, {});
698
698
  return sdkVersions;
699
699
  };
700
+ const hrtimeToISO8601 = (hrtime) => {
701
+ if (hrtime === null || hrtime === undefined) {
702
+ return "";
703
+ }
704
+ const seconds = hrtime[0];
705
+ const nanoseconds = hrtime[1];
706
+ // Convert time components
707
+ const totalSeconds = seconds + nanoseconds / 1e9;
708
+ const minutes = Math.floor(totalSeconds / 60);
709
+ const remainingSeconds = totalSeconds % 60;
710
+ // Format ISO 8601 duration without hours
711
+ return `PT${minutes > 0 ? minutes + "M" : ""}${remainingSeconds.toFixed(3)}S`;
712
+ };
700
713
 
701
714
  var cleanup = async (ctx) => {
702
715
  await extractBuild(ctx);
@@ -731,6 +744,9 @@ async function createManifest({ ctx, typesFileName, metaFileName, editorsMetaFil
731
744
  sdkVersions,
732
745
  packageManager,
733
746
  packageManagerVersion,
747
+ metrics: {
748
+ buildTime: hrtimeToISO8601(ctx.buildTime),
749
+ },
734
750
  },
735
751
  };
736
752
  await fs__namespace.writeFile(path__namespace.join(ctx.client.tmpDir, "embeddable-manifest.json"), JSON.stringify(manifest));
@@ -21317,6 +21333,7 @@ var build = async () => {
21317
21333
  await initLogger("build");
21318
21334
  const breadcrumbs = [];
21319
21335
  try {
21336
+ const startTime = process.hrtime();
21320
21337
  checkNodeVersion();
21321
21338
  breadcrumbs.push("checkNodeVersion");
21322
21339
  removeBuildSuccessFlag();
@@ -21336,6 +21353,8 @@ var build = async () => {
21336
21353
  // NOTE: likely this will be called inside the loop above if we decide to support clients with mixed frameworks simultaneously.
21337
21354
  breadcrumbs.push("generate");
21338
21355
  await generate(config, "sdk-react");
21356
+ // Calculating build time in seconds
21357
+ config.buildTime = process.hrtime(startTime);
21339
21358
  breadcrumbs.push("cleanup");
21340
21359
  await cleanup(config);
21341
21360
  await storeBuildSuccessFlag();
@@ -21950,7 +21969,7 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
21950
21969
  };
21951
21970
 
21952
21971
  var name = "@embeddable.com/sdk-core";
21953
- var version = "3.9.3";
21972
+ var version = "3.9.4";
21954
21973
  var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
21955
21974
  var keywords = [
21956
21975
  "embeddable",