Use lowercase entry points for event modules (#15535)
Matches npm convention
Andrew Clark committed
Apr 29, 2019 at 16:25 UTC
7882c41f607ee5273da9637da0bb20ca7634cb83
13 files changed
+77
-42
packages/react-events/drag.js
new
+14
@@ -0,0 +1,14 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ */
9
+
10
+'use strict';
11
+
12
+const Drag = require('./src/Drag');
13
+
14
+module.exports = Drag.default || Drag;
packages/react-events/focus-scope.js
renamed
packages/react-events/focus.js
new
+14
@@ -0,0 +1,14 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ */
9
+
10
+'use strict';
11
+
12
+const Focus = require('./src/Focus');
13
+
14
+module.exports = Focus.default || Focus;
packages/react-events/hover.js
new
+14
@@ -0,0 +1,14 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ */
9
+
10
+'use strict';
11
+
12
+const Hover = require('./src/Hover');
13
+
14
+module.exports = Hover.default || Hover;
packages/react-events/npm/Drag.js
deleted
-7
@@ -1,7 +0,0 @@
1
-'use strict';
2
-
3
-if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./cjs/react-events-drag.production.min.js');
5
-} else {
6
- module.exports = require('./cjs/react-events-drag.development.js');
7
-}
packages/react-events/npm/Focus.js
deleted
-7
@@ -1,7 +0,0 @@
1
-'use strict';
2
-
3
-if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./cjs/react-events-focus.production.min.js');
5
-} else {
6
- module.exports = require('./cjs/react-events-focus.development.js');
7
-}
packages/react-events/npm/Hover.js
deleted
-7
@@ -1,7 +0,0 @@
1
-'use strict';
2
-
3
-if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./cjs/react-events-hover.production.min.js');
5
-} else {
6
- module.exports = require('./cjs/react-events-hover.development.js');
7
-}
packages/react-events/npm/Press.js
deleted
-7
@@ -1,7 +0,0 @@
1
-'use strict';
2
-
3
-if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./cjs/react-events-press.production.min.js');
5
-} else {
6
- module.exports = require('./cjs/react-events-press.development.js');
7
-}
packages/react-events/npm/Swipe.js
deleted
-7
@@ -1,7 +0,0 @@
1
-'use strict';
2
-
3
-if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./cjs/react-events-swipe.production.min.js');
5
-} else {
6
- module.exports = require('./cjs/react-events-swipe.development.js');
7
-}
packages/react-events/press.js
new
+14
@@ -0,0 +1,14 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ */
9
+
10
+'use strict';
11
+
12
+const Press = require('./src/Press');
13
+
14
+module.exports = Press.default || Press;
packages/react-events/src/__tests__/FocusScope-test.internal.js
+1
-1
@@ -42,7 +42,7 @@ describe('FocusScope event responder', () => {
42
ReactFeatureFlags.enableEventAPI = true;
43
React = require('react');
44
ReactDOM = require('react-dom');
45
- FocusScope = require('react-events/FocusScope');
45
+ FocusScope = require('react-events/focus-scope');
46
47
container = document.createElement('div');
48
document.body.appendChild(container);
packages/react-events/swipe.js
new
+14
@@ -0,0 +1,14 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ */
9
+
10
+'use strict';
11
+
12
+const Swipe = require('./src/Swipe');
13
+
14
+module.exports = Swipe.default || Swipe;
scripts/rollup/bundles.js
+6
-6
@@ -487,7 +487,7 @@ const bundles = [
487
FB_WWW_PROD,
488
],
489
moduleType: NON_FIBER_RENDERER,
490
- entry: 'react-events/Press',
490
+ entry: 'react-events/press',
491
global: 'ReactEventsPress',
492
externals: [],
493
},
@@ -502,7 +502,7 @@ const bundles = [
502
FB_WWW_PROD,
503
],
504
moduleType: NON_FIBER_RENDERER,
505
- entry: 'react-events/Hover',
505
+ entry: 'react-events/hover',
506
global: 'ReactEventsHover',
507
externals: [],
508
},
@@ -517,7 +517,7 @@ const bundles = [
517
FB_WWW_PROD,
518
],
519
moduleType: NON_FIBER_RENDERER,
520
- entry: 'react-events/Focus',
520
+ entry: 'react-events/focus',
521
global: 'ReactEventsFocus',
522
externals: [],
523
},
@@ -532,7 +532,7 @@ const bundles = [
532
FB_WWW_PROD,
533
],
534
moduleType: NON_FIBER_RENDERER,
535
- entry: 'react-events/FocusScope',
535
+ entry: 'react-events/focus-scope',
536
global: 'ReactEventsFocusScope',
537
externals: [],
538
},
@@ -547,7 +547,7 @@ const bundles = [
547
FB_WWW_PROD,
548
],
549
moduleType: NON_FIBER_RENDERER,
550
- entry: 'react-events/Swipe',
550
+ entry: 'react-events/swipe',
551
global: 'ReactEventsSwipe',
552
externals: [],
553
},
@@ -562,7 +562,7 @@ const bundles = [
562
FB_WWW_PROD,
563
],
564
moduleType: NON_FIBER_RENDERER,
565
- entry: 'react-events/Drag',
565
+ entry: 'react-events/drag',
566
global: 'ReactEventsDrag',
567
externals: [],
568
},