From f6ea8e443d1abbeaa49c09d9e0976f4cb82b142e Mon Sep 17 00:00:00 2001 From: Maxime Khoy Date: Wed, 19 Aug 2020 15:36:31 +0200 Subject: [PATCH] fix: Use default export from package instead of named export version --- packages/core/src/index.ts | 4 +++- packages/theme-ui/test/color-modes.tsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index f60fdd319..bec71259f 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -6,13 +6,15 @@ import { import { css, Theme } from '@theme-ui/css' import * as React from 'react' import deepmerge from 'deepmerge' -import { version as __EMOTION_VERSION__ } from '@emotion/core/package.json' +import packageInfo from '@emotion/core/package.json' import './react-jsx' export * from '@theme-ui/css/dist/types' export * from './types' +const __EMOTION_VERSION__ = packageInfo.version + const getCSS = (props) => { if (!props.sx && !props.css) return undefined return (theme) => { diff --git a/packages/theme-ui/test/color-modes.tsx b/packages/theme-ui/test/color-modes.tsx index fdd9fb7f1..ee0b69493 100644 --- a/packages/theme-ui/test/color-modes.tsx +++ b/packages/theme-ui/test/color-modes.tsx @@ -4,9 +4,10 @@ import renderer from 'react-test-renderer' import { render, fireEvent, cleanup, act } from '@testing-library/react' import { matchers } from 'jest-emotion' import mockConsole from 'jest-mock-console' -import { version as emotionVersion } from '@emotion/core/package.json' +import packageInfo from '@emotion/core/package.json' import { jsx, ThemeProvider, useColorMode, useThemeUI } from '../src/index' +const emotionVersion = packageInfo.version const STORAGE_KEY = 'theme-ui-color-mode' afterEach(cleanup)