Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'request' from 'functions:shell' #5808

Merged
merged 21 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merging, more impl
  • Loading branch information
joehan committed Nov 7, 2023
commit ab0225483aff3e387e271983232d6432eb1fd777
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ lib
node_modules
standalone
templates
.firebase
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@ module.exports = {
// TODO(jamesdaniels): add this to overrides instead
ignorePatterns: [
"src/dynamicImport.js",
"scripts/webframeworks-deploy-tests/hosting/**",
"scripts/webframeworks-deploy-tests/nextjs/**",
"scripts/webframeworks-deploy-tests/angular/**",
"scripts/frameworks-tests/vite-project/**",
"/src/frameworks/docs/**",
// This file is taking a very long time to lint, 2-4m
"src/emulator/auth/schema.ts",
// TODO(hsubox76): Set up a job to run eslint separately on vscode dir
"firebase-vscode/",
],
};
49 changes: 32 additions & 17 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
node-version:
- "16"
- "18"
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -35,7 +35,7 @@ jobs:
cache: npm
cache-dependency-path: npm-shrinkwrap.json

- run: npm i -g npm@8.7
- run: npm i -g npm@9.5
- run: npm ci
- run: npm run lint:changed-files

Expand All @@ -44,7 +44,6 @@ jobs:
strategy:
matrix:
node-version:
- "14"
- "16"
- "18"
steps:
Expand All @@ -55,12 +54,12 @@ jobs:
cache: npm
cache-dependency-path: npm-shrinkwrap.json

- run: npm i -g npm@8.7
- run: npm i -g npm@9.5
- run: npm ci
- run: npm test -- -- --forbid-only

- uses: codecov/codecov-action@v3
if: matrix.node-version == '14'
if: matrix.node-version == '16'

integration:
needs: unit
Expand All @@ -80,7 +79,7 @@ jobs:
fail-fast: false
matrix:
node-version:
- "16"
- "18"
script:
- npm run test:client-integration
- npm run test:emulator
Expand All @@ -94,7 +93,6 @@ jobs:
- npm run test:storage-emulator-integration
- npm run test:triggers-end-to-end
- npm run test:triggers-end-to-end:inspect
- npm run test:webframeworks-deploy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -110,7 +108,7 @@ jobs:
key: ${{ runner.os }}-firebase-emulators-${{ hashFiles('emulator-cache/**') }}
continue-on-error: true

- run: npm i -g npm@8.7
- run: npm i -g npm@9.5
- run: npm ci
- run: echo ${{ secrets.service_account_json_base64 }} | base64 -d > ./scripts/service-account.json
- run: ${{ matrix.script }}
Expand All @@ -137,16 +135,16 @@ jobs:
fail-fast: false
matrix:
node-version:
- "16"
- "18"
script:
- npm run test:hosting
# - npm run test:hosting-rewrites # Long-running test that might conflict across test runs. Run this manually.
- npm run test:client-integration
- npm run test:emulator
# - npm run test:import-export # Fails becuase port 4000 is taken after first run - hub not shhutting down?
# - npm run test:import-export # Fails becuase port 4000 is taken after first run - hub not shutting down?
# - npm run test:extensions-emulator # Fails due to cannot find module sharp (not waiting for npm install?)
- npm run test:functions-discover
- npm run test:triggers-end-to-end
# - npm run test:triggers-end-to-end
- npm run test:triggers-end-to-end:inspect
- npm run test:storage-deploy
# - npm run test:storage-emulator-integration
Expand All @@ -173,7 +171,7 @@ jobs:

- run: echo ${{ secrets.service_account_json_base64 }} > tmp.txt
- run: certutil -decode tmp.txt scripts/service-account.json
- run: npm i -g npm@8.7
- run: npm i -g npm@9.5
- run: npm ci
- run: ${{ matrix.script }}
- name: Print debug logs
Expand All @@ -186,28 +184,45 @@ jobs:
strategy:
matrix:
node-version:
- "16"
- "18"

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: npm-shrinkwrap.json
- run: npm i -g [email protected]
- run: npm i -g [email protected]
# --ignore-scripts prevents the `prepare` script from being run.
- run: npm install --package-lock-only --ignore-scripts
- run: "git diff --exit-code -- npm-shrinkwrap.json || (echo 'Error: npm-shrinkwrap.json is changed during npm install! Please make sure to use npm >= 8 and commit npm-shrinkwrap.json.' && false)"

check-package-lock-vsce:
runs-on: ubuntu-latest

strategy:
matrix:
node-version:
- "18"

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g [email protected]
# --ignore-scripts prevents the `prepare` script from being run.
- run: "(cd firebase-vscode && npm install --package-lock-only --ignore-scripts)"
- run: "git diff --exit-code -- firebase-vscode/package-lock.json || (echo 'Error: firebase-vscode/package-lock.json is changed during npm install! Please make sure to use npm >= 8 and commit firebase-vscode/package-lock.json.' && false)"

check-json-schema:
runs-on: ubuntu-latest

strategy:
matrix:
node-version:
- "16"
- "18"

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
/lib/**/*
/CONTRIBUTING.md
/scripts/frameworks-tests/vite-project/**
/scripts/webframeworks-deploy-tests/angular/**
/scripts/webframeworks-deploy-tests/nextjs/**
/src/frameworks/docs/**
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
- Support for Next.js i18n, basePath, and more advanced rewrites/redirects/headers (#5788)
- hosting.frameworksBackend now respects omit: true (#5788)
- Web Frameworks now memoizes framework builds for single builds across multiple hosting sites (#5788)
- Fixed 2 bugs (unintended database mode changes and disabling of PITR or delete-protection) when updating Firestore databases (#6478)
13 changes: 4 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,10 @@ are unavailable to Pull Requests coming from forks of the repository.
| path | description |
| --------------- | --------------------------------------------------------- |
| `src` | Contains shared/support code for the commands |
| `src/bin` | Contains the runnable script. You shouldn't need to touch |
: : this content. :
| `src/commands` | Contains code for the commands, organized by |
: : one-file-per-command with dashes. :
| `src/templates` | Contains static files needed for various reasons |
: : (inittemplates, login success HTML, etc.) :
| `src/test` | Contains tests. Mirrors the top-level directory structure |
: : (i.e., `src/test/commands` contains command tests and :
: : `src/test/gcp` contains `gcp` tests) :
| `src/bin` | Contains the runnable script. You shouldn't need to touch this content. |
| `src/commands` | Contains code for the commands, organized by one-file-per-command with dashes. |
| `src/templates` | Contains static files needed for various reasons (inittemplates, login success HTML, etc.) |
| `src/test` | Contains tests. Mirrors the top-level directory structure (i.e., `src/test/commands` contains command tests and `src/test/gcp` contains `gcp` tests) |

## Building CLI commands

Expand Down
24 changes: 24 additions & 0 deletions firebase-vscode/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
// "react"
],
"rules": {
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
5 changes: 5 additions & 0 deletions firebase-vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.vsix
dist/
*.scss.d.ts
resources/dist
.vscode-test
3 changes: 3 additions & 0 deletions firebase-vscode/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
printWidth: 80,
};
7 changes: 7 additions & 0 deletions firebase-vscode/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// See http:https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
34 changes: 34 additions & 0 deletions firebase-vscode/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/dist/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/dist/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
11 changes: 11 additions & 0 deletions firebase-vscode/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"dist": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"dist": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
20 changes: 20 additions & 0 deletions firebase-vscode/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": ["$tsc-watch", "$ts-webpack-watch"],
"isBackground": true,
"presentation": {
"reveal": "always"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
20 changes: 20 additions & 0 deletions firebase-vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.vscode/**
.vscode-test/**
src/**
webviews/**
common/**
extension/**
public/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
*.vsix
webpack.*.js
../
*.zip
node_modules/
dist/test/
44 changes: 44 additions & 0 deletions firebase-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Change Log

## 0.0.25 (unreleased)

- Replace predeploy hack with something more robust.

## 0.0.24

- Remove proxy-agent stub #6172
- Pull in latest CLI changes (July 25, 2023)

## 0.0.24-alpha.1

- Add more user-friendly API permission denied messages

## 0.0.24-alpha.0

- Remove Google sign-in option from Monospace.
- Fix some Google sign-in login/logout logic.
- Prioritize showing latest failed deploy if it failed.

## 0.0.23 (July 13, 2023)

- Same as alpha.5, marked as stable.

## 0.0.23-alpha.5 (July 12, 2023)

- More fixes for service account detection logic.
- Better output and error handling for init and deploy steps.

## 0.0.23-alpha.4 (July 11, 2023)

- Fix for service account bugs

## 0.0.23-alpha.3 (July 7, 2023)

- UX updates
- Get last deploy date
- Write to and show info level logs in output channel when deploying
- Enable user to view service account email

## 0.0.23-alpha.2 (July 6 2023)

- Service account internal fixes plus fix for deploying Next.js twice in a row
21 changes: 21 additions & 0 deletions firebase-vscode/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2023 Firebase

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.