Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
@@ -1 +1,2 @@
- Fix Functions MCP log tool to normalize sort order and surface Cloud Logging error details (#9247)
- `firebase init` support a way to skip project setup and login via `--project demo-no-project` (#9251)
1 change: 1 addition & 0 deletions firebase-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT

- [Added] Refine / Generate Operation Code Lens.
- []

## 1.8.0

Expand Down
7 changes: 3 additions & 4 deletions firebase-vscode/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { registerWebhooks } from "./webhook";
import { createE2eMockable } from "../utils/test_hooks";
import { runTerminalTask } from "../data-connect/terminal";
import { AnalyticsLogger } from "../analytics";
import { EmulatorHub } from "../../../src/emulator/hub";

export async function registerCore(
broker: ExtensionBrokerImpl,
Expand Down Expand Up @@ -66,10 +67,8 @@ export async function registerCore(
);
return;
}
const initCommand = currentProjectId.value
? `${settings.firebasePath} init dataconnect --project ${currentProjectId.value}`
: `${settings.firebasePath} init dataconnect`;

const projectId = currentProjectId.value || EmulatorHub.MISSING_PROJECT_PLACEHOLDER;
const initCommand = `${settings.firebasePath} init dataconnect --project ${projectId}`;
initSpy.call("firebase init", initCommand, { focus: true });
});

Expand Down
15 changes: 7 additions & 8 deletions firebase-vscode/webviews/SidebarApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,13 @@ export function SidebarApp() {
<ConfigPicker />
</PanelSection>

{user.value &&
(isInitialized.value ? (
<Content />
) : (
<PanelSection isLast={true}>
<Welcome />
</PanelSection>
))}
{isInitialized.value ? (
<Content />
) : (
<PanelSection isLast={true}>
<Welcome />
</PanelSection>
)}
</App>
);
}
2 changes: 0 additions & 2 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { init, Setup } from "../init";
import { logger } from "../logger";
import { checkbox, confirm } from "../prompt";
import { requireAuth } from "../requireAuth";
import * as fsutils from "../fsutils";
import * as utils from "../utils";
import { Options } from "../options";
Expand Down Expand Up @@ -147,7 +146,6 @@
export const command = new Command("init [feature]")
.description("interactively configure the current directory as a Firebase project directory")
.help(HELP)
.before(requireAuth)
.action(initAction);

/**
Expand Down Expand Up @@ -202,7 +200,7 @@

const setup: Setup = {
config: config.src,
rcfile: config.readProjectFile(".firebaserc", {

Check warning on line 203 in src/commands/init.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
json: true,
fallback: {},
}),
Expand Down
7 changes: 7 additions & 0 deletions src/init/features/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import * as utils from "../../utils";
import * as prompt from "../../prompt";
import { Options } from "../../options";
import { EmulatorHub } from "../../emulator/hub";
import { requireAuth } from "../../requireAuth";

const OPTION_NO_PROJECT = "Don't set up a default project";
const OPTION_USE_PROJECT = "Use an existing project";
Expand Down Expand Up @@ -72,7 +74,7 @@
* @param options the Firebase CLI options object.
* @return the project metadata, or undefined if no project was selected.
*/
async function projectChoicePrompt(options: any): Promise<FirebaseProjectMetadata | undefined> {

Check warning on line 77 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
const choices = [OPTION_USE_PROJECT, OPTION_NEW_PROJECT, OPTION_ADD_FIREBASE, OPTION_NO_PROJECT];
const projectSetupOption: string = await prompt.select<(typeof choices)[number]>({
message: "Please select an option:",
Expand All @@ -81,9 +83,9 @@

switch (projectSetupOption) {
case OPTION_USE_PROJECT:
return getOrPromptProject(options);

Check warning on line 86 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `Partial<Options>`
case OPTION_NEW_PROJECT:
return promptAndCreateNewProject(options);

Check warning on line 88 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `Options`
case OPTION_ADD_FIREBASE:
return promptAndAddFirebaseToCloudProject();
default:
Expand All @@ -98,8 +100,13 @@
* @param config Configuration for the project.
* @param options Command line options.
*/
export async function doSetup(setup: any, config: any, options: any): Promise<void> {

Check warning on line 103 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 103 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 103 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
setup.project = {};

Check warning on line 104 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .project on an `any` value
if (options.project === EmulatorHub.MISSING_PROJECT_PLACEHOLDER) {

Check warning on line 105 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .project on an `any` value
logger.info(`Skipping Firebase project setup given --project=${options.project}`);

Check warning on line 106 in src/init/features/project.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression
return;
}
await requireAuth(options);

logger.info();
logger.info(`First, let's associate this project directory with a Firebase project.`);
Expand Down
Loading