Skip to content

Commit

Permalink
[docs] adjust Terminal syntax highlight + other Terminal tweaks (#27807)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simek committed Mar 23, 2024
1 parent d6d994c commit dc43021
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 24 deletions.
3 changes: 2 additions & 1 deletion docs/.eslintrc.cjs
Expand Up @@ -20,7 +20,8 @@ module.exports = {
'diff-.+',
'react-player',
'dark-theme',
'dialog-.+'
'dialog-.+',
'terminal-snippet'
]
}]
},
Expand Down
9 changes: 9 additions & 0 deletions docs/global-styles/prism.ts
Expand Up @@ -164,4 +164,13 @@ export const globalPrism = css`
pre .line-highlight {
margin-top: 0;
}
.terminal-snippet {
.token.property,
.token.atrule,
.token.attr-value,
.token.function {
color: ${theme.palette.pink10};
}
}
`;
6 changes: 2 additions & 4 deletions docs/pages/build/building-on-ci.mdx
Expand Up @@ -4,6 +4,7 @@ description: Learn how to trigger builds on EAS for your app from a CI environme
---

import { Collapsible } from '~/ui/components/Collapsible';
import { Terminal } from '~/ui/components/Snippet';

This document outlines how to trigger builds on EAS for your app from a CI environment such as GitHub Actions, Travis CI, and more.

Expand Down Expand Up @@ -53,9 +54,7 @@ Now that we're authenticated with Expo CLI, we can create the build step.

To trigger new builds, we will add this script to our configuration:

```sh
npx eas-cli build --platform all --non-interactive --no-wait
```
<Terminal cmd={['$ npx eas-cli build --platform all --non-interactive --no-wait']} />

This will trigger a new build on EAS. A URL will be printed, linking to the build's progress in the EAS dashboard.

Expand All @@ -68,7 +67,6 @@ This will trigger a new build on EAS. A URL will be printed, linking to the buil
Add the following code snippet in **.travis.yml** at the root of your project repository.

```yaml travis.yml
---
language: node_js
node_js:
- node
Expand Down
19 changes: 8 additions & 11 deletions docs/pages/eas-update/debug-advanced.mdx
Expand Up @@ -244,9 +244,7 @@ We also provide a [step-by-step guide to try out EAS Update quickly](/eas-update
- Reinstall pods with `npx pod-install`. The `expo-updates` podspec now detects this environment variable, and makes changes so that the debug code that would normally load from the Metro packager is bypassed, and the app is built with the EXUpdates bundle and other dependencies needed to load updates from EAS.
- [Ensure the desired channel is set in our **Expo.plist**](/eas-update/updating-your-app/#configuring-the-channel-manually)
- Modify the application Xcode project file to force bundling of the application JavaScript for both release and debug builds:
```sh
sed -i '' 's/SKIP_BUNDLING/FORCE_BUNDLING/g;' ios/&lt;project name&gt;.xcodeproj/project.pbxproj
```
<Terminal cmd={["$ sed -i '' 's/SKIP_BUNDLING/FORCE_BUNDLING/g;' ios/&lt;project name&gt;.xcodeproj/project.pbxproj"]} />
- Execute a [debug build](/debugging/runtime-issues/#native-debugging) of the app with Xcode or from the command line.

#### Android local builds
Expand Down Expand Up @@ -305,13 +303,13 @@ Once we've found the root cause of the issue, there are various mitigation steps

The fastest way to "undo" a bad publish is to re-publish a known good update. Imagine we have a branch with two updates:

```bash
branch: "production"
updates: [
update 2 (id: xyz2) "fixes typo" // bad update
update 1 (id: abc1) "updates color" // good update
]
```
<Terminal cmd={[
'branch: "production"',
'updates: [',
' update 2 (id: xyz2) "fixes typo" // bad update',
' update 1 (id: abc1) "updates color" // good update',
']'
]} />

If "update 2" turned out to be a bad update, we can re-publish "update 1" with a command like this:

Expand All @@ -337,7 +335,6 @@ The example command above would result in a branch that now appears like this:
']'
]} />


Since "update 3" is now the most recent update on the "production" branch, all users who query for an update in the future will receive "update 3" instead of the bad update, "update 2".

While this will prevent all new users from seeing the bad update, users who've already received the bad update will run it until they can download the latest update. Since mobile networks are not always able to download the most recent update, sometimes users may run a bad update for a long time. When viewing error logs for our app, it's normal to see a lingering long tail of errors as our users' apps get the most recent update or build. We'll know we solved the bug when we see the error rate decline dramatically; however, it likely will not disappear completely if we have a diverse user base across many locations and mobile networks.
4 changes: 1 addition & 3 deletions docs/pages/guides/analyzing-bundles.mdx
Expand Up @@ -36,9 +36,7 @@ Add a script to **package.json** to run it. You might have to adjust the input p

If you are using the SDK 50 `server` output for web, then use the following to map web bundles:

```sh
npx source-map-explorer 'dist/client/_expo/static/js/web/*.js' 'dist/client/_expo/static/js/web/*.js.map'
```
<Terminal cmd={["$ npx source-map-explorer 'dist/client/_expo/static/js/web/*.js' 'dist/client/_expo/static/js/web/*.js.map'"]} />

Web bundles are output to the **dist/client** subdirectory to prevent exposing server code to the client.

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/push-notifications/faq.mdx
Expand Up @@ -119,7 +119,7 @@ Check the `details` property of the returned push ticket or receipt for more inf
Here are some ways our community members have resolved this issue:

<Collapsible summary={<span>Read the Apple's <a href="https://developer.apple.com/library/archive/technotes/tn2265/_index.html">Technical Note on troubleshooting push notifications</a></span>}>
<Collapsible summary="Read the Apple's Technical Note on troubleshooting push notifications">

Read Apple's [Technical Note on troubleshooting push notifications](https://developer.apple.com/library/archive/technotes/tn2265/_index.html)! This is the single most reliable source of information on this problem. To help you grasp what they're suggesting:

Expand Down
3 changes: 2 additions & 1 deletion docs/pages/submit/android.mdx
Expand Up @@ -13,7 +13,8 @@ This guide outlines how to submit your app to the Google Play Store from your ow
- A paid developer account is required &mdash; You can create a Google Play Developer account on the [Google Play Console sign-up page](https://play.google.com/apps/publish/signup/).
- You have to create a [Google Service Account](https://expo.fyi/creating-google-service-account) and download its JSON private key.
- After that, you'll have to create an app on [Google Play Console](https://play.google.com/apps/publish/) and upload your app manually at least once.
- You will also need to have EAS CLI installed and authenticated with your Expo account: `npm install -g eas-cli && eas login`.
- You will also need to have EAS CLI installed and authenticated with your Expo account:
<Terminal cmd={['$ npm install -g eas-cli && eas login']} />

### Creating a Google Service Account

Expand Down
3 changes: 2 additions & 1 deletion docs/pages/submit/ios.mdx
Expand Up @@ -12,7 +12,8 @@ This guide outlines how to submit your app to the Apple App Store from your own
## Prerequisites

- A paid developer account is required to submit an app &mdash; you can create an Apple Developer account on the [Apple Developer Portal](https://developer.apple.com/account/).
- You will also need to have EAS CLI installed and authenticated with your Expo account: `npm install -g eas-cli && eas login`.
- You will also need to have EAS CLI installed and authenticated with your Expo account:
<Terminal cmd={['$ npm install -g eas-cli && eas login']} />

## 1. Build a standalone app

Expand Down
2 changes: 1 addition & 1 deletion docs/ui/components/Snippet/blocks/Terminal.tsx
Expand Up @@ -16,7 +16,7 @@ type TerminalProps = {
};

export const Terminal = ({ cmd, cmdCopy, hideOverflow, title = 'Terminal' }: TerminalProps) => (
<Snippet className="[li_&]:mt-4">
<Snippet className="terminal-snippet [li_&]:mt-4">
<SnippetHeader alwaysDark title={title} Icon={TerminalSquareIcon}>
{renderCopyButton({ cmd, cmdCopy })}
</SnippetHeader>
Expand Down
2 changes: 1 addition & 1 deletion docs/ui/components/Snippet/prism-bash.js
Expand Up @@ -172,7 +172,7 @@ import { Prism } from 'prism-react-renderer';
variable: insideString.variable,
function: {
pattern:
/(^|[\s;|&]|[<>]\()(?:apropos|apt|apt-cache|apt-get|aptitude|aspell|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper|npx|eas|netlify|serve|vercel|firebase|adb|bun)(?=$|[)\s;|&])/,
/(^|[\s;|&]|[<>]\()(?:apropos|apt|apt-cache|apt-get|aptitude|aspell|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper|npx|eas|netlify|serve|vercel|firebase|adb|bun|pod)(?=$|[)\s;|&])/,
lookbehind: true,
},
keyword: {
Expand Down

0 comments on commit dc43021

Please sign in to comment.