Skip to content

Commit 24db114

Browse files
committed
feat: demo iOS app supporting interchanging brownfield artifacts
1 parent d867bb3 commit 24db114

11 files changed

Lines changed: 228 additions & 44 deletions

File tree

.github/actions/appleapp-road-test/action.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Apple road test (selected RN app & AppleApp)
2-
description: Package the given RN app as XCFramework, and build the corresponding AppleApp scheme
2+
description: Package the given RN app as XCFramework, and build the corresponding AppleApp variant
33

44
inputs:
5-
scheme:
6-
description: 'AppleApp scheme to build (Expo or Vanilla)'
5+
variant:
6+
description: 'AppleApp yarn command variant to run (expo or vanilla)'
77
required: true
88

99
rn-project-path:
@@ -38,33 +38,33 @@ runs:
3838
with:
3939
path: |
4040
.ios_ccache
41-
key: ${{ runner.os }}-rnapp-appleapp-${{ inputs.scheme }}-ios-ccache-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.rn-project-path), format('{0}/ios/*.xcodeproj/project.pbxproj', inputs.rn-project-path), 'apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj') }}
41+
key: ${{ runner.os }}-rnapp-appleapp-${{ inputs.variant }}-ios-ccache-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.rn-project-path), format('{0}/ios/*.xcodeproj/project.pbxproj', inputs.rn-project-path), 'apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj') }}
4242
restore-keys: |
43-
${{ runner.os }}-rnapp-appleapp-${{ inputs.scheme }}-ios-ccache-
43+
${{ runner.os }}-rnapp-appleapp-${{ inputs.variant }}-ios-ccache-
4444
4545
# == RN app ==
4646

47-
- name: Restore Pods cache (RNApp)
47+
- name: Restore Pods cache (RN ${{ inputs.variant }} app)
4848
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
4949
with:
5050
path: |
5151
${{ inputs.rn-project-path }}/ios/Pods
52-
key: ${{ runner.os }}-rnapp-ios-pods-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.rn-project-path)) }}
52+
key: ${{ runner.os }}-rnapp-${{ inputs.variant }}-ios-pods-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.rn-project-path)) }}
5353
restore-keys: |
54-
${{ runner.os }}-rnapp-ios-pods-
54+
${{ runner.os }}-rnapp-${{ inputs.variant }}-ios-pods-
5555
56-
- name: Install pods (RNApp)
56+
- name: Install pods (RN ${{ inputs.variant }} app)
5757
run: |
5858
cd ${{ inputs.rn-project-path }}/ios
5959
pod install
6060
61-
- name: Restore DerivedData cache (RNApp)
61+
- name: Restore DerivedData cache (RN ${{ inputs.variant }} app)
6262
uses: actions/cache@v5
6363
with:
6464
path: ${{ inputs.rn-project-path }}/ios/build
65-
key: ${{ runner.os }}-ios-rnapp-derived-data-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.rn-project-path), format('{0}/ios/*.xcodeproj/project.pbxproj', inputs.rn-project-path)) }}
65+
key: ${{ runner.os }}-ios-rnapp-${{ inputs.variant }}-derived-data-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.rn-project-path), format('{0}/ios/*.xcodeproj/project.pbxproj', inputs.rn-project-path)) }}
6666
restore-keys: |
67-
${{ runner.os }}-ios-rnapp-derived-data-
67+
${{ runner.os }}-ios-rnapp-${{ inputs.variant }}-derived-data-
6868
6969
- name: Package iOS framework with the Brownfield CLI
7070
run: |
@@ -73,13 +73,13 @@ runs:
7373
7474
# == AppleApp ==
7575

76-
- name: Build Brownfield iOS native app
76+
- name: Build Brownfield iOS native app (${{ inputs.variant }})
7777
run: |
78-
yarn run build:example:ios-consumer
78+
yarn run build:example:ios-consumer:${{ inputs.variant }}
7979
8080
# ==============
8181

8282
- name: Log ccache stats
8383
uses: ./.github/actions/ccache-summary
8484
with:
85-
name: RNApp & AppleApp
85+
name: RN ${{ inputs.variant }} app & AppleApp

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ jobs:
198198
- name: Run RNApp -> AppleApp road test (Vanilla)
199199
uses: ./.github/actions/appleapp-road-test
200200
with:
201-
scheme: vanilla
201+
variant: vanilla
202202
rn-project-path: apps/RNApp
203203

204204
ios-appleapp-expo:
@@ -213,5 +213,5 @@ jobs:
213213
- name: Run RNApp -> AppleApp road test (Expo)
214214
uses: ./.github/actions/appleapp-road-test
215215
with:
216-
scheme: expo
216+
variant: expo
217217
rn-project-path: apps/RNApp

apps/AppleApp/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
build
2+
package

apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
798DE8D72F0EC98E00CFC6F3 /* BrownfieldLib.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC7E2EF5781F009EC2E3 /* BrownfieldLib.xcframework */; };
11-
798DE8D82F0EC98E00CFC6F3 /* BrownfieldLib.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC7E2EF5781F009EC2E3 /* BrownfieldLib.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
12-
798DE8DA2F0EC98F00CFC6F3 /* hermesvm.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC7F2EF5781F009EC2E3 /* hermesvm.xcframework */; };
13-
798DE8DB2F0EC98F00CFC6F3 /* hermesvm.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC7F2EF5781F009EC2E3 /* hermesvm.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
14-
798DE8DC2F0EC99000CFC6F3 /* ReactBrownfield.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC802EF5781F009EC2E3 /* ReactBrownfield.xcframework */; };
15-
798DE8DD2F0EC99000CFC6F3 /* ReactBrownfield.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC802EF5781F009EC2E3 /* ReactBrownfield.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
16-
79A9BC812EF5781F009EC2E3 /* Brownie.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC822EF5781F009EC2E3 /* Brownie.xcframework */; };
17-
79A9BC832EF5781F009EC2E3 /* Brownie.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC822EF5781F009EC2E3 /* Brownie.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
10+
798B42862F3E9A8B00DAD195 /* BrownfieldLib.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */; };
11+
798B42872F3E9A8B00DAD195 /* BrownfieldLib.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
12+
798B42882F3E9A8D00DAD195 /* Brownie.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CB2F3E93D90099076A /* Brownie.xcframework */; };
13+
798B42892F3E9A8D00DAD195 /* Brownie.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CB2F3E93D90099076A /* Brownie.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
14+
798B428A2F3E9A8E00DAD195 /* hermesvm.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CC2F3E93D90099076A /* hermesvm.xcframework */; };
15+
798B428B2F3E9A8E00DAD195 /* hermesvm.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CC2F3E93D90099076A /* hermesvm.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
16+
798B428C2F3E9A8F00DAD195 /* ReactBrownfield.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CD2F3E93D90099076A /* ReactBrownfield.xcframework */; };
17+
798B428D2F3E9A8F00DAD195 /* ReactBrownfield.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CD2F3E93D90099076A /* ReactBrownfield.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
1818
/* End PBXBuildFile section */
1919

2020
/* Begin PBXCopyFilesBuildPhase section */
@@ -24,10 +24,10 @@
2424
dstPath = "";
2525
dstSubfolderSpec = 10;
2626
files = (
27-
798DE8DB2F0EC98F00CFC6F3 /* hermesvm.xcframework in Embed Frameworks */,
28-
798DE8DD2F0EC99000CFC6F3 /* ReactBrownfield.xcframework in Embed Frameworks */,
29-
798DE8D82F0EC98E00CFC6F3 /* BrownfieldLib.xcframework in Embed Frameworks */,
30-
79A9BC832EF5781F009EC2E3 /* Brownie.xcframework in Embed Frameworks */,
27+
798B428B2F3E9A8E00DAD195 /* hermesvm.xcframework in Embed Frameworks */,
28+
798B428D2F3E9A8F00DAD195 /* ReactBrownfield.xcframework in Embed Frameworks */,
29+
798B42892F3E9A8D00DAD195 /* Brownie.xcframework in Embed Frameworks */,
30+
798B42872F3E9A8B00DAD195 /* BrownfieldLib.xcframework in Embed Frameworks */,
3131
);
3232
name = "Embed Frameworks";
3333
runOnlyForDeploymentPostprocessing = 0;
@@ -36,10 +36,10 @@
3636

3737
/* Begin PBXFileReference section */
3838
793C76A72EEBF938008A2A34 /* Brownfield Apple App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Brownfield Apple App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
39-
79A9BC7E2EF5781F009EC2E3 /* BrownfieldLib.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = BrownfieldLib.xcframework; path = ../RNApp/ios/.brownfield/package/BrownfieldLib.xcframework; sourceTree = SOURCE_ROOT; };
40-
79A9BC7F2EF5781F009EC2E3 /* hermesvm.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = hermesvm.xcframework; path = ../RNApp/ios/.brownfield/package/hermesvm.xcframework; sourceTree = SOURCE_ROOT; };
41-
79A9BC802EF5781F009EC2E3 /* ReactBrownfield.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ReactBrownfield.xcframework; path = ../RNApp/ios/.brownfield/package/ReactBrownfield.xcframework; sourceTree = SOURCE_ROOT; };
42-
79A9BC822EF5781F009EC2E3 /* Brownie.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Brownie.xcframework; path = ../RNApp/ios/.brownfield/package/Brownie.xcframework; sourceTree = SOURCE_ROOT; };
39+
79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = BrownfieldLib.xcframework; path = package/BrownfieldLib.xcframework; sourceTree = "<group>"; };
40+
79A7F5CB2F3E93D90099076A /* Brownie.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Brownie.xcframework; path = package/Brownie.xcframework; sourceTree = "<group>"; };
41+
79A7F5CC2F3E93D90099076A /* hermesvm.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = hermesvm.xcframework; path = package/hermesvm.xcframework; sourceTree = "<group>"; };
42+
79A7F5CD2F3E93D90099076A /* ReactBrownfield.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ReactBrownfield.xcframework; path = package/ReactBrownfield.xcframework; sourceTree = "<group>"; };
4343
/* End PBXFileReference section */
4444

4545
/* Begin PBXFileSystemSynchronizedRootGroup section */
@@ -55,10 +55,10 @@
5555
isa = PBXFrameworksBuildPhase;
5656
buildActionMask = 2147483647;
5757
files = (
58-
798DE8DA2F0EC98F00CFC6F3 /* hermesvm.xcframework in Frameworks */,
59-
798DE8DC2F0EC99000CFC6F3 /* ReactBrownfield.xcframework in Frameworks */,
60-
798DE8D72F0EC98E00CFC6F3 /* BrownfieldLib.xcframework in Frameworks */,
61-
79A9BC812EF5781F009EC2E3 /* Brownie.xcframework in Frameworks */,
58+
798B42882F3E9A8D00DAD195 /* Brownie.xcframework in Frameworks */,
59+
798B428C2F3E9A8F00DAD195 /* ReactBrownfield.xcframework in Frameworks */,
60+
798B42862F3E9A8B00DAD195 /* BrownfieldLib.xcframework in Frameworks */,
61+
798B428A2F3E9A8E00DAD195 /* hermesvm.xcframework in Frameworks */,
6262
);
6363
runOnlyForDeploymentPostprocessing = 0;
6464
};
@@ -68,12 +68,12 @@
6868
793C769E2EEBF938008A2A34 = {
6969
isa = PBXGroup;
7070
children = (
71-
79A9BC7E2EF5781F009EC2E3 /* BrownfieldLib.xcframework */,
72-
79A9BC822EF5781F009EC2E3 /* Brownie.xcframework */,
73-
79A9BC7F2EF5781F009EC2E3 /* hermesvm.xcframework */,
74-
79A9BC802EF5781F009EC2E3 /* ReactBrownfield.xcframework */,
7571
793C76A92EEBF938008A2A34 /* Brownfield Apple App */,
7672
793C76A82EEBF938008A2A34 /* Products */,
73+
79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */,
74+
79A7F5CB2F3E93D90099076A /* Brownie.xcframework */,
75+
79A7F5CC2F3E93D90099076A /* hermesvm.xcframework */,
76+
79A7F5CD2F3E93D90099076A /* ReactBrownfield.xcframework */,
7777
);
7878
sourceTree = "<group>";
7979
};
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "2620"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "793C76A62EEBF938008A2A34"
19+
BuildableName = "Brownfield Apple App.app"
20+
BlueprintName = "Brownfield Apple App"
21+
ReferencedContainer = "container:Brownfield Apple App.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES"
31+
shouldAutocreateTestPlan = "YES">
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "793C76A62EEBF938008A2A34"
48+
BuildableName = "Brownfield Apple App.app"
49+
BlueprintName = "Brownfield Apple App"
50+
ReferencedContainer = "container:Brownfield Apple App.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "793C76A62EEBF938008A2A34"
65+
BuildableName = "Brownfield Apple App.app"
66+
BlueprintName = "Brownfield Apple App"
67+
ReferencedContainer = "container:Brownfield Apple App.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

apps/AppleApp/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
"name": "@callstack/brownfield-example-ios-app",
33
"version": "0.0.1",
44
"private": true,
5+
"type": "module",
56
"scripts": {
6-
"build:example:ios-consumer": "xcodebuild -project \"Brownfield Apple App.xcodeproj\" -scheme \"Brownfield Apple App\" -configuration Release -sdk iphonesimulator build CODE_SIGNING_ALLOWED=NO -derivedDataPath ./build"
7+
"internal::build::common": "xcodebuild -project \"Brownfield Apple App.xcodeproj\" -scheme \"Brownfield Apple App\" -configuration Release -sdk iphonesimulator build CODE_SIGNING_ALLOWED=NO -derivedDataPath ./build",
8+
"build:example:ios-consumer:expo": "node prepareXCFrameworks.js --appName ExpoApp && yarn internal::build::common",
9+
"build:example:ios-consumer:vanilla": "node prepareXCFrameworks.js --appName RNApp && yarn internal::build::common"
10+
},
11+
"devDependencies": {
12+
"@rock-js/tools": "^0.12.8"
713
}
814
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import path from 'node:path';
2+
import fs, { globSync } from 'node:fs';
3+
4+
import { fileURLToPath } from 'url';
5+
import { dirname } from 'path';
6+
7+
// arg parser
8+
import yargs from 'yargs';
9+
10+
const { appName } = yargs(process.argv.slice(2))
11+
.usage('prepareXCFrameworks --appName <appName>')
12+
.demandOption('appName', 'App name is required, pass it as an argument')
13+
.parse();
14+
15+
import { intro, outro, logger } from '@rock-js/tools';
16+
17+
const __filename = fileURLToPath(import.meta.url);
18+
const __dirname = dirname(__filename);
19+
20+
intro(`Preparing XCFrameworks for ${appName}`);
21+
22+
if (!appName) {
23+
throw new Error('App name is required, pass it as an argument');
24+
}
25+
26+
const appPath = path.join(__dirname, '..', appName);
27+
28+
if (!fs.existsSync(appPath)) {
29+
throw new Error('Invalid app name, this app does not exist');
30+
}
31+
32+
const sourcePackagePath = path.join(
33+
appPath,
34+
'ios',
35+
'.brownfield',
36+
'package',
37+
'build'
38+
);
39+
40+
const targetPackagePath = path.join(__dirname, 'package');
41+
42+
if (fs.existsSync(targetPackagePath)) {
43+
logger.info(`Removing ${targetPackagePath}\n`);
44+
fs.rmSync(targetPackagePath, { recursive: true });
45+
}
46+
47+
logger.info(`Copying ${sourcePackagePath} to ${targetPackagePath}\n`);
48+
fs.cpSync(sourcePackagePath, targetPackagePath, { recursive: true });
49+
50+
/**
51+
* The Xcode project is configured to link the following frameworks:
52+
* - BrownfieldLib (constant)
53+
* - Brownie (constant)
54+
* - hermesvm <- this changes depending on RN version: for RN < 0.82 it's hermes.xcframework, for RN >= 0.82 it's hermesvm.xcframework
55+
* - ReactBrownfield (constant)
56+
*
57+
* The trick is to rename the artifacts to match the Xcode project configuration.
58+
*/
59+
60+
// handle hermesvm.xcframework / hermes.xcframework
61+
let hermesArtifactFound = false;
62+
for (const candidateDir of ['hermes.xcframework', 'hermesvm.xcframework']) {
63+
if (fs.existsSync(path.join(targetPackagePath, candidateDir))) {
64+
fs.renameSync(
65+
path.join(targetPackagePath, candidateDir),
66+
path.join(targetPackagePath, 'hermesvm.xcframework')
67+
);
68+
hermesArtifactFound = true;
69+
}
70+
}
71+
72+
if (!hermesArtifactFound) {
73+
throw new Error('Hermes artifact not found');
74+
}
75+
76+
// list files
77+
const validNames = [
78+
'BrownfieldLib.xcframework',
79+
'Brownie.xcframework',
80+
'hermesvm.xcframework',
81+
'ReactBrownfield.xcframework',
82+
];
83+
84+
for (const file of fs.readdirSync(targetPackagePath)) {
85+
if (!validNames.includes(file)) {
86+
throw new Error(`Invalid file name: ${file}`);
87+
}
88+
89+
logger.success(`${file} prepared`);
90+
}
91+
92+
outro(`Done!`);

apps/ExpoApp/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@callstack/react-native-brownfield",
4646
{
4747
"ios": {
48-
"frameworkName": "BrownfieldExpoApp"
48+
"frameworkName": "BrownfieldLib"
4949
},
5050
"android": {
5151
"moduleName": "brownfield-expo-app"

apps/ExpoApp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"prebuild": "expo prebuild",
1313
"brownfield:package:android": "brownfield package:android --module-name brownfield-expo-app --variant release",
1414
"brownfield:publish:android": "brownfield publish:android --module-name brownfield-expo-app",
15-
"brownfield:package:ios": "brownfield package:ios --scheme BrownfieldExpoApp --configuration Release"
15+
"brownfield:package:ios": "brownfield package:ios --scheme BrownfieldLib --configuration Release"
1616
},
1717
"dependencies": {
1818
"@callstack/brownie": "workspace:^",

docs/docs/docs/guides/guidelines.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ override fun onConfigurationChanged(newConfig: Configuration) {
9090
}
9191
```
9292

93+
After which you can use the CLI appropriately:
94+
95+
- for Android: `brownfield package:android --module-name brownfield-expo-app --variant release`
96+
- for iOS: `brownfield package:ios --scheme BrownfieldExpoApp --configuration Release`
97+
9398
## Advanced Use Cases
9499

95100
If you built on top of the above approach, then you can rather easily scale it to incorporate advanced use cases. We will discuss here only one case but you can extend it to your need as the gist remains the same.

0 commit comments

Comments
 (0)