From f6c60dcbcd11c756e16b1f0e50c18ca4dc2e3953 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 23 Oct 2017 21:18:11 +0300 Subject: [PATCH] Expose react-art/{Circle,Rectange/Wedge} on npm (#11343) * Include ART shapes into npm package * Fix the fixture * Prettier oops --- fixtures/art/VectorWidget.js | 2 +- .../npm/{lib/Circle.art.js => Circle.js} | 23 ++++--------------- .../{lib/Rectangle.art.js => Rectangle.js} | 23 ++++--------------- .../npm/{lib/Wedge.art.js => Wedge.js} | 23 ++++--------------- packages/react-art/package.json | 5 +++- 5 files changed, 20 insertions(+), 56 deletions(-) rename packages/react-art/npm/{lib/Circle.art.js => Circle.js} (70%) rename packages/react-art/npm/{lib/Rectangle.art.js => Rectangle.js} (87%) rename packages/react-art/npm/{lib/Wedge.art.js => Wedge.js} (91%) diff --git a/fixtures/art/VectorWidget.js b/fixtures/art/VectorWidget.js index c6d041f588446..8d4343c618444 100644 --- a/fixtures/art/VectorWidget.js +++ b/fixtures/art/VectorWidget.js @@ -6,7 +6,7 @@ */ 'use strict'; -var Circle = require('react-art/lib/Circle.art'); +var Circle = require('react-art/Circle'); var React = require('react'); var ReactART = require('react-art'); var Group = ReactART.Group; diff --git a/packages/react-art/npm/lib/Circle.art.js b/packages/react-art/npm/Circle.js similarity index 70% rename from packages/react-art/npm/lib/Circle.art.js rename to packages/react-art/npm/Circle.js index 7b5c3a8461de1..bad709488d7f5 100644 --- a/packages/react-art/npm/lib/Circle.art.js +++ b/packages/react-art/npm/Circle.js @@ -1,19 +1,3 @@ -'use strict'; - -var _extends = - Object.assign || - 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; - }; - /** * Copyright (c) 2013-present, Facebook, Inc. * @@ -33,9 +17,12 @@ var _extends = * */ +'use strict'; + +var assign = require('object-assign'); var PropTypes = require('prop-types'); var React = require('react'); -var ReactART = require('..'); +var ReactART = require('react-art'); var createReactClass = require('create-react-class'); @@ -61,7 +48,7 @@ var Circle = createReactClass({ .arc(0, radius * 2, radius) .arc(0, radius * -2, radius) .close(); - return React.createElement(Shape, _extends({}, this.props, {d: path})); + return React.createElement(Shape, assign({}, this.props, {d: path})); }, }); diff --git a/packages/react-art/npm/lib/Rectangle.art.js b/packages/react-art/npm/Rectangle.js similarity index 87% rename from packages/react-art/npm/lib/Rectangle.art.js rename to packages/react-art/npm/Rectangle.js index 4b2ac578d7c16..2284c517122f2 100644 --- a/packages/react-art/npm/lib/Rectangle.art.js +++ b/packages/react-art/npm/Rectangle.js @@ -1,19 +1,3 @@ -'use strict'; - -var _extends = - Object.assign || - 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; - }; - /** * Copyright (c) 2013-present, Facebook, Inc. * @@ -40,9 +24,12 @@ var _extends = * */ +'use strict'; + +var assign = require('object-assign'); var PropTypes = require('prop-types'); var React = require('react'); -var ReactART = require('..'); +var ReactART = require('react-art'); var createReactClass = require('create-react-class'); @@ -146,7 +133,7 @@ var Rectangle = createReactClass({ } path.line(0, -height + (bl + tl)); - return React.createElement(Shape, _extends({}, this.props, {d: path})); + return React.createElement(Shape, assign({}, this.props, {d: path})); }, }); diff --git a/packages/react-art/npm/lib/Wedge.art.js b/packages/react-art/npm/Wedge.js similarity index 91% rename from packages/react-art/npm/lib/Wedge.art.js rename to packages/react-art/npm/Wedge.js index c217a66f4c766..bcb671db0b82a 100644 --- a/packages/react-art/npm/lib/Wedge.art.js +++ b/packages/react-art/npm/Wedge.js @@ -1,19 +1,3 @@ -'use strict'; - -var _extends = - Object.assign || - 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; - }; - /** * Copyright (c) 2013-present, Facebook, Inc. * @@ -36,9 +20,12 @@ var _extends = * */ +'use strict'; + +var assign = require('object-assign'); var PropTypes = require('prop-types'); var React = require('react'); -var ReactART = require('..'); +var ReactART = require('react-art'); var createReactClass = require('create-react-class'); @@ -193,7 +180,7 @@ var Wedge = createReactClass({ path = this._createArcPath(startAngle, endAngle, or, ir); } - return React.createElement(Shape, _extends({}, this.props, {d: path})); + return React.createElement(Shape, assign({}, this.props, {d: path})); }, }); diff --git a/packages/react-art/package.json b/packages/react-art/package.json index e0676ca9e9c1d..94c7f9a8b19a6 100644 --- a/packages/react-art/package.json +++ b/packages/react-art/package.json @@ -33,7 +33,10 @@ "README.md", "index.js", "cjs/", - "umd/" + "umd/", + "Circle.js", + "Rectangle.js", + "Wedge.js" ], "browserify": { "transform": [