Skip to content

Commit

Permalink
fix(main): revert --disable-dev-shm-usage chrome launch arg
Browse files Browse the repository at this point in the history
Revert Chrome's --disable-dev-shm-usage launch arg that prevents npx commands fail on linux systems

fix #631
  • Loading branch information
onderceylan committed Jul 13, 2021
1 parent 12898d3 commit 83a80e8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/__snapshots__/cli.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,25 @@ exports[`CLI integrates with main API and creates an output with generated meta
"
`;
exports[`CLI integrates with npx 1`] = `
"
<meta name=\\"apple-mobile-web-app-capable\\" content=\\"yes\\">
<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-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-2778-1284.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)\\">
<link rel=\\"apple-touch-startup-image\\" href=\\"%PUBLIC_URL%/temp/apple-splash-dark-2532-1170.jpg\\" media=\\"(prefers-color-scheme: dark) and (device-width: 390px) and (device-height: 844px) 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-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-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-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)\\">
"
`;
28 changes: 28 additions & 0 deletions src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,32 @@ describe('CLI', () => {
);
expect(new Set(flagShorthands).size).toBe(flagShorthands.length);
});

test('integrates with npx', async () => {
let response = { stdout: '', stderr: '' };
try {
response = await execa(
'npx',
[
'-p .',
'pwa-asset-generator',
'./static/logo.png',
'./temp',
'--scrape=false',
'--splash-only',
'--landscape-only',
'--favicon',
'--path="%PUBLIC_URL%"',
'--dark-mode',
'--type=jpg',
'--quality=20',
],
{ env: { PAG_TEST_MODE: '1' } },
);
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
}
expect(response.stdout).toMatchSnapshot();
});
});
1 change: 0 additions & 1 deletion src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export default {
},

CHROME_LAUNCH_ARGS: [
'--disable-dev-shm-usage',
'--log-level=3', // Fatal only
'--no-default-browser-check',
'--disable-infobars',
Expand Down

0 comments on commit 83a80e8

Please sign in to comment.