Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 56 additions & 31 deletions .github/workflows/build-hoppscotch-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
default: "hoppscotch/hoppscotch"
branch:
description: Branch to checkout
required: false
required: true
default: "main"
tag:
description: Tag to checkout (takes precedence over branch if provided)
Expand All @@ -26,6 +26,26 @@ on:
required: false
type: boolean
default: false
build_linux:
description: Build for Linux
type: boolean
required: false
default: true
build_windows:
description: Build for Windows
type: boolean
required: false
default: true
build_macos_x64:
description: Build for macOS x64
type: boolean
required: false
default: true
build_macos_arm64:
description: Build for macOS ARM64
type: boolean
required: false
default: true
env:
CARGO_TERM_COLOR: always
WORKSPACE_PATH: ${{ github.workspace }}
Expand All @@ -35,18 +55,19 @@ env:
jobs:
build-linux:
runs-on: ubuntu-24.04
if: ${{ inputs.build_linux }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.tag != '' && inputs.tag || inputs.branch }}
token: ${{ secrets.CHECKOUT_GITHUB_TOKEN }}
token: ${{ secrets.HOPPSCOTCH_GITHUB_CHECKOUT_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v4
with:
version: 10.2.1
version: 10.18.3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
Expand Down Expand Up @@ -131,16 +152,17 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux
name: selfhost-desktop-linux
path: dist/*
build-windows:
runs-on: windows-latest
if: ${{ inputs.build_windows }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.tag != '' && inputs.tag || inputs.branch }}
token: ${{ secrets.CHECKOUT_GITHUB_TOKEN }}
token: ${{ secrets.HOPPSCOTCH_GITHUB_CHECKOUT_TOKEN }}
- name: Set Perl environment variables
shell: pwsh
run: |
Expand All @@ -151,7 +173,7 @@ jobs:
node-version: 20
- uses: pnpm/action-setup@v4
with:
version: 10.2.1
version: 10.18.3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
Expand All @@ -161,7 +183,7 @@ jobs:
shell: pwsh
run: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/Levminer/trusted-signing-cli/releases/download/0.5.0/trusted-signing-cli.exe" -OutFile "trusted-signing-cli.exe"
Invoke-WebRequest -Uri "https://github.com/Levminer/trusted-signing-cli/releases/download/0.8.0/trusted-signing-cli.exe" -OutFile "trusted-signing-cli.exe"
Move-Item -Path "trusted-signing-cli.exe" -Destination "$env:GITHUB_WORKSPACE\trusted-signing-cli.exe"
echo "$env:GITHUB_WORKSPACE" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
- name: Setting up Windows Signing Environment
Expand Down Expand Up @@ -238,22 +260,23 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows
name: selfhost-desktop-windows
path: dist/*
build-macos-x64:
runs-on: macos-latest
if: ${{ inputs.build_macos_x64 }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.tag != '' && inputs.tag || inputs.branch }}
token: ${{ secrets.CHECKOUT_GITHUB_TOKEN }}
token: ${{ secrets.HOPPSCOTCH_GITHUB_CHECKOUT_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v4
with:
version: 10.2.1
version: 10.18.3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
Expand All @@ -271,8 +294,8 @@ jobs:
- uses: apple-actions/import-codesign-certs@v3
if: ${{ inputs.disable_signing != true }}
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
p12-file-base64: ${{ secrets.HOPPSCOTCH_APPLE_CERTIFICATE }}
p12-password: ${{ secrets.HOPPSCOTCH_APPLE_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -310,10 +333,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.HOPPSCOTCH_APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.HOPPSCOTCH_APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.HOPPSCOTCH_APPLE_TEAM_ID }}
APPLE_SIGNING_IDENTITY: ${{ secrets.HOPPSCOTCH_APPLE_SIGNING_IDENTITY }}
RUST_LOG: debug
run: pnpm --dir ${{ env.DESKTOP_PATH }} tauri build --verbose --target x86_64-apple-darwin
- name: Build Tauri app without Apple signing
Expand All @@ -334,22 +357,23 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macos-x64
name: selfhost-desktop-macos-x64
path: dist/*
build-macos-arm64:
runs-on: macos-latest
if: ${{ inputs.build_macos_arm64 }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.tag != '' && inputs.tag || inputs.branch }}
token: ${{ secrets.CHECKOUT_GITHUB_TOKEN }}
token: ${{ secrets.HOPPSCOTCH_GITHUB_CHECKOUT_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v4
with:
version: 10.2.1
version: 10.18.3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
Expand All @@ -367,8 +391,8 @@ jobs:
- uses: apple-actions/import-codesign-certs@v3
if: ${{ inputs.disable_signing != true }}
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
p12-file-base64: ${{ secrets.HOPPSCOTCH_APPLE_CERTIFICATE }}
p12-password: ${{ secrets.HOPPSCOTCH_APPLE_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -406,10 +430,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.HOPPSCOTCH_APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.HOPPSCOTCH_APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.HOPPSCOTCH_APPLE_TEAM_ID }}
APPLE_SIGNING_IDENTITY: ${{ secrets.HOPPSCOTCH_APPLE_SIGNING_IDENTITY }}
RUST_LOG: debug
run: pnpm --dir ${{ env.DESKTOP_PATH }} tauri build --verbose --target aarch64-apple-darwin
- name: Build Tauri app without Apple signing
Expand All @@ -430,11 +454,12 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macos-aarch64
name: selfhost-desktop-macos-aarch64
path: dist/*
create-update-manifest:
needs: [build-linux, build-windows, build-macos-x64, build-macos-arm64]
runs-on: ubuntu-latest
if: ${{ inputs.build_linux && inputs.build_windows && inputs.build_macos_x64 && inputs.build_macos_arm64 }}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
Expand All @@ -452,19 +477,19 @@ jobs:
"pub_date": "${CURRENT_DATE}",
"platforms": {
"linux-x86_64": {
"signature": "$(cat artifacts/linux/Hoppscotch_SelfHost_linux_x64.AppImage.sig)",
"signature": "$(cat artifacts/selfhost-desktop-linux/Hoppscotch_SelfHost_linux_x64.AppImage.sig)",
"url": "https://github.com/hoppscotch/releases/releases/download/${VERSION}/Hoppscotch_SelfHost_linux_x64.AppImage"
},
"windows-x86_64": {
"signature": "$(cat artifacts/windows/Hoppscotch_SelfHost_win_x64.msi.sig)",
"signature": "$(cat artifacts/selfhost-desktop-windows/Hoppscotch_SelfHost_win_x64.msi.sig)",
"url": "https://github.com/hoppscotch/releases/releases/download/${VERSION}/Hoppscotch_SelfHost_win_x64.msi"
},
"darwin-x86_64": {
"signature": "$(cat artifacts/macos-x64/Hoppscotch_SelfHost_mac_x64.tar.gz.sig)",
"signature": "$(cat artifacts/selfhost-desktop-macos-x64/Hoppscotch_SelfHost_mac_x64.tar.gz.sig)",
"url": "https://github.com/hoppscotch/releases/releases/download/${VERSION}/Hoppscotch_SelfHost_mac_x64.tar.gz"
},
"darwin-aarch64": {
"signature": "$(cat artifacts/macos-aarch64/Hoppscotch_SelfHost_mac_aarch64.tar.gz.sig)",
"signature": "$(cat artifacts/selfhost-desktop-macos-aarch64/Hoppscotch_SelfHost_mac_aarch64.tar.gz.sig)",
"url": "https://github.com/hoppscotch/releases/releases/download/${VERSION}/Hoppscotch_SelfHost_mac_aarch64.tar.gz"
}
}
Expand All @@ -473,5 +498,5 @@ jobs:
- name: Upload manifest
uses: actions/upload-artifact@v4
with:
name: update-manifest
name: selfhost-desktop-update-manifest
path: artifacts/hoppscotch-selfhost-desktop.json
2 changes: 1 addition & 1 deletion packages/hoppscotch-backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hoppscotch-backend",
"version": "2025.10.0",
"version": "2025.10.1",
"description": "",
"author": "",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
"params": [],
"headers": [],
"preRequestScript": "export {};\n",
"testScript": "export {};\n\npm.test('pm.require() throws descriptive error', () => {\n const throwFn = () => pm.require('lodash')\n pm.expect(throwFn).to.throw()\n pm.expect(throwFn).to.throw(/not supported in Hoppscotch/)\n})\n\npm.test('pm.execution.runRequest() throws descriptive error', () => {\n const throwFn = () => pm.execution.runRequest()\n pm.expect(throwFn).to.throw()\n pm.expect(throwFn).to.throw(/Collection Runner feature/)\n})\n\npm.test('pm.collectionVariables.replaceIn() throws descriptive error', () => {\n const throwFn = () => pm.collectionVariables.replaceIn('{{test}}')\n pm.expect(throwFn).to.throw()\n pm.expect(throwFn).to.throw(/Workspace feature/)\n})\n\npm.test('pm.iterationData.toJSON() throws descriptive error', () => {\n const throwFn = () => pm.iterationData.toJSON()\n pm.expect(throwFn).to.throw()\n pm.expect(throwFn).to.throw(/Collection Runner feature/)\n})\n",
"testScript": "export {};\n\nconst unsupportedApis = [\n { api: 'pm.info.iteration', script: () => { const x = pm.info.iteration }, errorMessage: /Collection Runner feature/ },\n { api: 'pm.info.iterationCount', script: () => { const x = pm.info.iterationCount }, errorMessage: /Collection Runner feature/ },\n { api: 'pm.collectionVariables.get()', script: () => pm.collectionVariables.get('test'), errorMessage: /use environment or request variables instead/ },\n { api: 'pm.collectionVariables.set()', script: () => pm.collectionVariables.set('key', 'value'), errorMessage: /use environment or request variables instead/ },\n { api: 'pm.collectionVariables.unset()', script: () => pm.collectionVariables.unset('key'), errorMessage: /use environment or request variables instead/ },\n { api: 'pm.collectionVariables.has()', script: () => pm.collectionVariables.has('key'), errorMessage: /use environment or request variables instead/ },\n { api: 'pm.collectionVariables.clear()', script: () => pm.collectionVariables.clear(), errorMessage: /use environment or request variables instead/ },\n { api: 'pm.collectionVariables.toObject()', script: () => pm.collectionVariables.toObject(), errorMessage: /use environment or request variables instead/ },\n { api: 'pm.collectionVariables.replaceIn()', script: () => pm.collectionVariables.replaceIn('{{test}}'), errorMessage: /use environment or request variables instead/ },\n { api: 'pm.vault.get()', script: () => pm.vault.get('test'), errorMessage: /Postman Vault feature/ },\n { api: 'pm.vault.set()', script: () => pm.vault.set('key', 'value'), errorMessage: /Postman Vault feature/ },\n { api: 'pm.vault.unset()', script: () => pm.vault.unset('key'), errorMessage: /Postman Vault feature/ },\n { api: 'pm.iterationData.get()', script: () => pm.iterationData.get('test'), errorMessage: /Collection Runner feature/ },\n { api: 'pm.iterationData.set()', script: () => pm.iterationData.set('key', 'value'), errorMessage: /Collection Runner feature/ },\n { api: 'pm.iterationData.unset()', script: () => pm.iterationData.unset('key'), errorMessage: /Collection Runner feature/ },\n { api: 'pm.iterationData.has()', script: () => pm.iterationData.has('key'), errorMessage: /Collection Runner feature/ },\n { api: 'pm.iterationData.toObject()', script: () => pm.iterationData.toObject(), errorMessage: /Collection Runner feature/ },\n { api: 'pm.iterationData.toJSON()', script: () => pm.iterationData.toJSON(), errorMessage: /Collection Runner feature/ },\n { api: 'pm.execution.setNextRequest()', script: () => pm.execution.setNextRequest('next'), errorMessage: /Collection Runner feature/ },\n { api: 'pm.execution.skipRequest()', script: () => pm.execution.skipRequest(), errorMessage: /Collection Runner feature/ },\n { api: 'pm.execution.runRequest()', script: () => pm.execution.runRequest(), errorMessage: /Collection Runner feature/ },\n { api: 'pm.sendRequest()', script: () => pm.sendRequest('https://example.com', () => {}), errorMessage: /not yet implemented/ },\n { api: 'pm.visualizer.set()', script: () => pm.visualizer.set('<h1>Test</h1>'), errorMessage: /Postman Visualizer feature/ },\n { api: 'pm.visualizer.clear()', script: () => pm.visualizer.clear(), errorMessage: /Postman Visualizer feature/ },\n { api: 'pm.require()', script: () => pm.require('lodash'), errorMessage: /not supported in Hoppscotch/ },\n]\n\nunsupportedApis.forEach(({ api, script, errorMessage }) => {\n pm.test(`${api} throws descriptive error`, () => {\n pm.expect(script).to.throw(errorMessage)\n })\n})\n",
"auth": {
"authType": "inherit",
"authActive": true
Expand Down
2 changes: 1 addition & 1 deletion packages/hoppscotch-common/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hoppscotch/common",
"private": true,
"version": "2025.10.0",
"version": "2025.10.1",
"scripts": {
"dev": "pnpm exec npm-run-all -p -l dev:*",
"test": "vitest --run",
Expand Down
4 changes: 0 additions & 4 deletions packages/hoppscotch-common/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ declare module 'vue' {
HoppSmartProgressRing: typeof import('@hoppscotch/ui')['HoppSmartProgressRing']
HoppSmartRadio: typeof import('@hoppscotch/ui')['HoppSmartRadio']
HoppSmartRadioGroup: typeof import('@hoppscotch/ui')['HoppSmartRadioGroup']
HoppSmartSelect: typeof import('@hoppscotch/ui')['HoppSmartSelect']
HoppSmartSelectOption: typeof import('@hoppscotch/ui')['HoppSmartSelectOption']
HoppSmartSelectWrapper: typeof import('@hoppscotch/ui')['HoppSmartSelectWrapper']
HoppSmartSlideOver: typeof import('@hoppscotch/ui')['HoppSmartSlideOver']
HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner']
Expand Down Expand Up @@ -214,11 +212,9 @@ declare module 'vue' {
IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default']
IconLucideArrowUpRight: typeof import('~icons/lucide/arrow-up-right')['default']
IconLucideBrush: typeof import('~icons/lucide/brush')['default']
IconLucideCheck: typeof import('~icons/lucide/check')['default']
IconLucideCheckCircle: typeof import('~icons/lucide/check-circle')['default']
IconLucideChevronRight: typeof import('~icons/lucide/chevron-right')['default']
IconLucideCircleCheck: typeof import('~icons/lucide/circle-check')['default']
IconLucideCopy: typeof import('~icons/lucide/copy')['default']
IconLucideGlobe: typeof import('~icons/lucide/globe')['default']
IconLucideHelpCircle: typeof import('~icons/lucide/help-circle')['default']
IconLucideInbox: typeof import('~icons/lucide/inbox')['default']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ import { v4 as uuidv4 } from "uuid"
import { computed, onMounted, onUnmounted, ref } from "vue"

import { useColorMode } from "~/composables/theming"
import { MODULE_PREFIX } from "~/helpers/scripting"

// Import type definitions as raw strings
import preRequestTypes from "~/types/pre-request.d.ts?raw"
import postRequestTypes from "~/types/post-request.d.ts?raw"
import preRequestTypes from "~/types/pre-request.d.ts?raw"

const props = withDefaults(
defineProps<{
Expand Down Expand Up @@ -60,8 +61,6 @@ const extraLibRefs = new Map<string, monaco.IDisposable>()
// Track context-specific type definition for this editor instance
const contextTypeDefRef = ref<monaco.IDisposable | null>(null)

const MODULE_PREFIX = "export {};\n" as const

const ensureCompilerOptions = (() => {
let applied = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ import {
makeCollection,
} from "@hoppscotch/data"
import { useService } from "dioc/vue"
import { MODULE_PREFIX_REGEX_JSON_SERIALIZED } from "~/helpers/scripting"

import * as TE from "fp-ts/TaskEither"
import { pipe } from "fp-ts/function"
Expand Down Expand Up @@ -2832,7 +2833,10 @@ const exportData = async (collection: HoppCollection | TeamCollection) => {
const collectionJSON = JSON.stringify(collection, null, 2)

// Strip `export {};\n` from `testScript` and `preRequestScript` fields
const cleanedCollectionJSON = collectionJSON.replace(/export \{\};\\n/g, "")
const cleanedCollectionJSON = collectionJSON.replace(
MODULE_PREFIX_REGEX_JSON_SERIALIZED,
""
)

const name = (collection as HoppCollection).name

Expand All @@ -2855,7 +2859,7 @@ const exportData = async (collection: HoppCollection | TeamCollection) => {

// Strip `export {};\n` from `testScript` and `preRequestScript` fields
const cleanedCollectionJSON = collectionJSONString.replace(
/export \{\};\\n/g,
MODULE_PREFIX_REGEX_JSON_SERIALIZED,
""
)

Expand Down
Loading
Loading