Skip to content

Commit

Permalink
release: 0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
youluna committed Apr 2, 2020
1 parent 0e4f2d7 commit 15d6668
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 24 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo

In the project directory, you can run:

### `npm start`
### `yarn start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`
### `yarn test`

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`
### `yarn build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.
Expand Down Expand Up @@ -63,6 +63,6 @@ This section has moved here: https://facebook.github.io/create-react-app/docs/ad

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

### `npm run build` fails to minify
### `yarn build` fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
10 changes: 0 additions & 10 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,5 @@ export const isProduction = () => {
//
}

if (!result) {
try {
if (window.process.env.NODE_ENV === PRODUCTION_ENV) {
result = true;
}
} catch (err) {
//
}
}

return result;
};
24 changes: 21 additions & 3 deletions umd/adaptor-generate.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -4140,6 +4140,24 @@
});
return Adaptor.adaptor(props);
};
/**
* 判断是否是生产环境
* @type {Boolean}
*/

var isProduction = function isProduction() {
var result = false;

return result;
};

var warningMsg = function warningMsg(msg) {
if (isProduction()) {
console.error(msg);
} else {
throw new Error(msg);
}
};

var DemoItem =
/*#__PURE__*/
Expand All @@ -4162,13 +4180,13 @@
var element = dom.firstElementChild;

if (!element.hasAttribute('data-fusioncool')) {
throw new Error("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [data-XXX]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
warningMsg("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [data-XXX]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
} else if (element.style.direction !== 'ltr') {
throw new Error("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [style]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
warningMsg("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [style]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
element.style.direction = '';
}
} else {
throw new Error("[ERROR]: ".concat(adaptor.name, " DOM \u8282\u70B9\u4E0D\u80FD\u4F7F\u7528 Portal\u6302\u8F7D\u5230\u5176\u4ED6\u5730\u65B9\u5965"));
warningMsg("[ERROR]: ".concat(adaptor.name, " DOM \u8282\u70B9\u4E0D\u80FD\u4F7F\u7528 Portal\u6302\u8F7D\u5230\u5176\u4ED6\u5730\u65B9\u5965"));
}
}
}, {
Expand Down
24 changes: 21 additions & 3 deletions umd/adaptor-generate.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,24 @@ var renderAdaptor = function renderAdaptor(Adaptor) {
});
return Adaptor.adaptor(props);
};
/**
* 判断是否是生产环境
* @type {Boolean}
*/

var isProduction = function isProduction() {
var result = false;

return result;
};

var warningMsg = function warningMsg(msg) {
if (isProduction()) {
console.error(msg);
} else {
throw new Error(msg);
}
};

var DemoItem =
/*#__PURE__*/
Expand All @@ -275,13 +293,13 @@ function (_Component) {
var element = dom.firstElementChild;

if (!element.hasAttribute('data-fusioncool')) {
throw new Error("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [data-XXX]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
warningMsg("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [data-XXX]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
} else if (element.style.direction !== 'ltr') {
throw new Error("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [style]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
warningMsg("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [style]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
element.style.direction = '';
}
} else {
throw new Error("[ERROR]: ".concat(adaptor.name, " DOM \u8282\u70B9\u4E0D\u80FD\u4F7F\u7528 Portal\u6302\u8F7D\u5230\u5176\u4ED6\u5730\u65B9\u5965"));
warningMsg("[ERROR]: ".concat(adaptor.name, " DOM \u8282\u70B9\u4E0D\u80FD\u4F7F\u7528 Portal\u6302\u8F7D\u5230\u5176\u4ED6\u5730\u65B9\u5965"));
}
}
}, {
Expand Down
24 changes: 21 additions & 3 deletions umd/adaptor-generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,24 @@ var renderAdaptor = function renderAdaptor(Adaptor) {
});
return Adaptor.adaptor(props);
};
/**
* 判断是否是生产环境
* @type {Boolean}
*/

var isProduction = function isProduction() {
var result = false;

return result;
};

var warningMsg = function warningMsg(msg) {
if (isProduction()) {
console.error(msg);
} else {
throw new Error(msg);
}
};

var DemoItem =
/*#__PURE__*/
Expand All @@ -281,13 +299,13 @@ function (_Component) {
var element = dom.firstElementChild;

if (!element.hasAttribute('data-fusioncool')) {
throw new Error("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [data-XXX]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
warningMsg("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [data-XXX]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
} else if (element.style.direction !== 'ltr') {
throw new Error("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [style]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
warningMsg("[ERROR]: ".concat(adaptor.name, " \u9700\u8981\u652F\u6301\u900F\u4F20\u5C5E\u6027 [style]\uFF0C\u5426\u5219 Fusion Cool \u65E0\u6CD5\u6B63\u5E38\u6E32\u67D3"));
element.style.direction = '';
}
} else {
throw new Error("[ERROR]: ".concat(adaptor.name, " DOM \u8282\u70B9\u4E0D\u80FD\u4F7F\u7528 Portal\u6302\u8F7D\u5230\u5176\u4ED6\u5730\u65B9\u5965"));
warningMsg("[ERROR]: ".concat(adaptor.name, " DOM \u8282\u70B9\u4E0D\u80FD\u4F7F\u7528 Portal\u6302\u8F7D\u5230\u5176\u4ED6\u5730\u65B9\u5965"));
}
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion umd/adaptor-generate.production.min.js

Large diffs are not rendered by default.

0 comments on commit 15d6668

Please sign in to comment.