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

there should be a single place that holds the dependencies #13740

Open
nikikalwar opened this issue Dec 26, 2024 · 0 comments
Open

there should be a single place that holds the dependencies #13740

nikikalwar opened this issue Dec 26, 2024 · 0 comments

Comments

@nikikalwar
Copy link

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
const dependencies = require('./dependencies').sort();

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant