Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !5709

Verify `packageName` when installing react-scripts from git

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge github/fork/mrmckeb/feature/verify-git-package-names into main Nov 04, 2018
  • Overview 7
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: mrmckeb

This resolves an issue where a package name may not reflect a git repository name when using a custom react scripts package (--scripts-version). By default, CRA uses the repository name which causes it to throw an error when a package is installed like the below:

  "dependencies": {
    "@test/react-scripts": "git+ssh://git@github.com:mrmckeb/create-react-app.git#react-scripts",
  }

To test this fix, I've created an example repository here, and tested locally with the following command, where my package is named @test/react-scripts.

npx git+ssh://git@github.com:mrmckeb/create-react-app.git#cra \
  test-app \
  --scripts-version=git+ssh://git@github.com:mrmckeb/create-react-app.git#react-scripts

This worked well. It installed correctly, using the package name I had defined.

I'm of course open to a better way of solving this! I did some research into pulling the file from a remote, but I couldn't see a reliable solution for this (I could have missed something).

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/mrmckeb/feature/verify-git-package-names