Skip to content

Commit 1be74d0

Browse files
committed
update output files
1 parent ef114f2 commit 1be74d0

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Any framework that can generate a build output in accordance with the App Hostin
1818
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.
1919

2020
> [!NOTE]
21-
> App Hosting technically supports all all node applications, but no custom framework features will be enabled without the output bundle.
21+
> App Hosting technically supports all node applications, but no custom framework features will be enabled without the output bundle.
2222
2323
## Output bundle Schema
2424

@@ -37,6 +37,7 @@ interface OutputBundle {
3737
version: "v1"
3838
runConfig: RunConfig;
3939
metadata: Metadata;
40+
outputFiles?: OutputFiles;
4041
}
4142
```
4243

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

112+
### OutputFiles
113+
114+
OutputFiles is an optional field to configure outputFiles and optimize server files + static assets.
115+
116+
```typescript
117+
interface OutputFiles {
118+
serverApp: ServerApp
119+
}
120+
121+
```
122+
123+
| Field | Type | Description | Required? |
124+
| ---------- | ------- | - | - |
125+
| `serverApp` | `ServerApp` | ServerApp holds configurations related to the serving files at runtime from Cloud Run | y |
126+
127+
### ServerApp
128+
129+
OutputFiles is an optional field to configure outputFiles and optimize server files + static assets.
130+
131+
```typescript
132+
interface ServerApp {
133+
include: string[]
134+
}
135+
136+
```
137+
138+
| Field | Type | Description | Required? |
139+
| ---------- | ------- | - | - |
140+
| `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 |
141+
142+
## Sample
143+
111144
Here is a sample `.apphosting/bundle.yaml` file putting all this together:
112145

113146
```yaml
114147
version: v1
115148
runConfig:
116-
runCommand: 'node dist/index.js'
149+
runCommand: node dist/index.js
117150
environmentVariables:
118151
- variable: VAR
119152
value: 8080
@@ -123,6 +156,12 @@ runConfig:
123156
memoryMiB: 512
124157
minInstances: 0
125158
maxInstances: 14
159+
160+
outputFiles:
161+
serverApp:
162+
include:
163+
- dist
164+
- .output
126165

127166
metadata:
128167
adapterPackageName: npm-name

packages/@apphosting/common/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface OutputBundleConfig {
55
version: "v1";
66
runConfig: RunConfig;
77
metadata: Metadata;
8+
outputFiles?: OutputFiles;
89
}
910

1011
// Fields needed to configure the App Hosting server
@@ -38,6 +39,19 @@ export interface Metadata {
3839
frameworkVersion?: string;
3940
}
4041

42+
// Optional outputFiles to configure outputFiles and optimize server files + static assets.
43+
// If this is not set then all of the source code will be uploaded
44+
interface OutputFiles {
45+
serverApp: ServerApp
46+
}
47+
48+
// ServerApp holds a list of directories + files relative to the app root dir that frameworks need to deploy to the App Hosting server,
49+
// generally this will be the output/dist directory (e.g. .output or dist). To include all files set this to [“.”]
50+
interface ServerApp {
51+
include: string[]
52+
}
53+
54+
4155
// Represents a single environment variable.
4256
export interface EnvVarConfig {
4357
// Name of the variable

0 commit comments

Comments
 (0)