instantsearch-ui-components 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Highlight.js +64 -0
- package/dist/cjs/components/Hits.js +48 -0
- package/dist/cjs/components/index.js +27 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/lib/cx.js +17 -0
- package/dist/cjs/lib/index.js +16 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types/Renderer.js +1 -0
- package/dist/cjs/types/index.js +16 -0
- package/dist/cjs/version.js +8 -0
- package/dist/es/components/Highlight.js +2 -6
- package/dist/es/components/Hits.d.ts +40 -0
- package/dist/es/components/Hits.js +42 -0
- package/dist/es/components/index.d.ts +1 -0
- package/dist/es/components/index.js +2 -1
- package/dist/es/lib/cx.d.ts +3 -1
- package/dist/es/lib/cx.js +6 -1
- package/dist/es/version.d.ts +1 -1
- package/dist/es/version.js +1 -1
- package/package.json +13 -7
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createHighlightComponent = createHighlightComponent;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _lib = require("../lib");
|
|
11
|
+
var _excluded = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
|
|
12
|
+
function createHighlightPartComponent(_ref) {
|
|
13
|
+
var createElement = _ref.createElement;
|
|
14
|
+
return function HighlightPart(_ref2) {
|
|
15
|
+
var classNames = _ref2.classNames,
|
|
16
|
+
children = _ref2.children,
|
|
17
|
+
highlightedTagName = _ref2.highlightedTagName,
|
|
18
|
+
isHighlighted = _ref2.isHighlighted,
|
|
19
|
+
nonHighlightedTagName = _ref2.nonHighlightedTagName;
|
|
20
|
+
var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;
|
|
21
|
+
return createElement(TagName, {
|
|
22
|
+
className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted
|
|
23
|
+
}, children);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createHighlightComponent(_ref3) {
|
|
27
|
+
var createElement = _ref3.createElement,
|
|
28
|
+
Fragment = _ref3.Fragment;
|
|
29
|
+
var HighlightPart = createHighlightPartComponent({
|
|
30
|
+
createElement: createElement,
|
|
31
|
+
Fragment: Fragment
|
|
32
|
+
});
|
|
33
|
+
return function Highlight(userProps) {
|
|
34
|
+
var parts = userProps.parts,
|
|
35
|
+
_userProps$highlighte = userProps.highlightedTagName,
|
|
36
|
+
highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
|
|
37
|
+
_userProps$nonHighlig = userProps.nonHighlightedTagName,
|
|
38
|
+
nonHighlightedTagName = _userProps$nonHighlig === void 0 ? 'span' : _userProps$nonHighlig,
|
|
39
|
+
_userProps$separator = userProps.separator,
|
|
40
|
+
separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,
|
|
41
|
+
className = userProps.className,
|
|
42
|
+
_userProps$classNames = userProps.classNames,
|
|
43
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
44
|
+
props = (0, _objectWithoutProperties2.default)(userProps, _excluded);
|
|
45
|
+
return createElement("span", (0, _extends2.default)({}, props, {
|
|
46
|
+
className: (0, _lib.cx)(classNames.root, className)
|
|
47
|
+
}), parts.map(function (part, partIndex) {
|
|
48
|
+
var isLastPart = partIndex === parts.length - 1;
|
|
49
|
+
return createElement(Fragment, {
|
|
50
|
+
key: partIndex
|
|
51
|
+
}, part.map(function (subPart, subPartIndex) {
|
|
52
|
+
return createElement(HighlightPart, {
|
|
53
|
+
key: subPartIndex,
|
|
54
|
+
classNames: classNames,
|
|
55
|
+
highlightedTagName: highlightedTagName,
|
|
56
|
+
nonHighlightedTagName: nonHighlightedTagName,
|
|
57
|
+
isHighlighted: subPart.isHighlighted
|
|
58
|
+
}, subPart.value);
|
|
59
|
+
}), !isLastPart && createElement("span", {
|
|
60
|
+
className: classNames.separator
|
|
61
|
+
}, separator));
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createHitsComponent = createHitsComponent;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _lib = require("../lib");
|
|
11
|
+
var _excluded = ["classNames", "hits", "itemComponent", "sendEvent", "emptyComponent"];
|
|
12
|
+
// Should be imported from a shared package in the future
|
|
13
|
+
|
|
14
|
+
function createHitsComponent(_ref) {
|
|
15
|
+
var createElement = _ref.createElement;
|
|
16
|
+
return function Hits(userProps) {
|
|
17
|
+
var _userProps$classNames = userProps.classNames,
|
|
18
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
19
|
+
hits = userProps.hits,
|
|
20
|
+
ItemComponent = userProps.itemComponent,
|
|
21
|
+
sendEvent = userProps.sendEvent,
|
|
22
|
+
EmptyComponent = userProps.emptyComponent,
|
|
23
|
+
props = (0, _objectWithoutProperties2.default)(userProps, _excluded);
|
|
24
|
+
if (hits.length === 0 && EmptyComponent) {
|
|
25
|
+
return createElement(EmptyComponent, {
|
|
26
|
+
className: (0, _lib.cx)('ais-Hits', classNames.root, (0, _lib.cx)('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return createElement("div", (0, _extends2.default)({}, props, {
|
|
30
|
+
className: (0, _lib.cx)('ais-Hits', classNames.root, hits.length === 0 && (0, _lib.cx)('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
31
|
+
}), createElement("ol", {
|
|
32
|
+
className: (0, _lib.cx)('ais-Hits-list', classNames.list)
|
|
33
|
+
}, hits.map(function (hit, index) {
|
|
34
|
+
return createElement(ItemComponent, {
|
|
35
|
+
key: hit.objectID,
|
|
36
|
+
hit: hit,
|
|
37
|
+
index: index,
|
|
38
|
+
className: (0, _lib.cx)('ais-Hits-item', classNames.item),
|
|
39
|
+
onClick: function onClick() {
|
|
40
|
+
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
41
|
+
},
|
|
42
|
+
onAuxClick: function onAuxClick() {
|
|
43
|
+
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
})));
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Highlight = require("./Highlight");
|
|
7
|
+
Object.keys(_Highlight).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Highlight[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _Highlight[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _Hits = require("./Hits");
|
|
18
|
+
Object.keys(_Hits).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _Hits[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _Hits[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _components = require("./components");
|
|
7
|
+
Object.keys(_components).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _components[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _components[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _lib = require("./lib");
|
|
18
|
+
Object.keys(_lib).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _lib[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _lib[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _types = require("./types");
|
|
29
|
+
Object.keys(_types).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _types[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cx = cx;
|
|
7
|
+
function cx() {
|
|
8
|
+
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
+
classNames[_key] = arguments[_key];
|
|
10
|
+
}
|
|
11
|
+
return classNames.reduce(function (acc, className) {
|
|
12
|
+
if (Array.isArray(className)) {
|
|
13
|
+
return acc.concat(className);
|
|
14
|
+
}
|
|
15
|
+
return acc.concat([className]);
|
|
16
|
+
}, []).filter(Boolean).join(' ');
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _cx = require("./cx");
|
|
7
|
+
Object.keys(_cx).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _cx[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _cx[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs", "sideEffects": false }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Renderer = require("./Renderer");
|
|
7
|
+
Object.keys(_Renderer).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Renderer[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _Renderer[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
1
3
|
var _excluded = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
-
/** @jsx createElement */
|
|
6
4
|
import { cx } from "../lib/index.js";
|
|
7
5
|
function createHighlightPartComponent(_ref) {
|
|
8
6
|
var createElement = _ref.createElement;
|
|
@@ -26,8 +24,6 @@ export function createHighlightComponent(_ref3) {
|
|
|
26
24
|
Fragment: Fragment
|
|
27
25
|
});
|
|
28
26
|
return function Highlight(userProps) {
|
|
29
|
-
// Not destructured in function signature, to make sure it's not exposed in
|
|
30
|
-
// the type definition.
|
|
31
27
|
var parts = userProps.parts,
|
|
32
28
|
_userProps$highlighte = userProps.highlightedTagName,
|
|
33
29
|
highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ComponentProps, Renderer } from '../types';
|
|
2
|
+
type Hit = Record<string, unknown> & {
|
|
3
|
+
objectID: string;
|
|
4
|
+
};
|
|
5
|
+
type SendEventForHits = (...props: unknown[]) => void;
|
|
6
|
+
export type HitsProps<THit> = ComponentProps<'div'> & {
|
|
7
|
+
hits: THit[];
|
|
8
|
+
itemComponent: (props: {
|
|
9
|
+
hit: THit;
|
|
10
|
+
index: number;
|
|
11
|
+
className: string;
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
onAuxClick: () => void;
|
|
14
|
+
}) => JSX.Element;
|
|
15
|
+
sendEvent: SendEventForHits;
|
|
16
|
+
classNames?: Partial<HitsClassNames>;
|
|
17
|
+
emptyComponent?: (props: {
|
|
18
|
+
className: string;
|
|
19
|
+
}) => JSX.Element;
|
|
20
|
+
};
|
|
21
|
+
export type HitsClassNames = {
|
|
22
|
+
/**
|
|
23
|
+
* Class names to apply to the root element
|
|
24
|
+
*/
|
|
25
|
+
root: string | string[];
|
|
26
|
+
/**
|
|
27
|
+
* Class names to apply to the root element without results
|
|
28
|
+
*/
|
|
29
|
+
emptyRoot: string | string[];
|
|
30
|
+
/**
|
|
31
|
+
* Class names to apply to the list element
|
|
32
|
+
*/
|
|
33
|
+
list: string | string[];
|
|
34
|
+
/**
|
|
35
|
+
* Class names to apply to each item element
|
|
36
|
+
*/
|
|
37
|
+
item: string | string[];
|
|
38
|
+
};
|
|
39
|
+
export declare function createHitsComponent({ createElement }: Renderer): <THit extends Hit>(userProps: HitsProps<THit>) => JSX.Element;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["classNames", "hits", "itemComponent", "sendEvent", "emptyComponent"];
|
|
4
|
+
import { cx } from "../lib/index.js";
|
|
5
|
+
|
|
6
|
+
// Should be imported from a shared package in the future
|
|
7
|
+
|
|
8
|
+
export function createHitsComponent(_ref) {
|
|
9
|
+
var createElement = _ref.createElement;
|
|
10
|
+
return function Hits(userProps) {
|
|
11
|
+
var _userProps$classNames = userProps.classNames,
|
|
12
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
13
|
+
hits = userProps.hits,
|
|
14
|
+
ItemComponent = userProps.itemComponent,
|
|
15
|
+
sendEvent = userProps.sendEvent,
|
|
16
|
+
EmptyComponent = userProps.emptyComponent,
|
|
17
|
+
props = _objectWithoutProperties(userProps, _excluded);
|
|
18
|
+
if (hits.length === 0 && EmptyComponent) {
|
|
19
|
+
return createElement(EmptyComponent, {
|
|
20
|
+
className: cx('ais-Hits', classNames.root, cx('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return createElement("div", _extends({}, props, {
|
|
24
|
+
className: cx('ais-Hits', classNames.root, hits.length === 0 && cx('ais-Hits--empty', classNames.emptyRoot), props.className)
|
|
25
|
+
}), createElement("ol", {
|
|
26
|
+
className: cx('ais-Hits-list', classNames.list)
|
|
27
|
+
}, hits.map(function (hit, index) {
|
|
28
|
+
return createElement(ItemComponent, {
|
|
29
|
+
key: hit.objectID,
|
|
30
|
+
hit: hit,
|
|
31
|
+
index: index,
|
|
32
|
+
className: cx('ais-Hits-item', classNames.item),
|
|
33
|
+
onClick: function onClick() {
|
|
34
|
+
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
35
|
+
},
|
|
36
|
+
onAuxClick: function onAuxClick() {
|
|
37
|
+
sendEvent('click:internal', hit, 'Hit Clicked');
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
})));
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./Highlight.js";
|
|
1
|
+
export * from "./Highlight.js";
|
|
2
|
+
export * from "./Hits.js";
|
package/dist/es/lib/cx.d.ts
CHANGED
package/dist/es/lib/cx.js
CHANGED
|
@@ -2,5 +2,10 @@ export function cx() {
|
|
|
2
2
|
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3
3
|
classNames[_key] = arguments[_key];
|
|
4
4
|
}
|
|
5
|
-
return classNames.
|
|
5
|
+
return classNames.reduce(function (acc, className) {
|
|
6
|
+
if (Array.isArray(className)) {
|
|
7
|
+
return acc.concat(className);
|
|
8
|
+
}
|
|
9
|
+
return acc.concat([className]);
|
|
10
|
+
}, []).filter(Boolean).join(' ');
|
|
6
11
|
}
|
package/dist/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.
|
|
1
|
+
declare const _default: "0.4.0";
|
|
2
2
|
export default _default;
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '0.
|
|
1
|
+
export default '0.4.0';
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "instantsearch-ui-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Common UI components for InstantSearch.",
|
|
5
|
-
"source": "src/index.ts",
|
|
6
5
|
"types": "dist/es/index.d.ts",
|
|
7
|
-
"main": "dist/
|
|
6
|
+
"main": "dist/cjs/index.js",
|
|
8
7
|
"module": "dist/es/index.js",
|
|
9
8
|
"type": "module",
|
|
10
9
|
"exports": {
|
|
11
10
|
"types": "./dist/es/index.d.ts",
|
|
11
|
+
"require": "./dist/cjs/index.js",
|
|
12
12
|
"default": "./dist/es/index.js"
|
|
13
13
|
},
|
|
14
14
|
"sideEffects": false,
|
|
@@ -38,10 +38,16 @@
|
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
40
|
"clean": "rm -rf dist",
|
|
41
|
-
"build": "yarn build:es && yarn build:types",
|
|
42
|
-
"build:es": "BABEL_ENV=es babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/es --ignore '**/__tests__/**/*','**/__mocks__/**/*'
|
|
41
|
+
"build": "yarn build:cjs && yarn build:es && yarn build:types",
|
|
42
|
+
"build:es:base": "BABEL_ENV=es babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/es --ignore '**/__tests__/**/*','**/__mocks__/**/*'",
|
|
43
|
+
"build:es": "yarn build:es:base --quiet",
|
|
44
|
+
"build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/cjs --ignore '**/__tests__/**/*','**/__mocks__/**/*' --quiet && ../../scripts/prepare-cjs.sh",
|
|
43
45
|
"build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/es",
|
|
44
|
-
"version": "./scripts/version.cjs"
|
|
46
|
+
"version": "./scripts/version.cjs",
|
|
47
|
+
"watch:es": "yarn --silent build:es:base --watch"
|
|
45
48
|
},
|
|
46
|
-
"
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@babel/runtime": "^7.1.2"
|
|
51
|
+
},
|
|
52
|
+
"gitHead": "358f849cba15cbbb415da05feb582b47358aa239"
|
|
47
53
|
}
|