Skip to content

Commit 32cadf0

Browse files
Windows platform for Example app with v0.70 (#429)
* Init Windows app with v0.70 * Install react-native-windows into example * Turn on the Windows example build on CI * Enable metro config for Windows example
1 parent 513f4ab commit 32cadf0

36 files changed

+3061
-501
lines changed

.github/workflows/ReactNativeSlider-CI.yml

+16-17
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,19 @@ jobs:
203203
working-directory: example/ios
204204

205205

206-
# Disabled until Windows Example app is added with v0.70
207-
# build-Windows-app:
208-
# name: Build example app Windows
209-
# runs-on: windows-latest
210-
# needs: [verify]
211-
# steps:
212-
# - name: Ensure the cross-platform Git on Windows
213-
# run: git config --global core.autocrlf false
214-
#
215-
# - name: Checkout repository
216-
# uses: actions/checkout@v3
217-
#
218-
# - name: Install dependencies
219-
# run: npm install
220-
#
221-
# - name: Build the Windows OS app
222-
# run: cd example; npx react-native run-windows --arch x64 --no-launch --no-deploy --logging
206+
build-Windows-app:
207+
name: Build example app Windows
208+
runs-on: windows-latest
209+
needs: [verify]
210+
steps:
211+
- name: Ensure the cross-platform Git on Windows
212+
run: git config --global core.autocrlf false
213+
214+
- name: Checkout repository
215+
uses: actions/checkout@v3
216+
217+
- name: Install dependencies
218+
run: npm install
219+
220+
- name: Build the Windows OS app
221+
run: cd example; npx react-native run-windows --arch x64 --no-launch --no-deploy --logging

example/metro.config.ts

+18-19
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,27 @@
44
*
55
* @format
66
*/
7-
// const fs = require('fs');
8-
// const path = require('path');
9-
// const exclusionList = require('metro-config/src/defaults/exclusionList');
7+
const fs = require('fs');
8+
const path = require('path');
9+
const exclusionList = require('metro-config/src/defaults/exclusionList');
1010

11-
// const rnwPath = fs.realpathSync(
12-
// path.resolve(require.resolve('react-native-windows/package.json'), '..'),
13-
// );
11+
const rnwPath = fs.realpathSync(
12+
path.resolve(require.resolve('react-native-windows/package.json'), '..'),
13+
);
1414

1515
module.exports = {
16-
// Disabled until Windows Example app is added with v0.70
17-
// resolver: {
18-
// blockList: exclusionList([
19-
// // This stops "react-native run-windows" from causing the metro server to crash if its already running
20-
// new RegExp(
21-
// `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
22-
// ),
23-
// // This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild
24-
// new RegExp(`${rnwPath}/build/.*`),
25-
// new RegExp(`${rnwPath}/target/.*`),
26-
// /.*\.ProjectImports\.zip/,
27-
// ]),
28-
// },
16+
resolver: {
17+
blockList: exclusionList([
18+
// This stops "react-native run-windows" from causing the metro server to crash if its already running
19+
new RegExp(
20+
`${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
21+
),
22+
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild
23+
new RegExp(`${rnwPath}/build/.*`),
24+
new RegExp(`${rnwPath}/target/.*`),
25+
/.*\.ProjectImports\.zip/,
26+
]),
27+
},
2928
transformer: {
3029
getTransformOptions: async () => ({
3130
transform: {

0 commit comments

Comments
 (0)