Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: consolidate getting started and quickstart guide #303

Merged
merged 5 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ export default defineConfig({
{
label: 'Guides',
items: [
{
label: 'Code Push Quickstart',
link: '/guides/code-push-quickstart',
},
{
label: 'Staging Patches',
link: '/guides/staging-patches',
Expand Down Expand Up @@ -180,6 +176,7 @@ export default defineConfig({
'guides/crash-reporting': 'guides/crash-reporting/uploading-symbols',
'guides/fastlane': 'ci/fastlane',
'guides/flavors': 'guides/flavors/android',
'guides/code-push-quickstart': '/',
'guides/hybrid-app': 'guides/hybrid-apps/android',
'guides/hybrid-app/android': 'guides/hybrid-apps/android',
'guides/hybrid-app/ios': 'guides/hybrid-apps/ios',
Expand Down
161 changes: 0 additions & 161 deletions src/content/docs/guides/code-push-quickstart.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion src/content/docs/guides/submitting/app-store.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The app we will be releasing in this guide is Shorebird Clock, our demo code pus

To follow along with this guide, you will need the following:

1. An existing Shorebird app. If you don't have one, you can create one by following the [code push quickstart](/guides/code-push-quickstart/) guide.
1. An existing Shorebird app. If you don't have one, you can create one by following the [code push quickstart](/) guide.
1. Access to hardware running macOS. This is required to build iOS apps.
1. A valid Apple Developer account. This is required to release iOS apps.
1. An app in [App Store Connect](https://appstoreconnect.apple.com/). See the [official documentation](https://developer.apple.com/help/app-store-connect/create-an-app-record/add-a-new-app) for more information about how to create one.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/guides/submitting/play-store.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The app we will be releasing in this guide is [`Time Shift`](https://play.google

## Prerequisites

This guide assumes that you have an existing Shorebird app. If you don't have one, you can create one by following the [code push quickstart](/guides/code-push-quickstart/) guide.
This guide assumes that you have an existing Shorebird app. If you don't have one, you can create one by following the [code push quickstart](/) guide.

## Creating a release

Expand Down
160 changes: 136 additions & 24 deletions src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ template: doc

import { Tabs, TabItem } from '@astrojs/starlight/components';

This guide will walk you through [creating an account](#sign-up), [installing Shorebird](#install), and [logging in](#login).
Welcome to Shorebird! 👋

## Sign Up
In this guide, we'll walk you through setting up Shorebird and integrating it
into your app in just a few minutes.

To create an account, head over to the [Shorebird Console](https://console.shorebird.dev) and authenticate with your Google account.
## Sign up

The first thing you'll need to do is sign up for a Shorebird account. This will
allow you to use the Shorebird CLI to manage your apps.

### Create an account

To create an account, head over to the [Shorebird
Console](https://console.shorebird.dev) and authenticate with one of the available authentication methods. Once you've authenticated, you will have a free Shorebird account.

Next, let's install the Shorebird CLI on your machine.

## Install

Expand Down Expand Up @@ -116,43 +127,144 @@ Engine • revision e81fa131e59506d9f6af2a0cee7de749131f1bf0
No issues detected!
```

## Login
## Integrate Shorebird

You can login using the `shorebird login` command:
Once you have registered and installed the CLI, you're ready to use code push!

Start by creating a new Flutter app:

```sh
shorebird login
flutter create my_shorebird_app
```

Example output:
As with any Flutter app, you can verify this created the standard Counter app by
following the instructions printed by `flutter create`:

```sh
cd my_shorebird_app
flutter run
```

### Initialize Shorebird

To make this a Shorebird app, run:

```sh
shorebird init
```

This will create a `shorebird.yaml` file in the root of your project. This file
contains your Shorebird `app_id`. Your `app_id` is not secret and can be
checked into source control and freely shared.

This will also run `shorebird doctor` to ensure everything is set up correctly.

:::note
Shorebird expects to find the latest stable `flutter` installed on your
machine. Shorebird can be configured to work with older versions of Flutter
(back to 3.10.0). See [Flutter Version Management](/flutter-version) for more
info.
:::

### Create a release

We will create a release using the unmodified Counter app. Run:

<Tabs>

<TabItem value="android" label="Android">

```sh
shorebird release android
```

</TabItem>

<TabItem value="ios" label="iOS">

```sh
shorebird release ios
```
shorebird login
The Shorebird CLI needs your authorization to manage apps, releases, and patches
on your behalf.

In a browser, visit this URL to log in:
</TabItem>
</Tabs>

https://accounts.google.com/o/oauth2/v2/auth...
When prompted, use the suggested version number (`1.0.0+1`), and enter `y` when
asked if you would like to continue.

Waiting for your authorization...
### Preview the release

🎉 Welcome to Shorebird! You are now logged in as <email>.
To preview the release with Shorebird (that is, with [Shorebird's fork of the
Flutter engine](/faq#how-does-shorebird-relate-to-flutter)), run:

🔑 Credentials are stored in ./path/to/credentials.json.
🚪 To logout use: "shorebird logout".
```sh
shorebird preview
```

That's it 🎉
Now kill the app on your device or emulator.

### Create a patch

We will now make a small change to the Counter app. In `lib/main.dart`, change
the app theme's `primarySwatch` from blue to green:

```diff
class MyApp extends StatelessWidget {
const MyApp({super.key});

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
- primarySwatch: Colors.blue,
+ primarySwatch: Colors.green,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
```

After making this change, save the file and run:

<Tabs>

You now have a Shorebird account, have installed Shorebird CLI on your machine, and are ready to start using Shorebird.
<TabItem value="android" label="Android">

```sh
shorebird patch android
```

</TabItem>

<TabItem value="ios" label="iOS">

```sh
shorebird patch ios
```

</TabItem>

</Tabs>

### See the patch in action

Launch the app from your device or emulator. The app will still have the
original blue theme, but it will be downloading the patch we just created in the
background. Kill and launch the app again, and the app will be green! 🎉
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we talk about what a user would expect to see log-wise in preview?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to do so, I was mainly just trying to consolidate what we already had before going in and workshopping the actual content haha.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes total sense, we can do that in a later pass


## Connect on Discord

Shorebird has an active Discord where we're happy to help you:
Shorebird has an active Discord where we're happy to help you with any questions
https://discord.gg/shorebird

We also offer a private support channel for paying customers. We don't yet have
an automated way to add you to the channel, so please message a member of our
team on Discord and we'll happily add you to the customer support channel.
https://github.com/shorebirdtech/shorebird/issues/308