@shipstatic/types 0.7.2 → 0.7.3

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/index.d.ts CHANGED
@@ -388,6 +388,19 @@ export declare const BLOCKED_EXTENSIONS: ReadonlySet<string>;
388
388
  * isBlockedExtension('README') // false
389
389
  */
390
390
  export declare function isBlockedExtension(filename: string): boolean;
391
+ /**
392
+ * Directory names that indicate an unbuilt project was uploaded instead of build output.
393
+ * Used for early detection in CLI, browser, and server validation.
394
+ */
395
+ export declare const UNBUILT_PROJECT_MARKERS: ReadonlySet<string>;
396
+ /**
397
+ * Check if a file path contains an unbuilt project marker directory.
398
+ *
399
+ * @example
400
+ * hasUnbuiltMarker('node_modules/react/index.js') // true
401
+ * hasUnbuiltMarker('dist/index.html') // false
402
+ */
403
+ export declare function hasUnbuiltMarker(filePath: string): boolean;
391
404
  /**
392
405
  * Simple ping response for health checks
393
406
  */
package/dist/index.js CHANGED
@@ -249,6 +249,27 @@ export function isBlockedExtension(filename) {
249
249
  const ext = filename.slice(dotIndex + 1).toLowerCase();
250
250
  return BLOCKED_EXTENSIONS.has(ext);
251
251
  }
252
+ // =============================================================================
253
+ // UNBUILT PROJECT MARKERS
254
+ // =============================================================================
255
+ /**
256
+ * Directory names that indicate an unbuilt project was uploaded instead of build output.
257
+ * Used for early detection in CLI, browser, and server validation.
258
+ */
259
+ export const UNBUILT_PROJECT_MARKERS = new Set([
260
+ 'node_modules',
261
+ ]);
262
+ /**
263
+ * Check if a file path contains an unbuilt project marker directory.
264
+ *
265
+ * @example
266
+ * hasUnbuiltMarker('node_modules/react/index.js') // true
267
+ * hasUnbuiltMarker('dist/index.html') // false
268
+ */
269
+ export function hasUnbuiltMarker(filePath) {
270
+ const segments = filePath.replace(/\\/g, '/').split('/').filter(Boolean);
271
+ return segments.some(s => UNBUILT_PROJECT_MARKERS.has(s));
272
+ }
252
273
  // API Key Configuration
253
274
  export const API_KEY_PREFIX = 'ship-';
254
275
  export const API_KEY_HEX_LENGTH = 64;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Shared types for Shipstatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -571,6 +571,30 @@ export function isBlockedExtension(filename: string): boolean {
571
571
  return BLOCKED_EXTENSIONS.has(ext);
572
572
  }
573
573
 
574
+ // =============================================================================
575
+ // UNBUILT PROJECT MARKERS
576
+ // =============================================================================
577
+
578
+ /**
579
+ * Directory names that indicate an unbuilt project was uploaded instead of build output.
580
+ * Used for early detection in CLI, browser, and server validation.
581
+ */
582
+ export const UNBUILT_PROJECT_MARKERS: ReadonlySet<string> = new Set([
583
+ 'node_modules',
584
+ ]);
585
+
586
+ /**
587
+ * Check if a file path contains an unbuilt project marker directory.
588
+ *
589
+ * @example
590
+ * hasUnbuiltMarker('node_modules/react/index.js') // true
591
+ * hasUnbuiltMarker('dist/index.html') // false
592
+ */
593
+ export function hasUnbuiltMarker(filePath: string): boolean {
594
+ const segments = filePath.replace(/\\/g, '/').split('/').filter(Boolean);
595
+ return segments.some(s => UNBUILT_PROJECT_MARKERS.has(s));
596
+ }
597
+
574
598
  // =============================================================================
575
599
  // COMMON RESPONSE PATTERNS
576
600
  // =============================================================================