@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.
@@ -36,8 +36,9 @@ const stylelintCLI = `stylelint --fix ${
36
36
  ',',
37
37
  )}`;
38
38
 
39
- module.exports = {
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;
@@ -36,8 +36,9 @@ const stylelintCLI = `stylelint --fix ${
36
36
  ',',
37
37
  )}`;
38
38
 
39
- module.exports = {
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.135",
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": "6e12c4022bbfc2a15ec66a286b2f0a9e037fad37"
54
+ "gitHead": "0053ea65af8b398c4f765c8003b1cbf0b887737d"
54
55
  }
@@ -1,5 +1,4 @@
1
1
  import { Form, FormItem, Input, useForm } from '@baic/yolk-miniprogram';
2
- import * as React from 'react';
3
2
  export default () => {
4
3
  const [form] = useForm();
5
4
  return (
@@ -1,3 +1,2 @@
1
- import * as React from 'react';
2
1
  import { MobileInput } from '@baic/yolk-miniprogram';
3
2
  export default () => <MobileInput />;
@@ -1,3 +1,2 @@
1
- import * as React from 'react';
2
1
  import { MoneyInput } from '@baic/yolk-miniprogram';
3
2
  export default () => <MoneyInput />;
@@ -1,3 +1,2 @@
1
- import * as React from 'react';
2
1
  import { NumberInput } from '@baic/yolk-miniprogram';
3
2
  export default () => <NumberInput />;
@@ -1,5 +1,3 @@
1
- import * as React from 'react';
2
-
3
1
  import { Form, FormItem, Textarea, useForm } from '@baic/yolk-miniprogram';
4
2
 
5
3
  export default () => {
@@ -1,3 +1,2 @@
1
- import * as React from 'react';
2
1
  import { TimerButton } from '@baic/yolk-miniprogram';
3
2
  export default () => <TimerButton>验证码</TimerButton>;
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { View } from '@tarojs/components';
3
2
  import { Util } from '@baic/yolk';
4
3
  import { usePreload } from '@baic/yolk-miniprogram';
@@ -1,4 +1,5 @@
1
- import * as React from 'react';
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, React.FunctionComponent> = {
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] = React.useState(0);
25
- const onClickHandler = React.useCallback((i: number) => setCurrent(i), []);
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
- {React.createElement(tab)}
39
+ {createElement(tab)}
39
40
  </AtTabsPane>
40
41
  );
41
42
  })}
@@ -1,5 +1,3 @@
1
- import * as React from 'react';
2
-
3
1
  import { View } from '@tarojs/components';
4
2
 
5
3
  import style from './style.scss';
@@ -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,3 @@
1
- import * as React from 'react';
2
1
  import { Result } from 'antd-mobile';
3
2
 
4
3
  export default () => (
@@ -1,4 +1,5 @@
1
- import * as React from 'react';
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
- React.FunctionComponent | Record<string, React.FunctionComponent>
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
- {React.createElement(tab)}
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
- {React.createElement(tab2)}
75
+ {createElement(tab2)}
75
76
  </Panel>
76
77
  );
77
78
  })}
@@ -1,3 +1 @@
1
- import * as React from 'react';
2
-
3
1
  export default () => <div>Hello world</div>;
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { Result } from 'antd-mobile';
3
2
 
4
3
  export default () => (
@@ -1,4 +1,5 @@
1
- import * as React from 'react';
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
- React.FunctionComponent | Record<string, React.FunctionComponent>
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
- {React.createElement(tab)}
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
- {React.createElement(tab2)}
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 * as React from 'react';
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
- React.FunctionComponent | Record<string, React.FunctionComponent>
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
- {React.createElement(tab)}
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
- {React.createElement(tab2)}
125
+ {createElement(tab2)}
125
126
  </TabPane>
126
127
  );
127
128
  })}
@@ -1,3 +1 @@
1
- import * as React from 'react';
2
-
3
1
  export default () => <div>Hello world</div>;