diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 000000000..94eb553aa --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,66 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json + +language: 'en-US' +early_access: false +tone_instructions: 'You are an expert code reviewer in TypeScript, JavaScript, NodeJS, and ElectronJS. You work in an enterprise software developer team, providing concise and clear code review advice. You only elaborate or provide detailed explanations when requested.' + +knowledge_base: + opt_out: false + code_guidelines: + enabled: true + filePatterns: + - '**/CODING_STANDARDS.md' + +reviews: + profile: 'chill' + request_changes_workflow: false + high_level_summary: true + poem: true + review_status: true + collapse_walkthrough: false + auto_review: + enabled: true + drafts: false + base_branches: ['main', 'release/*'] + path_instructions: + - path: 'tests/**/**.*' + instructions: | + Review the following e2e test code written using the Playwright test library. Ensure that: + - Follow best practices for Playwright code and e2e automation + - Try to reduce usage of `page.waitForTimeout();` in code unless absolutely necessary and the locator cannot be found using existing `expect()` playwright calls + - Avoid using `page.pause()` in code + - Use locator variables for locators + - Avoid using test.only + - Use multiple assertions + - Promote the use of `test.step` as much as possible so the generated reports are easier to read + - Ensure that the `fixtures` like the collections are nested inside the `fixtures` folder + + + + **Fixture Example***: Here's an example of possible fixture and test pair + ``` + . + ├── fixtures + │ └── collection + │ ├── base.bru + │ ├── bruno.json + │ ├── collection.bru + │ ├── ws-test-request-with-headers.bru + │ ├── ws-test-request-with-subproto.bru + │ └── ws-test-request.bru + ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection + ├── headers.spec.ts + ├── persistence.spec.ts + ├── variable-interpolation + │ ├── fixtures + │ │ └── collection + │ │ ├── environments + │ │ ├── bruno.json + │ │ └── ws-interpolation-test.bru + │ ├── init-user-data + │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection + └── subproto.spec.ts + ``` + +chat: + auto_reply: true 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/.github/actions/common/setup-node-deps/action.yml b/.github/actions/common/setup-node-deps/action.yml index f99758768..66c32f298 100644 --- a/.github/actions/common/setup-node-deps/action.yml +++ b/.github/actions/common/setup-node-deps/action.yml @@ -23,4 +23,5 @@ runs: npm run sandbox:bundle-libraries --workspace=packages/bruno-js npm run build:bruno-converters npm run build:bruno-requests + npm run build:schema-types npm run build:bruno-filestore diff --git a/.github/workflows/npm-bru-cli.yml b/.github/workflows/npm-bru-cli.yml index 81771232a..1c323dd99 100644 --- a/.github/workflows/npm-bru-cli.yml +++ b/.github/workflows/npm-bru-cli.yml @@ -25,7 +25,7 @@ jobs: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-node@v5 with: node-version-file: '.nvmrc' @@ -40,7 +40,7 @@ jobs: run: | cd packages/bruno-tests/collection npm install - bru run --env Prod --output junit.xml --format junit + bru run --env Prod --output junit.xml --format junit --sandbox developer - name: Publish Test Report uses: dorny/test-reporter@v2 diff --git a/.github/workflows/ssl-tests.yml b/.github/workflows/ssl-tests.yml index ffda21137..d2d7ec7fb 100644 --- a/.github/workflows/ssl-tests.yml +++ b/.github/workflows/ssl-tests.yml @@ -15,7 +15,7 @@ jobs: pull-requests: write contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Setup Node Dependencies uses: ./.github/actions/common/setup-node-deps @@ -44,7 +44,7 @@ jobs: pull-requests: write contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Setup Node Dependencies uses: ./.github/actions/common/setup-node-deps @@ -73,7 +73,7 @@ jobs: pull-requests: write contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Setup Node Dependencies uses: ./.github/actions/common/setup-node-deps diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ffbe6df2f..833ceecff 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-node@v5 with: node-version-file: '.nvmrc' @@ -30,6 +30,7 @@ jobs: npm run sandbox:bundle-libraries --workspace=packages/bruno-js npm run build --workspace=packages/bruno-converters npm run build --workspace=packages/bruno-requests + npm run build --workspace=packages/bruno-schema-types npm run build --workspace=packages/bruno-filestore - name: Lint Check @@ -66,7 +67,7 @@ jobs: pull-requests: write contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-node@v5 with: node-version-file: '.nvmrc' @@ -83,6 +84,7 @@ jobs: npm run sandbox:bundle-libraries --workspace=packages/bruno-js npm run build --workspace=packages/bruno-converters npm run build --workspace=packages/bruno-requests + npm run build --workspace=packages/bruno-schema-types npm run build --workspace=packages/bruno-filestore - name: Run Local Testbench @@ -94,7 +96,7 @@ jobs: run: | cd packages/bruno-tests/collection npm install - node ../../bruno-cli/bin/bru.js run --env Prod --output junit.xml --format junit + node ../../bruno-cli/bin/bru.js run --env Prod --output junit.xml --format junit --sandbox developer - name: Publish Test Report uses: EnricoMi/publish-unit-test-result-action@v2 @@ -108,7 +110,7 @@ jobs: timeout-minutes: 60 runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-node@v5 with: node-version: v22.11.x @@ -134,12 +136,13 @@ jobs: npm run sandbox:bundle-libraries --workspace=packages/bruno-js npm run build:bruno-converters npm run build:bruno-requests + npm run build:schema-types npm run build:bruno-filestore - name: Run Playwright tests run: | xvfb-run npm run test:e2e - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 if: ${{ !cancelled() }} with: name: playwright-report diff --git a/.gitignore b/.gitignore index 9331b13ff..0ff231d00 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,12 @@ bruno.iml # Playwright /blob-report/ + +# Development plan files +*.plan.md + +# packages dist +packages/bruno-filestore/dist +packages/bruno-requests/dist +packages/bruno-schema-types/dist +packages/bruno-converters/dist diff --git a/CODING_STANDARDS.md b/CODING_STANDARDS.md new file mode 100644 index 000000000..400e8f51a --- /dev/null +++ b/CODING_STANDARDS.md @@ -0,0 +1,78 @@ +# Bruno Coding Standards + +- No diffs unless an actual change is made, the code changes need to be as minimal as possible, avoid making un-necessary whitespace diffs. This is already handled by eslint but make sure you check your code changes before commiting and raising a PR. + +## General Style Rules + +- Use 2 spaces for indentation. No tabs, just spaces – keeps everything neat and uniform. + +- Stick to single quotes for strings. Double quotes are cool elsewhere, but here we go single. + +- Always add semicolons at the end of statements. It's like putting a period at the end of a sentence – clarity matters. + +- JSX is enabled, so feel free to use it where it makes sense. + +## Punctuation and Spacing + +- No trailing commas. Keep it clean, no extra commas hanging around. + +- Always use parentheses around parameters in arrow functions. Even for single params – consistency is key. + +- For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline. + +- No newlines inside function parentheses. Keep 'em tight. + +- Space before and after the arrow in arrow functions. `() => {}` is good. + +- No space between function name and parentheses. `func()` not `func ()`. + +- Semicolons go at the end of the line, not on a new line. + +- No strict max length – write readable code, not cramped lines. + +- Multiple expressions per line in JSX are fine – flexibility is nice. + +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. +- Names for functions need to be concise and descriptive. +- Add in JSDoc comments to add more details to the abstractions if needed. +- Follow functional programming but just enough to be readable, we don't need to go as deep as ADTs and Monads, we want to keep the code pipeline obvious and easy for everyone to read and contribute to. +- Avoid single line abstractions where all that's being done is increasing the call stack with one additional function. +- Add in meaningful comments instead of obvious ones where complex code flow is explained properly. diff --git a/contributing.md b/contributing.md index 6206d59f5..988dcf36d 100644 --- a/contributing.md +++ b/contributing.md @@ -70,6 +70,7 @@ npm run build:bruno-query npm run build:bruno-common npm run build:bruno-converters npm run build:bruno-requests +npm run build:schema-types npm run build:bruno-filestore # bundle js sandbox libraries 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 decb6c7cc..769d50f48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "packages/bruno-common", "packages/bruno-converters", "packages/bruno-schema", + "packages/bruno-schema-types", "packages/bruno-query", "packages/bruno-js", "packages/bruno-lang", @@ -3554,6 +3555,16 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/@develar/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, "node_modules/@develar/schema-utils/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -3906,7 +3917,7 @@ "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, @@ -4469,9 +4480,9 @@ } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", "dev": true, "license": "MIT", "dependencies": { @@ -5067,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", @@ -5566,6 +5669,13 @@ "node": ">= 8" } }, + "node_modules/@opencollection/types": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@opencollection/types/-/types-0.1.0.tgz", + "integrity": "sha512-/v64ShE+KyDUAfAlO6Qd5wBwPArd603VC44eife/CdmrtPUSIiFBYcZ9gxAD7LlW99J36wb5IkMpKFDvViINiA==", + "dev": true, + "license": "MIT" + }, "node_modules/@parcel/watcher": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.0.tgz", @@ -6964,25 +7074,6 @@ "@rsbuild/core": "1.x" } }, - "node_modules/@rsbuild/plugin-sass/node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "node_modules/@rsbuild/plugin-sass/node_modules/postcss": { "version": "8.4.49", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", @@ -8232,12 +8323,6 @@ "@types/node": "*" } }, - "node_modules/@types/google-protobuf": { - "version": "3.15.12", - "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.15.12.tgz", - "integrity": "sha512-40um9QqwHjRS92qnOaDpL7RmDK15NuZYo9HihiJRbYkMQZlWnuH8AdvbMy8/o6lgLmKbDUKa+OALCltHdbOTpQ==", - "license": "MIT" - }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -8373,9 +8458,9 @@ "license": "MIT" }, "node_modules/@types/lodash": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.13.tgz", - "integrity": "sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==", "license": "MIT" }, "node_modules/@types/lodash-es": { @@ -8388,15 +8473,6 @@ "@types/lodash": "*" } }, - "node_modules/@types/lodash.set": { - "version": "4.3.9", - "resolved": "https://registry.npmjs.org/@types/lodash.set/-/lodash.set-4.3.9.tgz", - "integrity": "sha512-KOxyNkZpbaggVmqbpr82N2tDVTx05/3/j0f50Es1prxrWB0XYf9p3QNxqcbWb7P1Q9wlvsUSlCFnwlPCIJ46PQ==", - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, "node_modules/@types/markdown-it": { "version": "12.2.3", "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", @@ -8422,6 +8498,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/nanoid": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/nanoid/-/nanoid-2.1.0.tgz", + "integrity": "sha512-xdkn/oRTA0GSNPLIKZgHWqDTWZsVrieKomxJBOQUK9YDD+zfSgmwD5t4WJYra5S7XyhTw7tfvwznW+pFexaepQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { "version": "22.15.17", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.17.tgz", @@ -8858,6 +8943,10 @@ "resolved": "packages/bruno-schema", "link": true }, + "node_modules/@usebruno/schema-types": { + "resolved": "packages/bruno-schema-types", + "link": true + }, "node_modules/@usebruno/tests": { "resolved": "packages/bruno-tests", "link": true @@ -8866,22 +8955,6 @@ "resolved": "packages/bruno-toml", "link": true }, - "node_modules/@usebruno/vm2": { - "version": "3.9.19", - "resolved": "https://registry.npmjs.org/@usebruno/vm2/-/vm2-3.9.19.tgz", - "integrity": "sha512-WIrR9ODN2xkwUEoJb3awhCZO2dTgq8NWoObofAGuzFQOQ27rw96d2GJU/T8OKcygjfJiNei9nuqidyMh81kiug==", - "license": "MIT", - "dependencies": { - "acorn": "^8.7.0", - "acorn-walk": "^8.2.0" - }, - "bin": { - "vm2": "bin/vm2" - }, - "engines": { - "node": ">=6.0" - } - }, "node_modules/@web/rollup-plugin-copy": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/@web/rollup-plugin-copy/-/rollup-plugin-copy-0.5.1.tgz", @@ -9152,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", @@ -9224,6 +9312,7 @@ "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -9257,6 +9346,7 @@ "version": "8.3.4", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, "license": "MIT", "dependencies": { "acorn": "^8.11.0" @@ -9321,16 +9411,6 @@ } } }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, "node_modules/amdefine": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.0.8.tgz", @@ -11654,7 +11734,7 @@ "dependencies": { "env-paths": "^2.2.1", "import-fresh": "^3.3.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "parse-json": "^5.2.0" }, "engines": { @@ -15183,9 +15263,9 @@ } }, "node_modules/google-protobuf": { - "version": "3.21.4", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", - "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-4.0.0.tgz", + "integrity": "sha512-b8wmenhUMf2WNL+xIJ/slvD/hEE6V3nRnG86O2bzkBrMweM9gnqZE1dfXlDjibY3aXJXDNbAHepevYyQ7qWKsQ==", "license": "(BSD-3-Clause AND Apache-2.0)" }, "node_modules/gopd": { @@ -15312,20 +15392,18 @@ "node": ">= 6" } }, - "node_modules/grpc-reflection-js": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/grpc-reflection-js/-/grpc-reflection-js-0.3.0.tgz", - "integrity": "sha512-3lhTlQluPxVgbowCXA3tAZC3RJW+GSOUkguLNYl1QffYRiutUB3RDfPkQFTcrCFJgNiIIxx+iJkr8s3uSp3zWA==", + "node_modules/grpc-js-reflection-client": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/grpc-js-reflection-client/-/grpc-js-reflection-client-1.3.0.tgz", + "integrity": "sha512-eJ5/m1pXpcheSjOGExktU69WPUKnL4Su3IxGJYYYjy3/w19vE8dH7Wi46G5T92bpM0eZWftjiM5HduX8CjPq9w==", "license": "MIT", "dependencies": { - "@types/google-protobuf": "^3.7.2", - "@types/lodash.set": "^4.3.6", - "google-protobuf": "^3.12.2", - "lodash.set": "^4.3.2", - "protobufjs": "^7.2.2" + "@types/lodash": "^4.17.15", + "lodash": "^4.17.21", + "protobufjs": "^7.4.0" }, "peerDependencies": { - "@grpc/grpc-js": "^1.0.0" + "@grpc/grpc-js": "^1.12.6" } }, "node_modules/har-schema": { @@ -17804,9 +17882,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -18634,12 +18712,6 @@ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", "license": "MIT" }, - "node_modules/lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==", - "license": "MIT" - }, "node_modules/lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -19436,6 +19508,24 @@ "integrity": "sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==", "license": "MIT" }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/native-reg": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/native-reg/-/native-reg-1.1.1.tgz", @@ -21264,25 +21354,6 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "license": "MIT" }, - "node_modules/postcss/node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "node_modules/posthog-node": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-4.2.1.tgz", @@ -22291,7 +22362,7 @@ "config-file-ts": "^0.2.4", "dotenv": "^9.0.2", "dotenv-expand": "^5.1.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "json5": "^2.2.0", "lazy-val": "^1.0.4" }, @@ -23758,6 +23829,16 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, "node_modules/schema-utils/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -26867,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", @@ -26883,6 +26966,7 @@ "graphiql": "3.7.1", "graphql": "^16.6.0", "graphql-request": "^3.7.0", + "hexy": "^0.3.5", "httpsnippet": "^3.0.9", "i18next": "24.1.2", "idb": "^7.0.0", @@ -26893,6 +26977,7 @@ "jsonc-parser": "^3.2.1", "jsonpath-plus": "^10.3.0", "know-your-http-well": "^0.5.0", + "linkify-it": "^5.0.0", "lodash": "^4.17.21", "markdown-it": "^13.0.2", "markdown-it-replace-link": "^1.2.0", @@ -28442,6 +28527,15 @@ "node": ">=18.0.0" } }, + "packages/bruno-app/node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, "packages/bruno-app/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -28449,24 +28543,6 @@ "dev": true, "license": "MIT" }, - "packages/bruno-app/node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "packages/bruno-app/node_modules/semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", @@ -28490,6 +28566,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "packages/bruno-app/node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "license": "MIT" + }, "packages/bruno-app/node_modules/update-browserslist-db": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", @@ -28533,7 +28615,6 @@ "@usebruno/js": "0.12.0", "@usebruno/lang": "0.12.0", "@usebruno/requests": "^0.1.0", - "@usebruno/vm2": "^3.9.13", "aws4-axios": "^3.3.0", "axios": "^1.8.3", "axios-ntlm": "^1.4.2", @@ -28545,7 +28626,7 @@ "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", "iconv-lite": "^0.6.3", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "lodash": "^4.17.21", "qs": "^6.11.0", "socks-proxy-agent": "^8.0.2", @@ -30169,7 +30250,7 @@ "license": "MIT", "dependencies": { "@usebruno/schema": "^0.7.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "jscodeshift": "^17.3.0", "lodash": "^4.17.21", "nanoid": "3.3.8", @@ -30239,24 +30320,6 @@ "node": ">=16 || 14 >=14.17" } }, - "packages/bruno-converters/node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "packages/bruno-converters/node_modules/rimraf": { "version": "5.0.10", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", @@ -30280,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", @@ -30288,7 +30352,6 @@ "@usebruno/node-machine-id": "^2.0.0", "@usebruno/requests": "^0.1.0", "@usebruno/schema": "0.7.0", - "@usebruno/vm2": "^3.9.13", "about-window": "^1.15.2", "aws4-axios": "^3.3.0", "axios": "^1.8.3", @@ -30310,7 +30373,7 @@ "https-proxy-agent": "^7.0.2", "iconv-lite": "^0.6.3", "is-valid-path": "^0.1.1", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "lodash": "^4.17.21", "mime-types": "^2.1.35", "nanoid": "3.3.8", @@ -31550,7 +31613,7 @@ "hosted-git-info": "^4.1.0", "is-ci": "^3.0.0", "isbinaryfile": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "lazy-val": "^1.0.5", "minimatch": "^5.1.1", "read-config-file": "6.3.2", @@ -31597,7 +31660,7 @@ "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.1", "is-ci": "^3.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "source-map-support": "^0.5.19", "stat-mode": "^1.0.0", "temp-file": "^3.4.0" @@ -31728,7 +31791,7 @@ "builder-util-runtime": "9.2.4", "fs-extra": "^10.1.0", "iconv-lite": "^0.6.2", - "js-yaml": "^4.1.0" + "js-yaml": "^4.1.1" }, "optionalDependencies": { "dmg-license": "^1.0.11" @@ -31811,24 +31874,6 @@ "dev": true, "license": "MIT" }, - "packages/bruno-electron/node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "packages/bruno-electron/node_modules/semver": { "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", @@ -31858,20 +31903,27 @@ "version": "0.1.0", "license": "MIT", "dependencies": { + "@types/nanoid": "^2.1.0", "@usebruno/lang": "0.12.0", - "lodash": "^4.17.21" + "ajv": "^8.17.1", + "lodash": "^4.17.21", + "yaml": "^2.3.4" }, "devDependencies": { "@babel/preset-env": "^7.22.0", "@babel/preset-typescript": "^7.22.0", + "@opencollection/types": "0.1.0", "@rollup/plugin-commonjs": "^23.0.2", + "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.0.1", - "@rollup/plugin-typescript": "^9.0.2", + "@rollup/plugin-typescript": "^12.1.2", "@types/jest": "^29.5.11", "@types/lodash": "^4.14.191", "@types/node": "^24.1.0", + "@usebruno/schema-types": "0.0.1", "babel-jest": "^29.7.0", "jest": "^29.2.0", + "nanoid": "3.3.8", "rimraf": "^3.0.2", "rollup": "3.29.5", "rollup-plugin-dts": "^5.0.0", @@ -31880,6 +31932,33 @@ "typescript": "^4.8.4" } }, + "packages/bruno-filestore/node_modules/@rollup/plugin-typescript": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.3.0.tgz", + "integrity": "sha512-7DP0/p7y3t67+NabT9f8oTBFE6gGkto4SA6Np2oudYmZE/m1dt8RB0SjL1msMxFpLo631qjRCcBlAbq1ml/Big==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, "packages/bruno-filestore/node_modules/@types/node": { "version": "24.1.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", @@ -31960,6 +32039,18 @@ "dev": true, "license": "MIT" }, + "packages/bruno-filestore/node_modules/yaml": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", + "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, "packages/bruno-graphql-docs": { "name": "@usebruno/graphql-docs", "version": "0.1.0", @@ -32046,9 +32137,6 @@ "@rollup/plugin-node-resolve": "^15.0.1", "rollup": "3.29.5", "rollup-plugin-terser": "^7.0.2" - }, - "peerDependencies": { - "@usebruno/vm2": "^3.9.13" } }, "packages/bruno-js/node_modules/axios": { @@ -32062,24 +32150,6 @@ "proxy-from-env": "^1.1.0" } }, - "packages/bruno-js/node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "packages/bruno-js/node_modules/xml-formatter": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/xml-formatter/-/xml-formatter-3.5.0.tgz", @@ -32129,7 +32199,8 @@ "@types/qs": "^6.9.18", "axios": "^1.9.0", "debug": "^4.4.3", - "grpc-reflection-js": "^0.3.0", + "google-protobuf": "^4.0.0", + "grpc-js-reflection-client": "^1.3.0", "is-ip": "^5.0.1", "system-ca": "^2.0.1", "tough-cookie": "^6.0.0", @@ -32247,21 +32318,26 @@ "yup": "^0.32.11" } }, - "packages/bruno-schema/node_modules/nanoid": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", - "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], + "packages/bruno-schema-types": { + "name": "@usebruno/schema-types", + "version": "0.0.1", + "license": "MIT", + "devDependencies": { + "typescript": "^5.0.0" + } + }, + "packages/bruno-schema-types/node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", "bin": { - "nanoid": "bin/nanoid.cjs" + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">=14.17" } }, "packages/bruno-tests": { @@ -32277,7 +32353,7 @@ "express-basic-auth": "^1.2.1", "fast-xml-parser": "^5.0.8", "http-proxy": "^1.18.1", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "jsonwebtoken": "^9.0.2", "lodash": "^4.17.21", "multer": "^1.4.5-lts.1", diff --git a/package.json b/package.json index 520eaad33..c13afb087 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "packages/bruno-common", "packages/bruno-converters", "packages/bruno-schema", + "packages/bruno-schema-types", "packages/bruno-query", "packages/bruno-js", "packages/bruno-lang", @@ -61,6 +62,7 @@ "build:bruno-converters": "npm run build --workspace=packages/bruno-converters", "build:bruno-query": "npm run build --workspace=packages/bruno-query", "build:graphql-docs": "npm run build --workspace=packages/bruno-graphql-docs", + "build:schema-types": "npm run build --workspace=packages/bruno-schema-types", "build:electron": "node ./scripts/build-electron.js", "build:electron:mac": "./scripts/build-electron.sh mac", "build:electron:win": "./scripts/build-electron.sh win", 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 a55bb9f64..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", @@ -37,6 +39,7 @@ "graphiql": "3.7.1", "graphql": "^16.6.0", "graphql-request": "^3.7.0", + "hexy": "^0.3.5", "httpsnippet": "^3.0.9", "i18next": "24.1.2", "idb": "^7.0.0", @@ -47,6 +50,7 @@ "jsonc-parser": "^3.2.1", "jsonpath-plus": "^10.3.0", "know-your-http-well": "^0.5.0", + "linkify-it": "^5.0.0", "lodash": "^4.17.21", "markdown-it": "^13.0.2", "markdown-it-replace-link": "^1.2.0", 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/Accordion/index.js b/packages/bruno-app/src/components/Accordion/index.js index ed73921d7..e87e4bf9f 100644 --- a/packages/bruno-app/src/components/Accordion/index.js +++ b/packages/bruno-app/src/components/Accordion/index.js @@ -4,7 +4,7 @@ import { AccordionItem, AccordionHeader, AccordionContent } from './styledWrappe const AccordionContext = createContext(); -const Accordion = ({ children, defaultIndex }) => { +const Accordion = ({ children, defaultIndex, dataTestId }) => { const [openIndex, setOpenIndex] = useState(defaultIndex); const toggleItem = (index) => { @@ -13,7 +13,7 @@ const Accordion = ({ children, defaultIndex }) => { return ( -
{children}
+
{children}
); }; 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/StyledWrapper.js b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js index ab007c662..fee6b92bc 100644 --- a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js +++ b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js @@ -18,6 +18,33 @@ const StyledWrapper = styled.div` flex-direction: column-reverse; } + .CodeMirror-placeholder { + color: ${(props) => props.theme.text} !important; + opacity: 0.5 !important; + } + + .CodeMirror-linenumber { + text-align: left !important; + padding-left: 3px !important; + } + + /* Override default lint highlight background when emphasizing the gutter */ + .CodeMirror-lint-line-error, + .CodeMirror-lint-line-warning { + background: none !important; + } + + /* Style line numbers when there's a lint issue */ + .CodeMirror-lint-line-error .CodeMirror-linenumber { + color: #d32f2f !important; + text-decoration: underline; + } + + .CodeMirror-lint-line-warning .CodeMirror-linenumber { + color: #f57c00 !important; + text-decoration: underline; + } + /* Removes the glow outline around the folded json */ .CodeMirror-foldmarker { text-shadow: none; @@ -73,41 +100,48 @@ const StyledWrapper = styled.div` } } - .cm-s-monokai span.cm-property, - .cm-s-monokai span.cm-attribute { - color: #9cdcfe !important; - } - - .cm-s-monokai span.cm-string { - color: #ce9178 !important; - } - - .cm-s-monokai span.cm-number { - color: #b5cea8 !important; - } - - .cm-s-monokai span.cm-atom { - color: #569cd6 !important; + .cm-s-default, .cm-s-monokai { + span.cm-def { + color: ${(props) => props.theme.codemirror.tokens.definition} !important; + } + span.cm-property { + color: ${(props) => props.theme.codemirror.tokens.property} !important; + } + span.cm-string { + color: ${(props) => props.theme.codemirror.tokens.string} !important; + } + span.cm-number { + color: ${(props) => props.theme.codemirror.tokens.number} !important; + } + span.cm-atom { + color: ${(props) => props.theme.codemirror.tokens.atom} !important; + } + span.cm-variable { + color: ${(props) => props.theme.codemirror.tokens.variable} !important; + } + span.cm-keyword { + color: ${(props) => props.theme.codemirror.tokens.keyword} !important; + } + span.cm-comment { + color: ${(props) => props.theme.codemirror.tokens.comment} !important; + } + span.cm-operator { + color: ${(props) => props.theme.codemirror.tokens.operator} !important; + } } + /* Variable validation colors */ .cm-variable-valid { - color: green; + color: #5fad89 !important; /* Soft sage */ } .cm-variable-invalid { - color: red; + color: #d17b7b !important; /* Soft coral */ } .CodeMirror-search-hint { display: inline; } - - .cm-s-default span.cm-property { - color: #1f61a0 !important; - } - - .cm-s-default span.cm-variable { - color: #397d13 !important; - } + //matching bracket fix .CodeMirror-matchingbracket { @@ -126,6 +160,31 @@ const StyledWrapper = styled.div` .cm-search-current { background: rgba(255, 193, 7, 0.4); } + + .lint-error-tooltip { + position: fixed; + z-index: 10000; + background: ${(props) => props.theme.codemirror.bg}; + border-radius: ${(props) => props.theme.border.radius.base}; + padding: 8px 12px; + max-width: 400px; + box-shadow: ${(props) => props.theme.shadow.sm}; + font-size: ${(props) => props.theme.font.size.xs}; + line-height: 1.5; + pointer-events: none; + + .lint-tooltip-message { + padding: 2px 0; + } + + .lint-tooltip-message.error { + color: ${(props) => props.theme.colors.text.danger}; + } + + .lint-tooltip-message.warning { + color: ${(props) => props.theme.colors.text.warning}; + } + } `; export default StyledWrapper; diff --git a/packages/bruno-app/src/components/CodeEditor/index.js b/packages/bruno-app/src/components/CodeEditor/index.js index 73fe15330..d139d1ec0 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.js +++ b/packages/bruno-app/src/components/CodeEditor/index.js @@ -14,6 +14,8 @@ import * as jsonlint from '@prantlf/jsonlint'; import { JSHINT } from 'jshint'; import stripJsonComments from 'strip-json-comments'; import { getAllVariables } from 'utils/collections'; +import { setupLinkAware } from 'utils/codemirror/linkAware'; +import { setupLintErrorTooltip } from 'utils/codemirror/lint-errors'; import CodeMirrorSearch from 'components/CodeMirrorSearch'; const CodeMirror = require('codemirror'); @@ -36,7 +38,8 @@ export default class CodeEditor extends React.Component { this.lintOptions = { esversion: 11, expr: true, - asi: true + asi: true, + highlightLines: true }; this.state = { @@ -49,19 +52,22 @@ export default class CodeEditor extends React.Component { const editor = (this.editor = CodeMirror(this._node, { value: this.props.value || '', + placeholder: '...', lineNumbers: true, lineWrapping: this.props.enableLineWrapping ?? true, tabSize: TAB_SIZE, mode: this.props.mode || 'application/ld+json', - brunoVarInfo: { - variables - }, + brunoVarInfo: this.props.enableBrunoVarInfo !== false ? { + variables, + collection: this.props.collection, + item: this.props.item + } : false, keyMap: 'sublime', autoCloseBrackets: true, matchBrackets: true, showCursorWhenSelecting: true, foldGutter: true, - gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'CodeMirror-lint-markers'], + gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'], lint: this.lintOptions, readOnly: this.props.readOnly, scrollbarStyle: 'overlay', @@ -99,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'); @@ -145,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' @@ -182,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); @@ -191,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, @@ -202,6 +208,11 @@ export default class CodeEditor extends React.Component { editor, autoCompleteOptions ); + + setupLinkAware(editor); + + // Setup lint error tooltip on line number hover + this.cleanupLintErrorTooltip = setupLintErrorTooltip(editor); } } @@ -227,6 +238,16 @@ export default class CodeEditor extends React.Component { if (!isEqual(variables, this.variables)) { this.addOverlay(); } + + // Update collection and item when they change + if (this.props.enableBrunoVarInfo !== false && this.editor.options.brunoVarInfo) { + if (!isEqual(this.props.collection, this.editor.options.brunoVarInfo.collection)) { + this.editor.options.brunoVarInfo.collection = this.props.collection; + } + if (!isEqual(this.props.item, this.editor.options.brunoVarInfo.item)) { + this.editor.options.brunoVarInfo.item = this.props.item; + } + } } if (this.props.theme !== prevProps.theme && this.editor) { @@ -254,8 +275,13 @@ export default class CodeEditor extends React.Component { componentWillUnmount() { if (this.editor) { + this.editor?._destroyLinkAware?.(); this.editor.off('change', this._onEdit); this.editor.off('scroll', this.onScroll); + + // Clean up lint error tooltip + this.cleanupLintErrorTooltip?.(); + this.editor = null; } } @@ -290,6 +316,11 @@ export default class CodeEditor extends React.Component { let variables = getAllVariables(this.props.collection, this.props.item); this.variables = variables; + // Update brunoVarInfo with latest variables + if (this.props.enableBrunoVarInfo !== false && this.editor.options.brunoVarInfo) { + this.editor.options.brunoVarInfo.variables = variables; + } + defineCodeMirrorBrunoVariablesMode(variables, mode, false, this.props.enableVariableHighlighting); this.editor.setOption('mode', 'brunovariables'); }; 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/CodeMirrorSearch/StyledWrapper.js b/packages/bruno-app/src/components/CodeMirrorSearch/StyledWrapper.js index b50bb222b..d6265fe3e 100644 --- a/packages/bruno-app/src/components/CodeMirrorSearch/StyledWrapper.js +++ b/packages/bruno-app/src/components/CodeMirrorSearch/StyledWrapper.js @@ -27,7 +27,7 @@ const StyledWrapper = styled.div` border: none; outline: none; padding: 1px 2px; - font-size: 13px; + font-size: ${(props) => props.theme.font.size.base}; margin: 0 1px; height: 28px; } @@ -50,7 +50,7 @@ const StyledWrapper = styled.div` .searchbar-result-count { min-width: 28px; text-align: center; - font-size: 11px; + font-size: ${(props) => props.theme.font.size.xs}; color: #aaa; margin: 0 8px 0 1px; white-space: nowrap; @@ -74,7 +74,7 @@ const StyledWrapper = styled.div` color: inherit; border: none; outline: none; - font-size: 13px; + font-size: ${(props) => props.theme.font.size.base}; padding: 1px 2px; min-width: 80px; } diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/StyledWrapper.js index aaa30d7f8..79d16da14 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/StyledWrapper.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/ApiKeyAuth/StyledWrapper.js @@ -2,7 +2,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` label { - font-size: 0.8125rem; + font-size: ${(props) => props.theme.font.size.base}; } .single-line-editor-wrapper { 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/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/StyledWrapper.js index cdbdf8424..9cf2c5fa4 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/StyledWrapper.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/AuthMode/StyledWrapper.js @@ -1,7 +1,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` - font-size: 0.8125rem; + font-size: ${(props) => props.theme.font.size.base}; .auth-mode-selector { background: transparent; 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/AwsV4Auth/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/StyledWrapper.js index c2bb5d207..eeaf2d45a 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/StyledWrapper.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/StyledWrapper.js @@ -2,7 +2,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` label { - font-size: 0.8125rem; + font-size: ${(props) => props.theme.font.size.base}; } .single-line-editor-wrapper { diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/StyledWrapper.js index c2bb5d207..eeaf2d45a 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/StyledWrapper.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/BasicAuth/StyledWrapper.js @@ -2,7 +2,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` label { - font-size: 0.8125rem; + font-size: ${(props) => props.theme.font.size.base}; } .single-line-editor-wrapper { diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/StyledWrapper.js index c2bb5d207..eeaf2d45a 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/StyledWrapper.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/BearerAuth/StyledWrapper.js @@ -2,7 +2,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` label { - font-size: 0.8125rem; + font-size: ${(props) => props.theme.font.size.base}; } .single-line-editor-wrapper { diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/DigestAuth/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Auth/DigestAuth/StyledWrapper.js index c2bb5d207..eeaf2d45a 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/DigestAuth/StyledWrapper.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/DigestAuth/StyledWrapper.js @@ -2,7 +2,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` label { - font-size: 0.8125rem; + font-size: ${(props) => props.theme.font.size.base}; } .single-line-editor-wrapper { diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/StyledWrapper.js index 316d3a7c5..c2901f80b 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/StyledWrapper.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/NTLMAuth/StyledWrapper.js @@ -2,7 +2,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` label { - font-size: 0.8125rem; + font-size: ${(props) => props.theme.font.size.base}; } .single-line-editor-wrapper { 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/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/StyledWrapper.js index 856f35b9b..65cb5cba9 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/StyledWrapper.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/OAuth2/StyledWrapper.js @@ -2,7 +2,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` label { - font-size: 0.8125rem; + font-size: ${(props) => props.theme.font.size.base}; } .single-line-editor-wrapper { max-width: 400px; 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/WsseAuth/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Auth/WsseAuth/StyledWrapper.js index c2bb5d207..eeaf2d45a 100644 --- a/packages/bruno-app/src/components/CollectionSettings/Auth/WsseAuth/StyledWrapper.js +++ b/packages/bruno-app/src/components/CollectionSettings/Auth/WsseAuth/StyledWrapper.js @@ -2,7 +2,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` label { - font-size: 0.8125rem; + font-size: ${(props) => props.theme.font.size.base}; } .single-line-editor-wrapper { 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 083380c58..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', @@ -146,30 +146,30 @@ const ClientCertSettings = ({ collection }) => {
Add client certificates to be used for specific domains.
-

Client Certificates

+

Client Certificates

    {!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

+

Add Client Certificate