Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Any framework that can generate a build output in accordance with the App Hostin
The output bundle primarily consists of a `bundle.yaml` file that sits inside of the `.apphosting` directory. This bundle.yaml contains all the ways that frameworks can configure App Hosting when users deploy their applications.

> [!NOTE]
> App Hosting technically supports all all node applications, but no custom framework features will be enabled without the output bundle.
> App Hosting technically supports all node applications, but no custom framework features will be enabled without the output bundle.

## Output bundle Schema

Expand All @@ -37,6 +37,7 @@ interface OutputBundle {
version: "v1"
runConfig: RunConfig;
metadata: Metadata;
outputFiles?: OutputFiles;
}
```

Expand Down Expand Up @@ -108,12 +109,44 @@ interface Metadata {
| `framework` | `string` | Name of the framework that is being supported | y |
| `frameworkVersion` | `string` |Version of the framework that is being supported | n |

### OutputFiles

OutputFiles is an optional field to configure outputFiles and optimize server files + static assets.

```typescript
interface OutputFiles {
serverApp: ServerApp
}

```

| Field | Type | Description | Required? |
| ---------- | ------- | - | - |
| `serverApp` | `ServerApp` | ServerApp holds configurations related to the serving files at runtime from Cloud Run | y |

### ServerApp

OutputFiles is an optional field to configure outputFiles and optimize server files + static assets.

```typescript
interface ServerApp {
include: string[]
}

```

| Field | Type | Description | Required? |
| ---------- | ------- | - | - |
| `include` | `string[]` | include holds a list of directories + files relative to the app root dir that frameworks need to deploy to the App Hosting server, generally this will be the output/dist directory (e.g. .output or dist). In the case that the framework wants to include all files they can use [“.”] | y |

## Sample

Here is a sample `.apphosting/bundle.yaml` file putting all this together:

```yaml
version: v1
runConfig:
runCommand: 'node dist/index.js'
runCommand: node dist/index.js
environmentVariables:
- variable: VAR
value: 8080
Expand All @@ -123,6 +156,12 @@ runConfig:
memoryMiB: 512
minInstances: 0
maxInstances: 14

outputFiles:
serverApp:
include:
- dist
- .output

metadata:
adapterPackageName: npm-name
Expand Down
14 changes: 14 additions & 0 deletions packages/@apphosting/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
version: "v1";
runConfig: RunConfig;
metadata: Metadata;
outputFiles?: OutputFiles;
}

// Fields needed to configure the App Hosting server
Expand Down Expand Up @@ -38,6 +39,19 @@
frameworkVersion?: string;
}

// Optional outputFiles to configure outputFiles and optimize server files + static assets.

Check failure on line 42 in packages/@apphosting/common/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Delete `·`
// If this is not set then all of the source code will be uploaded
interface OutputFiles {
serverApp: ServerApp

Check failure on line 45 in packages/@apphosting/common/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Insert `;`
}

// ServerApp holds a list of directories + files relative to the app root dir that frameworks need to deploy to the App Hosting server,

Check failure on line 48 in packages/@apphosting/common/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Delete `·`
// generally this will be the output/dist directory (e.g. .output or dist). To include all files set this to [“.”]
interface ServerApp {
include: string[]

Check failure on line 51 in packages/@apphosting/common/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Replace `··string[]` with `·string[];`
}

Check failure on line 52 in packages/@apphosting/common/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Delete `⏎··`


// Represents a single environment variable.
export interface EnvVarConfig {
// Name of the variable
Expand Down
Loading