Skip to content

Add extra info in extensions commands#10237

Merged
joehan merged 2 commits intomainfrom
inlined.ext-tools
Apr 2, 2026
Merged

Add extra info in extensions commands#10237
joehan merged 2 commits intomainfrom
inlined.ext-tools

Conversation

@inlined
Copy link
Copy Markdown
Member

@inlined inlined commented Apr 1, 2026

Adds the download link to firebase ext:info and adds params info in the --json version of firebase ext:list

Sample runs:

❯ firebase ext:list --json --project inlined-junkdrawer
{
  "status": "success",
  "result": [
    {
      "extension": "firebase/storage-resize-images",
      "publisher": "firebase",
      "instanceId": "storage-resize-images-fqbz",
      "state": "ACTIVE",
      "version": "0.1.25",
      "updateTime": "2022-02-08 21:41:00",
      "params": {
        "INCLUDE_PATH_LIST": "/source/*",
        "EXCLUDE_PATH_LIST": "/source/*/pictures",
        "IMAGE_TYPE": "jpeg",
        "LOCATION": "us-central1",
        "IMG_BUCKET": "inlined-junkdrawer.appspot.com",
        "IMG_SIZES": "200x200",
        "DELETE_ORIGINAL_FILE": "true",
        "RESIZED_IMAGES_PATH": "thumbs"
      }
    }
  ]
}
❯ firebase ext:info firebase/storage-resize-images
i  extensions: ensuring required API firebaseextensions.googleapis.com is enabled...
i  extensions: information about firebase/storage-resize-images@latest:

Name: Resize Images
Author: Firebase (https://firebase.google.com)
Download URL: https://storage.googleapis.com/firebase-mod-sources-prod/3d086abae5f75f29bcb8baa50388bcbe2195eac2a314a08301638e1a40e5ca61
Description: Resizes images uploaded to Cloud Storage to a specified size, and optionally keeps or deletes the original image.

Details: Use this extension to create resized versions of an image uploaded to a Cloud Storage bucket.
...

@inlined inlined requested a review from joehan April 1, 2026 19:08
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the ext:info and ext:list commands by including the source download URL and extension configuration parameters (params and systemParams) in their respective outputs. The listExtensions function and its associated tests were updated to handle these additional fields. However, the use of any in the return type and variable declarations in src/extensions/listExtensions.ts violates the repository's style guide, which prohibits any as an escape hatch. You should define a proper interface for the extension instance object to ensure type safety.

* @return mapping that contains a list of instances under the "instances" key
*/
export async function listExtensions(projectId: string): Promise<Record<string, string>[]> {
export async function listExtensions(projectId: string): Promise<Record<string, any>[]> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of any violates the repository style guide (GEMINI.md, line 38). Please define a proper interface or use a specific type literal for the return value to ensure type safety.

Suggested change
export async function listExtensions(projectId: string): Promise<Record<string, any>[]> {
export async function listExtensions(projectId: string): Promise<Array<{
extension: string;
publisher: string;
instanceId: string;
state: string;
version: string | undefined;
updateTime: string;
params: Record<string, string>;
systemParams: Record<string, string>;
}>> {
References
  1. Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)

(a, b) => new Date(b.createTime).valueOf() - new Date(a.createTime).valueOf(),
);
const formatted: Record<string, string>[] = [];
const formatted: Record<string, any>[] = [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid using any here to comply with the repository style guide. Explicitly typing the formatted array improves code clarity and maintainability.

  const formatted: Array<{
    extension: string;
    publisher: string;
    instanceId: string;
    state: string;
    version: string | undefined;
    updateTime: string;
    params: Record<string, string>;
    systemParams: Record<string, string>;
  }> = [];
References
  1. Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)

@joehan joehan merged commit 589a7a8 into main Apr 2, 2026
47 of 48 checks passed
@joehan joehan deleted the inlined.ext-tools branch April 2, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants