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

Firebase Data Connect #7057

Merged
merged 394 commits into from Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
394 commits
Select commit Hold shift + click to select a range
8ddefda
Merge branch 'launch.firemat-fishfood' of https://github.com/Firebase…
rrousselGit Jan 19, 2024
4b4b461
Decode firemat.yaml
rrousselGit Jan 20, 2024
ba2ca2a
Show codelenses only folders corresponding to firemat.yaml
rrousselGit Jan 20, 2024
caa6a5a
Update tests to reflect config changes
rrousselGit Jan 20, 2024
71bef46
Apply suggestions from code review
rrousselGit Jan 22, 2024
03ab5af
Remove invocation to missing command
rrousselGit Jan 22, 2024
fa53ee7
Merge pull request #835 from FirebasePrivate/firemat.remove-dead-command
hlshen Jan 22, 2024
3cefad2
Enable running queries/mutations in production
rrousselGit Jan 25, 2024
14a0e76
Apply suggestions from code review
rrousselGit Jan 26, 2024
5425005
Fuse User Mock view and Arguments view (#837)
rrousselGit Jan 26, 2024
f1645f5
Add Firebase Data Connect view
rrousselGit Jan 26, 2024
5aa7d8d
Add Instance Picker
rrousselGit Jan 26, 2024
298585c
Update codelense logic to use instance picker
rrousselGit Jan 26, 2024
e849ad1
Add instance in status bar
rrousselGit Jan 26, 2024
461be83
Add project in statusbar
rrousselGit Jan 26, 2024
7e7acfe
Add tests for src/core/config.ts (#825)
rrousselGit Jan 29, 2024
1b7b595
Merge branch 'launch.firemat-fishfood' of https://github.com/Firebase…
rrousselGit Jan 29, 2024
566935f
Merge branch 'launch.firemat-fishfood' of https://github.com/Firebase…
rrousselGit Jan 29, 2024
ffc7711
Update config parsing to handle custom operationSet keys
rrousselGit Jan 29, 2024
081591e
Merge pull request #834 from FirebasePrivate/firemat.show-codelens-in…
hlshen Jan 29, 2024
4c071bd
Merge branch 'launch.firemat-fishfood' of https://github.com/Firebase…
rrousselGit Jan 30, 2024
c6c415a
Rename
rrousselGit Jan 31, 2024
6614859
Extract functions
rrousselGit Jan 31, 2024
5a15fda
Rename
rrousselGit Jan 31, 2024
f96d588
Merge pull request #838 from FirebasePrivate/firemat.production-codel…
hlshen Jan 31, 2024
f8b2dca
Include Firebase logo next to the selected project
rrousselGit Feb 5, 2024
32ab7d6
Merge firemat with master
rrousselGit Feb 5, 2024
12c3a7f
Merge pull request #842 from FirebasePrivate/merge
rrousselGit Feb 5, 2024
d54dfae
Fix codelenses incorrectly showing in the schema folder but not in th…
rrousselGit Feb 5, 2024
ee2d543
Fix merge error
rrousselGit Feb 5, 2024
7365d1e
Merge branch 'launch.firemat-fishfood' of https://github.com/Firebase…
rrousselGit Feb 5, 2024
7b95b7e
W
rrousselGit Feb 7, 2024
1ab7974
Complete execution e2e and fix failing e2e
rrousselGit Feb 8, 2024
7031280
Cleanup tests
rrousselGit Feb 8, 2024
429c7e3
Add instance picker e2e
rrousselGit Feb 8, 2024
a5cb862
Remove log and revert .vscode change
rrousselGit Feb 8, 2024
9c9844a
Move pageobjects to a separate folder
rrousselGit Feb 9, 2024
c46dcda
Apply suggestions from code review
rrousselGit Feb 9, 2024
4ca70b7
Can pick nothing
rrousselGit Feb 9, 2024
844e6db
Merge branch 'e2e' of https://github.com/FirebasePrivate/firebase-too…
rrousselGit Feb 9, 2024
0a9bb11
Merge pull request #849 from FirebasePrivate/e2e
hlshen Feb 9, 2024
5433a6d
initial lsp implementation
hlshen Feb 13, 2024
ae57a2c
Add lsp binary
hlshen Feb 13, 2024
0dc0553
Add lsp binary
hlshen Feb 13, 2024
295194b
Fix another vue-compiler dynamic dep
hlshen Feb 13, 2024
b13778f
Merge pull request #852 from FirebasePrivate/hlshen/ls
hlshen Feb 13, 2024
f1874d0
Merge pull request #843 from FirebasePrivate/firemat.production-codel…
hlshen Feb 13, 2024
bc80e8d
Emulator should stop taking focus
rrousselGit Feb 14, 2024
795cf7e
Don't pick an instance by default, and show statusbar in red
rrousselGit Feb 14, 2024
9c5ffdb
Merge pull request #853 from FirebasePrivate/stop-taking-focus
hlshen Feb 14, 2024
8722ca1
Merge pull request #854 from FirebasePrivate/no-default-instance
hlshen Feb 14, 2024
d775645
fix execute codelens not showing in adhoc folder
hlshen Feb 14, 2024
867e6c3
Merge branch 'master' of https://github.com/FirebasePrivate/firebase-…
rrousselGit Feb 15, 2024
cd3b9e7
fix merge mistake
rrousselGit Feb 15, 2024
2fe9e1c
Add start-emulator command
rrousselGit Feb 15, 2024
4794867
Instance default to emulator
rrousselGit Feb 15, 2024
9c4c8bd
Show execution codelens even if emulator isn't started
rrousselGit Feb 15, 2024
19a0184
Auto-start emulator when targeting emulator but it isn't started
rrousselGit Feb 15, 2024
3e14366
Add support for adhoc files. Update emulator to 0.1.4. Small fix to l…
hlshen Feb 15, 2024
57ea000
update emulator file
hlshen Feb 15, 2024
85e617e
add dataconnect icon to statusbar. Change statusbar color
hlshen Feb 16, 2024
6616e5c
Minor ui updates
hlshen Feb 16, 2024
985bb4e
Commit
rrousselGit Feb 16, 2024
c05ea00
Merge pull request #856 from FirebasePrivate/hlshen/adhoc
hlshen Feb 16, 2024
e79a60d
Merge pull request #857 from FirebasePrivate/hlshen/status
hlshen Feb 16, 2024
b458692
Merge pull request #858 from FirebasePrivate/hlshen/cleanup
hlshen Feb 16, 2024
4e88002
Delete unused conf
rrousselGit Feb 16, 2024
0f7161e
Fix e2e
rrousselGit Feb 16, 2024
c6d1dd3
Add some e2e tests
rrousselGit Feb 16, 2024
570b6c0
Merge branch 'launch.firemat-fishfood' of https://github.com/Firebase…
rrousselGit Feb 16, 2024
706e112
Fix tests
rrousselGit Feb 16, 2024
daeca98
Merge pull request #859 from FirebasePrivate/refactor-emulator
hlshen Feb 16, 2024
626fba9
fix execute codelens not showing in adhoc folder
hlshen Feb 16, 2024
fc0867f
Prototype `deploy --only dataconnect` (#820)
joehan Feb 23, 2024
5df134e
Fix Emulators.FIREMAT rename
rrousselGit Feb 26, 2024
0ce5e5b
Rename emulator to Dataconnect (#869)
rrousselGit Feb 28, 2024
c70a2bd
Adding a parser for connector and service names (#866)
joehan Mar 5, 2024
5207a09
Merging master to pull in new linter rules
joehan Mar 6, 2024
7a465f4
update shrinkwrap
joehan Mar 6, 2024
ec19e79
Rename instance
rrousselGit Mar 11, 2024
7b59c20
Update test
rrousselGit Mar 11, 2024
f4e5961
More test update
rrousselGit Mar 11, 2024
cce12bd
Update fishfood e2e
rrousselGit Mar 11, 2024
0cda5bc
Update e2e
rrousselGit Mar 11, 2024
b26bbaf
Fix emulator
rrousselGit Mar 11, 2024
69bd235
Fix console errors
rrousselGit Mar 11, 2024
5b50360
Fix path
rrousselGit Mar 11, 2024
d78a514
Fix test
rrousselGit Mar 11, 2024
3d7104a
Fix inquirer error
rrousselGit Mar 12, 2024
b9b3212
Merge pull request #880 from FirebasePrivate/rename-instance
hlshen Mar 12, 2024
effc5fe
Merge pull request #883 from FirebasePrivate/fix-inquirer
hlshen Mar 12, 2024
5209940
Rename folder
rrousselGit Mar 12, 2024
eb30ec9
Firemat > Data Connect
rrousselGit Mar 12, 2024
db97876
Merge branch 'launch.firemat-fishfood' of https://github.com/Firebase…
rrousselGit Mar 12, 2024
e1a0471
Merge pull request #884 from FirebasePrivate/rename-firemat
hlshen Mar 12, 2024
5297aea
webview id fix
hlshen Mar 12, 2024
6027d0c
Revert firemat.yaml > dataconnect.yaml for now
rrousselGit Mar 13, 2024
fc92a17
Format
rrousselGit Mar 13, 2024
dc0d1b1
Merge pull request #885 from FirebasePrivate/revert-config-rename
hlshen Mar 13, 2024
8e890d5
ignore wdio for vsix package
hlshen Mar 13, 2024
288d4ed
Add initial deploy flow
rrousselGit Mar 14, 2024
0a2eb0d
Add `dataconnect.list` command (#868)
joehan Mar 14, 2024
87f0538
Update queries.gql (#889)
tjlav5 Mar 15, 2024
8324ec5
Merge pull request #886 from FirebasePrivate/deploy-flow
hlshen Mar 15, 2024
529fb57
Fix config file
rrousselGit Mar 18, 2024
b283a09
Adding a basic cloudsqladmin client (#879)
joehan Mar 18, 2024
8e8fd28
Connect to CloudSQL as a builtin user or service account (#878)
joehan Mar 18, 2024
fdf5be5
Provision CloudSQL resources on init and deploy (#882)
joehan Mar 18, 2024
082c75c
Remove dependency on Option from readFirebaseJson (#893)
rrousselGit Mar 18, 2024
7abab8a
Update configs
rrousselGit Mar 18, 2024
569811b
Convert paths to absolute
rrousselGit Mar 18, 2024
d09aeb8
Fix path
rrousselGit Mar 18, 2024
9ef5b57
Fix move to connector
rrousselGit Mar 18, 2024
a392e83
location > source
rrousselGit Mar 18, 2024
03ea382
Cleanup
rrousselGit Mar 18, 2024
8dc8db8
Bump FDC emulator versions.
rosalyntan Mar 19, 2024
4062acc
In production, show connector ID
rrousselGit Mar 19, 2024
b2a029c
Kinda update tes
rrousselGit Mar 19, 2024
ca453b3
Fix FDC emulator absolute path.
rosalyntan Mar 19, 2024
f348682
Remove log import.
rosalyntan Mar 19, 2024
2fdc866
Lint.
rosalyntan Mar 19, 2024
22c8209
Merge pull request #895 from FirebasePrivate/rosalyntan.local
hlshen Mar 19, 2024
b691fe3
Merge pull request #894 from FirebasePrivate/update-configs
hlshen Mar 19, 2024
c771546
Fixing a bug from bugbash
joehan Mar 19, 2024
70b9571
Merge branch 'launch.firemat-fishfood' of github.com:FirebasePrivate/…
joehan Mar 19, 2024
8374c86
it builds now
joehan Mar 19, 2024
4ae3a5a
Pass the PG local connection string from an env variable to the emula…
rosalyntan Mar 19, 2024
3ad01f1
Add utils for getting services and connectors. Service file uses corr…
hlshen Mar 20, 2024
ef1a0a8
Separate utils file to file-utils and config
hlshen Mar 20, 2024
2c28c4a
Pass `local_connection_string` flag to emulator.
rosalyntan Mar 20, 2024
05758ac
Merge pull request #898 from FirebasePrivate/hlshen/prod
hlshen Mar 20, 2024
bb5a915
initial deploy commit
hlshen Mar 20, 2024
c222a9a
pass config options to deploy
hlshen Mar 20, 2024
67dc0cb
Update deploy to pick from services, then connectors
hlshen Mar 20, 2024
8bd285d
fix deploy
hlshen Mar 20, 2024
934aaa3
resolve comments
hlshen Mar 20, 2024
5705ee1
Merge pull request #899 from FirebasePrivate/hlshen/deploy
hlshen Mar 20, 2024
4f8e150
Default should be empty string.
rosalyntan Mar 20, 2024
a759398
Merge branch 'launch.firemat-fishfood' into rosalyntan.pg
rosalyntan Mar 20, 2024
ed810a3
Ran npm run generate:json-schema
rosalyntan Mar 20, 2024
2e43644
Bump emulator version.
rosalyntan Mar 20, 2024
6d40ea4
Implement dataconnect:sql:diff and dataconnect:sgl:migrate (#897)
joehan Mar 20, 2024
a753810
Run npm run generate:json-schema.
rosalyntan Mar 20, 2024
65d7c9e
Merge pull request #900 from FirebasePrivate/rosalyntan.bump
rosalyntan Mar 21, 2024
1b3606c
Merge branch 'launch.firemat-fishfood' into rosalyntan.pg
rosalyntan Mar 21, 2024
a39e0d2
Merge pull request #896 from FirebasePrivate/rosalyntan.pg
rosalyntan Mar 21, 2024
f3ceb11
Refactor "move to connector" to an assist
rrousselGit Mar 21, 2024
3e6145c
Merge pull request #901 from FirebasePrivate/move-connector
hlshen Mar 21, 2024
ab0ad19
initial stream compile errors implementation
hlshen Mar 21, 2024
7d0352b
Merge pull request #902 from FirebasePrivate/hlshen/stream
hlshen Mar 21, 2024
4b9eae4
Handle multiple connectors for moveToConnector
rrousselGit Mar 21, 2024
0c22d87
Merge pull request #904 from FirebasePrivate/multiple-service
hlshen Mar 21, 2024
4ca34ae
forgot to remove a test user
joehan Mar 21, 2024
fee9858
forgot to remove a test user
joehan Mar 21, 2024
3837ff6
fixing undefined access error
joehan Mar 21, 2024
a0820d3
Validate and patch existing Cloud SQL instances.
rosalyntan Mar 21, 2024
743a1d6
emulator bump
hlshen Mar 22, 2024
80469f0
Cleaning up and running a formatter.
rosalyntan Mar 23, 2024
82d44b1
npm run format
rosalyntan Mar 23, 2024
382bd09
One more lint error.
rosalyntan Mar 23, 2024
ba65114
Merge branch 'launch.firemat-fishfood' into rosalyntan.csql
rosalyntan Mar 23, 2024
5fad1c1
Linting one more time.
rosalyntan Mar 23, 2024
fa6dc06
Added support for connecting to cloudSQL using user accounts (#908)
joehan Mar 25, 2024
6e14546
Address review comments.
rosalyntan Mar 25, 2024
2be0e53
npm run lint:changed-files -- --fix
rosalyntan Mar 25, 2024
ff8f3dc
Merge pull request #906 from FirebasePrivate/rosalyntan.csql
rosalyntan Mar 25, 2024
2472f27
emulator bump
hlshen Mar 26, 2024
a031ffc
Merge branch 'master' into launch.firemat-fishfood
hlshen Mar 26, 2024
dbf8cc4
update api ver
hlshen Mar 26, 2024
d9d01fd
Re-add dataConnect specific api values as getters
hlshen Mar 26, 2024
0f6debf
Merge pull request #911 from FirebasePrivate/hlshen/alpha
hlshen Mar 26, 2024
1df38a6
Fix path typo (#913)
rrousselGit Mar 26, 2024
efb653e
Merge pull request #912 from FirebasePrivate/hlshen/fix-dc
hlshen Mar 26, 2024
3145c41
Fix sample project
rrousselGit Mar 26, 2024
9ef7e69
rename
rrousselGit Mar 26, 2024
d9fd545
Cleanup
rrousselGit Mar 26, 2024
d4e9747
Fix errors
rrousselGit Mar 26, 2024
f0534aa
Merge pull request #916 from FirebasePrivate/fix-e2e-project
hlshen Mar 26, 2024
723a215
Revamp side panel to include postgres setter
hlshen Mar 21, 2024
3b75aeb
update dc staging api
hlshen Mar 21, 2024
022ff9e
update staging url to use https
hlshen Mar 21, 2024
08b200d
ls package fixes
hlshen Mar 21, 2024
6c027fb
dataconnect api flag
hlshen Mar 21, 2024
75822fc
update vscode env vars
hlshen Mar 26, 2024
19e8a1a
cli update
hlshen Mar 26, 2024
c1ad0dd
Update src/utils.ts
hlshen Mar 26, 2024
062f388
Merge pull request #903 from FirebasePrivate/hlshen/fixes
hlshen Mar 26, 2024
88af8fc
Tweak datasource in dataconnect:list (#909)
joehan Mar 26, 2024
d65c4ee
format
joehan Mar 26, 2024
7b6ad69
Adding schema files for dataconnect.yaml and connector.yaml (#918)
joehan Mar 27, 2024
e40d7c9
Perform schema migration during deploy as well (#917)
joehan Mar 27, 2024
a538e72
Make serviceID optional, prompt for deleting services (#925)
joehan Mar 28, 2024
a59d8f3
Fix and refactor tests
rrousselGit Apr 2, 2024
222d085
Merge pull request #930 from FirebasePrivate/fix-tests
hlshen Apr 3, 2024
d61f3a0
Updating firebase.json to accept array of dataconnects (#931)
joehan Apr 4, 2024
f74e50b
Add localConectionString into .firebaserc (#929)
joehan Apr 4, 2024
04dda6b
dataconnect production api
hlshen Apr 4, 2024
db0a092
add missing files
hlshen Apr 4, 2024
449a2b2
change string concat
hlshen Apr 4, 2024
c4b2d8a
format
hlshen Apr 5, 2024
960b726
add language-service file
hlshen Apr 5, 2024
bc70bc1
fast fix for dataConnectSingle type
hlshen Apr 5, 2024
0ef63e6
typing fix for DataconnectMultiple
hlshen Apr 5, 2024
1ebf4ac
remove ui for adding psql conn string
hlshen Apr 5, 2024
eb8c054
Merge pull request #935 from FirebasePrivate/hlshen/psql
hlshen Apr 5, 2024
fe7cd39
address comments
hlshen Apr 8, 2024
911221b
Merge pull request #933 from FirebasePrivate/hlshen/api
hlshen Apr 8, 2024
c993f47
Bump FDC emulator version.
rosalyntan Apr 9, 2024
b71a5d6
Create CloudSQL instances with configuration needed for FDC free trial.
rosalyntan Apr 9, 2024
fe7931f
Merge pull request #937 from FirebasePrivate/rosalyntan.vbump
hlshen Apr 10, 2024
07098c7
Adding support for --only flags (#927)
joehan Apr 10, 2024
68086c4
deploy using a terminal
hlshen Apr 10, 2024
fcd7703
respond to comments
hlshen Apr 10, 2024
04c92e9
Remove backupConfiguration enablement, it already defaults to false.
rosalyntan Apr 10, 2024
391b57f
Merge pull request #938 from FirebasePrivate/rosalyntan.cloudsql
rosalyntan Apr 11, 2024
5b9f7ef
Merge pull request #939 from FirebasePrivate/hlshen/dep
hlshen Apr 12, 2024
c6e915a
Add `dataconnect:sdk:generate` command (#934)
joehan Apr 12, 2024
7de33f6
Remove "connect to instance" logic and show running emulators in the …
rrousselGit Apr 16, 2024
19a242f
Fixed package-lock and updated to use new emulator
maneesht Apr 16, 2024
0a98113
Refactor --force behavior match Freds proposal (#946)
joehan Apr 16, 2024
c15ed65
Update emulator
joehan Apr 17, 2024
77d9566
Add GraphQL.vscode-graphql-syntax as extension dependency (#948)
rrousselGit Apr 17, 2024
92f7151
Merge branch 'master' of https://github.com/FirebasePrivate/firebase-…
rrousselGit Apr 17, 2024
72d540a
Merge branch 'launch.firemat-fishfood' of https://github.com/Firebase…
rrousselGit Apr 17, 2024
06d1108
Remove duplicate
rrousselGit Apr 17, 2024
e30e135
Updating emulator
joehan Apr 17, 2024
5d8e88c
Correctly watch for dataconnect.yaml changes (#949)
rrousselGit Apr 18, 2024
24e28d1
Validate local schema and connectors together before deploy (#952)
joehan Apr 18, 2024
79fd2c5
Update FDC free trial tag per latest decision. (#953)
rosalyntan Apr 19, 2024
f3fa698
Merging in public master
joehan Apr 22, 2024
07378f6
Only one free trial per project, please. (#955)
joehan Apr 22, 2024
5a7bd42
Handle malformed dataconnect.yaml files (#950)
rrousselGit Apr 23, 2024
b5482a1
Show FDC views only if FDC is enabled
rrousselGit Apr 23, 2024
9ce3e41
Merge pull request #957 from FirebasePrivate/suggest-init
hlshen Apr 23, 2024
712e2b4
Merge branch 'master' into launch.firemat-fishfood
hlshen Apr 23, 2024
f511843
Enable Goole ML Integration if vector is used (#954)
joehan Apr 23, 2024
3558a38
Update FDC Deploy view (#958)
rrousselGit Apr 24, 2024
f5fa753
Starting point for piping logs to VSCode (#944)
joehan Apr 24, 2024
6663324
Bump emulator version. (#959)
rosalyntan Apr 24, 2024
eaccade
Add sslMode=disable to default local conn string (#960)
joehan Apr 24, 2024
534076b
Added simple smoke test for deploy --only dataconnect (#840)
joehan Apr 26, 2024
3838504
Merge branch 'master' into launch.dataconnect
joehan Apr 26, 2024
5857406
add deploy all
hlshen Apr 26, 2024
bc1f84d
address comments
hlshen Apr 26, 2024
5780633
Merge pull request #961 from FirebasePrivate/deploy
hlshen Apr 26, 2024
afefff3
Pass non demo- project id to emulator
hlshen Apr 26, 2024
05a5403
fix parse
hlshen Apr 26, 2024
d069eef
Merge pull request #962 from FirebasePrivate/vertex
hlshen Apr 26, 2024
5e8be0e
merging
joehan Apr 26, 2024
f8b6187
Adding shell:true to dataconnect emulator
joehan Apr 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.js
Expand Up @@ -130,5 +130,7 @@ module.exports = {
"src/emulator/auth/schema.ts",
// TODO(hsubox76): Set up a job to run eslint separately on vscode dir
"firebase-vscode/",
// If this is leftover from "clean-install.sh", don't lint it
"clean/**",
],
};
40 changes: 18 additions & 22 deletions firebase-vscode/.eslintrc.json
@@ -1,24 +1,20 @@
{
"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"
]
"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"]
}
3 changes: 2 additions & 1 deletion firebase-vscode/.gitignore
Expand Up @@ -4,4 +4,5 @@ dist/
resources/dist
.vscode-test
.wdio-vscode-service
logs
logs
!*.tgz
10 changes: 10 additions & 0 deletions firebase-vscode/.prettierignore
@@ -0,0 +1,10 @@
## The default
**/.git
**/.svn
**/.hg
**/node_modules

## The good stuff
dist
resources
package-lock.json
4 changes: 1 addition & 3 deletions firebase-vscode/.vscode/extensions.json
@@ -1,7 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
]
"recommendations": ["dbaeumer.vscode-eslint"]
}
12 changes: 3 additions & 9 deletions firebase-vscode/.vscode/launch.json
Expand Up @@ -9,12 +9,8 @@
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
},
{
Expand All @@ -25,9 +21,7 @@
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/dist/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/dist/test/**/*.js"
],
"outFiles": ["${workspaceFolder}/dist/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
Expand Down
5 changes: 4 additions & 1 deletion firebase-vscode/.vscodeignore
Expand Up @@ -17,4 +17,7 @@ webpack.*.js
../
*.zip
node_modules/
dist/test/
dist/test/
*.tgz
package-lock.json
.wdio-vscode-service/
28 changes: 28 additions & 0 deletions firebase-vscode/common/error.ts
@@ -0,0 +1,28 @@
/** An error thrown before the GraphQL operation could complete.
*
* This could include HTTP errors or JSON parsing errors.
*/
export class DataConnectError extends Error {
constructor(message: string, cause?: unknown) {
super(message, { cause });
}
}

/** Encode an error into a {@link SerializedError} */
export function toSerializedError(error: Error): SerializedError {
return {
name: error.name,
message: error.message,
stack: error.stack,
cause:
error.cause instanceof Error ? toSerializedError(error.cause) : undefined,
};
}

/** An error object that can be sent across webview boundaries */
export interface SerializedError {
name?: string;
message: string;
stack?: string;
cause?: SerializedError;
}
63 changes: 63 additions & 0 deletions firebase-vscode/common/graphql.ts
@@ -0,0 +1,63 @@
import { ExecutionResult, GraphQLError } from "graphql";

/** Asserts that an unknown object is a {@link ExecutionResult} */
export function assertExecutionResult(
response: any
): asserts response is ExecutionResult {
if (!response) {
throw new Error(`Expected ExecutionResult but got ${response}`);
}

const type = typeof response;
if (type !== "object") {
throw new Error(`Expected ExecutionResult but got ${type}`);
}

const { data, errors } = response;
if (!data && !errors) {
throw new Error(
`Expected ExecutionResult to have either "data" or "errors" set but none found`
);
}

if (errors) {
if (!Array.isArray(errors)) {
throw new Error(
`Expected errors to be an array but got ${typeof errors}`
);
}
for (const error of errors) {
assertGraphQLError(error);
}
}
}

export function isExecutionResult(response: any): response is ExecutionResult {
try {
assertExecutionResult(response);
return true;
} catch {
return false;
}
}

/** Asserts that an unknown object is a {@link GraphQLError} */
export function assertGraphQLError(
error: unknown
): asserts error is GraphQLError {
if (!error) {
throw new Error(`Expected GraphQLError but got ${error}`);
}

const type = typeof error;
if (type !== "object") {
throw new Error(`Expected GraphQLError but got ${type}`);
}

const { message } = error as GraphQLError;
if (typeof message !== "string") {
throw new Error(
`Expected GraphQLError to have "message" set but got ${typeof message}`
);
}
}
2 changes: 1 addition & 1 deletion firebase-vscode/common/messaging/broker.ts
Expand Up @@ -92,7 +92,7 @@ export function createBroker<
on<E extends keyof IncomingMessages>(
message: Extract<E, string>,
listener: (params: IncomingMessages[E]) => void
) {
): () => void {
return broker.addListener(message, listener);
},
delete(): void {
Expand Down
70 changes: 58 additions & 12 deletions firebase-vscode/common/messaging/protocol.ts
Expand Up @@ -8,6 +8,28 @@ import { User } from "../../../src/types/auth";
import { ServiceAccountUser } from "../types";
import { RCData } from "../../../src/rc";
import { EmulatorUiSelections, RunningEmulatorInfo } from "./types";
import { ExecutionResult } from "graphql";
import { SerializedError } from "../error";

export const DEFAULT_EMULATOR_UI_SELECTIONS: EmulatorUiSelections = {
projectId: "demo-something",
importStateFolderPath: "",
exportStateOnExit: false,
mode: "dataconnect",
debugLogging: false,
};

export enum UserMockKind {
ADMIN = "admin",
UNAUTHENTICATED = "unauthenticated",
AUTHENTICATED = "authenticated",
}
export type UserMock =
| { kind: UserMockKind.ADMIN | UserMockKind.UNAUTHENTICATED }
| {
kind: UserMockKind.AUTHENTICATED;
claims: string;
};

export interface WebviewToExtensionParamsMap {
/**
Expand All @@ -17,6 +39,13 @@ export interface WebviewToExtensionParamsMap {
addUser: {};
logout: { email: string };

/* Emulator panel requests */
getEmulatorUiSelections: void;
getEmulatorInfos: void;
updateEmulatorUiSelections: Partial<EmulatorUiSelections>;
/* Equivalent to the `firebase emulators:start` command.*/
launchEmulators: void;

/** Notify extension that current user has been changed in UI. */
requestChangeUser: { user: User | ServiceAccountUser };

Expand Down Expand Up @@ -64,27 +93,45 @@ export interface WebviewToExtensionParamsMap {
href: string;
};

/**
* Equivalent to the `firebase emulators:start` command.
*/
launchEmulators: {
emulatorUiSelections: EmulatorUiSelections;
};

/** Stops the emulators gracefully allowing for data export if required. */
stopEmulators: {};
stopEmulators: void;

selectEmulatorImportFolder: {};

definedDataConnectArgs: string;

/** Prompts the user to select a directory in which to place the quickstart */
chooseQuickstartDir: {};

notifyAuthUserMockChange: UserMock;

/** Deploy connectors/services to production */
"fdc.deploy": void;

/** Deploy all connectors/services to production */
"fdc.deploy-all": void;
}

export interface DataConnectResults {
query: string;
displayName: string;
results?: ExecutionResult | SerializedError;
args?: string;
}

export type ValueOrError<T> =
| { value: T; error: undefined }
| { error: string; value: undefined };

export interface ExtensionToWebviewParamsMap {
/** Triggered when the emulator UI/state changes */
notifyEmulatorUiSelectionsChanged: EmulatorUiSelections;
notifyEmulatorStateChanged: {
status: "running" | "stopped" | "starting" | "stopping";
infos: RunningEmulatorInfo | undefined;
};
notifyEmulatorImportFolder: { folder: string };

/** Triggered when new environment variables values are found. */
notifyEnv: { env: { isMonospace: boolean } };

Expand Down Expand Up @@ -136,10 +183,9 @@ export interface ExtensionToWebviewParamsMap {
*/
notifyPreviewChannelResponse: { id: string };

notifyEmulatorsStopped: {};
notifyEmulatorStartFailed: {};
notifyRunningEmulatorInfo: RunningEmulatorInfo;
notifyEmulatorImportFolder: { folder: string };
// data connect specific
notifyDataConnectResults: DataConnectResults;
notifyDataConnectRequiredArgs: { args: string[] };
}

export type MessageParamsMap =
Expand Down
2 changes: 1 addition & 1 deletion firebase-vscode/common/messaging/types.d.ts
Expand Up @@ -30,6 +30,6 @@ export interface EmulatorUiSelections {
firebaseJsonPath?: string;
importStateFolderPath?: string;
exportStateOnExit: boolean;
mode: "hosting" | "all";
mode: "hosting" | "all" | "dataconnect";
debugLogging: boolean;
}
4 changes: 2 additions & 2 deletions firebase-vscode/common/types.d.ts
@@ -1,8 +1,8 @@
export interface ServiceAccount {
user: ServiceAccountUser
user: ServiceAccountUser;
}

export interface ServiceAccountUser {
email: string;
type: 'service_account'
type: "service_account";
}
Binary file not shown.
Binary file not shown.