@@ -18,6 +18,14 @@ function readText(relativePath) {
1818 return readFileSync ( repoPath ( relativePath ) , 'utf8' ) ;
1919}
2020
21+ function listHtmlFiles ( relativeDir ) {
22+ return readdirSync ( repoPath ( relativeDir ) , { withFileTypes : true } ) . flatMap ( ( entry ) => {
23+ const relativePath = path . join ( relativeDir , entry . name ) ;
24+ if ( entry . isDirectory ( ) ) return listHtmlFiles ( relativePath ) ;
25+ return relativePath . endsWith ( '.html' ) ? [ relativePath ] : [ ] ;
26+ } ) ;
27+ }
28+
2129function assertFileExists ( relativePath ) {
2230 assert . ok ( existsSync ( repoPath ( relativePath ) ) , `Expected ${ relativePath } to exist` ) ;
2331}
@@ -32,6 +40,13 @@ function assertContains(text, expected, context) {
3240 assert . ok ( text . includes ( expected ) , `Expected ${ context } to contain ${ expected } ` ) ;
3341}
3442
43+ function assertJsonLdIsParseable ( html , context ) {
44+ const scripts = [ ...html . matchAll ( / < s c r i p t t y p e = " a p p l i c a t i o n \/ l d \+ j s o n " > ( [ \s \S ] * ?) < \/ s c r i p t > / g) ] ;
45+ for ( const [ , contents ] of scripts ) {
46+ assert . doesNotThrow ( ( ) => JSON . parse ( contents ) , `${ context } must contain parseable JSON-LD` ) ;
47+ }
48+ }
49+
3550assertCopiedByteForByte ( 'public/openclaw-logo-text-dark.png' , 'dist/openclaw-logo-text-dark.png' ) ;
3651assertCopiedByteForByte ( 'public/logo.png' , 'dist/logo.png' ) ;
3752assertCopiedByteForByte ( 'public/granola.png' , 'dist/granola.png' ) ;
@@ -54,6 +69,10 @@ const homePage = readText('dist/index.html');
5469const integrationsPage = readText ( 'dist/integrations/index.html' ) ;
5570const ecosystemPage = readText ( 'dist/ecosystem/index.html' ) ;
5671
72+ for ( const relativePath of listHtmlFiles ( 'dist' ) ) {
73+ assertJsonLdIsParseable ( readText ( relativePath ) , relativePath ) ;
74+ }
75+
5776assertContains ( homePage , siX . path , 'dist/index.html' ) ;
5877assertContains ( homePage , siGooglechrome . path , 'dist/index.html' ) ;
5978assertContains ( homePage , siGmail . path , 'dist/index.html' ) ;
0 commit comments