-
Notifications
You must be signed in to change notification settings - Fork 970
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/firebase/firebase-tools i…
…nto vscode-ci
- Loading branch information
Showing
279 changed files
with
18,146 additions
and
7,369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ dist/ | |
resources/dist | ||
.vscode-test | ||
.wdio-vscode-service | ||
logs | ||
logs | ||
!*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## The default | ||
**/.git | ||
**/.svn | ||
**/.hg | ||
**/node_modules | ||
|
||
## The good stuff | ||
dist | ||
resources | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,7 @@ webpack.*.js | |
../ | ||
*.zip | ||
node_modules/ | ||
dist/test/ | ||
dist/test/ | ||
*.tgz | ||
package-lock.json | ||
.wdio-vscode-service/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,12 @@ | ||
# firebase-vscode README | ||
# Firebase Extension | ||
|
||
This extension is in the development and exploration stage. | ||
VSCode extension for Firebase. The Firebase Extension currently supports the Data Connect product. | ||
|
||
## Running | ||
## Data Connect features | ||
|
||
1. In order to make sure f5 launches the extension properly, first open your | ||
VS Code session from the `firebase-vscode` subdirectory (not the `firebase-tools` directory). | ||
2. npm i (run this in both `firebase-tools` and `firebase-vscode`) | ||
3. Make sure the extension `amodio.tsl-problem-matcher` is installed - this | ||
enables the watcher to work, otherwise the Extension Development Host | ||
will not automatically open on F5 when the compilation is done. | ||
4. f5 to run opens new window | ||
f5 -> npm run watch defined in tasks.json | ||
My terminal didn't have npm available but yours might | ||
|
||
Workaround if f5 doesnt work: | ||
|
||
1. Execute `npm run watch` from within the vscode directory | ||
Aside: Running `npm run watch` or `npm run build` the extension is compiled into dist (extension.js) | ||
Changing code within extension is hot-reloaded | ||
Modifying extensions.js will not hot-reload | ||
source file src/extension.ts | ||
2. Wait for completion | ||
3. Hit play from the left nav | ||
|
||
New code changes are automatically rebuilt if you have `watch` running, however the new VSCode Plugin-enabled window will not reflect changes until reloaded. | ||
Manual reload from new window: "Developer: Reload Window" Default hotkey: cmd + R | ||
|
||
The communication between UI and extension done via the broker (see webview.postMessage) | ||
Web view uses react (carry-over from the hackweek project courtesy of Roman and Prakhar) | ||
|
||
## Structure | ||
|
||
Extention.ts main entry point, calls sidebar.ts and workflow.ts | ||
sidebar.ts loads the UI from the webviews folder | ||
workflow.ts is the driving component (logic source) | ||
cli.ts wraps CLI methods, importing from firebase-tools/src | ||
|
||
When workflow.ts needs to execute some CLI command, it defers to cli.ts | ||
|
||
## State | ||
|
||
currentOptions maintains the currentState of the plugin and is passed as a whole object to populate calls to the firebase-tools methods | ||
`prepare` in the command includes a lot of | ||
|
||
## Logic | ||
|
||
Calling firebase-tools in general follows the stuff: | ||
|
||
1. instead of calling `before`, call `requireAuth` instead | ||
requireAuth is a prerequisite for the plugin UI, needed | ||
Zero-state (before login) directs the user to sign in with google (using firebase-tools CLI) | ||
2. prepare is an implicit command in the cmd class | ||
3. action | ||
|
||
requireAuth -> login with service account or check that you're already logged in via firebase-tools | ||
|
||
## Open issues | ||
|
||
Login changes in the CLI are not immediately reflected in the Plugin, requires restart | ||
If logged-out in the middle of a plugin session, handle requireAuth errors gracefully | ||
Plugin startup is flaky sometimes | ||
Unit/Integration tests are not developed | ||
Code cleanliness/structure TODOs | ||
tsconfig.json's rootDirs includes ["src", "../src", "common"] which causes some issues with import autocomplete | ||
Three package.jsons - one for monospace and one for the standalone plugin, and then root to copy the correct version | ||
- Inline CodeLenses allow for one-click execution of operations | ||
- Pass in arguments | ||
- Impersonate user authentication | ||
- Generate queries and mutations from your schema with one click | ||
- Run against the emulator for offline development | ||
- Deploy and execute against production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# firebase-vscode README | ||
|
||
This extension is in the development and exploration stage. | ||
|
||
## Running | ||
|
||
1. In order to make sure f5 launches the extension properly, first open your | ||
VS Code session from the `firebase-vscode` subdirectory (not the `firebase-tools` directory). | ||
2. npm i (run this in both `firebase-tools` and `firebase-vscode`) | ||
3. Make sure the extension `amodio.tsl-problem-matcher` is installed - this | ||
enables the watcher to work, otherwise the Extension Development Host | ||
will not automatically open on F5 when the compilation is done. | ||
4. f5 to run opens new window | ||
f5 -> npm run watch defined in tasks.json | ||
My terminal didn't have npm available but yours might | ||
|
||
Workaround if f5 doesnt work: | ||
|
||
1. Execute `npm run watch` from within the vscode directory | ||
Aside: Running `npm run watch` or `npm run build` the extension is compiled into dist (extension.js) | ||
Changing code within extension is hot-reloaded | ||
Modifying extensions.js will not hot-reload | ||
source file src/extension.ts | ||
2. Wait for completion | ||
3. Hit play from the left nav | ||
|
||
New code changes are automatically rebuilt if you have `watch` running, however the new VSCode Plugin-enabled window will not reflect changes until reloaded. | ||
Manual reload from new window: "Developer: Reload Window" Default hotkey: cmd + R | ||
|
||
The communication between UI and extension done via the broker (see webview.postMessage) | ||
Web view uses react (carry-over from the hackweek project courtesy of Roman and Prakhar) | ||
|
||
## Structure | ||
|
||
Extention.ts main entry point, calls sidebar.ts and workflow.ts | ||
sidebar.ts loads the UI from the webviews folder | ||
workflow.ts is the driving component (logic source) | ||
cli.ts wraps CLI methods, importing from firebase-tools/src | ||
|
||
When workflow.ts needs to execute some CLI command, it defers to cli.ts | ||
|
||
## State | ||
|
||
currentOptions maintains the currentState of the plugin and is passed as a whole object to populate calls to the firebase-tools methods | ||
`prepare` in the command includes a lot of | ||
|
||
## Logic | ||
|
||
Calling firebase-tools in general follows the stuff: | ||
|
||
1. instead of calling `before`, call `requireAuth` instead | ||
requireAuth is a prerequisite for the plugin UI, needed | ||
Zero-state (before login) directs the user to sign in with google (using firebase-tools CLI) | ||
2. prepare is an implicit command in the cmd class | ||
3. action | ||
|
||
requireAuth -> login with service account or check that you're already logged in via firebase-tools | ||
|
||
## Open issues | ||
|
||
Login changes in the CLI are not immediately reflected in the Plugin, requires restart | ||
If logged-out in the middle of a plugin session, handle requireAuth errors gracefully | ||
Plugin startup is flaky sometimes | ||
Unit/Integration tests are not developed | ||
Code cleanliness/structure TODOs | ||
tsconfig.json's rootDirs includes ["src", "../src", "common"] which causes some issues with import autocomplete | ||
Three package.jsons - one for monospace and one for the standalone plugin, and then root to copy the correct version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
Oops, something went wrong.