You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, I was checking the comments where I saw it is mentioned in TODO, to have a single place to hold dependencies instead of hard-coding the values during declaration.
Instead of hardcoding the values in a place, I think we can have a single dependencies file which holds the dependencies array
(Describe your proposed solution here.)
Describe alternatives you've considered
(Write your answer here.)
Additional context
// TODO: there should be a single place that holds the dependencies
const dependencies = ['react', 'react-dom', 'react-scripts'].sort();
if (dependencies.includes(appName)) {
console.error(
chalk.red( Cannot create a project named ${chalk.green( "${appName}" )} because a dependency with the same name exists.\n + Due to the way npm works, the following names are not allowed:\n\n
) +
chalk.cyan(dependencies.map(depName => ${depName}).join('\n')) +
chalk.red('\n\nPlease choose a different project name.')
);
process.exit(1);
}
}
I thought I will give it a try, could you please take a look once you are free.
(Write your answer here.)
The text was updated successfully, but these errors were encountered:
Is your proposal related to a problem?
Yes, I was checking the comments where I saw it is mentioned in TODO, to have a single place to hold dependencies instead of hard-coding the values during declaration.
no, it's not a problem just checking comments(Write your answer here.)
Describe the solution you'd like
// dependencies.js
module.exports = ['react', 'react-dom', 'react-scripts'];
//createReactApp.js
Instead of hardcoding the values in a place, I think we can have a single dependencies file which holds the dependencies arrayconst dependencies = require('./dependencies').sort();
(Describe your proposed solution here.)
Describe alternatives you've considered
(Write your answer here.)
Additional context
// TODO: there should be a single place that holds the dependencies
const dependencies = ['react', 'react-dom', 'react-scripts'].sort();
if (dependencies.includes(appName)) {
console.error(
chalk.red(
Cannot create a project named ${chalk.green(
"${appName}")} because a dependency with the same name exists.\n
+Due to the way npm works, the following names are not allowed:\n\n
) +
chalk.cyan(dependencies.map(depName =>
${depName}
).join('\n')) +chalk.red('\n\nPlease choose a different project name.')
);
process.exit(1);
}
}
I thought I will give it a try, could you please take a look once you are free.
(Write your answer here.)
The text was updated successfully, but these errors were encountered: