clean-react-app icon indicating copy to clipboard operation
clean-react-app copied to clipboard

[FEATURE] Update package.json for GitHub User and RepoName when Install by npx

Open rubemfsv opened this issue 2 years ago • 6 comments

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's name field is dynamically updated to match the repoName.
  • The author field in package.json includes the GitHub username of the user's machine.
  • The package.json file's version field is dynamically updated to match the version '0.0.1'`.

Tasks:

  1. 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 in package.json to match the repoName.
    • You can update to the prefixed version '0.0.1', don't need to be dynamic.
  2. Testing:

    • Verify that the changes work as expected by running the script and checking the package.json file.
    • Ensure that the name, author and version fields are correctly updated.

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's name field is dynamically updated to match the repoName.
  • The author field in package.json includes the GitHub username of the user's machine.
  • The version field in package.json is '0.0.1' for new projects.

rubemfsv avatar Oct 03 '23 23:10 rubemfsv

Hey !! Can you assign this issue to me ?

HimanshuTembhe avatar Oct 04 '23 06:10 HimanshuTembhe

@HimanshuTembhe sure! Do you have experience with this kind of task?

rubemfsv avatar Oct 04 '23 11:10 rubemfsv

Yes I would love to work on this task .

HimanshuTembhe avatar Oct 04 '23 17:10 HimanshuTembhe

Hey, @HimanshuTembhe! How are the things going?

rubemfsv avatar Oct 08 '23 13:10 rubemfsv

Will do it in 2 days

HimanshuTembhe avatar Oct 08 '23 14:10 HimanshuTembhe

@HimanshuTembhe some fixes are missing

rubemfsv avatar Oct 26 '23 14:10 rubemfsv