Skip to content

Commit 4dcdcd1

Browse files
authored
Svn main 001 rem (#6486)
* Change name from stack to backend * Change name from stack to backend * changed file names * changed file names in experiments * changed name * lower case backend
1 parent ca4349d commit 4dcdcd1

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/commands/frameworks-stacks-create.ts renamed to src/commands/frameworks-backends-create.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { needProjectId } from "../projectUtils";
44
import requireInteractive from "../requireInteractive";
55
import { doSetup } from "../init/features/frameworks";
66

7-
export const command = new Command("stacks:create")
8-
.description("Create a stack in a Firebase project")
7+
export const command = new Command("backends:create")
8+
.description("Create a backend in a Firebase project")
99
.before(requireInteractive)
1010
.action(async (options: Options) => {
1111
const projectId = needProjectId(options);

src/commands/frameworks-stacks-delete.ts renamed to src/commands/frameworks-backends-delete.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ import * as gcp from "../gcp/frameworks";
66
import { promptOnce } from "../prompt";
77
import * as utils from "../utils";
88

9-
export const command = new Command("stacks:delete")
10-
.description("Delete a stack from a Firebase project")
9+
export const command = new Command("backends:delete")
10+
.description("Delete a backend from a Firebase project")
1111
.option("-l, --location <location>", "App Backend location", "us-central1")
12-
.option("-s, --stackId <stackId>", "Stack Id", "")
12+
.option("-s, --backendId <backendId>", "Backend Id", "")
1313
.withForce()
1414
.action(async (options: Options) => {
1515
const projectId = needProjectId(options);
1616
const location = options.location as string;
17-
const stackId = options.stackId as string;
18-
if (!stackId) {
19-
throw new FirebaseError("Stack id can't be empty.");
17+
const backendId = options.backendId as string;
18+
if (!backendId) {
19+
throw new FirebaseError("Backend id can't be empty.");
2020
}
2121
const confirmDeletion = await promptOnce(
2222
{
2323
type: "confirm",
2424
name: "force",
2525
default: false,
26-
message: "You are about to delete the Stack with id: " + stackId + "\n Are you sure?",
26+
message: "You are about to delete the backend with id: " + backendId + "\n Are you sure?",
2727
},
2828
options
2929
);
@@ -32,11 +32,11 @@ export const command = new Command("stacks:delete")
3232
}
3333

3434
try {
35-
await gcp.deleteStack(projectId, location, stackId);
36-
utils.logSuccess(`Successfully deleted the stack: ${stackId}`);
35+
await gcp.deleteBackend(projectId, location, backendId);
36+
utils.logSuccess(`Successfully deleted the backend: ${backendId}`);
3737
} catch (err: any) {
3838
throw new FirebaseError(
39-
`Failed to delete stack: ${stackId}. Please check the parameters you have provided.`,
39+
`Failed to delete backend: ${backendId}. Please check the parameters you have provided.`,
4040
{ original: err }
4141
);
4242
}

src/commands/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ export function load(client: any): any {
155155
client.frameworks = {};
156156
client.frameworks.stacks = {};
157157
client.frameworks.stacks.list = loadCommand("frameworks-stacks-list");
158-
client.frameworks.stacks.create = loadCommand("frameworks-stacks-create");
158+
client.frameworks.stacks.create = loadCommand("frameworks-backends-create");
159159
client.frameworks.stacks.create = loadCommand("frameworks-stacks-get");
160-
client.frameworks.stacks.create = loadCommand("frameworks-stacks-delete");
160+
client.frameworks.stacks.create = loadCommand("frameworks-backends-delete");
161161
}
162162
client.login = loadCommand("login");
163163
client.login.add = loadCommand("login-add");

src/gcp/frameworks.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ export async function listStack(projectId: string, location: string): Promise<Li
128128
}
129129

130130
/**
131-
* Deletes a Stack with stackId in a given project and location.
131+
* Deletes a backend with backendId in a given project and location.
132132
*/
133-
export async function deleteStack(
133+
export async function deleteBackend(
134134
projectId: string,
135135
location: string,
136-
stackId: string
136+
backendId: string
137137
): Promise<Operation> {
138-
const name = `projects/${projectId}/locations/${location}/backends/${stackId}`;
138+
const name = `projects/${projectId}/locations/${location}/backends/${backendId}`;
139139
const res = await client.delete<Operation>(name);
140140

141141
return res.body;

0 commit comments

Comments
 (0)