Skip to content

Commit 38e461b

Browse files
authoredSep 17, 2024··
Chore: improve hello example apps (example/js) (#177)
This PR moves the `hello` example app using Expo from `example/js/react-native/hello` to `example/js/expo/hello`, and modifies the `new-app` Makefile rule to create new apps in the new `example/js/expo` directory. We also recreate `example/js/react-native/hello` from scratch following the react-native guide, to create a new `hello` app without Expo. Then we integrated gnonative files without the gnonative NPM package. The steps to accomplish that are written in the `example/js/react-native/hello/README.md` file so anyone can integrate gnonative in its bare React-Native app. --------- Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
1 parent 7534c7d commit 38e461b

File tree

124 files changed

+26786
-7945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+26786
-7945
lines changed
 

‎.tool-versions

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
nodejs 21.7.3
1+
nodejs 22.8.0
22
ruby 3.2.2
33
cocoapods 1.15.2
44
java openjdk-17.0.2

‎Makefile

+6-8
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,19 @@ asdf.install_tools: asdf.add_plugins
190190
# Script to create a new app
191191

192192
npm_basic_dependencies := @gnolang/gnonative
193-
OUTPUT_DIR := $(make_dir)/examples/js/react-native
193+
OUTPUT_DIR := $(make_dir)/examples/js/expo
194194

195195
new-app:
196196
ifndef APP_NAME
197197
$(error APP_NAME is undefined. Please set APP_NAME to the name of your app)
198198
endif
199199
$(call check-program, npm)
200200
npm config set @buf:registry https://buf.build/gen/npm/v1/
201-
$(MAKE) new-react-native-app OUTPUT_DIR=$(make_dir)/examples/js/react-native
202-
$(MAKE) copy-js-files APP_NAME=$(APP_NAME) APP_OUTPUT_DIR=$(make_dir)/examples/js/react-native
201+
$(MAKE) new-expo-app OUTPUT_DIR=$(make_dir)/examples/js/expo
202+
$(MAKE) copy-js-files OUTPUT_DIR=$(make_dir)/examples/js/expo APP_NAME=$(APP_NAME)
203203

204-
# creates a new react native app using Expo script. Also creates ios and android folders
205-
new-react-native-app:
204+
# creates a new Expo app using Expo script. Also creates ios and android folders
205+
new-expo-app:
206206
$(call check-program, npm)
207207
$(call check-program, npx)
208208
@mkdir -p $(OUTPUT_DIR)
@@ -212,12 +212,10 @@ new-react-native-app:
212212
cd $(OUTPUT_DIR)/$(APP_NAME) && npx expo prebuild
213213
@echo "Installing npm dependencies"
214214
cd $(OUTPUT_DIR)/$(APP_NAME) && npm install ${npm_basic_dependencies}
215-
@echo "Building GnoCore.xcframework for the new app"
216-
$(MAKE) build.ios APP_NAME=$(APP_NAME) APP_OUTPUT_DIR=$(OUTPUT_DIR)/$(APP_NAME)
217215

218216
# copy js files from gnoboard to the new app
219217
copy-js-files:
220218
@echo "Copying js files"
221219
@cp $(expo_dir)/example/App.tsx $(OUTPUT_DIR)/$(APP_NAME)/App.tsx
222220

223-
.PHONY: new-app configure-npm new-react-native-app copy-js-files
221+
.PHONY: new-app configure-npm new-expo-app copy-js-files

0 commit comments

Comments
 (0)
Please sign in to comment.