Skip to content

Commit

Permalink
Merge branch 'master' into leoortizz_fixWindowsDotEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
leoortizz authored Jan 13, 2025
2 parents 3a1dc8e + be02559 commit 5dec56f
Show file tree
Hide file tree
Showing 22 changed files with 1,756 additions and 2,542 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
run: npm run test:e2e
working-directory: firebase-vscode

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Updated `cross-env` and `cross-spawn` dependencies to avoid vulnerable versions. (#7979)
- Fixed an issue with the Data Connect emulator where `dataDir` and `--export` were relative to the current directory insead of `firebase.json`.
2 changes: 2 additions & 0 deletions firebase-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## NEXT

- [Feature] Added `debug` setting to run commands with `--debug`

## 0.12.0

- Updated internal firebase-tools dependency to 13.29.1
Expand Down
5 changes: 5 additions & 0 deletions firebase-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"default": true,
"markdownDescription": "%ext.config.idx.viewMetricNotice%",
"scope": "application"
},
"firebase.debug": {
"type": "boolean",
"default": false,
"markdownDescription": "%ext.config.debug%"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions firebase-vscode/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ext.config.firebasePath": "Path to the `Firebase` module, e.g. `./node_modules/firebase`",
"ext.config.hosting.useFrameworks": "Enable web frameworks",
"ext.config.npmPath": "Path to NPM executable in local environment",
"ext.config.debug": "When true, add the --debug flag to any commands run by the extension",
"ext.config.title": "Prettier",
"ext.config.idx.viewMetricNotice": "Show data collection notice on next startup (IDX Only)"
}
7 changes: 6 additions & 1 deletion firebase-vscode/src/data-connect/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function setTerminalEnvVars(envVar: string, value: string) {
}

export function runCommand(command: string) {
const settings = getSettings();
const terminalOptions: TerminalOptions = {
name: "Data Connect Terminal",
env: environmentVariables,
Expand All @@ -30,6 +31,9 @@ export function runCommand(command: string) {
if (currentProjectId.value) {
command = `${command} --project ${currentProjectId.value}`;
}
if (settings.debug) {
command = `${command} --debug`;
}
terminal.sendText(command);
}

Expand All @@ -38,6 +42,7 @@ export function runTerminalTask(
command: string,
presentationOptions: vscode.TaskPresentationOptions = { focus: true },
): Promise<string> {
const settings = getSettings();
const type = "firebase-" + Date.now();
return new Promise(async (resolve, reject) => {
vscode.tasks.onDidEndTaskProcess(async (e) => {
Expand All @@ -60,7 +65,7 @@ export function runTerminalTask(
vscode.TaskScope.Workspace,
taskName,
"firebase",
new vscode.ShellExecution(command, executionOptions),
new vscode.ShellExecution(`${command}${settings.debug ? " --debug" : ""}`, executionOptions),
);
task.presentationOptions = presentationOptions;
await vscode.tasks.executeTask(task);
Expand Down
2 changes: 2 additions & 0 deletions firebase-vscode/src/utils/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface Settings {
readonly npmPath: string;
readonly useFrameworks: boolean;
readonly shouldShowIdxMetricNotice: boolean;
readonly debug: boolean;
}

// TODO: Temporary fallback for bashing, this should probably point to the global firebase binary on the system
Expand Down Expand Up @@ -37,6 +38,7 @@ export function getSettings(): Settings {
"idx.viewMetricNotice",
true,
),
debug: config.get<boolean>("debug", false),
};
}

Expand Down
23 changes: 12 additions & 11 deletions firebase-vscode/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,20 @@ const extensionConfig = {
from: "../schema",
to: "./schema",
},
// TODO(hlshen): Sanity check if these should be fixed or removed. AFIACT, they exist for functions and hosting deploys, which are not relevant anymore.
// Copy uncompiled JS files called at runtime by
// firebase-tools/src/parseTriggers.ts
{
from: "*.js",
to: "./",
context: "../src/deploy/functions/runtimes/node",
},
// Copy cross-env-shell.js used to run predeploy scripts
// to ensure they work in Windows
{
from: "../node_modules/cross-env/dist",
to: "./cross-env/dist",
},
// {
// from: "*.js",
// to: "./",
// context: "../src/deploy/functions/runtimes/node",
// },
// // Copy cross-env-shell.js used to run predeploy scripts
// // to ensure they work in Windows
// {
// from: "../node_modules/cross-env/dist",
// to: "./cross-env/dist",
// },
],
}),
],
Expand Down
Loading

0 comments on commit 5dec56f

Please sign in to comment.