Skip to content

Latest commit

 

History

History
135 lines (91 loc) · 3.5 KB

CONTRIBUTING.md

File metadata and controls

135 lines (91 loc) · 3.5 KB

Contribution guide

Setup

Install proto:

curl -fsSL https://moonrepo.dev/install/proto.sh | bash
proto use

Now you can start the app:

  1. moon run app:dev.
  2. Scan the QR code on your phone.

Cookbook

Writing a backend database migration

  1. Edit the Drizzle schema.
  2. Run moon run app:dbGenerate

Debugging Expo server

In VS Code open a JavaScript Debug Terminal from the command palette +Shift+p, then run commands as normal e.g.

moon run app:dev

This works because VS Code configures NODE_OPTIONS in the terminal to --require a special bootloader.js, so it's important that moon tasks that define NODE_OPTIONS pass through the existing value.

Adding a cross project dependency

Add to dependsOn: within moon.yml, then run:

moon sync projects

This will update package.json/dependencies, tsconfig.json/references, tsconfig.json/compilerOptions/paths.

Upgrading Yarn

Inside toolchain.yml edit node.yarn.version and update the version. Run moon sync projects to apply the change.

Upgrading Moon

proto outdated --update
proto use

Upgrading Proto

proto upgrade

Upgrading Node.js

Edit .moon/toolchain.yml edit node.version.

moon run node-version

Moon will automatically synchronize package.json engines.node, and it will use proto to download and install the right version of Node.js.

Upgrading a transitive Yarn dependency (e.g. for security patch)

A normal yarn up ___ won't work if no workspace depends on it directly, so you need to use --recursive. For example to upgrade tar use:

yarn up -R tar

Upgrading a dependency with a Yarn patch

Yarn doesn't automatically migrate patches, so you need to migrate it manually.

yarn patch expo-image
patch -d /private/var/folders/fs/...snip.../T/xfs-33350073/user < .yarn/patches/expo-image-npm-1.12.9-116d224baf.patch
yarn patch-commit -s /private/var/folders/fs/...snip.../T/xfs-33350073/user
rm .yarn/patches/expo-image-npm-1.12.9-116d224baf.patch

Updating app icons

Icons can be exported directly from Figma. Frames are labelled appropriately such that everything in Figma can be exported to the projects/app/src/assets directory.

Writing Pinyin on macOS

  1. Enable the Pinyin - Simplified keyboard.
  2. Type the pinyin without the tone (e.g. hao).
  3. Press Tab to cycle through each tone.
  4. Press Enter to accept the pinyin.

Example: to write hǎo type h a o Tab Tab Tab Enter.

Local development with Sign in with Apple for Web

  1. Set EXPO_TUNNEL_SUBDOMAIN in projects/app/.env.local to something like haohaohow-<yourname>.
  2. In Apple Developer portal edit the Service ID for the app and click Configure.
  3. Click the + button for Website URLs, in the Return URLs box add https://<EXPO_TUNNEL_SUBDOMAIN>.ngrok.io/api/auth/login/apple/callback (replace <EXPO_TUNNEL_SUBDOMAIN> with the value you chose).
  4. Save the changes.
  5. Start Expo via moon run app:dev.

iOS Device Enrolment

Add the iPhone (https://docs.expo.dev/build/internal-distribution/#configure-app-signing):

npx -y eas-cli device:create
npx -y eas-cli device:rename

Add the device to the provisioning profile:

npx -y eas-cli build --profile=preview --platform=ios