Skip to content

Commit cad191a

Browse files
committed
Change docs to use Yarn instead of npm
- React Native uses Yarn by default if installed - Typescript typings for RN CSS Modules only work with Yarn
1 parent 8e74cb7 commit cad191a

File tree

10 files changed

+31
-55
lines changed

10 files changed

+31
-55
lines changed

docs/setup-css.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cd AwesomeProject
2424
Start packager:
2525

2626
```sh
27-
npm start
27+
yarn start
2828
```
2929

3030
Run project on iOS simulator:
@@ -36,7 +36,7 @@ react-native run-ios
3636
### Step 3: Install dependencies for React Native CSS modules
3737

3838
```sh
39-
npm install babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-css-transformer --save-dev
39+
yarn add babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-css-transformer --dev
4040
```
4141

4242
### Step 4: Setup your project's `.babelrc`
@@ -176,7 +176,5 @@ export default class App extends Component<{}> {
176176
Restart React Native packager and clear it's cache (important) to see the styles that you added.
177177

178178
```sh
179-
npm start -- --reset-cache
179+
yarn start --reset-cache
180180
```
181-
182-
If it throws an error for missing `node_modules/react-native/local-cli/cli.js`, just run `npm install` and then try again.

docs/setup-less.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cd AwesomeProject
2424
Start packager:
2525

2626
```sh
27-
npm start
27+
yarn start
2828
```
2929

3030
Run project on iOS simulator:
@@ -36,7 +36,7 @@ react-native run-ios
3636
### Step 3: Install dependencies for React Native CSS modules
3737

3838
```sh
39-
npm install babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-less-transformer less --save-dev
39+
yarn add babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-less-transformer less --dev
4040
```
4141

4242
### Step 4: Setup your project's `.babelrc`
@@ -176,7 +176,5 @@ export default class App extends Component<{}> {
176176
Restart React Native packager and clear it's cache (important) to see the styles that you added.
177177

178178
```sh
179-
npm start -- --reset-cache
179+
yarn start --reset-cache
180180
```
181-
182-
If it throws an error for missing `node_modules/react-native/local-cli/cli.js`, just run `npm install` and then try again.

docs/setup-linting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Setup [ESLint](https://eslint.org) and [stylelint](https://stylelint.io/) in you
88
### Step 1: Install ESLint, stylelint and plugins
99

1010
```sh
11-
npm install eslint eslint-plugin-css-modules stylelint stylelint-react-native stylelint-config-react-native-css-modules --save-dev
11+
yarn add eslint eslint-plugin-css-modules stylelint stylelint-react-native stylelint-config-react-native-css-modules --dev
1212
```
1313

1414
### Step 2: Add configs
@@ -64,4 +64,4 @@ _You can remove file extensions that you don't use from the stylelint command._
6464

6565
### Step 4: Run linters
6666

67-
Run `npm run lint` in a terminal window to see if there are any linting errors or warnings.
67+
Run `yarn lint` in a terminal window to see if there are any linting errors or warnings.

docs/setup-postcss.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cd AwesomeProject
2424
Start packager:
2525

2626
```sh
27-
npm start
27+
yarn start
2828
```
2929

3030
Run project on iOS simulator:
@@ -36,7 +36,7 @@ react-native run-ios
3636
### Step 3: Install dependencies for React Native CSS modules
3737

3838
```sh
39-
npm install babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-postcss-transformer postcss --save-dev
39+
yarn add babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-postcss-transformer postcss --dev
4040
```
4141

4242
### Step 4: Add your PostCSS config and install your PostCSS plugins
@@ -208,7 +208,5 @@ export default class App extends Component<{}> {
208208
Restart React Native packager and clear it's cache (important) to see the styles that you added.
209209

210210
```sh
211-
npm start -- --reset-cache
211+
yarn start --reset-cache
212212
```
213-
214-
If it throws an error for missing `node_modules/react-native/local-cli/cli.js`, just run `npm install` and then try again.

docs/setup-responsive.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cd AwesomeProject
2626
Start packager:
2727

2828
```sh
29-
npm start
29+
yarn start
3030
```
3131

3232
Run project on iOS simulator:
@@ -38,7 +38,7 @@ react-native run-ios
3838
### Step 3: Install dependencies for React Native CSS modules
3939

4040
```sh
41-
npm install babel-plugin-react-native-classname-to-dynamic-style babel-plugin-react-native-platform-specific-extensions react-native-css-transformer --save-dev
41+
yarn add babel-plugin-react-native-classname-to-dynamic-style babel-plugin-react-native-platform-specific-extensions react-native-css-transformer --dev
4242
```
4343

4444
### Step 4: Setup your project's `.babelrc`
@@ -185,7 +185,5 @@ export default class App extends Component<{}> {
185185
Restart React Native packager and clear it's cache (important) to see the styles that you added.
186186

187187
```sh
188-
npm start -- --reset-cache
188+
yarn start --reset-cache
189189
```
190-
191-
If it throws an error for missing `node_modules/react-native/local-cli/cli.js`, just run `npm install` and then try again.

docs/setup-sass.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cd AwesomeProject
2424
Start packager:
2525

2626
```sh
27-
npm start
27+
yarn start
2828
```
2929

3030
Run project on iOS simulator:
@@ -36,7 +36,7 @@ react-native run-ios
3636
### Step 3: Install dependencies for React Native CSS modules
3737

3838
```sh
39-
npm install babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-sass-transformer node-sass --save-dev
39+
yarn add babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-sass-transformer node-sass --dev
4040
```
4141

4242
### Step 4: Setup your project's `.babelrc`
@@ -176,7 +176,5 @@ export default class App extends Component<{}> {
176176
Restart React Native packager and clear it's cache (important) to see the styles that you added.
177177

178178
```sh
179-
npm start -- --reset-cache
179+
yarn start --reset-cache
180180
```
181-
182-
If it throws an error for missing `node_modules/react-native/local-cli/cli.js`, just run `npm install` and then try again.

docs/setup-stylename.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cd AwesomeProject
2828
Start packager:
2929

3030
```sh
31-
npm start
31+
yarn start
3232
```
3333

3434
Run project on iOS simulator:
@@ -40,7 +40,7 @@ react-native run-ios
4040
### Step 3: Install dependencies for React Native CSS modules
4141

4242
```sh
43-
npm install babel-plugin-react-native-stylename-to-style babel-plugin-react-native-platform-specific-extensions react-native-css-transformer --save-dev
43+
yarn add babel-plugin-react-native-stylename-to-style babel-plugin-react-native-platform-specific-extensions react-native-css-transformer --dev
4444
```
4545

4646
### Step 4: Setup your project's `.babelrc`
@@ -190,7 +190,5 @@ export default class App extends Component<{}> {
190190
Restart React Native packager and clear it's cache (important) to see the styles that you added.
191191

192192
```sh
193-
npm start -- --reset-cache
193+
yarn start --reset-cache
194194
```
195-
196-
If it throws an error for missing `node_modules/react-native/local-cli/cli.js`, just run `npm install` and then try again.

docs/setup-stylus.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cd AwesomeProject
2424
Start packager:
2525

2626
```sh
27-
npm start
27+
yarn start
2828
```
2929

3030
Run project on iOS simulator:
@@ -36,7 +36,7 @@ react-native run-ios
3636
### Step 3: Install dependencies for React Native CSS modules
3737

3838
```sh
39-
npm install babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-stylus-transformer stylus --save-dev
39+
yarn add babel-plugin-react-native-classname-to-style babel-plugin-react-native-platform-specific-extensions react-native-stylus-transformer stylus --dev
4040
```
4141

4242
### Step 4: Setup your project's `.babelrc`
@@ -176,7 +176,5 @@ export default class App extends Component<{}> {
176176
Restart React Native packager and clear it's cache (important) to see the styles that you added.
177177

178178
```sh
179-
npm start -- --reset-cache
179+
yarn start --reset-cache
180180
```
181-
182-
If it throws an error for missing `node_modules/react-native/local-cli/cli.js`, just run `npm install` and then try again.

docs/setup-typescript.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,12 @@ _If you want Typescript types (`.d.ts` files) being generated your CSS/Sass/Less
1818

1919
#### For React Native v0.57 or newer
2020

21-
```
22-
npm install typescript --save-dev
23-
```
24-
25-
or
26-
2721
```
2822
yarn add typescript --dev
2923
```
3024

3125
#### For React Native v0.56 or older
3226

33-
```
34-
npm install react-native-typescript-transformer typescript --save-dev
35-
```
36-
37-
or
38-
3927
```
4028
yarn add react-native-typescript-transformer typescript --dev
4129
```
@@ -61,6 +49,8 @@ Make sure that `jsx` property is set to `react-native` in Typescript's `compiler
6149

6250
### Step 5: Setup transformer to support CSS modules and Typescript
6351

52+
#### For React Native v0.57 or newer
53+
6454
_This step is not needed if you are using React Native v0.57 or newer._
6555

6656
#### For React Native v0.56 or older (Typescript is supported by default on React Native 0.57+)

docs/web-compatibility.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ What you need is:
1515

1616
### Step 2: Install Webpack + React Native for Web
1717

18-
**Install Webpack dependencies:**
18+
#### Install Webpack dependencies
1919

2020
for React Native v0.56 or newer (uses Babel 7):
2121

2222
```sh
23-
npm install babel-loader babel-core@7.0.0-bridge.0 @babel/preset-env babel-preset-react@7.0.0-beta.3 webpack webpack-cli css-loader react-hot-loader style-loader webpack-dev-server --save-dev
23+
yarn add babel-loader babel-core@7.0.0-bridge.0 @babel/preset-env babel-preset-react@7.0.0-beta.3 webpack webpack-cli css-loader react-hot-loader style-loader webpack-dev-server --dev
2424
```
2525

2626
for React Native v0.55 or older (uses Babel 6):
2727

2828
```sh
29-
npm install babel-loader babel-core babel-preset-env babel-preset-react webpack webpack-cli css-loader react-hot-loader style-loader webpack-dev-server --save-dev
29+
yarn add babel-loader babel-core babel-preset-env babel-preset-react webpack webpack-cli css-loader react-hot-loader style-loader webpack-dev-server --dev
3030
```
3131

32-
**Install React Native for Web dependencies:**
32+
#### Install React Native for Web dependencies
3333

3434
```sh
35-
npm install react-art react-dom react-native-web --save
35+
yarn add react-art react-dom react-native-web --save
3636
```
3737

3838
### Step 3: Add Webpack config
@@ -162,4 +162,4 @@ In your project's `package.json`, add a new command called `web` to `scripts`, s
162162

163163
### Step 6: Start Webpack development server and open the project in a browser
164164

165-
Run `npm run web` in a terminal window and if there are no warnings, open `http://localhost:8080` in a web browser to see your React Native project running in a browser environment.
165+
Run `yarn web` in a terminal window and if there are no warnings, open `http://localhost:8080` in a web browser to see your React Native project running in a browser environment.

0 commit comments

Comments
 (0)