@baic/yolk-cli 2.1.0-alpha.135 → 2.1.0-alpha.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/.lintstagedrc.js +4 -1
- package/lib/.lintstagedrc.js +4 -1
- package/package.json +3 -2
- package/templates/miniprogram/src/pages/demo/examples/Input.tsx +0 -1
- package/templates/miniprogram/src/pages/demo/examples/MobileInput.tsx +0 -1
- package/templates/miniprogram/src/pages/demo/examples/MoneyInput.tsx +0 -1
- package/templates/miniprogram/src/pages/demo/examples/NumberInput.tsx +0 -1
- package/templates/miniprogram/src/pages/demo/examples/Textarea.tsx +0 -2
- package/templates/miniprogram/src/pages/demo/examples/TimerButton.tsx +0 -1
- package/templates/miniprogram/src/pages/demo/examples/usePreload.tsx +0 -1
- package/templates/miniprogram/src/pages/demo/index.tsx +6 -5
- package/templates/miniprogram/src/pages/index/index.tsx +0 -2
- package/templates/miniprogram/tsconfig.json +9 -1
- package/templates/umi-mobile-h5+app/src/pages/404.tsx +0 -1
- package/templates/umi-mobile-h5+app/src/pages/demo/index.tsx +5 -4
- package/templates/umi-mobile-h5+app/src/pages/index.tsx +0 -2
- package/templates/umi-mobile-native/src/pages/404.tsx +0 -1
- package/templates/umi-mobile-native/src/pages/demo/index.tsx +5 -4
- package/templates/umi-web/src/pages/demo/index.tsx +5 -4
- package/templates/umi-web-screen/src/pages/index.tsx +0 -2
package/es/.lintstagedrc.js
CHANGED
|
@@ -36,8 +36,9 @@ const stylelintCLI = `stylelint --fix ${
|
|
|
36
36
|
',',
|
|
37
37
|
)}`;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
const config = {
|
|
40
40
|
'*.{md,json}': [prettierCLI],
|
|
41
|
+
// '*.{png,jpeg,jpg,gif,svg}': ['imagemin-lint-staged'],
|
|
41
42
|
'*.css': [prettierCLI, `${stylelintCLI} --custom-syntax postcss`],
|
|
42
43
|
'*.less': [prettierCLI, `${stylelintCLI} --custom-syntax postcss-less`],
|
|
43
44
|
'*.{sass,scss}': [
|
|
@@ -47,3 +48,5 @@ module.exports = {
|
|
|
47
48
|
'*.{js,jsx}': [prettierCLI, eslintCLI],
|
|
48
49
|
'*.{ts,tsx}': [`${prettierCLI} --parser=typescript`, eslintCLI],
|
|
49
50
|
};
|
|
51
|
+
|
|
52
|
+
module.exports = config;
|
package/lib/.lintstagedrc.js
CHANGED
|
@@ -36,8 +36,9 @@ const stylelintCLI = `stylelint --fix ${
|
|
|
36
36
|
',',
|
|
37
37
|
)}`;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
const config = {
|
|
40
40
|
'*.{md,json}': [prettierCLI],
|
|
41
|
+
// '*.{png,jpeg,jpg,gif,svg}': ['imagemin-lint-staged'],
|
|
41
42
|
'*.css': [prettierCLI, `${stylelintCLI} --custom-syntax postcss`],
|
|
42
43
|
'*.less': [prettierCLI, `${stylelintCLI} --custom-syntax postcss-less`],
|
|
43
44
|
'*.{sass,scss}': [
|
|
@@ -47,3 +48,5 @@ module.exports = {
|
|
|
47
48
|
'*.{js,jsx}': [prettierCLI, eslintCLI],
|
|
48
49
|
'*.{ts,tsx}': [`${prettierCLI} --parser=typescript`, eslintCLI],
|
|
49
50
|
};
|
|
51
|
+
|
|
52
|
+
module.exports = config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baic/yolk-cli",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.136",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/303394539/yolk.git"
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@babel/runtime": "~7.x",
|
|
29
|
+
"@democrance/imagemin-lint-staged": "~2.3.x",
|
|
29
30
|
"@types/inquirer": "~8.x",
|
|
30
31
|
"@types/lint-staged": "~13.2.x",
|
|
31
32
|
"@types/lodash": "~4.x",
|
|
@@ -50,5 +51,5 @@
|
|
|
50
51
|
"publishConfig": {
|
|
51
52
|
"access": "public"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "0053ea65af8b398c4f765c8003b1cbf0b887737d"
|
|
54
55
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import { createElement, useCallback, useState } from 'react';
|
|
2
3
|
|
|
3
4
|
import { AtTabs, AtTabsPane } from 'taro-ui';
|
|
4
5
|
|
|
@@ -10,7 +11,7 @@ import MoneyInput from './examples/MoneyInput';
|
|
|
10
11
|
import Textarea from './examples/Textarea';
|
|
11
12
|
import TimerButton from './examples/TimerButton';
|
|
12
13
|
|
|
13
|
-
const tabs: Record<string,
|
|
14
|
+
const tabs: Record<string, FunctionComponent> = {
|
|
14
15
|
usePrload,
|
|
15
16
|
Input,
|
|
16
17
|
NumberInput,
|
|
@@ -21,8 +22,8 @@ const tabs: Record<string, React.FunctionComponent> = {
|
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export default () => {
|
|
24
|
-
const [current, setCurrent] =
|
|
25
|
-
const onClickHandler =
|
|
25
|
+
const [current, setCurrent] = useState(0);
|
|
26
|
+
const onClickHandler = useCallback((i: number) => setCurrent(i), []);
|
|
26
27
|
const keys = Object.keys(tabs);
|
|
27
28
|
return (
|
|
28
29
|
<AtTabs
|
|
@@ -35,7 +36,7 @@ export default () => {
|
|
|
35
36
|
const tab = tabs[key];
|
|
36
37
|
return (
|
|
37
38
|
<AtTabsPane current={current} index={index}>
|
|
38
|
-
{
|
|
39
|
+
{createElement(tab)}
|
|
39
40
|
</AtTabsPane>
|
|
40
41
|
);
|
|
41
42
|
})}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "@baic/yolk-taro/tsconfig.json"
|
|
2
|
+
"extends": "@baic/yolk-taro/lib/tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"typeRoots": ["node_modules/@types", "global.d.ts"],
|
|
6
|
+
"paths": {
|
|
7
|
+
"@/*": ["src/*"]
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"exclude": ["node_modules", "dist"]
|
|
3
11
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import { createElement } from 'react';
|
|
2
3
|
|
|
3
4
|
import { isFunction, isObject } from 'lodash';
|
|
4
5
|
|
|
@@ -27,7 +28,7 @@ const { Panel } = Collapse;
|
|
|
27
28
|
|
|
28
29
|
const tabs: Record<
|
|
29
30
|
string,
|
|
30
|
-
|
|
31
|
+
FunctionComponent | Record<string, FunctionComponent>
|
|
31
32
|
> = {
|
|
32
33
|
BarCode,
|
|
33
34
|
Iconfont,
|
|
@@ -58,7 +59,7 @@ export default () => {
|
|
|
58
59
|
if (isFunction(tab)) {
|
|
59
60
|
return (
|
|
60
61
|
<Tab key={key} title={key}>
|
|
61
|
-
{
|
|
62
|
+
{createElement(tab)}
|
|
62
63
|
</Tab>
|
|
63
64
|
);
|
|
64
65
|
}
|
|
@@ -71,7 +72,7 @@ export default () => {
|
|
|
71
72
|
const tab2 = tab[key2];
|
|
72
73
|
return (
|
|
73
74
|
<Panel key={key2} title={key2}>
|
|
74
|
-
{
|
|
75
|
+
{createElement(tab2)}
|
|
75
76
|
</Panel>
|
|
76
77
|
);
|
|
77
78
|
})}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import { createElement } from 'react';
|
|
2
3
|
|
|
3
4
|
import { isFunction, isObject } from 'lodash';
|
|
4
5
|
|
|
@@ -28,7 +29,7 @@ const { Panel } = Collapse;
|
|
|
28
29
|
|
|
29
30
|
const tabs: Record<
|
|
30
31
|
string,
|
|
31
|
-
|
|
32
|
+
FunctionComponent | Record<string, FunctionComponent>
|
|
32
33
|
> = {
|
|
33
34
|
BarCode,
|
|
34
35
|
Iconfont,
|
|
@@ -60,7 +61,7 @@ export default () => {
|
|
|
60
61
|
if (isFunction(tab)) {
|
|
61
62
|
return (
|
|
62
63
|
<Tab key={key} title={key}>
|
|
63
|
-
{
|
|
64
|
+
{createElement(tab)}
|
|
64
65
|
</Tab>
|
|
65
66
|
);
|
|
66
67
|
}
|
|
@@ -73,7 +74,7 @@ export default () => {
|
|
|
73
74
|
const tab2 = tab[key2];
|
|
74
75
|
return (
|
|
75
76
|
<Panel key={key2} title={key2}>
|
|
76
|
-
{
|
|
77
|
+
{createElement(tab2)}
|
|
77
78
|
</Panel>
|
|
78
79
|
);
|
|
79
80
|
})}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isFunction, isObject } from 'lodash';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import type { FunctionComponent } from 'react';
|
|
4
|
+
import { createElement } from 'react';
|
|
4
5
|
|
|
5
6
|
import { Tabs } from 'antd';
|
|
6
7
|
|
|
@@ -46,7 +47,7 @@ const { TabPane } = Tabs;
|
|
|
46
47
|
|
|
47
48
|
const tabs: Record<
|
|
48
49
|
string,
|
|
49
|
-
|
|
50
|
+
FunctionComponent | Record<string, FunctionComponent>
|
|
50
51
|
> = {
|
|
51
52
|
BankInput,
|
|
52
53
|
BarCode,
|
|
@@ -108,7 +109,7 @@ export default () => {
|
|
|
108
109
|
if (isFunction(tab)) {
|
|
109
110
|
return (
|
|
110
111
|
<TabPane key={key} tab={key}>
|
|
111
|
-
{
|
|
112
|
+
{createElement(tab)}
|
|
112
113
|
</TabPane>
|
|
113
114
|
);
|
|
114
115
|
}
|
|
@@ -121,7 +122,7 @@ export default () => {
|
|
|
121
122
|
const tab2 = tab[key2];
|
|
122
123
|
return (
|
|
123
124
|
<TabPane key={key2} tab={key2}>
|
|
124
|
-
{
|
|
125
|
+
{createElement(tab2)}
|
|
125
126
|
</TabPane>
|
|
126
127
|
);
|
|
127
128
|
})}
|