You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+45-54Lines changed: 45 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,97 +6,83 @@ We want this community to be friendly and respectful to each other. Please follo
6
6
7
7
## Development workflow
8
8
9
+
> [!IMPORTANT]
10
+
> Scripts in this project are designed to be run in a bash environment using [Yarn](https://yarnpkg.com/) and [Corepack](https://yarnpkg.com/corepack). If you are using a different shell, you may need to adjust the commands accordingly.
11
+
9
12
This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
10
13
11
14
- The library package in the root directory.
12
15
- An example app in the `example/` directory.
13
16
14
17
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
15
18
16
-
```sh
17
-
yarn init -2
18
-
yarn
19
-
yarn build
20
-
```
21
-
19
+
> [!NOTE]
20
+
> If you do not have Yarn v3/4 installed, you can install it via [Corepack](https://yarnpkg.com/corepack) by running: `npm install -g corepack`
22
21
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
23
22
24
-
The [example app](/example/) demonstrates usage of the library.
25
-
26
-
It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Most changes to the library's code will be reflected in the example app without a rebuild, but changes to the Metro, Babel or compiler sections will require a rebuild.
27
-
28
-
You can rebuild the library by running:
29
-
30
23
```sh
31
-
yarn build
24
+
yarn init -2 # We require Yarn 4
25
+
yarn clean # Install dependencies, rebuild the project and example app
26
+
yarn example ios # Or yarn example android
32
27
```
33
28
34
-
There is no rebuild watch command, as if you are changing code that requires a rebuild, you will also need to restart the example app server to observe any changes.
29
+
Once the example app is built, you can use
35
30
36
31
```sh
37
-
# Alias for yarn build && yarn example debug
38
-
yarn build:debug
39
-
40
-
# Alias for yarn build && yarn example start
41
-
yarn build:start
42
-
43
-
# Tips:
44
-
45
-
## Quickly rebuild and refresh the simulator
46
-
yarn build:debug --ios
47
-
yarn build:debug --android
48
-
yarn build:debug --web
32
+
yarn example start # Start Expo CLI
33
+
yarn example start:build # Rebuild the project and start Expo CLI
34
+
yarn example start:debug # Rebuild the project and start Expo CLI with debug logging
49
35
```
50
36
51
-
### Building the example app
37
+
##Example app
52
38
53
-
The example app is built using a canary version of the Expo SDK, which requires a development build. Before running the example app on a device or simulator, you need to build the app using the following command:
54
-
55
-
```sh
56
-
yarn example expo prebuild
57
-
58
-
yarn example ios
59
-
# Or
60
-
yarn example android
61
-
```
62
-
63
-
### Running the example app
39
+
The [example app](/example/) demonstrates usage of the library.
64
40
65
-
You can use various commands from the root directory to work with the project.
41
+
It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Most changes to the library's code will be reflected in the example app without a rebuild, but changes to the Metro, Babel or compiler sections will require a rebuild.
66
42
67
-
To start the CLI:
43
+
You can rebuild the library by running:
68
44
69
45
```sh
70
-
yarn example start
46
+
yarn build
71
47
```
72
48
73
-
To start the CLI wih debugging enabled:
49
+
**There is no rebuild watch command.** The example app should fast refresh with most code changes, but certain changes (like those to the Metro transformer or Babel plugin) will require a rebuild of the library and example app. For this reason, we recommend using the `start:*` commands to rebuild the library and start the example app server in one command.
74
50
75
51
```sh
76
-
yarn example debug
52
+
yarn example start # Start Expo CLI
53
+
yarn example start:build # Rebuild the project and start Expo CLI
54
+
yarn example start:debug # Rebuild the project and start Expo CLI with debug logging
77
55
```
78
56
79
-
To rebuild the example app on Android:
57
+
The `yarn example start` commands are aliases for `expo start`. They accept the same arguments as `expo start`, so you can pass any Expo CLI options to them.
58
+
59
+
For example, to open the example app on a specific platform, you can use:
80
60
81
61
```sh
82
-
yarn example android
62
+
yarn start --ios
63
+
yarn start --android
64
+
yarn start --web
65
+
66
+
yarn start:build --ios
67
+
yarn start:build --android
68
+
yarn start:build --web
83
69
```
84
70
85
-
To rebuild the example app on iOS:
71
+
> [!TIP]
72
+
> `start:build` and `start:debug` will clear the cache before starting the Expo CLI. If you are experiencing issue with `yarn example start` not reflecting your changes, try running `yarn example start:build` or `yarn example start:debug`.
86
73
87
-
```sh
88
-
yarn example ios
89
-
```
74
+
### Rebuilding the example app
90
75
91
-
To run the example app on Web:
76
+
The example app is built using a canary version of the Expo SDK, which requires a development build. Before running the example app on a device or simulator, you need to build the app using the following command:
92
77
93
78
```sh
94
-
yarn example web
79
+
yarn example expo prebuild # Rerun the Expo prebuild command
80
+
yarn example ios # Or yarn example android
95
81
```
96
82
97
83
### Testing
98
84
99
-
Remember to add tests for your change if possible. Run the unit tests by:
85
+
Remember to add tests for your pull request if possible. Run the unit tests by:
100
86
101
87
```sh
102
88
yarn test
@@ -110,7 +96,7 @@ yarn test
110
96
Run the example via the command line with the `debug` script to enable debugging:
111
97
112
98
```sh
113
-
yarn example debug
99
+
yarn example start:debug
114
100
```
115
101
116
102
This will print parsed CSS and style objects to the console, which can help you understand how the library processes CSS files.
@@ -163,7 +149,8 @@ yarn release
163
149
164
150
The `package.json` file contains various scripts for common tasks:
165
151
166
-
-`yarn`: setup project by installing dependencies.
152
+
-`yarn`: install dependencies.
153
+
-`yarn clean`: setup project by installing dependencies and rebuilding the project and example app
167
154
-`yarn typecheck`: type-check files with TypeScript.
168
155
-`yarn lint`: lint files with ESLint.
169
156
-`yarn test`: run unit tests with Jest.
@@ -183,6 +170,10 @@ When you're sending a pull request:
183
170
- Follow the pull request template when opening a pull request.
184
171
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
185
172
173
+
_Do not create pull requests for these reasons:_
174
+
175
+
- Changing the scripts to work in non-bash environments
Copy file name to clipboardExpand all lines: README.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,6 +172,25 @@ export default function App() {
172
172
173
173
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
174
174
175
+
To quickly get started with the project, you can run:
176
+
177
+
```sh
178
+
yarn init -2 # We require Yarn 4
179
+
yarn clean # Install dependencies, rebuild the project and example app
180
+
yarn example ios # Or yarn example android
181
+
```
182
+
183
+
Once the example app is built, you can use
184
+
185
+
```sh
186
+
yarn example start # Start Expo CLI
187
+
yarn example start:build # Rebuild the project and start Expo CLI
188
+
yarn example start:debug # Rebuild the project and start Expo CLI with debug logging
189
+
```
190
+
191
+
> [!TIP]
192
+
> `start:build` and `start:debug` will clear the cache before starting the Expo CLI. If you are experiencing issue with `yarn example start` not reflecting your changes, try running `yarn example start:build` or `yarn example start:debug`.
0 commit comments