├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .npmrc ├── .nvmrc ├── .prettierrc ├── .vscode ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── .vscodeignore ├── LICENSE ├── README.md ├── build ├── configs │ ├── webpack.common.ts │ ├── webpack.dev.ts │ └── webpack.prod.ts ├── index.ts ├── tsconfig.json └── typings │ └── index.d.ts ├── images ├── config_output.png ├── icon.png ├── logo.png ├── reVerbLogo.png ├── rightClick.png └── sidebar.png ├── media ├── OpenWebview.gif ├── QuickQuery.gif ├── inlineResponse.png ├── parseServer.gif ├── testEndpoint.png └── webviewQuery.gif ├── package.json ├── pull_request_template.md ├── resources ├── dark │ ├── DELETE.svg │ ├── GET.svg │ ├── POST.svg │ ├── PUT.svg │ ├── arrow.svg │ ├── axios.svg │ ├── boolean.svg │ ├── dependency.svg │ ├── document.svg │ ├── edit.svg │ ├── folder.svg │ ├── gutter.svg │ ├── http.svg │ ├── number.svg │ ├── refresh.svg │ └── string.svg └── light │ ├── boolean.svg │ ├── dependency.svg │ ├── document.svg │ ├── edit.svg │ ├── folder.svg │ ├── number.svg │ ├── refresh.svg │ └── string.svg ├── reverb-vscode-webview ├── .babelrc ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .prettierrc ├── .vscode │ └── settings.json ├── .vscodeignore ├── config │ └── webpack.config.js ├── package.json ├── src │ ├── App.jsx │ ├── assets │ │ ├── axios.svg │ │ └── icon.png │ ├── components │ │ ├── InputCookies.jsx │ │ ├── InputData.jsx │ │ ├── InputHeaders.jsx │ │ ├── OutputHeader.jsx │ │ ├── Params.jsx │ │ ├── Select.jsx │ │ ├── Settings.jsx │ │ ├── Welcome.jsx │ │ ├── outputTabs │ │ │ ├── HeaderTab.jsx │ │ │ ├── InfoTab.jsx │ │ │ ├── OutputTabs.jsx │ │ │ ├── ResponseTab.jsx │ │ │ └── WatchMainTab.jsx │ │ ├── select │ │ │ ├── SelectDomain.jsx │ │ │ └── SelectPreset.jsx │ │ └── settings │ │ │ ├── EraseStorage.jsx │ │ │ └── ParseForm.jsx │ ├── containers │ │ ├── Header.jsx │ │ ├── Input.jsx │ │ ├── Main.jsx │ │ ├── Output.jsx │ │ └── Sidebar.jsx │ ├── index.html │ ├── index.js │ ├── redux │ │ ├── reducers │ │ │ ├── inputStateSlice.js │ │ │ └── viewContextSlice.js │ │ └── store.js │ └── styles │ │ ├── _scaffolding.scss │ │ ├── _variables.scss │ │ ├── header.scss │ │ ├── index.scss │ │ ├── input.scss │ │ ├── main.scss │ │ ├── output.scss │ │ ├── settings.scss │ │ ├── sidebar.scss │ │ └── welcome.scss └── yarn.lock ├── src ├── commands.ts ├── constants │ ├── expressPatterns.ts │ └── serverTypes.ts ├── extension.ts ├── extensionVariables.ts ├── modules │ ├── Decorator.ts │ └── reverbTreeProvider.ts ├── parser │ ├── expressParser.ts │ └── utils │ │ ├── ast.ts │ │ ├── expressFileOps.ts │ │ ├── genericFileOps.ts │ │ └── serverPath.ts ├── tsconfig.json ├── typings │ ├── express.d.ts │ └── index.d.ts ├── utils │ └── utils.ts └── webview │ └── ReverbPanel.ts ├── test-fixture ├── index.ts └── package.json ├── test ├── runTests.ts ├── trout.test.ts └── tsconfig.json ├── tsconfig.base.json ├── tsconfig.eslint.json ├── tsconfig.test.json └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react"] 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 4 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | end_of_line = unset 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | out 4 | test-fixture/ 5 | .vscode-test/ 6 | reverb-vscode-webview -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | const OFF = 0; 2 | const WARN = 1; 3 | const ERROR = 2; 4 | 5 | module.exports = { 6 | root: true, 7 | env: { 8 | browser: true, 9 | es6: true, 10 | node: true, 11 | mocha: true, 12 | }, 13 | extends: [ 14 | 'airbnb-typescript/base', 15 | 'plugin:unicorn/recommended', 16 | 'prettier', 17 | 'prettier/@typescript-eslint', 18 | ], 19 | globals: { 20 | Atomics: 'readonly', 21 | SharedArrayBuffer: 'readonly', 22 | }, 23 | parser: '@typescript-eslint/parser', 24 | parserOptions: { 25 | ecmaVersion: 2020, 26 | sourceType: 'module', 27 | project: [ 28 | './tsconfig.eslint.json', 29 | './build/tsconfig.json', 30 | './src/tsconfig.json', 31 | './test/tsconfig.json', 32 | ], 33 | }, 34 | plugins: ['@typescript-eslint', 'unicorn'], 35 | settings: { 36 | 'import/resolver': { 37 | node: { 38 | extensions: ['.ts', '.js', '.json'], 39 | }, 40 | }, 41 | }, 42 | rules: { 43 | 'import/extensions': OFF, 44 | 'import/no-cycle': OFF, 45 | 'import/no-mutable-exports': OFF, 46 | 'import/no-unresolved': [WARN, { ignore: ['vscode'] }], 47 | 48 | '@typescript-eslint/explicit-function-return-type': OFF, 49 | '@typescript-eslint/no-explicit-any': OFF, 50 | '@typescript-eslint/no-non-null-assertion': OFF, 51 | '@typescript-eslint/naming-convention': OFF, 52 | '@typescript-eslint/no-unsafe-assignment': OFF, 53 | 54 | 'unicorn/consistent-function-scoping': OFF, 55 | 'unicorn/filename-case': [ 56 | ERROR, 57 | { 58 | cases: { 59 | camelCase: true, 60 | pascalCase: true, 61 | }, 62 | }, 63 | ], 64 | 'unicorn/import-style': OFF, 65 | 'unicorn/no-abusive-eslint-disable': OFF, 66 | 'unicorn/no-process-exit': OFF, 67 | 'unicorn/prevent-abbreviations': OFF, 68 | 'unicorn/no-useless-undefined': OFF, 69 | 'unicorn/no-reduce': OFF, 70 | 71 | 'func-names': OFF, 72 | 'no-bitwise': OFF, 73 | 'no-console': OFF, 74 | 'no-param-reassign': OFF, 75 | 'no-plusplus': OFF, 76 | 'no-unused-expressions': OFF, 77 | 'no-underscore-dangle': OFF, 78 | 'no-await-in-loop': OFF, 79 | 'no-restricted-syntax': OFF, 80 | }, 81 | overrides: [ 82 | { 83 | files: ['test/**/*.ts'], 84 | rules: { 85 | 'import/prefer-default-export': OFF, 86 | }, 87 | }, 88 | { 89 | files: ['build/**/*.ts'], 90 | rules: { 91 | 'import/no-extraneous-dependencies': OFF, 92 | }, 93 | }, 94 | ], 95 | }; 96 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # generated by yo code 2 | out 3 | .vscode-test/ 4 | *.vsix 5 | 6 | # Logs 7 | logs 8 | *.log 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | lerna-debug.log* 13 | 14 | # Diagnostic reports (https://nodejs.org/api/report.html) 15 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 16 | 17 | # Runtime data 18 | pids 19 | *.pid 20 | *.seed 21 | *.pid.lock 22 | 23 | # Directory for instrumented libs generated by jscoverage/JSCover 24 | lib-cov 25 | 26 | # Coverage directory used by tools like istanbul 27 | coverage 28 | *.lcov 29 | 30 | # nyc test coverage 31 | .nyc_output 32 | 33 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 34 | .grunt 35 | 36 | # Bower dependency directory (https://bower.io/) 37 | bower_components 38 | 39 | # node-waf configuration 40 | .lock-wscript 41 | 42 | # Compiled binary addons (https://nodejs.org/api/addons.html) 43 | build/Release 44 | 45 | # Dependency directories 46 | node_modules/ 47 | jspm_packages/ 48 | 49 | # TypeScript cache 50 | *.tsbuildinfo 51 | 52 | # Optional npm cache directory 53 | .npm 54 | 55 | # Optional eslint cache 56 | .eslintcache 57 | 58 | # Microbundle cache 59 | .rpt2_cache/ 60 | .rts2_cache_cjs/ 61 | .rts2_cache_es/ 62 | .rts2_cache_umd/ 63 | 64 | # Optional REPL history 65 | .node_repl_history 66 | 67 | # Output of 'npm pack' 68 | *.tgz 69 | 70 | # Yarn Integrity file 71 | .yarn-integrity 72 | 73 | # dotenv environment variables file 74 | .env 75 | .env.test 76 | 77 | # parcel-bundler cache (https://parceljs.org/) 78 | .cache 79 | 80 | # Next.js build output 81 | .next 82 | 83 | # Nuxt.js build / generate output 84 | .nuxt 85 | dist 86 | 87 | # Gatsby files 88 | .cache/ 89 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 90 | # https://nextjs.org/blog/next-9-1#public-directory-support 91 | # public 92 | 93 | # vuepress build output 94 | .vuepress/dist 95 | 96 | # Serverless directories 97 | .serverless/ 98 | 99 | # FuseBox cache 100 | .fusebox/ 101 | 102 | # DynamoDB Local files 103 | .dynamodb/ 104 | 105 | # TernJS port file 106 | .tern-port 107 | 108 | .vscode/* 109 | !.vscode/settings.json 110 | !.vscode/tasks.json 111 | !.vscode/launch.json 112 | !.vscode/extensions.json 113 | *.code-workspace 114 | 115 | # Windows thumbnail cache files 116 | Thumbs.db 117 | Thumbs.db:encryptable 118 | ehthumbs.db 119 | ehthumbs_vista.db 120 | 121 | # Dump file 122 | *.stackdump 123 | 124 | # Folder config file 125 | [Dd]esktop.ini 126 | 127 | # Recycle Bin used on file shares 128 | $RECYCLE.BIN/ 129 | 130 | # Windows Installer files 131 | *.cab 132 | *.msi 133 | *.msix 134 | *.msm 135 | *.msp 136 | 137 | # Windows shortcuts 138 | *.lnk 139 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict = true -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v14.15.1 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "tabWidth": 4, 4 | "semi": true, 5 | "singleQuote": true, 6 | "endOfLine": "auto", 7 | "printWidth": 100, 8 | "overrides": [ 9 | { 10 | "files": "*.md", 11 | "options": { 12 | "tabWidth": 2 13 | } 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "editorconfig.editorconfig", 4 | "dbaeumer.vscode-eslint", 5 | "esbenp.prettier-vscode" 6 | ], 7 | "unwantedRecommendations": [ 8 | "hookyqr.beautify", 9 | "ms-vscode.vscode-typescript-tslint-plugin", 10 | "dbaeumer.jshint" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "configurations": [ 4 | { 5 | "name": "dev", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "runtimeExecutable": "${execPath}", 9 | "args": ["--disable-extensions", "--extensionDevelopmentPath=${workspaceRoot}"], 10 | "stopOnEntry": false, 11 | "sourceMaps": true, 12 | "outFiles": ["${workspaceRoot}/out/**/*.js"], 13 | "preLaunchTask": "build" 14 | }, 15 | { 16 | "name": "test", 17 | "type": "extensionHost", 18 | "request": "launch", 19 | "runtimeExecutable": "${execPath}", 20 | "args": [ 21 | "--disable-extensions", 22 | "--extensionDevelopmentPath=${workspaceRoot}", 23 | "--extensionTestsPath=${workspaceFolder}/out/test/index" 24 | ], 25 | "stopOnEntry": false, 26 | "sourceMaps": true, 27 | "outFiles": ["${workspaceRoot}/out/test/**/*.js"], 28 | "preLaunchTask": "npm: test-compile" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "./node_modules/typescript/lib", 3 | "search.exclude": { 4 | "**/node_modules": true, 5 | "out": true, 6 | "test-fixture": true, 7 | ".vscode-test": true 8 | }, 9 | "files.watcherExclude": { 10 | "**/.git/objects/**": true, 11 | "**/.git/subtree-cache/**": true, 12 | "**/node_modules/**": true, 13 | "**/out/**": true, 14 | "**/test-fixture/**": true, 15 | "**/.vscode-test/**": true 16 | }, 17 | "[javascript]": { 18 | "editor.defaultFormatter": "esbenp.prettier-vscode" 19 | }, 20 | "[typescript]": { 21 | "editor.defaultFormatter": "esbenp.prettier-vscode" 22 | }, 23 | "[json]": { 24 | "editor.defaultFormatter": "esbenp.prettier-vscode" 25 | }, 26 | "[jsonc]": { 27 | "editor.defaultFormatter": "esbenp.prettier-vscode" 28 | }, 29 | "[markdown]": { 30 | "editor.defaultFormatter": "esbenp.prettier-vscode" 31 | }, 32 | "[yaml]": { 33 | "editor.defaultFormatter": "esbenp.prettier-vscode" 34 | }, 35 | "editor.codeActionsOnSave": { 36 | "source.fixAll.eslint": true 37 | }, 38 | "editor.formatOnSave": true, 39 | "liveServer.settings.port": 5501 40 | } 41 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "extension", 6 | "type": "npm", 7 | "script": "compile" 8 | }, 9 | { 10 | "label": "webview", 11 | "type": "npm", 12 | "script": "dev", 13 | "options": { 14 | "cwd": "./reverb-vscode-webview" 15 | } 16 | }, 17 | { 18 | "label": "build", 19 | "dependsOrder": "sequence", 20 | "dependsOn": ["extension", "webview"] 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | reverb-vscode-webview/ 3 | # develop 4 | .vscode/ 5 | typings/ 6 | configs/ 7 | scripts/ 8 | src/ 9 | 10 | # test and output 11 | .vscode-test/ 12 | test/ 13 | out/test/ 14 | test-fixture/ 15 | .nyc_output/ 16 | coverage/ 17 | build/ 18 | 19 | # configs 20 | .gitignore 21 | .vscodeignore 22 | tsconfig.json 23 | tsconfig.test.json 24 | .nvmrc 25 | .editorconfig 26 | .eslintrc.js 27 | .eslintignore 28 | .prettierrc 29 | yarn.lock 30 | 31 | !out/**/*.js 32 | !CHANGELOG.md 33 | !packages.json 34 | !images 35 | !README.md 36 | !icon.png 37 | !notes-usage 38 | !upgrade 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 OSLabs Beta 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## reVerb for Visual Studio Code [![Version](https://vsmarketplacebadge.apphb.com/version/reverb-api.reverb.svg)](https://marketplace.visualstudio.com/items?itemName=reverb-api.reverb) [![Installs](https://vsmarketplacebadge.apphb.com/installs-short/reverb-api.reverb.svg)](https://marketplace.visualstudio.com/items?itemName=reverb-api.reverb) [![vscodeVersion](https://img.shields.io/badge/vscode-%5E1.51.0-blue.svg)](https://marketplace.visualstudio.com/items?itemName=reverb-api.reverb) 2 | 3 | The reVerb extension is a RESTful api client for Visual Studio Code that offers an interactive GUI for testing Express endpoints, without ever having to leave the editor. 4 | 5 | Warning! reVerb is in pre-alpha. Please understand things may not always work as intended. 6 | You can always completely wipe all saved route data in settings > ERASE to start fresh. 7 | 8 | ![reVerb extension overview](media/OpenWebview.gif) 9 | ![reVerb extension overview](media/QuickQuery.gif) 10 | 11 | Full documentation is on the way! 12 | -------------------------------------------------------------------------------- /build/configs/webpack.common.ts: -------------------------------------------------------------------------------- 1 | import { resolve } from 'path'; 2 | import { Configuration } from 'webpack'; 3 | import WebpackBar from 'webpackbar'; 4 | import { CleanWebpackPlugin } from 'clean-webpack-plugin'; 5 | import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin'; 6 | 7 | const projectRoot = resolve(__dirname, '../../'); 8 | const commonWebpackConfig: Configuration = { 9 | target: 'node', 10 | entry: resolve(projectRoot, 'src/extension.ts'), 11 | output: { 12 | libraryTarget: 'commonjs2', 13 | path: resolve(projectRoot, 'out'), 14 | filename: 'extension.js', 15 | devtoolModuleFilenameTemplate: '../[resource-path]', 16 | }, 17 | resolve: { extensions: ['.ts', '.js'] }, 18 | externals: { 19 | vscode: 'commonjs vscode', 20 | }, 21 | module: { 22 | rules: [ 23 | { 24 | test: /\.ts$/, 25 | exclude: [/node_modules/, /reverb-vscode-webview/], 26 | loader: 'ts-loader', 27 | options: { 28 | configFile: resolve(projectRoot, 'src/tsconfig.json'), 29 | }, 30 | }, 31 | ], 32 | }, 33 | plugins: [ 34 | new WebpackBar({ 35 | name: 'VSCode extension', 36 | color: '#0066B8', 37 | }), 38 | new FriendlyErrorsPlugin(), 39 | new CleanWebpackPlugin(), 40 | ], 41 | }; 42 | 43 | export default commonWebpackConfig; 44 | -------------------------------------------------------------------------------- /build/configs/webpack.dev.ts: -------------------------------------------------------------------------------- 1 | import { Configuration } from 'webpack'; 2 | import { merge } from 'webpack-merge'; 3 | 4 | import commonWebpackConfig from './webpack.common'; 5 | 6 | const devWebpackConfiguration: Configuration = merge(commonWebpackConfig, { 7 | mode: 'development', 8 | devtool: 'source-map', 9 | }); 10 | 11 | export default devWebpackConfiguration; 12 | -------------------------------------------------------------------------------- /build/configs/webpack.prod.ts: -------------------------------------------------------------------------------- 1 | import { argv } from 'yargs'; 2 | import { Configuration } from 'webpack'; 3 | import { merge } from 'webpack-merge'; 4 | import TerserPlugin from 'terser-webpack-plugin'; 5 | import SpeedMeasurePlugin from 'speed-measure-webpack-plugin'; 6 | import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; 7 | 8 | import commonWebpackConfig from './webpack.common'; 9 | 10 | const mergedConfiguration: Configuration = merge(commonWebpackConfig, { 11 | mode: 'production', 12 | optimization: { 13 | minimize: true, 14 | minimizer: [ 15 | new TerserPlugin({ 16 | parallel: true, 17 | extractComments: false, 18 | }), 19 | ], 20 | }, 21 | }); 22 | 23 | // eslint-disable-next-line import/no-mutable-exports 24 | let prodWebpackConfiguration = mergedConfiguration; 25 | if (argv.analyze) { 26 | mergedConfiguration.plugins!.push(new BundleAnalyzerPlugin()); 27 | const smp = new SpeedMeasurePlugin(); 28 | prodWebpackConfiguration = smp.wrap(mergedConfiguration); 29 | } 30 | 31 | export default prodWebpackConfiguration; 32 | -------------------------------------------------------------------------------- /build/index.ts: -------------------------------------------------------------------------------- 1 | import webpack from 'webpack'; 2 | 3 | import devWebpackConfig from './configs/webpack.dev'; 4 | import prodWebpackConfig from './configs/webpack.prod'; 5 | 6 | const isProd = process.env.NODE_ENV !== 'development'; 7 | const compiler = webpack(isProd ? prodWebpackConfig : devWebpackConfig); 8 | 9 | compiler.run((error, stats) => { 10 | if (error) { 11 | console.error(error); 12 | return; 13 | } 14 | 15 | const prodStats = { 16 | preset: 'normal', 17 | colors: true, 18 | }; 19 | 20 | console.log(stats?.toString(isProd ? prodStats : 'minimal')); 21 | }); 22 | 23 | compiler.close((err) => { 24 | if (err) { 25 | console.error(err); 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /build/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /build/typings/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'speed-measure-webpack-plugin' { 2 | import { Configuration, Plugin } from 'webpack'; 3 | 4 | interface SpeedMeasurePluginOptions { 5 | disable: boolean; 6 | outputFormat: 'json' | 'human' | 'humanVerbose' | ((outputObj: object) => void); 7 | outputTarget: string | ((outputObj: string) => void); 8 | pluginNames: object; 9 | granularLoaderData: boolean; 10 | } 11 | 12 | class SpeedMeasurePlugin extends Plugin { 13 | constructor(options?: Partial); 14 | wrap(webpackConfig: Configuration): Configuration; 15 | } 16 | 17 | export = SpeedMeasurePlugin; 18 | } 19 | -------------------------------------------------------------------------------- /images/config_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/images/config_output.png -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/images/icon.png -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/images/logo.png -------------------------------------------------------------------------------- /images/reVerbLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/images/reVerbLogo.png -------------------------------------------------------------------------------- /images/rightClick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/images/rightClick.png -------------------------------------------------------------------------------- /images/sidebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/images/sidebar.png -------------------------------------------------------------------------------- /media/OpenWebview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/media/OpenWebview.gif -------------------------------------------------------------------------------- /media/QuickQuery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/media/QuickQuery.gif -------------------------------------------------------------------------------- /media/inlineResponse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/media/inlineResponse.png -------------------------------------------------------------------------------- /media/parseServer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/media/parseServer.gif -------------------------------------------------------------------------------- /media/testEndpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/media/testEndpoint.png -------------------------------------------------------------------------------- /media/webviewQuery.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/media/webviewQuery.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reverb", 3 | "displayName": " reVerb", 4 | "version": "0.0.8", 5 | "preview": true, 6 | "icon": "images/logo.png", 7 | "galleryBanner": { 8 | "color": "#0f2938", 9 | "theme": "dark" 10 | }, 11 | "description": "Its like Postman... but inside VSCode", 12 | "publisher": "reverb-api", 13 | "author": { 14 | "name": "Team reVerb", 15 | "url": "https://github.com/oslabs-beta/reverb-vscode-extension", 16 | "email": "reverb-api@protonmail.com" 17 | }, 18 | "license": "SEE LICENSE IN LICENSE", 19 | "homepage": "http://www.reverb-vs.com", 20 | "bugs": { 21 | "url": "https://github.com/oslabs-beta/reverb-vscode-extension/issues", 22 | "email": "reverb-api@protonmail.com" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "https://github.com/oslabs-beta/reverb-vscode-extension.git" 27 | }, 28 | "engines": { 29 | "vscode": "^1.51.0", 30 | "node": ">=14.14.0", 31 | "npm": "please-use-yarn", 32 | "yarn": ">= 1.19.1" 33 | }, 34 | "categories": [ 35 | "Debuggers", 36 | "Other" 37 | ], 38 | "keywords": [ 39 | "vscode", 40 | "vscode-extension", 41 | "reVerb", 42 | "rest" 43 | ], 44 | "main": "out/extension.js", 45 | "scripts": { 46 | "vscode:prepublish": "yarn build", 47 | "compile": "cross-env NODE_ENV=development ts-node-dev --files -P ./build/tsconfig.json ./build", 48 | "test-compile": "tsc -p ./test/tsconfig.json", 49 | "build": "cross-env NODE_ENV=production ts-node --files -P ./build/tsconfig.json ./build", 50 | "build-analyze": "yarn build --analyze", 51 | "lint": "eslint -c .eslintrc.js --ext .ts ./{build,src,test}/**/*.ts", 52 | "test": "yarn run test-compile && node ./out/test/runTests.js", 53 | "postinstall": "cd ./reverb-vscode-webview && yarn install" 54 | }, 55 | "activationEvents": [ 56 | "workspaceContains:**/*.js" 57 | ], 58 | "contributes": { 59 | "commands": [ 60 | { 61 | "command": "extension.savePreset", 62 | "title": "Saves preset to presets object" 63 | }, 64 | { 65 | "command": "extension.deletePreset", 66 | "title": "Deletes preset from presets object" 67 | }, 68 | { 69 | "command": "extension.parseServer", 70 | "title": "Parse server with supplied port and file path" 71 | }, 72 | { 73 | "command": "extension.validatePort", 74 | "title": "Checks if server is running on port" 75 | }, 76 | { 77 | "command": "extension.verboseRequest", 78 | "title": "Query given endpoint and return detailed response" 79 | }, 80 | { 81 | "command": "extension.openWebview", 82 | "title": "Open reVerb client" 83 | }, 84 | { 85 | "command": "extension.openTerminal", 86 | "title": "Open Terminal" 87 | }, 88 | { 89 | "command": "extension.openFileInEditor", 90 | "title": "Make file active in editor" 91 | }, 92 | { 93 | "command": "extension.wipeStorageObject", 94 | "title": "Delete Local Routes Storage" 95 | }, 96 | { 97 | "command": "extension.rightClickQuery", 98 | "title": "Quick Query " 99 | }, 100 | { 101 | "command": "paths.generateAxios", 102 | "title": "Generate Axios Request", 103 | "icon": { 104 | "light": "resources/light/edit.svg", 105 | "dark": "resources/dark/axios.svg" 106 | } 107 | }, 108 | { 109 | "command": "paths.simpleQuery", 110 | "title": "Send a simple query to this endpoint", 111 | "icon": { 112 | "light": "resources/light/edit.svg", 113 | "dark": "images/icon.png" 114 | } 115 | } 116 | ], 117 | "menus": { 118 | "editor/context": [ 119 | { 120 | "when": "editorTextFocus", 121 | "command": "extension.openWebview", 122 | "group": "navigation@1" 123 | }, 124 | { 125 | "when": "editorTextFocus", 126 | "command": "extension.rightClickQuery", 127 | "group": "navigation" 128 | } 129 | ], 130 | "view/title": [ 131 | { 132 | "command": "extension.openWebview", 133 | "group": "navigation", 134 | "when": "view == paths" 135 | } 136 | ], 137 | "view/item/context": [ 138 | { 139 | "command": "paths.generateAxios", 140 | "when": "viewItem == routeItem", 141 | "group": "inline" 142 | }, 143 | { 144 | "command": "paths.simpleQuery", 145 | "when": "viewItem == routeItem", 146 | "group": "inline@2" 147 | } 148 | ] 149 | }, 150 | "viewsContainers": { 151 | "activitybar": [ 152 | { 153 | "id": "reverb-explorer", 154 | "title": "reVerb", 155 | "icon": "images/icon.png" 156 | } 157 | ] 158 | }, 159 | "views": { 160 | "reverb-explorer": [ 161 | { 162 | "id": "paths", 163 | "name": "Control Panel", 164 | "contextualTitle": "Control Panel" 165 | } 166 | ] 167 | }, 168 | "viewsWelcome": [ 169 | { 170 | "view": "paths", 171 | "contents": "No Endpoints found. Search workspace for Endpoints?\n[Open Webview](command:extension.openWebview)" 172 | } 173 | ] 174 | }, 175 | "husky": { 176 | "hooks": { 177 | "pre-commit": "lint-staged" 178 | } 179 | }, 180 | "lint-staged": { 181 | "*.{ts}": [ 182 | "eslint -c .eslintrc" 183 | ], 184 | "*.{ts,json,md}": [ 185 | "prettier --write" 186 | ] 187 | }, 188 | "dependencies": { 189 | "@types/uuid": "^8.3.0", 190 | "@typescript-eslint/typescript-estree": "^4.9.0", 191 | "axios": "^0.21.0", 192 | "estree-walker": "^2.0.1", 193 | "find-process": "^1.4.4", 194 | "httpsnippet": "^1.24.0", 195 | "ts-node-dev": "^1.1.0", 196 | "uuid": "^8.3.2" 197 | }, 198 | "devDependencies": { 199 | "@types/friendly-errors-webpack-plugin": "^0.1.2", 200 | "@types/glob": "^7.1.1", 201 | "@types/mocha": "^8.0.4", 202 | "@types/node": "^14.14.10", 203 | "@types/terser-webpack-plugin": "^5.0.2", 204 | "@types/vscode": "1.51.0", 205 | "@types/webpack": "^4.41.25", 206 | "@types/webpack-bundle-analyzer": "^3.9.0", 207 | "@types/webpack-merge": "^4.1.5", 208 | "@types/webpackbar": "^4.0.0", 209 | "@types/yargs": "^15.0.10", 210 | "@typescript-eslint/eslint-plugin": "^4.8.2", 211 | "@typescript-eslint/parser": "^4.8.2", 212 | "clean-webpack-plugin": "^3.0.0", 213 | "cross-env": "^7.0.2", 214 | "eslint": "^7.14.0", 215 | "eslint-config-airbnb-base": "^14.2.1", 216 | "eslint-config-airbnb-typescript": "^12.0.0", 217 | "eslint-config-prettier": "^6.15.0", 218 | "eslint-plugin-import": "2.22.1", 219 | "eslint-plugin-jsx-a11y": "^6.4.1", 220 | "eslint-plugin-react": "^7.21.5", 221 | "eslint-plugin-react-hooks": "^4.2.0", 222 | "eslint-plugin-unicorn": "^23.0.0", 223 | "friendly-errors-webpack-plugin": "^1.7.0", 224 | "glob": "^7.1.5", 225 | "husky": "^4.3.0", 226 | "lint-staged": "^10.5.2", 227 | "mocha": "^8.2.1", 228 | "prettier": "^2.2.1", 229 | "speed-measure-webpack-plugin": "^1.3.3", 230 | "terser-webpack-plugin": "^5.0.3", 231 | "ts-loader": "^8.0.11", 232 | "ts-node": "^9.0.0", 233 | "typescript": "^4.1.2", 234 | "vscode-test": "^1.4.1", 235 | "webpack": "^5.9.0", 236 | "webpack-bundle-analyzer": "^4.1.0", 237 | "webpack-merge": "^5.4.0", 238 | "webpackbar": "^5.0.0-3", 239 | "yargs": "^16.1.1" 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Type of Change 2 | - [] Bugfix (non-breaking change that solves an issue) 3 | - [] New feature (non-breaking change that adds functionality) 4 | - [] Breaking change (change that is not backwards-compatible and/or changes current functionality) 5 | 6 | # Description of Changes 7 | 8 | # Screenshots 9 | 10 | # Checklist 11 | - [] I have ensured that my code follows the style guidelines of this project 12 | - [] I have ensured that my repo is up to date with the master branch 13 | - [] I have checked that there are no open pull requests that might conflict with mine 14 | - [] I have written new test cases for my core changes, as applicable 15 | - [] I have updated the Readme, as applicable -------------------------------------------------------------------------------- /resources/dark/DELETE.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | background 5 | 6 | 7 | 8 | Layer 1 9 | DEL 10 | 11 | -------------------------------------------------------------------------------- /resources/dark/GET.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | background 5 | 6 | 7 | 8 | Layer 1 9 | GET 10 | 11 | -------------------------------------------------------------------------------- /resources/dark/POST.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | background 5 | 6 | 7 | 8 | Layer 1 9 | POST 10 | 11 | -------------------------------------------------------------------------------- /resources/dark/PUT.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | background 5 | 6 | 7 | 8 | Layer 1 9 | PUT 10 | 11 | -------------------------------------------------------------------------------- /resources/dark/arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /resources/dark/axios.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/dark/boolean.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/dark/dependency.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/dark/document.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/dark/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/dark/folder.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/dark/gutter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | background 5 | 6 | 7 | 8 | 9 | 10 | 11 | Layer 1 12 | 13 | 14 | -------------------------------------------------------------------------------- /resources/dark/http.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 11 | 14 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /resources/dark/number.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/dark/refresh.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/dark/string.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/light/boolean.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/light/dependency.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/light/document.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/light/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/light/folder.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/light/number.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/light/refresh.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/light/string.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /reverb-vscode-webview/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react"], 3 | "plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime"] 4 | } 5 | -------------------------------------------------------------------------------- /reverb-vscode-webview/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | dist 4 | test-fixture/ 5 | .vscode-test/ 6 | -------------------------------------------------------------------------------- /reverb-vscode-webview/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "browser": true, 5 | "es6": true 6 | }, 7 | "extends": ["airbnb", "prettier", "prettier/react"], 8 | "globals": { 9 | "Atomics": "readonly", 10 | "SharedArrayBuffer": "readonly", 11 | "window": true, 12 | "document": true, 13 | "localStorage": true, 14 | "FormData": true, 15 | "FileReader": true, 16 | "Blob": true, 17 | "navigator": true 18 | }, 19 | "parser": "babel-eslint", 20 | "parserOptions": { 21 | "ecmaFeatures": { 22 | "jsx": true 23 | }, 24 | "ecmaVersion": 2020, 25 | "sourceType": "module" 26 | }, 27 | "plugins": ["react", "prettier", "react-hooks"], 28 | "rules": { 29 | "react-hooks/rules-of-hooks": "error", 30 | "react-hooks/exhaustive-deps": "warn", 31 | "react/jsx-filename-extension": [ 32 | 1, 33 | { 34 | "extensions": [".js", ".jsx"] 35 | } 36 | ], 37 | "import/imports-first": ["error", "absolute-first"], 38 | "import/newline-after-import": "error", 39 | "react/prop-types": 0, 40 | "no-console": 0 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /reverb-vscode-webview/.gitignore: -------------------------------------------------------------------------------- 1 | /dist/ 2 | /node_modules/ 3 | /.DS_Store -------------------------------------------------------------------------------- /reverb-vscode-webview/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 2, 4 | "semi": true, 5 | "singleQuote": true, 6 | "endOfLine": "auto", 7 | "printWidth": 100, 8 | "bracketSpacing": true, 9 | "jsxBracketSameLine": true 10 | 11 | } 12 | -------------------------------------------------------------------------------- /reverb-vscode-webview/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.fixAll.eslint": true 4 | }, 5 | "editor.formatOnSave": true 6 | } 7 | -------------------------------------------------------------------------------- /reverb-vscode-webview/.vscodeignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | reverb-vscode-webview/ 3 | # develop 4 | .vscode/ 5 | typings/ 6 | configs/ 7 | scripts/ 8 | src/ 9 | 10 | # test and output 11 | .vscode-test/ 12 | test/ 13 | out/test/ 14 | test-fixture/ 15 | .nyc_output/ 16 | coverage/ 17 | build/ 18 | 19 | # configs 20 | .gitignore 21 | .vscodeignore 22 | tsconfig.json 23 | tsconfig.test.json 24 | .nvmrc 25 | .editorconfig 26 | .eslintrc 27 | .eslintignore 28 | .prettierrc 29 | yarn.lock 30 | 31 | !out/**/*.js 32 | !CHANGELOG.md 33 | !packages.json 34 | !images/**/*.png 35 | !README.md 36 | !icon.png 37 | !notes-usage 38 | !upgrade 39 | -------------------------------------------------------------------------------- /reverb-vscode-webview/config/webpack.config.js: -------------------------------------------------------------------------------- 1 | const FileManagerPlugin = require('filemanager-webpack-plugin'); 2 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 3 | const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin'); 4 | const path = require('path'); 5 | 6 | module.exports = { 7 | entry: './src/index.js', 8 | output: { 9 | path: path.resolve(__dirname, '../dist'), 10 | filename: 'main.js', 11 | publicPath: '/', 12 | }, 13 | plugins: [ 14 | new HtmlWebpackInlineSourcePlugin(HtmlWebpackPlugin), 15 | new HtmlWebpackPlugin({ 16 | filename: 'index.html', 17 | inject: true, 18 | template: path.resolve(__dirname, '../src', 'index.html'), 19 | inlineSource: '.(js|css)$', 20 | }), 21 | new FileManagerPlugin({ 22 | events: { 23 | onEnd: { 24 | copy: [ 25 | { 26 | source: path.resolve(__dirname, '../dist/index.html'), 27 | destination: path.resolve(__dirname, '../../out/index.html'), 28 | }, 29 | ], 30 | }, 31 | }, 32 | }), 33 | ], 34 | resolve: { 35 | extensions: ['.js', '.jsx', '.scss'], 36 | }, 37 | module: { 38 | rules: [ 39 | { test: /\.jsx?$/, exclude: /node_modules/, use: ['babel-loader'] }, 40 | { 41 | test: /\.(scss|css)$/, 42 | use: ['style-loader', 'css-loader', 'sass-loader'], 43 | }, 44 | { 45 | test: /\.svg$/, 46 | use: [ 47 | { 48 | loader: 'babel-loader', 49 | }, 50 | { 51 | loader: 'react-svg-loader', 52 | options: { 53 | jsx: true, 54 | }, 55 | }, 56 | ], 57 | }, 58 | ], 59 | }, 60 | }; 61 | -------------------------------------------------------------------------------- /reverb-vscode-webview/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reverb-vscode-webview", 3 | "version": "1.0.0", 4 | "description": "Companion webview for reVerb", 5 | "main": "src/index.js", 6 | "scripts": { 7 | "dev": "cross-env NODE_ENV=development webpack --config config/webpack.config.js" 8 | }, 9 | "author": "Team reVerb", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@babel/plugin-transform-runtime": "^7.12.10", 13 | "@reduxjs/toolkit": "^1.5.0", 14 | "babel-eslint": "^10.1.0", 15 | "codemirror": "^5.58.3", 16 | "formik": "^2.2.6", 17 | "jsonlint-mod": "^1.7.6", 18 | "react": "^17.0.1", 19 | "react-codemirror2": "^7.2.1", 20 | "react-dom": "^17.0.1", 21 | "react-iframe": "^1.8.0", 22 | "react-redux": "^7.2.2", 23 | "react-svg-loader": "^3.0.3", 24 | "react-table": "^6.11.5", 25 | "redux": "^4.0.5" 26 | }, 27 | "devDependencies": { 28 | "@babel/cli": "^7.12.8", 29 | "@babel/core": "^7.12.9", 30 | "@babel/plugin-proposal-class-properties": "^7.12.1", 31 | "@babel/preset-env": "^7.12.7", 32 | "@babel/preset-react": "^7.12.7", 33 | "@types/codemirror": "0.0.102", 34 | "babel-loader": "^8.2.2", 35 | "copy-webpack-plugin": "^6.3.2", 36 | "cross-env": "^7.0.3", 37 | "css-loader": "^5.0.1", 38 | "eslint": "^7.15.0", 39 | "eslint-config-airbnb": "^18.2.1", 40 | "eslint-config-prettier": "^6.15.0", 41 | "eslint-plugin-import": "^2.22.1", 42 | "eslint-plugin-jsx-a11y": "^6.4.1", 43 | "eslint-plugin-prettier": "^3.2.0", 44 | "eslint-plugin-react": "^7.21.5", 45 | "eslint-plugin-react-hooks": "^4.2.0", 46 | "filemanager-webpack-plugin": "^3.0.0-beta.0", 47 | "html-webpack-inline-source-plugin": "^1.0.0-beta.2", 48 | "html-webpack-plugin": "^4.5.0", 49 | "node-sass": "^5.0.0", 50 | "prettier": "^2.2.1", 51 | "sass": "^1.29.0", 52 | "sass-loader": "^10.1.0", 53 | "style-loader": "^2.0.0", 54 | "webpack": "^5.9.0", 55 | "webpack-cli": "^4.2.0", 56 | "webpack-dev-server": "^3.11.0" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/App.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Main from './containers/Main'; 3 | import Output from './containers/Output'; 4 | import Welcome from './components/Welcome'; 5 | import { useDispatch, useSelector } from 'react-redux'; 6 | import { getMasterObject, loading } from './redux/reducers/inputStateSlice'; 7 | 8 | function App() { 9 | const _loading = useSelector(loading); 10 | const dispatch = useDispatch(); 11 | 12 | if (_loading === true) { 13 | dispatch(getMasterObject()); 14 | return ; 15 | } else { 16 | return ( 17 |
18 | 19 |
20 |
21 | ); 22 | } 23 | } 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/assets/axios.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 25 | 31 | 32 | 57 | 59 | 60 | 62 | image/svg+xml 63 | 65 | 66 | 67 | 68 | 69 | 74 | 76 | 78 | 82 | 87 | 88 | 91 | V 99 | 106 | 113 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oslabs-beta/reverb-vscode-extension/f7d446fa736ca5c69b1e9f1423ca13e1b321b9e7/reverb-vscode-webview/src/assets/icon.png -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/InputCookies.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module inputCookies.jsx 5 | * @author Amir Marcel, Christopher Johnson, Corey Van Splinter, Sean Arseneault 6 | * @date 12/23/2020 7 | * @description user input for cookie key/value pairs 8 | * 9 | * ************************************ 10 | */ 11 | 12 | import React from 'react'; 13 | import { useDispatch, useSelector } from 'react-redux'; 14 | import { Formik, Field, Form, FieldArray } from 'formik'; 15 | 16 | import { setCookieState, cookieState } from '../redux/reducers/inputStateSlice'; 17 | import { cookies } from '../redux/reducers/viewContextSlice'; 18 | 19 | function InputCookies() { 20 | const _cookieState = useSelector(cookieState); 21 | const cookiesView = useSelector(cookies); 22 | const dispatch = useDispatch(); 23 | 24 | return ( 25 | 26 | {({ values }) => ( 27 |
28 | 29 | {({ remove, push }) => ( 30 |
31 | {values.cookies.length > 0 && 32 | values.cookies.map((cookie, index) => ( 33 |
34 | { 40 | dispatch(setCookieState(values)); 41 | }} 42 | /> 43 | { 48 | dispatch(setCookieState(values)); 49 | }} 50 | /> 51 | 54 |
55 | ))} 56 | 57 |
58 | {/* these look like inputs but are buttons that add a new row of inputs above them when clicked */} 59 | push({ key: '', value: '' })} 64 | readOnly 65 | /> 66 | push({ key: '', value: '' })} 71 | readOnly 72 | /> 73 |
74 |
75 | )} 76 |
77 |
78 | )} 79 |
80 | ); 81 | } 82 | 83 | export default InputCookies; 84 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/InputData.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module inputData.jsx 5 | * @author Amir Marcel, Christopher Johnson, Corey Van Splinter, Sean Arseneault 6 | * @date 12/23/2020 7 | * @description user input for data/body 8 | * 9 | * ************************************ 10 | */ 11 | 12 | import React from 'react'; 13 | import { useDispatch, useSelector } from 'react-redux'; 14 | import { Controlled as CodeMirror } from 'react-codemirror2'; 15 | import 'codemirror/lib/codemirror.css'; 16 | import 'codemirror/theme/material.css'; 17 | import 'codemirror/addon/edit/closebrackets'; 18 | import 'codemirror/addon/edit/closetag'; 19 | import 'codemirror/addon/lint/lint'; 20 | import 'codemirror/addon/lint/json-lint'; 21 | import 'codemirror/addon/lint/lint.css'; 22 | const jsonlint = require('jsonlint-mod'); 23 | window.jsonlint = jsonlint; 24 | 25 | import { setDataState, dataState } from '../redux/reducers/inputStateSlice'; 26 | import { data } from '../redux/reducers/viewContextSlice'; 27 | 28 | function InputData() { 29 | const _dataState = useSelector(dataState); 30 | const dataView = useSelector(data); 31 | const dispatch = useDispatch(); 32 | 33 | return ( 34 |
35 | { 50 | ed.refresh(); 51 | }} 52 | onBeforeChange={(editor, data, value) => { 53 | dispatch(setDataState(value)); 54 | }} 55 | /> 56 |
57 | ); 58 | } 59 | 60 | export default InputData; 61 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/InputHeaders.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module inputHeaders.jsx 5 | * @author Amir Marcel, Christopher Johnson, Corey Van Splinter, Sean Arseneault 6 | * @date 12/23/2020 7 | * @description user input for header key/value pairs 8 | * 9 | * ************************************ 10 | */ 11 | 12 | import React from 'react'; 13 | import { useDispatch, useSelector } from 'react-redux'; 14 | import { Formik, Field, Form, FieldArray } from 'formik'; 15 | 16 | import { setHeaderState, headerState } from '../redux/reducers/inputStateSlice'; 17 | import { header } from '../redux/reducers/viewContextSlice'; 18 | 19 | function InputHeaders() { 20 | const _headerState = useSelector(headerState); 21 | const headersView = useSelector(header); 22 | const dispatch = useDispatch(); 23 | 24 | return ( 25 | 26 | {({ values }) => ( 27 |
28 | 29 | {({ remove, push }) => ( 30 |
31 | {values.headers.length > 0 && 32 | values.headers.map((header, index) => ( 33 |
34 | { 40 | dispatch(setHeaderState(values)); 41 | }} 42 | /> 43 | { 48 | dispatch(setHeaderState(values)); 49 | }} 50 | /> 51 | 54 |
55 | ))} 56 |
57 | {/* these look like inputs but are buttons that add a new row of inputs above them when clicked */} 58 | push({ key: '', value: '' })} 63 | readOnly 64 | /> 65 | push({ key: '', value: '' })} 70 | readOnly 71 | /> 72 |
73 |
74 | )} 75 |
76 |
77 | )} 78 |
79 | ); 80 | } 81 | 82 | export default InputHeaders; 83 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/OutputHeader.jsx: -------------------------------------------------------------------------------- 1 | /** 2 | * ************************************ 3 | * 4 | * @module outputHeader.jsx 5 | * @author Amir Marcel, Christopher Johnson, Corey Van Splinter, Sean Arseneault 6 | * @date 12/23/2020 7 | * @description renders output panel tabs and axios response metrics 8 | * 9 | * ************************************ 10 | */ 11 | 12 | import React from 'react'; 13 | import { useDispatch, useSelector } from 'react-redux'; 14 | 15 | import { setOutputTabContext, outputTabContext } from '../redux/reducers/viewContextSlice'; 16 | import { requestResult } from '../redux/reducers/inputStateSlice'; 17 | 18 | function OutputHeader() { 19 | const _outputTabContext = useSelector(outputTabContext); 20 | const _requestResult = useSelector(requestResult); 21 | 22 | const dispatch = useDispatch(); 23 | 24 | // sets background color based on status code 25 | function colorCode(x) { 26 | switch (true) { 27 | case x >= 100 && x < 200: 28 | return '#B4D5E0'; 29 | case x >= 200 && x < 300: 30 | return 'rgb(0, 99, 0)'; 31 | case x >= 300 && x < 400: 32 | return 'rgb(111, 0, 109)'; 33 | case x >= 400 && x < 500: 34 | return 'rgb(117, 37, 0)'; 35 | case x >= 500 && x < 600: 36 | return 'rgb(101, 84, 0)'; 37 | default: 38 | return 'var(--vscode-input-background)'; 39 | } 40 | } 41 | let size; 42 | if (_requestResult.headers) { 43 | size = _requestResult.headers['content-length']; 44 | } 45 | return ( 46 |
47 |
48 |
49 | 57 | 65 | {/* */} 71 |
72 | 73 |
74 | 75 | {_requestResult.status ? _requestResult.status : ' - '} 76 | 77 | 78 | {_requestResult.resTime === undefined ? ' - ' : `${_requestResult.resTime} ms`} 79 | 80 | {size === undefined ? ' - ' : `${size} b`} 81 |
82 | 83 | 96 |
97 |
98 | ); 99 | } 100 | 101 | export default OutputHeader; 102 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/Params.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react'; 2 | import { useDispatch, useSelector } from 'react-redux'; 3 | import { currentUrl, urls, currentMethod, setParamState } from '../redux/reducers/inputStateSlice'; 4 | 5 | import { params } from '../redux/reducers/viewContextSlice'; 6 | 7 | function Params() { 8 | const [paramsArray, setParamsArray] = useState([]); 9 | 10 | const _currentUrl = useSelector(currentUrl); 11 | const paramsView = useSelector(params); 12 | const dispatch = useDispatch(); 13 | 14 | useEffect(() => { 15 | if (_currentUrl === 'default') { 16 | setParamsArray([]); 17 | return; 18 | } 19 | setParamsArray( 20 | Object.keys(_currentUrl.params).map((param) => { 21 | return ( 22 |
23 | :{param} 24 | dispatch(setParamState({ name: param, value: e.target.value }))} 28 | /> 29 |
30 | ); 31 | }) 32 | ); 33 | }, [_currentUrl]); 34 | 35 | return ( 36 |
37 | {paramsArray} 38 |
39 | ); 40 | } 41 | 42 | export default Params; 43 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/Select.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useDispatch, useSelector } from 'react-redux'; 3 | 4 | import { makeRequest, waiting } from '../redux/reducers/inputStateSlice'; 5 | import SelectDomain from './select/SelectDomain'; 6 | import SelectPreset from './select/SelectPreset'; 7 | import Svg from '../assets/axios.svg'; 8 | 9 | function Select() { 10 | const dispatch = useDispatch(); 11 | const _waiting = useSelector(waiting); 12 | return ( 13 | <> 14 | 15 | dispatch(makeRequest())} 21 | /> 22 |
23 | 24 |
25 | 26 | 27 | ); 28 | } 29 | 30 | export default Select; 31 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/Settings.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useSelector } from 'react-redux'; 3 | 4 | import { settings } from '../redux/reducers/viewContextSlice'; 5 | import EraseStorage from './settings/EraseStorage'; 6 | import ParseForm from './settings/ParseForm'; 7 | 8 | function Settings() { 9 | const settingsView = useSelector(settings); 10 | 11 | return ( 12 | settingsView && ( 13 |
14 | 15 | 16 |
17 | ) 18 | ); 19 | } 20 | 21 | export default Settings; 22 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/Welcome.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ParseForm from './settings/ParseForm'; 3 | 4 | function Welcome() { 5 | return ( 6 |
7 |

8 | Welcome to re 9 | V 10 | erb! 11 |

12 | 13 |

Before reVerb can do its thing, we need the following from you:

14 |
    15 |
  • ensure the server you will be testing is running
  • 16 |
  • select your primary server file from the dropdown
  • 17 |
  • enter the port number the server is listening on
  • 18 |
  • press confirm!
  • 19 |
20 | 21 | 22 |
23 | ); 24 | } 25 | 26 | export default Welcome; 27 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/outputTabs/HeaderTab.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactTable from 'react-table'; 3 | import 'react-table/react-table.css'; 4 | 5 | import { useSelector } from 'react-redux'; 6 | import { requestResult } from '../../redux/reducers/inputStateSlice'; 7 | 8 | function HeaderTab() { 9 | const { headers } = useSelector(requestResult); 10 | let data; 11 | if (headers !== undefined && headers !== null) { 12 | data = Object.keys(headers).map((el) => { 13 | return { key: el, value: headers[el] }; 14 | }); 15 | } 16 | 17 | const columns = [ 18 | { minWidth: 150, maxWidth: 250, accessor: 'key' }, 19 | { 20 | accessor: 'value', 21 | }, 22 | ]; 23 | 24 | return ( 25 |
26 | 36 |
37 | ); 38 | } 39 | 40 | export default HeaderTab; 41 | -------------------------------------------------------------------------------- /reverb-vscode-webview/src/components/outputTabs/InfoTab.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Iframe from 'react-iframe'; 3 | import { useSelector } from 'react-redux'; 4 | import { requestResult } from '../../redux/reducers/inputStateSlice'; 5 | 6 | function InfoTab() { 7 | const _requestResult= useSelector(requestResult); 8 | 9 | return ( 10 |
11 |