@@ -12,7 +12,8 @@ import {
1212} from "node:fs" ;
1313import { parseHTML } from "linkedom" ;
1414import AdmZip from "adm-zip" ;
15- import ignore , { type Ignore } from "ignore" ;
15+ import type { Ignore } from "ignore" ;
16+ import { projectIgnore } from "@hyperframes/lint" ;
1617import { CSS_URL_RE , isNonRelativeUrl , isPathInside , rewriteSrcsetUrls } from "@hyperframes/core" ;
1718import { decodeUrlPathVariants , encodeUrlPath } from "@hyperframes/parsers" ;
1819import { buildAuthHeaders } from "../auth/client.js" ;
@@ -24,12 +25,6 @@ import { writeProjectLink } from "./projectLink.js";
2425
2526const IGNORED_DIRS = new Set ( [ ".git" , "node_modules" , "dist" , ".next" , "coverage" ] ) ;
2627const IGNORED_FILES = new Set ( [ ".DS_Store" , "Thumbs.db" ] ) ;
27- const HYPERFRAMES_IGNORE_FILE = ".hyperframesignore" ;
28- // Unanchored (no leading/mid slash) so it matches a dot-prefixed name at any
29- // depth, same as the segments it replaces below — but as a matcher pattern
30- // instead of a hard skip, a project's own `.hyperframesignore` negation can
31- // still override it.
32- const DEFAULT_PROJECT_IGNORE = [ "/renders/" , "/snapshots/" , ".*" ] ;
3328const PUBLISH_CONTENT_TYPE = "application/zip" ;
3429const PUBLISH_METADATA_TIMEOUT_MS = 30_000 ;
3530const PUBLISH_UPLOAD_MIN_TIMEOUT_MS = 120_000 ;
@@ -301,21 +296,12 @@ export function uploadTimeoutMs(byteLength: number): number {
301296
302297// Absolute, non-negotiable exclusions only — anything a `.hyperframesignore`
303298// negation rule should be able to override (including dot-prefixed paths;
304- // see DEFAULT_PROJECT_IGNORE ) must go through the ignore matcher instead of
299+ // see projectIgnore ) must go through the ignore matcher instead of
305300// short-circuiting here.
306301function shouldIgnoreSegment ( segment : string ) : boolean {
307302 return IGNORED_DIRS . has ( segment ) || IGNORED_FILES . has ( segment ) ;
308303}
309304
310- function createProjectIgnore ( rootDir : string ) : Ignore {
311- const matcher = ignore ( ) . add ( DEFAULT_PROJECT_IGNORE ) ;
312- const ignorePath = join ( rootDir , HYPERFRAMES_IGNORE_FILE ) ;
313- if ( existsSync ( ignorePath ) ) {
314- matcher . add ( readFileSync ( ignorePath , "utf-8" ) ) ;
315- }
316- return matcher ;
317- }
318-
319305function collectProjectFiles (
320306 rootDir : string ,
321307 currentDir : string ,
@@ -636,7 +622,7 @@ export function stagePublishFiles(
636622) : Map < string , StagedFile > {
637623 const absProjectDir = resolve ( projectDir ) ;
638624 const filePaths : string [ ] = [ ] ;
639- collectProjectFiles ( absProjectDir , absProjectDir , filePaths , createProjectIgnore ( absProjectDir ) ) ;
625+ collectProjectFiles ( absProjectDir , absProjectDir , filePaths , projectIgnore ( absProjectDir ) ) ;
640626 if ( ! filePaths . includes ( "index.html" ) ) {
641627 throw new Error (
642628 "Project archive must include index.html at the root. Check that .hyperframesignore does not exclude it." ,
0 commit comments