Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump sharp and pass ignore-engines for yarn v1.x.x #20146

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/upload/package.json
Expand Up @@ -66,7 +66,7 @@
"react-query": "3.39.3",
"react-redux": "8.1.1",
"react-select": "5.7.0",
"sharp": "0.32.6",
"sharp": "0.33.3",
"yup": "0.32.9"
},
"devDependencies": {
Expand Down
26 changes: 23 additions & 3 deletions packages/generators/app/src/create-project.ts
Expand Up @@ -147,7 +147,8 @@ export default async function createProject(

try {
if (scope.installDependencies !== false) {
const runner = runInstall(scope);
const installArguments = await getInstallArguments(scope);
const runner = runInstall(scope, installArguments);

runner.stdout?.on('data', logInstall);
runner.stderr?.on('data', logInstall);
Expand Down Expand Up @@ -230,12 +231,31 @@ export default async function createProject(
console.log();
}

const installArguments = ['install', '--production', '--no-optional'];
function runInstall({ rootPath, useYarn }: Scope) {
async function getInstallArguments({ useYarn, rootPath }: Scope) {
const installArguments = ['install', '--production', '--no-optional'];

if (useYarn) {
const { stdout } = await execa('yarnpkg', ['--version'], {
cwd: rootPath,
});
const version = stdout.trim();

if (version.startsWith('1.')) {
// Ignore engines for yarn v1.x.x
installArguments.push('--ignore-engines');
}

// Increase timeout for slow internet connections.
installArguments.push('--network-timeout 1000000');

return installArguments;
}

return installArguments;
}

function runInstall({ rootPath, useYarn }: Scope, installArguments: string[] = []) {
if (useYarn) {
return execa('yarnpkg', installArguments, {
cwd: rootPath,
stdin: 'ignore',
Expand Down