diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 785378f91..b18db1b88 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -11,3 +11,7 @@ - [ ] **Create an issue and link to the pull request.** 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 + +Please see [here](../publishing.md) for more information. diff --git a/contributing.md b/contributing.md index 966a6134b..e2a558cce 100644 --- a/contributing.md +++ b/contributing.md @@ -1,12 +1,12 @@ -**English** | [Українська](/contributing_ua.md) | [Русский](/contributing_ru.md) +**English** | [Українська](/contributing_ua.md) | [Русский](/contributing_ru.md) | [Türkçe](/contributing_tr.md) | [Deutsch](/contributing_de.md) | [Français](/contributing_fr.md) -## Lets make bruno better, together !! +## Let's make bruno better, together !! I am happy that you are looking to improve bruno. Below are the guidelines to get started bringing up bruno on your computer. ### Technology Stack -Bruno is built using NextJs and React. We also use electron to ship a desktop version (that supports local collections) +Bruno is built using Next.js and React. We also use electron to ship a desktop version (that supports local collections) Libraries we use @@ -23,7 +23,7 @@ Libraries we use You would need [Node v18.x or the latest LTS version](https://nodejs.org/en/) and npm 8.x. We use npm workspaces in the project -### Lets start coding +### Let's start coding Please reference [development.md](docs/development.md) for instructions on running the local development environment. @@ -33,5 +33,5 @@ Please reference [development.md](docs/development.md) for instructions on runni - Please follow the format of creating branches - feature/[feature name]: This branch should contain changes for a specific feature - Example: feature/dark-mode - - bugfix/[bug name]: This branch should container only bug fixes for a specific bug + - bugfix/[bug name]: This branch should contain only bug fixes for a specific bug - Example bugfix/bug-1 diff --git a/contributing_de.md b/contributing_de.md new file mode 100644 index 000000000..26b1ffb6a --- /dev/null +++ b/contributing_de.md @@ -0,0 +1,37 @@ +[English](/contributing.md) | [Українська](/contributing_ua.md) | [Русский](/contributing_ru.md) | [Türkçe](/contributing_tr.md) | **Deutsch** | [Français](/contributing_fr.md) + +## Lass uns Bruno noch besser machen, gemeinsam !! + +Ich freue mich, dass Du Bruno verbessern möchtest. Hier findest Du eine Anleitung, mit der Du Bruno auf Deinem Computer einrichten kannst. + +### Technologie Stack + +Bruno ist mit Next.js und React erstellt. Außerdem benötigen wir electron für die Desktop Version (die lokale Sammlungen unterstützt). + +Bibliotheken die wir benutzen + +- CSS - Tailwind +- Code Editoren - Codemirror +- State Management - Redux +- Icons - Tabler Icons +- Formulare - formik +- Schema Validierung - Yup +- Request Client - axios +- Dateisystem Watcher - chokidar + +### Abhängigkeiten + +Du benötigst [Node v18.x oder die neuste LTS Version](https://nodejs.org/en/) und npm 8.x. Wir benutzen npm workspaces in dem Projekt. + +### Lass uns coden + +Eine Anleitung zum Ausführen einer lokalen Entwicklungsumgebung findest Du in [development.md](docs/development_de.md). + +### Pull Request erstellen + +- Bitte halte die PRs klein und begrenzt auf eine Sache +- Bitte halte Dich beim Erstellen eines Branches an das folgende Format + - feature/[feature name]: Dieser Branch soll Änderungen für ein bestimmtes Feature enthalten + - Beispiel: feature/dark-mode + - bugfix/[bug name]: Dieser Branch soll ausschließlich Bugfixes für einen bestimmten Bug enthalten + - Beispiel: bugfix/bug-1 diff --git a/contributing_fr.md b/contributing_fr.md new file mode 100644 index 000000000..d775083f1 --- /dev/null +++ b/contributing_fr.md @@ -0,0 +1,37 @@ +[English](/contributing.md) | [Українська](/contributing_ua.md) | [Русский](/contributing_ru.md) | [Türkçe](/contributing_tr.md) | [Deutsch](/contributing_de.md) | **Français** + +## Ensemble, améliorons Bruno ! + +Je suis content de voir que vous envisagez améliorer Bruno. Ci-dessous, vous trouverez les règles et guides pour récupérer Bruno sur votre ordinateur. + +### Technologies utilisées + +Bruno est construit en utilisant NextJs et React. Nous utilisons aussi Electron pour embarquer la version ordinateur (qui permet les collections locales). + +Les bibliothèques que nous utilisons : + +- CSS - Tailwind +- Code Editors - Codemirror +- State Management - Redux +- Icons - Tabler Icons +- Forms - formik +- Schema Validation - Yup +- Request Client - axios +- Filesystem Watcher - chokidar + +### Dépendances + +Vous aurez besoin de [Node v18.x ou la dernière version LTS](https://nodejs.org/en/) et npm 8.x. Nous utilisons aussi les espaces de travail npm (_npm workspaces_) dans ce projet. + +### Commençons à coder + +Veuillez vous référez à la [documentation de développement](docs/development_fr.md) pour les instructions de démarrage de l'environnement de développement local. + +### Ouvrir une Pull Request + +- Merci de conserver les PR petites et focalisées sur un seul objectif +- Merci de suivre le format de nom des branches + - feature/[feature name]: Cette branche devrait contenir une fonctionnalité spécifique + - Exemple: feature/dark-mode + - bugfix/[bug name]: Cette branche devrait contenir seulement une solution pour pour une bogue spécifique + - Exemple: bugfix/bug-1 diff --git a/contributing_ru.md b/contributing_ru.md index 6636004ba..62fc5d03e 100644 --- a/contributing_ru.md +++ b/contributing_ru.md @@ -1,4 +1,4 @@ -[English](/contributing.md) | [Українська](/contributing_ua.md) | **Русский** +[English](/contributing.md) | [Українська](/contributing_ua.md) | **Русский** | [Türkçe](/contributing_tr.md) | [Deutsch](/contributing_de.md) | [Français](/contributing_fr.md) ## Давайте вместе сделаем Бруно лучше!!! @@ -6,7 +6,7 @@ ### Стек -Bruno построен с использованием NextJs и React. Мы также используем electron для поставки десктопной версии ( которая поддерживает локальные коллекции ) +Bruno построен с использованием Next.js и React. Мы также используем electron для поставки десктопной версии ( которая поддерживает локальные коллекции ) Библиотеки, которые мы используем diff --git a/contributing_tr.md b/contributing_tr.md new file mode 100644 index 000000000..69d3098a3 --- /dev/null +++ b/contributing_tr.md @@ -0,0 +1,37 @@ +[English](/readme.md) | [Українська](/contributing_ua.md) | [Русский](/contributing_ru.md) | **Türkçe** | [Deutsch](/contributing_de.md) | [Français](/contributing_fr.md) + +## Bruno'yu birlikte daha iyi hale getirelim !! + +Bruno'yu geliştirmek istemenizden mutluluk duyuyorum. Aşağıda, bruno'yu bilgisayarınıza getirmeye başlamak için yönergeler bulunmaktadır. + +### Kullanılan Teknolojiler + +Bruno, Next.js ve React kullanılarak oluşturulmuştur. Ayrıca bir masaüstü sürümü (yerel koleksiyonları destekleyen) göndermek için electron kullanıyoruz + +Kullandığımız kütüphaneler + +- CSS - Tailwind +- Kod Düzenleyiciler - Codemirror +- Durum Yönetimi - Redux +- Iconlar - Tabler Simgeleri +- Formlar - formik +- Şema Doğrulama - Yup +- İstek İstemcisi - axios +- Dosya Sistemi İzleyicisi - chokidar + +### Bağımlılıklar + +[Node v18.x veya en son LTS sürümüne](https://nodejs.org/en/) ve npm 8.x'e ihtiyacınız olacaktır. Projede npm çalışma alanlarını kullanıyoruz + +### Kodlamaya başlayalım + +Yerel geliştirme ortamının çalıştırılmasına ilişkin talimatlar için lütfen [development.md](docs/development.md) adresine başvurun. + +### Pull Request Oluşturma + +- Lütfen PR'ları küçük tutun ve tek bir şeye odaklanın +- Lütfen şube oluşturma formatını takip edin + - feature/[özellik adı]: Bu dal belirli bir özellik için değişiklikler içermelidir + - Örnek: feature/dark-mode + - bugfix/[hata adı]: Bu dal yalnızca belirli bir hata için hata düzeltmelerini içermelidir + - Örnek bugfix/bug-1 diff --git a/contributing_ua.md b/contributing_ua.md index 75760f565..de7f3f4e9 100644 --- a/contributing_ua.md +++ b/contributing_ua.md @@ -1,4 +1,4 @@ -[English](/contributing.md) | **Українська** | [Русский](/contributing_ru.md) +[English](/contributing.md) | **Українська** | [Русский](/contributing_ru.md) | [Türkçe](/contributing_tr.md) | [Deutsch](/contributing_de.md) | [Français](/contributing_fr.md) ## Давайте зробимо Bruno краще, разом !! @@ -6,7 +6,7 @@ ### Стек технологій -Bruno побудований на NextJs та React. Також для десктопної версії (яка підтримує локальні колекції) використовується Electron +Bruno побудований на Next.js та React. Також для десктопної версії (яка підтримує локальні колекції) використовується Electron Бібліотеки, які ми використовуємо diff --git a/docs/development.md b/docs/development.md index d56d3e6cf..af4d5d4a9 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,8 +1,8 @@ -**English** | [Українська](/docs/development_ua.md) | [Русский](/docs/development_ru.md) +**English** | [Українська](/docs/development_ua.md) | [Русский](/docs/development_ru.md) | [Deutsch](/docs/development_de.md) | [Français](/docs/development_fr.md) ## Development -Bruno is being developed as a desktop app. You need to load the app by running the nextjs app in one terminal and then run the electron app in another terminal. +Bruno is being developed as a desktop app. You need to load the app by running the Next.js app in one terminal and then run the electron app in another terminal. ### Dependencies diff --git a/docs/development_de.md b/docs/development_de.md new file mode 100644 index 000000000..0a30383aa --- /dev/null +++ b/docs/development_de.md @@ -0,0 +1,55 @@ +[English](/docs/development.md) | [Українська](/docs/development_ua.md) | [Русский](/docs/development_ru.md) | **Deutsch** | [Français](/docs/development_fr.md) + +## Entwicklung + +Bruno wird als Desktop-Anwendung entwickelt. Um die App zu starten, musst Du zuerst die Next.js App in einem Terminal ausführen und anschließend in einem anderen Terminal die Electron-App. + +### Abhängigkeiten + +- NodeJS v18 + +### Lokales Entwickeln + +```bash +# use nodejs 18 version +nvm use + +# install deps +npm i --legacy-peer-deps + +# build graphql docs +npm run build:graphql-docs + +# build bruno query +npm run build:bruno-query + +# run next app (terminal 1) +npm run dev:web + +# run electron app (terminal 2) +npm run dev:electron +``` + +### Troubleshooting + +Es kann sein, dass Du einen `Unsupported platform`-Fehler bekommst, wenn Du `npm install` ausführst. Um dies zu beheben, musst Du `node_modules` und `package-lock.json` löschen und `npm install` erneut ausführen. Dies sollte alle notwendigen Pakete installieren, die zum Ausführen der Anwendung benötigt werden. + +```shell +# Delete node_modules in sub-directories +find ./ -type d -name "node_modules" -print0 | while read -d $'\0' dir; do + rm -rf "$dir" +done + +# Delete package-lock in sub-directories +find . -type f -name "package-lock.json" -delete +``` + +### Testen + +```bash +# bruno-schema +npm test --workspace=packages/bruno-schema + +# bruno-lang +npm test --workspace=packages/bruno-lang +``` diff --git a/docs/development_fr.md b/docs/development_fr.md new file mode 100644 index 000000000..4a5e69446 --- /dev/null +++ b/docs/development_fr.md @@ -0,0 +1,55 @@ +[English](/docs/development.md) | [Українська](/docs/development_ua.md) | [Русский](/docs/development_ru.md) | [Deutsch](/docs/development_de.md) | **Français** + +## Développement + +Bruno est développé comme une application de _lourde_. Vous devez charger l'application en démarrant nextjs dans un terminal, puis démarre l'application Electron dans un autre terminal. + +### Dépendances + +- NodeJS v18 + +### Développement local + +```bash +# use nodejs 18 version +nvm use + +# install deps +npm i --legacy-peer-deps + +# build graphql docs +npm run build:graphql-docs + +# build bruno query +npm run build:bruno-query + +# run next app (terminal 1) +npm run dev:web + +# run electron app (terminal 2) +npm run dev:electron +``` + +### Dépannage + +Vous pourriez rencontrer une error `Unsupported platform` pendant le lancement de `npm install`. Pour résoudre cela, veuillez supprimer le répertoire `node_modules`, le fichier `package-lock.json` et lancer à nouveau `npm install`. Cela devrait isntaller tous les paquets nécessaires pour lancer l'application. + +```shell +# Delete node_modules in sub-directories +find ./ -type d -name "node_modules" -print0 | while read -d $'\0' dir; do + rm -rf "$dir" +done + +# Delete package-lock in sub-directories +find . -type f -name "package-lock.json" -delete +``` + +### Tests + +```bash +# bruno-schema +npm test --workspace=packages/bruno-schema + +# bruno-lang +npm test --workspace=packages/bruno-lang +``` diff --git a/docs/development_ru.md b/docs/development_ru.md index 3816066e0..be1aa8875 100644 --- a/docs/development_ru.md +++ b/docs/development_ru.md @@ -1,8 +1,8 @@ -[English](/docs/development.md) | [Українська](/docs/development_ua.md) | **Русский** +[English](/docs/development.md) | [Українська](/docs/development_ua.md) | **Русский** | [Deutsch](/docs/development_de.md) | [Français](/docs/development_fr.md) ## Разработка -Bruno разрабатывается как десктопное приложение. Необходимо загрузить приложение, запустив приложение nextjs в одном терминале, а затем запустить приложение electron в другом терминале. +Bruno разрабатывается как десктопное приложение. Необходимо загрузить приложение, запустив приложение Next.js в одном терминале, а затем запустить приложение electron в другом терминале. ### Зависимости diff --git a/docs/development_ua.md b/docs/development_ua.md index d6d5bcdf8..c7de38f78 100644 --- a/docs/development_ua.md +++ b/docs/development_ua.md @@ -1,8 +1,8 @@ -[English](/docs/development.md) | **Українська** | [Русский](/docs/development_ru.md) +[English](/docs/development.md) | **Українська** | [Русский](/docs/development_ru.md) | [Deutsch](/docs/development_de.md) | [Français](/docs/development_fr.md) ## Розробка -Bruno розробляється як декстопний застосунок. Вам потрібно запустити nextjs в одній сесії терміналу, та запустити застосунок Electron в іншій сесії терміналу. +Bruno розробляється як декстопний застосунок. Вам потрібно запустити Next.js в одній сесії терміналу, та запустити застосунок Electron в іншій сесії терміналу. ### Залежності diff --git a/package-lock.json b/package-lock.json index a39d0c028..79f3de50f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5534,75 +5534,6 @@ "node": ">=10.12.0" } }, - "node_modules/autoprefixer": { - "version": "10.4.16", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", - "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/autoprefixer" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "peer": true, - "dependencies": { - "browserslist": "^4.21.10", - "caniuse-lite": "^1.0.30001538", - "fraction.js": "^4.3.6", - "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", - "postcss-value-parser": "^4.2.0" - }, - "bin": { - "autoprefixer": "bin/autoprefixer" - }, - "engines": { - "node": "^10 || ^12 || >=14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/autoprefixer/node_modules/browserslist": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", - "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "peer": true, - "dependencies": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", - "update-browserslist-db": "^1.0.13" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, "node_modules/aws-sign2": { "version": "0.7.0", "dev": true, @@ -5998,6 +5929,7 @@ }, "node_modules/browserslist": { "version": "4.21.4", + "dev": true, "funding": [ { "type": "opencollective", @@ -7919,7 +7851,8 @@ "node_modules/electron-to-chromium": { "version": "1.4.554", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.554.tgz", - "integrity": "sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==" + "integrity": "sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==", + "dev": true }, "node_modules/electron-util": { "version": "0.17.2", @@ -8664,19 +8597,6 @@ "node": ">= 0.6" } }, - "node_modules/fraction.js": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", - "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", - "peer": true, - "engines": { - "node": "*" - }, - "funding": { - "type": "patreon", - "url": "https://github.com/sponsors/rawify" - } - }, "node_modules/fresh": { "version": "0.5.2", "license": "MIT", @@ -11856,7 +11776,8 @@ "node_modules/node-releases": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true }, "node_modules/normalize-package-data": { "version": "2.5.0", @@ -11889,15 +11810,6 @@ "node": ">=0.10.0" } }, - "node_modules/normalize-range": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", - "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/normalize-url": { "version": "6.1.0", "dev": true, @@ -15843,6 +15755,7 @@ "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "dev": true, "funding": [ { "type": "opencollective", @@ -16534,7 +16447,7 @@ "@tabler/icons": "^1.46.0", "@tippyjs/react": "^4.2.6", "@usebruno/graphql-docs": "0.1.0", - "@usebruno/schema": "0.5.0", + "@usebruno/schema": "0.6.0", "axios": "^0.26.0", "classnames": "^2.3.1", "codemirror": "^5.65.2", @@ -16625,11 +16538,11 @@ }, "packages/bruno-cli": { "name": "@usebruno/cli", - "version": "0.14.0", + "version": "0.15.1", "license": "MIT", "dependencies": { - "@usebruno/js": "0.8.0", - "@usebruno/lang": "0.8.0", + "@usebruno/js": "0.9.1", + "@usebruno/lang": "0.9.0", "axios": "^1.5.1", "chai": "^4.3.7", "chalk": "^3.0.0", @@ -16717,18 +16630,18 @@ }, "packages/bruno-electron": { "name": "bruno", - "version": "v0.25.0", + "version": "v0.27.2", "dependencies": { "@aws-sdk/credential-providers": "^3.425.0", - "@usebruno/js": "0.8.0", - "@usebruno/lang": "0.8.0", - "@usebruno/schema": "0.5.0", + "@usebruno/js": "0.9.1", + "@usebruno/lang": "0.9.0", + "@usebruno/schema": "0.6.0", "about-window": "^1.15.2", "aws4-axios": "^3.3.0", "axios": "^1.5.1", "chai": "^4.3.7", - "chai-string": "^1.5.0", "chokidar": "^3.5.3", + "content-disposition": "^0.5.4", "decomment": "^0.9.5", "dotenv": "^16.0.3", "electron-is-dev": "^2.0.0", @@ -16742,7 +16655,9 @@ "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", "is-valid-path": "^0.1.1", + "js-yaml": "^4.1.0", "lodash": "^4.17.21", + "mime-types": "^2.1.35", "mustache": "^4.2.0", "nanoid": "3.3.4", "node-machine-id": "^1.1.12", @@ -16776,6 +16691,11 @@ "node": ">= 14" } }, + "packages/bruno-electron/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, "packages/bruno-electron/node_modules/aws4-axios": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/aws4-axios/-/aws4-axios-3.3.0.tgz", @@ -16892,6 +16812,17 @@ "node": ">= 14" } }, + "packages/bruno-electron/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==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "packages/bruno-electron/node_modules/uuid": { "version": "9.0.0", "license": "MIT", @@ -16928,7 +16859,7 @@ }, "packages/bruno-js": { "name": "@usebruno/js", - "version": "0.8.0", + "version": "0.9.1", "license": "MIT", "dependencies": { "@usebruno/query": "0.1.0", @@ -16937,6 +16868,7 @@ "axios": "^0.26.0", "btoa": "^1.2.1", "chai": "^4.3.7", + "chai-string": "^1.5.0", "crypto-js": "^4.1.1", "handlebars": "^4.7.8", "json-query": "^2.2.2", @@ -16977,7 +16909,7 @@ }, "packages/bruno-lang": { "name": "@usebruno/lang", - "version": "0.8.0", + "version": "0.9.0", "license": "MIT", "dependencies": { "arcsecond": "^5.0.0", @@ -17014,7 +16946,7 @@ }, "packages/bruno-schema": { "name": "@usebruno/schema", - "version": "0.5.0", + "version": "0.6.0", "license": "MIT", "peerDependencies": { "yup": "^0.32.11" @@ -20578,7 +20510,7 @@ "@tabler/icons": "^1.46.0", "@tippyjs/react": "^4.2.6", "@usebruno/graphql-docs": "0.1.0", - "@usebruno/schema": "0.5.0", + "@usebruno/schema": "0.6.0", "axios": "^0.26.0", "babel-loader": "^8.2.3", "classnames": "^2.3.1", @@ -20660,8 +20592,8 @@ "@usebruno/cli": { "version": "file:packages/bruno-cli", "requires": { - "@usebruno/js": "0.8.0", - "@usebruno/lang": "0.8.0", + "@usebruno/js": "0.9.1", + "@usebruno/lang": "0.9.0", "axios": "^1.5.1", "chai": "^4.3.7", "chalk": "^3.0.0", @@ -20756,6 +20688,7 @@ "axios": "^0.26.0", "btoa": "^1.2.1", "chai": "^4.3.7", + "chai-string": "^1.5.0", "crypto-js": "^4.1.1", "handlebars": "^4.7.8", "json-query": "^2.2.2", @@ -21307,34 +21240,6 @@ "atomically": { "version": "1.7.0" }, - "autoprefixer": { - "version": "10.4.16", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", - "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", - "peer": true, - "requires": { - "browserslist": "^4.21.10", - "caniuse-lite": "^1.0.30001538", - "fraction.js": "^4.3.6", - "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", - "postcss-value-parser": "^4.2.0" - }, - "dependencies": { - "browserslist": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", - "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", - "peer": true, - "requires": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", - "update-browserslist-db": "^1.0.13" - } - } - } - }, "aws-sign2": { "version": "0.7.0", "dev": true @@ -21596,6 +21501,7 @@ }, "browserslist": { "version": "4.21.4", + "dev": true, "requires": { "caniuse-lite": "^1.0.30001400", "electron-to-chromium": "^1.4.251", @@ -21607,15 +21513,15 @@ "version": "file:packages/bruno-electron", "requires": { "@aws-sdk/credential-providers": "^3.425.0", - "@usebruno/js": "0.8.0", - "@usebruno/lang": "0.8.0", - "@usebruno/schema": "0.5.0", + "@usebruno/js": "0.9.1", + "@usebruno/lang": "0.9.0", + "@usebruno/schema": "0.6.0", "about-window": "^1.15.2", "aws4-axios": "^3.3.0", "axios": "^1.5.1", "chai": "^4.3.7", - "chai-string": "^1.5.0", "chokidar": "^3.5.3", + "content-disposition": "^0.5.4", "decomment": "^0.9.5", "dmg-license": "^1.0.11", "dotenv": "^16.0.3", @@ -21633,7 +21539,9 @@ "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.2", "is-valid-path": "^0.1.1", + "js-yaml": "^4.1.0", "lodash": "^4.17.21", + "mime-types": "^2.1.35", "mustache": "^4.2.0", "nanoid": "3.3.4", "node-machine-id": "^1.1.12", @@ -21654,6 +21562,11 @@ "debug": "^4.3.4" } }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, "aws4-axios": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/aws4-axios/-/aws4-axios-3.3.0.tgz", @@ -21724,6 +21637,14 @@ "debug": "4" } }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, "uuid": { "version": "9.0.0" } @@ -22948,7 +22869,8 @@ "electron-to-chromium": { "version": "1.4.554", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.554.tgz", - "integrity": "sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==" + "integrity": "sha512-Q0umzPJjfBrrj8unkONTgbKQXzXRrH7sVV7D9ea2yBV3Oaogz991yhbpfvo2LMNkJItmruXTEzVpP9cp7vaIiQ==", + "dev": true }, "electron-util": { "version": "0.17.2", @@ -23429,12 +23351,6 @@ "forwarded": { "version": "0.2.0" }, - "fraction.js": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", - "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", - "peer": true - }, "fresh": { "version": "0.5.2" }, @@ -25443,7 +25359,8 @@ "node-releases": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true }, "normalize-package-data": { "version": "2.5.0", @@ -25468,12 +25385,6 @@ "normalize-path": { "version": "3.0.0" }, - "normalize-range": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", - "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", - "peer": true - }, "normalize-url": { "version": "6.1.0", "dev": true @@ -27920,6 +27831,7 @@ "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "dev": true, "requires": { "escalade": "^3.1.1", "picocolors": "^1.0.0" diff --git a/packages/bruno-app/package.json b/packages/bruno-app/package.json index 8ead3b925..c3f82569f 100644 --- a/packages/bruno-app/package.json +++ b/packages/bruno-app/package.json @@ -3,7 +3,7 @@ "version": "0.3.0", "private": true, "scripts": { - "dev": "cross-env ENV=dev next dev", + "dev": "cross-env ENV=dev next dev -p 3000", "build": "next build && next export", "start": "next start", "lint": "next lint", @@ -19,7 +19,7 @@ "@tabler/icons": "^1.46.0", "@tippyjs/react": "^4.2.6", "@usebruno/graphql-docs": "0.1.0", - "@usebruno/schema": "0.5.0", + "@usebruno/schema": "0.6.0", "axios": "^0.26.0", "classnames": "^2.3.1", "codemirror": "^5.65.2", diff --git a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js index fe0f4cc19..3623d406d 100644 --- a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js +++ b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js @@ -5,6 +5,7 @@ const StyledWrapper = styled.div` background: ${(props) => props.theme.codemirror.bg}; border: solid 1px ${(props) => props.theme.codemirror.border}; font-family: ${(props) => (props.font ? props.font : 'default')}; + line-break: anywhere; } .CodeMirror-overlayscroll-horizontal div, diff --git a/packages/bruno-app/src/components/CodeEditor/index.js b/packages/bruno-app/src/components/CodeEditor/index.js index 6ad999e6b..b1a115c9e 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.js +++ b/packages/bruno-app/src/components/CodeEditor/index.js @@ -70,6 +70,35 @@ export default class CodeEditor extends React.Component { 'Ctrl-F': 'findPersistent', Tab: function (cm) { cm.replaceSelection(' ', 'end'); + }, + 'Ctrl-Y': 'foldAll', + 'Cmd-Y': 'foldAll', + 'Ctrl-I': 'unfoldAll', + 'Cmd-I': 'unfoldAll' + }, + foldOptions: { + widget: (from, to) => { + var count = undefined; + var internal = this.editor.getRange(from, to); + if (this.props.mode == 'application/ld+json') { + if (this.editor.getLine(from.line).endsWith('[')) { + var toParse = '[' + internal + ']'; + } else var toParse = '{' + internal + '}'; + try { + count = Object.keys(JSON.parse(toParse)).length; + } catch (e) {} + } else if (this.props.mode == 'application/xml') { + var doc = new DOMParser(); + try { + //add header element and remove prefix namespaces for DOMParser + var dcm = doc.parseFromString( + ' ' + internal.replace(/(?<=\<|<\/)\w+:/g, '') + '', + 'application/xml' + ); + count = dcm.documentElement.children.length; + } catch (e) {} + } + return count ? `\u21A4${count}\u21A6` : '\u2194'; } } })); diff --git a/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js b/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js index fd3cc8986..2ed25b1e5 100644 --- a/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/ProxySettings/index.js @@ -7,17 +7,17 @@ import toast from 'react-hot-toast'; const ProxySettings = ({ proxyConfig, onUpdate }) => { const proxySchema = Yup.object({ - use: Yup.string().oneOf(['global', 'true', 'false']), + enabled: Yup.string().oneOf(['global', 'true', 'false']), protocol: Yup.string().oneOf(['http', 'https', 'socks4', 'socks5']), hostname: Yup.string() - .when('use', { + .when('enabled', { is: true, then: (hostname) => hostname.required('Specify the hostname for your proxy.'), otherwise: (hostname) => hostname.nullable() }) .max(1024), port: Yup.number() - .when('use', { + .when('enabled', { is: true, then: (port) => port.required('Specify port between 1 and 65535').typeError('Specify port between 1 and 65535'), otherwise: (port) => port.nullable().transform((_, val) => (val ? Number(val) : null)) @@ -49,7 +49,7 @@ const ProxySettings = ({ proxyConfig, onUpdate }) => { const formik = useFormik({ initialValues: { - use: proxyConfig.use || 'global', + enabled: proxyConfig.enabled || 'global', protocol: proxyConfig.protocol || 'http', hostname: proxyConfig.hostname || '', port: proxyConfig.port || '', @@ -65,11 +65,11 @@ const ProxySettings = ({ proxyConfig, onUpdate }) => { proxySchema .validate(values, { abortEarly: true }) .then((validatedProxy) => { - // serialize 'use' to boolean - if (validatedProxy.use === 'true') { - validatedProxy.use = true; - } else if (validatedProxy.use === 'false') { - validatedProxy.use = false; + // serialize 'enabled' to boolean + if (validatedProxy.enabled === 'true') { + validatedProxy.enabled = true; + } else if (validatedProxy.enabled === 'false') { + validatedProxy.enabled = false; } onUpdate(validatedProxy); @@ -83,7 +83,7 @@ const ProxySettings = ({ proxyConfig, onUpdate }) => { useEffect(() => { formik.setValues({ - use: proxyConfig.use === true ? 'true' : proxyConfig.use === false ? 'false' : 'global', + enabled: proxyConfig.enabled === true ? 'true' : proxyConfig.enabled === false ? 'false' : 'global', protocol: proxyConfig.protocol || 'http', hostname: proxyConfig.hostname || '', port: proxyConfig.port || '', @@ -120,9 +120,9 @@ const ProxySettings = ({ proxyConfig, onUpdate }) => {