Install proto:
curl -fsSL https://moonrepo.dev/install/proto.sh | bash
proto use
Now you can start the app:
npx inngest-cli@latest dev
moon run app:dev
.- Scan the QR code on your phone.
- Edit the Drizzle schema.
- Run
moon run app:dbGenerate
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.
Add to dependsOn:
within moon.yml
, then run:
moon sync projects
This will update package.json/dependencies
, tsconfig.json/references
, tsconfig.json/compilerOptions/paths
.
Inside toolchain.yml
edit node.yarn.version
and update the version. Run
moon sync projects
to apply the change.
proto outdated --update
proto use
proto upgrade
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.
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
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
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.
- Enable the
Pinyin - Simplified
keyboard. - Type the pinyin without the tone (e.g.
hao
). - Press Tab to cycle through each tone.
- Press Enter to accept the pinyin.
Example: to write hǎo
type h a o Tab Tab Tab Enter.
- Set
EXPO_TUNNEL_SUBDOMAIN
inprojects/app/.env.local
to something likehaohaohow-<yourname>
. - In Apple Developer portal edit the Service ID for the app and click Configure.
- 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). - Save the changes.
- Start Expo via
moon run app:dev -- --tunnel
.
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
It's important that this is done using the interactive version of the command so that you can authenticate your Apple Developer account and have it synchronize the provisioning profile.
In local development it can be useful to merge together migrations without
losing local data. In this case you can manually modify the Drizzle migration
state in drizzle.__drizzle_migrations
.
Copy the timestamp from _journal.json
, and the hash is the lower-case SHA256
of the .sql
migration file.
There have been compatibility issues between @expo/server and Vercel in the past. To help debug these it's useful to run the Vercel server locally in a JavaScript Debug Terminal.
To do this you need build the Expo web output, and then point app/api/index.cjs
to the output directory, then run the vercel dev server.
For example you can run something like this:
cd projects/app
moon run buildVercelExpo --cache=write
Now edit app/api/index.cjs
to point to it:
-build: require(`path`).join(__dirname, `../dist/vercel/server`),
+build: require(`path`).join(__dirname, `../dist/.cache/vercel-expo/server`),
Finally run the vercel dev server: (e.g. with extra logging)
DEBUG=inngest:* INNGEST_DEV=1 npx vercel dev --listen 8081
Create a app/api/trpc/replicache.push+api.ts
file containing:
export function POST() {
return new Response(
`An error occurred with your deployment
FUNCTION_INVOCATION_TIMEOUT
syd1::m6bjf-1738011631946-6a41c1b3d99c`,
{
status: 504,
headers: {
"x-vercel-error": `FUNCTION_INVOCATION_TIMEOUT`,
"x-vercel-id": `syd1::gqwrj-1738016771255-d9363c982187`,
},
},
);
}
Customise this to suit your scenario.
-
Vercel: There should be no
EXPO_PUBLIC_
environment variables configured in Vercel's environment variables.EXPO_PUBLIC_
are inlined at build-time by metro so there's no effect from having them defined in the environment at runtime too. However other environment variables likeDATABASE_URL
should be defined here as they are read at run-time.SENTRY_DSN
: Needs to be defined here, even though it's typically defined usingEXPO_PUBLIC_SENTRY_DSN
in other places, theSentry.init()
call is not in code compiled by Metro and instead is in the entry-pointprojects/app/api/index.cjs
. -
EXPO_PUBLIC_
: These are inlined into the build and exposed publicly. These need to be configured anywhere that builds are done:.github/workflows/release.yml
.github/workflows/expo-eas-build.yml
.github/workflows/pr.yml
This means they need to be declared in Github's Action Secrets too.
Expo's Metro plugin is patched to error if
HHH_STRICT_EXPO_ENV_VARS
is set when aPUBLIC_EXPO_
variable is missing. This helps catch errors during build before they reach users.