Skip to content

Commit

Permalink
fix(puppets): updated scraper for latest specs and improve fallback h…
Browse files Browse the repository at this point in the history
…andling

Updated Apple device specs scraper based on the latest device. Improved error handling for the
scraper to enable a graceful failure, faling back to the stored data.

fix #355
  • Loading branch information
onderceylan committed Jul 30, 2020
1 parent e0be4d8 commit 6506952
Show file tree
Hide file tree
Showing 183 changed files with 2,242 additions and 3,782 deletions.
9 changes: 7 additions & 2 deletions bin/update-fallback-data
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ const constants = require('../dist/config/constants').default;
timeout: constants.BROWSER_TIMEOUT,
});

const splashScreenMetaData = await getSplashScreenMetaData({ scrape: true }, browser);
const splashScreenMetaData = await getSplashScreenMetaData(
{ scrape: true },
browser,
);
console.log(splashScreenMetaData);
const jsonData = JSON.stringify(splashScreenMetaData, null, 2);

await writeFile('./src/config/apple-fallback-data.json', jsonData, { encoding:'utf8' });
await writeFile('./src/config/apple-fallback-data.json', jsonData, {
encoding: 'utf8',
});
try {
await killBrowser(browser, chrome);
} catch (e) {
Expand Down
5,142 changes: 1,719 additions & 3,423 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"slash": "3.0.0"
},
"devDependencies": {
"@commitlint/cli": "^9.0.1",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.0.1",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
Expand Down Expand Up @@ -100,14 +100,14 @@
"eslint-plugin-prettier": "^3.1.0",
"execa": "^4.0.1",
"husky": "^4.0.10",
"jest": "^25.1.0",
"jest": "^26.2.1",
"jpeg-js": "^0.4.0",
"lint-staged": "^10.0.0",
"pixelmatch": "^5.1.0",
"pixelmatch": "^5.2.1",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"semantic-release": "^17.0.4",
"ts-jest": "^25.0.0",
"ts-jest": "^26.1.4",
"typescript": "^3.9.2"
},
"husky": {
Expand Down
5 changes: 3 additions & 2 deletions src/__snapshots__/cli.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ exports[`CLI integrates with main API and creates an output with generated meta
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2732-2048.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2388-1668.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2224-1668.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2048-1536.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2224-1668.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2160-1620.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2688-1242.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2436-1125.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-1792-828.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2208-1242.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-1920-1080.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 360px) and (device-height: 640px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-1334-750.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-1136-640.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)\\">
Expand Down
Loading

0 comments on commit 6506952

Please sign in to comment.