nuxt-skew-protection 0.3.2 → 0.3.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/dist/module.json +1 -1
- package/dist/module.mjs +10 -5
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -681,20 +681,25 @@ export {}
|
|
|
681
681
|
});
|
|
682
682
|
const assets = await assetManager.getAssetsFromBuild(outputDir);
|
|
683
683
|
const { isExistingVersion } = await assetManager.updateVersionsManifest(buildId, assets);
|
|
684
|
+
const manifest = await assetManager.getManifest();
|
|
685
|
+
const totalReleases = Object.keys(manifest.versions).length;
|
|
686
|
+
const timestamps = Object.values(manifest.versions).map((v) => new Date(v.timestamp).getTime());
|
|
687
|
+
const oldestTimestamp = Math.min(...timestamps);
|
|
688
|
+
const daysSince = Math.floor((Date.now() - oldestTimestamp) / (1e3 * 60 * 60 * 24));
|
|
689
|
+
const timeInfo = daysSince > 0 ? `${daysSince} day${daysSince > 1 ? "s" : ""} ago` : "today";
|
|
684
690
|
logger.log(colors.cyan(`Initialising Nuxt Skew Protection v${version}...`));
|
|
691
|
+
logger.log(` ${totalReleases} releases stored (oldest from ${timeInfo})`);
|
|
685
692
|
const storageInfo = options.storage.base ? `${colors.green(options.storage.driver)} ${colors.gray(`(${options.storage.base})`)}` : colors.green(options.storage.driver);
|
|
686
693
|
logger.log(` Database: ${storageInfo}`);
|
|
687
694
|
logger.log(` Storing ${colors.yellow(assets.length.toString())} assets in storage...`);
|
|
688
|
-
await assetManager.storeAssetsInStorage(buildId, outputDir, assets).
|
|
689
|
-
logger.
|
|
690
|
-
}).catch((error) => {
|
|
691
|
-
logger.error(` \u2717 Failed to store assets:`, error instanceof Error ? error.message : error);
|
|
695
|
+
await assetManager.storeAssetsInStorage(buildId, outputDir, assets).catch((error) => {
|
|
696
|
+
logger.error(`Failed to store assets:`, error instanceof Error ? error.message : error);
|
|
692
697
|
throw error;
|
|
693
698
|
});
|
|
694
699
|
const existingVersions = await assetManager.listExistingVersions();
|
|
695
700
|
const versionCount = existingVersions.filter((v) => v.id !== buildId).length;
|
|
701
|
+
logger.success(`Successfully stored ${assets.length} assets for latest release`);
|
|
696
702
|
if (versionCount > 0) {
|
|
697
|
-
const manifest = await assetManager.getManifest();
|
|
698
703
|
let totalAssets = 0;
|
|
699
704
|
const versionSizes = [];
|
|
700
705
|
for (const [vId, vData] of Object.entries(manifest.versions)) {
|