Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rayandrew committed Jul 6, 2018
1 parent 668bd5c commit c4c9bc6
Show file tree
Hide file tree
Showing 13 changed files with 403 additions and 287 deletions.
5 changes: 3 additions & 2 deletions examples/modal-enhance-example/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "modal-enhance-example",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"dependencies": {
"modal-enhanced-react-native-web": "^0.1.1",
"modal-enhanced-react-native-web": "^0.1.2",
"react": "^16.4.1",
"react-art": "^16.4.1",
"react-dom": "^16.4.1",
"react-native-web": "^0.8.6",
"react-scripts": "1.1.4"
Expand Down
5 changes: 3 additions & 2 deletions examples/modal-example/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "modal-example",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"dependencies": {
"modal-react-native-web": "^0.1.1",
"modal-react-native-web": "^0.1.2",
"react": "^16.4.1",
"react-art": "^16.4.1",
"react-dom": "^16.4.1",
"react-native-web": "^0.8.6",
"react-scripts": "1.1.4"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"packages/*",
"examples/*"
],
"version": "0.1.1",
"version": "0.1.2",
"registry": "https://registry.npmjs.org/"
}
16 changes: 15 additions & 1 deletion packages/modal-enhanced-react-native-web/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,24 @@
"react-native"
],
"plugins": [
["babel-plugin-transform-class-properties", {
"loose": true
}],
["transform-object-rest-spread", {
"useBuiltIns": true
}],
["transform-react-remove-prop-types", {
"mode": "wrap"
}],
["module-resolver", {
"alias": {
"react-native": ["react-native-web"]
}
}]
]
],
"env": {
"commonjs": {
"plugins": ["add-module-exports"]
}
}
}
15 changes: 11 additions & 4 deletions packages/modal-enhanced-react-native-web/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{
"name": "modal-enhanced-react-native-web",
"version": "0.1.1",
"version": "0.1.2",
"description": "React native modal enhanced for web",
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/index.js",
"repository": "https://github.com/rayandrews/react-native-web-modal/packages/modal-enhanced-react-native-web",
"author": "Ray Andrew <raydreww@gmail.com>",
"license": "MIT",
"private": false,
"scripts": {
"build": "webpack",
"build": "yarn clean && yarn build:cjs && yarn build:umd",
"build:cjs": "BABEL_ENV=commonjs webpack --config webpack.config.cjs.js",
"build:umd": "webpack --config webpack.config.umd.js",
"build:watch": "yarn build -w",
"clean": "rimraf dist"
},
Expand All @@ -25,7 +28,7 @@
],
"dependencies": {
"babel-runtime": "^6.26.0",
"modal-react-native-web": "^0.1.1",
"modal-react-native-web": "^0.1.2",
"prop-types": "^15.6.2",
"react": "^16.4.1",
"react-art": "^16.4.1",
Expand All @@ -35,7 +38,11 @@
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-loader": "^7.1.5",
"babel-plugin-add-module-exports": "next",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/modal-enhanced-react-native-web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const makeAnimation = (name, obj) => {

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

export default class ReactNativeModal extends Component {
class ReactNativeModal extends Component {
static propTypes = {
animationIn: PropTypes.oneOfType([PropTypes.string, PropTypes.shape]),
animationInTiming: PropTypes.number,
Expand Down Expand Up @@ -483,3 +483,6 @@ export default class ReactNativeModal extends Component {
);
}
}

export { ReactNativeModal };
export default ReactNativeModal;
66 changes: 66 additions & 0 deletions packages/modal-enhanced-react-native-web/webpack.config.cjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const path = require('path');

const libraryName = 'modal-enhanced-react-native-web';

const config = {
context: __dirname,
mode: 'production',
entry: path.resolve('./src/index.js'),
module: {
rules: [
{
test: /\.(js|jsx)$/,
include: [
path.resolve('./src'),
path.resolve('./node_modules/react-native-animatable'),
],
exclude: /node_modules\/react-native-web\//,
use: {
loader: 'babel-loader',
},
},
],
},
resolve: {
modules: ['node_modules', './src'],
alias: {
'react-native': 'react-native-web',
},
extensions: ['.js', '.jsx'],
},
output: {
path: `${__dirname}/dist/cjs`,
filename: 'index.js',
library: libraryName,
libraryTarget: 'commonjs2',
},
devtool: 'none',
externals: {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
ReactDOM: {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
'react-native': {
root: 'react-native',
commonjs2: 'react-native',
commonjs: 'react-native',
amd: 'react-native',
},
'react-native-web': {
root: 'react-native-web',
commonjs2: 'react-native-web',
commonjs: 'react-native-web',
amd: 'react-native-web',
},
},
};

module.exports = config;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');

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

const config = {
context: __dirname,
Expand All @@ -14,30 +14,28 @@ const config = {
path.resolve('./src'),
path.resolve('./node_modules/react-native-animatable'),
],
// include: [path.resolve('./src'), /node_modules\/react-native-/],
// react-native-web is already compiled.
exclude: /node_modules\/react-native-web\//,
use: {
loader: 'babel-loader',
},
},
],
},
resolve: {
modules: ['node_modules', './src'],
alias: {
'react-native': 'react-native-web',
},
extensions: ['.js', '.jsx'],
},
output: {
path: `${__dirname}/dist`,
filename: 'index.js',
library: libraryName,
libraryTarget: 'umd',
umdNamedDefine: true,
},
devtool: 'source-map',
resolve: {
modules: ['node_modules', './src'],
alias: {
'react-native': 'react-native-web',
},
extensions: ['.js', '.jsx'],
},
devtool: 'none',
externals: {
react: {
root: 'React',
Expand Down
18 changes: 16 additions & 2 deletions packages/modal-react-native-web/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,24 @@
"minify"
],
"plugins": [
"transform-runtime", ["module-resolver", {
["babel-plugin-transform-class-properties", {
"loose": true
}],
["babel-plugin-transform-object-rest-spread", {
"useBuiltIns": true
}],
["babel-plugin-transform-react-remove-prop-types", {
"mode": "wrap"
}],
["module-resolver", {
"alias": {
"react-native": ["react-native-web"]
}
}]
]
],
"env": {
"commonjs": {
"plugins": ["add-module-exports"]
}
}
}
14 changes: 10 additions & 4 deletions packages/modal-react-native-web/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "modal-react-native-web",
"version": "0.1.1",
"version": "0.1.2",
"description": "React native modal implementation for web",
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/index.js",
"repository": "https://github.com/rayandrews/react-native-web-modal",
"author": "Ray Andrew <raydreww@gmail.com>",
"license": "MIT",
Expand All @@ -19,14 +20,19 @@
"react-native-animatable"
],
"scripts": {
"build": "BABEL_ENV=production babel src -d dist --source-maps --copy-files",
"build": "yarn clean && yarn build:es5 && yarn build:commonjs",
"build:es5": "BABEL_ENV=production babel src -d dist --ignore \"**/__tests__\"",
"build:commonjs": "BABEL_ENV=commonjs babel src -d dist/cjs --ignore \"**/__tests__\"",
"build:watch": "yarn build -w",
"clean": "rimraf dist"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-add-module-exports": "next",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-minify": "^0.4.3",
Expand Down
Loading

0 comments on commit c4c9bc6

Please sign in to comment.