docs/build.md
yarnyarn webYou're all set!
This is NOT required when developing for web.
.zshrc or .bashrc file: export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home. DO NOT use another JDK or you will encounter build errors.arch -arm64 brew install llvmsudo gem install ffihomebrew. If you have, remove it:
brew info cocoapodsInstalled:brew remove cocoapodsrbenv:
brew install rbenvrbenv install 2.7.6rbenv global 2.7.6eval "$(rbenv init - zsh)" to your ~/.zshrcbundler install (this will install Cocoapods)google-services.json.example to google-services.json or provide your own google-services.json. (A real firebase project is NOT required)npx expo prebuild -> you will also need to run this anytime app.json or native package.json deps changeyarn ios
Xcode > Settings > Platforms.xcode-select -s /Applications/Xcode.appxcodebuild -runFirstLaunchxcrun simctl runtime add "~/Downloads/iOS_17.4_Simulator_Runtime.dmg" (adapt the path to the downloaded file)xcode-select --install.rm -rf ios before trying to build again (yarn ios)yarn android
export ANDROID_HOME=/Users/<your_username>/Library/Android/sdk to your .zshrc or .bashrc (and restart your terminal).yarn web (see the top of this file).After you do yarn ios and yarn android once, you can later just run yarn web and then press either i or a to open iOS and Android emulators respectively which is much faster. However, if you make native changes, you'll have to do yarn prebuild -p ios and yarn prebuild -p android and then yarn ios and yarn android again before you can continue with the same workflow.
.env.example to .env and fill in any necessary tokens. (The Sentry token is NOT required; see instructions below if you want to enable Sentry.)--device to the command (e.g. yarn android --device). To build in production mode (slower build, faster app), also add --variant release on Android or --configuration Release on iOS.owner and extra.eas.projectId properties. If you do not have an Expo account, you may remove these properties.npx react-native info Checks what has been installed.adb reverse tcp:{PORT} tcp:{PORT}
adb reverse tcp:3001 tcp:3001foo.native.ts) but only when compiling for Web thus far. Therefore we always have one version of the file that doesn't use a platform specifier, and that should be the Web version. (More info.)yarn e2e:mock-serveryarn e2e:startyarn e2e:buildyarn e2e:runAdding Sentry is NOT required. You can keep SENTRY_AUTH_TOKEN= in .env which will build the app without Sentry.
However, if you're a part of the Bluesky team and want to enable Sentry, fill in SENTRY_AUTH_TOKEN in your .env. It can be created on the Sentry dashboard using these instructions.
If you change SENTRY_AUTH_TOKEN, you need to do yarn prebuild before running yarn ios or yarn android again.
Adding bitdrift is NOT required. You can keep EXPO_PUBLIC_BITDRIFT_API_KEY= in .env which will avoid initializing bitdrift during startup.
However, if you're a part of the Bluesky team and want to enable bitdrift, fill in EXPO_PUBLIC_BITDRIFT_API_KEY in your .env to enable bitdrift.
yarn intl:build -> you will also need to run this anytime ./src/locale/{locale}/messages.po changeThis is NOT required for app development but if you also want to develop the Bluesky backend locally too, you'll need this.
git clone [email protected]:bluesky-social/atproto.gitcd atprotobrew install pnpmbrew install jqpnpm ipnpm buildcd packages/dev-env && pnpm startRun the account with the AppView proxy DID passed in as an environment variable: EXPO_PUBLIC_BLUESKY_PROXY_DID=did:plc:dw4kbjf5mn7nhenabiqpkyh3 yarn start
Then, when logging in or creating an account, point it to the localhost port of the devserver.
The Go server in this repository is only used for serving the web app in production. Usually you won't need to touch it.
To run the build with Go, use staging credentials, your own, or any other account you create.
cd social-app
yarn && yarn build-web
cd bskyweb/
go mod tidy
go build -v -tags timetzdata -o bskyweb ./cmd/bskyweb
./bskyweb serve --appview-host=https://public.api.bsky.app
On build success, access the application at http://localhost:8100/. Subsequent changes require re-running the above steps in order to be reflected.
To open the Developer Menu on an expo-dev-client app you can do the following:
See testing.md.
./platform/polyfills.*.ts adds polyfills to the environment. Currently, this includes:
Sourcemaps should automatically be updated when a signed build is created using eas build and published using eas submit due to the postPublish hook setup in app.json. However, if an update is created and published OTA using eas update, we need to take the following steps to upload sourcemaps to Sentry:
dist/bundles folder to match index.android.bundle (Android) or main.jsbundle (iOS).${bundleIdentifier}@${version}+${buildNumber} (iOS) or ${androidPackage}@${version}+${versionCode} (Android), so for example [email protected]+1.dist should be set to the Update ID that eas update generated.node_modules/@sentry/cli/bin/sentry-cli releases \ files <release name> \ upload-sourcemaps \ --dist <Android Update ID> \ --rewrite \ dist/bundles/index.android.bundle dist/bundles/android-<hash>.mapnode_modules/@sentry/cli/bin/sentry-cli releases \ files <release name> \ upload-sourcemaps \ --dist <iOS Update ID> \ --rewrite \ dist/bundles/main.jsbundle dist/bundles/ios-<hash>.mapTo create OTA updates, run eas update along with the --branch flag to indicate which branch you want to push the update to, and the --message flag to indicate a message for yourself and your team that shows up on https://expo.dev. All the channels (which make up the options for the --branch flag) are given in eas.json. See more here
The clients which can receive an OTA update are governed by the runtimeVersion property in app.json. Right now, it is set so that only apps with the same appVersion (same as version property in app.json) can receive the update and install it. However, we can manually set "runtimeVersion": "1.34.0" or anything along those lines as well. This is useful if very little native code changes from update to update. If we are manually setting runtimeVersion, we should increment the version each time the native code is changed. See more here