Skip to content

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

Open
@rubemfsv

Description

@rubemfsv

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.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions