Open
Description
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.json
file'sname
field is dynamically updated to match therepoName
. - The
author
field inpackage.json
includes the GitHub username of the user's machine. - The
package.json
file'sversion
field is dynamically updated to match the version '0.0.1'`.
Tasks:
-
Modify
bin.js
script:- Update the
bin.js
script to fetch the GitHub username in the user's machine, and you already have the repoName. - Use this information to update the
name
field inpackage.json
to 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.json
file. - Ensure that the
name
,author
andversion
fields 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.json
file.
Acceptance Criteria:
- The
package.json
file'sname
field is dynamically updated to match therepoName
. - The
author
field inpackage.json
includes the GitHub username of the user's machine. - The
version
field inpackage.json
is '0.0.1' for new projects.