@shipstatic/ship 0.4.22 → 0.4.24

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/browser.d.ts CHANGED
@@ -535,27 +535,30 @@ declare function getENV(): ExecutionEnvironment;
535
535
  */
536
536
  declare function formatFileSize(bytes: number, decimals?: number): string;
537
537
  /**
538
- * Validate files against configuration limits
538
+ * Validate files against configuration limits with severity-based reporting
539
539
  *
540
- * ATOMIC VALIDATION: If ANY file fails validation, ALL files are rejected.
541
- * This ensures deployments are all-or-nothing for data integrity.
540
+ * Validation categorizes issues by severity:
541
+ * - **Errors**: Block deployment (file too large, invalid type, etc.)
542
+ * - **Warnings**: Exclude files but allow deployment (empty files, etc.)
542
543
  *
543
544
  * @param files - Array of files to validate
544
545
  * @param config - Validation configuration from ship.getConfig()
545
- * @returns Validation result with updated file status
546
+ * @returns Validation result with errors and warnings
546
547
  *
547
548
  * @example
548
549
  * ```typescript
549
550
  * const config = await ship.getConfig();
550
551
  * const result = validateFiles(files, config);
551
552
  *
552
- * if (result.error) {
553
- * // Validation failed - result.validFiles will be empty
554
- * console.error(result.error.details);
555
- * // Show individual file errors:
556
- * result.files.forEach(f => console.log(`${f.name}: ${f.statusMessage}`));
553
+ * if (!result.canDeploy) {
554
+ * // Has errors - deployment blocked
555
+ * console.error('Deployment blocked:', result.errors);
556
+ * } else if (result.warnings.length > 0) {
557
+ * // Has warnings - deployment proceeds, some files excluded
558
+ * console.warn('Files excluded:', result.warnings);
559
+ * await ship.deploy(result.validFiles);
557
560
  * } else {
558
- * // All files valid - safe to upload
561
+ * // All files valid
559
562
  * await ship.deploy(result.validFiles);
560
563
  * }
561
564
  * ```