Skip to content

Commit

Permalink
released v7.1.2 (kkt)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Feb 23, 2022
1 parent d7f446a commit 5f9106a
Show file tree
Hide file tree
Showing 30 changed files with 186 additions and 115 deletions.
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kkt",
"version": "7.1.1",
"version": "7.1.2",
"description": "Create React apps with no build configuration, Cli tool for creating react apps.",
"author": "Kenny Wong <wowohoo@qq.com> (https://github.com/jaywcjlove)",
"main": "lib/index.js",
Expand Down
2 changes: 1 addition & 1 deletion example/basic-entry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"react-dom": "17.0.2"
},
"devDependencies": {
"kkt": "7.1.1"
"kkt": "7.1.2"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion example/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"web-vitals": "^2.1.2"
},
"devDependencies": {
"kkt": "7.1.1"
"kkt": "7.1.2"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion example/bundle-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@types/hapi__hapi": "20.0.10"
},
"devDependencies": {
"@kkt/ncc": "1.0.0"
"@kkt/ncc": "1.0.1"
},
"eslintConfig": {
"extends": [
Expand Down
15 changes: 5 additions & 10 deletions example/bundle/.kktrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import reactLibrary from '@kkt/react-library';
import lessModules from '@kkt/less-modules';
import pkg from './package.json';

export default (conf, env, options) => {
conf = lessModules(conf, env, options);
conf = reactLibrary(conf, env, {
...options,
...pkg,
// webpack externals options
dependencies: {
if (options.bundle) {
conf.externals = {
react: {
root: 'React',
commonjs2: 'react',
Expand All @@ -21,8 +16,8 @@ export default (conf, env, options) => {
commonjs: 'react-dom',
amd: 'react-dom',
},
'react-refresh': '0',
},
});
};
}
console.log('conf:', env, conf);
return conf;
};
10 changes: 5 additions & 5 deletions example/bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"description": "",
"private": true,
"scripts": {
"start": "kkt start",
"start": "FAST_REFRESH=false kkt start",
"build": "kkt build",
"released": "npm run bundle && npm run bundle:min",
"bundle": "kkt build --bundle",
"bundle:min": "GENERATE_SOURCEMAP=false kkt build --bundle --mini"
"bundle": "ncc build src/components/button/index.jsx --target web --library Button",
"bundle:min": "ncc build src/components/button/index.jsx --target web --library Button -m"
},
"repository": {
"type": "git",
Expand All @@ -24,8 +24,8 @@
},
"devDependencies": {
"@kkt/less-modules": "7.1.1",
"@kkt/react-library": "7.1.1",
"kkt": "7.1.1"
"@kkt/ncc": "1.0.1",
"kkt": "7.1.2"
},
"eslintConfig": {
"extends": [
Expand Down
33 changes: 33 additions & 0 deletions example/bundle/public/umd.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://unpkg.com/@babel/standalone@7.17.5/babel.min.js" crossorigin></script>
<script src="https://unpkg.com/react@16.x/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@16.x/umd/react-dom.development.js" crossorigin></script>
<script src="../dist/index.js"></script>
<link href="../dist/index.css" rel="stylesheet" />
<title>Demo</title>
</head>
<body>
<div id="container" style="padding: 24px"></div>
<script type="text/babel">
const Demo = () => {
const ButtonCom = Button.default;
return (
<div>
<ButtonCom type="primary">主要按钮</ButtonCom>
<ButtonCom type="success">成功按钮</ButtonCom>
<ButtonCom type="warning">警告按钮</ButtonCom>
<ButtonCom type="danger">错误按钮</ButtonCom>
<ButtonCom type="light">亮按钮</ButtonCom>
<ButtonCom type="dark">暗按钮</ButtonCom>
</div>
);
}
ReactDOM.render(<Demo />, document.getElementById("container"));
</script>
</body>
</html>
File renamed without changes.
70 changes: 0 additions & 70 deletions example/bundle/src/components/button/index.js

This file was deleted.

109 changes: 109 additions & 0 deletions example/bundle/src/components/button/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import React from 'react';
import './style/index.less';
import './style/btn.less';

export default function Button(props) {
const {
prefixCls = 'w-btn',
type = 'light',
size = 'default',
active = false,
disabled = false,
block = false,
basic = false,
className,
loading = false,
children,
htmlType = 'button',
...others
} = props;

const cls = [
className,
prefixCls,
size ? `${prefixCls}-${size}` : false,
type ? `${prefixCls}-${type}` : false,
basic ? `${prefixCls}-basic` : false,
loading ? `${prefixCls}-loading` : false,
disabled || loading ? 'disabled' : false,
active ? 'active' : false,
block ? 'block' : false,
]
.filter(Boolean)
.join(' ');
return (
<button {...others} disabled={disabled || loading} type={htmlType} className={cls}>
{children &&
React.Children.map(children, (child) => {
if (React.isValidElement(child)) return child;
return <span> {child} </span>;
})}
</button>
);
}

Button.defaultProps = {
prefixCls: 'w-btn',
disabled: false,
active: false,
loading: false,
block: false,
basic: false,
htmlType: 'button',
type: 'light',
size: 'default',
};
// Button.propTypes = {
// prefixCls: PropTypes.string,
// loading: PropTypes.bool,
// disabled: PropTypes.bool,
// block: PropTypes.bool,
// active: PropTypes.bool,
// basic: PropTypes.bool,
// htmlType: PropTypes.string,
// type: PropTypes.oneOf(['primary', 'success', 'warning', 'danger', 'light', 'dark', 'link']),
// size: PropTypes.oneOf(['large', 'default', 'small']),
// };

// export default class Button extends React.Component {
// render() {
// const {
// prefixCls,
// type,
// size,
// active,
// disabled,
// block,
// basic,
// intent,
// className,
// loading,
// children,
// htmlType,
// ...others
// } = this.props;

// const cls = [
// className,
// prefixCls,
// size ? `${prefixCls}-${size}` : false,
// type ? `${prefixCls}-${type}` : false,
// basic ? `${prefixCls}-basic` : false,
// loading ? `${prefixCls}-loading` : false,
// disabled || loading ? 'disabled' : false,
// active ? 'active' : false,
// block ? 'block' : false,
// ]
// .filter(Boolean)
// .join(' ');
// return (
// <button {...others} disabled={disabled || loading} type={htmlType} className={cls}>
// {children &&
// React.Children.map(children, (child) => {
// if (React.isValidElement(child)) return child;
// return <span> {child} </span>;
// })}
// </button>
// );
// }
// }
6 changes: 0 additions & 6 deletions example/bundle/src/index.js

This file was deleted.

7 changes: 7 additions & 0 deletions example/bundle/src/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
// import App from './app/App';
import './index.css';

ReactDOM.render(<div>test app</div>, document.getElementById('root'));
// ReactDOM.render(<App />, document.getElementById('root'));
2 changes: 1 addition & 1 deletion example/chrome-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"devDependencies": {
"clean-webpack-plugin": "4.0.0",
"filemanager-webpack-plugin": "6.1.7",
"kkt": "7.1.1"
"kkt": "7.1.2"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion example/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@types/react": "17.0.38",
"@types/react-dom": "17.0.11",
"electron": "16.0.6",
"kkt": "7.1.1",
"kkt": "7.1.2",
"tsbb": "3.5.4"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion example/less/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@kkt/less-modules": "7.1.1",
"kkt": "7.1.1"
"kkt": "7.1.2"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion example/markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"devDependencies": {
"@kkt/less-modules": "7.1.1",
"@kkt/raw-modules": "7.1.1",
"kkt": "7.1.1"
"kkt": "7.1.2"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion example/react-component-tsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@types/react-test-renderer": "17.0.1",
"compile-less-cli": "1.8.11",
"husky": "7.0.4",
"kkt": "7.1.1",
"kkt": "7.1.2",
"lint-staged": "12.3.3",
"prettier": "2.5.1",
"react-test-renderer": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion example/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@kkt/less-modules": "7.1.1",
"kkt": "7.1.1"
"kkt": "7.1.2"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion example/rematch-tsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/react": "17.0.38",
"@types/react-dom": "17.0.11",
"@types/react-redux": "7.1.21",
"kkt": "7.1.1"
"kkt": "7.1.2"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion example/scss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"react-dom": "17.0.2"
},
"devDependencies": {
"kkt": "7.1.1"
"kkt": "7.1.2"
},
"browserslist": {
"production": [
Expand Down

0 comments on commit 5f9106a

Please sign in to comment.