[FEATURE] Update package.json for GitHub User and RepoName when Install by npx
Description
Currently, the package.json file does not dynamically update the author and name fields based on the GitHub username and repository name. Also change the user's version to '0.0.1'. This feature issue aims to adapt the src/main/scripts/bin.js script to automatically change these fields to reflect the user's information, and not the template.
Current Behavior
When I run "npx @rubemfsv/clean-react-app my-app", it comes with this project package json, with rubemfsv author, @rubemfsv/clean-react-app name and its current vesion.
Expected Behavior
When I run "npx @rubemfsv/clean-react-app my-app", in my machine, I'd like to see:
- The
package.jsonfile'snamefield is dynamically updated to match therepoName. - The
authorfield inpackage.jsonincludes the GitHub username of the user's machine. - The
package.jsonfile'sversionfield is dynamically updated to match the version '0.0.1'`.
Tasks:
-
Modify
bin.jsscript:- Update the
bin.jsscript to fetch the GitHub username in the user's machine, and you already have the repoName. - Use this information to update the
namefield inpackage.jsonto match therepoName. - You can update to the prefixed version '0.0.1', don't need to be dynamic.
- Update the
-
Testing:
- Verify that the changes work as expected by running the script and checking the
package.jsonfile. - Ensure that the
name,authorandversionfields are correctly updated.
- Verify that the changes work as expected by running the script and checking the
Additional Information:
- This feature will make it easier for users to initialize projects with the correct GitHub information automatically populated in the
package.jsonfile.
Acceptance Criteria:
- The
package.jsonfile'snamefield is dynamically updated to match therepoName. - The
authorfield inpackage.jsonincludes the GitHub username of the user's machine. - The
versionfield inpackage.jsonis '0.0.1' for new projects.
Hey !! Can you assign this issue to me ?
@HimanshuTembhe sure! Do you have experience with this kind of task?
Yes I would love to work on this task .
Hey, @HimanshuTembhe! How are the things going?
Will do it in 2 days
@HimanshuTembhe some fixes are missing