diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b18db1b88..bcade316d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,9 +1,10 @@ -# Description +### Description -### Contribution Checklist: +#### Contribution Checklist: +- [ ] **I've used AI significantly to create this pull request** - [ ] **The pull request only addresses one issue or adds one feature.** - [ ] **The pull request does not introduce any breaking changes** - [ ] **I have added screenshots or gifs to help explain the change if applicable.** @@ -12,6 +13,6 @@ Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests. -### Publishing to New Package Managers +#### Publishing to New Package Managers Please see [here](../publishing.md) for more information. diff --git a/.gitignore b/.gitignore index eb8f8e0fa..0ff231d00 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,10 @@ bruno.iml # Playwright /blob-report/ -# packages +# Development plan files +*.plan.md + +# packages dist packages/bruno-filestore/dist packages/bruno-requests/dist packages/bruno-schema-types/dist diff --git a/CODING_STANDARDS.md b/CODING_STANDARDS.md index ab0fe5445..400e8f51a 100644 --- a/CODING_STANDARDS.md +++ b/CODING_STANDARDS.md @@ -34,6 +34,40 @@ Remember, these rules are here to make our codebase harmonious. If something doesn't fit perfectly, let's chat about it. Happy coding! ๐Ÿš€ + +## Tests + +- Add tests for any new functionality or meaningful changes. If code is added, removed, or significantly modified, corresponding tests should be updated or created. + +- Prioritise high-value tests over maximum coverage. Focus on testing behaviour that is critical, complex, or likely to breakโ€”donโ€™t chase coverage numbers for their own sake. + +- Write behaviour-driven tests, not implementation-driven ones. Tests should validate real expected output and observable behaviour, not internal details or mocked-out logic unless absolutely necessary. + +- Minimise mocking unless it meaningfully increases clarity or isolates external dependencies. Prefer real flows where practical; only mock external services, slow systems, or non-deterministic behaviour. + +- Keep tests readable and maintainable. Optimise for clarity over cleverness. Name tests descriptively, keep setup minimal, and avoid unnecessary abstraction. + +- Aim for tests that fail usefully. When a test fails, it should clearly indicate what behaviour broke and why. + +- Cover both the โ€œhappy pathโ€ and the realistically problematic paths. Validate expected success behaviour, but also validate error handling, edge cases, and degraded-mode behaviour when appropriate. + +- Ensure tests are deterministic and reproducible. No randomness, timing dependencies, or environment-specific assumptions without explicit control. + +- Avoid overfitting tests to current behaviour if future flexibility matters. Only assert what needs to be true, not incidental details. + +- Use consistent patterns and helper utilities where they improve clarity. Prefer shared test utilities over copy-pasted setup code, but only when it actually reduces complexity. + +- Tests should be fast enough to run continuously. Avoid long-running operations unless absolutely necessary; prefer lightweight fixtures and isolated units. + + +## UI Specific instructions + +### React + +- Use styled component's theme prop to manage CSS colors and not CSS variables when in the context of a styled component or any react component using the styled component +- Styled Components are used as wrappers to define both self and children components style, tailwind classes are used specifically for layout based styles. +- Styled Component CSS might also change layout but tailwind classes shouldn't define colors. + ## Readability and Abstractions - Avoid abstractions unless the exact same code is being used in more than 3 places. diff --git a/eslint.config.js b/eslint.config.js index 523623f28..2ac40a269 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,6 +1,6 @@ // eslint.config.js -const { defineConfig } = require("eslint/config"); -const globals = require("globals"); +const { defineConfig } = require('eslint/config'); +const globals = require('globals'); const { fixupPluginRules } = require('@eslint/compat'); const eslintPluginDiff = require('eslint-plugin-diff'); @@ -11,6 +11,16 @@ const runESMImports = async () => { }; module.exports = runESMImports().then(() => defineConfig([ + // Global ignores - must be a standalone object with ONLY ignores + { + ignores: [ + '**/node_modules/**/*', + '**/dist/**/*', + '**/*.bru', + 'packages/bruno-js/src/sandbox/bundle-browser-rollup.js', + 'packages/bruno-app/public/static/**/*' + ] + }, { plugins: { 'diff': fixupPluginRules(eslintPluginDiff), @@ -34,13 +44,13 @@ module.exports = runESMImports().then(() => defineConfig([ 'packages/bruno-converters/**/*.js', 'packages/bruno-electron/**/*.js', 'packages/bruno-filestore/**/*.ts', + 'packages/bruno-schema-types/**/*.ts', 'packages/bruno-js/**/*.js', 'packages/bruno-lang/**/*.js', 'packages/bruno-requests/**/*.ts', 'packages/bruno-requests/**/*.js', 'packages/bruno-tests/**/*.{js,ts}' ], - processor: 'diff/diff', rules: { ...stylistic.configs.customize({ indent: 2, @@ -56,7 +66,7 @@ module.exports = runESMImports().then(() => defineConfig([ minElements: 2, consistent: true }], - '@stylistic/function-paren-newline': ['error', 'never'], + '@stylistic/function-paren-newline': ['off'], '@stylistic/array-bracket-spacing': ['error', 'never'], '@stylistic/arrow-spacing': ['error', { before: true, after: true }], '@stylistic/function-call-spacing': ['error', 'never'], @@ -64,12 +74,14 @@ module.exports = runESMImports().then(() => defineConfig([ '@stylistic/padding-line-between-statements': ['off'], '@stylistic/semi-style': ['error', 'last'], '@stylistic/max-len': ['off'], - '@stylistic/jsx-one-expression-per-line': ['off'] + '@stylistic/jsx-one-expression-per-line': ['off'], + '@stylistic/max-statements-per-line': ['off'], + '@stylistic/no-mixed-operators': ['off'] } }, { - files: ["packages/bruno-app/**/*.{js,jsx,ts}"], - ignores: ["**/*.config.js", "**/public/**/*"], + files: ['packages/bruno-app/**/*.{js,jsx,ts}'], + ignores: ['**/*.config.js', '**/public/**/*'], languageOptions: { globals: { ...globals.browser, @@ -82,114 +94,114 @@ module.exports = runESMImports().then(() => defineConfig([ }, parserOptions: { ecmaFeatures: { - jsx: true, - }, - }, + jsx: true + } + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { // It prevents lint errors when using CommonJS exports (module.exports) in Jest mocks. - files: ["packages/bruno-app/src/test-utils/mocks/codemirror.js"], + files: ['packages/bruno-app/src/test-utils/mocks/codemirror.js'], languageOptions: { globals: { ...globals.node, - ...globals.jest, - }, + ...globals.jest + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-cli/**/*.js"], - ignores: ["**/*.config.js"], + files: ['packages/bruno-cli/**/*.js'], + ignores: ['**/*.config.js'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, parserOptions: { - ecmaVersion: "latest" - }, + ecmaVersion: 'latest' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-common/**/*.ts"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-common/**/*.ts'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, - parser: require("@typescript-eslint/parser"), + parser: require('@typescript-eslint/parser'), parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - project: "./packages/bruno-common/tsconfig.json", - }, + ecmaVersion: 'latest', + sourceType: 'module', + project: './packages/bruno-common/tsconfig.json' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-converters/**/*.js"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-converters/**/*.js'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, + ecmaVersion: 'latest', + sourceType: 'module' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-electron/**/*.js"], - ignores: ["**/*.config.js", "**/web/**/*"], + files: ['packages/bruno-electron/**/*.js'], + ignores: ['**/*.config.js', '**/web/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, - }, + ...globals.jest + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-filestore/**/*.ts"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-filestore/**/*.ts'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, - parser: require("@typescript-eslint/parser"), + parser: require('@typescript-eslint/parser'), parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - project: "./packages/bruno-filestore/tsconfig.json", - }, + ecmaVersion: 'latest', + sourceType: 'module', + project: './packages/bruno-filestore/tsconfig.json' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-js/**/*.js"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-js/**/*.js'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, @@ -200,65 +212,65 @@ module.exports = runESMImports().then(() => defineConfig([ typeDetectGlobalObject: false }, parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, + ecmaVersion: 'latest', + sourceType: 'module' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-lang/**/*.js"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-lang/**/*.js'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, + ecmaVersion: 'latest', + sourceType: 'module' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-requests/**/*.ts"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-requests/**/*.ts'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, - parser: require("@typescript-eslint/parser"), + parser: require('@typescript-eslint/parser'), parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - project: "./packages/bruno-requests/tsconfig.json", - }, + ecmaVersion: 'latest', + sourceType: 'module', + project: './packages/bruno-requests/tsconfig.json' + } }, rules: { - "no-undef": "error", - }, + 'no-undef': 'error' + } }, { - files: ["packages/bruno-requests/**/*.js"], - ignores: ["**/*.config.js", "**/dist/**/*"], + files: ['packages/bruno-requests/**/*.js'], + ignores: ['**/*.config.js', '**/dist/**/*'], languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.jest }, parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, + ecmaVersion: 'latest', + sourceType: 'module' + } }, rules: { - "no-undef": "error", - }, - }, + 'no-undef': 'error' + } + } ])); diff --git a/package-lock.json b/package-lock.json index 80932bfc0..769d50f48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5078,6 +5078,98 @@ "jsep": "^0.4.0||^1.0.0" } }, + "node_modules/@lydell/node-pty": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lydell/node-pty/-/node-pty-1.1.0.tgz", + "integrity": "sha512-VDD8LtlMTOrPKWMXUAcB9+LTktzuunqrMwkYR1DMRBkS6LQrCt+0/Ws1o2rMml/n3guePpS7cxhHF7Nm5K4iMw==", + "license": "MIT", + "optionalDependencies": { + "@lydell/node-pty-darwin-arm64": "1.1.0", + "@lydell/node-pty-darwin-x64": "1.1.0", + "@lydell/node-pty-linux-arm64": "1.1.0", + "@lydell/node-pty-linux-x64": "1.1.0", + "@lydell/node-pty-win32-arm64": "1.1.0", + "@lydell/node-pty-win32-x64": "1.1.0" + } + }, + "node_modules/@lydell/node-pty-darwin-arm64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lydell/node-pty-darwin-arm64/-/node-pty-darwin-arm64-1.1.0.tgz", + "integrity": "sha512-7kFD+owAA61qmhJCtoMbqj3Uvff3YHDiU+4on5F2vQdcMI3MuwGi7dM6MkFG/yuzpw8LF2xULpL71tOPUfxs0w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@lydell/node-pty-darwin-x64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lydell/node-pty-darwin-x64/-/node-pty-darwin-x64-1.1.0.tgz", + "integrity": "sha512-XZdvqj5FjAMjH8bdp0YfaZjur5DrCIDD1VYiE9EkkYVMDQqRUPHYV3U8BVEQVT9hYfjmpr7dNaELF2KyISWSNA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@lydell/node-pty-linux-arm64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lydell/node-pty-linux-arm64/-/node-pty-linux-arm64-1.1.0.tgz", + "integrity": "sha512-yyDBmalCfHpLiQMT2zyLcqL2Fay4Xy7rIs8GH4dqKLnEviMvPGOK7LADVkKAsbsyXBSISL3Lt1m1MtxhPH6ckg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@lydell/node-pty-linux-x64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lydell/node-pty-linux-x64/-/node-pty-linux-x64-1.1.0.tgz", + "integrity": "sha512-NcNqRTD14QT+vXcEuqSSvmWY+0+WUBn2uRE8EN0zKtDpIEr9d+YiFj16Uqds6QfcLCHfZmC+Ls7YzwTaqDnanA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@lydell/node-pty-win32-arm64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lydell/node-pty-win32-arm64/-/node-pty-win32-arm64-1.1.0.tgz", + "integrity": "sha512-JOMbCou+0fA7d/m97faIIfIU0jOv8sn2OR7tI45u3AmldKoKoLP8zHY6SAvDDnI3fccO1R2HeR1doVjpS7HM0w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@lydell/node-pty-win32-x64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lydell/node-pty-win32-x64/-/node-pty-win32-x64-1.1.0.tgz", + "integrity": "sha512-3N56BZ+WDFnUMYRtsrr7Ky2mhWGl9xXcyqR6cexfuCqcz9RNWL+KoXRv/nZylY5dYaXkft4JaR1uVu+roiZDAw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@malept/flatpak-bundler": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@malept/flatpak-bundler/-/flatpak-bundler-0.4.0.tgz", @@ -9133,6 +9225,21 @@ "node": ">=10.0.0" } }, + "node_modules/@xterm/addon-fit": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.10.0.tgz", + "integrity": "sha512-UFYkDm4HUahf2lnEyHvio51TNGiLK66mqP2JoATy7hRZeXaGMRDr00JiSF7m63vR5WKATF605yEggJKsw0JpMQ==", + "license": "MIT", + "peerDependencies": { + "@xterm/xterm": "^5.0.0" + } + }, + "node_modules/@xterm/xterm": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz", + "integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==", + "license": "MIT" + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -26841,6 +26948,8 @@ "@usebruno/common": "0.1.0", "@usebruno/graphql-docs": "0.1.0", "@usebruno/schema": "0.7.0", + "@xterm/addon-fit": "^0.10.0", + "@xterm/xterm": "^5.5.0", "classnames": "^2.3.1", "codemirror": "5.65.2", "codemirror-graphql": "2.1.1", @@ -30234,6 +30343,7 @@ "@aws-sdk/credential-providers": "3.750.0", "@grpc/grpc-js": "^1.13.2", "@grpc/proto-loader": "^0.7.13", + "@lydell/node-pty": "^1.1.0", "@usebruno/common": "0.1.0", "@usebruno/converters": "^0.1.0", "@usebruno/filestore": "^0.1.0", diff --git a/packages/bruno-app/babel.config.js b/packages/bruno-app/babel.config.js index e04b84e5e..a3be21ad1 100644 --- a/packages/bruno-app/babel.config.js +++ b/packages/bruno-app/babel.config.js @@ -6,4 +6,4 @@ module.exports = { }] ], plugins: ['babel-plugin-styled-components'] -}; \ No newline at end of file +}; diff --git a/packages/bruno-app/jest.config.js b/packages/bruno-app/jest.config.js index fdab3f936..31cac61da 100644 --- a/packages/bruno-app/jest.config.js +++ b/packages/bruno-app/jest.config.js @@ -1,10 +1,10 @@ module.exports = { rootDir: '.', transform: { - '^.+\\.[jt]sx?$': 'babel-jest', + '^.+\\.[jt]sx?$': 'babel-jest' }, transformIgnorePatterns: [ - "/node_modules/(?!strip-json-comments|nanoid|xml-formatter)/", + '/node_modules/(?!strip-json-comments|nanoid|xml-formatter)/' ], moduleNameMapper: { '^assets/(.*)$': '/src/assets/$1', @@ -22,9 +22,9 @@ module.exports = { testEnvironment: 'jsdom', setupFilesAfterEnv: ['@testing-library/jest-dom'], setupFiles: [ - '/jest.setup.js', + '/jest.setup.js' ], testMatch: [ '/src/**/*.spec.[jt]s?(x)' ] -}; \ No newline at end of file +}; diff --git a/packages/bruno-app/package.json b/packages/bruno-app/package.json index 8353b6074..9def0c5dd 100644 --- a/packages/bruno-app/package.json +++ b/packages/bruno-app/package.json @@ -21,6 +21,8 @@ "@usebruno/common": "0.1.0", "@usebruno/graphql-docs": "0.1.0", "@usebruno/schema": "0.7.0", + "@xterm/addon-fit": "^0.10.0", + "@xterm/xterm": "^5.5.0", "classnames": "^2.3.1", "codemirror": "5.65.2", "codemirror-graphql": "2.1.1", diff --git a/packages/bruno-app/public/theme/dark.js b/packages/bruno-app/public/theme/dark.js index b34340c81..417e6714a 100644 --- a/packages/bruno-app/public/theme/dark.js +++ b/packages/bruno-app/public/theme/dark.js @@ -1,6 +1,6 @@ const darkTheme = { - brand: '#546de5', - text: 'rgb(52 52 52)', + 'brand': '#546de5', + 'text': 'rgb(52 52 52)', 'primary-text': '#ffffff', 'primary-theme': '#1e1e1e', 'secondary-text': '#929292', diff --git a/packages/bruno-app/public/theme/light.js b/packages/bruno-app/public/theme/light.js index 6ba048f6a..ea37ebdae 100644 --- a/packages/bruno-app/public/theme/light.js +++ b/packages/bruno-app/public/theme/light.js @@ -1,6 +1,6 @@ const lightTheme = { - brand: '#546de5', - text: 'rgb(52 52 52)', + 'brand': '#546de5', + 'text': 'rgb(52 52 52)', 'primary-text': 'rgb(52 52 52)', 'primary-theme': '#ffffff', 'secondary-text': '#929292', diff --git a/packages/bruno-app/src/components/BrunoSupport/index.js b/packages/bruno-app/src/components/BrunoSupport/index.js index 190ef6ef4..545e1c56a 100644 --- a/packages/bruno-app/src/components/BrunoSupport/index.js +++ b/packages/bruno-app/src/components/BrunoSupport/index.js @@ -6,7 +6,7 @@ import StyledWrapper from './StyledWrapper'; const BrunoSupport = ({ onClose }) => { return ( - +
diff --git a/packages/bruno-app/src/components/CodeEditor/index.js b/packages/bruno-app/src/components/CodeEditor/index.js index 9157fb00a..d139d1ec0 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.js +++ b/packages/bruno-app/src/components/CodeEditor/index.js @@ -105,7 +105,7 @@ export default class CodeEditor extends React.Component { }, 'Cmd-H': 'replace', 'Ctrl-H': 'replace', - Tab: function (cm) { + 'Tab': function (cm) { cm.getSelection().includes('\n') || editor.getLine(cm.getCursor().line) == cm.getSelection() ? cm.execCommand('indentMore') : cm.replaceSelection(' ', 'end'); @@ -151,7 +151,7 @@ export default class CodeEditor extends React.Component { } else if (this.props.mode == 'application/xml') { var doc = new DOMParser(); try { - //add header element and remove prefix namespaces for DOMParser + // add header element and remove prefix namespaces for DOMParser var dcm = doc.parseFromString( ' ' + internal.replace(/(?<=\<|<\/)\w+:/g, '') + '', 'application/xml' @@ -188,7 +188,7 @@ export default class CodeEditor extends React.Component { } return found; }); - + if (editor) { editor.setOption('lint', this.props.mode && editor.getValue().trim().length > 0 ? this.lintOptions : false); editor.on('change', this._onEdit); @@ -197,7 +197,7 @@ export default class CodeEditor extends React.Component { this.addOverlay(); const getAllVariablesHandler = () => getAllVariables(this.props.collection, this.props.item); - + // Setup AutoComplete Helper for all modes const autoCompleteOptions = { showHintsFor: this.props.showHintsFor, diff --git a/packages/bruno-app/src/components/CodeEditor/index.spec.js b/packages/bruno-app/src/components/CodeEditor/index.spec.js index 973a8d3a9..b745890c0 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.spec.js +++ b/packages/bruno-app/src/components/CodeEditor/index.spec.js @@ -10,10 +10,10 @@ jest.mock('codemirror', () => { const MOCK_THEME = { codemirror: { - bg: "#1e1e1e", - border: "#333", + bg: '#1e1e1e', + border: '#333' }, - textLink: "#007acc", + textLink: '#007acc' }; const setupEditorState = (editor, { value, cursorPosition }) => { @@ -27,8 +27,8 @@ const setupEditorState = (editor, { value, cursorPosition }) => { }); editor.state = { - completionActive: null, - } + completionActive: null + }; }; const setupEditorWithRef = () => { @@ -47,5 +47,5 @@ describe('CodeEditor', () => { jest.resetModules(); }); - it("add CodeEditor related tests here", () => {}); -}); \ No newline at end of file + it('add CodeEditor related tests here', () => {}); +}); diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/index.js index 2de1495c8..b2f70923f 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/index.js @@ -43,16 +43,16 @@ const ApiKeyAuth = ({ collection }) => { }; useEffect(() => { - !apikeyAuth?.placement && - dispatch( - updateCollectionAuth({ - mode: 'apikey', - collectionUid: collection.uid, - content: { - placement: 'header' - } - }) - ); + !apikeyAuth?.placement + && dispatch( + updateCollectionAuth({ + mode: 'apikey', + collectionUid: collection.uid, + content: { + placement: 'header' + } + }) + ); }, [apikeyAuth]); return ( diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js index f7bd8f0b1..781e9f477 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/index.js @@ -87,7 +87,7 @@ const AuthMode = ({ collection }) => { }} > NTLM Auth -
+
{ diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.js index 50e1bbbc6..a967ccb48 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/index.js @@ -9,13 +9,7 @@ import { updateCollectionAuth } from 'providers/ReduxStore/slices/collections'; import { saveCollectionSettings } from 'providers/ReduxStore/slices/collections/actions'; import StyledWrapper from './StyledWrapper'; - - - - const NTLMAuth = ({ collection }) => { - - const dispatch = useDispatch(); const { storedTheme } = useTheme(); @@ -25,7 +19,6 @@ const NTLMAuth = ({ collection }) => { const handleSave = () => dispatch(saveCollectionSettings(collection.uid)); - const handleUsernameChange = (username) => { dispatch( updateCollectionAuth({ @@ -67,10 +60,7 @@ const NTLMAuth = ({ collection }) => { } }) ); - }; - - - + }; return ( diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js index 2dfe54c44..da0f8a38d 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/index.js @@ -10,7 +10,7 @@ import OAuth2ClientCredentials from 'components/RequestPane/Auth/OAuth2/ClientCr import OAuth2Implicit from 'components/RequestPane/Auth/OAuth2/Implicit/index'; import GrantTypeSelector from 'components/RequestPane/Auth/OAuth2/GrantTypeSelector/index'; -const GrantTypeComponentMap = ({collection }) => { +const GrantTypeComponentMap = ({ collection }) => { const dispatch = useDispatch(); const save = () => { diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/index.js index af457e6f4..0e643c4e7 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/index.js @@ -13,7 +13,6 @@ import StyledWrapper from './StyledWrapper'; import OAuth2 from './OAuth2'; import NTLMAuth from './NTLMAuth'; - const Auth = ({ collection }) => { const authMode = collection.draft?.root ? get(collection, 'draft.root.request.auth.mode') : get(collection, 'root.request.auth.mode'); const dispatch = useDispatch(); @@ -36,7 +35,7 @@ const Auth = ({ collection }) => { } case 'ntlm': { return ; - } + } case 'oauth2': { return ; } diff --git a/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js b/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js index c1707801c..b871be3e3 100644 --- a/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js @@ -39,7 +39,7 @@ const ClientCertSettings = ({ collection }) => { domain: Yup.string() .required() .trim() - .test('not-empty-after-trim', 'Domain is required', value => value && value.trim().length > 0), + .test('not-empty-after-trim', 'Domain is required', (value) => value && value.trim().length > 0), type: Yup.string().required().oneOf(['cert', 'pfx']), certFilePath: Yup.string().when('type', { is: (type) => type == 'cert', @@ -151,22 +151,22 @@ const ClientCertSettings = ({ collection }) => { {!clientCertConfig.length ? 'No client certificates added' : clientCertConfig.map((clientCert, index) => ( -
  • -
    -
    - - {clientCert.domain} -
    -
    - - {clientCert.type === 'cert' ? clientCert.certFilePath : clientCert.pfxFilePath} -
    +
  • +
    +
    + + {clientCert.domain} +
    +
    + + {clientCert.type === 'cert' ? clientCert.certFilePath : clientCert.pfxFilePath} +
    -
    -
  • - ))} +
    + + ))}

    Add Client Certificate

    diff --git a/packages/bruno-app/src/components/CollectionSettings/Docs/index.js b/packages/bruno-app/src/components/CollectionSettings/Docs/index.js index 38d314de5..00e2271b0 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Docs/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Docs/index.js @@ -38,21 +38,21 @@ const Docs = ({ collection }) => { })) ); toggleViewMode(); - } + }; const onSave = () => { dispatch(saveCollectionSettings(collection.uid)); toggleViewMode(); - } + }; return ( -
    -
    +
    +
    Documentation
    -
    +
    {isEditing ? ( <>
    @@ -81,14 +81,13 @@ const Docs = ({ collection }) => { fontSize={get(preferences, 'font.codeFontSize')} /> ) : ( -
    -
    +
    +
    { - docs?.length > 0 ? - - : - - } + docs?.length > 0 + ? + : + }
    )} @@ -98,7 +97,6 @@ const Docs = ({ collection }) => { export default Docs; - const documentationPlaceholder = ` Welcome to your collection documentation! This space is designed to help you document your API collection effectively. diff --git a/packages/bruno-app/src/components/CollectionSettings/Headers/index.js b/packages/bruno-app/src/components/CollectionSettings/Headers/index.js index a03c93506..e0846dff5 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Headers/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Headers/index.js @@ -123,8 +123,7 @@ const Headers = ({ collection }) => { }, header, 'name' - ) - } + )} autocomplete={headerAutoCompleteList} collection={collection} /> @@ -143,8 +142,7 @@ const Headers = ({ collection }) => { }, header, 'value' - ) - } + )} collection={collection} autocomplete={MimeTypes} /> diff --git a/packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js b/packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js index 2a09512de..be15d598d 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js @@ -1,9 +1,9 @@ -import React from "react"; +import React from 'react'; import { getTotalRequestCountInCollection } from 'utils/collections/'; import { IconBox, IconFolder, IconWorld, IconApi, IconShare } from '@tabler/icons'; -import { areItemsLoading, getItemsLoadStats } from "utils/collections/index"; -import { useState } from "react"; -import ShareCollection from "components/ShareCollection/index"; +import { areItemsLoading, getItemsLoadStats } from 'utils/collections/index'; +import { useState } from 'react'; +import ShareCollection from 'components/ShareCollection/index'; const Info = ({ collection }) => { const totalRequestsInCollection = getTotalRequestCountInCollection(collection); @@ -11,10 +11,10 @@ const Info = ({ collection }) => { const isCollectionLoading = areItemsLoading(collection); const { loading: itemsLoadingCount, total: totalItems } = getItemsLoadStats(collection); const [showShareCollectionModal, toggleShowShareCollectionModal] = useState(false); - + const handleToggleShowShareCollectionModal = (value) => (e) => { toggleShowShareCollectionModal(value); - } + }; return (
    @@ -55,7 +55,7 @@ const Info = ({ collection }) => {
    Requests
    { - isCollectionLoading? `${totalItems - itemsLoadingCount} out of ${totalItems} requests in the collection loaded` : `${totalRequestsInCollection} request${totalRequestsInCollection !== 1 ? 's' : ''} in collection` + isCollectionLoading ? `${totalItems - itemsLoadingCount} out of ${totalItems} requests in the collection loaded` : `${totalRequestsInCollection} request${totalRequestsInCollection !== 1 ? 's' : ''} in collection` }
    @@ -79,4 +79,4 @@ const Info = ({ collection }) => { ); }; -export default Info; \ No newline at end of file +export default Info; diff --git a/packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js b/packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js index 4c7406580..d498ca451 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js @@ -1,7 +1,7 @@ import React from 'react'; -import { flattenItems } from "utils/collections"; +import { flattenItems } from 'utils/collections'; import { IconAlertTriangle } from '@tabler/icons'; -import StyledWrapper from "./StyledWrapper"; +import StyledWrapper from './StyledWrapper'; import { useDispatch, useSelector } from 'react-redux'; import { isItemARequest, itemIsOpenedInTabs } from 'utils/tabs/index'; import { getDefaultRequestPaneTab } from 'utils/collections/index'; @@ -12,13 +12,13 @@ const RequestsNotLoaded = ({ collection }) => { const dispatch = useDispatch(); const tabs = useSelector((state) => state.tabs.tabs); const flattenedItems = flattenItems(collection.items); - const itemsFailedLoading = flattenedItems?.filter(item => item?.partial && !item?.loading); + const itemsFailedLoading = flattenedItems?.filter((item) => item?.partial && !item?.loading); if (!itemsFailedLoading?.length) { return null; } - const handleRequestClick = (item) => e => { + const handleRequestClick = (item) => (e) => { e.preventDefault(); if (isItemARequest(item)) { dispatch(hideHomePage()); @@ -39,7 +39,7 @@ const RequestsNotLoaded = ({ collection }) => { ); return; } - } + }; return ( @@ -61,7 +61,7 @@ const RequestsNotLoaded = ({ collection }) => { {flattenedItems?.map((item, index) => ( item?.partial && !item?.loading ? ( - + {item?.pathname?.split(`${collection?.pathname}/`)?.[1]} diff --git a/packages/bruno-app/src/components/CollectionSettings/Overview/index.js b/packages/bruno-app/src/components/CollectionSettings/Overview/index.js index 9792c224c..806ac2a53 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Overview/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Overview/index.js @@ -1,8 +1,8 @@ -import StyledWrapper from "./StyledWrapper"; -import Docs from "../Docs"; -import Info from "./Info"; +import StyledWrapper from './StyledWrapper'; +import Docs from '../Docs'; +import Info from './Info'; import { IconBox } from '@tabler/icons'; -import RequestsNotLoaded from "./RequestsNotLoaded"; +import RequestsNotLoaded from './RequestsNotLoaded'; const Overview = ({ collection }) => { return ( @@ -22,6 +22,6 @@ const Overview = ({ collection }) => {
    ); -} +}; -export default Overview; \ No newline at end of file +export default Overview; diff --git a/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js b/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js index 039b2eab8..9b7f07073 100644 --- a/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js @@ -156,9 +156,9 @@ const ProxySettings = ({ collection }) => {
      -
    • global - use global proxy config
    • -
    • enabled - use collection proxy config
    • -
    • disable - disable proxy
    • +
    • global - use global proxy config
    • +
    • enabled - use collection proxy config
    • +
    • disable - disable proxy
    @@ -367,4 +367,4 @@ const ProxySettings = ({ collection }) => { ); }; -export default ProxySettings; \ No newline at end of file +export default ProxySettings; diff --git a/packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/index.js b/packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/index.js index e84ddc081..25136bfa3 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/index.js @@ -127,8 +127,7 @@ const VarsTable = ({ collection, vars, varType }) => { }, _var, 'value' - ) - } + )} collection={collection} /> diff --git a/packages/bruno-app/src/components/Cookies/ModifyCookieModal/index.js b/packages/bruno-app/src/components/Cookies/ModifyCookieModal/index.js index b35c360ee..a59e5ed9f 100644 --- a/packages/bruno-app/src/components/Cookies/ModifyCookieModal/index.js +++ b/packages/bruno-app/src/components/Cookies/ModifyCookieModal/index.js @@ -125,7 +125,7 @@ const ModifyCookieModal = ({ onClose, domain, cookie }) => { ); if (!isEmpty(validationErrors)) { - toast.error(Object.values(validationErrors).join("\n")); + toast.error(Object.values(validationErrors).join('\n')); return; } @@ -208,7 +208,7 @@ const ModifyCookieModal = ({ onClose, domain, cookie }) => { onClose={onClose} handleCancel={onClose} handleConfirm={onSubmit} - customHeader={ + customHeader={(

    {title}

    @@ -223,7 +223,7 @@ const ModifyCookieModal = ({ onClose, domain, cookie }) => {
    - } + )} >
    e.preventDefault()} className="px-2"> {isRawMode ? ( diff --git a/packages/bruno-app/src/components/Cookies/index.js b/packages/bruno-app/src/components/Cookies/index.js index b00bd5a48..c5138bcbb 100644 --- a/packages/bruno-app/src/components/Cookies/index.js +++ b/packages/bruno-app/src/components/Cookies/index.js @@ -72,7 +72,7 @@ const CollectionProperties = ({ onClose }) => { const [searchText, setSearchText] = useState(null); const handleAddCookie = (domain) => { - if(domain) setCurrentDomain(domain); + if (domain) setCurrentDomain(domain); setIsModifyCookieModalOpen(true); }; diff --git a/packages/bruno-app/src/components/Devtools/Console/DebugTab/StyledWrapper.js b/packages/bruno-app/src/components/Devtools/Console/DebugTab/StyledWrapper.js index e8e95b070..1180739fd 100644 --- a/packages/bruno-app/src/components/Devtools/Console/DebugTab/StyledWrapper.js +++ b/packages/bruno-app/src/components/Devtools/Console/DebugTab/StyledWrapper.js @@ -160,4 +160,4 @@ const StyledWrapper = styled.div` } `; -export default StyledWrapper; \ No newline at end of file +export default StyledWrapper; diff --git a/packages/bruno-app/src/components/Devtools/Console/DebugTab/index.js b/packages/bruno-app/src/components/Devtools/Console/DebugTab/index.js index 1faa14ec7..a5810e3bc 100644 --- a/packages/bruno-app/src/components/Devtools/Console/DebugTab/index.js +++ b/packages/bruno-app/src/components/Devtools/Console/DebugTab/index.js @@ -1,7 +1,7 @@ import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { IconBug } from '@tabler/icons'; -import { +import { setSelectedError, clearDebugErrors } from 'providers/ReduxStore/slices/logs'; @@ -10,10 +10,10 @@ import StyledWrapper from './StyledWrapper'; const ErrorRow = ({ error, isSelected, onClick }) => { const formatTime = (timestamp) => { const date = new Date(timestamp); - return date.toLocaleTimeString('en-US', { - hour12: false, - hour: '2-digit', - minute: '2-digit', + return date.toLocaleTimeString('en-US', { + hour12: false, + hour: '2-digit', + minute: '2-digit', second: '2-digit', fractionalSecondDigits: 3 }); @@ -38,18 +38,18 @@ const ErrorRow = ({ error, isSelected, onClick }) => { }; return ( -
    {getShortMessage(error.message)}
    - +
    {getLocation(error)}
    - +
    {formatTime(error.timestamp)}
    @@ -59,7 +59,7 @@ const ErrorRow = ({ error, isSelected, onClick }) => { const DebugTab = () => { const dispatch = useDispatch(); - const { debugErrors, selectedError } = useSelector(state => state.logs); + const { debugErrors, selectedError } = useSelector((state) => state.logs); const handleErrorClick = (error) => { dispatch(setSelectedError(error)); @@ -85,7 +85,7 @@ const DebugTab = () => {
    Location
    Time
    - +
    {debugErrors.map((error, index) => ( { ); }; -export default DebugTab; \ No newline at end of file +export default DebugTab; diff --git a/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/StyledWrapper.js b/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/StyledWrapper.js index c7d4360ac..09299b0df 100644 --- a/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/StyledWrapper.js +++ b/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/StyledWrapper.js @@ -225,4 +225,4 @@ const StyledWrapper = styled.div` } `; -export default StyledWrapper; \ No newline at end of file +export default StyledWrapper; diff --git a/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/index.js b/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/index.js index 91499b4a3..e4017f10d 100644 --- a/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/index.js +++ b/packages/bruno-app/src/components/Devtools/Console/ErrorDetailsPanel/index.js @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { useSelector, useDispatch } from 'react-redux'; -import { +import { IconX, IconBug, IconFileText, @@ -15,7 +15,7 @@ import StyledWrapper from './StyledWrapper'; const ErrorInfoTab = ({ error }) => { const { version } = useApp(); - + const formatTimestamp = (timestamp) => { const date = new Date(timestamp); return date.toLocaleString(); @@ -23,7 +23,7 @@ const ErrorInfoTab = ({ error }) => { const generateGitHubIssueUrl = () => { const title = `Bug: ${error.message.substring(0, 50)}${error.message.length > 50 ? '...' : ''}`; - + const body = `## Bug Report ### Error Details @@ -66,7 +66,7 @@ ${error.args ? error.args.map((arg, index) => { const encodedTitle = encodeURIComponent(title); const encodedBody = encodeURIComponent(body); - + return `https://github.com/usebruno/bruno/issues/new?template=BLANK_ISSUE&title=${encodedTitle}&body=${encodedBody}`; }; @@ -84,33 +84,33 @@ ${error.args ? error.args.map((arg, index) => { {error.message || 'No message available'}
    - + {error.filename && (
    {error.filename}
    )} - + {error.lineno && (
    {error.lineno}{error.colno ? `:${error.colno}` : ''}
    )} - +
    {formatTimestamp(error.timestamp)}
    - +

    Report Issue

    Found a bug? Help us improve Bruno by reporting this error on GitHub.

    -
    - -
    - - - - - - + {isOpen && ( -
    +
    Filter by Method -
    - +
    - {Object.keys(filters).map(method => ( + {Object.keys(filters).map((method) => (