Skip to content

Commit

Permalink
chore(live-preview): expose current package version []
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishelgert committed Oct 16, 2023
1 parent ba6d19f commit 1b7f559
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/live-preview-sdk/src/helpers/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as packageJson from '../../package.json';
import { version } from '../../package.json';
import { CONTENTFUL_ORIGINS, LIVE_PREVIEW_SDK_SOURCE } from '../constants';
import { PostMessageMethods } from '../messages';
import type { EditorMessage, MessageFromSDK } from '../messages';
Expand All @@ -15,7 +15,7 @@ export function sendMessageToEditor(method: PostMessageMethods, data: EditorMess
from: 'live-preview',
source: LIVE_PREVIEW_SDK_SOURCE,
location: window.location.href,
version: packageJson.version || '2.2.0',
version,
};

debug.log('Send message', message);
Expand Down
3 changes: 3 additions & 0 deletions packages/live-preview-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import './styles.css';

import { type DocumentNode } from 'graphql';

import { version } from '../package.json';
import { getAllTaggedEntries } from './fieldTaggingUtils';
import {
sendMessageToEditor,
Expand Down Expand Up @@ -29,6 +30,8 @@ import {
TagAttributes,
} from './types';

export const VERSION = version;

export interface ContentfulLivePreviewInitConfig {
locale: string;
debugMode?: boolean;
Expand Down

0 comments on commit 1b7f559

Please sign in to comment.