Skip to content

Commit

Permalink
add mobile, fix bug v1
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyuchi_cd committed Jun 19, 2020
1 parent 329e4f2 commit eddafc5
Show file tree
Hide file tree
Showing 11 changed files with 16,675 additions and 106 deletions.
16 changes: 15 additions & 1 deletion lib/generators/kry-mobile/templates/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"extends": "eslint-config-umi",
"parser": "@typescript-eslint/parser",
"extends": [
"eslint-config-umi",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"eslint:recommended",
"plugin:react/recommended",
"plugin:import/recommended"
],
"plugins": ["@typescript-eslint", "typescript", "react", "react-hooks", "import", "jsx-a11y", "jsdoc"],
"rules": {
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/no-angle-bracket-type-assertion": "off",
"@typescript-eslint/no-triple-slash-reference": 0,
"@typescript-eslint/prefer-interface": 0,
"@typescript-eslint/no-object-literal-type-assertion": 0,
"no-angle-bracket-type-assertion": false
},
"globals": {
Expand Down
4 changes: 4 additions & 0 deletions lib/generators/kry-mobile/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
"@types/react": "^16.7.18",
"@types/react-dom": "^16.0.11",
"@types/react-test-renderer": "^16.0.3",
"@typescript-eslint/eslint-plugin": "^3.3.0",
<% } -%>
"babel-eslint": "^9.0.0",
"better-npm-run": "^0.1.1",
Expand All @@ -168,6 +169,9 @@
"eslint-plugin-flowtype": "^2.50.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
<% if (isTypeScript) { -%>
"eslint-plugin-typescript": "^0.14.0",
<% } -%>
"eslint-plugin-react": "^7.11.1",
"husky": "^0.14.3",
"lint-staged": "^7.2.2",
Expand Down
13 changes: 2 additions & 11 deletions lib/generators/kry-mobile/templates/src/pages/demo/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { connect } from 'dva';
import { Card, Alert } from 'antd';
import { Card } from 'antd';
import { FormattedMessage } from 'umi-plugin-react/locale';

const CodePreview = ({ children }) => (
Expand All @@ -23,16 +23,7 @@ class Demo extends Component {
return (
<div>
<Card>
<Alert
message="umi ui 现已发布,欢迎使用 npm run ui 启动体验demo。"
type="success"
showIcon={true}
banner={true}
style={{
margin: -12,
marginBottom: 24,
}}
/>
<p>umi ui 现已发布,欢迎使用 npm run ui 启动体验demo。</p>
<div strong={true}>
<a target="_blank" rel="noopener noreferrer" href="https://pro.ant.design/docs/block">
<FormattedMessage
Expand Down
17 changes: 4 additions & 13 deletions lib/generators/kry-mobile/templates/src/pages/demo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { connect } from 'dva';
import { Card, Alert, WhiteSpace } from 'antd-mobile';
import { Card } from 'antd-mobile';
import { FormattedMessage } from 'umi-plugin-react/locale';

export interface Loading {
Expand Down Expand Up @@ -33,18 +33,9 @@ class Demo extends Component {
render() {
const { loading }: any = this.props;
return (
<WhiteSpace>
<div>
<Card>
<Alert
message="umi ui 现已发布,欢迎使用 npm run ui 启动体验demo。"
type="success"
showIcon={true}
banner={true}
style={{
margin: -12,
marginBottom: 24,
}}
/>
<p>umi ui 现已发布,欢迎使用 npm run ui 启动体验demo。</p>
<div strong={true}>
<a target="_blank" rel="noopener noreferrer" href="https://pro.ant.design/docs/block">
<FormattedMessage
Expand Down Expand Up @@ -77,7 +68,7 @@ class Demo extends Component {
</a>
</p>
</WhiteSpace>
</div>
);
}
};
Expand Down
4 changes: 2 additions & 2 deletions lib/generators/kry-mobile/templates/src/utils/JSBridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const getOrgInfo = () => {
}
};
const generateKey = function() {
var code = 65;
var offset = 26;
const code = 65;
const offset = 26;
return (
"CB_" +
"xxxxxxxxxxx".replace(/x/gi, function() {
Expand Down
4 changes: 2 additions & 2 deletions lib/generators/kry-mobile/templates/src/utils/JSBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const getOrgInfo = () => {
}
};
const generateKey = function() {
var code = 65;
var offset = 26;
const code = 65;
const offset = 26;
return (
"CB_" +
"xxxxxxxxxxx".replace(/x/gi, function() {
Expand Down
38 changes: 0 additions & 38 deletions lib/generators/kry-mobile/templates/tslint.yml

This file was deleted.

Loading

0 comments on commit eddafc5

Please sign in to comment.