Skip to content

Commit

Permalink
Windows platform for Example app with v0.70 (callstack#429)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
BartoszKlonowski authored Sep 15, 2022
1 parent 513f4ab commit 32cadf0
Show file tree
Hide file tree
Showing 36 changed files with 3,061 additions and 501 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/ReactNativeSlider-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,19 @@ jobs:
working-directory: example/ios


# Disabled until Windows Example app is added with v0.70
# build-Windows-app:
# name: Build example app Windows
# runs-on: windows-latest
# needs: [verify]
# steps:
# - name: Ensure the cross-platform Git on Windows
# run: git config --global core.autocrlf false
#
# - name: Checkout repository
# uses: actions/checkout@v3
#
# - name: Install dependencies
# run: npm install
#
# - name: Build the Windows OS app
# run: cd example; npx react-native run-windows --arch x64 --no-launch --no-deploy --logging
build-Windows-app:
name: Build example app Windows
runs-on: windows-latest
needs: [verify]
steps:
- name: Ensure the cross-platform Git on Windows
run: git config --global core.autocrlf false

- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
run: npm install

- name: Build the Windows OS app
run: cd example; npx react-native run-windows --arch x64 --no-launch --no-deploy --logging
37 changes: 18 additions & 19 deletions example/metro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@
*
* @format
*/
// const fs = require('fs');
// const path = require('path');
// const exclusionList = require('metro-config/src/defaults/exclusionList');
const fs = require('fs');
const path = require('path');
const exclusionList = require('metro-config/src/defaults/exclusionList');

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

module.exports = {
// Disabled until Windows Example app is added with v0.70
// resolver: {
// blockList: exclusionList([
// // This stops "react-native run-windows" from causing the metro server to crash if its already running
// new RegExp(
// `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
// ),
// // This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild
// new RegExp(`${rnwPath}/build/.*`),
// new RegExp(`${rnwPath}/target/.*`),
// /.*\.ProjectImports\.zip/,
// ]),
// },
resolver: {
blockList: exclusionList([
// This stops "react-native run-windows" from causing the metro server to crash if its already running
new RegExp(
`${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
),
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild
new RegExp(`${rnwPath}/build/.*`),
new RegExp(`${rnwPath}/target/.*`),
/.*\.ProjectImports\.zip/,
]),
},
transformer: {
getTransformOptions: async () => ({
transform: {
Expand Down
Loading

0 comments on commit 32cadf0

Please sign in to comment.