Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
- Moved firebase-tools-ui server.js logic to fireabse-tools to run it in-memory. (#7897)
- Updates `superstatic` to `9.1.0` (#7929).
- Added the appdistribution:group:list and appdistribution:testers:list commands.
- Aliased `appdistribution:group:*` commands to `appdistribution:groups:*`.
- Updated the Firebase Data Connect local toolkit to v1.7.2, which includes bug fixes for `@auth` expressions that reference the `auth` variable, `Optional` arrays in Swift codegen, and updates Kotlin codegen to use fully-qualified class names everywhere. (#7968)
14 changes: 7 additions & 7 deletions npm-shrinkwrap.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"cjson": "^0.3.1",
"cli-table": "0.3.11",
"colorette": "^2.0.19",
"commander": "^4.0.1",
"commander": "^5.1.0",
"configstore": "^5.0.1",
"cors": "^2.8.5",
"cross-env": "^5.1.3",
Expand Down
4 changes: 2 additions & 2 deletions src/bin/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

// Check for older versions of Node no longer supported by the CLI.
import * as semver from "semver";
const pkg = require("../../package.json");

Check warning on line 5 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value

Check warning on line 5 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Require statement not part of import statement
const nodeVersion = process.version;
if (!semver.satisfies(nodeVersion, pkg.engines.node)) {

Check warning on line 7 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `string | Range`

Check warning on line 7 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .engines on an `any` value
console.error(
`Firebase CLI v${pkg.version} is incompatible with Node.js ${nodeVersion} Please upgrade Node.js to version ${pkg.engines.node}`,

Check warning on line 9 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression

Check warning on line 9 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .version on an `any` value

Check warning on line 9 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression

Check warning on line 9 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .engines on an `any` value
);
process.exit(1);
}
Expand All @@ -14,11 +14,11 @@
import * as updateNotifierPkg from "update-notifier-cjs";
import * as clc from "colorette";
import { markedTerminal } from "marked-terminal";
const updateNotifier = updateNotifierPkg({ pkg });

Check warning on line 17 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
import { marked } from "marked";
marked.use(markedTerminal() as any);

Check warning on line 19 in src/bin/firebase.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `MarkedExtension`

import { Command } from "commander";
import { CommanderStatic } from "commander";
import { join } from "node:path";
import { SPLAT } from "triple-beam";
import { stripVTControlCharacters } from "node:util";
Expand All @@ -34,7 +34,7 @@
import * as winston from "winston";

let args = process.argv.slice(2);
let cmd: Command;
let cmd: CommanderStatic;

function findAvailableLogFile(): string {
const candidates = ["firebase-debug.log"];
Expand Down
1 change: 1 addition & 0 deletions src/command.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe("Command", () => {
},
["foo", "bar"],
);
command.alias("example2");
command.help("here's how!");
command.action(() => {
// do nothing
Expand Down
14 changes: 14 additions & 0 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class Command {
private descriptionText = "";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private options: any[][] = [];
private aliases: string[] = [];
private actionFn: ActionFunction = (): void => {
// noop by default, unless overwritten by `.action(fn)`.
};
Expand All @@ -62,6 +63,16 @@ export class Command {
return this;
}

/**
* Sets an alias for a command.
* @param aliases an alternativre name for the command. Users will be able to call the command via this name.
* @return the command, for chaining.
*/
alias(alias: string): Command {
this.aliases.push(alias);
return this;
}

/**
* Sets any options for the command.
*
Expand Down Expand Up @@ -138,6 +149,9 @@ export class Command {
if (this.descriptionText) {
cmd.description(this.descriptionText);
}
if (this.aliases) {
cmd.aliases(this.aliases);
}
this.options.forEach((args) => {
const flags = args.shift();
cmd.option(flags, ...args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { requireAuth } from "../requireAuth";
import { AppDistributionClient } from "../appdistribution/client";
import { getProjectName } from "../appdistribution/options-parser-util";

export const command = new Command("appdistribution:group:create <displayName> [alias]")
export const command = new Command("appdistribution:groups:create <displayName> [alias]")
.description("create group in project")
.alias("appdistribution:group:create")
.before(requireAuth)
.action(async (displayName: string, alias?: string, options?: any) => {
const projectName = await getProjectName(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { FirebaseError } from "../error";
import { AppDistributionClient } from "../appdistribution/client";
import { getProjectName } from "../appdistribution/options-parser-util";

export const command = new Command("appdistribution:group:delete <alias>")
export const command = new Command("appdistribution:groups:delete <alias>")
.description("delete group from a project")
.alias("appdistribution:group:delete")
.before(requireAuth)
.action(async (alias: string, options: any) => {
const projectName = await getProjectName(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import * as utils from "../utils";

const Table = require("cli-table");

export const command = new Command("appdistribution:group:list")
export const command = new Command("appdistribution:groups:list")
.description("list groups in project")
.alias("appdistribution:group:list")
.before(requireAuth)
.action(async (options?: Options): Promise<ListGroupsResponse> => {
const projectName = await getProjectName(options);
Expand Down
7 changes: 4 additions & 3 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ export function load(client: any): any {
client.appdistribution.testers.add = loadCommand("appdistribution-testers-add");
client.appdistribution.testers.delete = loadCommand("appdistribution-testers-remove");
client.appdistribution.group = {};
client.appdistribution.group.list = loadCommand("appdistribution-group-list");
client.appdistribution.group.create = loadCommand("appdistribution-group-create");
client.appdistribution.group.delete = loadCommand("appdistribution-group-delete");
client.appdistribution.group.list = loadCommand("appdistribution-groups-list");
client.appdistribution.group.create = loadCommand("appdistribution-groups-create");
client.appdistribution.group.delete = loadCommand("appdistribution-groups-delete");
client.appdistribution.groups = client.appdistribution.group;
client.apps = {};
client.apps.create = loadCommand("apps-create");
client.apps.list = loadCommand("apps-list");
Expand Down
Loading