Skip to content

Commit

Permalink
Rename serverconfig to runconfig (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuangwang authored Oct 7, 2024
1 parent 9719c22 commit f938deb
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@apphosting/adapter-angular/e2e/run-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const tests = await Promise.all(

const bundleYaml = parseYaml(readFileSync(join(cwd, ".apphosting/bundle.yaml")).toString());

const runCommand = bundleYaml.serverConfig.runCommand;
const runCommand = bundleYaml.runConfig.runCommand;

if (typeof runCommand !== "string") {
throw new Error("runCommand must be a string");
Expand Down
2 changes: 1 addition & 1 deletion packages/@apphosting/adapter-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apphosting/adapter-angular",
"version": "17.2.9",
"version": "17.2.10",
"main": "dist/index.js",
"description": "Experimental addon to the Firebase CLI to add web framework support",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@apphosting/adapter-angular/src/bin/build.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("build commands", () => {
"dist/test/browser/browserfile": "",
"dist/test/server/server.mjs": "",
".apphosting/bundle.yaml": `version: v1
serverConfig:
runConfig:
runCommand: node dist/test/server/server.mjs
environmentVariables: []
metadata:
Expand Down
2 changes: 1 addition & 1 deletion packages/@apphosting/adapter-angular/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ async function generateBundleYaml(
await mkdir(dirname(opts.bundleYamlPath));
const outputBundle: OutputBundleConfig = {
version: "v1",
serverConfig: {
runConfig: {
runCommand: `node ${normalize(relative(cwd, opts.serverFilePath))}`,
environmentVariables: generateEnvVars(angularVersion),
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@apphosting/adapter-nextjs/e2e/run-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ await promiseSpawn("node", [buildScript], {

const bundleYaml = parseYaml(readFileSync(join(cwd, ".apphosting/bundle.yaml")).toString());

const runCommand = bundleYaml.serverConfig.runCommand;
const runCommand = bundleYaml.runConfig.runCommand;

if (typeof runCommand !== "string") {
throw new Error("runCommand must be a string");
Expand Down
2 changes: 1 addition & 1 deletion packages/@apphosting/adapter-nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apphosting/adapter-nextjs",
"version": "14.0.8",
"version": "14.0.9",
"main": "dist/index.js",
"description": "Experimental addon to the Firebase CLI to add web framework support",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@apphosting/adapter-nextjs/src/bin/build.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("build commands", () => {
".next/standalone/.next/static/staticfile": "",
".next/standalone/server.js": "",
".apphosting/bundle.yaml": `version: v1
serverConfig:
runConfig:
runCommand: node .next/standalone/server.js
metadata:
adapterPackageName: "@apphosting/adapter-nextjs"
Expand Down Expand Up @@ -105,7 +105,7 @@ metadata:
};
const expectedPartialYaml = {
version: "v1",
serverConfig: { runCommand: "node .next/standalone/apps/next-app/server.js" },
runConfig: { runCommand: "node .next/standalone/apps/next-app/server.js" },
};
validateTestFiles(tmpDir, expectedFiles);
validatePartialYamlContents(tmpDir, ".apphosting/bundle.yaml", expectedPartialYaml);
Expand Down
2 changes: 1 addition & 1 deletion packages/@apphosting/adapter-nextjs/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async function generateBundleYaml(
await mkdir(opts.outputDirectoryBasePath);
const outputBundle: OutputBundleConfig = {
version: "v1",
serverConfig: {
runConfig: {
runCommand: `node ${normalize(relative(cwd, opts.serverFilePath))}`,
},
metadata: createMetadata(nextVersion),
Expand Down
2 changes: 1 addition & 1 deletion packages/@apphosting/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apphosting/common",
"version": "0.0.4",
"version": "0.0.5",
"description": "Shared library code for App Hosting framework adapters",
"author": {
"name": "Firebase",
Expand Down
4 changes: 2 additions & 2 deletions packages/@apphosting/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { spawn } from "child_process";
// Output bundle metadata specifications to be written to bundle.yaml
export interface OutputBundleConfig {
version: "v1";
serverConfig: ServerConfig;
runConfig: RunConfig;
metadata: Metadata;
}

// Fields needed to configure the App Hosting server
export interface ServerConfig {
export interface RunConfig {
// Command to start the server (e.g. "node dist/index.js"). Assume this command is run from the root dir of the workspace
runCommand: string;
// Environment variables set when the app is run
Expand Down

0 comments on commit f938deb

Please sign in to comment.