Commit Graph

56 Commits

Author SHA1 Message Date
Ian Sutherland
88f2b0bcfc Add pre-eject message about new features in v2 (#5954)
* Add pre-eject message about new features in v2

* Make message bold
2018-12-03 21:54:56 -05:00
Joe Haddad
6364bbf6dc Remove react-scripts type reference on eject (#5611)
* Remove react-scripts type reference on eject

* Check for env file

* Check eject for typescript

* Shuffle appTypeDeclarations

* Append internal types on eject

* Ensure lib is published for types

* Adjust comment

* Don't add a bunch of new lines

* File should exist and not be deleted

* Add debug

* Set file explicitly

* Revert "Set file explicitly"

This reverts commit bcd58a36cbd08a71af50b037d8f1fae6c595fb4e.

* Copy file before destroying ourselves

* Revert "Add debug"

This reverts commit 0068ba81c6d79d99788877c9e1b618acd7412dce.
2018-10-29 23:15:52 -04:00
Joe Haddad
50b4857ff8 Revert "Add support for yarn and lerna monorepos. (#3741)"
This reverts commit b43ad04b88.
2018-09-18 14:31:19 -04:00
Joe Haddad
cc328d6287 Revert "Use yarn when running inside yarn workspace. (#3997)"
This reverts commit 2c34d5b66e.
2018-09-18 14:31:19 -04:00
bradfordlemley
2c34d5b66e Use yarn when running inside yarn workspace. (#3997)
* Run yarn after ejecting.

* On eject, choose to run yarn instead of npm if yarn is available.

* Move monorepo to react-dev-utils.

* Fix lint.

* Rename monorepo to workspaceUtils.

* Add react-dev-utils dep for create-react-app.

* getMonorepo -> findMonorepo
2018-02-10 13:07:19 +00:00
bradfordlemley
b43ad04b88 Add support for yarn and lerna monorepos. (#3741)
* Support for multiple source paths via package.json srcPaths entry.

Initial support for yarn workspace.

Support lerna workspace, fix for when to use template files.

Remove support for specifying srcPaths in package.json.

Re-enable transpilation caching.

* Clean up, use file matching (similar to original) in webpack configs instead of matching function.

* Remove package lock files.

* Fix for eject.
Note: monorepos won't work after eject.
Can be fixed easily with JEST 22.0.?+ which has file pattern matches against realpaths.

* Filter tests to run only tests in monorepo components included by the app.
(Not sure this is desireable, might be cool to be able to easily run all tests in monorepo from one app.)

* Fix conditions for when to use template.

* Fix eject.

* Remove code that is not needed w/ Jest 22.

* Include all cra-comp tests in monorepo instead of trying to include only tests that are dependencies of app.
(tests can be easily filtered via jest cli if desired, e.g. 'npm test -- myapp comp1')

* Pin find-pkg version.

* Hopefully fix jest test file matching on windows by removing first slash.

* E2E tests for monorepo.

* Run monorepo tests in CI.

* Fix and test post-eject build.

* Fix e2e test.

* Fix test suite names in appveyor.

* Include individual package dirs as srcPaths instead of top-level monorepo root.
Fixes build/start after eject.

* Fix running tests after eject.

* Clean up test workspace, add some verifcations.

* Cleanup.

* Try to fix hang when running test on appveyor.

* Don't write babel or lint config to package.json when ejecting.

* Incorporate review comments.
* Simply monorepo pkg finder
* Only include monorepo pkgs if app itself is included in monorepo
* Check for specific tests in e2e

* Fixes for windows.

* Fix for kitchensink mocha tests compiling.

* Add lerna monorepo test.

* Fix lerna bootstrap on windows.

* Incorporate more review comments:
* remove support for lerna w/o yarn workspace
* add react and react-dom as devDeps to comp1 and comp2

* Add monorepo info to user guide.
2018-02-01 20:58:18 +00:00
Michaël De Boey
25184c4e91 Fix links to package (#3898) 2018-01-22 22:16:22 +00:00
Dan Abramov
72c3d4ebb5 Try to fix CI (#3806)
* Try to fix CI

* Bump Jest elsewhere

* Bump Babel elsewhere

* Fix CI on Windows by writing .cmd file back
2018-01-16 18:24:14 +00:00
Joe Haddad
2e59c5412c Offer to set default browsers (#3792)
* Offer to set browser defaults

* Catch error on no

* Add ending newlines

* Ensure we re-check to prevent defaults from leaking

* Reduce nesting

* Add defaults message

* More explicit
2018-01-15 00:09:07 -05:00
Joe Lim
4bec877178 Improve eject message (#3416)
* improve eject message

* cross os implementation
2017-11-07 13:37:40 -05:00
Sophie Alpert
2e82ebb337 BSD+Patents -> MIT (#3189)
* File headers BSD+Patents -> MIT

* BSD+Patents -> MIT
2017-09-26 10:30:05 +01:00
Ade Viankakrisna Fadlil
44cfbccfda Rerun prettier and pin version (#3058)
* rerun prettier for all files

* pin prettier to 1.6.1
2017-09-10 01:12:38 -04:00
Dan Abramov
a171d93064 Reformat source code with Prettier 1.5.2 2017-06-28 16:23:16 +01:00
Dan Abramov
9559ba486e Put react-scripts in dependencies, not devDependencies (#2657)
* Put react-scripts in dependencies, not devDependencies

* Sort dependencies on eject

* Remove CI check
2017-06-28 14:04:26 +01:00
Dan Abramov
3747144f9a Set npm loglevel to 'error' (#2635) 2017-06-27 15:39:42 +01:00
Dan Abramov
bed875c83d Don't run yarn after ejecting (#2634) 2017-06-27 15:09:46 +01:00
Paweł Jędrzejczyk
0644e80d36 add check to filter out custom scripts in eject command (#2562) 2017-06-27 14:11:14 +01:00
Pavol Madar
0d1521aabf Remove connect-history-api-fallback and cross-spawn dependencies from react-scripts (#751) (#2320) 2017-05-22 12:46:51 +01:00
pmadar
a1749f9154 Remove unnecessary dependencies(#751) (#2283)
* Remove unnecessary dependencies(#751)

* Sort alphabetically
2017-05-20 19:08:58 +01:00
Milo Kang
a257e7d0fa Ejecting should ensure you have clean git status (#2221)
* Ejecting should ensure you have clean git status

* Rename function

* Style

* Minor changes

- extract function
- exclude error output for missing git
- more descriptive error message
- no need to mutate answer
- fix answering "no" to return 0 exit code
2017-05-20 18:55:16 +01:00
Dan Abramov
8dc9217b61 Move more logic from react-scripts to react-dev-utils (#2209)
* Show warnings for builds

* Move WebpackDevServer helpers into react-dev-utils
2017-05-18 12:26:18 +01:00
Ryan Sullivan
10a180be9b Make coverage and snapshot Jest options overridable in package.json (#1830)
* Override Jest config collectCoverageFrom with package.json

* Protect against overriding other options

* Better error message

* Create Jest config early on eject

* Tweak wording

* Dry it up
2017-05-16 05:13:19 +01:00
Ian Sutherland
82687dd224 Replace prompt function from react-dev-utils with Inquirer.js. (#1772) 2017-05-14 23:14:56 +01:00
David
0ace417c45 Make scripts crash on unhandled rejections (#1819)
* Makes end-to-end testing crash on unhandled rejections

* Comment fix
2017-03-14 15:32:48 -04:00
Dan Abramov
ccb5f84dc6 Fixes a silent crash when ejecting (#1810)
* Fixes a silent crash when ejecting

* Delete unnecessary files

* Remove references to eslintrc in Webpack config

* Fix lint

* Correct ESLint CLI options
2017-03-14 11:17:53 -04:00
Valerii Sorokobatko
fe7b5c212b update to modern code style (#1738)
* mv create-react-app/index.js -> create-react-app/creteReactApp.js

* update to modern code style

* var -> cosnt

* set trailing-coma to es5 for prettier
2017-03-07 19:46:10 +00:00
Valerii Sorokobatko
d7bcc1916a Fix eject for linked react-scripts (#1736)
* fix eject for linked react-scripts

* path.resolve => resolveApp
2017-03-06 17:44:18 +00:00
Dan Abramov
1bfd5dafdf Fix internal linting setup and add missing headers (#1741) 2017-03-06 14:20:29 +00:00
Dan Abramov
23dc422606 Fix ejecting from a scoped fork (#1727)
* Read script names from own bin instead of guessing

This fixes ejecting from a fork that uses a different bin script name.

* Fix ejecting for a scoped react-scripts fork

We shouldn't hardcode react-scripts because fork name might differ.
We also shouldn't rely on it being an immediate child because scoped packages are a level deeper.

* Clarify that own* properties only exist before ejecting
2017-03-05 23:23:51 +00:00
Daniel Grant
b88d6655eb Modularise scripts (#1433)
* Refactor start script into modules

* Move dev server config into config file

* Replace eject file whitelist with a "remove-file-on-eject" flag

* Move utils into scripts folder (for inclusion in ejection)

* Add missed changes

* Pass showInstructions as an argument

* Fix eject bug

* Don't eject babelTransform
2017-03-03 22:05:07 -05:00
Joe Haddad
b609ac96fe Use posix paths for Jest config during eject (#1635)
Resolves #1417 and #1498.
2017-02-24 17:06:54 -05:00
Valerii Sorokobatko
d6a83aa887 Remove .bin files defined at react-scripts/package.json after eject (#1567)
* remove bin files after eject defined at package.json

* add swallowing try/catch
2017-02-24 18:00:09 +00:00
Valerii Sorokobatko
bec009ce71 Fix workflow if react-scripts package is linked via npm-link (#1356)
* add npm-link support

* - remove extra veriable
- simplify condition

* update code after review:
- remove utils/isReactScriptsLinked
- add appPath and ownPath to paths.js (but only for "before eject" export case)

* update code after review:
- remove utils/isReactScriptsLinked
- add appPath and ownPath to paths.js (but only for "before eject" export case)

* update code after review:
- remove utils/isReactScriptsLinked
- add appPath and ownPath to paths.js (but only for "before eject" export case)
- remove "if" block for fs.removeSync(ownPath) at ejec.tjs

* change ownPath value
2017-02-24 11:51:16 -05:00
pd4d10
b999405c67 Add missing '\n' to the end of package.json file (#1510) 2017-02-09 16:36:20 -05:00
creynders
bc2fc80898 eject: Additionally remove react-scripts from dependencies (#1458)
ATM if react-scripts is (erroneously) declared in `dependencies` instead of `devDependencies` or isn't declared at all, the `eject` script will fail half-way. This change makes it more robust, react-scripts will be removed from either, if present.
2017-01-27 16:26:35 +00:00
Ville Immonen
1b645e2cc4 Use yarnpkg alias to run Yarn (#1365)
There’s a common tool included in Hadoop that also has a `yarn` command,
which created issues for users who had Hadoop installed:
* #1257
* #1363

Yarn also installs the command under `yarnpkg` alias (added in
cefa9a368d)
so we can use `yarnpkg` instead of `yarn` to make it more reliable.

This has no effect on users who don't have Hadoop installed, but those
who have won't see errors from falsely detecting Hadoop Yarn as Yarn
the package manager, and they can now also install Yarn to make use of
our Yarn support without the Hadoop Yarn interfering.
2017-01-09 17:25:31 +02:00
Eduard Kyvenko
21b0044412 Remove path-exists from dependencies and replace it with fs.existsSync (#1289) 2016-12-18 20:57:00 +02:00
Dan Abramov
5456ffff29 Let Jest handle all file types (#1197)
* Let Jest handle all file types

* Update regexes

* Fix exclusion regex to also exclude files without extension
* Be over-cautious with Windows paths because I'm not sure how Jest handles them

* There is no automatic babel-jest discovery now that we use transsform
2016-12-07 20:28:03 +00:00
Brian Ng
2da6edabab Replace rimraf with fs-extra functions (#1072) 2016-11-21 18:26:08 +00:00
Ville Immonen
bcc469c9a5 Support Yarn (#898)
In the `create-react-app` command, try to install packages using Yarn.
If Yarn is not installed, use npm instead.

In `react-scripts`, detect if the project is using Yarn by checking if
a `yarn.lock` file exists. If the project is using Yarn, display all
the instructions with Yarn commands and use Yarn to install packages
in `init` and `eject` scripts.
2016-11-17 22:55:00 +02:00
Alice Rose
7ce4b6e0e4 Check for presence of folders before continuing eject. Closes #939. (#951) 2016-10-28 13:54:56 +01:00
Dan Abramov
df21070ede Tweak eject output 2016-10-03 13:41:49 +01:00
Andrew Zakordonets
27e76bebbe Beaufity output of eject.js script (#769)
* Beaufity output of eject.js script

* change formatting of the eject.js output and move colors to cyan

* change message about file copy

* add missing three dots to some statements in eject.js script

* change color of "copying files" line and do not repeat copy path anymore in log

* fix merge conflict

* Remove yellow color from "Removing dependency" line

* changing color to "Adding dependency" line

* Add line that outputs which react script is getting replaced by similar node script

* remove not used anymore colors

* add console line about updating Jest configs

* fix typo

* change formatting of replacing script output in eject.js

* remove "Writing package.json" file console output

* make quotes cyan in "Replacing script" console output

* update console log output for Jest, Babel, ESLint update and group them under one statement

* Style nits
2016-09-30 18:39:24 +01:00
Fernando Montoya
d72c749337 Moved Babel and ESLint config to package.json after ejecting (#773) 2016-09-27 11:17:46 +01:00
Shubheksha Jalan
1b6f58cf05 Forked react-scripts should retain the binary name (#754)
* Forked react-scripts should retain the binary name

* Forked react-scripts should retain the binary name -- fixed issue with regex

* Forked react-scripts should retain the binary name -- fixed style nit
2016-09-25 23:31:53 +01:00
Dan Abramov
176dd373b2 Fix eject 2016-09-23 22:20:40 +01:00
Dan Abramov
fda91eba56 Don't hardcode react-scripts package name (#728)
* Don't hardcode react-scripts package name

Fixes issue described in https://github.com/facebookincubator/create-react-app/issues/682#issuecomment-248781486.

* Update eject.js
2016-09-23 21:29:14 +01:00
Dan Abramov
e5bf5af296 Extract some utilities into a separate package (#723)
* Extract some utilities into a separate package

* Add utils dir to `files` in package.json

* Do not create an empty `utils` dir on eject
2016-09-23 20:53:08 +01:00
Dan Abramov
9a70038b6d Preserve scripts/test.js after ejecting (#715)
Fixes #702
2016-09-23 12:35:26 +01:00
Dan Abramov
f54c9d8fb5 Remove other flow command 2016-09-23 12:07:29 +01:00