Skip to content

haohao-how/haohao.how

Repository files navigation

haohao.how

CI

Setup

Install proto:

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

Running scripts with moon

moon app:dev

Cookbook

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.