@baic/yolk-cli 2.0.1-alpha.1 → 2.0.1-alpha.10

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.
Files changed (163) hide show
  1. package/{templates/web/base/LICENSE → LICENSE} +1 -1
  2. package/README.md +6 -6
  3. package/{bin → lib}/index.d.ts +0 -0
  4. package/lib/index.js +2 -0
  5. package/package.json +22 -21
  6. package/templates/{miniapp/base/.editorconfig.tpl → miniprogram/.editorconfig} +0 -0
  7. package/templates/miniprogram/.eslintrc +6 -0
  8. package/templates/{miniapp/base/.prettierignore.tpl → miniprogram/.prettierignore} +0 -0
  9. package/templates/{miniapp/base/.prettierrc.tpl → miniprogram/.prettierrc} +0 -0
  10. package/templates/{miniapp/base → miniprogram}/.stylelintrc.json +1 -1
  11. package/templates/{miniapp/base → miniprogram}/LICENSE +0 -0
  12. package/templates/{mobile/base → miniprogram}/README.md.tpl +5 -1
  13. package/templates/miniprogram/babel.config.js +3 -0
  14. package/templates/miniprogram/config/index.ts.tpl +11 -0
  15. package/templates/miniprogram/global.d.ts +33 -0
  16. package/templates/{miniapp/base → miniprogram}/package.json.tpl +2 -3
  17. package/templates/{miniapp/base → miniprogram}/project.config.json.tpl +18 -3
  18. package/templates/{miniapp/base → miniprogram}/project.tt.json.tpl +0 -0
  19. package/templates/{miniapp/base → miniprogram}/src/app.config.ts +1 -3
  20. package/templates/{miniapp/base → miniprogram}/src/app.scss +0 -0
  21. package/templates/miniprogram/src/app.tsx +19 -0
  22. package/templates/{miniapp/base → miniprogram}/src/common/request.ts +1 -1
  23. package/templates/{web/base → miniprogram}/src/common/util.ts +1 -1
  24. package/templates/{miniapp/base → miniprogram}/src/components/index.ts +0 -0
  25. package/templates/miniprogram/src/constants.ts +1 -0
  26. package/templates/{miniapp/base → miniprogram}/src/hooks/index.ts +0 -0
  27. package/templates/{miniapp/base → miniprogram}/src/images/empty.gif +0 -0
  28. package/templates/{miniapp/base → miniprogram}/src/index.html +0 -0
  29. package/templates/miniprogram/src/pages/demo/examples/Input.tsx +3 -0
  30. package/templates/miniprogram/src/pages/demo/examples/MobileInput.tsx +3 -0
  31. package/templates/miniprogram/src/pages/demo/examples/MoneyInput.tsx +3 -0
  32. package/templates/miniprogram/src/pages/demo/examples/NumberInput.tsx +3 -0
  33. package/templates/miniprogram/src/pages/demo/examples/Textarea.tsx +3 -0
  34. package/templates/miniprogram/src/pages/demo/examples/TimerButton.tsx +3 -0
  35. package/templates/miniprogram/src/pages/demo/examples/usePreload.tsx +10 -0
  36. package/templates/miniprogram/src/pages/demo/index.config.ts +5 -0
  37. package/templates/{miniapp/base/src/pages/index → miniprogram/src/pages/demo}/index.module.scss +0 -0
  38. package/templates/miniprogram/src/pages/demo/index.tsx +44 -0
  39. package/templates/{miniapp/base → miniprogram}/src/pages/index/index.config.ts +0 -0
  40. package/templates/miniprogram/src/pages/index/index.module.scss +3 -0
  41. package/templates/{miniapp/base → miniprogram}/src/pages/index/index.tsx +1 -3
  42. package/templates/miniprogram/src/theme.scss +4 -0
  43. package/templates/{miniapp/base → miniprogram}/src/types/user.d.ts +0 -0
  44. package/templates/{miniapp/base → miniprogram}/tsconfig.json +3 -9
  45. package/templates/mobile/{base/.editorconfig.tpl → .editorconfig} +0 -0
  46. package/templates/mobile/{base/.eslintrc.tpl → .eslintrc} +0 -0
  47. package/templates/mobile/{base/.prettierignore.tpl → .prettierignore} +0 -0
  48. package/templates/mobile/{base/.prettierrc.tpl → .prettierrc} +0 -0
  49. package/templates/mobile/{base/.stylelintrc.json → .stylelintrc.json} +1 -1
  50. package/templates/mobile/{base/.umirc.ts.tpl → .umirc.ts.tpl} +1 -1
  51. package/templates/mobile/{base/LICENSE → LICENSE} +0 -0
  52. package/templates/{miniapp/base → mobile}/README.md.tpl +6 -2
  53. package/templates/{web/base → mobile}/package.json.tpl +2 -3
  54. package/templates/mobile/{base/public → public}/favicon.ico +0 -0
  55. package/templates/mobile/src/app.tsx +24 -0
  56. package/templates/mobile/src/common/request.ts +3 -0
  57. package/templates/{miniapp/base → mobile}/src/common/util.ts +1 -1
  58. package/templates/mobile/{base/src → src}/components/index.ts +0 -0
  59. package/templates/mobile/{base/src → src}/global.less +1 -1
  60. package/templates/mobile/src/layouts/index.tsx +4 -0
  61. package/templates/mobile/src/pages/404.tsx +10 -0
  62. package/templates/mobile/src/pages/demo/examples/BarCode.tsx +4 -0
  63. package/templates/mobile/src/pages/demo/examples/Iconfont.tsx +18 -0
  64. package/templates/mobile/src/pages/demo/examples/Loading.tsx +12 -0
  65. package/templates/mobile/src/pages/demo/examples/QrCode.tsx +4 -0
  66. package/templates/mobile/src/pages/demo/examples/Required.tsx +4 -0
  67. package/templates/mobile/src/pages/demo/examples/TimerButton.tsx +4 -0
  68. package/templates/mobile/src/pages/demo/examples/usePreload.tsx +9 -0
  69. package/templates/mobile/src/pages/demo/index.tsx +39 -0
  70. package/templates/mobile/src/pages/index.tsx +3 -0
  71. package/templates/mobile/{base/src → src}/types/user.d.ts +1 -1
  72. package/templates/{web/base → mobile}/tsconfig.json +2 -2
  73. package/templates/mobile/typings.d.ts +16 -0
  74. package/templates/web/{base/.editorconfig.tpl → .editorconfig} +0 -0
  75. package/templates/web/{base/.eslintrc.tpl → .eslintrc} +0 -0
  76. package/templates/web/{base/.prettierignore.tpl → .prettierignore} +0 -0
  77. package/templates/web/{base/.prettierrc.tpl → .prettierrc} +0 -0
  78. package/templates/web/{base/.stylelintrc.json → .stylelintrc.json} +1 -1
  79. package/templates/web/.umirc.ts +6 -0
  80. package/templates/web/LICENSE +21 -0
  81. package/templates/web/{base/README.md.tpl → README.md.tpl} +6 -2
  82. package/templates/{mobile/base → web}/package.json.tpl +2 -3
  83. package/templates/web/{base/public → public}/favicon.ico +0 -0
  84. package/templates/web/src/app.tsx +25 -0
  85. package/templates/web/src/common/request.ts +3 -0
  86. package/templates/{mobile/base → web}/src/common/util.ts +1 -1
  87. package/templates/web/{base/src → src}/components/index.ts +0 -0
  88. package/templates/web/{base/src → src}/global.less +1 -1
  89. package/templates/web/src/layouts/index.tsx +4 -0
  90. package/templates/web/{base/src → src}/pages/404.tsx +0 -0
  91. package/templates/web/src/pages/demo/examples/BankInput.tsx +14 -0
  92. package/templates/web/src/pages/demo/examples/BarCode.tsx +4 -0
  93. package/templates/web/src/pages/demo/examples/Collapse.tsx +4 -0
  94. package/templates/web/src/pages/demo/examples/DatePicker.tsx +4 -0
  95. package/templates/web/src/pages/demo/examples/Flex.tsx +10 -0
  96. package/templates/web/src/pages/demo/examples/Grid/1.tsx +25 -0
  97. package/templates/web/src/pages/demo/examples/Grid/2.tsx +26 -0
  98. package/templates/web/src/pages/demo/examples/Grid/3.tsx +37 -0
  99. package/templates/web/src/pages/demo/examples/Grid/4.tsx +44 -0
  100. package/templates/web/src/pages/demo/examples/Grid/5.tsx +37 -0
  101. package/templates/web/src/pages/demo/examples/Grid/6.tsx +28 -0
  102. package/templates/web/src/pages/demo/examples/Iconfont.tsx +18 -0
  103. package/templates/web/src/pages/demo/examples/ImagePreview.tsx +20 -0
  104. package/templates/web/src/pages/demo/examples/Input/1.tsx +4 -0
  105. package/templates/web/src/pages/demo/examples/Input/2.tsx +80 -0
  106. package/templates/web/src/pages/demo/examples/LinkButton/1.tsx +4 -0
  107. package/templates/web/src/pages/demo/examples/LinkButton/2.tsx +9 -0
  108. package/templates/web/src/pages/demo/examples/LinkButton/3.tsx +12 -0
  109. package/templates/web/src/pages/demo/examples/Loading.tsx +12 -0
  110. package/templates/web/src/pages/demo/examples/MobileInput.tsx +4 -0
  111. package/templates/web/src/pages/demo/examples/NumberInput.tsx +4 -0
  112. package/templates/web/src/pages/demo/examples/QrCode.tsx +4 -0
  113. package/templates/web/src/pages/demo/examples/RangeNumber/1.tsx +4 -0
  114. package/templates/web/src/pages/demo/examples/RangeNumber/2.tsx +16 -0
  115. package/templates/web/src/pages/demo/examples/Required.tsx +4 -0
  116. package/templates/web/src/pages/demo/examples/SearchLayout.tsx +46 -0
  117. package/templates/web/src/pages/demo/examples/Table/1.tsx +64 -0
  118. package/templates/web/src/pages/demo/examples/Table/2.tsx +29 -0
  119. package/templates/web/src/pages/demo/examples/Table/3.tsx +39 -0
  120. package/templates/web/src/pages/demo/examples/Table/4.tsx +42 -0
  121. package/templates/web/src/pages/demo/examples/TimerButton.tsx +4 -0
  122. package/templates/web/src/pages/demo/examples/Title/1.tsx +4 -0
  123. package/templates/web/src/pages/demo/examples/Title/2.tsx +5 -0
  124. package/templates/web/src/pages/demo/examples/WaterMark.tsx +8 -0
  125. package/templates/web/src/pages/demo/examples/Wrapper.tsx +40 -0
  126. package/templates/web/src/pages/demo/examples/usePreload.tsx +9 -0
  127. package/templates/web/src/pages/demo/index.tsx +133 -0
  128. package/templates/web/src/pages/index.tsx +3 -0
  129. package/templates/web/{base/src → src}/types/user.d.ts +1 -1
  130. package/templates/{mobile/base → web}/tsconfig.json +2 -2
  131. package/templates/web/typings.d.ts +16 -0
  132. package/bin/index.js +0 -2
  133. package/templates/miniapp/base/.eslintrc.js.tpl +0 -6
  134. package/templates/miniapp/base/.gitignore.tpl +0 -38
  135. package/templates/miniapp/base/babel.config.js +0 -3
  136. package/templates/miniapp/base/config/index.ts.tpl +0 -8
  137. package/templates/miniapp/base/global.d.ts +0 -18
  138. package/templates/miniapp/base/src/app.tsx +0 -26
  139. package/templates/miniapp/base/src/constants.ts +0 -1
  140. package/templates/miniapp/base/src/store/index.ts +0 -34
  141. package/templates/miniapp/base/src/theme.scss +0 -4
  142. package/templates/mobile/base/.gitignore.tpl +0 -33
  143. package/templates/mobile/base/__tests__/__snapshots__/pages.test.tsx.snap +0 -88
  144. package/templates/mobile/base/__tests__/pages.test.tsx +0 -11
  145. package/templates/mobile/base/src/app.tsx +0 -27
  146. package/templates/mobile/base/src/common/request.ts +0 -3
  147. package/templates/mobile/base/src/layouts/index.less +0 -103
  148. package/templates/mobile/base/src/layouts/index.tsx +0 -48
  149. package/templates/mobile/base/src/pages/404.tsx +0 -12
  150. package/templates/mobile/base/src/pages/index.tsx +0 -3
  151. package/templates/mobile/base/src/store/index.ts +0 -17
  152. package/templates/mobile/base/typings.d.ts +0 -8
  153. package/templates/web/base/.gitignore.tpl +0 -33
  154. package/templates/web/base/.umirc.ts.tpl +0 -6
  155. package/templates/web/base/__tests__/__snapshots__/pages.test.tsx.snap +0 -112
  156. package/templates/web/base/__tests__/pages.test.tsx +0 -11
  157. package/templates/web/base/src/app.tsx +0 -36
  158. package/templates/web/base/src/common/request.ts +0 -3
  159. package/templates/web/base/src/layouts/index.less +0 -11
  160. package/templates/web/base/src/layouts/index.tsx +0 -94
  161. package/templates/web/base/src/pages/index.tsx +0 -3
  162. package/templates/web/base/src/store/index.ts +0 -17
  163. package/templates/web/base/typings.d.ts +0 -8
@@ -1,112 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`pages Demo 1`] = `
4
- Object {
5
- "asFragment": [Function],
6
- "baseElement": <body>
7
- <div>
8
- <div
9
- style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; display: flex; align-items: center; justify-content: center; padding: 10px;"
10
- >
11
- <div
12
- class="ant-spin ant-spin-spinning"
13
- >
14
- <span
15
- class="ant-spin-dot ant-spin-dot-spin"
16
- >
17
- <i
18
- class="ant-spin-dot-item"
19
- />
20
- <i
21
- class="ant-spin-dot-item"
22
- />
23
- <i
24
- class="ant-spin-dot-item"
25
- />
26
- <i
27
- class="ant-spin-dot-item"
28
- />
29
- </span>
30
- </div>
31
- </div>
32
- </div>
33
- </body>,
34
- "container": <div>
35
- <div
36
- style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; display: flex; align-items: center; justify-content: center; padding: 10px;"
37
- >
38
- <div
39
- class="ant-spin ant-spin-spinning"
40
- >
41
- <span
42
- class="ant-spin-dot ant-spin-dot-spin"
43
- >
44
- <i
45
- class="ant-spin-dot-item"
46
- />
47
- <i
48
- class="ant-spin-dot-item"
49
- />
50
- <i
51
- class="ant-spin-dot-item"
52
- />
53
- <i
54
- class="ant-spin-dot-item"
55
- />
56
- </span>
57
- </div>
58
- </div>
59
- </div>,
60
- "debug": [Function],
61
- "findAllByAltText": [Function],
62
- "findAllByDisplayValue": [Function],
63
- "findAllByLabelText": [Function],
64
- "findAllByPlaceholderText": [Function],
65
- "findAllByRole": [Function],
66
- "findAllByTestId": [Function],
67
- "findAllByText": [Function],
68
- "findAllByTitle": [Function],
69
- "findByAltText": [Function],
70
- "findByDisplayValue": [Function],
71
- "findByLabelText": [Function],
72
- "findByPlaceholderText": [Function],
73
- "findByRole": [Function],
74
- "findByTestId": [Function],
75
- "findByText": [Function],
76
- "findByTitle": [Function],
77
- "getAllByAltText": [Function],
78
- "getAllByDisplayValue": [Function],
79
- "getAllByLabelText": [Function],
80
- "getAllByPlaceholderText": [Function],
81
- "getAllByRole": [Function],
82
- "getAllByTestId": [Function],
83
- "getAllByText": [Function],
84
- "getAllByTitle": [Function],
85
- "getByAltText": [Function],
86
- "getByDisplayValue": [Function],
87
- "getByLabelText": [Function],
88
- "getByPlaceholderText": [Function],
89
- "getByRole": [Function],
90
- "getByTestId": [Function],
91
- "getByText": [Function],
92
- "getByTitle": [Function],
93
- "queryAllByAltText": [Function],
94
- "queryAllByDisplayValue": [Function],
95
- "queryAllByLabelText": [Function],
96
- "queryAllByPlaceholderText": [Function],
97
- "queryAllByRole": [Function],
98
- "queryAllByTestId": [Function],
99
- "queryAllByText": [Function],
100
- "queryAllByTitle": [Function],
101
- "queryByAltText": [Function],
102
- "queryByDisplayValue": [Function],
103
- "queryByLabelText": [Function],
104
- "queryByPlaceholderText": [Function],
105
- "queryByRole": [Function],
106
- "queryByTestId": [Function],
107
- "queryByText": [Function],
108
- "queryByTitle": [Function],
109
- "rerender": [Function],
110
- "unmount": [Function],
111
- }
112
- `;
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { render } from '@testing-library/react';
3
-
4
- import Index from '../src/pages/index';
5
-
6
- describe('pages', () => {
7
- it('Demo', async () => {
8
- const wrapper = render(<Index />);
9
- expect(wrapper).toMatchSnapshot();
10
- });
11
- });
@@ -1,36 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { Provider } from '@baic/yolk';
4
-
5
- import { Provider as WebProvider } from '@baic/yolk-web';
6
-
7
- import { Provider as WebUIProvider } from '@baic/yolk-web-ui';
8
-
9
- import { Provider as ReactReduxProvider } from 'react-redux';
10
-
11
- import request from '@/common/request';
12
-
13
- import store from './store';
14
-
15
- import '@baic/yolk-web-ui/lib/style/index.less';
16
-
17
- export function rootContainer(container: React.ReactNode) {
18
- return (
19
- <Provider request={request}
20
- >
21
- <ReactReduxProvider store={store}>
22
- <WebProvider>
23
- <WebUIProvider
24
- inputMaxLength={40}
25
- iconfontScriptUrl={[
26
- '//at.alicdn.com/t/font_1788044_0dwu4guekcwr.js',
27
- '//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js',
28
- ]}
29
- >
30
- {container}
31
- </WebUIProvider>
32
- </WebProvider>
33
- </ReactReduxProvider>
34
- </Provider>
35
- );
36
- }
@@ -1,3 +0,0 @@
1
- import { Request } from '@baic/yolk';
2
-
3
- export default new Request();
@@ -1,11 +0,0 @@
1
- #components-layout-demo-top-side-2 .logo {
2
- float: left;
3
- width: 120px;
4
- height: 31px;
5
- margin: 16px 28px 16px 0;
6
- background: rgba(255, 255, 255, 0.2);
7
- }
8
-
9
- .site-layout-background {
10
- background: #fff;
11
- }
@@ -1,94 +0,0 @@
1
- import * as React from 'react';
2
- import { IRouteComponentProps } from 'umi';
3
-
4
- import { Layout, Menu, Breadcrumb } from 'antd';
5
- import {
6
- UserOutlined,
7
- LaptopOutlined,
8
- NotificationOutlined,
9
- } from '@ant-design/icons';
10
-
11
- import style from './index.less';
12
-
13
- const { SubMenu } = Menu;
14
- const { Header, Content, Sider } = Layout;
15
-
16
- export default ({
17
- children,
18
- location,
19
- route,
20
- history,
21
- match,
22
- }: IRouteComponentProps) => {
23
- console.log(
24
- {
25
- children,
26
- location,
27
- route,
28
- history,
29
- match,
30
- },
31
- );
32
- return (
33
- <Layout>
34
- <Header className="header">
35
- <div className="logo" />
36
- <Menu theme="dark" mode="horizontal" defaultSelectedKeys={['2']}>
37
- <Menu.Item key="1">nav 1</Menu.Item>
38
- <Menu.Item key="2">nav 2</Menu.Item>
39
- <Menu.Item key="3">nav 3</Menu.Item>
40
- </Menu>
41
- </Header>
42
- <Layout>
43
- <Sider width={200} className={style.siteLayoutBackground}>
44
- <Menu
45
- mode="inline"
46
- defaultSelectedKeys={['1']}
47
- defaultOpenKeys={['sub1']}
48
- style={{ height: '100%', borderRight: 0 }}
49
- >
50
- <SubMenu key="sub1" icon={<UserOutlined />} title="subnav 1">
51
- <Menu.Item key="1">option1</Menu.Item>
52
- <Menu.Item key="2">option2</Menu.Item>
53
- <Menu.Item key="3">option3</Menu.Item>
54
- <Menu.Item key="4">option4</Menu.Item>
55
- </SubMenu>
56
- <SubMenu key="sub2" icon={<LaptopOutlined />} title="subnav 2">
57
- <Menu.Item key="5">option5</Menu.Item>
58
- <Menu.Item key="6">option6</Menu.Item>
59
- <Menu.Item key="7">option7</Menu.Item>
60
- <Menu.Item key="8">option8</Menu.Item>
61
- </SubMenu>
62
- <SubMenu
63
- key="sub3"
64
- icon={<NotificationOutlined />}
65
- title="subnav 3"
66
- >
67
- <Menu.Item key="9">option9</Menu.Item>
68
- <Menu.Item key="10">option10</Menu.Item>
69
- <Menu.Item key="11">option11</Menu.Item>
70
- <Menu.Item key="12">option12</Menu.Item>
71
- </SubMenu>
72
- </Menu>
73
- </Sider>
74
- <Layout style={{ padding: '0 24px 24px' }}>
75
- <Breadcrumb style={{ margin: '16px 0' }}>
76
- <Breadcrumb.Item>Home</Breadcrumb.Item>
77
- <Breadcrumb.Item>List</Breadcrumb.Item>
78
- <Breadcrumb.Item>App</Breadcrumb.Item>
79
- </Breadcrumb>
80
- <Content
81
- className="site-layout-background"
82
- style={{
83
- padding: 24,
84
- margin: 0,
85
- minHeight: 280,
86
- }}
87
- >
88
- {children}
89
- </Content>
90
- </Layout>
91
- </Layout>
92
- </Layout>
93
- );
94
- };
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
-
3
- export default () => <div>Hello world</div>;
@@ -1,17 +0,0 @@
1
- import { createStore, combineReducers, applyMiddleware } from 'redux';
2
-
3
- import thunk from 'redux-thunk';
4
- import { createLogger } from 'redux-logger';
5
-
6
- const filterLogerAction: string[] = [];
7
-
8
- const logger = createLogger({
9
- predicate: (_, action) =>
10
- action && !filterLogerAction.some((item) => item === action.type),
11
- });
12
- const middleware =
13
- process.env.NODE_ENV !== 'production' ? [thunk, logger] : [thunk];
14
-
15
- const store = createStore(combineReducers({}), applyMiddleware(...middleware));
16
-
17
- export default store;
@@ -1,8 +0,0 @@
1
- declare module '*.css';
2
- declare module '*.less';
3
- declare module "*.png";
4
- declare module '*.svg' {
5
- export function ReactComponent(props: React.SVGProps<SVGSVGElement>): React.ReactElement
6
- const url: string
7
- export default url
8
- }