Skip to content

Commit 76ee113

Browse files
Merge pull request #517 from airbnb/f/fix-entrypoint
2 parents 23d79b0 + 2f10718 commit 76ee113

File tree

7 files changed

+56
-56
lines changed

7 files changed

+56
-56
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This project adheres to [Semantic Versioning](http://semver.org/). Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/airbnb/react-sketchapp/releases) page.
44

5+
## Version 3.2.5
6+
7+
- Fix Skpm taking the wrong entry point when requiring react-sketchapp
8+
59
## Version 3.2.4
610

711
- Fix the generated ES package

examples/basic-svg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Jon Gold <jon.gold@airbnb.com>",
1717
"license": "MIT",
1818
"devDependencies": {
19-
"@skpm/builder": "^0.4.0"
19+
"@skpm/builder": "^0.7.5"
2020
},
2121
"dependencies": {
2222
"prop-types": "^15.5.8",

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"name": "react-sketchapp",
3-
"version": "3.2.4",
3+
"version": "3.2.5",
44
"description": "A React renderer for Sketch.app",
55
"sideEffects": false,
66
"main": "lib/index.js",
77
"module": "lib/module/index.js",
8-
"sketch": "lib/module/index.sketch.js",
98
"types": "lib/index.d.ts",
109
"license": "MIT",
1110
"author": "Jon Gold <jon.gold@airbnb.com> (http://jon.gold)",

src/index.sketch.ts renamed to src/entrypoint.sketch.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,3 @@ export function makeSymbol(
3737
}
3838

3939
export const TextStyles = _TextStyles(() => SketchBridge);
40-
41-
export * from './index.common';

src/entrypoint.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { render as _render } from './render';
2+
import { renderToJSON as _renderToJSON } from './renderToJSON';
3+
import { makeSymbol as _makeSymbol, SymbolMasterProps } from './symbol';
4+
5+
import {
6+
SketchLayer,
7+
WrappedSketchLayer,
8+
SketchDocumentData,
9+
WrappedSketchDocument,
10+
SketchDocument,
11+
PlatformBridge,
12+
} from './types';
13+
14+
import { TextStyles as _TextStyles } from './sharedStyles/TextStyles';
15+
16+
function getDefaultPlatformBridge() {
17+
return require('./platformBridges/macos').default;
18+
}
19+
20+
export function render(
21+
element: React.ReactElement,
22+
container?: SketchLayer | WrappedSketchLayer,
23+
platformBridge: PlatformBridge = getDefaultPlatformBridge(),
24+
) {
25+
return _render(platformBridge)(element, container);
26+
}
27+
28+
export function renderToJSON(
29+
element: React.ReactElement,
30+
platformBridge: PlatformBridge = getDefaultPlatformBridge(),
31+
) {
32+
return _renderToJSON(platformBridge)(element);
33+
}
34+
35+
export function makeSymbol(
36+
Component: React.ComponentType<any>,
37+
symbolProps: string | SymbolMasterProps,
38+
document: SketchDocumentData | SketchDocument | WrappedSketchDocument | undefined,
39+
bridge: PlatformBridge = getDefaultPlatformBridge(),
40+
) {
41+
return _makeSymbol(bridge)(Component, symbolProps, document);
42+
}
43+
44+
export const TextStyles = _TextStyles(() => getDefaultPlatformBridge());

src/index.common.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/index.ts

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,7 @@
1-
import { render as _render } from './render';
2-
import { renderToJSON as _renderToJSON } from './renderToJSON';
3-
import { makeSymbol as _makeSymbol, SymbolMasterProps } from './symbol';
1+
export { Platform } from './Platform';
2+
export { StyleSheet } from './stylesheet';
3+
export { getSymbolComponentByName, getSymbolMasterByName, injectSymbols } from './symbol';
4+
export { useWindowDimensions } from './context';
45

5-
import {
6-
SketchLayer,
7-
WrappedSketchLayer,
8-
SketchDocumentData,
9-
WrappedSketchDocument,
10-
SketchDocument,
11-
PlatformBridge,
12-
} from './types';
13-
14-
import { TextStyles as _TextStyles } from './sharedStyles/TextStyles';
15-
16-
function getDefaultPlatformBridge() {
17-
return require('./platformBridges/macos').default;
18-
}
19-
20-
export function render(
21-
element: React.ReactElement,
22-
container?: SketchLayer | WrappedSketchLayer,
23-
platformBridge: PlatformBridge = getDefaultPlatformBridge(),
24-
) {
25-
return _render(platformBridge)(element, container);
26-
}
27-
28-
export function renderToJSON(
29-
element: React.ReactElement,
30-
platformBridge: PlatformBridge = getDefaultPlatformBridge(),
31-
) {
32-
return _renderToJSON(platformBridge)(element);
33-
}
34-
35-
export function makeSymbol(
36-
Component: React.ComponentType<any>,
37-
symbolProps: string | SymbolMasterProps,
38-
document: SketchDocumentData | SketchDocument | WrappedSketchDocument | undefined,
39-
bridge: PlatformBridge = getDefaultPlatformBridge(),
40-
) {
41-
return _makeSymbol(bridge)(Component, symbolProps, document);
42-
}
43-
44-
export const TextStyles = _TextStyles(() => getDefaultPlatformBridge());
45-
46-
export * from './index.common';
6+
export * from './components';
7+
export * from './entrypoint';

0 commit comments

Comments
 (0)