Skip to content

Commit 995acf9

Browse files
committed
Conflicts: README.md packages/react-scripts/package.json packages/react-scripts/scripts/init.js packages/react-scripts/scripts/utils/createJestConfig.js packages/react-scripts/template/README.md packages/react-scripts/template/src/App.css packages/react-scripts/template/src/App.test.tsx packages/react-scripts/template/src/App.tsx packages/react-scripts/template/src/index.tsx packages/react-scripts/template/tslint.json
1 parent 89a5ae6 commit 995acf9

File tree

202 files changed

+2614
-2867
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+2614
-2867
lines changed

.yarnrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--install.no-lockfile true
2+
--install.check-files true
3+
--add.no-lockfile true

CHANGELOG.md

-1,210
Large diffs are not rendered by default.

CODE_OF_CONDUCT.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.facebook.com/pages/876921332402685/open-source-code-of-conduct) so that you can understand what actions will and will not be tolerated.

CONTRIBUTING.md

+23-10
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,40 @@ All functionality must be retained (and configuration given to the user) if they
7575

7676
1. Clone the repo with `git clone https://github.com/facebookincubator/create-react-app`
7777

78-
2. Run `npm install` in the root `create-react-app` folder.
78+
2. Run `yarn` in the root `create-react-app` folder.
7979

80-
Once it is done, you can modify any file locally and run `npm start`, `npm test` or `npm run build` just like in a generated project.
80+
Once it is done, you can modify any file locally and run `yarn start`, `yarn test` or `yarn build` just like in a generated project.
8181

8282
If you want to try out the end-to-end flow with the global CLI, you can do this too:
8383

8484
```
85-
npm run create-react-app my-app
85+
yarn create-react-app my-app
8686
cd my-app
8787
```
8888

89-
and then run `npm start` or `npm run build`.
90-
91-
*Note: if you are using yarn, we suggest that you use `yarn install --no-lockfile` instead of the bare `yarn` or `yarn install` because we [intentionally](https://github.com/facebookincubator/create-react-app/pull/2014#issuecomment-300811661) do not ignore or add yarn.lock to our repo.*
89+
and then run `yarn start` or `yarn build`.
9290

9391
## Contributing to E2E (end to end) tests
9492

9593
**TL;DR** use the command `yarn e2e:docker` to run unit and e2e tests.
9694

9795
More detailed information are in the dedicated [README](/packages/react-scripts/fixtures/kitchensink/README.md).
9896

97+
## Tips for contributors using Windows
98+
99+
The scripts in tasks folder and other scripts in `package.json` will not work in Windows out of the box. However, using [Bash on windows](https://msdn.microsoft.com/en-us/commandline/wsl/about) makes it easier to use those scripts without any workarounds. The steps to do so are detailed below:
100+
101+
### Install Bash on Ubuntu on Windows
102+
103+
A good step by step guide can be found [here](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)
104+
105+
### Install Node.js and yarn
106+
Even if you have node and yarn installed on your windows, it would not be accessible from the bash shell. You would have to install it again. Installing via [`nvm`](https://github.com/creationix/nvm#install-script) is recommended.
107+
108+
### Line endings
109+
110+
By default git would use `CRLF` line endings which would cause the scripts to fail. You can change it for this repo only by setting `autocrlf` to false by running `git config core.autocrlf false`. You can also enable it for all your repos by using the `--global` flag if you wish to do so.
111+
99112
## Cutting a Release
100113

101114
1. Tag all merged pull requests that go into the release with the relevant milestone. Each merged PR should also be labeled with one of the [labels](https://github.com/facebookincubator/create-react-app/labels) named `tag: ...` to indicate what kind of change it is.
@@ -104,13 +117,13 @@ More detailed information are in the dedicated [README](/packages/react-scripts/
104117
4. Note that files in `packages/create-react-app` should be modified with extreme caution. Since it’s a global CLI, any version of `create-react-app` (global CLI) including very old ones should work with the latest version of `react-scripts`.
105118
5. Create a change log entry for the release:
106119
* You'll need an [access token for the GitHub API](https://help.github.com/articles/creating-an-access-token-for-command-line-use/). Save it to this environment variable: `export GITHUB_AUTH="..."`
107-
* Run `npm run changelog`. The command will find all the labeled pull requests merged since the last release and group them by the label and affected packages, and create a change log entry with all the changes and links to PRs and their authors. Copy and paste it to `CHANGELOG.md`.
120+
* Run `yarn changelog`. The command will find all the labeled pull requests merged since the last release and group them by the label and affected packages, and create a change log entry with all the changes and links to PRs and their authors. Copy and paste it to `CHANGELOG.md`.
108121
* Add a four-space indented paragraph after each non-trivial list item, explaining what changed and why. For each breaking change also write who it affects and instructions for migrating existing code.
109122
* Maybe add some newlines here and there. Preview the result on GitHub to get a feel for it. Changelog generator output is a bit too terse for my taste, so try to make it visually pleasing and well grouped.
110123
6. Make sure to include “Migrating from ...” instructions for the previous release. Often you can copy and paste them.
111-
7. After merging the changelog update, create a GitHub Release with the same text. See previous Releases for inspiration.
112-
8. **Do not run `npm publish`. Instead, run `npm run publish`.**
113-
9. Wait for a long time, and it will get published. Don’t worry that it’s stuck. In the end the publish script will prompt for versions before publishing the packages.
124+
7. Run `npm run publish`. (It has to be `npm run publish` exactly, not just `npm publish` or `yarn publish`.)
125+
8. Wait for a long time, and it will get published. Don’t worry that it’s stuck. In the end the publish script will prompt for versions before publishing the packages.
126+
9. After publishing, create a GitHub Release with the same text as the changelog entry. See previous Releases for inspiration.
114127

115128
Make sure to test the released version! If you want to be extra careful, you can publish a prerelease by running `npm run publish -- --tag next` instead of `npm run publish`.
116129

LICENSE

+17-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
1-
BSD License
1+
MIT License
22

3-
For create-react-app software
3+
Copyright (c) 2013-present, Facebook, Inc.
44

5-
Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
611

7-
Redistribution and use in source and binary forms, with or without modification,
8-
are permitted provided that the following conditions are met:
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
914

10-
* Redistributions of source code must retain the above copyright notice, this
11-
list of conditions and the following disclaimer.
12-
13-
* Redistributions in binary form must reproduce the above copyright notice,
14-
this list of conditions and the following disclaimer in the documentation
15-
and/or other materials provided with the distribution.
16-
17-
* Neither the name Facebook nor the names of its contributors may be used to
18-
endorse or promote products derived from this software without specific
19-
prior written permission.
20-
21-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

PATENTS

-33
This file was deleted.

README.md

+53-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ See [Forking react-scripts](https://github.com/facebookincubator/create-react-ap
1414

1515
Create React apps (with Typescript) with no build configuration.
1616

17+
* [Getting Started](#tldr) – How to create a new app.
18+
* [User Guide](https://github.com/wmonk/create-react-app-typescript/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with react scripts ts.
19+
1720
_Do you know react and want to try out typescript? Or do you know typescript and want to try out react?_ Get all the benefits from `create-react-app` but you use typescript! 🚀
1821

1922
## tl;dr
@@ -163,15 +166,23 @@ All of them are transitive dependencies of the provided npm package.
163166
## Contributing
164167

165168
## Features
169+
## Migration
166170

167-
### Code highlighting on error
168-
When you run `npm run build` the terminal will output the error, including the highlighted sourcecode (like babel)!
171+
In general, most upgrades won't require any migration steps to work, but if you experience problems after an upgrade, please file an issue, and we'll add it to the list of migration steps below.
169172

170-
![CodeHighlight](https://cloud.githubusercontent.com/assets/175278/22310149/1ee66ccc-e346-11e6-83ff-e3a053701fb4.gif)
173+
### From `<2.13.0` to `>=2.13.0`
171174

172-
## Migration
175+
Since `2.13.0`, `typescript` is listed as a peer dependency of `react-scripts-ts`. For projects generated with at least this version, the init script takes care of properly installing it as dev dependency to the generated projects. Older projects require manual installation, in case you have not already done that.
173176

174-
In general, most upgrades won't require any migration steps to work, but if you experience problems after an upgrade, please file an issue, and we'll add it to the list of migration steps below.
177+
Using `npm`:
178+
```
179+
npm i -D typescript
180+
```
181+
182+
Using `yarn`:
183+
```
184+
yarn add -D typescript
185+
```
175186

176187
### From `<2.5.0` to `>=2.5.0`
177188

@@ -191,6 +202,43 @@ To fix this, create a new file *in the root of the project* called `tsconfig.tes
191202

192203
## Changelog
193204

205+
### 2.15.0
206+
* Replace TSLint rules with presets - @nielsdB97
207+
* Update file-loader exclusion rules - @winstonewert
208+
* Fix Uglifyjs settings - @meandmax
209+
* Merge react-script 1.1.x - @wmonk
210+
211+
### 2.14.0
212+
* README fixes - @kaminskypavel
213+
* README fixes - @adambowles
214+
* Remove unused JS files - @DorianGrey
215+
* README fixes - @stephtr
216+
* Added the abillity to import js and jsx files with ts-loader - @GeeWee
217+
* Uglifyjs update for es6 support - @thetric
218+
219+
### 2.13.0
220+
* Remove tslint-loader from prod builds - @DorianGrey
221+
* Include typescript as devDependency in boilerplate - @ianschmitz
222+
* Document custom module formats - @joshtynjala
223+
* Fix tsconfig.json - @diabelb
224+
225+
### 2.12.0
226+
* Update typescript to 2.6.2
227+
228+
### 2.11.0
229+
* Upgrade to [`react-scripts@1.0.17`](https://github.com/facebookincubator/create-react-app/releases/tag/v1.0.17)
230+
231+
### 2.10.0
232+
* README updates - StefanSchoof
233+
* README updates - DorianGrey
234+
* Add support for fork-ts-checker-webpack-plugin - johnnyreilly
235+
236+
### 2.9.0 - UNPUBLISHED
237+
This included changes that were not published by the facebook upstream, so was unpublished.
238+
239+
### 2.8.0
240+
* Update typescript to 2.5.3 - @nicolaserny
241+
194242
### 2.7.0
195243
* Merge react-scripts@1.0.13 - @JohnNilsson
196244
* Fix git tempalte - @hktonylee

appveyor.cleanup-cache.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ http://help.appveyor.com/discussions/questions/1310-delete-cache
33

44
----
55
Just testing if this works.
6+
lalala.

appveyor.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ image: Visual Studio 2017
22

33
environment:
44
matrix:
5-
- nodejs_version: 7
5+
- nodejs_version: 8
66
test_suite: "simple"
7-
- nodejs_version: 7
7+
- nodejs_version: 8
88
test_suite: "installs"
9-
- nodejs_version: 7
9+
- nodejs_version: 8
1010
test_suite: "kitchensink"
1111
- nodejs_version: 6
1212
test_suite: "simple"
@@ -28,8 +28,6 @@ platform:
2828
- x64
2929

3030
install:
31-
# TODO: Remove after https://github.com/appveyor/ci/issues/1426 is fixed
32-
- set PATH=C:\Program Files\Git\mingw64\bin;%PATH%
3331
- ps: Install-Product node $env:nodejs_version $env:platform
3432

3533
build: off
@@ -41,4 +39,4 @@ skip_commits:
4139
test_script:
4240
- node --version
4341
- npm --version
44-
- sh tasks/e2e-%test_suite%.sh
42+
- bash tasks/e2e-%test_suite%.sh

lerna.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"lerna": "2.0.0",
2+
"lerna": "2.6.0",
3+
"npmClient": "yarn",
4+
"useWorkspaces": true,
35
"version": "independent",
46
"changelog": {
57
"repo": "facebookincubator/create-react-app",
@@ -12,8 +14,5 @@
1214
"tag: internal": ":house: Internal"
1315
},
1416
"cacheDir": ".changelog"
15-
},
16-
"packages": [
17-
"packages/*"
18-
]
17+
}
1918
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"publish": "tasks/release.sh",
1111
"start": "node packages/react-scripts/scripts/start.js",
1212
"test": "node packages/react-scripts/scripts/test.js --env=jsdom",
13-
"format": "prettier --trailing-comma es5 --single-quote --write 'packages/*/*.js' 'packages/*/!(node_modules)/**/*.js'",
13+
"format": "prettier --trailing-comma es5 --single-quote --write \"packages/*/*.js\" \"packages/*/!(node_modules)/**/*.js\"",
1414
"precommit": "lint-staged"
1515
},
1616
"devDependencies": {

packages/babel-preset-react-app/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ If you want to use this Babel preset in a project not built with Create React Ap
1616

1717
First, [install Babel](https://babeljs.io/docs/setup/).
1818

19+
Then install babel-preset-react-app.
20+
21+
```sh
22+
npm install babel-preset-react-app --save-dev
23+
```
24+
1925
Then create a file named `.babelrc` with following contents in the root folder of your project:
2026

2127
```js

packages/babel-preset-react-app/index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97
'use strict';
108

119
const plugins = [
10+
// Necessary to include regardless of the environment because
11+
// in practice some other transforms (such as object-rest-spread)
12+
// don't work without it: https://github.com/babel/babel/issues/7215
13+
require.resolve('babel-plugin-transform-es2015-destructuring'),
1214
// class { handleClick = () => { } }
1315
require.resolve('babel-plugin-transform-class-properties'),
1416
// The following two plugins use Object.assign directly, instead of Babel's

packages/babel-preset-react-app/package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
{
22
"name": "babel-preset-react-app",
3-
"version": "3.0.2",
3+
"version": "3.1.1",
44
"description": "Babel preset used by Create React App",
55
"repository": "facebookincubator/create-react-app",
6-
"license": "BSD-3-Clause",
6+
"license": "MIT",
77
"bugs": {
88
"url": "https://github.com/facebookincubator/create-react-app/issues"
99
},
1010
"files": [
1111
"index.js"
1212
],
1313
"dependencies": {
14-
"babel-plugin-dynamic-import-node": "1.0.2",
14+
"babel-plugin-dynamic-import-node": "1.1.0",
1515
"babel-plugin-syntax-dynamic-import": "6.18.0",
1616
"babel-plugin-transform-class-properties": "6.24.1",
17-
"babel-plugin-transform-object-rest-spread": "6.23.0",
17+
"babel-plugin-transform-es2015-destructuring": "6.23.0",
18+
"babel-plugin-transform-object-rest-spread": "6.26.0",
1819
"babel-plugin-transform-react-constant-elements": "6.23.0",
1920
"babel-plugin-transform-react-jsx": "6.24.1",
2021
"babel-plugin-transform-react-jsx-self": "6.22.0",
2122
"babel-plugin-transform-react-jsx-source": "6.22.0",
22-
"babel-plugin-transform-regenerator": "6.24.1",
23+
"babel-plugin-transform-regenerator": "6.26.0",
2324
"babel-plugin-transform-runtime": "6.23.0",
24-
"babel-preset-env": "1.5.2",
25+
"babel-preset-env": "1.6.1",
2526
"babel-preset-react": "6.24.1"
2627
},
2728
"peerDependencies": {

0 commit comments

Comments
 (0)