Skip to content

Commit

Permalink
Fix yarn installation
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanbruegge committed Oct 6, 2018
1 parent f856f8e commit b63ba93
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,6 @@ module.exports = function init(appPath, appName, verboseOpts) {
const appPackageJson = path.join(appPath, 'package.json');
const appPackage = require(appPackageJson);

if (cli === 'yarn') {
//TODO: Remove
console.log();
console.error(
chalk.red(
'Sorry, but for some reason yarn resolves packages differently than npm or pnpm, please use one of those package managers for the time being.'
)
);
fs.removeSync(appPath);
process.exit(1);
}

// Manipulate app's package.json
appPackage.scripts = {
format: "prettier --write '{src,test}/**/*.{js,jsx,ts,tsx}'",
Expand Down Expand Up @@ -150,6 +138,12 @@ module.exports = function init(appPath, appName, verboseOpts) {
...devDependencies
};

if (cli === 'yarn') {
appPackage.resolutions = {
'**/typescript': '2.8'
};
}

fs.writeFileSync(appPackageJson, JSON.stringify(appPackage, null, 2));

// Copy flavor files
Expand Down

0 comments on commit b63ba93

Please sign in to comment.