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

refactor: Prepare docs for OSS #2

Merged
merged 9 commits into from
Dec 11, 2023
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
8 changes: 8 additions & 0 deletions .github/.cspell/dart_dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Keywords/terms specific to the Dart/Flutter ecosystem
dartdoc
pubspec
unawaited
endtemplate
gitignores
writeln
Stderrs
6 changes: 6 additions & 0 deletions .github/.cspell/globe_dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Dictionary file for Globe-related words
Redeployments
Jaspr
globeapp
Dammam
Querétaro
6 changes: 6 additions & 0 deletions .github/.cspell/people_usernames.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Specific people's names and/or usernames
rroussel
subosito
bluefireteam
thollander
amannn
2 changes: 2 additions & 0 deletions .github/.cspell/words_dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Actual english words (or common abbreviations) missing from CSpell
upvote
37 changes: 37 additions & 0 deletions .github/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "0.2",
"language": "en",
"flagWords": ["teh", "hte"],
"ignorePaths": [".github/**", "**/CHANGELOG.md"],
"ignoreRegExpList": ["\\#[\\w\\-]+"],
"dictionaries": [
"en_US",
"softwareTerms",
"dart_dictionary",
"globe_dictionary",
"people_usernames",
"words_dictionary"
],
"dictionaryDefinitions": [
{
"name": "dart_dictionary",
"path": "./.github/.cspell/dart_dictionary.txt",
"addWords": true
},
{
"name": "globe_dictionary",
"path": "./.github/.cspell/globe_dictionary.txt",
"addWords": true
},
{
"name": "usernames",
"path": "./.github/.cspell/people_usernames.txt",
"addWords": true
},
{
"name": "words_dictionary",
"path": "./.github/.cspell/words_dictionary.txt",
"addWords": true
}
]
}
4 changes: 4 additions & 0 deletions .github/workflows/dart_validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: all_dart_packages

on:
pull_request:
paths-ignore:
- 'docs/**'
push:
paths-ignore:
- 'docs/**'
branches:
- main

Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/docs_comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: docs_preview
on:
pull_request:
paths:
- "docs/**"
- "docs.yaml"
types: [opened]

jobs:
comment_link:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
# pr number
message: |
:books: Documentation changes in this PR can be previewed [here](https://docs.page/invertase/globe~${{ github.event.pull_request.number }}).
17 changes: 17 additions & 0 deletions .github/workflows/spell_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: spell_checker

on:
push:
branches:
- main
pull_request:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v5
with:
config: ".github/cspell.json"
files: "**/*.{md,mdx,dart}"
6 changes: 5 additions & 1 deletion .github/workflows/title_validation.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: "PR Title is Conventional"

on:
pull_request:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
Expand Down
64 changes: 64 additions & 0 deletions docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: Docs
logo: "/assets/globe_dark.png"
logoDark: "/assets/globe_light.png"
twitter: dart_globe
anchors:
- title: Discord
icon: discord
link: https://invertase.link/globe-discord
theme: "#FFA03F"
favicon: "/assets/globe_dark.png"
sidebar:
- - Overview
- "/"
- - Getting Started
- "/getting-started"
- - CLI
- - - CLI Overview
- "/cli"
- - Deploy
- "/cli.commands.deploy"
- - Link
- "/cli.commands.link"
- - Login
- "/cli.commands.login"
- - Logout
- "/cli.commands.logout"
- - Unlink
- "/cli.commands.unlink"
- - Deployments
- - - Overview
- "/deployments"
- - Build Settings
- "/deployments.build-settings"
- - Domains
- "/deployments.domains"
- - Environment Variables
- "/deployments.environment-variables"
- - GitHub Integration
- "/deployments.github-integration"
- - Hooks
- "/deployments.hooks"
- - Redeployments
- "/deployments.redeployments"
- - Frameworks
- - - Overview
- "/frameworks"
- - Dart Frog
- "/frameworks.dart-frog"
- - Jaspr
- "/frameworks.jaspr"
- - Infrastructure
- - - Overview
- "/infrastructure"
- - Cold Starts
- "/infrastructure.cold-starts"
- - Cron Jobs
- "/infrastructure.cron-jobs"
- - Headers
- "/infrastructure.headers"
- - Regions
- "/infrastructure.regions"
- - WebSockets
- "/infrastructure.websockets"
Binary file added docs/assets/globe_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/globe_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions docs/cli.commands.deploy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Deploy a project with the Globe CLI
description: Deploy your Dart application to Globe directly from the command line.
---

# Deploy

The `deploy` command allows you to deploy your Dart application to Globe directly from the command line.

If you have not yet [linked a project](/docs/cli/commands/link), you will be prompted to do so before deploying.

## Usage

To deploy a project, run the following command from your Dart project root directory.

```bash
globe deploy
```

The CLI will upload your project to Globe and trigger a new deployment. Upon success, you will provided a URL to view deployment progress on the Globe dashboard.

By default, deployments via the `deploy` command are treated as a preview deployment. This means that once deployed, the deployment will have it's own unique URL generated by Globe.
To deploy as a production deployment, append the `--prod` flag to the command.

```bash
globe deploy --prod
```

When successfully built, the deployment will be promoted to production and will be accessible via the project's primary domain(s).

You can learn more about [preview and production deployments](/docs/deployments) in the deployments documentation.

### Flags

The command has flags (in addition to [global flags](/docs/cli)) that can be used to modify the behavior of the command, which can be accessed by running `globe deploy --<flag>`:

- `--prod` - Creates a deployment which will be promoted to production once built.
29 changes: 29 additions & 0 deletions docs/cli.commands.link.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Link a project to Globe
---

# Link

The `link` command links a local Dart project to a Globe project. Linking is required to deploy a project to Globe.

Project linking is carried out automatically if the project is not yet linked when running the [`deploy`](/docs/cli/commands/deploy) command.

## Usage

```bash
globe link
```

The `link` command will first prompt, asking whether you wish to continue linking the local project. If you continue, you will be further prompted to:

1. Select an account you wish to link this project to.
2. Select, or create a new project to link this project to.

Upon completion, the project will be linked to your Globe account and you will be able to deploy the project.

## Details

A linked project stores metadata about the project in the local `.dart_tool/dart_globe` directory on your machine. This metadata is used to identify the project when deploying to Globe. If not already,
the `.dart_tool` directory should not be committed to your Git repository. You can add this directory to your `.gitignore` file to ensure it is not committed.

If you accidentally delete this directory, or run the [`unlink`](/docs/cli/commands/unlink) command, you will need to re-link the project before you can deploy again.
22 changes: 22 additions & 0 deletions docs/cli.commands.login.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Login to Globe
---

# Login

The `login` command allows you to authenticate your local CLI with your Globe account. This is required before you can deploy any projects.

## Usage

```bash
globe login
```

A new browser window will open prompting you to login to your Globe account. Once you have logged in, you will be redirected to a page notifying you of a successful login. You can close this page once complete.
Globe will store a secure token on your local machine to authenticate future requests.

If you wish to [logout](/docs/cli/commands/logout), you can run the following command:

```bash
globe logout
```
15 changes: 15 additions & 0 deletions docs/cli.commands.logout.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Logout of Globe
---

# Logout

The `logout` command allows removes any prior authentication tokens from your local machine. Once you have logged out, you will need to login again before you can deploy any projects.

## Usage

```bash
globe logout
```

A message will be displayed notifying you that you have been logged out.
17 changes: 17 additions & 0 deletions docs/cli.commands.unlink.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Unlink a project from Globe
---

# Unlink

The `unlink` command removes any previously linked projects from the current local project. This will prevent you from deploying the project to Globe.

## Usage

```bash
globe unlink
```

## Details

The command removes the `.dart_tool/dart_globe` directory from the local project. This directory stores metadata about the project, which is used to identify the project when deploying to Globe.
45 changes: 45 additions & 0 deletions docs/cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Globe CLI
description: Install and start deploying using the Globe CLI.
---

# Globe CLI

The Globe CLI is a command line tool that helps you deploy and interact with your Dart applications via Globe.

## Pre-requisites

To get started, you must have the [Dart SDK](https://dart.dev/get-dart) installed on your machine.

## Installation

To install the Globe CLI, run the following command:

```bash
dart pub global activate globe_cli
```

Once installed, you can access the `globe` executable from anywhere on your machine.

To login with your Globe account, run the following command:

```bash
globe login
```

## Commands

The Globe CLI provides the following commands, which can be accessed by running `globe <command>`:

- [`deploy`](/cli/commands/deploy) - Deploy your Dart application to Globe directly from the command line.
- [`link`](/cli/commands/link) - Link a local project to a Globe project.
- [`login`](/cli/commands/login) - Login to your Globe account.
- [`logout`](/cli/commands/logout) - Logout of your Globe account.
- [`unlink`](/cli/commands/unlink) - Unlink a local project from a Globe project.

## Global Flags

All CLI commands have global flags that can be used to modify the behavior of the command, which can be accessed by running `globe <command> --<flag>`.

- `--help` - Display help information for the command.
- `--verbose` - Display verbose output for the command, such as API calls and debug information.
Loading