Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set packageName in TypeScript reference file #5827

Closed
wants to merge 9 commits into from
Closed

Set packageName in TypeScript reference file #5827

wants to merge 9 commits into from

Conversation

devloco
Copy link

@devloco devloco commented Nov 16, 2018

This PR is sent as suggested by @Timer here:
#5811

Here are the full steps that I used to test:

  1. I published my react-scripts changes to NPM as @devloco/react-scripts-test
  2. bash prompt at: create-react-app/packages/create-react-app
  3. npm link (to pick up the changes made to createReactApp.js)
  4. cd ~/temp
  5. create-react-app foo1 --typescript --scripts-version @devloco/react-scripts-test
  6. See app creation succeed.
  7. cd foo1/src
  8. vim react-app-env.d.ts
  9. See that "types" prop value is @devloco/react-scripts-test
  10. :q! + ENTER to exit vim
  11. yarn start
  12. See no errors happen. Webpack Dev Server and browser tab launch successfully. Page renders in browser as usual.

Screenshots:
pr1
pr2
pr3


Make sure that not using --scripts-version still works the same

  1. cd ~/temp
  2. `create-react-app foo2 --typescript
  3. See app creation succeed.
  4. cd foo2/src
  5. vim react-app-env.d.ts
  6. See that "types" prop value is react-scripts
  7. :q! + ENTER to exit vim
  8. yarn start
  9. See no errors happen. Webpack Dev Server and browser tab launch successfully. Page renders in browser as usual.

Update from upstream repo facebook/create-react-app@master
Update from upstream repo facebook/create-react-app@master
Update from upstream repo facebook/create-react-app@master
Update from upstream repo facebook/create-react-app@master
Update from upstream repo facebook/create-react-app@master
Update from upstream repo facebook/create-react-app@master
Update from upstream repo facebook/create-react-app@master
Update from upstream repo facebook/create-react-app@master
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@Timer
Copy link
Contributor

Timer commented Nov 20, 2018

Hmm, this would break existing apps adding TypeScript. We just need to parse it from paths.ownPackageJson.

@mrmckeb
Copy link
Contributor

mrmckeb commented Dec 3, 2018

@Timer This is included in this #5877, along with another fix.

@devloco devloco closed this Dec 8, 2018
@devloco devloco deleted the set-packageName-in-TypeScript-reference-file branch December 8, 2018 17:02
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants