Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit c4c9bc6

Browse files
committed
v0.1.2
1 parent 668bd5c commit c4c9bc6

File tree

13 files changed

+403
-287
lines changed

13 files changed

+403
-287
lines changed

examples/modal-enhance-example/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "modal-enhance-example",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"private": true,
55
"dependencies": {
6-
"modal-enhanced-react-native-web": "^0.1.1",
6+
"modal-enhanced-react-native-web": "^0.1.2",
77
"react": "^16.4.1",
8+
"react-art": "^16.4.1",
89
"react-dom": "^16.4.1",
910
"react-native-web": "^0.8.6",
1011
"react-scripts": "1.1.4"

examples/modal-example/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "modal-example",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"private": true,
55
"dependencies": {
6-
"modal-react-native-web": "^0.1.1",
6+
"modal-react-native-web": "^0.1.2",
77
"react": "^16.4.1",
8+
"react-art": "^16.4.1",
89
"react-dom": "^16.4.1",
910
"react-native-web": "^0.8.6",
1011
"react-scripts": "1.1.4"

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"packages/*",
77
"examples/*"
88
],
9-
"version": "0.1.1",
9+
"version": "0.1.2",
1010
"registry": "https://registry.npmjs.org/"
1111
}

packages/modal-enhanced-react-native-web/.babelrc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,24 @@
66
"react-native"
77
],
88
"plugins": [
9+
["babel-plugin-transform-class-properties", {
10+
"loose": true
11+
}],
12+
["transform-object-rest-spread", {
13+
"useBuiltIns": true
14+
}],
15+
["transform-react-remove-prop-types", {
16+
"mode": "wrap"
17+
}],
918
["module-resolver", {
1019
"alias": {
1120
"react-native": ["react-native-web"]
1221
}
1322
}]
14-
]
23+
],
24+
"env": {
25+
"commonjs": {
26+
"plugins": ["add-module-exports"]
27+
}
28+
}
1529
}

packages/modal-enhanced-react-native-web/package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
22
"name": "modal-enhanced-react-native-web",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "React native modal enhanced for web",
5-
"main": "dist/index.js",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/index.js",
67
"repository": "https://github.com/rayandrews/react-native-web-modal/packages/modal-enhanced-react-native-web",
78
"author": "Ray Andrew <[email protected]>",
89
"license": "MIT",
910
"private": false,
1011
"scripts": {
11-
"build": "webpack",
12+
"build": "yarn clean && yarn build:cjs && yarn build:umd",
13+
"build:cjs": "BABEL_ENV=commonjs webpack --config webpack.config.cjs.js",
14+
"build:umd": "webpack --config webpack.config.umd.js",
1215
"build:watch": "yarn build -w",
1316
"clean": "rimraf dist"
1417
},
@@ -25,7 +28,7 @@
2528
],
2629
"dependencies": {
2730
"babel-runtime": "^6.26.0",
28-
"modal-react-native-web": "^0.1.1",
31+
"modal-react-native-web": "^0.1.2",
2932
"prop-types": "^15.6.2",
3033
"react": "^16.4.1",
3134
"react-art": "^16.4.1",
@@ -35,7 +38,11 @@
3538
"devDependencies": {
3639
"babel-cli": "^6.26.0",
3740
"babel-loader": "^7.1.5",
41+
"babel-plugin-add-module-exports": "next",
3842
"babel-plugin-module-resolver": "^3.1.1",
43+
"babel-plugin-transform-class-properties": "^6.24.1",
44+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
45+
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
3946
"babel-plugin-transform-runtime": "^6.23.0",
4047
"babel-polyfill": "^6.26.0",
4148
"babel-preset-env": "^1.7.0",

packages/modal-enhanced-react-native-web/src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const makeAnimation = (name, obj) => {
3737

3838
const isObject = (obj) => obj !== null && typeof obj === 'object';
3939

40-
export default class ReactNativeModal extends Component {
40+
class ReactNativeModal extends Component {
4141
static propTypes = {
4242
animationIn: PropTypes.oneOfType([PropTypes.string, PropTypes.shape]),
4343
animationInTiming: PropTypes.number,
@@ -483,3 +483,6 @@ export default class ReactNativeModal extends Component {
483483
);
484484
}
485485
}
486+
487+
export { ReactNativeModal };
488+
export default ReactNativeModal;
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
const path = require('path');
2+
3+
const libraryName = 'modal-enhanced-react-native-web';
4+
5+
const config = {
6+
context: __dirname,
7+
mode: 'production',
8+
entry: path.resolve('./src/index.js'),
9+
module: {
10+
rules: [
11+
{
12+
test: /\.(js|jsx)$/,
13+
include: [
14+
path.resolve('./src'),
15+
path.resolve('./node_modules/react-native-animatable'),
16+
],
17+
exclude: /node_modules\/react-native-web\//,
18+
use: {
19+
loader: 'babel-loader',
20+
},
21+
},
22+
],
23+
},
24+
resolve: {
25+
modules: ['node_modules', './src'],
26+
alias: {
27+
'react-native': 'react-native-web',
28+
},
29+
extensions: ['.js', '.jsx'],
30+
},
31+
output: {
32+
path: `${__dirname}/dist/cjs`,
33+
filename: 'index.js',
34+
library: libraryName,
35+
libraryTarget: 'commonjs2',
36+
},
37+
devtool: 'none',
38+
externals: {
39+
react: {
40+
root: 'React',
41+
commonjs2: 'react',
42+
commonjs: 'react',
43+
amd: 'react',
44+
},
45+
ReactDOM: {
46+
root: 'ReactDOM',
47+
commonjs2: 'react-dom',
48+
commonjs: 'react-dom',
49+
amd: 'react-dom',
50+
},
51+
'react-native': {
52+
root: 'react-native',
53+
commonjs2: 'react-native',
54+
commonjs: 'react-native',
55+
amd: 'react-native',
56+
},
57+
'react-native-web': {
58+
root: 'react-native-web',
59+
commonjs2: 'react-native-web',
60+
commonjs: 'react-native-web',
61+
amd: 'react-native-web',
62+
},
63+
},
64+
};
65+
66+
module.exports = config;

packages/modal-enhanced-react-native-web/webpack.config.js renamed to packages/modal-enhanced-react-native-web/webpack.config.umd.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path');
22

3-
const libraryName = 'modal-animated-react-native-web';
3+
const libraryName = 'modal-enhanced-react-native-web';
44

55
const config = {
66
context: __dirname,
@@ -14,30 +14,28 @@ const config = {
1414
path.resolve('./src'),
1515
path.resolve('./node_modules/react-native-animatable'),
1616
],
17-
// include: [path.resolve('./src'), /node_modules\/react-native-/],
18-
// react-native-web is already compiled.
1917
exclude: /node_modules\/react-native-web\//,
2018
use: {
2119
loader: 'babel-loader',
2220
},
2321
},
2422
],
2523
},
26-
resolve: {
27-
modules: ['node_modules', './src'],
28-
alias: {
29-
'react-native': 'react-native-web',
30-
},
31-
extensions: ['.js', '.jsx'],
32-
},
3324
output: {
3425
path: `${__dirname}/dist`,
3526
filename: 'index.js',
3627
library: libraryName,
3728
libraryTarget: 'umd',
3829
umdNamedDefine: true,
3930
},
40-
devtool: 'source-map',
31+
resolve: {
32+
modules: ['node_modules', './src'],
33+
alias: {
34+
'react-native': 'react-native-web',
35+
},
36+
extensions: ['.js', '.jsx'],
37+
},
38+
devtool: 'none',
4139
externals: {
4240
react: {
4341
root: 'React',

packages/modal-react-native-web/.babelrc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,24 @@
77
"minify"
88
],
99
"plugins": [
10-
"transform-runtime", ["module-resolver", {
10+
["babel-plugin-transform-class-properties", {
11+
"loose": true
12+
}],
13+
["babel-plugin-transform-object-rest-spread", {
14+
"useBuiltIns": true
15+
}],
16+
["babel-plugin-transform-react-remove-prop-types", {
17+
"mode": "wrap"
18+
}],
19+
["module-resolver", {
1120
"alias": {
1221
"react-native": ["react-native-web"]
1322
}
1423
}]
15-
]
24+
],
25+
"env": {
26+
"commonjs": {
27+
"plugins": ["add-module-exports"]
28+
}
29+
}
1630
}

packages/modal-react-native-web/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "modal-react-native-web",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "React native modal implementation for web",
5-
"main": "dist/index.js",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/index.js",
67
"repository": "https://github.com/rayandrews/react-native-web-modal",
78
"author": "Ray Andrew <[email protected]>",
89
"license": "MIT",
@@ -19,14 +20,19 @@
1920
"react-native-animatable"
2021
],
2122
"scripts": {
22-
"build": "BABEL_ENV=production babel src -d dist --source-maps --copy-files",
23+
"build": "yarn clean && yarn build:es5 && yarn build:commonjs",
24+
"build:es5": "BABEL_ENV=production babel src -d dist --ignore \"**/__tests__\"",
25+
"build:commonjs": "BABEL_ENV=commonjs babel src -d dist/cjs --ignore \"**/__tests__\"",
2326
"build:watch": "yarn build -w",
2427
"clean": "rimraf dist"
2528
},
2629
"devDependencies": {
2730
"babel-cli": "^6.26.0",
31+
"babel-plugin-add-module-exports": "next",
2832
"babel-plugin-module-resolver": "^3.1.1",
29-
"babel-plugin-transform-runtime": "^6.23.0",
33+
"babel-plugin-transform-class-properties": "^6.24.1",
34+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
35+
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
3036
"babel-polyfill": "^6.26.0",
3137
"babel-preset-env": "^1.7.0",
3238
"babel-preset-minify": "^0.4.3",

0 commit comments

Comments
 (0)