diff --git a/pages-eleventy/app.11ty.js b/pages-eleventy/app.11ty.js index ceba932..b177c6a 100644 --- a/pages-eleventy/app.11ty.js +++ b/pages-eleventy/app.11ty.js @@ -4,7 +4,8 @@ import config from '../nuxt.config.js' import { getAppType, getRouteType } from '../helpers/app-derived.js' import { deviceSupportsApp } from '../helpers/devices.js' -import { makeLastUpdatedFriendly } from '../helpers/parse-date' +import { makeLastUpdatedFriendly } from '../helpers/parse-date.js' +import { getStatusOfScan } from '../helpers/statuses.js' import VideoRow from '../components-eleventy/video/row.js' @@ -15,6 +16,10 @@ import VideoRow from '../components-eleventy/video/row.js' // Setup dotenv dotenv.config() +function isString( maybeString ) { + return (typeof maybeString === 'string' || maybeString instanceof String) +} + export const makeTitle = function ( app ) { return `Does ${app.name} work on Apple Silicon? - ${ config.head.title }` } @@ -56,6 +61,57 @@ export function renderPageLinksHtml ( links ) { } ).join('') } +export function supportedArchitectures ( appScan ) { + // if ( Array.isArray(appScan['Macho Meta']) ) { + // return appScan['Macho Meta'].map( architecture => architecture.processorType) + // } + + // console.log('meta', appScan['Macho Meta']) + + if ( appScan['Macho Meta'].architectures === undefined ) return [] + + return appScan['Macho Meta'].architectures + .map( architecture => architecture.processorType) + .filter(processorType => Number(processorType) !== 0) +} + +function renderBundleDataLevel ( bundleLevelData, depth = 0 ) { + + const levelContainerClassses = 'border rounded-lg bg-black bg-opacity-10 space-y-4 p-4 mt-4' + const maxDepth = 2 + + if ( isString(bundleLevelData) ) { + return bundleLevelData + } + + if ( depth >= maxDepth ) { + return /* html */`
${ JSON.stringify(bundleLevelData, undefined, 2) }`
+ }
+
+ if ( Array.isArray( bundleLevelData ) ) {
+ const htmlList = bundleLevelData.map( ( bundleLevel ) => {
+ return /* html */`${ JSON.stringify(report['Info Plist'], undefined, 2) }
+ ${ JSON.stringify(report['Macho Meta'], undefined, 2) }
+