From 7330018f94773ebfbfc4fb4c73ab62e4fbb8a5df Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 17 Apr 2021 18:45:22 -0500 Subject: [PATCH 01/44] Add app store genres as app tags --- helpers/app-store/genres.js | 76 +++++++++++++++++++++++++++++++++++++ helpers/build-app-list.js | 69 +++++++++++++++++++++++++++++++-- 2 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 helpers/app-store/genres.js diff --git a/helpers/app-store/genres.js b/helpers/app-store/genres.js new file mode 100644 index 0000000..ab11d51 --- /dev/null +++ b/helpers/app-store/genres.js @@ -0,0 +1,76 @@ +export default { + '0': ['Mobile Software Application'], + '6018': ['Book'], + '6000': ['Business'], + '6022': ['Catalogs'], + '6017': ['Education'], + '6016': ['Entertainment'], + '6015': ['Finance'], + '6023': ['Food & Drink'], + '6014': ['Games'], + '7001': ['Games', 'Action'], + '7002': ['Games', 'Adventure'], + '7003': ['Games', 'Arcade'], + '7004': ['Games', 'Board'], + '7005': ['Games', 'Card'], + '7006': ['Games', 'Casino'], + '7007': ['Games', 'Dice'], + '7008': ['Games', 'Educational'], + '7009': ['Games', 'Family'], + '7011': ['Games', 'Music'], + '7012': ['Games', 'Puzzle'], + '7013': ['Games', 'Racing'], + '7014': ['Games', 'Role Playing'], + '7015': ['Games', 'Simulation'], + '7016': ['Games', 'Sports'], + '7017': ['Games', 'Strategy'], + '7018': ['Games', 'Trivia'], + '7019': ['Games', 'Word'], + '6013': ['Health & Fitness'], + '6012': ['Lifestyle'], + '6020': ['Medical'], + '6011': ['Music'], + '6010': ['Navigation'], + '6009': ['News'], + '6021': ['Newsstand'], + '6008': ['Photo & Video'], + '6007': ['Productivity'], + '6006': ['Reference'], + '6024': ['Shopping'], + '6005': ['Social Networking'], + '6004': ['Sports'], + '6025': ['Stickers'], + '6003': ['Travel'], + '6002': ['Utilities'], + '6001': ['Weather'], + '6026': ['Developer Tools'], + '6027': ['Graphics & Design'], + '13001': ['Newsstand', 'News & Politics'], + '13002': ['Newsstand', 'Fashion & Style'], + '13003': ['Newsstand', 'Home & Garden'], + '13004': ['Newsstand', 'Outdoors & Nature'], + '13005': ['Newsstand', 'Sports & Leisure'], + '13006': ['Newsstand', 'Automotive'], + '13007': ['Newsstand', 'Arts & Photography'], + '13008': ['Newsstand', 'Brides & Weddings'], + '13009': ['Newsstand', 'Business & Investing'], + '13010': ['Newsstand', 'Children\'s Magazines'], + '13011': ['Newsstand', 'Computers & Internet'], + '13012': ['Newsstand', 'Cooking, Food & Drink'], + '13013': ['Newsstand', 'Crafts & Hobbies'], + '13014': ['Newsstand', 'Electronics & Audio'], + '13015': ['Newsstand', 'Entertainment'], + '13017': ['Newsstand', 'Health, Mind & Body'], + '13018': ['Newsstand', 'History'], + '13019': ['Newsstand', 'Literary Magazines & Journals'], + '13020': ['Newsstand', 'Men\'s Interest'], + '13021': ['Newsstand', 'Movies & Music'], + '13023': ['Newsstand', 'Parenting & Family'], + '13024': ['Newsstand', 'Pets'], + '13025': ['Newsstand', 'Professional & Trade'], + '13026': ['Newsstand', 'Regional News'], + '13027': ['Newsstand', 'Science'], + '13028': ['Newsstand', 'Teens'], + '13029': ['Newsstand', 'Travel & Regional'], + '13030': ['Newsstand', 'Women\'s Interest'], +} diff --git a/helpers/build-app-list.js b/helpers/build-app-list.js index 42eafa1..2a4906b 100644 --- a/helpers/build-app-list.js +++ b/helpers/build-app-list.js @@ -5,6 +5,7 @@ import slugify from 'slugify' import axios from 'axios' import statuses, { getStatusName } from './statuses' +import appStoreGenres from './app-store/genres.js' import parseDate from './parse-date' import { eitherMatches } from './matching.js' import { getAppEndpoint } from './app-derived' @@ -98,6 +99,41 @@ const lookForLastUpdated = function (app, commits) { return null } +// Fetch list of genres for each bundle +async function fetchBundleGenres () { + const genresJsonUrl = `${process.env.VFUNCTIONS_URL}/app-store/listings-sheet?fields=bundleId,genreIds` + + return await axios.get( genresJsonUrl ) + .then( response => { + return new Map( response.data.apps ) + }) + .catch(function (error) { + // handle error + console.warn('Error fetching bundle genres', error) + }) +} + + +function generateTagsFromGenres( bundleId, bundleGenres ) { + // If we don't have this bundleID + // then return empty + if ( !bundleGenres.has( bundleId ) ) return [] + + const genres = new Set() + + bundleGenres.get( bundleId ).split(',').forEach( genreId => { + if ( !appStoreGenres.hasOwnProperty(genreId) ) { + console.warn('Not known genre ID', genreId) + } + + appStoreGenres[genreId].forEach( genreName => { + genres.add(genreName) + }) + }) + + return genres +} + export default async function () { @@ -113,6 +149,7 @@ export default async function () { // Save commits to file just in case // await fs.writeFile('./commits-data.json', JSON.stringify(commits)) + const bundleGenres = await fetchBundleGenres() const scanListMap = new Map() @@ -154,10 +191,15 @@ export default async function () { href: 'https://doesitarm.com/apple-silicon-app-test/', }) + // console.log('appScan', appScan) + + const tags = generateTagsFromGenres( appScan.bundleIdentifier, bundleGenres ) + // Add to scanned app list scanListMap.set( appSlug, { name: appName, aliases: appScan['aliases'], + bundleId: appScan.bundleIdentifier, status: statusName, lastUpdated: parseDate( appScan['Date'] ), // url, @@ -172,6 +214,7 @@ export default async function () { category: { slug: 'uncategorized' }, + tags, relatedLinks }) }) @@ -236,14 +279,27 @@ export default async function () { const [ name, url ] = link.substring(1, link.length-1).split('](') + let bundleId = null + let tags = [] + // Search for this app in the scanList and remove duplicates scanListMap.forEach( ( scannedApp, key ) => { - for ( const alias of scannedApp.aliases) { + for ( const alias of scannedApp.aliases ) { // console.log( key, alias, name, eitherMatches(alias, name) ) if ( eitherMatches(alias, name) ) { - console.log(`Removing ${alias} from scanned apps`) + // If we don't have a bundleId yet + // Set this app's bundleId + if ( bundleId === null ) { bundleId = scannedApp.bundleId } + + // Merge this scanned app's tags into the matching app + tags = Array.from(new Set([ + ...tags, + ...scannedApp.tags + ])) + + console.log(`Merged ${alias} (${scannedApp.bundleId}) from scanned apps into ${name} from README`) scanListMap.delete( key ) } } @@ -285,15 +341,22 @@ export default async function () { appList.push({ name, status, + bundleId, lastUpdated, // url, text, slug: appSlug, endpoint, category, + tags, // content: token.content, - relatedLinks + relatedLinks, }) + + + // if ( tags.length > 1 ) { + // console.log('tags', name, bundleId, tags) + // } } // appList[categorySlug] From 4b0b63c70c5f6da3b8798d7ea2476dc551dfd8e5 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 17 Apr 2021 18:46:11 -0500 Subject: [PATCH 02/44] Add 42 matter genres link --- helpers/app-store/genres.js | 1 + 1 file changed, 1 insertion(+) diff --git a/helpers/app-store/genres.js b/helpers/app-store/genres.js index ab11d51..2e8210a 100644 --- a/helpers/app-store/genres.js +++ b/helpers/app-store/genres.js @@ -1,3 +1,4 @@ +// Source 1: https://42matters.com/docs/app-market-data/ios/apps/appstore-genres export default { '0': ['Mobile Software Application'], '6018': ['Book'], From 00f1f1397cbec10a2683952aef4273f335b8e035 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 17 Apr 2021 22:36:06 -0500 Subject: [PATCH 03/44] Move makeSlug to function --- helpers/build-app-list.js | 14 ++------------ helpers/build-game-list.js | 9 ++------- helpers/build-video-list.js | 7 ++----- helpers/categories.js | 8 ++------ helpers/slug.js | 9 +++++++++ 5 files changed, 17 insertions(+), 30 deletions(-) create mode 100644 helpers/slug.js diff --git a/helpers/build-app-list.js b/helpers/build-app-list.js index 2a4906b..2afdd0a 100644 --- a/helpers/build-app-list.js +++ b/helpers/build-app-list.js @@ -1,7 +1,6 @@ import { promises as fs } from 'fs' import MarkdownIt from 'markdown-it' -import slugify from 'slugify' import axios from 'axios' import statuses, { getStatusName } from './statuses' @@ -9,17 +8,11 @@ import appStoreGenres from './app-store/genres.js' import parseDate from './parse-date' import { eitherMatches } from './matching.js' import { getAppEndpoint } from './app-derived' +import { makeSlug } from './slug.js' const md = new MarkdownIt() - -const makeSlug = name => slugify(name, { - lower: true, - strict: true -}) - - const getTokenLinks = function ( childTokens ) { const tokenList = [] @@ -264,10 +257,7 @@ export default async function () { if (isHeading && token.type === 'inline') { categoryTitle = token.content - categorySlug = slugify(token.content, { - lower: true, - strict: true - }) + categorySlug = makeSlug( token.content ) // appList[categorySlug] = [] } diff --git a/helpers/build-game-list.js b/helpers/build-game-list.js index 0195a7b..0375a9a 100644 --- a/helpers/build-game-list.js +++ b/helpers/build-game-list.js @@ -1,10 +1,8 @@ - -import { promises as fs } from 'fs' -import slugify from 'slugify' import axios from 'axios' // import { statuses } from './build-app-list' import { getAppEndpoint } from './app-derived' +import { makeSlug } from './slug.js' // console.log('process.env.GAMES_SOURCE', process.env.GAMES_SOURCE) @@ -101,10 +99,7 @@ export default async function () { if (isPlayable(game) && statusesTranslations.hasOwnProperty(environmentName(game)) === false) continue // Generate slug - const slug = slugify(game.Games, { - lower: true, - strict: true - }) + const slug = makeSlug( game.Games ) // Find index of game is list so far const gameIndex = gameList.findIndex(game => { diff --git a/helpers/build-video-list.js b/helpers/build-video-list.js index 4a32a97..619f9a0 100644 --- a/helpers/build-video-list.js +++ b/helpers/build-video-list.js @@ -1,11 +1,11 @@ -import slugify from 'slugify' import axios from 'axios' import { fuzzyMatchesWholeWord } from './matching.js' import { byTimeThenNull } from './sort-list.js' import { getVideoEndpoint } from './app-derived.js' import parseDate from './parse-date' +import { makeSlug } from './slug.js' const inTimestamps = ( name, video ) => { @@ -150,10 +150,7 @@ export default async function ( applist ) { if (fetchedVideos[videoId].title === 'Deleted video') continue // Build video slug - const slug = slugify(`${fetchedVideos[videoId].title}-i-${videoId}`, { - lower: true, - strict: true - }) + const slug = makeSlug( `${fetchedVideos[videoId].title}-i-${videoId}` ) const apps = [] // Generate new tag set based on api data diff --git a/helpers/categories.js b/helpers/categories.js index 5effd90..914d71a 100644 --- a/helpers/categories.js +++ b/helpers/categories.js @@ -1,12 +1,8 @@ // Universal JS imports only -import slugify from 'slugify' - +import { makeSlug } from './slug.js' export function makeCategorySlug ( categoryName ) { - return slugify(categoryName, { - lower: true, - strict: true - }) + return makeSlug( categoryName ) } diff --git a/helpers/slug.js b/helpers/slug.js new file mode 100644 index 0000000..9ad21dc --- /dev/null +++ b/helpers/slug.js @@ -0,0 +1,9 @@ +// Universal JS imports only +import slugify from 'slugify' + +export function makeSlug ( name ) { + return slugify(name, { + lower: true, + strict: true + }) +} From 1d5a4d059b7ce115f540e84dce64aed8a114b762 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 17 Apr 2021 23:10:54 -0500 Subject: [PATCH 04/44] Enable generating device list --- build-lists.js | 18 +++++++++++++++--- helpers/app-derived.js | 9 +++++++++ helpers/build-device-list.js | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 helpers/build-device-list.js diff --git a/build-lists.js b/build-lists.js index cceacf9..f3daa2e 100644 --- a/build-lists.js +++ b/build-lists.js @@ -5,6 +5,7 @@ import buildAppList from './helpers/build-app-list.js' import buildGamesList from './helpers/build-game-list.js' import buildHomebrewList from './helpers/build-homebrew-list.js' import buildVideoList from './helpers/build-video-list.js' +import buildDeviceList from './helpers/build-device-list.js' import { videosRelatedToApp } from './helpers/related.js' import { buildVideoPayload, buildAppBenchmarkPayload } from './helpers/build-payload.js' @@ -14,6 +15,7 @@ import { getAppType, getAppEndpoint, getVideoEndpoint, + isVideo } from './helpers/app-derived.js' import { makeSearchableList } from './helpers/searchable-list.js' @@ -61,6 +63,11 @@ class BuildLists { path: '/static/homebrew-list.json', buildMethod: buildHomebrewList, }, + { + name: 'device', + path: '/static/device-list.json', + buildMethod: buildDeviceList, + }, // Secondary Derivative built lists // Always goes after initial lists @@ -225,10 +232,10 @@ class BuildLists { this.lists[listKey].forEach( app => { - const isVideo = (app.category === undefined) + // const isVideo = (app.category === undefined) const appType = getAppType( app ) - if ( isVideo ) { + if ( isVideo( app ) ) { // this.endpointMaps.eleventy.add({ // route: getVideoEndpoint(app), // payload: buildVideoPayload( app, this.allVideoAppsList, this.lists.video ) @@ -273,9 +280,14 @@ class BuildLists { relatedVideos } ) + } else if ( appType === 'device' ) { + // Add device endpoint + // console.log('Added to nuxt endpoints', app.endpoint ) + this.endpointMaps.nuxt.set( app.endpoint , { listing: app } ) + } else { // Add game or other endpoint - // console.log('Added to nuxt endpoints', getAppEndpoint(app)) + // console.log('Added to nuxt endpoints', app.endpoint ) this.endpointMaps.nuxt.set( getAppEndpoint(app), { app } ) } diff --git a/helpers/app-derived.js b/helpers/app-derived.js index 8ed7ec0..da98483 100644 --- a/helpers/app-derived.js +++ b/helpers/app-derived.js @@ -1,5 +1,10 @@ // App Data that is derived from other app data +export function isDevice ( listing ) { + if ( !listing.hasOwnProperty('endpoint') ) return false + + return listing.endpoint.startsWith('/device/') +} export function isVideo ( app ) { return app.hasOwnProperty('thumbnail') && app.hasOwnProperty('timestamps') @@ -13,6 +18,10 @@ export function getAppType ( app ) { return 'video' } + if ( isDevice( app ) ) { + return 'device' + } + if(app.category !== Object(app.category)) { console.warn('app has no categories', app) diff --git a/helpers/build-device-list.js b/helpers/build-device-list.js new file mode 100644 index 0000000..2cbaec1 --- /dev/null +++ b/helpers/build-device-list.js @@ -0,0 +1,33 @@ +import axios from 'axios' + +import { makeSlug } from './slug.js' + +export function getDeviceEndpoint ( slug ) { + return `/device/${ slug }` +} + + + +export default async function () { + + const devicesJsonUrl = `${process.env.VFUNCTIONS_URL}/api/devices` + + const rawDeviceList = await axios.get(devicesJsonUrl) + .then( response => { + return response.data + }) + .catch(function (error) { + // handle error + console.warn('Error fetching device list', error) + }) + + return rawDeviceList.map( device => { + const slug = makeSlug( device.name ) + + return { + ...device, + slug, + endpoint: getDeviceEndpoint( slug ), + } + }) +} From 9e341c038483152394591b7940054695f05cb48a Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 18 Apr 2021 00:23:56 -0500 Subject: [PATCH 05/44] Filter out ios devices for now --- helpers/build-device-list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/build-device-list.js b/helpers/build-device-list.js index 2cbaec1..0311ffd 100644 --- a/helpers/build-device-list.js +++ b/helpers/build-device-list.js @@ -21,7 +21,7 @@ export default async function () { console.warn('Error fetching device list', error) }) - return rawDeviceList.map( device => { + return rawDeviceList.filter( device => ( device.type !== 'ios' ) ).map( device => { const slug = makeSlug( device.name ) return { From d2d61cca53c6ce1a1212d5e0c6d1ac7489edbde7 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 18 Apr 2021 00:32:11 -0500 Subject: [PATCH 06/44] Add device listing page --- pages/device/_slug.vue | 201 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 pages/device/_slug.vue diff --git a/pages/device/_slug.vue b/pages/device/_slug.vue new file mode 100644 index 0000000..10822e6 --- /dev/null +++ b/pages/device/_slug.vue @@ -0,0 +1,201 @@ + + + From 8cda98e0e62010b966ca678f00077efc70fd3f59 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 18 Apr 2021 19:45:15 -0500 Subject: [PATCH 07/44] Install chance --- package-lock.json | 11 +++++++++++ package.json | 1 + 2 files changed, 12 insertions(+) diff --git a/package-lock.json b/package-lock.json index f88ea3e..3d5f8c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@open-wc/webpack-import-meta-loader": "^0.4.7", "@zip.js/zip.js": "^2.2.6", "axios": "^0.21.0", + "chance": "^1.1.7", "cross-env": "^5.2.0", "jsdom": "^16.4.0", "lazysizes": "^5.3.0-beta1", @@ -4842,6 +4843,11 @@ "node": ">=8" } }, + "node_modules/chance": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/chance/-/chance-1.1.7.tgz", + "integrity": "sha512-bua/2cZEfzS6qPm0vi3JEvGNbriDLcMj9lKxCQOjUcCJRcyjA7umP0zZm6bKWWlBN04vA0L99QGH/CZQawr0eg==" + }, "node_modules/character-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", @@ -29210,6 +29216,11 @@ } } }, + "chance": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/chance/-/chance-1.1.7.tgz", + "integrity": "sha512-bua/2cZEfzS6qPm0vi3JEvGNbriDLcMj9lKxCQOjUcCJRcyjA7umP0zZm6bKWWlBN04vA0L99QGH/CZQawr0eg==" + }, "character-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", diff --git a/package.json b/package.json index 245fd6e..8e912fd 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@open-wc/webpack-import-meta-loader": "^0.4.7", "@zip.js/zip.js": "^2.2.6", "axios": "^0.21.0", + "chance": "^1.1.7", "cross-env": "^5.2.0", "jsdom": "^16.4.0", "lazysizes": "^5.3.0-beta1", From 8eaf958f7b83ba3d82f8a6d20a3bf83cbacc751e Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 18 Apr 2021 19:51:03 -0500 Subject: [PATCH 08/44] Pick featured apps deterministically --- pages/device/_slug.vue | 57 +++++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/pages/device/_slug.vue b/pages/device/_slug.vue index 10822e6..a558513 100644 --- a/pages/device/_slug.vue +++ b/pages/device/_slug.vue @@ -95,32 +95,57 @@ function deviceSupportsApp ( device, app ) { export default { async asyncData ({ params: { slug } }) { + const { default: Chance } = await import('chance') + const { allList } = await import('~/helpers/get-list.js') const { default: deviceList } = await import('~/static/device-list.json') // const { default: gameList } = await import('~/static/game-list.json') // const { default: videoList } = await import('~/static/video-list.json') + const charCode = slug.charCodeAt( slug.length-2 ) + const shuffler = new Chance( charCode ) + const device = deviceList.find( device => { return device.slug === slug }) + const deviceAppList = allList.map( app => { + const appIsSupported = deviceSupportsApp( device, app ) + + return { + name: app.name, + status: app.status, + slug: app.slug, + // endpoint: app.endpoint, + text: appIsSupported ? `✅ Supported on ${device.name}` : `🚫 Not yet reported working on ${device.name}`, + lastUpdated: app.lastUpdated, + category: app.category, + // searchLinks: makeAppSearchLinks( app, (new Set(videoList)) ) + } + }) + + const supportedApps = deviceAppList.filter( app => { + const supported = app.text.startsWith('✅') + const hasNotAllowedCategory = ([ + 'no-category', + 'homebrew', + 'games', + ]).some( categorySlug => (app.category.slug === categorySlug) ) + + // console.log('hasNonStandardCategory', app.category.slug, hasNonStandardCategory) + + return supported && !hasNotAllowedCategory + }) + + const featuredApps = shuffler.shuffle( supportedApps ).slice(0, 12) + + // console.log('featuredApps', featuredApps[0]) + return { slug, device, - deviceAppList: allList.map( app => { - const appIsSupported = deviceSupportsApp( device, app ) - - return { - name: app.name, - status: app.status, - slug: app.slug, - // endpoint: app.endpoint, - text: appIsSupported ? `✅ Supported on ${device.name}` : `🚫 Not yet reported working on ${device.name}`, - lastUpdated: app.lastUpdated, - category: app.category, - // searchLinks: makeAppSearchLinks( app, (new Set(videoList)) ) - } - }) + featuredApps, + deviceAppList } }, components: { @@ -135,9 +160,7 @@ export default { }, computed: { supportedAppList () { - return this.deviceAppList.filter(app => { - return app.text.startsWith('✅') - }).slice(0, 12).map(app => app.name) + return this.featuredApps.map(app => app.name) }, title () { return `App support list for ${this.device.name}` From 6e65c498c8330e315d60da9ea84ed052cf07b6b9 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 18 Apr 2021 20:01:48 -0500 Subject: [PATCH 09/44] Move deviceSupportsApp into helper --- helpers/devices.js | 37 +++++++++++++++++++++++++++++++++++++ pages/device/_slug.vue | 36 +----------------------------------- 2 files changed, 38 insertions(+), 35 deletions(-) create mode 100644 helpers/devices.js diff --git a/helpers/devices.js b/helpers/devices.js new file mode 100644 index 0000000..667d978 --- /dev/null +++ b/helpers/devices.js @@ -0,0 +1,37 @@ + +import { getStatusName } from './statuses.js' + + +export const macAppleSiliconStatuses = new Set([ + 'native', + 'rosetta' +]) + +export function deviceSupportsApp ( device, app ) { + + // const statuses = { + // '✅': 'native', + // '✳️': 'rosetta', + // '⏹': 'no-in-progress', + // '🚫': 'no', + // '🔶': 'unreported', + // } + const appStatus = getStatusName( app.text ) + + if ( device.type === 'intel') { + + return true + } + + if ( device.type === 'mac-apple-silicon') { + + return macAppleSiliconStatuses.has( appStatus ) + } + + // if ( device.type === 'ios') { + + // return + // } + + return false +} diff --git a/pages/device/_slug.vue b/pages/device/_slug.vue index a558513..c67036d 100644 --- a/pages/device/_slug.vue +++ b/pages/device/_slug.vue @@ -57,41 +57,7 @@ import Search from '~/components/search.vue' import LinkButton from '~/components/link-button.vue' // import { categories } from '~/helpers/categories.js' -import { getStatusName } from '~/helpers/statuses.js' - -const macAppleSiliconStatuses = new Set([ - 'native', - 'rosetta' -]) - -function deviceSupportsApp ( device, app ) { - - // const statuses = { - // '✅': 'native', - // '✳️': 'rosetta', - // '⏹': 'no-in-progress', - // '🚫': 'no', - // '🔶': 'unreported', - // } - const appStatus = getStatusName( app.text ) - - if ( device.type === 'intel') { - - return true - } - - if ( device.type === 'mac-apple-silicon') { - - return macAppleSiliconStatuses.has( appStatus ) - } - - // if ( device.type === 'ios') { - - // return - // } - - return false -} +import { deviceSupportsApp } from '~/helpers/devices.js' export default { async asyncData ({ params: { slug } }) { From 1e2ef74b7b866bcfc72636c38f972352080603b2 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 18 Apr 2021 20:40:26 -0500 Subject: [PATCH 10/44] Add autofocus prop to search --- components/search.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/search.vue b/components/search.vue index bf56db3..c2c3fb1 100644 --- a/components/search.vue +++ b/components/search.vue @@ -16,12 +16,12 @@ @@ -222,6 +222,10 @@ export default { type: Number, default: null }, + autofocus: { + type: Boolean, + default: true + }, quickButtons: { type: Array, default: () => [ From 4ddc4b35020fe2ca07dcc4dde73674a9facfeaca Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 18 Apr 2021 20:40:54 -0500 Subject: [PATCH 11/44] Disable autofocus on device pages --- pages/device/_slug.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/device/_slug.vue b/pages/device/_slug.vue index c67036d..1a5f015 100644 --- a/pages/device/_slug.vue +++ b/pages/device/_slug.vue @@ -15,6 +15,7 @@