Skip to content

Commit 3709d7d

Browse files
authored
Merge pull request #2445 from microsoft/update-documentation
Update documentation for the latest changes
2 parents f6311c1 + 0c6b351 commit 3709d7d

File tree

2 files changed

+77
-7
lines changed

2 files changed

+77
-7
lines changed

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Using this extension, you can **debug your code and quickly run `react-native` o
5353
- [Debug on Expo Web](#debug-on-expo-web)
5454
- [Configuring Expo](#configuring-expo)
5555
- [Expo Hermes](#expo-hermes)
56+
- [EAS Build initialization](#eas-build-initialization)
5657
- [Windows applications](#react-native-for-windows)
5758
- [Windows Hermes debugging](#windows-hermes-debugging)
5859
- [MacOS applications](#react-native-for-macos)
@@ -143,6 +144,7 @@ The full list of commands is:
143144
| Enable & Disable Expo Hermes | `reactNative.expoHermesEnable` | Use hermes or jsc as JavaScript engine for expo project |
144145
| Open expo upgrade helper in web page | `reactNative.openExpoUpgradeHelper` | Open expo upgrade helper in web browser |
145146
| Kill Port | `reactNative.killPort` | Kill the process running on a specific port |
147+
| Run EAS Build | `reactNative.runEasBuild` | Initialize EAS Build configuration by creating `eas.json` and `.eas/workflows/create-production-builds.yml` files if they don't exist |
146148
| Set React Native New Architecture | `reactNative.setNewArch` | Enable or disable the new architecture settings in RN projects |
147149
| Toggle Network View | `reactNative.toggleNetworkView` | Enable or disable vscode network view feature for web debugging |
148150

@@ -432,6 +434,74 @@ Expo using Hermes as default engine, you can switch engine on a specific platfor
432434

433435
**Note**: You maybe need to create developer account to run `eas build`. Any other issue or limitiation, please see [expo hermes ducomentation](https://docs.expo.dev/guides/using-hermes/).
434436

437+
### EAS Build initialization
438+
439+
The **Run EAS Build** command (`reactNative.runEasBuild`) helps you quickly set up [Expo Application Services (EAS) Build](https://docs.expo.dev/build/introduction/) configuration in your Expo project.
440+
441+
#### What it does
442+
443+
When you run this command from the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`), it will:
444+
445+
1. Check if your project root directory is accessible
446+
2. Create an `eas.json` file (if it doesn't exist) with an empty configuration `{}`
447+
3. Create the `.eas/workflows/` directory structure
448+
4. Generate a `create-production-builds.yml` workflow file with the following content:
449+
450+
```yaml
451+
name: Create Production Builds
452+
jobs:
453+
build_android:
454+
type: build # This job type creates a production build for Android
455+
params:
456+
platform: android
457+
build_ios:
458+
type: build # This job type creates a production build for iOS
459+
params:
460+
platform: ios
461+
```
462+
463+
#### How to use
464+
465+
1. Open your Expo project in VS Code
466+
2. Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS) to open the Command Palette
467+
3. Type "Run EAS Build" and select **React Native: Run EAS Build**
468+
4. The command will create the necessary files if they don't exist
469+
470+
**Note**: The command is idempotent - it will not overwrite existing files. If the files already exist, the command will skip creation and display an appropriate message.
471+
472+
#### Next steps after initialization
473+
474+
After running this command, you should:
475+
476+
1. **Configure `eas.json`**: Add your build profiles (e.g., `development`, `preview`, `production`). See [EAS Build Configuration](https://docs.expo.dev/build/eas-json/) for details.
477+
478+
2. **Set up credentials**: Configure your iOS and Android signing credentials. Use `eas credentials` command or configure them in your EAS project.
479+
480+
3. **Run your first build**:
481+
482+
```bash
483+
# For Android
484+
npx eas build --platform android
485+
486+
# For iOS
487+
npx eas build --platform ios
488+
489+
# For both platforms
490+
npx eas build --platform all
491+
```
492+
493+
4. **Customize workflows**: Edit `.eas/workflows/create-production-builds.yml` to add more complex build configurations, such as different build profiles, environment variables, or custom scripts.
494+
495+
5. **Monitor builds**: Use `React Native: Open the eas project in a web page` command to view your build status in the EAS dashboard.
496+
497+
#### Troubleshooting
498+
499+
- **Permission errors**: Ensure VS Code has write permissions to your project directory
500+
- **Files already exist**: The command will skip file creation if they already exist - this is normal behavior
501+
- **Project not found**: Make sure you have opened a React Native/Expo project folder in VS Code
502+
503+
For more information about EAS Build, visit the [official Expo documentation](https://docs.expo.dev/build/introduction/).
504+
435505
## React Native for Windows
436506

437507
Please make sure that your development environment is configured properly in accordance with [the official system requirements](https://microsoft.github.io/react-native-windows/docs/rnw-dependencies).

test/extension/commandExecutor.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ suite("commandExecutor", function () {
8383
assert.strictEqual(reason.errorCode, 101);
8484
assert.strictEqual(reason.errorLevel, 0);
8585
}
86-
});
86+
}).timeout(10000);
8787

8888
test("should reject on good command that fails", async () => {
8989
const ce = new CommandExecutor(nodeModulesRoot);
@@ -96,7 +96,7 @@ suite("commandExecutor", function () {
9696
assert.strictEqual(reason.errorCode, 101);
9797
assert.strictEqual(reason.errorLevel, 0);
9898
}
99-
});
99+
}).timeout(10000);
100100

101101
test("should spawn a command", async () => {
102102
const ce = new CommandExecutor(nodeModulesRoot);
@@ -106,7 +106,7 @@ suite("commandExecutor", function () {
106106
});
107107

108108
return await ce.spawn("node", ["-v"]);
109-
});
109+
}).timeout(10000);
110110

111111
test("spawn should reject a bad command", async () => {
112112
const ce = new CommandExecutor(nodeModulesRoot);
@@ -121,23 +121,23 @@ suite("commandExecutor", function () {
121121
assert.strictEqual(reason.errorCode, 101);
122122
assert.strictEqual(reason.errorLevel, 0);
123123
}
124-
});
124+
}).timeout(10000);
125125

126126
test("should return correct CLI react command", async () => {
127127
const ce = new CommandExecutor(nodeModulesRoot);
128128
// const expected =
129129
// "test\\resources\\sampleReactNativeProject\\node_modules\\.bin\react-native.cmd";
130130
const command = HostPlatform.getNpmCliCommand(ce.selectReactNativeCLI());
131131
assert.ok(command.includes("react-native"));
132-
});
132+
}).timeout(10000);
133133

134134
test("should return correct CLI Expo command", async () => {
135135
const ce = new CommandExecutor(nodeModulesRoot);
136136
// const expected =
137137
// "test\\resources\\sampleReactNativeProject\\node_modules\\.bin\\expo.cmd";
138138
const command = HostPlatform.getNpmCliCommand(ce.selectExpoCLI());
139139
assert.ok(command.includes("expo"));
140-
});
140+
}).timeout(10000);
141141

142142
test("should not fail on react-native command without arguments", async () => {
143143
(sinon.stub(childProcessStubInstance, "spawn") as Sinon.SinonStub).returns({
@@ -151,7 +151,7 @@ suite("commandExecutor", function () {
151151
} catch (error) {
152152
assert.fail("react-native command was not expected to fail");
153153
}
154-
});
154+
}).timeout(10000);
155155

156156
suite("getReactNativeVersion", () => {
157157
const reactNativePackageDir = path.join(

0 commit comments

Comments
 (0)