From e93eb1d1c17c0e987a0711c73634c8efa56d47db Mon Sep 17 00:00:00 2001 From: Daniel Winter Date: Mon, 24 Nov 2025 16:54:37 +0100 Subject: [PATCH 1/3] Add prepublishOnly script to ensure build runs before publish --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c3d6d47..d513cdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hygraph/preview-sdk", - "version": "1.0.1", + "version": "1.0.2", "description": "Content preview SDK for seamless real-time content editing in Hygraph CMS", "publishConfig": { "access": "public" @@ -40,7 +40,8 @@ "lint:fix": "eslint src --ext .ts,.tsx --fix", "test": "vitest --run --passWithNoTests", "test:ui": "vitest --ui", - "clean": "rm -rf dist" + "clean": "rm -rf dist", + "prepublishOnly": "npm run build" }, "keywords": [ "hygraph", From 6e265a9fac101a39db2f39a5f3777f455aed1945 Mon Sep 17 00:00:00 2001 From: Daniel Winter Date: Mon, 1 Dec 2025 15:42:39 +0100 Subject: [PATCH 2/3] Fix studioUrl handling to accept URLs with trailing slashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Strip trailing slashes from studioUrl config to prevent malformed URLs when building Studio URLs (e.g., "https://studio.hygraph.dev//entry" instead of "https://studio.hygraph.dev/entry"). This improves setup experience by accepting both formats: - https://studio.hygraph.dev/ - https://studio.hygraph.dev 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/core/Preview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Preview.ts b/src/core/Preview.ts index a5bc8b9..43ada47 100644 --- a/src/core/Preview.ts +++ b/src/core/Preview.ts @@ -604,7 +604,7 @@ export class Preview { } private buildStudioUrl(entryId: string, fieldApiId?: string, locale?: string, componentChain?: ComponentChainLink[]): string { - const baseUrl = this.config.studioUrl || 'https://app.hygraph.com'; + const baseUrl = (this.config.studioUrl || 'https://app.hygraph.com').replace(/\/+$/, ''); const params = new URLSearchParams({ endpoint: this.config.endpoint, entryId, From a7594a6c1e4dbb6f58ea46e63aae8f1668b641d2 Mon Sep 17 00:00:00 2001 From: Daniel Winter Date: Mon, 1 Dec 2025 15:45:41 +0100 Subject: [PATCH 3/3] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d513cdf..2656919 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hygraph/preview-sdk", - "version": "1.0.2", + "version": "1.0.3", "description": "Content preview SDK for seamless real-time content editing in Hygraph CMS", "publishConfig": { "access": "public"